diff --git a/package.json b/package.json index f918e99b46..00ca74327a 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "lint:eslint": "eslint packages", "lint:prettier": "prettier --check .", "lintDISABLED:mrl": "mrl check", - "lint:escheck-cjs": "es-check es8 packages/*/dist/index.js packages/turf/turf.min.js", - "lint:escheck-esm": "es-check --module es8 packages/*/dist/index.mjs", + "lint:escheck-cjs": "es-check es8 packages/*/dist/cjs/index.cjs packages/turf/turf.min.js", + "lint:escheck-esm": "es-check --module es8 packages/*/dist/esm/index.mjs", "lint:escheck-web": "es-check es5 packages/turf/turf.min.js", "lint:docs": "documentation lint packages/turf-*/index.js packages/turf-*/index.mjs", "preinstall": "npx only-allow pnpm", @@ -61,6 +61,7 @@ "progress": "^2.0.3", "rollup": "^2.79.1", "ts-node": "^9.0.0", + "tsup": "^8.0.1", "tsx": "^4.6.2", "typescript": "^5.2.2", "yamljs": "^0.3.0" diff --git a/packages/turf-along/package.json b/packages/turf-along/package.json index 19acb412bc..df48d1dedd 100644 --- a/packages/turf-along/package.json +++ b/packages/turf-along/package.json @@ -23,13 +23,21 @@ "turf", "distance" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-angle/package.json b/packages/turf-angle/package.json index 63560f549b..f02637d7ca 100644 --- a/packages/turf-angle/package.json +++ b/packages/turf-angle/package.json @@ -23,13 +23,21 @@ "turf", "angle" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-area/package.json b/packages/turf-area/package.json index 44e348abf1..5d475843a6 100644 --- a/packages/turf-area/package.json +++ b/packages/turf-area/package.json @@ -22,13 +22,21 @@ "polygon", "multipolygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-bbox-clip/package.json b/packages/turf-bbox-clip/package.json index bb50f2def7..95f20b85ef 100644 --- a/packages/turf-bbox-clip/package.json +++ b/packages/turf-bbox-clip/package.json @@ -28,13 +28,21 @@ "bbox", "clip" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-bbox-polygon/package.json b/packages/turf-bbox-polygon/package.json index 7178495656..6c42da1e11 100644 --- a/packages/turf-bbox-polygon/package.json +++ b/packages/turf-bbox-polygon/package.json @@ -23,13 +23,21 @@ "extent", "bbox" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-bbox/package.json b/packages/turf-bbox/package.json index bda6586c4f..010e7b7548 100644 --- a/packages/turf-bbox/package.json +++ b/packages/turf-bbox/package.json @@ -24,13 +24,21 @@ "featurecollection", "geojson" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-bearing/package.json b/packages/turf-bearing/package.json index 5830daa9a5..c0d470209d 100644 --- a/packages/turf-bearing/package.json +++ b/packages/turf-bearing/package.json @@ -20,13 +20,21 @@ "turf", "bearing" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-bezier-spline/package.json b/packages/turf-bezier-spline/package.json index 24e225e845..c0336c6589 100644 --- a/packages/turf-bezier-spline/package.json +++ b/packages/turf-bezier-spline/package.json @@ -23,13 +23,21 @@ "curve", "linestring" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-clockwise/package.json b/packages/turf-boolean-clockwise/package.json index 68cef49c06..d0e4103a0f 100755 --- a/packages/turf-boolean-clockwise/package.json +++ b/packages/turf-boolean-clockwise/package.json @@ -27,13 +27,21 @@ "clockwise", "boolean" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-concave/package.json b/packages/turf-boolean-concave/package.json index 9c3f24091e..1c73a09b0b 100644 --- a/packages/turf-boolean-concave/package.json +++ b/packages/turf-boolean-concave/package.json @@ -26,13 +26,21 @@ "convex", "boolean" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-contains/package.json b/packages/turf-boolean-contains/package.json index 78fbcb2a74..403df13a8a 100644 --- a/packages/turf-boolean-contains/package.json +++ b/packages/turf-boolean-contains/package.json @@ -26,13 +26,21 @@ "boolean", "de-9im" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-crosses/package.json b/packages/turf-boolean-crosses/package.json index 3d9dffd5ab..805ecf8903 100644 --- a/packages/turf-boolean-crosses/package.json +++ b/packages/turf-boolean-crosses/package.json @@ -26,13 +26,21 @@ "boolean", "de-9im" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-disjoint/package.json b/packages/turf-boolean-disjoint/package.json index 76061ec586..9b84e0647c 100644 --- a/packages/turf-boolean-disjoint/package.json +++ b/packages/turf-boolean-disjoint/package.json @@ -26,13 +26,21 @@ "boolean", "de-9im" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-equal/package.json b/packages/turf-boolean-equal/package.json index ceb50c897b..9f8cff5d7a 100644 --- a/packages/turf-boolean-equal/package.json +++ b/packages/turf-boolean-equal/package.json @@ -29,13 +29,21 @@ "equal", "boolean-equal" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -44,7 +52,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-intersects/package.json b/packages/turf-boolean-intersects/package.json index dd264d33a3..37898c1c44 100644 --- a/packages/turf-boolean-intersects/package.json +++ b/packages/turf-boolean-intersects/package.json @@ -26,13 +26,21 @@ "boolean", "de-9im" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-overlap/package.json b/packages/turf-boolean-overlap/package.json index 7d8db1eb39..9300004a1f 100755 --- a/packages/turf-boolean-overlap/package.json +++ b/packages/turf-boolean-overlap/package.json @@ -28,13 +28,21 @@ "overlap", "boolean-overlap" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-parallel/package.json b/packages/turf-boolean-parallel/package.json index be17e8c87e..5cbe53efd0 100644 --- a/packages/turf-boolean-parallel/package.json +++ b/packages/turf-boolean-parallel/package.json @@ -25,13 +25,21 @@ "boolean", "boolean-parallel" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -40,7 +48,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-point-in-polygon/package.json b/packages/turf-boolean-point-in-polygon/package.json index 6c4ccd01e6..8489912788 100644 --- a/packages/turf-boolean-point-in-polygon/package.json +++ b/packages/turf-boolean-point-in-polygon/package.json @@ -24,13 +24,21 @@ "bin", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-point-on-line/package.json b/packages/turf-boolean-point-on-line/package.json index a343441412..90f8278714 100644 --- a/packages/turf-boolean-point-on-line/package.json +++ b/packages/turf-boolean-point-on-line/package.json @@ -23,13 +23,21 @@ "turf", "booleanPointOnLine" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-touches/package.json b/packages/turf-boolean-touches/package.json index a127c151c0..6f08f7e589 100644 --- a/packages/turf-boolean-touches/package.json +++ b/packages/turf-boolean-touches/package.json @@ -27,13 +27,21 @@ "touches", "boolean-touches" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-boolean-valid/package.json b/packages/turf-boolean-valid/package.json index 6b4f1f3a30..d0f63e48a4 100644 --- a/packages/turf-boolean-valid/package.json +++ b/packages/turf-boolean-valid/package.json @@ -26,13 +26,21 @@ "boolean", "ogc" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-boolean-within/package.json b/packages/turf-boolean-within/package.json index fae42905b3..b653f30ebb 100644 --- a/packages/turf-boolean-within/package.json +++ b/packages/turf-boolean-within/package.json @@ -27,13 +27,21 @@ "within", "boolean-within" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-buffer/package.json b/packages/turf-buffer/package.json index 4fde1886ee..422ee10520 100644 --- a/packages/turf-buffer/package.json +++ b/packages/turf-buffer/package.json @@ -30,13 +30,21 @@ "geojson", "turf" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -46,7 +54,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-center-mean/package.json b/packages/turf-center-mean/package.json index 75bee966e9..f8bac7c1ee 100644 --- a/packages/turf-center-mean/package.json +++ b/packages/turf-center-mean/package.json @@ -28,13 +28,21 @@ "geo", "turf" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-center-median/package.json b/packages/turf-center-median/package.json index ffa7352cea..863a513e2c 100644 --- a/packages/turf-center-median/package.json +++ b/packages/turf-center-median/package.json @@ -23,13 +23,21 @@ "turf", "center-median" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-center-of-mass/package.json b/packages/turf-center-of-mass/package.json index 31173b9987..cffdb35d8e 100644 --- a/packages/turf-center-of-mass/package.json +++ b/packages/turf-center-of-mass/package.json @@ -20,13 +20,21 @@ "turf", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-center/package.json b/packages/turf-center/package.json index cc249f1c19..75adf49beb 100644 --- a/packages/turf-center/package.json +++ b/packages/turf-center/package.json @@ -24,13 +24,21 @@ "geo", "turf" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-centroid/package.json b/packages/turf-centroid/package.json index 96d9209aea..e87e91d0d1 100644 --- a/packages/turf-centroid/package.json +++ b/packages/turf-centroid/package.json @@ -22,13 +22,21 @@ "geo", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-circle/package.json b/packages/turf-circle/package.json index 544627dbf7..1d6bfb81cb 100644 --- a/packages/turf-circle/package.json +++ b/packages/turf-circle/package.json @@ -24,13 +24,21 @@ "miles", "km" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-clean-coords/package.json b/packages/turf-clean-coords/package.json index 02ad770bd2..08c35e5b1d 100644 --- a/packages/turf-clean-coords/package.json +++ b/packages/turf-clean-coords/package.json @@ -24,13 +24,21 @@ "gis", "clean-coords" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-clone/package.json b/packages/turf-clone/package.json index 3d7aa88c61..3c0fa896cb 100644 --- a/packages/turf-clone/package.json +++ b/packages/turf-clone/package.json @@ -23,13 +23,21 @@ "turf", "clone" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-clusters-dbscan/package.json b/packages/turf-clusters-dbscan/package.json index 8c87ce0ffd..a22034a72f 100644 --- a/packages/turf-clusters-dbscan/package.json +++ b/packages/turf-clusters-dbscan/package.json @@ -30,13 +30,21 @@ "density", "dbscan" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -45,7 +53,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-clusters-kmeans/package.json b/packages/turf-clusters-kmeans/package.json index 3eb6fa1ab2..075a796ac6 100644 --- a/packages/turf-clusters-kmeans/package.json +++ b/packages/turf-clusters-kmeans/package.json @@ -29,13 +29,21 @@ "clustering", "k-means" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -44,7 +52,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-clusters/package.json b/packages/turf-clusters/package.json index eb07451d01..1a4ea9fd36 100644 --- a/packages/turf-clusters/package.json +++ b/packages/turf-clusters/package.json @@ -26,13 +26,21 @@ "clusters", "clustering" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-collect/package.json b/packages/turf-collect/package.json index eb1cb7d317..1794471274 100644 --- a/packages/turf-collect/package.json +++ b/packages/turf-collect/package.json @@ -27,13 +27,21 @@ "polygons", "stats" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-combine/package.json b/packages/turf-combine/package.json index 2938f614a7..e0a1241a5c 100644 --- a/packages/turf-combine/package.json +++ b/packages/turf-combine/package.json @@ -23,13 +23,21 @@ "multipolygon", "combine" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-concave/package.json b/packages/turf-concave/package.json index bfc30a78a6..cb0c279b3c 100644 --- a/packages/turf-concave/package.json +++ b/packages/turf-concave/package.json @@ -33,13 +33,21 @@ "concave", "geometry" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -48,7 +56,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-convex/package.json b/packages/turf-convex/package.json index 56e1d86920..5b193a7b24 100644 --- a/packages/turf-convex/package.json +++ b/packages/turf-convex/package.json @@ -20,13 +20,21 @@ "turf", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-destination/package.json b/packages/turf-destination/package.json index d917112468..bfcb46a456 100644 --- a/packages/turf-destination/package.json +++ b/packages/turf-destination/package.json @@ -24,13 +24,21 @@ "miles", "km" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-difference/package.json b/packages/turf-difference/package.json index a53c833f1d..c953f22493 100644 --- a/packages/turf-difference/package.json +++ b/packages/turf-difference/package.json @@ -20,13 +20,21 @@ "turf", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-directional-mean/package.json b/packages/turf-directional-mean/package.json index 98981753b1..7259dcdd48 100644 --- a/packages/turf-directional-mean/package.json +++ b/packages/turf-directional-mean/package.json @@ -23,13 +23,21 @@ "turf", "directional-mean" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-dissolve/package.json b/packages/turf-dissolve/package.json index d01ce47b5f..dd386c4e29 100644 --- a/packages/turf-dissolve/package.json +++ b/packages/turf-dissolve/package.json @@ -23,13 +23,21 @@ "geojson", "polygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-distance-weight/package.json b/packages/turf-distance-weight/package.json index 125816cd82..ff7d342f49 100644 --- a/packages/turf-distance-weight/package.json +++ b/packages/turf-distance-weight/package.json @@ -23,13 +23,21 @@ "turf", "distance-weight" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-distance/package.json b/packages/turf-distance/package.json index e7f086b904..dc5ea3b606 100644 --- a/packages/turf-distance/package.json +++ b/packages/turf-distance/package.json @@ -22,13 +22,21 @@ "miles", "km" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-ellipse/package.json b/packages/turf-ellipse/package.json index 6dc472bbe7..c92bf37346 100644 --- a/packages/turf-ellipse/package.json +++ b/packages/turf-ellipse/package.json @@ -23,13 +23,21 @@ "turf", "ellipse" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-envelope/package.json b/packages/turf-envelope/package.json index a8087a1f9f..8579f4b82b 100644 --- a/packages/turf-envelope/package.json +++ b/packages/turf-envelope/package.json @@ -23,13 +23,21 @@ "polygon", "extent" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-explode/package.json b/packages/turf-explode/package.json index c95798c0e0..f623bea27a 100644 --- a/packages/turf-explode/package.json +++ b/packages/turf-explode/package.json @@ -22,13 +22,21 @@ "geospatial", "coordinates" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-flatten/package.json b/packages/turf-flatten/package.json index 3fd57035da..f706d75d42 100644 --- a/packages/turf-flatten/package.json +++ b/packages/turf-flatten/package.json @@ -27,13 +27,21 @@ "gis", "featurecollection" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-flip/package.json b/packages/turf-flip/package.json index 473887c1b8..b4d86c1569 100644 --- a/packages/turf-flip/package.json +++ b/packages/turf-flip/package.json @@ -22,13 +22,21 @@ "coordinate", "flip" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-geojson-rbush/package.json b/packages/turf-geojson-rbush/package.json index 3127c54c07..7246ad0a1f 100644 --- a/packages/turf-geojson-rbush/package.json +++ b/packages/turf-geojson-rbush/package.json @@ -28,13 +28,21 @@ "spatial", "rbush" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -44,7 +52,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-great-circle/package.json b/packages/turf-great-circle/package.json index 891e6f018b..61f33f9cda 100644 --- a/packages/turf-great-circle/package.json +++ b/packages/turf-great-circle/package.json @@ -28,13 +28,21 @@ "great", "circle" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -44,7 +52,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-helpers/package.json b/packages/turf-helpers/package.json index 4f023b3edc..c2a55db3e0 100644 --- a/packages/turf-helpers/package.json +++ b/packages/turf-helpers/package.json @@ -28,13 +28,21 @@ "turf", "geojson" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-hex-grid/package.json b/packages/turf-hex-grid/package.json index 14c569330f..bc67901530 100644 --- a/packages/turf-hex-grid/package.json +++ b/packages/turf-hex-grid/package.json @@ -32,13 +32,21 @@ "points", "geojson" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -47,7 +55,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-interpolate/package.json b/packages/turf-interpolate/package.json index d6164a870e..f66c5ecc18 100644 --- a/packages/turf-interpolate/package.json +++ b/packages/turf-interpolate/package.json @@ -24,13 +24,21 @@ "idw", "interpolate" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -40,7 +48,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-intersect/package.json b/packages/turf-intersect/package.json index 3b29ce4b0a..c027e92650 100644 --- a/packages/turf-intersect/package.json +++ b/packages/turf-intersect/package.json @@ -21,13 +21,21 @@ "gis", "intersect" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -36,7 +44,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-invariant/package.json b/packages/turf-invariant/package.json index dd071adb24..f2e81868c1 100644 --- a/packages/turf-invariant/package.json +++ b/packages/turf-invariant/package.json @@ -25,13 +25,21 @@ "invariant", "expectations" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -40,7 +48,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-isobands/package.json b/packages/turf-isobands/package.json index 21b875a67d..caaad61e9b 100644 --- a/packages/turf-isobands/package.json +++ b/packages/turf-isobands/package.json @@ -28,13 +28,21 @@ "topography", "filled" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-isolines/package.json b/packages/turf-isolines/package.json index 913678fa5c..3605ddb5b1 100644 --- a/packages/turf-isolines/package.json +++ b/packages/turf-isolines/package.json @@ -27,13 +27,21 @@ "elevation", "topography" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-kinks/package.json b/packages/turf-kinks/package.json index b11dbeb4e3..f5de3dfc25 100644 --- a/packages/turf-kinks/package.json +++ b/packages/turf-kinks/package.json @@ -21,13 +21,21 @@ "kinks", "self-intersection" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -36,7 +44,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-length/package.json b/packages/turf-length/package.json index ddaf27c4de..551669f3db 100644 --- a/packages/turf-length/package.json +++ b/packages/turf-length/package.json @@ -28,13 +28,21 @@ "units", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-line-arc/package.json b/packages/turf-line-arc/package.json index 2428164f27..6ad0974ce3 100644 --- a/packages/turf-line-arc/package.json +++ b/packages/turf-line-arc/package.json @@ -20,13 +20,21 @@ "turf", "gif" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-line-chunk/package.json b/packages/turf-line-chunk/package.json index 4479ca7e9e..38f79bdbbc 100644 --- a/packages/turf-line-chunk/package.json +++ b/packages/turf-line-chunk/package.json @@ -29,13 +29,21 @@ "linestring", "line segment" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -45,7 +53,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-line-intersect/package.json b/packages/turf-line-intersect/package.json index fa3d67c6b0..5982947b34 100644 --- a/packages/turf-line-intersect/package.json +++ b/packages/turf-line-intersect/package.json @@ -27,13 +27,21 @@ "line", "intersect" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-line-offset/package.json b/packages/turf-line-offset/package.json index 6e66fca130..2b1a454d14 100644 --- a/packages/turf-line-offset/package.json +++ b/packages/turf-line-offset/package.json @@ -27,13 +27,21 @@ "turf", "offset" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-line-overlap/package.json b/packages/turf-line-overlap/package.json index d46a5d1e8d..528a8725fe 100644 --- a/packages/turf-line-overlap/package.json +++ b/packages/turf-line-overlap/package.json @@ -26,13 +26,21 @@ "line", "overlap" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-line-segment/package.json b/packages/turf-line-segment/package.json index 6b03ac5adc..0aafd7a5f4 100644 --- a/packages/turf-line-segment/package.json +++ b/packages/turf-line-segment/package.json @@ -21,13 +21,21 @@ "line", "segment" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -36,7 +44,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-line-slice-along/package.json b/packages/turf-line-slice-along/package.json index 4232d57ec8..6b8cd6155e 100644 --- a/packages/turf-line-slice-along/package.json +++ b/packages/turf-line-slice-along/package.json @@ -21,13 +21,21 @@ "along", "line-slice" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-line-slice/package.json b/packages/turf-line-slice/package.json index 6a2d371a95..d045e42612 100644 --- a/packages/turf-line-slice/package.json +++ b/packages/turf-line-slice/package.json @@ -25,13 +25,21 @@ "line", "distance" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-line-split/package.json b/packages/turf-line-split/package.json index 3f60a86fbb..4093782eff 100644 --- a/packages/turf-line-split/package.json +++ b/packages/turf-line-split/package.json @@ -26,13 +26,21 @@ "line", "split" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-line-to-polygon/package.json b/packages/turf-line-to-polygon/package.json index 7337d4af34..658e8e4e86 100644 --- a/packages/turf-line-to-polygon/package.json +++ b/packages/turf-line-to-polygon/package.json @@ -26,13 +26,21 @@ "linestring", "line" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-mask/package.json b/packages/turf-mask/package.json index 1ffe33cfb8..67e4fde201 100644 --- a/packages/turf-mask/package.json +++ b/packages/turf-mask/package.json @@ -21,13 +21,21 @@ "mask", "polygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-meta/package.json b/packages/turf-meta/package.json index c31294d2c3..74fafdec94 100644 --- a/packages/turf-meta/package.json +++ b/packages/turf-meta/package.json @@ -43,13 +43,21 @@ "lineEeach", "lineReduce" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -59,7 +67,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-midpoint/package.json b/packages/turf-midpoint/package.json index b483680cad..320d0bfbf5 100644 --- a/packages/turf-midpoint/package.json +++ b/packages/turf-midpoint/package.json @@ -23,13 +23,21 @@ "geojson", "line" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-moran-index/package.json b/packages/turf-moran-index/package.json index b55dfc1c97..fc1909d3dd 100644 --- a/packages/turf-moran-index/package.json +++ b/packages/turf-moran-index/package.json @@ -23,13 +23,21 @@ "turf", "moran-index" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-nearest-neighbor-analysis/package.json b/packages/turf-nearest-neighbor-analysis/package.json index 5d9a22ada2..7374e5139e 100644 --- a/packages/turf-nearest-neighbor-analysis/package.json +++ b/packages/turf-nearest-neighbor-analysis/package.json @@ -23,13 +23,21 @@ "turf", "nearest-neighbor" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-nearest-point-on-line/package.json b/packages/turf-nearest-point-on-line/package.json index f74c7af9d1..cf69161a51 100644 --- a/packages/turf-nearest-point-on-line/package.json +++ b/packages/turf-nearest-point-on-line/package.json @@ -16,13 +16,20 @@ "publishConfig": { "access": "public" }, - "main": "dist/index.js", - "module": "dist/index.mjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -31,7 +38,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index a9fd462484..2d616430ea 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -26,13 +26,21 @@ "near", "nearest-point-to-line" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-nearest-point/package.json b/packages/turf-nearest-point/package.json index 3906c18470..0829f8bbb2 100644 --- a/packages/turf-nearest-point/package.json +++ b/packages/turf-nearest-point/package.json @@ -24,13 +24,21 @@ "nearest", "point" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-planepoint/package.json b/packages/turf-planepoint/package.json index 1154d9ec00..7d42d498de 100644 --- a/packages/turf-planepoint/package.json +++ b/packages/turf-planepoint/package.json @@ -23,13 +23,21 @@ "point", "interpolation" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-point-grid/package.json b/packages/turf-point-grid/package.json index a22fc3001a..003190f21c 100644 --- a/packages/turf-point-grid/package.json +++ b/packages/turf-point-grid/package.json @@ -26,13 +26,21 @@ "points", "geojson" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-point-on-feature/package.json b/packages/turf-point-on-feature/package.json index 73b293a23d..219c19c880 100644 --- a/packages/turf-point-on-feature/package.json +++ b/packages/turf-point-on-feature/package.json @@ -24,13 +24,21 @@ "surface", "polygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-point-to-line-distance/package.json b/packages/turf-point-to-line-distance/package.json index f9d31a85ab..3dfd1dfada 100644 --- a/packages/turf-point-to-line-distance/package.json +++ b/packages/turf-point-to-line-distance/package.json @@ -24,13 +24,21 @@ "point-to-line-distance", "distance" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-points-within-polygon/package.json b/packages/turf-points-within-polygon/package.json index 193456dc80..7c578bf828 100644 --- a/packages/turf-points-within-polygon/package.json +++ b/packages/turf-points-within-polygon/package.json @@ -23,13 +23,21 @@ "polygon", "featurecollection" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-polygon-smooth/package.json b/packages/turf-polygon-smooth/package.json index 01f83c869f..96d756b4fb 100644 --- a/packages/turf-polygon-smooth/package.json +++ b/packages/turf-polygon-smooth/package.json @@ -24,13 +24,21 @@ "geojson", "polygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-polygon-tangents/package.json b/packages/turf-polygon-tangents/package.json index 2aa98bffec..16c0ebe9ca 100644 --- a/packages/turf-polygon-tangents/package.json +++ b/packages/turf-polygon-tangents/package.json @@ -27,13 +27,21 @@ "tangent", "polygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-polygon-to-line/package.json b/packages/turf-polygon-to-line/package.json index 97bb3c9c8b..c114f25a7e 100644 --- a/packages/turf-polygon-to-line/package.json +++ b/packages/turf-polygon-to-line/package.json @@ -23,13 +23,21 @@ "linestring", "polygon" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-polygonize/package.json b/packages/turf-polygonize/package.json index 5455687744..899e755f6a 100644 --- a/packages/turf-polygonize/package.json +++ b/packages/turf-polygonize/package.json @@ -26,13 +26,21 @@ "gis", "polygonize" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-projection/package.json b/packages/turf-projection/package.json index 2d63ea6b92..afa7661a8a 100644 --- a/packages/turf-projection/package.json +++ b/packages/turf-projection/package.json @@ -34,13 +34,21 @@ "EPSG:900913", "EPSG:102113" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -49,7 +57,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-quadrat-analysis/package.json b/packages/turf-quadrat-analysis/package.json index 8da5d90f08..f20c7eb376 100644 --- a/packages/turf-quadrat-analysis/package.json +++ b/packages/turf-quadrat-analysis/package.json @@ -23,13 +23,21 @@ "turf", "quadrat-analysis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-random/package.json b/packages/turf-random/package.json index 88785ace71..7057e6ba5e 100644 --- a/packages/turf-random/package.json +++ b/packages/turf-random/package.json @@ -20,13 +20,21 @@ "turf", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-rectangle-grid/package.json b/packages/turf-rectangle-grid/package.json index c5c020177f..f5ee2ae136 100644 --- a/packages/turf-rectangle-grid/package.json +++ b/packages/turf-rectangle-grid/package.json @@ -26,13 +26,21 @@ "regular", "cartesian" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-rewind/package.json b/packages/turf-rewind/package.json index 6cd86d9f07..88e885a3f2 100644 --- a/packages/turf-rewind/package.json +++ b/packages/turf-rewind/package.json @@ -28,13 +28,21 @@ "polygon", "rewind" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-rhumb-bearing/package.json b/packages/turf-rhumb-bearing/package.json index 6676d88da5..2e407b9631 100644 --- a/packages/turf-rhumb-bearing/package.json +++ b/packages/turf-rhumb-bearing/package.json @@ -28,13 +28,21 @@ "rhumb", "rhumb line" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-rhumb-destination/package.json b/packages/turf-rhumb-destination/package.json index 0ee8fabd00..b133bf94ad 100644 --- a/packages/turf-rhumb-destination/package.json +++ b/packages/turf-rhumb-destination/package.json @@ -32,13 +32,21 @@ "miles", "km" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -47,7 +55,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-rhumb-distance/package.json b/packages/turf-rhumb-distance/package.json index 042bda67b5..5e2cd9a506 100644 --- a/packages/turf-rhumb-distance/package.json +++ b/packages/turf-rhumb-distance/package.json @@ -30,13 +30,21 @@ "miles", "km" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -45,7 +53,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-sample/package.json b/packages/turf-sample/package.json index 9528f88152..8c605db6a8 100644 --- a/packages/turf-sample/package.json +++ b/packages/turf-sample/package.json @@ -22,13 +22,21 @@ "sample", "turf" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -37,7 +45,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-sector/package.json b/packages/turf-sector/package.json index 203bfaa167..48dd522f17 100644 --- a/packages/turf-sector/package.json +++ b/packages/turf-sector/package.json @@ -20,13 +20,21 @@ "turf", "gif" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-shortest-path/package.json b/packages/turf-shortest-path/package.json index a1af9c79cb..3cd7600a20 100644 --- a/packages/turf-shortest-path/package.json +++ b/packages/turf-shortest-path/package.json @@ -25,13 +25,21 @@ "shortest-path", "path" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -40,7 +48,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-simplify/package.json b/packages/turf-simplify/package.json index 9483774cde..9f2746bc23 100644 --- a/packages/turf-simplify/package.json +++ b/packages/turf-simplify/package.json @@ -28,13 +28,21 @@ "algorithm", "peucker" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -43,7 +51,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-square-grid/package.json b/packages/turf-square-grid/package.json index 1eee6fedb9..c8bb97ae4d 100644 --- a/packages/turf-square-grid/package.json +++ b/packages/turf-square-grid/package.json @@ -23,13 +23,21 @@ "cartesian", "grid" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-square/package.json b/packages/turf-square/package.json index 569fc35141..88d033bc30 100644 --- a/packages/turf-square/package.json +++ b/packages/turf-square/package.json @@ -22,13 +22,21 @@ "geojson", "extent" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -38,7 +46,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-standard-deviational-ellipse/package.json b/packages/turf-standard-deviational-ellipse/package.json index 60489e5bda..ae12ec08a3 100644 --- a/packages/turf-standard-deviational-ellipse/package.json +++ b/packages/turf-standard-deviational-ellipse/package.json @@ -25,13 +25,21 @@ "geostatistics", "directional distribution" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-tag/package.json b/packages/turf-tag/package.json index 9302a5a673..281ff527d2 100644 --- a/packages/turf-tag/package.json +++ b/packages/turf-tag/package.json @@ -26,13 +26,21 @@ "data", "analysis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -41,7 +49,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-tesselate/package.json b/packages/turf-tesselate/package.json index 67303b10ea..14f0ef314b 100644 --- a/packages/turf-tesselate/package.json +++ b/packages/turf-tesselate/package.json @@ -30,13 +30,21 @@ "polygon", "triangles" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -46,7 +54,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf-tin/package.json b/packages/turf-tin/package.json index e8bb870deb..280960767a 100644 --- a/packages/turf-tin/package.json +++ b/packages/turf-tin/package.json @@ -21,13 +21,21 @@ "tin", "triangulate" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -36,7 +44,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-transform-rotate/package.json b/packages/turf-transform-rotate/package.json index 386fdc5ac8..74894e7062 100644 --- a/packages/turf-transform-rotate/package.json +++ b/packages/turf-transform-rotate/package.json @@ -26,13 +26,21 @@ "transformation", "rotate" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -42,7 +50,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-transform-scale/package.json b/packages/turf-transform-scale/package.json index 9e2175fbf1..6546fe4407 100644 --- a/packages/turf-transform-scale/package.json +++ b/packages/turf-transform-scale/package.json @@ -30,13 +30,21 @@ "zoom-in", "zoom-out" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -46,7 +54,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-transform-translate/package.json b/packages/turf-transform-translate/package.json index 78ba094de6..6a3c74fdac 100644 --- a/packages/turf-transform-translate/package.json +++ b/packages/turf-transform-translate/package.json @@ -28,13 +28,21 @@ "move", "shift" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -44,7 +52,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-triangle-grid/package.json b/packages/turf-triangle-grid/package.json index 9e7d4b0bed..1b16b3fadf 100644 --- a/packages/turf-triangle-grid/package.json +++ b/packages/turf-triangle-grid/package.json @@ -24,13 +24,21 @@ "analysis", "gis" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-truncate/package.json b/packages/turf-truncate/package.json index 321cd901d5..40e81375f4 100644 --- a/packages/turf-truncate/package.json +++ b/packages/turf-truncate/package.json @@ -25,13 +25,21 @@ "gis", "truncate" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -40,7 +48,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-union/package.json b/packages/turf-union/package.json index 63946da009..b12d6b1891 100644 --- a/packages/turf-union/package.json +++ b/packages/turf-union/package.json @@ -20,13 +20,21 @@ "turf", "gif" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -35,7 +43,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-unkink-polygon/package.json b/packages/turf-unkink-polygon/package.json index 293a2a478e..86c71b999c 100644 --- a/packages/turf-unkink-polygon/package.json +++ b/packages/turf-unkink-polygon/package.json @@ -23,13 +23,21 @@ "polygon", "self-intersection" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -39,7 +47,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", diff --git a/packages/turf-voronoi/package.json b/packages/turf-voronoi/package.json index f61b20a1c5..d8d148fe99 100644 --- a/packages/turf-voronoi/package.json +++ b/packages/turf-voronoi/package.json @@ -29,13 +29,21 @@ "polygons", "points" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "sideEffects": false, @@ -45,7 +53,7 @@ ], "scripts": { "bench": "tsx bench.ts", - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting", + "build": "tsup --config ../../tsup.config.ts", "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts" diff --git a/packages/turf/package.json b/packages/turf/package.json index 11675c5ac4..6ce48f5bdb 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -43,13 +43,21 @@ "jenks", "sample" ], - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "commonjs", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.mjs", + "types": "dist/cjs/index.d.ts", "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.cjs" + } } }, "browser": "turf.min.js", @@ -60,7 +68,7 @@ "turf.min.js" ], "scripts": { - "build": "tsup index.?s --dts --format esm,cjs --cjsInterop --splitting && rollup -c rollup.config.js", + "build": "tsup --config ../../tsup.config.ts && rollup -c rollup.config.js", "last-checks": "npm-run-all last-checks:testjs last-checks:example", "last-checks:example": "tsx test.example.js", "last-checks:testjs": "tsx test.ts", @@ -72,6 +80,7 @@ "@rollup/plugin-babel": "^5.3.1", "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-node-resolve": "^11.2.1", + "@types/tape": "^4.2.32", "camelcase": "^8.0.0", "documentation": "^13.2.5", "glob": "^10.3.10", diff --git a/packages/turf/test.ts b/packages/turf/test.ts index 621d5a0036..6798691abd 100644 --- a/packages/turf/test.ts +++ b/packages/turf/test.ts @@ -4,7 +4,7 @@ import { glob } from "glob"; import test from "tape"; import camelCase from "camelcase"; import documentation from "documentation"; -import * as turf from "./dist/index"; +import * as turf from "./index"; // Helpers const directory = path.join(__dirname, ".."); @@ -218,8 +218,8 @@ test("turf -- parsing dependencies from index.js", (t) => { // Test for missing modules test("turf -- missing modules", (t) => { const files = { - typescript: fs.readFileSync(path.join(__dirname, "dist/index.d.ts")), - modules: fs.readFileSync(path.join(__dirname, "dist/index.js")), + typescript: fs.readFileSync(path.join(__dirname, "dist/cjs/index.d.ts")), + modules: fs.readFileSync(path.join(__dirname, "dist/cjs/index.cjs")), }; modules.forEach(({ name }) => { @@ -328,7 +328,7 @@ const turfTypescriptPath = path.join(__dirname, "..", "turf-*", "index.d.ts"); // Test Strings const requireString = `const test = require('tape'); -const turf = require('./dist/index.js'); +const turf = require('./dist/cjs/index.cjs'); `; /** diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18fe9ab0b5..41f8a27fc7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,6 +89,9 @@ importers: ts-node: specifier: ^9.0.0 version: 9.1.1(typescript@5.3.3) + tsup: + specifier: ^8.0.1 + version: 8.0.1(ts-node@9.1.1)(typescript@5.3.3) tsx: specifier: ^4.6.2 version: 4.6.2 @@ -456,6 +459,9 @@ importers: '@rollup/plugin-node-resolve': specifier: ^11.2.1 version: 11.2.1(rollup@2.79.1) + '@types/tape': + specifier: ^4.2.32 + version: 4.13.4 camelcase: specifier: ^8.0.0 version: 8.0.0 diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000000..e56e70b0a8 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,28 @@ +import { defineConfig, type Options } from "tsup"; + +const baseOptions: Options = { + clean: true, + dts: true, + entry: ["index.?s"], + minify: false, + skipNodeModulesBundle: true, + sourcemap: true, + target: "es2017", + tsconfig: "./tsconfig.json", + keepNames: true, + treeshake: true, +}; + +export default [ + defineConfig({ + ...baseOptions, + outDir: "dist/cjs", + format: "cjs", + outExtension: () => ({ js: ".cjs" }), + }), + defineConfig({ + ...baseOptions, + outDir: "dist/esm", + format: "esm", + }), +];