From 878a1d3d97fa0eb336723acc1cdf4f37f24f6177 Mon Sep 17 00:00:00 2001 From: mfedderly Date: Tue, 17 Mar 2020 17:59:35 -0400 Subject: [PATCH] Build Standardization (#1860) - Enforce some TS configurations that we already standardized - Standardize rollup builds to put artifacts under dist - Standardize test scripts with tape and tsc testing - Small bench/test fixes - Standardize packages/turf builds - Move turf-difference and turf-meta from index.mjs to index.js Co-authored-by: Matt Fedderly --- .monorepolint.config.ts | 74 ++++++++++++++++++- packages/turf-along/package.json | 3 +- packages/turf-angle/package.json | 3 +- packages/turf-area/package.json | 3 +- packages/turf-bbox-clip/package.json | 3 +- packages/turf-bbox-polygon/package.json | 3 +- packages/turf-bbox/package.json | 3 +- packages/turf-bearing/package.json | 3 +- packages/turf-bezier-spline/package.json | 3 +- packages/turf-boolean-clockwise/package.json | 3 +- packages/turf-boolean-concave/package.json | 3 +- packages/turf-boolean-contains/package.json | 3 +- packages/turf-boolean-crosses/package.json | 3 +- packages/turf-boolean-disjoint/package.json | 3 +- packages/turf-boolean-equal/package.json | 3 +- packages/turf-boolean-intersects/package.json | 3 +- packages/turf-boolean-overlap/package.json | 3 +- packages/turf-boolean-parallel/package.json | 3 +- .../package.json | 3 +- .../turf-boolean-point-on-line/package.json | 3 +- packages/turf-boolean-touches/package.json | 2 +- packages/turf-boolean-valid/package.json | 6 +- packages/turf-boolean-within/package.json | 2 +- packages/turf-buffer/bench.js | 2 +- packages/turf-buffer/package.json | 12 ++- packages/turf-buffer/test.js | 2 +- packages/turf-center-mean/package.json | 2 +- packages/turf-center-median/package.json | 3 +- packages/turf-center-of-mass/package.json | 2 +- packages/turf-center/package.json | 2 +- packages/turf-centroid/package.json | 2 +- packages/turf-circle/package.json | 2 +- packages/turf-clean-coords/package.json | 2 +- packages/turf-clone/package.json | 2 +- packages/turf-clusters-dbscan/package.json | 2 +- packages/turf-clusters-kmeans/package.json | 4 +- packages/turf-clusters/package.json | 2 +- packages/turf-collect/package.json | 3 +- packages/turf-combine/package.json | 3 +- packages/turf-concave/package.json | 3 +- packages/turf-convex/package.json | 3 +- packages/turf-destination/package.json | 3 +- packages/turf-difference/.gitignore | 1 - packages/turf-difference/bench.js | 2 +- .../turf-difference/{index.mjs => index.js} | 0 packages/turf-difference/package.json | 13 ++-- packages/turf-difference/test.js | 2 +- packages/turf-directional-mean/package.json | 3 +- packages/turf-dissolve/bench.js | 3 +- packages/turf-dissolve/package.json | 14 ++-- packages/turf-dissolve/test.js | 2 +- packages/turf-distance-weight/package.json | 3 +- packages/turf-distance/package.json | 3 +- packages/turf-ellipse/bench.js | 2 +- packages/turf-ellipse/package.json | 13 ++-- packages/turf-ellipse/test.js | 2 +- packages/turf-envelope/bench.js | 2 +- packages/turf-envelope/package.json | 13 ++-- packages/turf-envelope/test.js | 2 +- packages/turf-explode/bench.js | 2 +- packages/turf-explode/package.json | 13 ++-- packages/turf-explode/test.js | 2 +- packages/turf-flatten/bench.js | 2 +- packages/turf-flatten/package.json | 12 ++- packages/turf-flatten/test.js | 2 +- packages/turf-flip/bench.js | 2 +- packages/turf-flip/package.json | 12 ++- packages/turf-flip/test.js | 2 +- packages/turf-great-circle/bench.js | 2 +- packages/turf-great-circle/package.json | 13 ++-- packages/turf-great-circle/test.js | 2 +- packages/turf-helpers/package.json | 2 +- packages/turf-hex-grid/package.json | 2 +- packages/turf-interpolate/bench.js | 2 +- packages/turf-interpolate/package.json | 12 ++- packages/turf-interpolate/test.js | 2 +- packages/turf-intersect/package.json | 2 +- packages/turf-invariant/package.json | 2 +- packages/turf-isobands/bench.js | 2 +- packages/turf-isobands/package.json | 14 ++-- packages/turf-isobands/test.js | 2 +- packages/turf-isolines/bench.js | 2 +- packages/turf-isolines/package.json | 14 ++-- packages/turf-isolines/test.js | 2 +- packages/turf-kinks/package.json | 2 +- packages/turf-length/package.json | 3 +- packages/turf-line-arc/package.json | 2 +- packages/turf-line-chunk/bench.js | 2 +- packages/turf-line-chunk/package.json | 12 ++- packages/turf-line-chunk/test.js | 2 +- packages/turf-line-intersect/package.json | 3 +- packages/turf-line-offset/bench.js | 2 +- packages/turf-line-offset/package.json | 13 ++-- packages/turf-line-offset/test.js | 2 +- packages/turf-line-overlap/package.json | 2 +- packages/turf-line-segment/package.json | 3 +- packages/turf-line-slice-along/bench.js | 2 +- packages/turf-line-slice-along/package.json | 13 ++-- packages/turf-line-slice-along/test.js | 2 +- packages/turf-line-slice/bench.js | 2 +- packages/turf-line-slice/package.json | 13 ++-- packages/turf-line-slice/test.js | 2 +- packages/turf-line-split/bench.js | 2 +- packages/turf-line-split/package.json | 13 ++-- packages/turf-line-split/test.js | 2 +- packages/turf-line-to-polygon/package.json | 2 +- packages/turf-mask/bench.js | 2 +- packages/turf-mask/package.json | 12 ++- packages/turf-mask/test.js | 2 +- packages/turf-meta/.gitignore | 1 - packages/turf-meta/bench.js | 2 +- packages/turf-meta/{index.mjs => index.js} | 0 packages/turf-meta/package.json | 12 +-- packages/turf-meta/test.js | 2 +- packages/turf-midpoint/bench.js | 2 +- packages/turf-midpoint/package.json | 13 ++-- packages/turf-midpoint/test.js | 2 +- packages/turf-moran-index/package.json | 3 +- .../package.json | 3 +- .../turf-nearest-point-on-line/package.json | 2 +- .../turf-nearest-point-to-line/package.json | 2 +- packages/turf-nearest-point/package.json | 4 +- packages/turf-planepoint/bench.js | 2 +- packages/turf-planepoint/package.json | 12 ++- packages/turf-planepoint/test.js | 2 +- packages/turf-point-grid/package.json | 2 +- packages/turf-point-on-feature/bench.js | 2 +- packages/turf-point-on-feature/package.json | 13 ++-- packages/turf-point-on-feature/test.js | 2 +- .../turf-point-to-line-distance/package.json | 2 +- packages/turf-points-within-polygon/bench.js | 2 +- .../turf-points-within-polygon/package.json | 12 ++- packages/turf-points-within-polygon/test.js | 2 +- packages/turf-polygon-smooth/bench.js | 2 +- packages/turf-polygon-smooth/package.json | 12 ++- packages/turf-polygon-smooth/test.js | 2 +- packages/turf-polygon-tangents/bench.js | 2 +- packages/turf-polygon-tangents/package.json | 12 ++- packages/turf-polygon-tangents/test.js | 2 +- packages/turf-polygon-to-line/package.json | 3 +- packages/turf-polygonize/bench.js | 2 +- packages/turf-polygonize/package.json | 13 ++-- packages/turf-polygonize/test.js | 2 +- packages/turf-projection/package.json | 2 +- packages/turf-quadrat-analysis/package.json | 3 +- packages/turf-random/package.json | 3 +- packages/turf-rectangle-grid/package.json | 3 +- packages/turf-rewind/bench.js | 2 +- packages/turf-rewind/package.json | 12 ++- packages/turf-rewind/test.js | 2 +- packages/turf-rhumb-bearing/package.json | 3 +- packages/turf-rhumb-destination/package.json | 3 +- packages/turf-rhumb-distance/package.json | 3 +- packages/turf-sample/bench.js | 2 +- packages/turf-sample/package.json | 13 ++-- packages/turf-sample/test.js | 2 +- packages/turf-sector/bench.js | 2 +- packages/turf-sector/package.json | 12 ++- packages/turf-sector/test.js | 2 +- packages/turf-shortest-path/bench.js | 2 +- packages/turf-shortest-path/package.json | 13 ++-- packages/turf-shortest-path/test.js | 2 +- packages/turf-simplify/bench.js | 2 +- packages/turf-simplify/package.json | 13 ++-- packages/turf-simplify/test.js | 2 +- packages/turf-square-grid/package.json | 3 +- packages/turf-square/bench.js | 2 +- packages/turf-square/package.json | 13 ++-- packages/turf-square/test.js | 2 +- .../bench.js | 2 +- .../package.json | 12 ++- .../turf-standard-deviational-ellipse/test.js | 2 +- packages/turf-tag/bench.js | 2 +- packages/turf-tag/package.json | 13 ++-- packages/turf-tag/test.js | 2 +- packages/turf-tesselate/bench.js | 2 +- packages/turf-tesselate/package.json | 13 ++-- packages/turf-tesselate/test.js | 2 +- packages/turf-tin/package.json | 2 +- packages/turf-transform-rotate/bench.js | 2 +- packages/turf-transform-rotate/package.json | 12 ++- packages/turf-transform-rotate/test.js | 2 +- packages/turf-transform-scale/bench.js | 2 +- packages/turf-transform-scale/package.json | 12 ++- packages/turf-transform-scale/test.js | 2 +- packages/turf-transform-translate/bench.js | 2 +- .../turf-transform-translate/package.json | 12 ++- packages/turf-transform-translate/test.js | 2 +- packages/turf-triangle-grid/package.json | 2 +- packages/turf-truncate/package.json | 2 +- packages/turf-union/package.json | 2 +- packages/turf-unkink-polygon/bench.js | 2 +- packages/turf-unkink-polygon/package.json | 13 ++-- packages/turf-unkink-polygon/test.js | 2 +- packages/turf-voronoi/bench.js | 2 +- packages/turf-voronoi/package.json | 13 ++-- packages/turf-voronoi/test.js | 2 +- packages/turf/.gitignore | 9 --- packages/turf/package.json | 16 ++-- packages/turf/rollup.config.js | 4 +- packages/turf/test.js | 6 +- rollup.config.js | 4 +- 202 files changed, 505 insertions(+), 470 deletions(-) delete mode 100644 packages/turf-difference/.gitignore rename packages/turf-difference/{index.mjs => index.js} (100%) delete mode 100644 packages/turf-meta/.gitignore rename packages/turf-meta/{index.mjs => index.js} (100%) diff --git a/.monorepolint.config.ts b/.monorepolint.config.ts index a6cb6c392f..c519804f3f 100644 --- a/.monorepolint.config.ts +++ b/.monorepolint.config.ts @@ -32,6 +32,78 @@ glob.sync(path.join(__dirname, "packages", "turf-*")).forEach(pk => { module.exports = { rules: { - ":alphabetical-scripts": {} + ":alphabetical-scripts": {}, + + ":package-entry": [ + { + options: { + entries: { + main: "dist/js/index.js", + types: "dist/js/index.d.ts", + files: ["dist"] + } + }, + includePackages: TS_PACKAGES + }, + { + options: { + entries: { + main: "dist/js/index.js", + module: "dist/es/index.js", + types: "index.d.ts", + files: ["dist", "index.d.ts"] + } + }, + includePackages: JS_PACKAGES + } + ], + + ":package-script": [ + { + options: { + scripts: { + bench: "npm-run-all prepare bench:run", + "bench:run": "node bench.js", + docs: "node ../../scripts/generate-readmes", + prepare: "tsc", + pretest: "tsc" + } + }, + includePackages: TS_PACKAGES + }, + { + options: { + scripts: { + pretest: "rollup -c ../../rollup.config.js", + posttest: "node -r esm ../../scripts/validate-es5-dependencies.js" + } + }, + includePackages: JS_PACKAGES + }, + { + options: { + scripts: { + "test:tape": "node -r esm test.js" + } + }, + includePackages: TAPE_PACKAGES + }, + { + options: { + scripts: { + "test:types": "tsc --noEmit types.ts" + } + }, + includePackages: TYPES_PACKAGES + }, + { + options: { + scripts: { + test: "npm-run-all test:*" + } + }, + excludePackages: [MAIN_PACKAGE] + } + ] } }; diff --git a/packages/turf-along/package.json b/packages/turf-along/package.json index c4fd027d64..7f0a1a5beb 100644 --- a/packages/turf-along/package.json +++ b/packages/turf-along/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-angle/package.json b/packages/turf-angle/package.json index 61c3b7de6f..582956e1ad 100644 --- a/packages/turf-angle/package.json +++ b/packages/turf-angle/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-area/package.json b/packages/turf-area/package.json index 49cd73cc1f..88089e9715 100644 --- a/packages/turf-area/package.json +++ b/packages/turf-area/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-bbox-clip/package.json b/packages/turf-bbox-clip/package.json index 6bd766e49d..45b92ef52f 100644 --- a/packages/turf-bbox-clip/package.json +++ b/packages/turf-bbox-clip/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-bbox-polygon/package.json b/packages/turf-bbox-polygon/package.json index 3ffc3f5203..c81ae49c78 100644 --- a/packages/turf-bbox-polygon/package.json +++ b/packages/turf-bbox-polygon/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-bbox/package.json b/packages/turf-bbox/package.json index 7abe83c769..a36285c52d 100644 --- a/packages/turf-bbox/package.json +++ b/packages/turf-bbox/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-bearing/package.json b/packages/turf-bearing/package.json index cb70f260e8..a9af353522 100644 --- a/packages/turf-bearing/package.json +++ b/packages/turf-bearing/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-bezier-spline/package.json b/packages/turf-bezier-spline/package.json index 3ae2a2a0e2..458d1c5833 100644 --- a/packages/turf-bezier-spline/package.json +++ b/packages/turf-bezier-spline/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-clockwise/package.json b/packages/turf-boolean-clockwise/package.json index 25cef46ef1..8b6d200d66 100755 --- a/packages/turf-boolean-clockwise/package.json +++ b/packages/turf-boolean-clockwise/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-concave/package.json b/packages/turf-boolean-concave/package.json index d91cf0c5b9..a885238d9c 100644 --- a/packages/turf-boolean-concave/package.json +++ b/packages/turf-boolean-concave/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-contains/package.json b/packages/turf-boolean-contains/package.json index 60c733e780..ce0c386ff6 100644 --- a/packages/turf-boolean-contains/package.json +++ b/packages/turf-boolean-contains/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-crosses/package.json b/packages/turf-boolean-crosses/package.json index a93b7d952d..3190de490e 100644 --- a/packages/turf-boolean-crosses/package.json +++ b/packages/turf-boolean-crosses/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-disjoint/package.json b/packages/turf-boolean-disjoint/package.json index fa99df0cdd..c61b4720d6 100644 --- a/packages/turf-boolean-disjoint/package.json +++ b/packages/turf-boolean-disjoint/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-equal/package.json b/packages/turf-boolean-equal/package.json index 44ebce6ae4..788f861904 100644 --- a/packages/turf-boolean-equal/package.json +++ b/packages/turf-boolean-equal/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-intersects/package.json b/packages/turf-boolean-intersects/package.json index 10b5395c33..499ebd56f0 100644 --- a/packages/turf-boolean-intersects/package.json +++ b/packages/turf-boolean-intersects/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-overlap/package.json b/packages/turf-boolean-overlap/package.json index da6b58417d..b1e911e859 100755 --- a/packages/turf-boolean-overlap/package.json +++ b/packages/turf-boolean-overlap/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-parallel/package.json b/packages/turf-boolean-parallel/package.json index 34f0085007..e28debf97d 100644 --- a/packages/turf-boolean-parallel/package.json +++ b/packages/turf-boolean-parallel/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-point-in-polygon/package.json b/packages/turf-boolean-point-in-polygon/package.json index a93e1d808c..227d0db684 100644 --- a/packages/turf-boolean-point-in-polygon/package.json +++ b/packages/turf-boolean-point-in-polygon/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-point-on-line/package.json b/packages/turf-boolean-point-on-line/package.json index b58a25ace0..4d2716e7ff 100644 --- a/packages/turf-boolean-point-on-line/package.json +++ b/packages/turf-boolean-point-on-line/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-touches/package.json b/packages/turf-boolean-touches/package.json index 01a99365f4..ade3b1a0bc 100644 --- a/packages/turf-boolean-touches/package.json +++ b/packages/turf-boolean-touches/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-boolean-valid/package.json b/packages/turf-boolean-valid/package.json index b4f3cfa35f..da9ab96869 100644 --- a/packages/turf-boolean-valid/package.json +++ b/packages/turf-boolean-valid/package.json @@ -5,8 +5,7 @@ "main": "dist/js/index.js", "types": "dist/js/index.d.ts", "files": [ - "dist/js/index.js", - "dist/js/index.d.ts" + "dist" ], "scripts": { "bench": "npm-run-all prepare bench:run", @@ -14,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-boolean-within/package.json b/packages/turf-boolean-within/package.json index d9dd0e5f54..12cda37391 100644 --- a/packages/turf-boolean-within/package.json +++ b/packages/turf-boolean-within/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-buffer/bench.js b/packages/turf-buffer/bench.js index 60d83fe757..5c69ed13f8 100644 --- a/packages/turf-buffer/bench.js +++ b/packages/turf-buffer/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import buffer from './'; +import buffer from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-buffer/package.json b/packages/turf-buffer/package.json index 36ce0e9a5e..e52ba803bd 100644 --- a/packages/turf-buffer/package.json +++ b/packages/turf-buffer/package.json @@ -2,21 +2,19 @@ "name": "@turf/buffer", "version": "5.1.5", "description": "turf buffer module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-buffer/test.js b/packages/turf-buffer/test.js index eff9485eef..be2edfb720 100644 --- a/packages/turf-buffer/test.js +++ b/packages/turf-buffer/test.js @@ -6,7 +6,7 @@ import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureEach } from '@turf/meta'; import { featureCollection, point, polygon, geometryCollection } from '@turf/helpers'; -import buffer from '.'; +import buffer from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-center-mean/package.json b/packages/turf-center-mean/package.json index 541a0d1710..6ffa2f1379 100644 --- a/packages/turf-center-mean/package.json +++ b/packages/turf-center-mean/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-center-median/package.json b/packages/turf-center-median/package.json index f1fe6cdbda..b23452953a 100644 --- a/packages/turf-center-median/package.json +++ b/packages/turf-center-median/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-center-of-mass/package.json b/packages/turf-center-of-mass/package.json index 5dca85132c..08a0dbafe7 100644 --- a/packages/turf-center-of-mass/package.json +++ b/packages/turf-center-of-mass/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-center/package.json b/packages/turf-center/package.json index 43412234e5..d3b926be5e 100644 --- a/packages/turf-center/package.json +++ b/packages/turf-center/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-centroid/package.json b/packages/turf-centroid/package.json index 2f26a01229..da09974a99 100644 --- a/packages/turf-centroid/package.json +++ b/packages/turf-centroid/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-circle/package.json b/packages/turf-circle/package.json index fa00388cc7..f6bead06f4 100644 --- a/packages/turf-circle/package.json +++ b/packages/turf-circle/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-clean-coords/package.json b/packages/turf-clean-coords/package.json index 30eba09d11..c5dcf30d1e 100644 --- a/packages/turf-clean-coords/package.json +++ b/packages/turf-clean-coords/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-clone/package.json b/packages/turf-clone/package.json index 1b7a2045b1..6dfbf92928 100644 --- a/packages/turf-clone/package.json +++ b/packages/turf-clone/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-clusters-dbscan/package.json b/packages/turf-clusters-dbscan/package.json index a2f23614c5..8c7faf029e 100644 --- a/packages/turf-clusters-dbscan/package.json +++ b/packages/turf-clusters-dbscan/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-clusters-kmeans/package.json b/packages/turf-clusters-kmeans/package.json index 48c911a481..cd8c48925a 100644 --- a/packages/turf-clusters-kmeans/package.json +++ b/packages/turf-clusters-kmeans/package.json @@ -13,7 +13,9 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js", + "test:types": "tsc --noEmit types.ts" }, "repository": { "type": "git", diff --git a/packages/turf-clusters/package.json b/packages/turf-clusters/package.json index ad82372643..16e0b4a9b2 100644 --- a/packages/turf-clusters/package.json +++ b/packages/turf-clusters/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-collect/package.json b/packages/turf-collect/package.json index 29eaa42784..48cd02a4d0 100644 --- a/packages/turf-collect/package.json +++ b/packages/turf-collect/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-combine/package.json b/packages/turf-combine/package.json index 6c7e38958f..5a1ac35421 100644 --- a/packages/turf-combine/package.json +++ b/packages/turf-combine/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-concave/package.json b/packages/turf-concave/package.json index 3301764e2f..4f4cb3be26 100644 --- a/packages/turf-concave/package.json +++ b/packages/turf-concave/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-convex/package.json b/packages/turf-convex/package.json index bb3316af5e..2a420b2c39 100644 --- a/packages/turf-convex/package.json +++ b/packages/turf-convex/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-destination/package.json b/packages/turf-destination/package.json index 338c3cd54d..3e4d1ad578 100644 --- a/packages/turf-destination/package.json +++ b/packages/turf-destination/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-difference/.gitignore b/packages/turf-difference/.gitignore deleted file mode 100644 index 945ce43a90..0000000000 --- a/packages/turf-difference/.gitignore +++ /dev/null @@ -1 +0,0 @@ -index.js \ No newline at end of file diff --git a/packages/turf-difference/bench.js b/packages/turf-difference/bench.js index 337d96767d..9da8c188ab 100644 --- a/packages/turf-difference/bench.js +++ b/packages/turf-difference/bench.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const load = require('load-json-file'); const Benchmark = require('benchmark'); -const difference = require('./'); +const difference = require('./dist/js/index.js'); const directory = path.join(__dirname, 'test', 'in') + path.sep; let fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-difference/index.mjs b/packages/turf-difference/index.js similarity index 100% rename from packages/turf-difference/index.mjs rename to packages/turf-difference/index.js diff --git a/packages/turf-difference/package.json b/packages/turf-difference/package.json index 3e63372f06..c9de2da1af 100644 --- a/packages/turf-difference/package.json +++ b/packages/turf-difference/package.json @@ -2,19 +2,20 @@ "name": "@turf/difference", "version": "6.0.0", "description": "turf difference module", - "main": "index", - "module": "index.mjs", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.mjs", + "dist", "index.d.ts" ], "scripts": { "bench": "node bench.js", "docs": "node ../../scripts/generate-readmes", - "pretest": "rollup -f cjs -o index.js index.mjs", - "test": "node test.js" + "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", + "pretest": "rollup -c ../../rollup.config.js", + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-difference/test.js b/packages/turf-difference/test.js index 1f7640c624..653c031aea 100644 --- a/packages/turf-difference/test.js +++ b/packages/turf-difference/test.js @@ -4,7 +4,7 @@ const glob = require('glob'); const load = require('load-json-file'); const write = require('write-json-file'); const { featureCollection, polygon } = require('@turf/helpers'); -const difference = require('./'); +const difference = require('./dist/js/index.js'); const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-directional-mean/package.json b/packages/turf-directional-mean/package.json index 633d23dc7b..0431ab277e 100644 --- a/packages/turf-directional-mean/package.json +++ b/packages/turf-directional-mean/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-dissolve/bench.js b/packages/turf-dissolve/bench.js index 71a672b3e8..d733a6d318 100644 --- a/packages/turf-dissolve/bench.js +++ b/packages/turf-dissolve/bench.js @@ -1,7 +1,8 @@ +import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import dissolve from '.'; +import dissolve from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-dissolve/package.json b/packages/turf-dissolve/package.json index 0e283a182c..e10038ce03 100644 --- a/packages/turf-dissolve/package.json +++ b/packages/turf-dissolve/package.json @@ -2,22 +2,20 @@ "name": "@turf/dissolve", "version": "5.1.5", "description": "turf dissolve module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-dissolve/test.js b/packages/turf-dissolve/test.js index 6550431a9a..d5bdbc9baa 100644 --- a/packages/turf-dissolve/test.js +++ b/packages/turf-dissolve/test.js @@ -4,7 +4,7 @@ import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; import {polygon, point, featureCollection} from '@turf/helpers'; -import dissolve from './'; +import dissolve from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-distance-weight/package.json b/packages/turf-distance-weight/package.json index b933c999ce..286d361213 100644 --- a/packages/turf-distance-weight/package.json +++ b/packages/turf-distance-weight/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-distance/package.json b/packages/turf-distance/package.json index 5527b6e229..d313bb26d5 100644 --- a/packages/turf-distance/package.json +++ b/packages/turf-distance/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-ellipse/bench.js b/packages/turf-ellipse/bench.js index 888b4ad633..bdb2e329d9 100644 --- a/packages/turf-ellipse/bench.js +++ b/packages/turf-ellipse/bench.js @@ -1,5 +1,5 @@ import Benchmark from 'benchmark'; -import ellipse from '.'; +import ellipse from './dist/js/index.js'; /** * Benchmark Results diff --git a/packages/turf-ellipse/package.json b/packages/turf-ellipse/package.json index 98ebc7b3cb..8e3cadc649 100644 --- a/packages/turf-ellipse/package.json +++ b/packages/turf-ellipse/package.json @@ -2,21 +2,20 @@ "name": "@turf/ellipse", "version": "5.1.5", "description": "turf ellipse module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-ellipse/test.js b/packages/turf-ellipse/test.js index 7c3827dcb4..0ad2b1e30a 100644 --- a/packages/turf-ellipse/test.js +++ b/packages/turf-ellipse/test.js @@ -10,7 +10,7 @@ import bboxPolygon from '@turf/bbox-polygon'; import rhumbDestination from '@turf/rhumb-destination'; // import destination from '@turf/destination'; import { featureCollection } from '@turf/helpers'; -import ellipse from '.'; +import ellipse from './dist/js/index.js'; test('turf-ellipse', t => { glob.sync(path.join(__dirname, 'test', 'in', '*.json')).forEach(filepath => { diff --git a/packages/turf-envelope/bench.js b/packages/turf-envelope/bench.js index b2ae399679..07a0fbeef1 100644 --- a/packages/turf-envelope/bench.js +++ b/packages/turf-envelope/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import envelope from './'; +import envelope from './dist/js/index.js'; const fixture = load.sync(path.join(__dirname, 'test', 'in', 'feature-collection.geojson')); diff --git a/packages/turf-envelope/package.json b/packages/turf-envelope/package.json index bd68e8f353..a259bd8555 100644 --- a/packages/turf-envelope/package.json +++ b/packages/turf-envelope/package.json @@ -2,21 +2,20 @@ "name": "@turf/envelope", "version": "5.1.5", "description": "turf envelope module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-envelope/test.js b/packages/turf-envelope/test.js index f8135197fd..f0af2b2c88 100644 --- a/packages/turf-envelope/test.js +++ b/packages/turf-envelope/test.js @@ -1,7 +1,7 @@ import path from 'path'; import test from 'tape'; import load from 'load-json-file'; -import envelope from '.'; +import envelope from './dist/js/index.js'; // Fixtures const fc = load.sync(path.join(__dirname, 'test', 'in', 'feature-collection.geojson')); diff --git a/packages/turf-explode/bench.js b/packages/turf-explode/bench.js index 382d81695c..a2168fd874 100644 --- a/packages/turf-explode/bench.js +++ b/packages/turf-explode/bench.js @@ -1,6 +1,6 @@ import Benchmark from 'benchmark'; import { polygon } from '@turf/helpers'; -import explode from './'; +import explode from './dist/js/index.js'; var poly = polygon([[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]); diff --git a/packages/turf-explode/package.json b/packages/turf-explode/package.json index 9c6d33b1b2..3359f88b5c 100644 --- a/packages/turf-explode/package.json +++ b/packages/turf-explode/package.json @@ -2,21 +2,20 @@ "name": "@turf/explode", "version": "5.1.5", "description": "turf explode module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-explode/test.js b/packages/turf-explode/test.js index bbf1621e0f..e1bf77ecc7 100644 --- a/packages/turf-explode/test.js +++ b/packages/turf-explode/test.js @@ -4,7 +4,7 @@ import tape from 'tape'; import { all as fixtures } from 'geojson-fixtures'; import load from 'load-json-file'; import write from 'write-json-file'; -import explode from '.'; +import explode from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-flatten/bench.js b/packages/turf-flatten/bench.js index 5dc1b067cd..1e18b8f44f 100644 --- a/packages/turf-flatten/bench.js +++ b/packages/turf-flatten/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import flatten from './'; +import flatten from './dist/js/index.js'; // Define fixtures const directory = path.join(__dirname, 'test', 'in') + path.sep; diff --git a/packages/turf-flatten/package.json b/packages/turf-flatten/package.json index d3f3b25909..a50f42a15a 100644 --- a/packages/turf-flatten/package.json +++ b/packages/turf-flatten/package.json @@ -2,21 +2,19 @@ "name": "@turf/flatten", "version": "5.1.5", "description": "turf flatten module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-flatten/test.js b/packages/turf-flatten/test.js index 46d0eb066d..208b118378 100644 --- a/packages/turf-flatten/test.js +++ b/packages/turf-flatten/test.js @@ -3,7 +3,7 @@ import test from 'tape'; import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; -import flatten from '.'; +import flatten from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-flip/bench.js b/packages/turf-flip/bench.js index fce116d581..f4f944a964 100644 --- a/packages/turf-flip/bench.js +++ b/packages/turf-flip/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import flip from './'; +import flip from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-flip/package.json b/packages/turf-flip/package.json index bca24e34e2..e78f4c483f 100644 --- a/packages/turf-flip/package.json +++ b/packages/turf-flip/package.json @@ -2,21 +2,19 @@ "name": "@turf/flip", "version": "5.1.5", "description": "turf flip module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-flip/test.js b/packages/turf-flip/test.js index e16bd6c5a2..dd307cc94b 100644 --- a/packages/turf-flip/test.js +++ b/packages/turf-flip/test.js @@ -4,7 +4,7 @@ import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; import { point } from '@turf/helpers'; -import flip from '.'; +import flip from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-great-circle/bench.js b/packages/turf-great-circle/bench.js index 1a3eb03061..ff9c70e540 100644 --- a/packages/turf-great-circle/bench.js +++ b/packages/turf-great-circle/bench.js @@ -1,6 +1,6 @@ import Benchmark from 'benchmark'; import { point } from '@turf/helpers'; -import greatCircle from './'; +import greatCircle from './dist/js/index.js'; const point1 = point([-75, 45]); const point2 = point([30, 45]); diff --git a/packages/turf-great-circle/package.json b/packages/turf-great-circle/package.json index 075b6225f2..e2807a7e15 100644 --- a/packages/turf-great-circle/package.json +++ b/packages/turf-great-circle/package.json @@ -2,22 +2,19 @@ "name": "@turf/great-circle", "version": "5.1.5", "description": "turf great-circle module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-great-circle/test.js b/packages/turf-great-circle/test.js index ff45b0b23d..588293ceca 100644 --- a/packages/turf-great-circle/test.js +++ b/packages/turf-great-circle/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureCollection } from '@turf/helpers'; -import greatCircle from '.'; +import greatCircle from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-helpers/package.json b/packages/turf-helpers/package.json index 63e74e5479..85760aecdb 100644 --- a/packages/turf-helpers/package.json +++ b/packages/turf-helpers/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-hex-grid/package.json b/packages/turf-hex-grid/package.json index e52bd02c75..94ec1e2307 100644 --- a/packages/turf-hex-grid/package.json +++ b/packages/turf-hex-grid/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-interpolate/bench.js b/packages/turf-interpolate/bench.js index 74eca8ec41..de95675c2f 100644 --- a/packages/turf-interpolate/bench.js +++ b/packages/turf-interpolate/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import interpolate from './'; +import interpolate from './dist/js/index.js'; // Define Fixtures const directory = path.join(__dirname, 'test', 'in') + path.sep; diff --git a/packages/turf-interpolate/package.json b/packages/turf-interpolate/package.json index 7b0bfe495d..5c9f7bf91e 100644 --- a/packages/turf-interpolate/package.json +++ b/packages/turf-interpolate/package.json @@ -2,21 +2,19 @@ "name": "@turf/interpolate", "version": "5.1.5", "description": "turf interpolate module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-interpolate/test.js b/packages/turf-interpolate/test.js index e65f581c2a..06f3770da0 100644 --- a/packages/turf-interpolate/test.js +++ b/packages/turf-interpolate/test.js @@ -7,7 +7,7 @@ import truncate from '@turf/truncate'; import { brightness } from 'chromatism'; import { round, featureCollection, point } from '@turf/helpers'; import { featureEach, propEach } from '@turf/meta'; -import interpolate from '.'; +import interpolate from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-intersect/package.json b/packages/turf-intersect/package.json index cdc052272b..18d2a61deb 100644 --- a/packages/turf-intersect/package.json +++ b/packages/turf-intersect/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-invariant/package.json b/packages/turf-invariant/package.json index 7a06e85e0e..758f82729b 100644 --- a/packages/turf-invariant/package.json +++ b/packages/turf-invariant/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-isobands/bench.js b/packages/turf-isobands/bench.js index c7f505f830..4f136f1dad 100644 --- a/packages/turf-isobands/bench.js +++ b/packages/turf-isobands/bench.js @@ -3,7 +3,7 @@ import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; import matrixToGrid from './matrix-to-grid'; -import isobands from './'; +import isobands from './dist/js/index.js'; // Define Fixtures const directory = path.join(__dirname, 'test', 'in') + path.sep; diff --git a/packages/turf-isobands/package.json b/packages/turf-isobands/package.json index 9f62e0bd4e..906cb5b14a 100644 --- a/packages/turf-isobands/package.json +++ b/packages/turf-isobands/package.json @@ -2,22 +2,20 @@ "name": "@turf/isobands", "version": "5.1.5", "description": "turf isobands module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-isobands/test.js b/packages/turf-isobands/test.js index a365994e98..62e592b193 100644 --- a/packages/turf-isobands/test.js +++ b/packages/turf-isobands/test.js @@ -11,7 +11,7 @@ import { lineString } from '@turf/helpers'; import { featureEach } from '@turf/meta'; import { randomPolygon } from '@turf/random'; import matrixToGrid from './lib/matrix-to-grid'; -import isobands from './'; +import isobands from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-isolines/bench.js b/packages/turf-isolines/bench.js index 1631ac8225..081c8f14e3 100644 --- a/packages/turf-isolines/bench.js +++ b/packages/turf-isolines/bench.js @@ -3,7 +3,7 @@ import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; import matrixToGrid from 'matrix-to-grid'; -import isolines from './'; +import isolines from './dist/js/index.js'; // Define Fixtures const directory = path.join(__dirname, 'test', 'in') + path.sep; diff --git a/packages/turf-isolines/package.json b/packages/turf-isolines/package.json index 1ec0535ee8..0221692520 100644 --- a/packages/turf-isolines/package.json +++ b/packages/turf-isolines/package.json @@ -2,21 +2,19 @@ "name": "@turf/isolines", "version": "5.1.5", "description": "turf isolines module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", + "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-isolines/test.js b/packages/turf-isolines/test.js index 12463c882f..04b6bb0679 100644 --- a/packages/turf-isolines/test.js +++ b/packages/turf-isolines/test.js @@ -10,7 +10,7 @@ import { getCoords } from '@turf/invariant'; import { randomPolygon } from '@turf/random'; import { lineString, polygon } from '@turf/helpers'; import matrixToGrid from './lib/matrix-to-grid'; -import isolines from '.'; +import isolines from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-kinks/package.json b/packages/turf-kinks/package.json index 55c0da0595..3232246d01 100644 --- a/packages/turf-kinks/package.json +++ b/packages/turf-kinks/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-length/package.json b/packages/turf-length/package.json index 1837f923e8..838b905864 100644 --- a/packages/turf-length/package.json +++ b/packages/turf-length/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-line-arc/package.json b/packages/turf-line-arc/package.json index 415216dabc..7c9ae769a6 100644 --- a/packages/turf-line-arc/package.json +++ b/packages/turf-line-arc/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-line-chunk/bench.js b/packages/turf-line-chunk/bench.js index 7994f0ffb9..e278d4b5a1 100644 --- a/packages/turf-line-chunk/bench.js +++ b/packages/turf-line-chunk/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import lineChunk from './'; +import lineChunk from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-line-chunk/package.json b/packages/turf-line-chunk/package.json index 3bc088b578..c2eeeeda05 100644 --- a/packages/turf-line-chunk/package.json +++ b/packages/turf-line-chunk/package.json @@ -2,21 +2,19 @@ "name": "@turf/line-chunk", "version": "5.1.5", "description": "turf line-chunk module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-line-chunk/test.js b/packages/turf-line-chunk/test.js index b0cb0210c3..bd76b4b4bb 100644 --- a/packages/turf-line-chunk/test.js +++ b/packages/turf-line-chunk/test.js @@ -6,7 +6,7 @@ import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureEach } from '@turf/meta'; import { lineString, featureCollection } from '@turf/helpers'; -import lineChunk from '.'; +import lineChunk from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-line-intersect/package.json b/packages/turf-line-intersect/package.json index 42b32a33b0..b9184a3818 100644 --- a/packages/turf-line-intersect/package.json +++ b/packages/turf-line-intersect/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-line-offset/bench.js b/packages/turf-line-offset/bench.js index ea9157a671..08ee4f0c0a 100644 --- a/packages/turf-line-offset/bench.js +++ b/packages/turf-line-offset/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import lineOffset from './'; +import lineOffset from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; let fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-line-offset/package.json b/packages/turf-line-offset/package.json index 1094233224..ba82275fe4 100644 --- a/packages/turf-line-offset/package.json +++ b/packages/turf-line-offset/package.json @@ -2,22 +2,19 @@ "name": "@turf/line-offset", "version": "5.1.5", "description": "turf line-offset module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-line-offset/test.js b/packages/turf-line-offset/test.js index f8be9c7f6a..417adcbd67 100644 --- a/packages/turf-line-offset/test.js +++ b/packages/turf-line-offset/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureCollection, lineString } from '@turf/helpers'; -import lineOffset from '.'; +import lineOffset from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-line-overlap/package.json b/packages/turf-line-overlap/package.json index 59008f1161..7afdb1768e 100644 --- a/packages/turf-line-overlap/package.json +++ b/packages/turf-line-overlap/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-line-segment/package.json b/packages/turf-line-segment/package.json index 8ace774314..c38f0a3f12 100644 --- a/packages/turf-line-segment/package.json +++ b/packages/turf-line-segment/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-line-slice-along/bench.js b/packages/turf-line-slice-along/bench.js index e84af14280..453a0ae4fa 100644 --- a/packages/turf-line-slice-along/bench.js +++ b/packages/turf-line-slice-along/bench.js @@ -1,6 +1,6 @@ import fs from 'fs'; import Benchmark from 'benchmark'; -import lineSliceAlong from './'; +import lineSliceAlong from './dist/js/index.js'; var line1 = JSON.parse(fs.readFileSync(__dirname + '/test/fixtures/line1.geojson')); var route1 = JSON.parse(fs.readFileSync(__dirname + '/test/fixtures/route1.geojson')); diff --git a/packages/turf-line-slice-along/package.json b/packages/turf-line-slice-along/package.json index 44e0990533..dd6126a548 100644 --- a/packages/turf-line-slice-along/package.json +++ b/packages/turf-line-slice-along/package.json @@ -2,21 +2,20 @@ "name": "@turf/line-slice-along", "version": "5.1.5", "description": "turf line-slice-along module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-line-slice-along/test.js b/packages/turf-line-slice-along/test.js index 5c6a147894..940437ebfe 100644 --- a/packages/turf-line-slice-along/test.js +++ b/packages/turf-line-slice-along/test.js @@ -2,7 +2,7 @@ import test from 'tape'; import path from 'path'; import load from 'load-json-file'; import along from '@turf/along'; -import lineSliceAlong from '.'; +import lineSliceAlong from './dist/js/index.js'; var line1 = load.sync(path.join(__dirname, 'test', 'fixtures', 'line1.geojson')); var route1 = load.sync(path.join(__dirname, 'test', 'fixtures', 'route1.geojson')); diff --git a/packages/turf-line-slice/bench.js b/packages/turf-line-slice/bench.js index d9191053a3..c4278377ee 100644 --- a/packages/turf-line-slice/bench.js +++ b/packages/turf-line-slice/bench.js @@ -1,7 +1,7 @@ import fs from 'fs'; import Benchmark from 'benchmark'; import { point } from '@turf/helpers'; -import lineSlice from './'; +import lineSlice from './dist/js/index.js'; var route1 = JSON.parse(fs.readFileSync(__dirname + '/test/in/route1.geojson')); var route2 = JSON.parse(fs.readFileSync(__dirname + '/test/in/route2.geojson')); diff --git a/packages/turf-line-slice/package.json b/packages/turf-line-slice/package.json index 7743dc8d3e..a8d75fb537 100644 --- a/packages/turf-line-slice/package.json +++ b/packages/turf-line-slice/package.json @@ -2,21 +2,20 @@ "name": "@turf/line-slice", "version": "5.1.5", "description": "turf line-slice module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-line-slice/test.js b/packages/turf-line-slice/test.js index 0cfbe2f095..a1010de071 100644 --- a/packages/turf-line-slice/test.js +++ b/packages/turf-line-slice/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureCollection } from '@turf/helpers'; -import lineSlice from './'; +import lineSlice from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-line-split/bench.js b/packages/turf-line-split/bench.js index dbee00636f..1d87f3ac50 100644 --- a/packages/turf-line-split/bench.js +++ b/packages/turf-line-split/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import lineSplit from './'; +import lineSplit from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-line-split/package.json b/packages/turf-line-split/package.json index dd10735a53..f2d978f36d 100644 --- a/packages/turf-line-split/package.json +++ b/packages/turf-line-split/package.json @@ -2,21 +2,20 @@ "name": "@turf/line-split", "version": "5.1.5", "description": "turf line-split module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-line-split/test.js b/packages/turf-line-split/test.js index 2b319432a0..fcee783c30 100644 --- a/packages/turf-line-split/test.js +++ b/packages/turf-line-split/test.js @@ -6,7 +6,7 @@ import write from 'write-json-file'; import { featureEach } from '@turf/meta'; import { point, lineString, multiPoint, featureCollection, round } from '@turf/helpers'; import { getCoords } from '@turf/invariant'; -import lineSplit from '.'; +import lineSplit from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-line-to-polygon/package.json b/packages/turf-line-to-polygon/package.json index cddac9ca93..5f606c6471 100644 --- a/packages/turf-line-to-polygon/package.json +++ b/packages/turf-line-to-polygon/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-mask/bench.js b/packages/turf-mask/bench.js index 500cc95f2a..de2e7f8fc5 100644 --- a/packages/turf-mask/bench.js +++ b/packages/turf-mask/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import turfMask from '.'; +import turfMask from './dist/js/index.js'; const suite = new Benchmark.Suite('turf-mask'); diff --git a/packages/turf-mask/package.json b/packages/turf-mask/package.json index bb574bfeb4..e7a78e2ae0 100644 --- a/packages/turf-mask/package.json +++ b/packages/turf-mask/package.json @@ -2,21 +2,19 @@ "name": "@turf/mask", "version": "5.1.5", "description": "turf mask module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-mask/test.js b/packages/turf-mask/test.js index 1e4f0a821b..af482dd48d 100644 --- a/packages/turf-mask/test.js +++ b/packages/turf-mask/test.js @@ -3,7 +3,7 @@ import test from 'tape'; import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; -import mask from '.'; +import mask from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-meta/.gitignore b/packages/turf-meta/.gitignore deleted file mode 100644 index 945ce43a90..0000000000 --- a/packages/turf-meta/.gitignore +++ /dev/null @@ -1 +0,0 @@ -index.js \ No newline at end of file diff --git a/packages/turf-meta/bench.js b/packages/turf-meta/bench.js index 7e2f584b1e..0e7c06828e 100644 --- a/packages/turf-meta/bench.js +++ b/packages/turf-meta/bench.js @@ -1,6 +1,6 @@ const Benchmark = require('benchmark'); const random = require('@turf/random'); -const meta = require('./'); +const meta = require('./dist/js/index.js'); const fixtures = { point: random.randomPoint(), diff --git a/packages/turf-meta/index.mjs b/packages/turf-meta/index.js similarity index 100% rename from packages/turf-meta/index.mjs rename to packages/turf-meta/index.js diff --git a/packages/turf-meta/package.json b/packages/turf-meta/package.json index afe699553f..69ab40a1ca 100644 --- a/packages/turf-meta/package.json +++ b/packages/turf-meta/package.json @@ -2,19 +2,19 @@ "name": "@turf/meta", "version": "6.0.1", "description": "turf meta module", - "main": "index", - "module": "index.mjs", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.mjs", + "dist", "index.d.ts" ], "scripts": { "bench": "node bench.js", "docs": "node ../../scripts/generate-readmes", - "pretest": "rollup -f cjs -o index.js index.mjs", - "test": "npm-run-all test:tape test:types", + "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", + "pretest": "rollup -c ../../rollup.config.js", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-meta/test.js b/packages/turf-meta/test.js index 120cc85ceb..f67b7476d9 100644 --- a/packages/turf-meta/test.js +++ b/packages/turf-meta/test.js @@ -13,7 +13,7 @@ const { lineStrings, polygons } = require('@turf/helpers'); -const meta = require('./'); +const meta = require('./dist/js/index.js'); const pt = point([0, 0], {a: 1}); const pt2 = point([1, 1]); diff --git a/packages/turf-midpoint/bench.js b/packages/turf-midpoint/bench.js index 094d3c0f2a..cdbd997e1c 100644 --- a/packages/turf-midpoint/bench.js +++ b/packages/turf-midpoint/bench.js @@ -1,7 +1,7 @@ import fs from 'fs'; import Benchmark from 'benchmark'; import { point } from '@turf/helpers'; -import midpoint from './'; +import midpoint from './dist/js/index.js'; var pt1 = point([0,0]); var pt2 = point([10,0]); diff --git a/packages/turf-midpoint/package.json b/packages/turf-midpoint/package.json index 8da4fd6d32..a9206887f4 100644 --- a/packages/turf-midpoint/package.json +++ b/packages/turf-midpoint/package.json @@ -2,21 +2,20 @@ "name": "@turf/midpoint", "version": "5.1.5", "description": "turf midpoint module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-midpoint/test.js b/packages/turf-midpoint/test.js index be2087b265..abfdec04a8 100644 --- a/packages/turf-midpoint/test.js +++ b/packages/turf-midpoint/test.js @@ -1,5 +1,5 @@ import test from 'tape'; -import midpoint from '.'; +import midpoint from './dist/js/index.js'; import distance from '@turf/distance'; import { point } from '@turf/helpers'; diff --git a/packages/turf-moran-index/package.json b/packages/turf-moran-index/package.json index aba85c1b4d..adbbf0c714 100644 --- a/packages/turf-moran-index/package.json +++ b/packages/turf-moran-index/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-nearest-neighbor-analysis/package.json b/packages/turf-nearest-neighbor-analysis/package.json index 3c56e4e1cd..c74ed8c6c0 100644 --- a/packages/turf-nearest-neighbor-analysis/package.json +++ b/packages/turf-nearest-neighbor-analysis/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-nearest-point-on-line/package.json b/packages/turf-nearest-point-on-line/package.json index ff0ef1e0fc..e46177c09f 100644 --- a/packages/turf-nearest-point-on-line/package.json +++ b/packages/turf-nearest-point-on-line/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index 6ff53891af..f83999389e 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-nearest-point/package.json b/packages/turf-nearest-point/package.json index 1536f8b23e..44ffec6d26 100644 --- a/packages/turf-nearest-point/package.json +++ b/packages/turf-nearest-point/package.json @@ -13,7 +13,9 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js", + "test:types": "tsc --noEmit types.ts" }, "repository": { "type": "git", diff --git a/packages/turf-planepoint/bench.js b/packages/turf-planepoint/bench.js index c7768d99fa..b9cba786b7 100644 --- a/packages/turf-planepoint/bench.js +++ b/packages/turf-planepoint/bench.js @@ -1,6 +1,6 @@ import Benchmark from 'benchmark'; import { polygon } from '@turf/helpers'; -import planepoint from './'; +import planepoint from './dist/js/index.js'; const point = [1, 1]; const triangle = polygon([[[0, 0, 0], [2, 0, 0], [1, 2, 2], [0, 0, 0]]], {a: 0, b: 0, c: 2}); diff --git a/packages/turf-planepoint/package.json b/packages/turf-planepoint/package.json index c18b2072f0..e1a8c794be 100644 --- a/packages/turf-planepoint/package.json +++ b/packages/turf-planepoint/package.json @@ -2,21 +2,19 @@ "name": "@turf/planepoint", "version": "5.1.5", "description": "turf planepoint module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-planepoint/test.js b/packages/turf-planepoint/test.js index eff5402890..4dd6de7e54 100644 --- a/packages/turf-planepoint/test.js +++ b/packages/turf-planepoint/test.js @@ -3,7 +3,7 @@ import test from 'tape'; import { polygon } from '@turf/helpers'; -import planepoint from '.'; +import planepoint from './dist/js/index.js'; test('turf-planepoint', t => { diff --git a/packages/turf-point-grid/package.json b/packages/turf-point-grid/package.json index 7a6fddc2af..d2163a1c2e 100644 --- a/packages/turf-point-grid/package.json +++ b/packages/turf-point-grid/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-point-on-feature/bench.js b/packages/turf-point-on-feature/bench.js index 418ea0180b..d856ec18cf 100644 --- a/packages/turf-point-on-feature/bench.js +++ b/packages/turf-point-on-feature/bench.js @@ -3,7 +3,7 @@ import path from 'path'; import glob from 'glob'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import pointOnFeature from './'; +import pointOnFeature from './dist/js/index.js'; /** * Benchmark Results diff --git a/packages/turf-point-on-feature/package.json b/packages/turf-point-on-feature/package.json index 0fcbf92881..0b8c721472 100644 --- a/packages/turf-point-on-feature/package.json +++ b/packages/turf-point-on-feature/package.json @@ -2,21 +2,20 @@ "name": "@turf/point-on-feature", "version": "5.1.5", "description": "turf point-on-feature module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-point-on-feature/test.js b/packages/turf-point-on-feature/test.js index abc76bdbad..f86886d5af 100644 --- a/packages/turf-point-on-feature/test.js +++ b/packages/turf-point-on-feature/test.js @@ -7,7 +7,7 @@ import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureEach } from '@turf/meta'; import { featureCollection } from '@turf/helpers'; -import pointOnFeature from '.'; +import pointOnFeature from './dist/js/index.js'; test('turf-point-on-feature', t => { glob.sync(path.join(__dirname, 'test', 'in', '*.json')).forEach(filepath => { diff --git a/packages/turf-point-to-line-distance/package.json b/packages/turf-point-to-line-distance/package.json index 89c926fcf8..38817548ea 100644 --- a/packages/turf-point-to-line-distance/package.json +++ b/packages/turf-point-to-line-distance/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-points-within-polygon/bench.js b/packages/turf-points-within-polygon/bench.js index b9d333d646..833b52157f 100644 --- a/packages/turf-points-within-polygon/bench.js +++ b/packages/turf-points-within-polygon/bench.js @@ -1,7 +1,7 @@ import fs from 'fs'; import Benchmark from 'benchmark'; import { featureCollection, point, polygon } from '@turf/helpers'; -import pointsWithinPolygon from './'; +import pointsWithinPolygon from './dist/js/index.js'; var poly1 = polygon([[[0, 0], [10, 0], [10, 10], [0, 0]]]); var poly2 = polygon([[[10, 0], [20, 10], [20, 20], [10, 0]]]); diff --git a/packages/turf-points-within-polygon/package.json b/packages/turf-points-within-polygon/package.json index 78b8a7306b..bc4a8ebef7 100644 --- a/packages/turf-points-within-polygon/package.json +++ b/packages/turf-points-within-polygon/package.json @@ -2,21 +2,19 @@ "name": "@turf/points-within-polygon", "version": "5.1.5", "description": "turf points-within-polygon module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-points-within-polygon/test.js b/packages/turf-points-within-polygon/test.js index 212ba6f229..c269e199ff 100644 --- a/packages/turf-points-within-polygon/test.js +++ b/packages/turf-points-within-polygon/test.js @@ -2,7 +2,7 @@ import test from 'tape'; import { point, points } from '@turf/helpers'; import { polygon } from '@turf/helpers'; import { featureCollection } from '@turf/helpers'; -import pointsWithinPolygon from '.'; +import pointsWithinPolygon from './dist/js/index.js'; test('turf-points-within-polygon', t => { t.plan(4); diff --git a/packages/turf-polygon-smooth/bench.js b/packages/turf-polygon-smooth/bench.js index 6528c4066d..489f1e01a0 100644 --- a/packages/turf-polygon-smooth/bench.js +++ b/packages/turf-polygon-smooth/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import polygonSmooth from './'; +import polygonSmooth from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; let fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-polygon-smooth/package.json b/packages/turf-polygon-smooth/package.json index 8ea2445fb3..b89f73781a 100644 --- a/packages/turf-polygon-smooth/package.json +++ b/packages/turf-polygon-smooth/package.json @@ -2,21 +2,19 @@ "name": "@turf/polygon-smooth", "version": "5.0.1", "description": "turf polygon smooth module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-polygon-smooth/test.js b/packages/turf-polygon-smooth/test.js index efe246e59a..eccfdc4e2c 100644 --- a/packages/turf-polygon-smooth/test.js +++ b/packages/turf-polygon-smooth/test.js @@ -4,7 +4,7 @@ import path from 'path'; import glob from 'glob'; import load from 'load-json-file'; import write from 'write-json-file'; -import polygonSmooth from '.'; +import polygonSmooth from './dist/js/index.js'; test('turf-polygon-smooth', t => { glob.sync(path.join(__dirname, 'test', 'in', '*.json')).forEach(filepath => { diff --git a/packages/turf-polygon-tangents/bench.js b/packages/turf-polygon-tangents/bench.js index 4068b29d6e..162227fb03 100644 --- a/packages/turf-polygon-tangents/bench.js +++ b/packages/turf-polygon-tangents/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import tangents from './'; +import tangents from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; let fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-polygon-tangents/package.json b/packages/turf-polygon-tangents/package.json index 7e2a073a32..8ac1b09952 100644 --- a/packages/turf-polygon-tangents/package.json +++ b/packages/turf-polygon-tangents/package.json @@ -2,21 +2,19 @@ "name": "@turf/polygon-tangents", "version": "5.1.5", "description": "turf polygon tangents module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-polygon-tangents/test.js b/packages/turf-polygon-tangents/test.js index 79011fa774..c1bc88d841 100644 --- a/packages/turf-polygon-tangents/test.js +++ b/packages/turf-polygon-tangents/test.js @@ -4,7 +4,7 @@ import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; import { polygon, point } from '@turf/helpers'; -import polygonTangents from '.'; +import polygonTangents from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-polygon-to-line/package.json b/packages/turf-polygon-to-line/package.json index bac6b751c4..9485c16498 100644 --- a/packages/turf-polygon-to-line/package.json +++ b/packages/turf-polygon-to-line/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-polygonize/bench.js b/packages/turf-polygonize/bench.js index baac8e3927..bd0f35b18e 100644 --- a/packages/turf-polygonize/bench.js +++ b/packages/turf-polygonize/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import polygonize from './'; +import polygonize from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-polygonize/package.json b/packages/turf-polygonize/package.json index c4f7d14f63..142049e2ce 100644 --- a/packages/turf-polygonize/package.json +++ b/packages/turf-polygonize/package.json @@ -2,22 +2,19 @@ "name": "@turf/polygonize", "version": "5.1.5", "description": "turf polygonize module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-polygonize/test.js b/packages/turf-polygonize/test.js index 768d51c457..224d29730d 100644 --- a/packages/turf-polygonize/test.js +++ b/packages/turf-polygonize/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import { featureEach } from '@turf/meta'; import { featureCollection, lineString } from '@turf/helpers'; -import polygonize from '.'; +import polygonize from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-projection/package.json b/packages/turf-projection/package.json index c5ce24cb1c..408ae92fb7 100644 --- a/packages/turf-projection/package.json +++ b/packages/turf-projection/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-quadrat-analysis/package.json b/packages/turf-quadrat-analysis/package.json index 4055482512..7a4737b94a 100644 --- a/packages/turf-quadrat-analysis/package.json +++ b/packages/turf-quadrat-analysis/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-random/package.json b/packages/turf-random/package.json index 956183e9ce..777e42af92 100644 --- a/packages/turf-random/package.json +++ b/packages/turf-random/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-rectangle-grid/package.json b/packages/turf-rectangle-grid/package.json index cde7ab96f7..7f5d59bfe4 100644 --- a/packages/turf-rectangle-grid/package.json +++ b/packages/turf-rectangle-grid/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-rewind/bench.js b/packages/turf-rewind/bench.js index 41a2f53d4d..991253a09c 100644 --- a/packages/turf-rewind/bench.js +++ b/packages/turf-rewind/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import rewind from './'; +import rewind from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; let fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-rewind/package.json b/packages/turf-rewind/package.json index 875fa2e271..f2bb0d7a53 100644 --- a/packages/turf-rewind/package.json +++ b/packages/turf-rewind/package.json @@ -2,21 +2,19 @@ "name": "@turf/rewind", "version": "5.1.5", "description": "turf rewind module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-rewind/test.js b/packages/turf-rewind/test.js index ff7fce58db..cce2861f07 100644 --- a/packages/turf-rewind/test.js +++ b/packages/turf-rewind/test.js @@ -4,7 +4,7 @@ import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; import { polygon, lineString, featureCollection, geometryCollection } from '@turf/helpers'; -import rewind from '.'; +import rewind from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-rhumb-bearing/package.json b/packages/turf-rhumb-bearing/package.json index d680d5b3a7..219708d7a5 100644 --- a/packages/turf-rhumb-bearing/package.json +++ b/packages/turf-rhumb-bearing/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-rhumb-destination/package.json b/packages/turf-rhumb-destination/package.json index 214f0ac668..ddf7c2295a 100644 --- a/packages/turf-rhumb-destination/package.json +++ b/packages/turf-rhumb-destination/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-rhumb-distance/package.json b/packages/turf-rhumb-distance/package.json index 3b8dc4783b..8f033df995 100644 --- a/packages/turf-rhumb-distance/package.json +++ b/packages/turf-rhumb-distance/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-sample/bench.js b/packages/turf-sample/bench.js index a4a52427e1..5531f232fe 100644 --- a/packages/turf-sample/bench.js +++ b/packages/turf-sample/bench.js @@ -1,7 +1,7 @@ import fs from 'fs'; import Benchmark from 'benchmark'; import { point, featureCollection } from '@turf/helpers'; -import sample from './'; +import sample from './dist/js/index.js'; var points = featureCollection( [point(1,2, {team: 'Red Sox'}), diff --git a/packages/turf-sample/package.json b/packages/turf-sample/package.json index 201b2b3c14..c8c8b487da 100644 --- a/packages/turf-sample/package.json +++ b/packages/turf-sample/package.json @@ -2,21 +2,20 @@ "name": "@turf/sample", "version": "5.1.5", "description": "turf sample module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-sample/test.js b/packages/turf-sample/test.js index ace14fdfb3..c807a5eaa0 100644 --- a/packages/turf-sample/test.js +++ b/packages/turf-sample/test.js @@ -1,7 +1,7 @@ import test from 'tape'; import { point } from '@turf/helpers'; import { featureCollection } from '@turf/helpers'; -import sample from '.'; +import sample from './dist/js/index.js'; test('remove', function (t) { var points = featureCollection([ diff --git a/packages/turf-sector/bench.js b/packages/turf-sector/bench.js index b8d636ae85..240c0e8fdb 100644 --- a/packages/turf-sector/bench.js +++ b/packages/turf-sector/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import sector from './'; +import sector from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-sector/package.json b/packages/turf-sector/package.json index eac0871381..5215d031b6 100644 --- a/packages/turf-sector/package.json +++ b/packages/turf-sector/package.json @@ -2,21 +2,19 @@ "name": "@turf/sector", "version": "5.1.5", "description": "turf sector module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-sector/test.js b/packages/turf-sector/test.js index 3a26e9f458..aac4b4cd46 100644 --- a/packages/turf-sector/test.js +++ b/packages/turf-sector/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import truncate from '@turf/truncate'; import { featureCollection } from '@turf/helpers'; -import sector from '.'; +import sector from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-shortest-path/bench.js b/packages/turf-shortest-path/bench.js index 5c2cc28929..f6e6333c7d 100644 --- a/packages/turf-shortest-path/bench.js +++ b/packages/turf-shortest-path/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import shortestPath from './'; +import shortestPath from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-shortest-path/package.json b/packages/turf-shortest-path/package.json index 375e399b25..07a8d63acf 100644 --- a/packages/turf-shortest-path/package.json +++ b/packages/turf-shortest-path/package.json @@ -2,22 +2,19 @@ "name": "@turf/shortest-path", "version": "5.1.5", "description": "turf shortest-path module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-shortest-path/test.js b/packages/turf-shortest-path/test.js index d43ee9644d..ae2e003bf3 100644 --- a/packages/turf-shortest-path/test.js +++ b/packages/turf-shortest-path/test.js @@ -7,7 +7,7 @@ import truncate from '@turf/truncate'; import { featureCollection, point } from '@turf/helpers'; import { getCoord } from '@turf/invariant'; import { featureEach } from '@turf/meta'; -import shortestPath from './'; +import shortestPath from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-simplify/bench.js b/packages/turf-simplify/bench.js index 70457d34e6..e0e7f1e78f 100644 --- a/packages/turf-simplify/bench.js +++ b/packages/turf-simplify/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import simplify from './'; +import simplify from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-simplify/package.json b/packages/turf-simplify/package.json index d737aba741..cf83dbdc6a 100644 --- a/packages/turf-simplify/package.json +++ b/packages/turf-simplify/package.json @@ -2,22 +2,19 @@ "name": "@turf/simplify", "version": "5.1.5", "description": "turf simplify module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-simplify/test.js b/packages/turf-simplify/test.js index 070098ce60..d4c9c043db 100644 --- a/packages/turf-simplify/test.js +++ b/packages/turf-simplify/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import truncate from '@turf/truncate'; import { polygon, multiPolygon } from '@turf/helpers'; -import simplify from '.'; +import simplify from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-square-grid/package.json b/packages/turf-square-grid/package.json index 0d2e6c0106..2aa2fe23cc 100644 --- a/packages/turf-square-grid/package.json +++ b/packages/turf-square-grid/package.json @@ -13,7 +13,8 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "node test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-square/bench.js b/packages/turf-square/bench.js index a84e3bea85..4a2b86c4ea 100644 --- a/packages/turf-square/bench.js +++ b/packages/turf-square/bench.js @@ -1,6 +1,6 @@ import fs from 'fs'; import Benchmark from 'benchmark'; -import square from './'; +import square from './dist/js/index.js'; var bbox = [0,0,5,10]; diff --git a/packages/turf-square/package.json b/packages/turf-square/package.json index 66556ce35e..eb6af8da19 100644 --- a/packages/turf-square/package.json +++ b/packages/turf-square/package.json @@ -2,21 +2,20 @@ "name": "@turf/square", "version": "5.1.5", "description": "turf square module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-square/test.js b/packages/turf-square/test.js index d8b72a29c2..46f796a942 100644 --- a/packages/turf-square/test.js +++ b/packages/turf-square/test.js @@ -1,5 +1,5 @@ import test from 'tape'; -import square from '.'; +import square from './dist/js/index.js'; test('square', function (t) { var bbox1 = [0, 0, 5, 10]; diff --git a/packages/turf-standard-deviational-ellipse/bench.js b/packages/turf-standard-deviational-ellipse/bench.js index d1b0a38d4d..ecece50033 100644 --- a/packages/turf-standard-deviational-ellipse/bench.js +++ b/packages/turf-standard-deviational-ellipse/bench.js @@ -1,5 +1,5 @@ import { randomPoint } from '@turf/random'; -import standardDeviationalEllipse from '.'; +import standardDeviationalEllipse from './dist/js/index.js'; import Benchmark from 'benchmark'; /** diff --git a/packages/turf-standard-deviational-ellipse/package.json b/packages/turf-standard-deviational-ellipse/package.json index eb1b8ec25f..f3a20df58e 100644 --- a/packages/turf-standard-deviational-ellipse/package.json +++ b/packages/turf-standard-deviational-ellipse/package.json @@ -2,21 +2,19 @@ "name": "@turf/standard-deviational-ellipse", "version": "5.1.5", "description": "turf standard-deviational-ellipse module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-standard-deviational-ellipse/test.js b/packages/turf-standard-deviational-ellipse/test.js index d3c8909235..e0f98e8128 100644 --- a/packages/turf-standard-deviational-ellipse/test.js +++ b/packages/turf-standard-deviational-ellipse/test.js @@ -6,7 +6,7 @@ import write from 'write-json-file'; import { featureCollection } from '@turf/helpers'; import { featureEach } from '@turf/meta'; import truncate from '@turf/truncate'; -import standardDeviationalEllipse from '.'; +import standardDeviationalEllipse from './dist/js/index.js'; test('turf-standard-deviational-ellipse', t => { glob.sync(path.join(__dirname, 'test', 'in', '*.json')).forEach(filepath => { diff --git a/packages/turf-tag/bench.js b/packages/turf-tag/bench.js index 2192cceea0..494d24d1ea 100644 --- a/packages/turf-tag/bench.js +++ b/packages/turf-tag/bench.js @@ -1,6 +1,6 @@ import fs from 'fs'; import Benchmark from 'benchmark'; -import tag from './'; +import tag from './dist/js/index.js'; var points = JSON.parse(fs.readFileSync('./test/tagPoints.geojson')); var polygons = JSON.parse(fs.readFileSync('./test/tagPolygons.geojson')); diff --git a/packages/turf-tag/package.json b/packages/turf-tag/package.json index 8a2955638a..f9829b3c8d 100644 --- a/packages/turf-tag/package.json +++ b/packages/turf-tag/package.json @@ -2,21 +2,20 @@ "name": "@turf/tag", "version": "5.1.5", "description": "turf tag module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-tag/test.js b/packages/turf-tag/test.js index 5b9a0bf4c5..ccdbed2908 100644 --- a/packages/turf-tag/test.js +++ b/packages/turf-tag/test.js @@ -1,7 +1,7 @@ import path from 'path'; import test from 'tape'; import load from 'load-json-file'; -import tag from '.'; +import tag from './dist/js/index.js'; test('tag', t => { const points = load.sync(path.join(__dirname, 'test', 'tagPoints.geojson')); diff --git a/packages/turf-tesselate/bench.js b/packages/turf-tesselate/bench.js index 3d19bdf536..2283d04ca1 100644 --- a/packages/turf-tesselate/bench.js +++ b/packages/turf-tesselate/bench.js @@ -1,6 +1,6 @@ import Benchmark from 'benchmark'; import { polygon } from '@turf/helpers'; -import tesselate from './'; +import tesselate from './dist/js/index.js'; var poly = polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]); diff --git a/packages/turf-tesselate/package.json b/packages/turf-tesselate/package.json index 98ec0404d2..73161f3333 100644 --- a/packages/turf-tesselate/package.json +++ b/packages/turf-tesselate/package.json @@ -2,21 +2,20 @@ "name": "@turf/tesselate", "version": "5.1.5", "description": "turf tesselate module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-tesselate/test.js b/packages/turf-tesselate/test.js index d49b220406..35b999c111 100644 --- a/packages/turf-tesselate/test.js +++ b/packages/turf-tesselate/test.js @@ -1,5 +1,5 @@ import test from 'tape'; -import tesselate from '.'; +import tesselate from './dist/js/index.js'; import { featureCollection as featurecollection } from '@turf/helpers'; import { point } from '@turf/helpers'; diff --git a/packages/turf-tin/package.json b/packages/turf-tin/package.json index d8a6f1b10c..d7eb72ae53 100644 --- a/packages/turf-tin/package.json +++ b/packages/turf-tin/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-transform-rotate/bench.js b/packages/turf-transform-rotate/bench.js index 101e725153..58589b1aec 100644 --- a/packages/turf-transform-rotate/bench.js +++ b/packages/turf-transform-rotate/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import rotate from './'; +import rotate from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-transform-rotate/package.json b/packages/turf-transform-rotate/package.json index bb71319018..51f29c5ca2 100644 --- a/packages/turf-transform-rotate/package.json +++ b/packages/turf-transform-rotate/package.json @@ -2,21 +2,19 @@ "name": "@turf/transform-rotate", "version": "5.1.5", "description": "turf transform-rotate module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-transform-rotate/test.js b/packages/turf-transform-rotate/test.js index 8b3ee7e616..1a1f7665da 100644 --- a/packages/turf-transform-rotate/test.js +++ b/packages/turf-transform-rotate/test.js @@ -7,7 +7,7 @@ import centroid from '@turf/centroid'; import truncate from '@turf/truncate'; import { getCoord } from '@turf/invariant'; import { point, lineString, featureCollection, geometryCollection } from '@turf/helpers'; -import rotate from '.'; +import rotate from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-transform-scale/bench.js b/packages/turf-transform-scale/bench.js index 86d30c4935..0e6d120e1d 100644 --- a/packages/turf-transform-scale/bench.js +++ b/packages/turf-transform-scale/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import scale from './'; +import scale from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-transform-scale/package.json b/packages/turf-transform-scale/package.json index f41e34ec05..7601c28632 100644 --- a/packages/turf-transform-scale/package.json +++ b/packages/turf-transform-scale/package.json @@ -2,21 +2,19 @@ "name": "@turf/transform-scale", "version": "5.1.5", "description": "turf transform-scale module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-transform-scale/test.js b/packages/turf-transform-scale/test.js index 6fc03675fc..8746d0422d 100644 --- a/packages/turf-transform-scale/test.js +++ b/packages/turf-transform-scale/test.js @@ -12,7 +12,7 @@ import centroid from '@turf/centroid'; import { featureEach } from '@turf/meta'; import { getCoord } from '@turf/invariant'; import { point, lineString, geometryCollection, featureCollection } from '@turf/helpers'; -import scale from '.'; +import scale from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-transform-translate/bench.js b/packages/turf-transform-translate/bench.js index eba23e74b9..b187ae08a3 100644 --- a/packages/turf-transform-translate/bench.js +++ b/packages/turf-transform-translate/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import translate from './'; +import translate from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-transform-translate/package.json b/packages/turf-transform-translate/package.json index 19e0d90f29..1131b89676 100644 --- a/packages/turf-transform-translate/package.json +++ b/packages/turf-transform-translate/package.json @@ -2,21 +2,19 @@ "name": "@turf/transform-translate", "version": "5.1.5", "description": "turf transform-translate module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-transform-translate/test.js b/packages/turf-transform-translate/test.js index 9bfb2ab7cb..875845fea1 100644 --- a/packages/turf-transform-translate/test.js +++ b/packages/turf-transform-translate/test.js @@ -5,7 +5,7 @@ import load from 'load-json-file'; import write from 'write-json-file'; import truncate from '@turf/truncate'; import { point, lineString, geometryCollection, featureCollection } from '@turf/helpers'; -import translate from '.'; +import translate from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-triangle-grid/package.json b/packages/turf-triangle-grid/package.json index a5cabb4e54..6cb7a5ec67 100644 --- a/packages/turf-triangle-grid/package.json +++ b/packages/turf-triangle-grid/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-truncate/package.json b/packages/turf-truncate/package.json index 663d2223a0..bbd8ad1c82 100644 --- a/packages/turf-truncate/package.json +++ b/packages/turf-truncate/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-union/package.json b/packages/turf-union/package.json index 5b3d8433c8..82c22e1d11 100644 --- a/packages/turf-union/package.json +++ b/packages/turf-union/package.json @@ -13,7 +13,7 @@ "docs": "node ../../scripts/generate-readmes", "prepare": "tsc", "pretest": "tsc", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-unkink-polygon/bench.js b/packages/turf-unkink-polygon/bench.js index 741c9cc7d4..ffc8274627 100644 --- a/packages/turf-unkink-polygon/bench.js +++ b/packages/turf-unkink-polygon/bench.js @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import load from 'load-json-file'; import Benchmark from 'benchmark'; -import unkink from '.'; +import unkink from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep diff --git a/packages/turf-unkink-polygon/package.json b/packages/turf-unkink-polygon/package.json index a05c700c97..2e6b146a5b 100644 --- a/packages/turf-unkink-polygon/package.json +++ b/packages/turf-unkink-polygon/package.json @@ -2,22 +2,19 @@ "name": "@turf/unkink-polygon", "version": "5.1.5", "description": "turf unkink-polygon module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "lib", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "npm-run-all test:tape test:types", + "test": "npm-run-all test:*", "test:tape": "node -r esm test.js", "test:types": "tsc --noEmit types.ts" }, diff --git a/packages/turf-unkink-polygon/test.js b/packages/turf-unkink-polygon/test.js index 548a52e73b..254f8483b0 100644 --- a/packages/turf-unkink-polygon/test.js +++ b/packages/turf-unkink-polygon/test.js @@ -6,7 +6,7 @@ import write from 'write-json-file'; import { featureEach } from '@turf/meta'; import { featureCollection } from '@turf/helpers'; import kinks from '@turf/kinks'; -import unkinkPolygon from '.'; +import unkinkPolygon from './dist/js/index.js'; const directories = { in: path.join(__dirname, 'test', 'in') + path.sep, diff --git a/packages/turf-voronoi/bench.js b/packages/turf-voronoi/bench.js index 6effda99eb..063e3a2d1a 100644 --- a/packages/turf-voronoi/bench.js +++ b/packages/turf-voronoi/bench.js @@ -2,7 +2,7 @@ import Benchmark from 'benchmark'; import path from 'path'; import fs from 'fs'; import load from 'load-json-file'; -import voronoi from './'; +import voronoi from './dist/js/index.js'; const directory = path.join(__dirname, 'test', 'in') + path.sep; const fixtures = fs.readdirSync(directory).map(filename => { diff --git a/packages/turf-voronoi/package.json b/packages/turf-voronoi/package.json index 3de48ed4a8..d203afd3cf 100644 --- a/packages/turf-voronoi/package.json +++ b/packages/turf-voronoi/package.json @@ -2,21 +2,20 @@ "name": "@turf/voronoi", "version": "5.1.5", "description": "turf voronoi module", - "main": "main.js", - "module": "main.es.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", "types": "index.d.ts", "files": [ - "index.js", - "index.d.ts", - "main.js", - "main.es.js" + "dist", + "index.d.ts" ], "scripts": { "bench": "node -r esm bench.js", "docs": "node ../../scripts/generate-readmes", "posttest": "node -r esm ../../scripts/validate-es5-dependencies.js", "pretest": "rollup -c ../../rollup.config.js", - "test": "node -r esm test.js" + "test": "npm-run-all test:*", + "test:tape": "node -r esm test.js" }, "repository": { "type": "git", diff --git a/packages/turf-voronoi/test.js b/packages/turf-voronoi/test.js index e7ec4af21e..2fefd5d55e 100644 --- a/packages/turf-voronoi/test.js +++ b/packages/turf-voronoi/test.js @@ -4,7 +4,7 @@ import glob from 'glob'; import path from 'path'; import load from 'load-json-file'; import write from 'write-json-file'; -import voronoi from '.'; +import voronoi from './dist/js/index.js'; test('turf-voronoi', t => { glob.sync(path.join(__dirname, 'test', 'in', '*.json')).forEach(filepath => { diff --git a/packages/turf/.gitignore b/packages/turf/.gitignore index 5768bdaf52..42b43bad70 100644 --- a/packages/turf/.gitignore +++ b/packages/turf/.gitignore @@ -1,10 +1 @@ -turf.js -turf.js.map -turf.mjs -turf.mjs.map -turf.min.js -turf.es.js -turf.es.js.map -turf.min.js.map test.example.js -index.js \ No newline at end of file diff --git a/packages/turf/package.json b/packages/turf/package.json index da9d861253..fa2dc60b46 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -2,24 +2,20 @@ "name": "@turf/turf", "version": "6.0.0", "description": "a JavaScript library for performing geospatial operations with GeoJSON", - "main": "index.js", - "module": "turf.mjs", - "browser": "turf.min.js", + "main": "dist/js/index.js", + "module": "dist/es/index.js", + "browser": "dist/turf.min.js", "types": "index.d.ts", "files": [ - "index.js", - "index.mjs", - "index.d.ts", - "turf.js", - "turf.mjs", - "turf.min.js" + "dist", + "index.d.ts" ], "scripts": { "last-checks": "npm-run-all last-checks:testjs last-checks:example", "last-checks:example": "node test.example.js", "last-checks:testjs": "node test.js", "prepare": "rollup -c rollup.config.js", - "pretest": "rollup -f cjs -o index.js index.mjs", + "pretest": "npm-run-all prepare", "test": "echo '@turf/turf tests run in the last-checks step'" }, "repository": { diff --git a/packages/turf/rollup.config.js b/packages/turf/rollup.config.js index 11a07c4794..45741309ca 100644 --- a/packages/turf/rollup.config.js +++ b/packages/turf/rollup.config.js @@ -2,13 +2,13 @@ import node from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs' import uglify from 'rollup-plugin-uglify' -const pckg = require('./package') +const pckg = require('./package.json') const input = 'index.mjs' export default [{ input, output: [ - {file: pckg.main + '.js', format: 'umd', name: 'turf'}, + {file: pckg.main, format: 'cjs'}, {file: pckg.module, format: 'es'}, ], plugins: [commonjs(), node()] diff --git a/packages/turf/test.js b/packages/turf/test.js index e6445015b3..68852d5d3f 100644 --- a/packages/turf/test.js +++ b/packages/turf/test.js @@ -4,7 +4,7 @@ const glob = require('glob'); const test = require('tape'); const camelcase = require('camelcase'); const documentation = require('documentation'); -const turf = require('./'); +const turf = require('./dist/js/index.js'); // Helpers const directory = path.join(__dirname, '..'); @@ -200,7 +200,7 @@ test('turf -- parsing dependencies from index.js', t => { test('turf -- missing modules', t => { const files = { typescript: fs.readFileSync(path.join(__dirname, 'index.d.ts')), - modules: fs.readFileSync(path.join(__dirname, 'index.js')) + modules: fs.readFileSync(path.join(__dirname, 'dist/js/index.js')) }; modules.forEach(({name}) => { @@ -297,7 +297,7 @@ const turfTypescriptPath = path.join(__dirname, '..', 'turf-*', 'index.d.ts'); // Test Strings const requireString = `const test = require('tape'); -const turf = require('./index'); +const turf = require('./dist/js/index.js'); `; /** diff --git a/rollup.config.js b/rollup.config.js index 34fd3c1666..98bbd3c71a 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,8 +3,8 @@ import typescript from './rollup-plugins/typescript-export'; export default { input: 'index.js', output: [ - {file: 'main.js', format: 'cjs'}, - {file: 'main.es.js', format: 'es'} + {file: 'dist/js/index.js', format: 'cjs'}, + {file: 'dist/es/index.js', format: 'es'} ], plugins: [typescript()] }