File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change 27912791 (add-exports [pkg-jsons]
27922792 (reduce-kv
27932793 (fn [pkg-jsons path {:strs [exports] :as pkg-json}]
2794- (reduce-kv
2795- (fn [pkg-jsons export _]
2796- ; ; NOTE: ignore "." exports for now
2797- (if (= " ." export)
2798- pkg-jsons
2799- (let [export-pkg-json
2800- (io/file
2801- (trim-package-json path)
2802- (trim-relative export)
2803- " package.json" )]
2804- (cond-> pkg-jsons
2805- (.exists export-pkg-json)
2806- (assoc
2807- (.getAbsolutePath export-pkg-json)
2808- (json/read-str (slurp export-pkg-json)))))))
2809- pkg-jsons exports))
2794+ ; ; "exports" can just be a dupe of "main", i.e. a string - ignore
2795+ ; ; https://nodejs.org/api/packages.html#main-entry-point-export
2796+ (if (string? exports)
2797+ pkg-jsons
2798+ (reduce-kv
2799+ (fn [pkg-jsons export _]
2800+ ; ; NOTE: ignore "." exports for now
2801+ (if (= " ." export)
2802+ pkg-jsons
2803+ (let [export-pkg-json
2804+ (io/file
2805+ (trim-package-json path)
2806+ (trim-relative export)
2807+ " package.json" )]
2808+ (cond-> pkg-jsons
2809+ (.exists export-pkg-json)
2810+ (assoc
2811+ (.getAbsolutePath export-pkg-json)
2812+ (json/read-str (slurp export-pkg-json)))))))
2813+ pkg-jsons exports)))
28102814 pkg-jsons pkg-jsons))]
28112815 (let [
28122816 ; ; a map of all the *top-level* package.json paths and their exports
You can’t perform that action at this time.
0 commit comments