From a924d5e1fee9c0c58e6dcd9464908a8f578e21c4 Mon Sep 17 00:00:00 2001 From: James Beard Date: Sun, 23 Jun 2024 17:50:15 +1000 Subject: [PATCH 01/10] Configuring types.ts tests using a dedicated tsconfig file in each package, rather than specifying the arguments on the command line. --- packages/turf-boolean-touches/package.json | 2 +- packages/turf-boolean-touches/tsconfig.testTypes.json | 7 +++++++ packages/turf-boolean-within/package.json | 2 +- packages/turf-boolean-within/tsconfig.testTypes.json | 7 +++++++ packages/turf-buffer/package.json | 2 +- packages/turf-buffer/tsconfig.testTypes.json | 7 +++++++ packages/turf-center-mean/package.json | 2 +- packages/turf-center-mean/tsconfig.testTypes.json | 7 +++++++ packages/turf-center-of-mass/package.json | 2 +- packages/turf-center-of-mass/tsconfig.testTypes.json | 7 +++++++ packages/turf-center/package.json | 2 +- packages/turf-center/tsconfig.testTypes.json | 7 +++++++ packages/turf-centroid/package.json | 2 +- packages/turf-centroid/tsconfig.testTypes.json | 7 +++++++ packages/turf-circle/package.json | 2 +- packages/turf-circle/tsconfig.testTypes.json | 7 +++++++ packages/turf-clean-coords/package.json | 2 +- packages/turf-clean-coords/tsconfig.testTypes.json | 7 +++++++ packages/turf-clone/package.json | 2 +- packages/turf-clone/tsconfig.testTypes.json | 7 +++++++ packages/turf-clusters-dbscan/package.json | 2 +- packages/turf-clusters-dbscan/tsconfig.testTypes.json | 7 +++++++ packages/turf-clusters-kmeans/package.json | 2 +- packages/turf-clusters-kmeans/tsconfig.testTypes.json | 7 +++++++ packages/turf-clusters/package.json | 2 +- packages/turf-clusters/tsconfig.testTypes.json | 7 +++++++ packages/turf-flatten/package.json | 2 +- packages/turf-flatten/tsconfig.testTypes.json | 7 +++++++ packages/turf-flip/package.json | 2 +- packages/turf-flip/tsconfig.testTypes.json | 7 +++++++ packages/turf-geojson-rbush/package.json | 2 +- packages/turf-geojson-rbush/tsconfig.testTypes.json | 7 +++++++ packages/turf-great-circle/package.json | 2 +- packages/turf-great-circle/tsconfig.testTypes.json | 7 +++++++ packages/turf-helpers/package.json | 2 +- packages/turf-helpers/tsconfig.testTypes.json | 7 +++++++ packages/turf-hex-grid/package.json | 2 +- packages/turf-hex-grid/tsconfig.testTypes.json | 7 +++++++ packages/turf-interpolate/package.json | 2 +- packages/turf-interpolate/tsconfig.testTypes.json | 7 +++++++ packages/turf-intersect/package.json | 2 +- packages/turf-intersect/tsconfig.testTypes.json | 7 +++++++ packages/turf-invariant/package.json | 2 +- packages/turf-invariant/tsconfig.testTypes.json | 7 +++++++ packages/turf-isolines/package.json | 2 +- packages/turf-isolines/tsconfig.testTypes.json | 7 +++++++ packages/turf-kinks/package.json | 2 +- packages/turf-kinks/tsconfig.testTypes.json | 7 +++++++ packages/turf-line-arc/package.json | 2 +- packages/turf-line-arc/tsconfig.testTypes.json | 7 +++++++ packages/turf-line-chunk/package.json | 2 +- packages/turf-line-chunk/tsconfig.testTypes.json | 7 +++++++ packages/turf-line-offset/package.json | 2 +- packages/turf-line-offset/tsconfig.testTypes.json | 7 +++++++ packages/turf-line-overlap/package.json | 2 +- packages/turf-line-overlap/tsconfig.testTypes.json | 7 +++++++ packages/turf-line-to-polygon/package.json | 2 +- packages/turf-line-to-polygon/tsconfig.testTypes.json | 7 +++++++ packages/turf-mask/package.json | 2 +- packages/turf-mask/tsconfig.testTypes.json | 7 +++++++ packages/turf-meta/package.json | 2 +- packages/turf-meta/tsconfig.testTypes.json | 7 +++++++ packages/turf-nearest-point-on-line/package.json | 2 +- .../turf-nearest-point-on-line/tsconfig.testTypes.json | 7 +++++++ packages/turf-nearest-point-to-line/package.json | 2 +- .../turf-nearest-point-to-line/tsconfig.testTypes.json | 7 +++++++ packages/turf-nearest-point/package.json | 2 +- packages/turf-nearest-point/tsconfig.testTypes.json | 7 +++++++ packages/turf-planepoint/package.json | 2 +- packages/turf-planepoint/tsconfig.testTypes.json | 7 +++++++ packages/turf-point-grid/package.json | 2 +- packages/turf-point-grid/tsconfig.testTypes.json | 7 +++++++ packages/turf-point-to-line-distance/package.json | 2 +- .../turf-point-to-line-distance/tsconfig.testTypes.json | 7 +++++++ packages/turf-points-within-polygon/package.json | 2 +- .../turf-points-within-polygon/tsconfig.testTypes.json | 7 +++++++ packages/turf-polygon-smooth/package.json | 2 +- packages/turf-polygon-smooth/tsconfig.testTypes.json | 7 +++++++ packages/turf-polygon-tangents/package.json | 2 +- packages/turf-polygon-tangents/tsconfig.testTypes.json | 7 +++++++ packages/turf-polygonize/package.json | 2 +- packages/turf-polygonize/tsconfig.testTypes.json | 7 +++++++ packages/turf-projection/package.json | 2 +- packages/turf-projection/tsconfig.testTypes.json | 7 +++++++ packages/turf-rewind/package.json | 2 +- packages/turf-rewind/tsconfig.testTypes.json | 7 +++++++ packages/turf-sector/package.json | 2 +- packages/turf-sector/tsconfig.testTypes.json | 7 +++++++ packages/turf-shortest-path/package.json | 2 +- packages/turf-shortest-path/tsconfig.testTypes.json | 7 +++++++ packages/turf-simplify/package.json | 2 +- packages/turf-simplify/tsconfig.testTypes.json | 7 +++++++ packages/turf-standard-deviational-ellipse/package.json | 2 +- .../tsconfig.testTypes.json | 7 +++++++ packages/turf-tin/package.json | 2 +- packages/turf-tin/tsconfig.testTypes.json | 7 +++++++ packages/turf-transform-rotate/package.json | 2 +- packages/turf-transform-rotate/tsconfig.testTypes.json | 7 +++++++ packages/turf-transform-scale/package.json | 2 +- packages/turf-transform-scale/tsconfig.testTypes.json | 7 +++++++ packages/turf-transform-translate/package.json | 2 +- packages/turf-transform-translate/tsconfig.testTypes.json | 7 +++++++ packages/turf-triangle-grid/package.json | 2 +- packages/turf-triangle-grid/tsconfig.testTypes.json | 7 +++++++ packages/turf-truncate/package.json | 2 +- packages/turf-truncate/tsconfig.testTypes.json | 7 +++++++ packages/turf-union/package.json | 2 +- packages/turf-union/tsconfig.testTypes.json | 7 +++++++ packages/turf-unkink-polygon/package.json | 2 +- packages/turf-unkink-polygon/tsconfig.testTypes.json | 7 +++++++ 110 files changed, 440 insertions(+), 55 deletions(-) create mode 100644 packages/turf-boolean-touches/tsconfig.testTypes.json create mode 100644 packages/turf-boolean-within/tsconfig.testTypes.json create mode 100644 packages/turf-buffer/tsconfig.testTypes.json create mode 100644 packages/turf-center-mean/tsconfig.testTypes.json create mode 100644 packages/turf-center-of-mass/tsconfig.testTypes.json create mode 100644 packages/turf-center/tsconfig.testTypes.json create mode 100644 packages/turf-centroid/tsconfig.testTypes.json create mode 100644 packages/turf-circle/tsconfig.testTypes.json create mode 100644 packages/turf-clean-coords/tsconfig.testTypes.json create mode 100644 packages/turf-clone/tsconfig.testTypes.json create mode 100644 packages/turf-clusters-dbscan/tsconfig.testTypes.json create mode 100644 packages/turf-clusters-kmeans/tsconfig.testTypes.json create mode 100644 packages/turf-clusters/tsconfig.testTypes.json create mode 100644 packages/turf-flatten/tsconfig.testTypes.json create mode 100644 packages/turf-flip/tsconfig.testTypes.json create mode 100644 packages/turf-geojson-rbush/tsconfig.testTypes.json create mode 100644 packages/turf-great-circle/tsconfig.testTypes.json create mode 100644 packages/turf-helpers/tsconfig.testTypes.json create mode 100644 packages/turf-hex-grid/tsconfig.testTypes.json create mode 100644 packages/turf-interpolate/tsconfig.testTypes.json create mode 100644 packages/turf-intersect/tsconfig.testTypes.json create mode 100644 packages/turf-invariant/tsconfig.testTypes.json create mode 100644 packages/turf-isolines/tsconfig.testTypes.json create mode 100644 packages/turf-kinks/tsconfig.testTypes.json create mode 100644 packages/turf-line-arc/tsconfig.testTypes.json create mode 100644 packages/turf-line-chunk/tsconfig.testTypes.json create mode 100644 packages/turf-line-offset/tsconfig.testTypes.json create mode 100644 packages/turf-line-overlap/tsconfig.testTypes.json create mode 100644 packages/turf-line-to-polygon/tsconfig.testTypes.json create mode 100644 packages/turf-mask/tsconfig.testTypes.json create mode 100644 packages/turf-meta/tsconfig.testTypes.json create mode 100644 packages/turf-nearest-point-on-line/tsconfig.testTypes.json create mode 100644 packages/turf-nearest-point-to-line/tsconfig.testTypes.json create mode 100644 packages/turf-nearest-point/tsconfig.testTypes.json create mode 100644 packages/turf-planepoint/tsconfig.testTypes.json create mode 100644 packages/turf-point-grid/tsconfig.testTypes.json create mode 100644 packages/turf-point-to-line-distance/tsconfig.testTypes.json create mode 100644 packages/turf-points-within-polygon/tsconfig.testTypes.json create mode 100644 packages/turf-polygon-smooth/tsconfig.testTypes.json create mode 100644 packages/turf-polygon-tangents/tsconfig.testTypes.json create mode 100644 packages/turf-polygonize/tsconfig.testTypes.json create mode 100644 packages/turf-projection/tsconfig.testTypes.json create mode 100644 packages/turf-rewind/tsconfig.testTypes.json create mode 100644 packages/turf-sector/tsconfig.testTypes.json create mode 100644 packages/turf-shortest-path/tsconfig.testTypes.json create mode 100644 packages/turf-simplify/tsconfig.testTypes.json create mode 100644 packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json create mode 100644 packages/turf-tin/tsconfig.testTypes.json create mode 100644 packages/turf-transform-rotate/tsconfig.testTypes.json create mode 100644 packages/turf-transform-scale/tsconfig.testTypes.json create mode 100644 packages/turf-transform-translate/tsconfig.testTypes.json create mode 100644 packages/turf-triangle-grid/tsconfig.testTypes.json create mode 100644 packages/turf-truncate/tsconfig.testTypes.json create mode 100644 packages/turf-union/tsconfig.testTypes.json create mode 100644 packages/turf-unkink-polygon/tsconfig.testTypes.json diff --git a/packages/turf-boolean-touches/package.json b/packages/turf-boolean-touches/package.json index d4cf7fd409..143226f927 100644 --- a/packages/turf-boolean-touches/package.json +++ b/packages/turf-boolean-touches/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-touches/tsconfig.testTypes.json b/packages/turf-boolean-touches/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-boolean-touches/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-boolean-within/package.json b/packages/turf-boolean-within/package.json index 94a9f165fa..12b03cb3e9 100644 --- a/packages/turf-boolean-within/package.json +++ b/packages/turf-boolean-within/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-within/tsconfig.testTypes.json b/packages/turf-boolean-within/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-boolean-within/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-buffer/package.json b/packages/turf-buffer/package.json index 87d1e9a581..668d3e029c 100644 --- a/packages/turf-buffer/package.json +++ b/packages/turf-buffer/package.json @@ -57,7 +57,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-buffer/tsconfig.testTypes.json b/packages/turf-buffer/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-buffer/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-center-mean/package.json b/packages/turf-center-mean/package.json index b613c5fad3..74b098b213 100644 --- a/packages/turf-center-mean/package.json +++ b/packages/turf-center-mean/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/center": "workspace:^", diff --git a/packages/turf-center-mean/tsconfig.testTypes.json b/packages/turf-center-mean/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-center-mean/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-center-of-mass/package.json b/packages/turf-center-of-mass/package.json index cefc548714..5a58a73ec4 100644 --- a/packages/turf-center-of-mass/package.json +++ b/packages/turf-center-of-mass/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-center-of-mass/tsconfig.testTypes.json b/packages/turf-center-of-mass/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-center-of-mass/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-center/package.json b/packages/turf-center/package.json index 5cff045363..fa9b935858 100644 --- a/packages/turf-center/package.json +++ b/packages/turf-center/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-center/tsconfig.testTypes.json b/packages/turf-center/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-center/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-centroid/package.json b/packages/turf-centroid/package.json index 9169fcf5cb..42119fa8a1 100644 --- a/packages/turf-centroid/package.json +++ b/packages/turf-centroid/package.json @@ -49,7 +49,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-centroid/tsconfig.testTypes.json b/packages/turf-centroid/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-centroid/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-circle/package.json b/packages/turf-circle/package.json index d04995f28e..763b43a964 100644 --- a/packages/turf-circle/package.json +++ b/packages/turf-circle/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@placemarkio/check-geojson": "^0.1.12", diff --git a/packages/turf-circle/tsconfig.testTypes.json b/packages/turf-circle/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-circle/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-clean-coords/package.json b/packages/turf-clean-coords/package.json index 0b283a08b0..a5adda05d1 100644 --- a/packages/turf-clean-coords/package.json +++ b/packages/turf-clean-coords/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-clean-coords/tsconfig.testTypes.json b/packages/turf-clean-coords/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-clean-coords/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-clone/package.json b/packages/turf-clone/package.json index 7696cf7424..4a65f551a0 100644 --- a/packages/turf-clone/package.json +++ b/packages/turf-clone/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/meta": "workspace:^", diff --git a/packages/turf-clone/tsconfig.testTypes.json b/packages/turf-clone/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-clone/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-clusters-dbscan/package.json b/packages/turf-clusters-dbscan/package.json index cb48836239..1a9403d640 100644 --- a/packages/turf-clusters-dbscan/package.json +++ b/packages/turf-clusters-dbscan/package.json @@ -57,7 +57,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/centroid": "workspace:^", diff --git a/packages/turf-clusters-dbscan/tsconfig.testTypes.json b/packages/turf-clusters-dbscan/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-clusters-dbscan/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-clusters-kmeans/package.json b/packages/turf-clusters-kmeans/package.json index e7a5676d3e..16b69ae1f5 100644 --- a/packages/turf-clusters-kmeans/package.json +++ b/packages/turf-clusters-kmeans/package.json @@ -56,7 +56,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/centroid": "workspace:^", diff --git a/packages/turf-clusters-kmeans/tsconfig.testTypes.json b/packages/turf-clusters-kmeans/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-clusters-kmeans/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-clusters/package.json b/packages/turf-clusters/package.json index 0a285d63d7..6aa23113fa 100644 --- a/packages/turf-clusters/package.json +++ b/packages/turf-clusters/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-clusters/tsconfig.testTypes.json b/packages/turf-clusters/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-clusters/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-flatten/package.json b/packages/turf-flatten/package.json index 5ea04bea56..7cde1feb31 100644 --- a/packages/turf-flatten/package.json +++ b/packages/turf-flatten/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-flatten/tsconfig.testTypes.json b/packages/turf-flatten/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-flatten/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-flip/package.json b/packages/turf-flip/package.json index 772d5e293d..8863d14e04 100644 --- a/packages/turf-flip/package.json +++ b/packages/turf-flip/package.json @@ -49,7 +49,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-flip/tsconfig.testTypes.json b/packages/turf-flip/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-flip/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-geojson-rbush/package.json b/packages/turf-geojson-rbush/package.json index 61f4f0473a..9ffc833ea1 100644 --- a/packages/turf-geojson-rbush/package.json +++ b/packages/turf-geojson-rbush/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-geojson-rbush/tsconfig.testTypes.json b/packages/turf-geojson-rbush/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-geojson-rbush/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-great-circle/package.json b/packages/turf-great-circle/package.json index 7effa65b0e..b1e9ac02c6 100644 --- a/packages/turf-great-circle/package.json +++ b/packages/turf-great-circle/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-great-circle/tsconfig.testTypes.json b/packages/turf-great-circle/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-great-circle/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-helpers/package.json b/packages/turf-helpers/package.json index e13b8787e9..47535f30c6 100644 --- a/packages/turf-helpers/package.json +++ b/packages/turf-helpers/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-helpers/tsconfig.testTypes.json b/packages/turf-helpers/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-helpers/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-hex-grid/package.json b/packages/turf-hex-grid/package.json index 748416011b..0d1b2241e9 100644 --- a/packages/turf-hex-grid/package.json +++ b/packages/turf-hex-grid/package.json @@ -59,7 +59,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-hex-grid/tsconfig.testTypes.json b/packages/turf-hex-grid/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-hex-grid/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-interpolate/package.json b/packages/turf-interpolate/package.json index e0d457db62..854441d8a7 100644 --- a/packages/turf-interpolate/package.json +++ b/packages/turf-interpolate/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-interpolate/tsconfig.testTypes.json b/packages/turf-interpolate/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-interpolate/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-intersect/package.json b/packages/turf-intersect/package.json index 7100fb0fd7..9e7f9c0449 100644 --- a/packages/turf-intersect/package.json +++ b/packages/turf-intersect/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-intersect/tsconfig.testTypes.json b/packages/turf-intersect/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-intersect/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-invariant/package.json b/packages/turf-invariant/package.json index 821fc13bc0..2d4d2b0546 100644 --- a/packages/turf-invariant/package.json +++ b/packages/turf-invariant/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-invariant/tsconfig.testTypes.json b/packages/turf-invariant/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-invariant/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-isolines/package.json b/packages/turf-isolines/package.json index df809b5ef7..d35c829872 100644 --- a/packages/turf-isolines/package.json +++ b/packages/turf-isolines/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/envelope": "workspace:^", diff --git a/packages/turf-isolines/tsconfig.testTypes.json b/packages/turf-isolines/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-isolines/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-kinks/package.json b/packages/turf-kinks/package.json index 3c261417df..18f6054730 100644 --- a/packages/turf-kinks/package.json +++ b/packages/turf-kinks/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/meta": "workspace:^", diff --git a/packages/turf-kinks/tsconfig.testTypes.json b/packages/turf-kinks/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-kinks/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-line-arc/package.json b/packages/turf-line-arc/package.json index c6da7c8c31..5b81823326 100644 --- a/packages/turf-line-arc/package.json +++ b/packages/turf-line-arc/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-line-arc/tsconfig.testTypes.json b/packages/turf-line-arc/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-line-arc/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-line-chunk/package.json b/packages/turf-line-chunk/package.json index ccea240d41..127b7fbeef 100644 --- a/packages/turf-line-chunk/package.json +++ b/packages/turf-line-chunk/package.json @@ -56,7 +56,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-line-chunk/tsconfig.testTypes.json b/packages/turf-line-chunk/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-line-chunk/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-line-offset/package.json b/packages/turf-line-offset/package.json index deabf65426..abca4672c0 100644 --- a/packages/turf-line-offset/package.json +++ b/packages/turf-line-offset/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-line-offset/tsconfig.testTypes.json b/packages/turf-line-offset/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-line-offset/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-line-overlap/package.json b/packages/turf-line-overlap/package.json index 6b3ec645dd..969eb6d993 100644 --- a/packages/turf-line-overlap/package.json +++ b/packages/turf-line-overlap/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-line-overlap/tsconfig.testTypes.json b/packages/turf-line-overlap/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-line-overlap/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-line-to-polygon/package.json b/packages/turf-line-to-polygon/package.json index 10871952d9..09fe366632 100644 --- a/packages/turf-line-to-polygon/package.json +++ b/packages/turf-line-to-polygon/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-line-to-polygon/tsconfig.testTypes.json b/packages/turf-line-to-polygon/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-line-to-polygon/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-mask/package.json b/packages/turf-mask/package.json index 3f3a07f787..176438949a 100644 --- a/packages/turf-mask/package.json +++ b/packages/turf-mask/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-mask/tsconfig.testTypes.json b/packages/turf-mask/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-mask/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-meta/package.json b/packages/turf-meta/package.json index 8db7d4ef0c..962aec2a20 100644 --- a/packages/turf-meta/package.json +++ b/packages/turf-meta/package.json @@ -70,7 +70,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/random": "workspace:^", diff --git a/packages/turf-meta/tsconfig.testTypes.json b/packages/turf-meta/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-meta/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-nearest-point-on-line/package.json b/packages/turf-nearest-point-on-line/package.json index 7b6cd4debb..2ee14690e1 100644 --- a/packages/turf-nearest-point-on-line/package.json +++ b/packages/turf-nearest-point-on-line/package.json @@ -43,7 +43,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/along": "workspace:^", diff --git a/packages/turf-nearest-point-on-line/tsconfig.testTypes.json b/packages/turf-nearest-point-on-line/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-nearest-point-on-line/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index 431eee65f7..f83c4c1e95 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/circle": "workspace:^", diff --git a/packages/turf-nearest-point-to-line/tsconfig.testTypes.json b/packages/turf-nearest-point-to-line/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-nearest-point-to-line/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-nearest-point/package.json b/packages/turf-nearest-point/package.json index 468406b876..ee95e2b68b 100644 --- a/packages/turf-nearest-point/package.json +++ b/packages/turf-nearest-point/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-nearest-point/tsconfig.testTypes.json b/packages/turf-nearest-point/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-nearest-point/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-planepoint/package.json b/packages/turf-planepoint/package.json index fbf4297dde..6b8b93a297 100644 --- a/packages/turf-planepoint/package.json +++ b/packages/turf-planepoint/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "benchmark": "^2.1.4", diff --git a/packages/turf-planepoint/tsconfig.testTypes.json b/packages/turf-planepoint/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-planepoint/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-point-grid/package.json b/packages/turf-point-grid/package.json index cde79c16c4..0255b45f18 100644 --- a/packages/turf-point-grid/package.json +++ b/packages/turf-point-grid/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-point-grid/tsconfig.testTypes.json b/packages/turf-point-grid/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-point-grid/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-point-to-line-distance/package.json b/packages/turf-point-to-line-distance/package.json index 065faf4d5c..bc27ca171a 100644 --- a/packages/turf-point-to-line-distance/package.json +++ b/packages/turf-point-to-line-distance/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/circle": "workspace:^", diff --git a/packages/turf-point-to-line-distance/tsconfig.testTypes.json b/packages/turf-point-to-line-distance/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-point-to-line-distance/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-points-within-polygon/package.json b/packages/turf-points-within-polygon/package.json index 67b82b527f..a94c7a9408 100644 --- a/packages/turf-points-within-polygon/package.json +++ b/packages/turf-points-within-polygon/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-points-within-polygon/tsconfig.testTypes.json b/packages/turf-points-within-polygon/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-points-within-polygon/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-polygon-smooth/package.json b/packages/turf-polygon-smooth/package.json index d2c9da64b4..7a47e08874 100644 --- a/packages/turf-polygon-smooth/package.json +++ b/packages/turf-polygon-smooth/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygon-smooth/tsconfig.testTypes.json b/packages/turf-polygon-smooth/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-polygon-smooth/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-polygon-tangents/package.json b/packages/turf-polygon-tangents/package.json index dc96e17567..fdb3f4a314 100644 --- a/packages/turf-polygon-tangents/package.json +++ b/packages/turf-polygon-tangents/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygon-tangents/tsconfig.testTypes.json b/packages/turf-polygon-tangents/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-polygon-tangents/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-polygonize/package.json b/packages/turf-polygonize/package.json index 26b237b8e7..7ea85e9c07 100644 --- a/packages/turf-polygonize/package.json +++ b/packages/turf-polygonize/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygonize/tsconfig.testTypes.json b/packages/turf-polygonize/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-polygonize/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-projection/package.json b/packages/turf-projection/package.json index 0e8acef559..6b7cff6a40 100644 --- a/packages/turf-projection/package.json +++ b/packages/turf-projection/package.json @@ -61,7 +61,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-projection/tsconfig.testTypes.json b/packages/turf-projection/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-projection/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-rewind/package.json b/packages/turf-rewind/package.json index 331c68d4db..cd6535051c 100644 --- a/packages/turf-rewind/package.json +++ b/packages/turf-rewind/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-rewind/tsconfig.testTypes.json b/packages/turf-rewind/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-rewind/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-sector/package.json b/packages/turf-sector/package.json index 6b49c1207b..cf43e501d2 100644 --- a/packages/turf-sector/package.json +++ b/packages/turf-sector/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-sector/tsconfig.testTypes.json b/packages/turf-sector/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-sector/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-shortest-path/package.json b/packages/turf-shortest-path/package.json index 174cb952d7..742752f0be 100644 --- a/packages/turf-shortest-path/package.json +++ b/packages/turf-shortest-path/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-shortest-path/tsconfig.testTypes.json b/packages/turf-shortest-path/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-shortest-path/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-simplify/package.json b/packages/turf-simplify/package.json index c446cc44c5..c2aaac38d9 100644 --- a/packages/turf-simplify/package.json +++ b/packages/turf-simplify/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-simplify/tsconfig.testTypes.json b/packages/turf-simplify/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-simplify/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-standard-deviational-ellipse/package.json b/packages/turf-standard-deviational-ellipse/package.json index 7b483a864a..22212d23fb 100644 --- a/packages/turf-standard-deviational-ellipse/package.json +++ b/packages/turf-standard-deviational-ellipse/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/random": "workspace:^", diff --git a/packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json b/packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-tin/package.json b/packages/turf-tin/package.json index f8cfd6b320..13eaddb249 100644 --- a/packages/turf-tin/package.json +++ b/packages/turf-tin/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-tin/tsconfig.testTypes.json b/packages/turf-tin/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-tin/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-transform-rotate/package.json b/packages/turf-transform-rotate/package.json index d28ac59441..31786e2a69 100644 --- a/packages/turf-transform-rotate/package.json +++ b/packages/turf-transform-rotate/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-transform-rotate/tsconfig.testTypes.json b/packages/turf-transform-rotate/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-transform-rotate/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-transform-scale/package.json b/packages/turf-transform-scale/package.json index c3b4f3b406..88ab978157 100644 --- a/packages/turf-transform-scale/package.json +++ b/packages/turf-transform-scale/package.json @@ -57,7 +57,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-transform-scale/tsconfig.testTypes.json b/packages/turf-transform-scale/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-transform-scale/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-transform-translate/package.json b/packages/turf-transform-translate/package.json index f7157bb723..8534add55d 100644 --- a/packages/turf-transform-translate/package.json +++ b/packages/turf-transform-translate/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-transform-translate/tsconfig.testTypes.json b/packages/turf-transform-translate/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-transform-translate/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-triangle-grid/package.json b/packages/turf-triangle-grid/package.json index 44d1f58a8e..0c0bd58591 100644 --- a/packages/turf-triangle-grid/package.json +++ b/packages/turf-triangle-grid/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-triangle-grid/tsconfig.testTypes.json b/packages/turf-triangle-grid/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-triangle-grid/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-truncate/package.json b/packages/turf-truncate/package.json index 37a0f46968..ba3acacc3f 100644 --- a/packages/turf-truncate/package.json +++ b/packages/turf-truncate/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-truncate/tsconfig.testTypes.json b/packages/turf-truncate/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-truncate/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-union/package.json b/packages/turf-union/package.json index ce7b7e3fe8..ee3bad7ffc 100644 --- a/packages/turf-union/package.json +++ b/packages/turf-union/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-union/tsconfig.testTypes.json b/packages/turf-union/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-union/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/packages/turf-unkink-polygon/package.json b/packages/turf-unkink-polygon/package.json index 360b0fb75b..887c21d6ea 100644 --- a/packages/turf-unkink-polygon/package.json +++ b/packages/turf-unkink-polygon/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts" + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/kinks": "workspace:^", diff --git a/packages/turf-unkink-polygon/tsconfig.testTypes.json b/packages/turf-unkink-polygon/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/packages/turf-unkink-polygon/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} From 180efa7906599b5b7fffe228b513f83597b0eb50 Mon Sep 17 00:00:00 2001 From: James Beard Date: Sun, 23 Jun 2024 17:54:20 +1000 Subject: [PATCH 02/10] Experimenting with changes to when and why we build different JS artefacts. See discussion https://github.com/Turfjs/turf/discussions/2629 --- .monorepolint.config.mjs | 11 +- nx.json | 2 +- package.json | 5 +- packages/turf/package.json | 13 ++ pnpm-lock.yaml | 265 +++++------------------------- templates/tsconfig.testTypes.json | 7 + tsconfig.shared.json | 10 +- 7 files changed, 79 insertions(+), 234 deletions(-) create mode 100644 templates/tsconfig.testTypes.json diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index c3bf85e249..b34a950a42 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -5,6 +5,7 @@ import * as fs from "node:fs"; import { alphabeticalDependencies, alphabeticalScripts, + fileContents, packageOrder, packageEntry, packageScript, @@ -50,6 +51,13 @@ const JS_TAPE_PACKAGES = TAPE_PACKAGES.filter( export default { rules: [ + fileContents({ + options: { + file: "tsconfig.testTypes.json", + templateFile: "./templates/tsconfig.testTypes.json", + }, + includePackages: TYPES_PACKAGES, + }), packageOrder({ options: { order: [ @@ -208,8 +216,7 @@ export default { packageScript({ options: { scripts: { - "test:types": - "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts", + "test:types": "tsc -p ./tsconfig.testTypes.json", }, }, includePackages: TYPES_PACKAGES, diff --git a/nx.json b/nx.json index 87f3cd2f1b..8bae838462 100644 --- a/nx.json +++ b/nx.json @@ -28,7 +28,7 @@ "{projectRoot}/test/**", "{projectRoot}/types.ts" ], - "dependsOn": ["build"], + "dependsOn": [], "cache": true }, "last-checks": { diff --git a/package.json b/package.json index 7074ca63d8..459cb253f4 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,10 @@ "lint:eslint": "eslint packages", "lint:mrl": "mrl check", "lint:prettier": "prettier --check .", + "postinstall": "husky install", "preinstall": "npx only-allow pnpm", - "prepare": "lerna run build && husky install", - "test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks" + "prepublish": "lerna run build && lerna run --scope @turf/turf last-checks", + "test": "lerna run test" }, "lint-staged": { "package.json": [ diff --git a/packages/turf/package.json b/packages/turf/package.json index d8e3994138..2c2941c09f 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -204,6 +204,19 @@ "@turf/union": "workspace:^", "@turf/unkink-polygon": "workspace:^", "@turf/voronoi": "workspace:^", + "concaveman": "^1.2.1", + "d3-geo": "1.7.1", + "d3-voronoi": "1.1.2", + "deep-equal": "^2.2.3", + "earcut": "^2.2.4", + "marchingsquares": "^1.3.3", + "point-in-polygon-hao": "^1.1.0", + "polygon-clipping": "^0.15.3", + "rbush": "^3.0.1", + "skmeans": "0.9.7", + "sweepline-intersections": "^1.5.0", + "topojson-client": "3.x", + "topojson-server": "3.x", "tslib": "^2.6.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 372c573d2e..f70aa1b06b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -449,6 +449,45 @@ importers: '@turf/voronoi': specifier: workspace:^ version: link:../turf-voronoi + concaveman: + specifier: ^1.2.1 + version: 1.2.1 + d3-geo: + specifier: 1.7.1 + version: 1.7.1 + d3-voronoi: + specifier: 1.1.2 + version: 1.1.2 + deep-equal: + specifier: ^2.2.3 + version: 2.2.3 + earcut: + specifier: ^2.2.4 + version: 2.2.4 + marchingsquares: + specifier: ^1.3.3 + version: 1.3.3 + point-in-polygon-hao: + specifier: ^1.1.0 + version: 1.1.0 + polygon-clipping: + specifier: ^0.15.3 + version: 0.15.3 + rbush: + specifier: ^3.0.1 + version: 3.0.1 + skmeans: + specifier: 0.9.7 + version: 0.9.7 + sweepline-intersections: + specifier: ^1.5.0 + version: 1.5.0 + topojson-client: + specifier: 3.x + version: 3.1.0 + topojson-server: + specifier: 3.x + version: 3.0.1 tslib: specifier: ^2.6.2 version: 2.6.2 @@ -551,8 +590,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-along/dist/es: {} - packages/turf-angle: dependencies: '@turf/bearing': @@ -614,8 +651,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-angle/dist/es: {} - packages/turf-area: dependencies: '@turf/helpers': @@ -659,8 +694,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-area/dist/es: {} - packages/turf-bbox: dependencies: '@turf/helpers': @@ -744,8 +777,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-bbox-clip/dist/es: {} - packages/turf-bbox-polygon: dependencies: '@turf/helpers': @@ -780,10 +811,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-bbox-polygon/dist/es: {} - - packages/turf-bbox/dist/es: {} - packages/turf-bearing: dependencies: '@turf/helpers': @@ -827,8 +854,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-bearing/dist/es: {} - packages/turf-bezier-spline: dependencies: '@turf/helpers': @@ -872,8 +897,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-bezier-spline/dist/es: {} - packages/turf-boolean-clockwise: dependencies: '@turf/helpers': @@ -917,8 +940,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-clockwise/dist/es: {} - packages/turf-boolean-concave: dependencies: '@turf/helpers': @@ -962,8 +983,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-concave/dist/es: {} - packages/turf-boolean-contains: dependencies: '@turf/bbox': @@ -1022,8 +1041,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-contains/dist/es: {} - packages/turf-boolean-crosses: dependencies: '@turf/boolean-point-in-polygon': @@ -1079,8 +1096,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-crosses/dist/es: {} - packages/turf-boolean-disjoint: dependencies: '@turf/boolean-point-in-polygon': @@ -1133,8 +1148,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-disjoint/dist/es: {} - packages/turf-boolean-equal: dependencies: '@turf/clean-coords': @@ -1184,8 +1197,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-equal/dist/es: {} - packages/turf-boolean-intersects: dependencies: '@turf/boolean-disjoint': @@ -1232,8 +1243,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-intersects/dist/es: {} - packages/turf-boolean-overlap: dependencies: '@turf/helpers': @@ -1289,8 +1298,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-overlap/dist/es: {} - packages/turf-boolean-parallel: dependencies: '@turf/clean-coords': @@ -1340,8 +1347,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-boolean-parallel/dist/es: {} - packages/turf-boolean-point-in-polygon: dependencies: '@turf/helpers': @@ -1382,8 +1387,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-point-in-polygon/dist/es: {} - packages/turf-boolean-point-on-line: dependencies: '@turf/helpers': @@ -1430,8 +1433,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-boolean-point-on-line/dist/es: {} - packages/turf-boolean-touches: dependencies: '@turf/boolean-point-in-polygon': @@ -1487,8 +1488,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-touches/dist/es: {} - packages/turf-boolean-valid: dependencies: '@turf/bbox': @@ -1562,8 +1561,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-valid/dist/es: {} - packages/turf-boolean-within: dependencies: '@turf/bbox': @@ -1622,8 +1619,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-boolean-within/dist/es: {} - packages/turf-buffer: dependencies: '@turf/bbox': @@ -1679,8 +1674,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-buffer/dist/es: {} - packages/turf-center: dependencies: '@turf/bbox': @@ -1788,8 +1781,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-center-mean/dist/es: {} - packages/turf-center-median: dependencies: '@turf/center-mean': @@ -1854,8 +1845,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-center-median/dist/es: {} - packages/turf-center-of-mass: dependencies: '@turf/centroid': @@ -1911,10 +1900,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-center-of-mass/dist/es: {} - - packages/turf-center/dist/es: {} - packages/turf-centroid: dependencies: '@turf/helpers': @@ -1961,8 +1946,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-centroid/dist/es: {} - packages/turf-circle: dependencies: '@turf/destination': @@ -2012,8 +1995,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-circle/dist/es: {} - packages/turf-clean-coords: dependencies: '@turf/helpers': @@ -2060,8 +2041,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-clean-coords/dist/es: {} - packages/turf-clone: dependencies: '@turf/helpers': @@ -2099,8 +2078,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-clone/dist/es: {} - packages/turf-clusters: dependencies: '@turf/helpers': @@ -2205,8 +2182,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-clusters-dbscan/dist/es: {} - packages/turf-clusters-kmeans: dependencies: '@turf/clone': @@ -2277,10 +2252,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-clusters-kmeans/dist/es: {} - - packages/turf-clusters/dist/es: {} - packages/turf-collect: dependencies: '@turf/bbox': @@ -2327,8 +2298,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-collect/dist/es: {} - packages/turf-combine: dependencies: '@turf/helpers': @@ -2366,8 +2335,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-combine/dist/es: {} - packages/turf-concave: dependencies: '@turf/clone': @@ -2435,8 +2402,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-concave/dist/es: {} - packages/turf-convex: dependencies: '@turf/helpers': @@ -2489,8 +2454,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-convex/dist/es: {} - packages/turf-destination: dependencies: '@turf/helpers': @@ -2540,8 +2503,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-destination/dist/es: {} - packages/turf-difference: dependencies: '@turf/helpers': @@ -2591,8 +2552,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-difference/dist/es: {} - packages/turf-directional-mean: dependencies: '@turf/bearing': @@ -2651,8 +2610,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-directional-mean/dist/es: {} - packages/turf-dissolve: dependencies: '@turf/flatten': @@ -2705,8 +2662,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-dissolve/dist/es: {} - packages/turf-distance: dependencies: '@turf/helpers': @@ -2799,10 +2754,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-distance-weight/dist/es: {} - - packages/turf-distance/dist/es: {} - packages/turf-ellipse: dependencies: '@turf/helpers': @@ -2870,8 +2821,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-ellipse/dist/es: {} - packages/turf-envelope: dependencies: '@turf/bbox': @@ -2915,8 +2864,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-envelope/dist/es: {} - packages/turf-explode: dependencies: '@turf/helpers': @@ -2960,8 +2907,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-explode/dist/es: {} - packages/turf-flatten: dependencies: '@turf/helpers': @@ -3005,8 +2950,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-flatten/dist/es: {} - packages/turf-flip: dependencies: '@turf/clone': @@ -3053,8 +2996,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-flip/dist/es: {} - packages/turf-geojson-rbush: dependencies: '@turf/bbox': @@ -3150,8 +3091,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-great-circle/dist/es: {} - packages/turf-helpers: dependencies: deep-equal: @@ -3189,8 +3128,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-helpers/dist/es: {} - packages/turf-hex-grid: dependencies: '@turf/distance': @@ -3246,8 +3183,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-hex-grid/dist/es: {} - packages/turf-interpolate: dependencies: '@turf/bbox': @@ -3318,8 +3253,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-interpolate/dist/es: {} - packages/turf-intersect: dependencies: '@turf/helpers': @@ -3369,8 +3302,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-intersect/dist/es: {} - packages/turf-invariant: dependencies: '@turf/helpers': @@ -3405,8 +3336,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-invariant/dist/es: {} - packages/turf-isobands: dependencies: '@turf/area': @@ -3486,8 +3415,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-isobands/dist/es: {} - packages/turf-isolines: dependencies: '@turf/bbox': @@ -3558,8 +3485,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-isolines/dist/es: {} - packages/turf-kinks: dependencies: '@turf/helpers': @@ -3606,8 +3531,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-kinks/dist/es: {} - packages/turf-length: dependencies: '@turf/distance': @@ -3654,8 +3577,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-length/dist/es: {} - packages/turf-line-arc: dependencies: '@turf/circle': @@ -3705,8 +3626,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-arc/dist/es: {} - packages/turf-line-chunk: dependencies: '@turf/helpers': @@ -3753,8 +3672,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-chunk/dist/es: {} - packages/turf-line-intersect: dependencies: '@turf/helpers': @@ -3801,8 +3718,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-intersect/dist/es: {} - packages/turf-line-offset: dependencies: '@turf/helpers': @@ -3846,8 +3761,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-offset/dist/es: {} - packages/turf-line-overlap: dependencies: '@turf/boolean-point-on-line': @@ -3912,8 +3825,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-overlap/dist/es: {} - packages/turf-line-segment: dependencies: '@turf/helpers': @@ -3960,8 +3871,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-segment/dist/es: {} - packages/turf-line-slice: dependencies: '@turf/helpers': @@ -4051,10 +3960,6 @@ importers: specifier: ^4.6.2 version: 4.6.2 - packages/turf-line-slice-along/dist/es: {} - - packages/turf-line-slice/dist/es: {} - packages/turf-line-split: dependencies: '@turf/bbox': @@ -4116,8 +4021,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-split/dist/es: {} - packages/turf-line-to-polygon: dependencies: '@turf/bbox': @@ -4167,8 +4070,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-line-to-polygon/dist/es: {} - packages/turf-mask: dependencies: '@turf/helpers': @@ -4209,8 +4110,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-mask/dist/es: {} - packages/turf-meta: dependencies: '@turf/helpers': @@ -4239,8 +4138,6 @@ importers: specifier: ^4.6.2 version: 4.6.2 - packages/turf-meta/dist/es: {} - packages/turf-midpoint: dependencies: '@turf/bearing': @@ -4275,8 +4172,6 @@ importers: specifier: ^4.6.2 version: 4.6.2 - packages/turf-midpoint/dist/es: {} - packages/turf-moran-index: dependencies: '@turf/distance-weight': @@ -4323,8 +4218,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-moran-index/dist/es: {} - packages/turf-nearest-neighbor-analysis: dependencies: '@turf/area': @@ -4389,8 +4282,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-nearest-neighbor-analysis/dist/es: {} - packages/turf-nearest-point: dependencies: '@turf/clone': @@ -4507,8 +4398,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-nearest-point-on-line/dist/es: {} - packages/turf-nearest-point-to-line: dependencies: '@turf/helpers': @@ -4567,10 +4456,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-nearest-point-to-line/dist/es: {} - - packages/turf-nearest-point/dist/es: {} - packages/turf-planepoint: dependencies: '@turf/helpers': @@ -4596,8 +4481,6 @@ importers: specifier: ^4.6.2 version: 4.6.2 - packages/turf-planepoint/dist/es: {} - packages/turf-point-grid: dependencies: '@turf/boolean-within': @@ -4653,8 +4536,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-point-grid/dist/es: {} - packages/turf-point-on-feature: dependencies: '@turf/boolean-point-in-polygon': @@ -4710,8 +4591,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-point-on-feature/dist/es: {} - packages/turf-point-to-line-distance: dependencies: '@turf/bearing': @@ -4776,8 +4655,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-point-to-line-distance/dist/es: {} - packages/turf-points-within-polygon: dependencies: '@turf/boolean-point-in-polygon': @@ -4818,8 +4695,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-points-within-polygon/dist/es: {} - packages/turf-polygon-smooth: dependencies: '@turf/helpers': @@ -4866,8 +4741,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-polygon-smooth/dist/es: {} - packages/turf-polygon-tangents: dependencies: '@turf/bbox': @@ -4923,8 +4796,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-polygon-tangents/dist/es: {} - packages/turf-polygon-to-line: dependencies: '@turf/helpers': @@ -4968,8 +4839,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-polygon-to-line/dist/es: {} - packages/turf-polygonize: dependencies: '@turf/boolean-point-in-polygon': @@ -5022,8 +4891,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-polygonize/dist/es: {} - packages/turf-projection: dependencies: '@turf/clone': @@ -5076,8 +4943,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-projection/dist/es: {} - packages/turf-quadrat-analysis: dependencies: '@turf/area': @@ -5145,8 +5010,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-quadrat-analysis/dist/es: {} - packages/turf-random: dependencies: '@turf/helpers': @@ -5184,8 +5047,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-random/dist/es: {} - packages/turf-rectangle-grid: dependencies: '@turf/boolean-intersects': @@ -5238,8 +5099,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-rectangle-grid/dist/es: {} - packages/turf-rewind: dependencies: '@turf/boolean-clockwise': @@ -5292,8 +5151,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-rewind/dist/es: {} - packages/turf-rhumb-bearing: dependencies: '@turf/helpers': @@ -5337,8 +5194,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-rhumb-bearing/dist/es: {} - packages/turf-rhumb-destination: dependencies: '@turf/helpers': @@ -5385,8 +5240,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-rhumb-destination/dist/es: {} - packages/turf-rhumb-distance: dependencies: '@turf/helpers': @@ -5433,8 +5286,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-rhumb-distance/dist/es: {} - packages/turf-sample: dependencies: '@turf/helpers': @@ -5469,8 +5320,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-sample/dist/es: {} - packages/turf-sector: dependencies: '@turf/circle': @@ -5526,8 +5375,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-sector/dist/es: {} - packages/turf-shortest-path: dependencies: '@turf/bbox': @@ -5595,8 +5442,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-shortest-path/dist/es: {} - packages/turf-simplify: dependencies: '@turf/clean-coords': @@ -5649,8 +5494,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-simplify/dist/es: {} - packages/turf-square: dependencies: '@turf/distance': @@ -5722,10 +5565,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-square-grid/dist/es: {} - - packages/turf-square/dist/es: {} - packages/turf-standard-deviational-ellipse: dependencies: '@turf/center-mean': @@ -5781,8 +5620,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-standard-deviational-ellipse/dist/es: {} - packages/turf-tag: dependencies: '@turf/boolean-point-in-polygon': @@ -5829,8 +5666,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-tag/dist/es: {} - packages/turf-tesselate: dependencies: '@turf/helpers': @@ -5859,8 +5694,6 @@ importers: specifier: ^4.6.2 version: 4.6.2 - packages/turf-tesselate/dist/es: {} - packages/turf-tin: dependencies: '@turf/helpers': @@ -5895,8 +5728,6 @@ importers: specifier: ^5.2.2 version: 5.3.3 - packages/turf-tin/dist/es: {} - packages/turf-transform-rotate: dependencies: '@turf/centroid': @@ -5955,8 +5786,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-transform-rotate/dist/es: {} - packages/turf-transform-scale: dependencies: '@turf/bbox': @@ -6027,8 +5856,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-transform-scale/dist/es: {} - packages/turf-transform-translate: dependencies: '@turf/clone': @@ -6078,8 +5905,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-transform-translate/dist/es: {} - packages/turf-triangle-grid: dependencies: '@turf/distance': @@ -6132,8 +5957,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-triangle-grid/dist/es: {} - packages/turf-truncate: dependencies: '@turf/helpers': @@ -6177,8 +6000,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-truncate/dist/es: {} - packages/turf-union: dependencies: '@turf/helpers': @@ -6228,8 +6049,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-union/dist/es: {} - packages/turf-unkink-polygon: dependencies: '@turf/area': @@ -6279,8 +6098,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-unkink-polygon/dist/es: {} - packages/turf-voronoi: dependencies: '@turf/clone': @@ -6327,10 +6144,6 @@ importers: specifier: ^5.0.0 version: 5.0.0 - packages/turf-voronoi/dist/es: {} - - packages/turf/dist/es: {} - packages: /@aashutoshrathi/word-wrap@1.2.6: diff --git a/templates/tsconfig.testTypes.json b/templates/tsconfig.testTypes.json new file mode 100644 index 0000000000..9ec75a08c6 --- /dev/null +++ b/templates/tsconfig.testTypes.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["types.ts"] +} diff --git a/tsconfig.shared.json b/tsconfig.shared.json index 56c4f8ea85..511ff491e6 100644 --- a/tsconfig.shared.json +++ b/tsconfig.shared.json @@ -1,12 +1,16 @@ { "compilerOptions": { "target": "es2017", - "module": "node16", + "module": "esnext", "declaration": true, "esModuleInterop": true, "strict": true, - "moduleResolution": "node16", + "moduleResolution": "bundler", "importHelpers": true, - "skipLibCheck": true + "skipLibCheck": true, + "baseUrl": ".", + "paths": { + "@turf/*": ["./packages/turf-*"] + } } } From 0821730470e89c662dcf80ed4feabb5632126b5d Mon Sep 17 00:00:00 2001 From: James Beard Date: Sun, 23 Jun 2024 17:55:20 +1000 Subject: [PATCH 03/10] Need to remove some old weird type workarounds for the new approach to building to work. Simplifies things overall. --- packages/turf-clusters-dbscan/index.ts | 4 ++-- packages/turf-clusters-dbscan/lib/rbush-export.ts | 7 ------- packages/turf-collect/index.ts | 2 +- packages/turf-collect/lib/rbush-export.ts | 7 ------- packages/turf-kinks/index.ts | 4 ++-- packages/turf-kinks/lib/sweepline-intersections-export.ts | 7 ------- packages/turf-line-intersect/index.ts | 4 ++-- .../lib/sweepline-intersections-export.ts | 7 ------- 8 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 packages/turf-clusters-dbscan/lib/rbush-export.ts delete mode 100644 packages/turf-collect/lib/rbush-export.ts delete mode 100644 packages/turf-kinks/lib/sweepline-intersections-export.ts delete mode 100644 packages/turf-line-intersect/lib/sweepline-intersections-export.ts diff --git a/packages/turf-clusters-dbscan/index.ts b/packages/turf-clusters-dbscan/index.ts index 7ad8906200..bccc6b6756 100644 --- a/packages/turf-clusters-dbscan/index.ts +++ b/packages/turf-clusters-dbscan/index.ts @@ -2,7 +2,7 @@ import { GeoJsonProperties, FeatureCollection, Point } from "geojson"; import { clone } from "@turf/clone"; import { distance } from "@turf/distance"; import { degreesToRadians, lengthToDegrees, Units } from "@turf/helpers"; -import { rbush as RBush } from "./lib/rbush-export.js"; +import rbush from "rbush"; type Dbscan = "core" | "edge" | "noise"; type DbscanProps = GeoJsonProperties & { @@ -67,7 +67,7 @@ function clustersDbscan( const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units); // Create a spatial index - var tree = new RBush(points.features.length); + var tree = new rbush(points.features.length); // Keeps track of whether a point has been visited or not. var visited = points.features.map((_) => false); diff --git a/packages/turf-clusters-dbscan/lib/rbush-export.ts b/packages/turf-clusters-dbscan/lib/rbush-export.ts deleted file mode 100644 index 49463b8ab5..0000000000 --- a/packages/turf-clusters-dbscan/lib/rbush-export.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Get around problems with moduleResolution node16 and some older libraries. -// Manifests as "This expression is not callable ... has no call signatures" -// https://stackoverflow.com/a/74709714 - -import lib from "rbush"; - -export const rbush = lib as unknown as typeof lib.default; diff --git a/packages/turf-collect/index.ts b/packages/turf-collect/index.ts index bde4e7c069..d8b713adab 100644 --- a/packages/turf-collect/index.ts +++ b/packages/turf-collect/index.ts @@ -1,7 +1,7 @@ import { FeatureCollection, Polygon, Point } from "geojson"; import { bbox as turfbbox } from "@turf/bbox"; import { booleanPointInPolygon } from "@turf/boolean-point-in-polygon"; -import { rbush } from "./lib/rbush-export.js"; +import rbush from "rbush"; interface Entry { minX: number; diff --git a/packages/turf-collect/lib/rbush-export.ts b/packages/turf-collect/lib/rbush-export.ts deleted file mode 100644 index 49463b8ab5..0000000000 --- a/packages/turf-collect/lib/rbush-export.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Get around problems with moduleResolution node16 and some older libraries. -// Manifests as "This expression is not callable ... has no call signatures" -// https://stackoverflow.com/a/74709714 - -import lib from "rbush"; - -export const rbush = lib as unknown as typeof lib.default; diff --git a/packages/turf-kinks/index.ts b/packages/turf-kinks/index.ts index f8dcfb6c30..87e70783d9 100644 --- a/packages/turf-kinks/index.ts +++ b/packages/turf-kinks/index.ts @@ -8,7 +8,7 @@ import { Polygon, } from "geojson"; import { point } from "@turf/helpers"; -import { sweeplineIntersections as findIntersections } from "./lib/sweepline-intersections-export.js"; +import sweeplineIntersections from "sweepline-intersections"; /** * Takes a {@link LineString|linestring}, {@link MultiLineString|multi-linestring}, @@ -49,7 +49,7 @@ function kinks( "Polygon, or MultiPolygon Feature or Geometry" ); } - const intersections = findIntersections(featureIn, false); + const intersections = sweeplineIntersections(featureIn, false); for (let i = 0; i < intersections.length; ++i) { const intersection = intersections[i]; results.features.push(point([intersection[0], intersection[1]])); diff --git a/packages/turf-kinks/lib/sweepline-intersections-export.ts b/packages/turf-kinks/lib/sweepline-intersections-export.ts deleted file mode 100644 index 2d10f64b69..0000000000 --- a/packages/turf-kinks/lib/sweepline-intersections-export.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Get around problems with moduleResolution node16 and some older libraries. -// Manifests as "This expression is not callable ... has no call signatures" -// https://stackoverflow.com/a/74709714 - -import lib from "sweepline-intersections"; - -export const sweeplineIntersections = lib as unknown as typeof lib.default; diff --git a/packages/turf-line-intersect/index.ts b/packages/turf-line-intersect/index.ts index e4c83d30ed..9538fd022e 100644 --- a/packages/turf-line-intersect/index.ts +++ b/packages/turf-line-intersect/index.ts @@ -9,7 +9,7 @@ import { Polygon, } from "geojson"; import type { Intersection } from "sweepline-intersections"; -import { sweeplineIntersections as findIntersections } from "./lib/sweepline-intersections-export.js"; +import sweeplineIntersections from "sweepline-intersections"; /** * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s). @@ -66,7 +66,7 @@ function lineIntersect< features.push(feature(line2)); } - const intersections = findIntersections( + const intersections = sweeplineIntersections( featureCollection(features), ignoreSelfIntersections ); diff --git a/packages/turf-line-intersect/lib/sweepline-intersections-export.ts b/packages/turf-line-intersect/lib/sweepline-intersections-export.ts deleted file mode 100644 index 2d10f64b69..0000000000 --- a/packages/turf-line-intersect/lib/sweepline-intersections-export.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Get around problems with moduleResolution node16 and some older libraries. -// Manifests as "This expression is not callable ... has no call signatures" -// https://stackoverflow.com/a/74709714 - -import lib from "sweepline-intersections"; - -export const sweeplineIntersections = lib as unknown as typeof lib.default; From 232efc71412f54b2d0a1744b19ccb79278a15205 Mon Sep 17 00:00:00 2001 From: James Beard Date: Sun, 23 Jun 2024 22:20:17 +1000 Subject: [PATCH 04/10] Enabling skipNodeModulesBundle was causing dependent modules to be inlined in dist/esm/index.js files, greatly increasing their size. --- tsup.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tsup.config.ts b/tsup.config.ts index 9ff2aa452b..6f314636a0 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -5,7 +5,6 @@ const baseOptions: Options = { dts: true, entry: ["index.?s"], // while we have a mix of TS and JS packages minify: false, - skipNodeModulesBundle: true, sourcemap: true, target: "es2017", tsconfig: "./tsconfig.json", From d966fd80cfc993cc8aefe9bc25a36ef7643e2902 Mon Sep 17 00:00:00 2001 From: James Beard Date: Sun, 23 Jun 2024 23:10:53 +1000 Subject: [PATCH 05/10] These packages weren't actually needed by @turf/turf. Suspect they were causing problems in a previous build because skipNodeModulesBundle was true. That's now been removed and @turf/turf does build fine without them. --- packages/turf/package.json | 13 ------ pnpm-lock.yaml | 96 ++++++++++++++++++++++---------------- 2 files changed, 56 insertions(+), 53 deletions(-) diff --git a/packages/turf/package.json b/packages/turf/package.json index 2c2941c09f..d8e3994138 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -204,19 +204,6 @@ "@turf/union": "workspace:^", "@turf/unkink-polygon": "workspace:^", "@turf/voronoi": "workspace:^", - "concaveman": "^1.2.1", - "d3-geo": "1.7.1", - "d3-voronoi": "1.1.2", - "deep-equal": "^2.2.3", - "earcut": "^2.2.4", - "marchingsquares": "^1.3.3", - "point-in-polygon-hao": "^1.1.0", - "polygon-clipping": "^0.15.3", - "rbush": "^3.0.1", - "skmeans": "0.9.7", - "sweepline-intersections": "^1.5.0", - "topojson-client": "3.x", - "topojson-server": "3.x", "tslib": "^2.6.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f70aa1b06b..922b5c80a5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -449,45 +449,6 @@ importers: '@turf/voronoi': specifier: workspace:^ version: link:../turf-voronoi - concaveman: - specifier: ^1.2.1 - version: 1.2.1 - d3-geo: - specifier: 1.7.1 - version: 1.7.1 - d3-voronoi: - specifier: 1.1.2 - version: 1.1.2 - deep-equal: - specifier: ^2.2.3 - version: 2.2.3 - earcut: - specifier: ^2.2.4 - version: 2.2.4 - marchingsquares: - specifier: ^1.3.3 - version: 1.3.3 - point-in-polygon-hao: - specifier: ^1.1.0 - version: 1.1.0 - polygon-clipping: - specifier: ^0.15.3 - version: 0.15.3 - rbush: - specifier: ^3.0.1 - version: 3.0.1 - skmeans: - specifier: 0.9.7 - version: 0.9.7 - sweepline-intersections: - specifier: ^1.5.0 - version: 1.5.0 - topojson-client: - specifier: 3.x - version: 3.1.0 - topojson-server: - specifier: 3.x - version: 3.0.1 tslib: specifier: ^2.6.2 version: 2.6.2 @@ -533,7 +494,7 @@ importers: version: 5.7.2 tsup: specifier: ^8.0.1 - version: 8.0.1(ts-node@9.1.1)(typescript@5.3.3) + version: 8.0.1(typescript@5.3.3) tsx: specifier: ^4.6.2 version: 4.6.2 @@ -15157,6 +15118,22 @@ packages: engines: {node: '>=0.10.0'} dev: true + /postcss-load-config@4.0.2: + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 3.0.0 + yaml: 2.3.4 + dev: true + /postcss-load-config@4.0.2(ts-node@9.1.1): resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} engines: {node: '>= 14'} @@ -17001,6 +16978,45 @@ packages: - ts-node dev: true + /tsup@8.0.1(typescript@5.3.3): + resolution: {integrity: sha512-hvW7gUSG96j53ZTSlT4j/KL0q1Q2l6TqGBFc6/mu/L46IoNWqLLUzLRLP1R8Q7xrJTmkDxxDoojV5uCVs1sVOg==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@microsoft/api-extractor': ^7.36.0 + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 4.0.2(esbuild@0.19.11) + cac: 6.7.14 + chokidar: 3.5.3 + debug: 4.3.4 + esbuild: 0.19.11 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 4.0.2 + resolve-from: 5.0.0 + rollup: 4.9.0 + source-map: 0.8.0-beta.0 + sucrase: 3.34.0 + tree-kill: 1.2.2 + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /tsutils@3.21.0(typescript@3.9.10): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} From 70a8580dd57e12cbd869aa3bd25afa2922f7c585 Mon Sep 17 00:00:00 2001 From: James Beard Date: Thu, 15 Aug 2024 15:49:01 +1000 Subject: [PATCH 06/10] Type testing using tsc updated / added for all packages to at least some degree (except @turf/turf). TS projects we statically type check the index.ts itself. JS projects we type check a minimal types.ts file against the index.d.ts definition. --- .monorepolint.config.mjs | 58 ++++- packages/turf-along/package.json | 3 +- packages/turf-along/tsconfig.json | 3 +- packages/turf-angle/package.json | 3 +- packages/turf-angle/tsconfig.json | 3 +- packages/turf-area/package.json | 3 +- packages/turf-area/tsconfig.json | 3 +- packages/turf-bbox-clip/package.json | 3 +- packages/turf-bbox-clip/tsconfig.json | 3 +- packages/turf-bbox-polygon/package.json | 3 +- packages/turf-bbox-polygon/tsconfig.json | 3 +- packages/turf-bbox/package.json | 3 +- packages/turf-bbox/tsconfig.json | 3 +- packages/turf-bearing/package.json | 3 +- packages/turf-bearing/tsconfig.json | 3 +- packages/turf-bezier-spline/package.json | 3 +- packages/turf-bezier-spline/tsconfig.json | 3 +- packages/turf-boolean-clockwise/package.json | 3 +- packages/turf-boolean-clockwise/tsconfig.json | 3 +- packages/turf-boolean-concave/package.json | 3 +- packages/turf-boolean-concave/tsconfig.json | 3 +- packages/turf-boolean-contains/package.json | 3 +- packages/turf-boolean-contains/tsconfig.json | 3 +- packages/turf-boolean-crosses/package.json | 3 +- packages/turf-boolean-crosses/tsconfig.json | 3 +- packages/turf-boolean-disjoint/package.json | 3 +- packages/turf-boolean-disjoint/tsconfig.json | 3 +- packages/turf-boolean-equal/package.json | 3 +- packages/turf-boolean-equal/tsconfig.json | 3 +- packages/turf-boolean-intersects/package.json | 3 +- .../turf-boolean-intersects/tsconfig.json | 3 +- packages/turf-boolean-overlap/package.json | 3 +- packages/turf-boolean-overlap/tsconfig.json | 3 +- packages/turf-boolean-parallel/package.json | 3 +- packages/turf-boolean-parallel/tsconfig.json | 3 +- .../package.json | 3 +- .../tsconfig.json | 3 +- .../turf-boolean-point-on-line/package.json | 3 +- .../turf-boolean-point-on-line/tsconfig.json | 3 +- packages/turf-boolean-touches/package.json | 2 +- packages/turf-boolean-touches/tsconfig.json | 3 +- packages/turf-boolean-touches/types.ts | 9 - packages/turf-boolean-valid/package.json | 3 +- packages/turf-boolean-valid/tsconfig.json | 3 +- packages/turf-boolean-within/package.json | 2 +- packages/turf-boolean-within/tsconfig.json | 3 +- packages/turf-boolean-within/types.ts | 9 - packages/turf-buffer/tsconfig.testTypes.json | 2 +- packages/turf-center-mean/package.json | 2 +- packages/turf-center-mean/tsconfig.json | 3 +- packages/turf-center-mean/types.ts | 11 - packages/turf-center-median/package.json | 3 +- packages/turf-center-median/tsconfig.json | 3 +- packages/turf-center-of-mass/package.json | 2 +- packages/turf-center-of-mass/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-center-of-mass/types.ts | 10 - packages/turf-center/package.json | 2 +- packages/turf-center/tsconfig.json | 3 +- packages/turf-center/tsconfig.testTypes.json | 7 - packages/turf-center/types.ts | 10 - packages/turf-centroid/package.json | 2 +- packages/turf-centroid/tsconfig.json | 3 +- .../turf-centroid/tsconfig.testTypes.json | 7 - packages/turf-centroid/types.ts | 10 - packages/turf-circle/package.json | 2 +- packages/turf-circle/tsconfig.json | 3 +- packages/turf-circle/tsconfig.testTypes.json | 7 - packages/turf-circle/types.ts | 12 - packages/turf-clean-coords/package.json | 2 +- packages/turf-clean-coords/tsconfig.json | 3 +- .../turf-clean-coords/tsconfig.testTypes.json | 7 - packages/turf-clean-coords/types.ts | 20 -- packages/turf-clone/package.json | 2 +- packages/turf-clone/tsconfig.json | 3 +- packages/turf-clone/tsconfig.testTypes.json | 7 - packages/turf-clone/types.ts | 12 - packages/turf-clusters-dbscan/package.json | 2 +- packages/turf-clusters-dbscan/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-clusters-dbscan/types.ts | 30 --- packages/turf-clusters-kmeans/package.json | 2 +- packages/turf-clusters-kmeans/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-clusters-kmeans/types.ts | 24 -- packages/turf-clusters/package.json | 2 +- packages/turf-clusters/tsconfig.json | 3 +- .../turf-clusters/tsconfig.testTypes.json | 7 - packages/turf-clusters/types.ts | 113 ---------- packages/turf-collect/package.json | 3 +- packages/turf-collect/tsconfig.json | 3 +- packages/turf-combine/package.json | 3 +- packages/turf-combine/tsconfig.json | 3 +- packages/turf-concave/package.json | 3 +- packages/turf-concave/tsconfig.json | 3 +- packages/turf-convex/package.json | 3 +- packages/turf-convex/tsconfig.json | 3 +- packages/turf-destination/package.json | 3 +- packages/turf-destination/tsconfig.json | 3 +- packages/turf-difference/package.json | 3 +- packages/turf-difference/tsconfig.json | 3 +- packages/turf-directional-mean/package.json | 3 +- packages/turf-directional-mean/tsconfig.json | 3 +- packages/turf-dissolve/package.json | 3 +- packages/turf-dissolve/tsconfig.json | 3 +- packages/turf-distance-weight/package.json | 3 +- packages/turf-distance-weight/tsconfig.json | 3 +- packages/turf-distance/package.json | 3 +- packages/turf-distance/tsconfig.json | 3 +- packages/turf-ellipse/package.json | 3 +- packages/turf-ellipse/tsconfig.json | 3 +- packages/turf-envelope/package.json | 3 +- packages/turf-envelope/tsconfig.json | 3 +- packages/turf-explode/package.json | 3 +- packages/turf-explode/tsconfig.json | 3 +- packages/turf-flatten/package.json | 2 +- packages/turf-flatten/tsconfig.json | 3 +- packages/turf-flatten/tsconfig.testTypes.json | 7 - packages/turf-flatten/types.ts | 30 --- packages/turf-flip/package.json | 2 +- packages/turf-flip/tsconfig.json | 3 +- packages/turf-flip/tsconfig.testTypes.json | 7 - packages/turf-flip/types.ts | 26 --- .../tsconfig.testTypes.json | 2 +- .../turf-great-circle/tsconfig.testTypes.json | 2 +- packages/turf-helpers/package.json | 2 +- packages/turf-helpers/tsconfig.json | 3 +- packages/turf-helpers/tsconfig.testTypes.json | 7 - packages/turf-helpers/types.ts | 213 ------------------ packages/turf-hex-grid/package.json | 2 +- packages/turf-hex-grid/tsconfig.json | 3 +- .../turf-hex-grid/tsconfig.testTypes.json | 7 - packages/turf-hex-grid/types.ts | 23 -- .../turf-interpolate/tsconfig.testTypes.json | 2 +- packages/turf-intersect/package.json | 2 +- packages/turf-intersect/tsconfig.json | 3 +- .../turf-intersect/tsconfig.testTypes.json | 7 - packages/turf-intersect/types.ts | 25 -- packages/turf-invariant/package.json | 2 +- packages/turf-invariant/tsconfig.json | 3 +- .../turf-invariant/tsconfig.testTypes.json | 7 - packages/turf-invariant/types.ts | 77 ------- packages/turf-isobands/package.json | 3 +- packages/turf-isobands/tsconfig.json | 3 +- packages/turf-isolines/package.json | 2 +- packages/turf-isolines/tsconfig.json | 3 +- .../turf-isolines/tsconfig.testTypes.json | 7 - packages/turf-isolines/types.ts | 23 -- packages/turf-kinks/package.json | 2 +- packages/turf-kinks/tsconfig.json | 3 +- packages/turf-kinks/tsconfig.testTypes.json | 7 - packages/turf-kinks/types.ts | 13 -- packages/turf-length/package.json | 3 +- packages/turf-length/tsconfig.json | 3 +- packages/turf-line-arc/package.json | 2 +- packages/turf-line-arc/tsconfig.json | 3 +- .../turf-line-arc/tsconfig.testTypes.json | 7 - packages/turf-line-arc/types.ts | 13 -- packages/turf-line-chunk/tsconfig.json | 3 +- .../turf-line-chunk/tsconfig.testTypes.json | 2 +- packages/turf-line-intersect/package.json | 3 +- packages/turf-line-intersect/tsconfig.json | 3 +- .../turf-line-offset/tsconfig.testTypes.json | 2 +- packages/turf-line-overlap/package.json | 2 +- packages/turf-line-overlap/tsconfig.json | 3 +- .../turf-line-overlap/tsconfig.testTypes.json | 7 - packages/turf-line-overlap/types.ts | 54 ----- packages/turf-line-segment/package.json | 3 +- packages/turf-line-segment/tsconfig.json | 3 +- packages/turf-line-slice-along/package.json | 3 +- .../tsconfig.testTypes.json | 2 +- packages/turf-line-slice-along/types.ts | 1 + packages/turf-line-slice/package.json | 3 +- .../tsconfig.testTypes.json | 2 +- packages/turf-line-slice/types.ts | 1 + packages/turf-line-split/package.json | 3 +- .../tsconfig.testTypes.json | 2 +- packages/turf-line-split/types.ts | 1 + packages/turf-line-to-polygon/package.json | 2 +- packages/turf-line-to-polygon/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-line-to-polygon/types.ts | 20 -- packages/turf-mask/package.json | 2 +- packages/turf-mask/tsconfig.json | 3 +- packages/turf-mask/tsconfig.testTypes.json | 7 - packages/turf-mask/types.ts | 25 -- packages/turf-meta/tsconfig.testTypes.json | 2 +- packages/turf-midpoint/package.json | 3 +- packages/turf-midpoint/tsconfig.json | 3 +- packages/turf-moran-index/package.json | 3 +- packages/turf-moran-index/tsconfig.json | 3 +- .../package.json | 3 +- .../tsconfig.json | 3 +- .../turf-nearest-point-on-line/package.json | 2 +- .../turf-nearest-point-on-line/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-nearest-point-on-line/types.ts | 33 --- .../turf-nearest-point-to-line/package.json | 2 +- .../turf-nearest-point-to-line/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-nearest-point-to-line/types.ts | 29 --- packages/turf-nearest-point/package.json | 2 +- packages/turf-nearest-point/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-nearest-point/types.ts | 12 - packages/turf-planepoint/package.json | 2 +- packages/turf-planepoint/tsconfig.json | 3 +- .../turf-planepoint/tsconfig.testTypes.json | 7 - packages/turf-planepoint/types.ts | 16 -- packages/turf-point-grid/package.json | 2 +- packages/turf-point-grid/tsconfig.json | 3 +- .../turf-point-grid/tsconfig.testTypes.json | 7 - packages/turf-point-grid/types.ts | 23 -- packages/turf-point-on-feature/package.json | 3 +- packages/turf-point-on-feature/tsconfig.json | 3 +- .../turf-point-to-line-distance/package.json | 2 +- .../turf-point-to-line-distance/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-point-to-line-distance/types.ts | 13 -- .../turf-points-within-polygon/package.json | 2 +- .../turf-points-within-polygon/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-points-within-polygon/types.ts | 44 ---- packages/turf-polygon-smooth/package.json | 2 +- packages/turf-polygon-smooth/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-polygon-smooth/types.ts | 15 -- packages/turf-polygon-tangents/package.json | 2 +- packages/turf-polygon-tangents/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-polygon-tangents/types.ts | 16 -- packages/turf-polygon-to-line/package.json | 3 +- packages/turf-polygon-to-line/tsconfig.json | 3 +- packages/turf-polygonize/package.json | 2 +- packages/turf-polygonize/tsconfig.json | 3 +- .../turf-polygonize/tsconfig.testTypes.json | 7 - packages/turf-polygonize/types.ts | 10 - packages/turf-projection/package.json | 2 +- packages/turf-projection/tsconfig.json | 3 +- .../turf-projection/tsconfig.testTypes.json | 7 - packages/turf-projection/types.ts | 12 - packages/turf-quadrat-analysis/package.json | 3 +- packages/turf-quadrat-analysis/tsconfig.json | 3 +- packages/turf-random/package.json | 3 +- packages/turf-random/tsconfig.json | 3 +- packages/turf-rectangle-grid/package.json | 3 +- packages/turf-rectangle-grid/tsconfig.json | 3 +- packages/turf-rewind/package.json | 2 +- packages/turf-rewind/tsconfig.json | 3 +- packages/turf-rewind/tsconfig.testTypes.json | 7 - packages/turf-rewind/types.ts | 26 --- packages/turf-rhumb-bearing/package.json | 3 +- packages/turf-rhumb-bearing/tsconfig.json | 3 +- packages/turf-rhumb-destination/package.json | 3 +- packages/turf-rhumb-destination/tsconfig.json | 3 +- packages/turf-rhumb-distance/package.json | 3 +- packages/turf-rhumb-distance/tsconfig.json | 3 +- packages/turf-sample/package.json | 3 +- packages/turf-sample/tsconfig.json | 3 +- packages/turf-sector/package.json | 2 +- packages/turf-sector/tsconfig.json | 3 +- packages/turf-sector/tsconfig.testTypes.json | 7 - packages/turf-sector/types.ts | 13 -- packages/turf-shortest-path/package.json | 2 +- packages/turf-shortest-path/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-shortest-path/types.ts | 35 --- packages/turf-simplify/package.json | 2 +- packages/turf-simplify/tsconfig.json | 3 +- .../turf-simplify/tsconfig.testTypes.json | 7 - packages/turf-simplify/types.ts | 19 -- packages/turf-square-grid/package.json | 3 +- packages/turf-square-grid/tsconfig.json | 3 +- packages/turf-square/package.json | 3 +- packages/turf-square/tsconfig.json | 3 +- .../package.json | 2 +- .../tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - .../types.ts | 14 -- packages/turf-tag/package.json | 3 +- packages/turf-tag/tsconfig.json | 3 +- packages/turf-tesselate/package.json | 3 +- packages/turf-tesselate/tsconfig.json | 3 +- packages/turf-tin/package.json | 2 +- packages/turf-tin/tsconfig.json | 3 +- packages/turf-tin/tsconfig.testTypes.json | 7 - packages/turf-tin/types.ts | 10 - packages/turf-transform-rotate/package.json | 2 +- packages/turf-transform-rotate/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-transform-rotate/types.ts | 41 ---- packages/turf-transform-scale/package.json | 2 +- packages/turf-transform-scale/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-transform-scale/types.ts | 30 --- .../turf-transform-translate/package.json | 2 +- .../turf-transform-translate/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-transform-translate/types.ts | 31 --- packages/turf-triangle-grid/package.json | 2 +- packages/turf-triangle-grid/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-triangle-grid/types.ts | 16 -- packages/turf-truncate/package.json | 2 +- packages/turf-truncate/tsconfig.json | 3 +- .../turf-truncate/tsconfig.testTypes.json | 7 - packages/turf-truncate/types.ts | 29 --- packages/turf-union/package.json | 2 +- packages/turf-union/tsconfig.json | 3 +- packages/turf-union/tsconfig.testTypes.json | 7 - packages/turf-union/types.ts | 20 -- packages/turf-unkink-polygon/package.json | 2 +- packages/turf-unkink-polygon/tsconfig.json | 3 +- .../tsconfig.testTypes.json | 7 - packages/turf-unkink-polygon/types.ts | 32 --- packages/turf-voronoi/package.json | 3 +- packages/turf-voronoi/tsconfig.json | 3 +- templates/tsconfig.testTypes.json | 2 +- 318 files changed, 437 insertions(+), 1894 deletions(-) delete mode 100644 packages/turf-boolean-touches/types.ts delete mode 100644 packages/turf-boolean-within/types.ts delete mode 100644 packages/turf-center-mean/types.ts delete mode 100644 packages/turf-center-of-mass/tsconfig.testTypes.json delete mode 100644 packages/turf-center-of-mass/types.ts delete mode 100644 packages/turf-center/tsconfig.testTypes.json delete mode 100644 packages/turf-center/types.ts delete mode 100644 packages/turf-centroid/tsconfig.testTypes.json delete mode 100644 packages/turf-centroid/types.ts delete mode 100644 packages/turf-circle/tsconfig.testTypes.json delete mode 100644 packages/turf-circle/types.ts delete mode 100644 packages/turf-clean-coords/tsconfig.testTypes.json delete mode 100644 packages/turf-clean-coords/types.ts delete mode 100644 packages/turf-clone/tsconfig.testTypes.json delete mode 100644 packages/turf-clone/types.ts delete mode 100644 packages/turf-clusters-dbscan/tsconfig.testTypes.json delete mode 100644 packages/turf-clusters-dbscan/types.ts delete mode 100644 packages/turf-clusters-kmeans/tsconfig.testTypes.json delete mode 100644 packages/turf-clusters-kmeans/types.ts delete mode 100644 packages/turf-clusters/tsconfig.testTypes.json delete mode 100644 packages/turf-clusters/types.ts delete mode 100644 packages/turf-flatten/tsconfig.testTypes.json delete mode 100644 packages/turf-flatten/types.ts delete mode 100644 packages/turf-flip/tsconfig.testTypes.json delete mode 100644 packages/turf-flip/types.ts delete mode 100644 packages/turf-helpers/tsconfig.testTypes.json delete mode 100644 packages/turf-helpers/types.ts delete mode 100644 packages/turf-hex-grid/tsconfig.testTypes.json delete mode 100644 packages/turf-hex-grid/types.ts delete mode 100644 packages/turf-intersect/tsconfig.testTypes.json delete mode 100644 packages/turf-intersect/types.ts delete mode 100644 packages/turf-invariant/tsconfig.testTypes.json delete mode 100644 packages/turf-invariant/types.ts delete mode 100644 packages/turf-isolines/tsconfig.testTypes.json delete mode 100644 packages/turf-isolines/types.ts delete mode 100644 packages/turf-kinks/tsconfig.testTypes.json delete mode 100644 packages/turf-kinks/types.ts delete mode 100644 packages/turf-line-arc/tsconfig.testTypes.json delete mode 100644 packages/turf-line-arc/types.ts delete mode 100644 packages/turf-line-overlap/tsconfig.testTypes.json delete mode 100644 packages/turf-line-overlap/types.ts rename packages/{turf-boolean-touches => turf-line-slice-along}/tsconfig.testTypes.json (78%) create mode 100644 packages/turf-line-slice-along/types.ts rename packages/{turf-center-mean => turf-line-slice}/tsconfig.testTypes.json (78%) create mode 100644 packages/turf-line-slice/types.ts rename packages/{turf-boolean-within => turf-line-split}/tsconfig.testTypes.json (78%) create mode 100644 packages/turf-line-split/types.ts delete mode 100644 packages/turf-line-to-polygon/tsconfig.testTypes.json delete mode 100644 packages/turf-line-to-polygon/types.ts delete mode 100644 packages/turf-mask/tsconfig.testTypes.json delete mode 100644 packages/turf-mask/types.ts delete mode 100644 packages/turf-nearest-point-on-line/tsconfig.testTypes.json delete mode 100644 packages/turf-nearest-point-on-line/types.ts delete mode 100644 packages/turf-nearest-point-to-line/tsconfig.testTypes.json delete mode 100644 packages/turf-nearest-point-to-line/types.ts delete mode 100644 packages/turf-nearest-point/tsconfig.testTypes.json delete mode 100644 packages/turf-nearest-point/types.ts delete mode 100644 packages/turf-planepoint/tsconfig.testTypes.json delete mode 100644 packages/turf-planepoint/types.ts delete mode 100644 packages/turf-point-grid/tsconfig.testTypes.json delete mode 100644 packages/turf-point-grid/types.ts delete mode 100644 packages/turf-point-to-line-distance/tsconfig.testTypes.json delete mode 100644 packages/turf-point-to-line-distance/types.ts delete mode 100644 packages/turf-points-within-polygon/tsconfig.testTypes.json delete mode 100644 packages/turf-points-within-polygon/types.ts delete mode 100644 packages/turf-polygon-smooth/tsconfig.testTypes.json delete mode 100644 packages/turf-polygon-smooth/types.ts delete mode 100644 packages/turf-polygon-tangents/tsconfig.testTypes.json delete mode 100644 packages/turf-polygon-tangents/types.ts delete mode 100644 packages/turf-polygonize/tsconfig.testTypes.json delete mode 100644 packages/turf-polygonize/types.ts delete mode 100644 packages/turf-projection/tsconfig.testTypes.json delete mode 100644 packages/turf-projection/types.ts delete mode 100644 packages/turf-rewind/tsconfig.testTypes.json delete mode 100644 packages/turf-rewind/types.ts delete mode 100644 packages/turf-sector/tsconfig.testTypes.json delete mode 100644 packages/turf-sector/types.ts delete mode 100644 packages/turf-shortest-path/tsconfig.testTypes.json delete mode 100644 packages/turf-shortest-path/types.ts delete mode 100644 packages/turf-simplify/tsconfig.testTypes.json delete mode 100644 packages/turf-simplify/types.ts delete mode 100644 packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json delete mode 100644 packages/turf-standard-deviational-ellipse/types.ts delete mode 100644 packages/turf-tin/tsconfig.testTypes.json delete mode 100644 packages/turf-tin/types.ts delete mode 100644 packages/turf-transform-rotate/tsconfig.testTypes.json delete mode 100644 packages/turf-transform-rotate/types.ts delete mode 100644 packages/turf-transform-scale/tsconfig.testTypes.json delete mode 100644 packages/turf-transform-scale/types.ts delete mode 100644 packages/turf-transform-translate/tsconfig.testTypes.json delete mode 100644 packages/turf-transform-translate/types.ts delete mode 100644 packages/turf-triangle-grid/tsconfig.testTypes.json delete mode 100644 packages/turf-triangle-grid/types.ts delete mode 100644 packages/turf-truncate/tsconfig.testTypes.json delete mode 100644 packages/turf-truncate/types.ts delete mode 100644 packages/turf-union/tsconfig.testTypes.json delete mode 100644 packages/turf-union/types.ts delete mode 100644 packages/turf-unkink-polygon/tsconfig.testTypes.json delete mode 100644 packages/turf-unkink-polygon/types.ts diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index 97c309e107..b2c1ffcc37 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -17,7 +17,6 @@ const JS_PACKAGES = []; // projects that use javascript/rollup to build const MAIN_PACKAGE = "@turf/turf"; const TAPE_PACKAGES = []; // projects that have tape tests -const TYPES_PACKAGES = []; // projects that have types tests const BENCH_PACKAGES = []; // projects that have benchmarks // iterate all the packages and figure out what buckets everything falls into @@ -36,10 +35,6 @@ glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => { if (fs.existsSync(path.join(pk, "test.js"))) { TAPE_PACKAGES.push(name); } - - if (fs.existsSync(path.join(pk, "types.ts"))) { - TYPES_PACKAGES.push(name); - } }); const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter( @@ -56,8 +51,48 @@ export default { file: "tsconfig.testTypes.json", templateFile: "./templates/tsconfig.testTypes.json", }, - includePackages: TYPES_PACKAGES, + includePackages: JS_PACKAGES, + }), + fileContents({ + options: { + file: "tsconfig.json", + template: `{ + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] +} +`, + }, + includePackages: TS_PACKAGES.filter( + (elem) => !["@turf/isobands", "@turf/tesselate"].includes(elem) + ), + }), + + // Special treatment for two packages with locally defined .d.ts files for + // untyped Javascript dependencies. Might be possible to remove should those + // libraries be retired / types added to DefinitelyTyped. + fileContents({ + options: { + file: "tsconfig.json", + template: `{ + "extends": "../../tsconfig.shared.json", + "files": ["index.ts", "marchingsquares.d.ts"] +} +`, + }, + includePackages: ["@turf/isobands"], + }), + fileContents({ + options: { + file: "tsconfig.json", + template: `{ + "extends": "../../tsconfig.shared.json", + "files": ["index.ts", "earcut.d.ts"] +} +`, + }, + includePackages: ["@turf/tesselate"], }), + packageOrder({ options: { order: [ @@ -214,13 +249,22 @@ export default { includePackages: [...TS_TAPE_PACKAGES, ...JS_TAPE_PACKAGES], }), + packageScript({ + options: { + scripts: { + "test:types": "tsc --noEmit", + }, + }, + includePackages: TS_PACKAGES, + }), + packageScript({ options: { scripts: { "test:types": "tsc -p ./tsconfig.testTypes.json", }, }, - includePackages: TYPES_PACKAGES, + includePackages: JS_PACKAGES, }), requireDependency({ diff --git a/packages/turf-along/package.json b/packages/turf-along/package.json index ba94b8805a..beea36e7cc 100644 --- a/packages/turf-along/package.json +++ b/packages/turf-along/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-along/tsconfig.json b/packages/turf-along/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-along/tsconfig.json +++ b/packages/turf-along/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-angle/package.json b/packages/turf-angle/package.json index 17eb031087..2b393ba976 100644 --- a/packages/turf-angle/package.json +++ b/packages/turf-angle/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/distance": "workspace:^", diff --git a/packages/turf-angle/tsconfig.json b/packages/turf-angle/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-angle/tsconfig.json +++ b/packages/turf-angle/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-area/package.json b/packages/turf-area/package.json index eaa59340c6..bb8b21543a 100644 --- a/packages/turf-area/package.json +++ b/packages/turf-area/package.json @@ -48,7 +48,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-area/tsconfig.json b/packages/turf-area/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-area/tsconfig.json +++ b/packages/turf-area/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-bbox-clip/package.json b/packages/turf-bbox-clip/package.json index a6b7be6355..8e65c53499 100644 --- a/packages/turf-bbox-clip/package.json +++ b/packages/turf-bbox-clip/package.json @@ -54,7 +54,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox": "workspace:^", diff --git a/packages/turf-bbox-clip/tsconfig.json b/packages/turf-bbox-clip/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-bbox-clip/tsconfig.json +++ b/packages/turf-bbox-clip/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-bbox-polygon/package.json b/packages/turf-bbox-polygon/package.json index b3e5ea242c..7e1761b5ec 100644 --- a/packages/turf-bbox-polygon/package.json +++ b/packages/turf-bbox-polygon/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-bbox-polygon/tsconfig.json b/packages/turf-bbox-polygon/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-bbox-polygon/tsconfig.json +++ b/packages/turf-bbox-polygon/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-bbox/package.json b/packages/turf-bbox/package.json index 3488b08c6e..19edbd66f4 100644 --- a/packages/turf-bbox/package.json +++ b/packages/turf-bbox/package.json @@ -50,7 +50,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-bbox/tsconfig.json b/packages/turf-bbox/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-bbox/tsconfig.json +++ b/packages/turf-bbox/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-bearing/package.json b/packages/turf-bearing/package.json index aa28f719ad..d004ada94d 100644 --- a/packages/turf-bearing/package.json +++ b/packages/turf-bearing/package.json @@ -46,7 +46,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/destination": "workspace:^", diff --git a/packages/turf-bearing/tsconfig.json b/packages/turf-bearing/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-bearing/tsconfig.json +++ b/packages/turf-bearing/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-bezier-spline/package.json b/packages/turf-bezier-spline/package.json index 8799a962c4..73ef5b9828 100644 --- a/packages/turf-bezier-spline/package.json +++ b/packages/turf-bezier-spline/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-bezier-spline/tsconfig.json b/packages/turf-bezier-spline/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-bezier-spline/tsconfig.json +++ b/packages/turf-bezier-spline/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-clockwise/package.json b/packages/turf-boolean-clockwise/package.json index dd270de779..9f56682fac 100755 --- a/packages/turf-boolean-clockwise/package.json +++ b/packages/turf-boolean-clockwise/package.json @@ -53,7 +53,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-clockwise/tsconfig.json b/packages/turf-boolean-clockwise/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-clockwise/tsconfig.json +++ b/packages/turf-boolean-clockwise/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-concave/package.json b/packages/turf-boolean-concave/package.json index 255ce5ab24..fff20eb904 100644 --- a/packages/turf-boolean-concave/package.json +++ b/packages/turf-boolean-concave/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-concave/tsconfig.json b/packages/turf-boolean-concave/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-concave/tsconfig.json +++ b/packages/turf-boolean-concave/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-contains/package.json b/packages/turf-boolean-contains/package.json index 2cc7f26bd5..94b075bc37 100644 --- a/packages/turf-boolean-contains/package.json +++ b/packages/turf-boolean-contains/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-contains/tsconfig.json b/packages/turf-boolean-contains/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-contains/tsconfig.json +++ b/packages/turf-boolean-contains/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-crosses/package.json b/packages/turf-boolean-crosses/package.json index 9a8812cb2a..8ae6adc827 100644 --- a/packages/turf-boolean-crosses/package.json +++ b/packages/turf-boolean-crosses/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-crosses/tsconfig.json b/packages/turf-boolean-crosses/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-crosses/tsconfig.json +++ b/packages/turf-boolean-crosses/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-disjoint/package.json b/packages/turf-boolean-disjoint/package.json index 6661359ce9..69cc63b42c 100644 --- a/packages/turf-boolean-disjoint/package.json +++ b/packages/turf-boolean-disjoint/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-disjoint/tsconfig.json b/packages/turf-boolean-disjoint/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-disjoint/tsconfig.json +++ b/packages/turf-boolean-disjoint/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-equal/package.json b/packages/turf-boolean-equal/package.json index 5d56b8132e..140fce5d34 100644 --- a/packages/turf-boolean-equal/package.json +++ b/packages/turf-boolean-equal/package.json @@ -55,7 +55,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-equal/tsconfig.json b/packages/turf-boolean-equal/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-equal/tsconfig.json +++ b/packages/turf-boolean-equal/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-intersects/package.json b/packages/turf-boolean-intersects/package.json index 09864f80c4..92413e3213 100644 --- a/packages/turf-boolean-intersects/package.json +++ b/packages/turf-boolean-intersects/package.json @@ -53,7 +53,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-intersects/tsconfig.json b/packages/turf-boolean-intersects/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-intersects/tsconfig.json +++ b/packages/turf-boolean-intersects/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-overlap/package.json b/packages/turf-boolean-overlap/package.json index 4550057c26..4a50c29f37 100755 --- a/packages/turf-boolean-overlap/package.json +++ b/packages/turf-boolean-overlap/package.json @@ -54,7 +54,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-overlap/tsconfig.json b/packages/turf-boolean-overlap/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-overlap/tsconfig.json +++ b/packages/turf-boolean-overlap/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-parallel/package.json b/packages/turf-boolean-parallel/package.json index ae8e532678..447537050d 100644 --- a/packages/turf-boolean-parallel/package.json +++ b/packages/turf-boolean-parallel/package.json @@ -51,7 +51,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-parallel/tsconfig.json b/packages/turf-boolean-parallel/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-parallel/tsconfig.json +++ b/packages/turf-boolean-parallel/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-point-in-polygon/package.json b/packages/turf-boolean-point-in-polygon/package.json index 5893e1c5f8..0968cdb63a 100644 --- a/packages/turf-boolean-point-in-polygon/package.json +++ b/packages/turf-boolean-point-in-polygon/package.json @@ -50,7 +50,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-point-in-polygon/tsconfig.json b/packages/turf-boolean-point-in-polygon/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-point-in-polygon/tsconfig.json +++ b/packages/turf-boolean-point-in-polygon/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-point-on-line/package.json b/packages/turf-boolean-point-on-line/package.json index 35eda8de9d..a56b975c67 100644 --- a/packages/turf-boolean-point-on-line/package.json +++ b/packages/turf-boolean-point-on-line/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-point-on-line/tsconfig.json b/packages/turf-boolean-point-on-line/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-point-on-line/tsconfig.json +++ b/packages/turf-boolean-point-on-line/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-touches/package.json b/packages/turf-boolean-touches/package.json index e1def1959d..e8fb2ad52f 100644 --- a/packages/turf-boolean-touches/package.json +++ b/packages/turf-boolean-touches/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-touches/tsconfig.json b/packages/turf-boolean-touches/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-touches/tsconfig.json +++ b/packages/turf-boolean-touches/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-touches/types.ts b/packages/turf-boolean-touches/types.ts deleted file mode 100644 index cafd1accb6..0000000000 --- a/packages/turf-boolean-touches/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as helpers from "@turf/helpers"; -import { booleanTouches } from "./index.js"; - -const pt = helpers.point([0, 0]); -const line = helpers.lineString([ - [0, 0], - [10, 10], -]); -booleanTouches(pt, line); diff --git a/packages/turf-boolean-valid/package.json b/packages/turf-boolean-valid/package.json index 091d8e5b88..82e45b333e 100644 --- a/packages/turf-boolean-valid/package.json +++ b/packages/turf-boolean-valid/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-valid/tsconfig.json b/packages/turf-boolean-valid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-valid/tsconfig.json +++ b/packages/turf-boolean-valid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-within/package.json b/packages/turf-boolean-within/package.json index aa7bc68bfa..d2af66ae80 100644 --- a/packages/turf-boolean-within/package.json +++ b/packages/turf-boolean-within/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-within/tsconfig.json b/packages/turf-boolean-within/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-boolean-within/tsconfig.json +++ b/packages/turf-boolean-within/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-boolean-within/types.ts b/packages/turf-boolean-within/types.ts deleted file mode 100644 index 190bcfd689..0000000000 --- a/packages/turf-boolean-within/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as helpers from "@turf/helpers"; -import { booleanWithin } from "./index.js"; - -const pt = helpers.point([0, 0]); -const line = helpers.lineString([ - [0, 0], - [10, 10], -]); -booleanWithin(pt, line); diff --git a/packages/turf-buffer/tsconfig.testTypes.json b/packages/turf-buffer/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-buffer/tsconfig.testTypes.json +++ b/packages/turf-buffer/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-center-mean/package.json b/packages/turf-center-mean/package.json index 93fad8899a..42490b5e85 100644 --- a/packages/turf-center-mean/package.json +++ b/packages/turf-center-mean/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/center": "workspace:^", diff --git a/packages/turf-center-mean/tsconfig.json b/packages/turf-center-mean/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-center-mean/tsconfig.json +++ b/packages/turf-center-mean/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-center-mean/types.ts b/packages/turf-center-mean/types.ts deleted file mode 100644 index 8c0d54ab02..0000000000 --- a/packages/turf-center-mean/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { lineString } from "@turf/helpers"; -import { centerMean } from "./index.js"; - -const line = lineString([ - [0, 0], - [10, 10], -]); - -centerMean(line); -centerMean(line, { properties: { foo: "bar" } }); -centerMean(line, { weight: "foo" }); diff --git a/packages/turf-center-median/package.json b/packages/turf-center-median/package.json index 99951dd12a..0989b814cc 100644 --- a/packages/turf-center-median/package.json +++ b/packages/turf-center-median/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/center": "workspace:^", diff --git a/packages/turf-center-median/tsconfig.json b/packages/turf-center-median/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-center-median/tsconfig.json +++ b/packages/turf-center-median/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-center-of-mass/package.json b/packages/turf-center-of-mass/package.json index 247cf06570..2fec245424 100644 --- a/packages/turf-center-of-mass/package.json +++ b/packages/turf-center-of-mass/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-center-of-mass/tsconfig.json b/packages/turf-center-of-mass/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-center-of-mass/tsconfig.json +++ b/packages/turf-center-of-mass/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-center-of-mass/tsconfig.testTypes.json b/packages/turf-center-of-mass/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-center-of-mass/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-center-of-mass/types.ts b/packages/turf-center-of-mass/types.ts deleted file mode 100644 index 773280c0b7..0000000000 --- a/packages/turf-center-of-mass/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { lineString } from "@turf/helpers"; -import { centerOfMass } from "./index.js"; - -const line = lineString([ - [0, 0], - [10, 10], -]); - -centerOfMass(line); -centerOfMass(line, { properties: { foo: "bar" } }); diff --git a/packages/turf-center/package.json b/packages/turf-center/package.json index 918c5ddc79..fe0205f5e3 100644 --- a/packages/turf-center/package.json +++ b/packages/turf-center/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-center/tsconfig.json b/packages/turf-center/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-center/tsconfig.json +++ b/packages/turf-center/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-center/tsconfig.testTypes.json b/packages/turf-center/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-center/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-center/types.ts b/packages/turf-center/types.ts deleted file mode 100644 index 20e2e9a957..0000000000 --- a/packages/turf-center/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { lineString } from "@turf/helpers"; -import { center } from "./index.js"; - -const line = lineString([ - [0, 0], - [10, 10], -]); - -center(line); -center(line, { properties: { foo: "bar" } }); diff --git a/packages/turf-centroid/package.json b/packages/turf-centroid/package.json index ff93bcf5dc..b11087e8cd 100644 --- a/packages/turf-centroid/package.json +++ b/packages/turf-centroid/package.json @@ -49,7 +49,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-centroid/tsconfig.json b/packages/turf-centroid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-centroid/tsconfig.json +++ b/packages/turf-centroid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-centroid/tsconfig.testTypes.json b/packages/turf-centroid/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-centroid/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-centroid/types.ts b/packages/turf-centroid/types.ts deleted file mode 100644 index 37700d53ca..0000000000 --- a/packages/turf-centroid/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { lineString } from "@turf/helpers"; -import { centroid } from "./index.js"; - -const line = lineString([ - [0, 0], - [10, 10], -]); - -centroid(line); -centroid(line, { properties: { foo: "bar" } }); diff --git a/packages/turf-circle/package.json b/packages/turf-circle/package.json index 6b3bb3e4ce..d371821c1f 100644 --- a/packages/turf-circle/package.json +++ b/packages/turf-circle/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@placemarkio/check-geojson": "^0.1.12", diff --git a/packages/turf-circle/tsconfig.json b/packages/turf-circle/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-circle/tsconfig.json +++ b/packages/turf-circle/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-circle/tsconfig.testTypes.json b/packages/turf-circle/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-circle/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-circle/types.ts b/packages/turf-circle/types.ts deleted file mode 100644 index 453fb9ae7f..0000000000 --- a/packages/turf-circle/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { point } from "@turf/helpers"; -import { circle } from "./index.js"; - -const center = point([-75.343, 39.984]); -const units = "kilometers"; -const radius = 5; -const steps = 10; - -circle(center, radius); -circle(center, radius, { steps }); -circle(center, radius, { steps, units }); -circle([-75, 39], radius, { steps, units, properties: { foo: "bar" } }); diff --git a/packages/turf-clean-coords/package.json b/packages/turf-clean-coords/package.json index b7744a0c29..2d4939344c 100644 --- a/packages/turf-clean-coords/package.json +++ b/packages/turf-clean-coords/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-clean-coords/tsconfig.json b/packages/turf-clean-coords/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-clean-coords/tsconfig.json +++ b/packages/turf-clean-coords/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-clean-coords/tsconfig.testTypes.json b/packages/turf-clean-coords/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-clean-coords/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-clean-coords/types.ts b/packages/turf-clean-coords/types.ts deleted file mode 100644 index b9037fa586..0000000000 --- a/packages/turf-clean-coords/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { multiPoint } from "@turf/helpers"; -import { cleanCoords } from "./index.js"; - -// Fixtures -const multiPt = multiPoint([ - [0, 0], - [0, 0], - [2, 2], -]); - -// Feature -cleanCoords(multiPt).geometry; -cleanCoords(multiPt).properties; - -// Geometry -cleanCoords(multiPt.geometry).coordinates; -cleanCoords(multiPt.geometry).type; - -// Input mutation -cleanCoords(multiPt.geometry, { mutate: true }); diff --git a/packages/turf-clone/package.json b/packages/turf-clone/package.json index 44d8a284e3..e72423281a 100644 --- a/packages/turf-clone/package.json +++ b/packages/turf-clone/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/meta": "workspace:^", diff --git a/packages/turf-clone/tsconfig.json b/packages/turf-clone/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-clone/tsconfig.json +++ b/packages/turf-clone/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-clone/tsconfig.testTypes.json b/packages/turf-clone/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-clone/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-clone/types.ts b/packages/turf-clone/types.ts deleted file mode 100644 index 07e9831a6c..0000000000 --- a/packages/turf-clone/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Feature, LineString, Point } from "geojson"; -import { lineString, point } from "@turf/helpers"; -import { clone } from "./index.js"; - -const pt = point([0, 20]); -const ptCloned: Feature = clone(pt); - -const line = lineString([ - [0, 20], - [10, 10], -]).geometry; -const lineCloned: LineString = clone(line); diff --git a/packages/turf-clusters-dbscan/package.json b/packages/turf-clusters-dbscan/package.json index 366c236c04..c7f871853b 100644 --- a/packages/turf-clusters-dbscan/package.json +++ b/packages/turf-clusters-dbscan/package.json @@ -57,7 +57,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/centroid": "workspace:^", diff --git a/packages/turf-clusters-dbscan/tsconfig.json b/packages/turf-clusters-dbscan/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-clusters-dbscan/tsconfig.json +++ b/packages/turf-clusters-dbscan/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-clusters-dbscan/tsconfig.testTypes.json b/packages/turf-clusters-dbscan/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-clusters-dbscan/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-clusters-dbscan/types.ts b/packages/turf-clusters-dbscan/types.ts deleted file mode 100644 index 0433d16097..0000000000 --- a/packages/turf-clusters-dbscan/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { featureCollection, point } from "@turf/helpers"; -import { clustersDbscan } from "./index.js"; - -// Fixtures -const points = featureCollection([point([0, 0]), point([2, 2])]); - -// Default -const maxDistance = 5; -const clustered = clustersDbscan(points, maxDistance); - -// Enforce strict properties when using the dbscan property -const output = clustersDbscan(points, maxDistance); -let { dbscan, cluster } = output.features[0].properties; -dbscan = "edge"; -dbscan = "core"; -dbscan = "noise"; -// dbscan = 'foo' //= [ts] Type '"foo"' is not assignable to type '"core" | "edge" | "noise"'. -clustersDbscan(output, maxDistance); - -// Options -const minPoints = 3; -const units = "miles"; -clustersDbscan(points, maxDistance); -clustersDbscan(points, maxDistance, { units }); -clustersDbscan(points, maxDistance, { units, minPoints }); - -// Custom Properties -clustered.features[0].properties.cluster; -clustered.features[0].properties.dbscan; -clustered.features[0].properties.foo; diff --git a/packages/turf-clusters-kmeans/package.json b/packages/turf-clusters-kmeans/package.json index 309607feb7..db46e3b16f 100644 --- a/packages/turf-clusters-kmeans/package.json +++ b/packages/turf-clusters-kmeans/package.json @@ -56,7 +56,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/centroid": "workspace:^", diff --git a/packages/turf-clusters-kmeans/tsconfig.json b/packages/turf-clusters-kmeans/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-clusters-kmeans/tsconfig.json +++ b/packages/turf-clusters-kmeans/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-clusters-kmeans/tsconfig.testTypes.json b/packages/turf-clusters-kmeans/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-clusters-kmeans/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-clusters-kmeans/types.ts b/packages/turf-clusters-kmeans/types.ts deleted file mode 100644 index 6e9a779171..0000000000 --- a/packages/turf-clusters-kmeans/types.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { featureCollection, point } from "@turf/helpers"; -import { clustersKmeans } from "./index.js"; - -// Fixtures -const points = featureCollection([point([0, 0]), point([2, 2])]); - -// Default -const numberOfClusters = 5; -const clustered = clustersKmeans(points, { numberOfClusters }); -let { cluster, centroid } = clustered.features[0].properties; -cluster = 2; -centroid = [-110, 85]; -// cluster = 'foo' // Type Error - Type '"foo"' is not assignable to type 'number'. -// centroid = 'foo' // Type Error - Type '"foo"' is not assignable to type '[number, number]'. - -// Properties option -clustersKmeans(points); -clustersKmeans(points, { numberOfClusters }); -clustersKmeans(points, { numberOfClusters, mutate: true }); - -// Custom Properties -clustered.features[0].properties.centroid; -clustered.features[0].properties.cluster; -clustered.features[0].properties.foo; diff --git a/packages/turf-clusters/package.json b/packages/turf-clusters/package.json index cdefa70ad7..539baf6817 100644 --- a/packages/turf-clusters/package.json +++ b/packages/turf-clusters/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-clusters/tsconfig.json b/packages/turf-clusters/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-clusters/tsconfig.json +++ b/packages/turf-clusters/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-clusters/tsconfig.testTypes.json b/packages/turf-clusters/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-clusters/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-clusters/types.ts b/packages/turf-clusters/types.ts deleted file mode 100644 index 3af8b77f30..0000000000 --- a/packages/turf-clusters/types.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { Point } from "geojson"; -import * as clusters from "./index.js"; -import { featureCollection, point } from "@turf/helpers"; -import { getCluster, clusterEach, clusterReduce } from "./index.js"; - -/** - * Fixtures - */ -const geojson = featureCollection< - Point, - { cluster?: number; 0?: string; bar?: string } ->([ - point([0, 0], { cluster: 0 }), - point([2, 4], { cluster: 1 }), - point([3, 6], { cluster: 1 }), - point([3, 6], { 0: "foo" }), - point([3, 6], { bar: "foo" }), -]); - -/** - * Get Cluster - */ -clusters.getCluster(geojson, { cluster: 1 }); -getCluster(geojson, { cluster: 1 }); -getCluster(geojson, { 0: "foo" }); -getCluster(geojson, { bar: "foo" }); -getCluster(geojson, "cluster"); -getCluster(geojson, ["cluster", "bar"]); -getCluster(geojson, 0); - -/** - * ClusterEach - */ -clusters.clusterEach(geojson, "cluster", () => { - /* no-op */ -}); -clusterEach(geojson, "cluster", (cluster, clusterValue, currentIndex) => { - //= cluster - //= clusterValue - //= currentIndex -}); -// Calculate the total number of clusters -let total = 0; -clusterEach(geojson, "cluster", () => { - total++; -}); - -// Create an Array of all the values retrieved from the 'cluster' property -const values: number[] = []; -clusterEach(geojson, "cluster", (cluster, clusterValue: number) => { - values.push(clusterValue); -}); - -/** - * ClusterReduce - */ -const initialValue = 0; -clusterReduce(geojson, "cluster", () => { - /* no-op */ -}); -clusterReduce( - geojson, - "cluster", - (previousValue, cluster, clusterValue, currentIndex) => { - //= previousValue - //= cluster - //= clusterValue - //= currentIndex - }, - initialValue -); - -// Calculate the total number of clusters -const totalReduce = clusterReduce( - geojson, - "cluster", - function (previousValue) { - return previousValue++; - }, - 0 -); - -// Create an Array of all the values retrieved from the 'cluster' property -const valuesReduce = clusterReduce( - geojson, - "cluster", - function (previousValue, cluster, clusterValue) { - return previousValue.concat(clusterValue); - }, - [] -); - -/** - * Custom Properties - */ -const customPoints = featureCollection([ - point([0, 0], { cluster: 0 }), - point([2, 4], { cluster: 1 }), - point([3, 6], { cluster: 1 }), -]); - -getCluster(customPoints, { cluster: 1 }).features[0].properties.cluster; -// getCluster(customPoints, {cluster: 1}).features[0].properties.foo // [ts] Property 'foo' does not exist on type '{ cluster: number; }'. - -clusterEach(customPoints, "cluster", (cluster) => { - cluster.features[0].properties.cluster; - // cluster.features[0].properties.foo // [ts] Property 'foo' does not exist on type '{ cluster: number; }'. -}); - -clusterReduce(customPoints, "cluster", (previousValue, cluster) => { - cluster.features[0].properties.cluster; - // cluster.features[0].properties.foo // [ts] Property 'foo' does not exist on type '{ cluster: number; }'. -}); diff --git a/packages/turf-collect/package.json b/packages/turf-collect/package.json index c9e0c8dbba..cc2e5b10f3 100644 --- a/packages/turf-collect/package.json +++ b/packages/turf-collect/package.json @@ -53,7 +53,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-collect/tsconfig.json b/packages/turf-collect/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-collect/tsconfig.json +++ b/packages/turf-collect/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-combine/package.json b/packages/turf-combine/package.json index f9e941b17b..433b16bd7d 100644 --- a/packages/turf-combine/package.json +++ b/packages/turf-combine/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-combine/tsconfig.json b/packages/turf-combine/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-combine/tsconfig.json +++ b/packages/turf-combine/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-concave/package.json b/packages/turf-concave/package.json index 1226e48987..a7aaf81b05 100644 --- a/packages/turf-concave/package.json +++ b/packages/turf-concave/package.json @@ -59,7 +59,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-concave/tsconfig.json b/packages/turf-concave/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-concave/tsconfig.json +++ b/packages/turf-concave/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-convex/package.json b/packages/turf-convex/package.json index e323b5d609..cfe8ea5c64 100644 --- a/packages/turf-convex/package.json +++ b/packages/turf-convex/package.json @@ -46,7 +46,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-convex/tsconfig.json b/packages/turf-convex/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-convex/tsconfig.json +++ b/packages/turf-convex/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-destination/package.json b/packages/turf-destination/package.json index 2545efa642..de3d41608f 100644 --- a/packages/turf-destination/package.json +++ b/packages/turf-destination/package.json @@ -50,7 +50,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-destination/tsconfig.json b/packages/turf-destination/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-destination/tsconfig.json +++ b/packages/turf-destination/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-difference/package.json b/packages/turf-difference/package.json index af27e4a900..aea44ea204 100644 --- a/packages/turf-difference/package.json +++ b/packages/turf-difference/package.json @@ -46,7 +46,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-difference/tsconfig.json b/packages/turf-difference/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-difference/tsconfig.json +++ b/packages/turf-difference/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-directional-mean/package.json b/packages/turf-directional-mean/package.json index ab887f8383..128f6ac2cf 100644 --- a/packages/turf-directional-mean/package.json +++ b/packages/turf-directional-mean/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-directional-mean/tsconfig.json b/packages/turf-directional-mean/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-directional-mean/tsconfig.json +++ b/packages/turf-directional-mean/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-dissolve/package.json b/packages/turf-dissolve/package.json index 6f66ca5afd..252272babc 100644 --- a/packages/turf-dissolve/package.json +++ b/packages/turf-dissolve/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-dissolve/tsconfig.json b/packages/turf-dissolve/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-dissolve/tsconfig.json +++ b/packages/turf-dissolve/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-distance-weight/package.json b/packages/turf-distance-weight/package.json index 06a852f451..8106a17448 100644 --- a/packages/turf-distance-weight/package.json +++ b/packages/turf-distance-weight/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-distance-weight/tsconfig.json b/packages/turf-distance-weight/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-distance-weight/tsconfig.json +++ b/packages/turf-distance-weight/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-distance/package.json b/packages/turf-distance/package.json index 609d05d3cc..27873b8dd4 100644 --- a/packages/turf-distance/package.json +++ b/packages/turf-distance/package.json @@ -48,7 +48,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-distance/tsconfig.json b/packages/turf-distance/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-distance/tsconfig.json +++ b/packages/turf-distance/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-ellipse/package.json b/packages/turf-ellipse/package.json index 6874f5df6a..fb3d64263c 100644 --- a/packages/turf-ellipse/package.json +++ b/packages/turf-ellipse/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@placemarkio/check-geojson": "^0.1.12", diff --git a/packages/turf-ellipse/tsconfig.json b/packages/turf-ellipse/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-ellipse/tsconfig.json +++ b/packages/turf-ellipse/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-envelope/package.json b/packages/turf-envelope/package.json index c1ff815246..a436a3e24c 100644 --- a/packages/turf-envelope/package.json +++ b/packages/turf-envelope/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-envelope/tsconfig.json b/packages/turf-envelope/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-envelope/tsconfig.json +++ b/packages/turf-envelope/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-explode/package.json b/packages/turf-explode/package.json index f3df867751..122c8715f4 100644 --- a/packages/turf-explode/package.json +++ b/packages/turf-explode/package.json @@ -48,7 +48,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-explode/tsconfig.json b/packages/turf-explode/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-explode/tsconfig.json +++ b/packages/turf-explode/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-flatten/package.json b/packages/turf-flatten/package.json index cfb1060c60..543626b778 100644 --- a/packages/turf-flatten/package.json +++ b/packages/turf-flatten/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-flatten/tsconfig.json b/packages/turf-flatten/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-flatten/tsconfig.json +++ b/packages/turf-flatten/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-flatten/tsconfig.testTypes.json b/packages/turf-flatten/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-flatten/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-flatten/types.ts b/packages/turf-flatten/types.ts deleted file mode 100644 index 563b0945e8..0000000000 --- a/packages/turf-flatten/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { FeatureCollection, Point, LineString } from "geojson"; -import { - multiPoint, - multiLineString, - geometryCollection, - // Typescript types -} from "@turf/helpers"; -import { flatten } from "./index.js"; - -const multiPt = multiPoint([ - [0, 0], - [10, 10], -]); -const multiLine = multiLineString([ - [ - [20, 20], - [30, 30], - ], - [ - [0, 0], - [10, 10], - ], -]); - -let points: FeatureCollection = flatten(multiPt); -let lines: FeatureCollection = flatten(multiLine); -points = flatten(multiPt.geometry); -lines = flatten(multiLine.geometry); - -flatten(geometryCollection([multiPt.geometry, multiLine.geometry])); diff --git a/packages/turf-flip/package.json b/packages/turf-flip/package.json index 15aec5a06a..5c0752c469 100644 --- a/packages/turf-flip/package.json +++ b/packages/turf-flip/package.json @@ -49,7 +49,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-flip/tsconfig.json b/packages/turf-flip/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-flip/tsconfig.json +++ b/packages/turf-flip/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-flip/tsconfig.testTypes.json b/packages/turf-flip/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-flip/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-flip/types.ts b/packages/turf-flip/types.ts deleted file mode 100644 index c4543fe9c6..0000000000 --- a/packages/turf-flip/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { - featureCollection, - point, - lineString, - geometryCollection, -} from "@turf/helpers"; -import { flip } from "./index.js"; - -const pt = point([120.1234567, 40.1234567]); -const ptGeom = pt.geometry; -const line = lineString([ - [20, 80], - [50, 40], -]); -const lineGeom = line.geometry; -const points = featureCollection([pt]); -const lines = featureCollection([line]); -const geomCollection = geometryCollection([ptGeom, lineGeom]); - -flip(pt); -flip(ptGeom); -flip(line); -flip(lineGeom); -flip(lines); -flip(points); -flip(geomCollection, { mutate: true }); diff --git a/packages/turf-geojson-rbush/tsconfig.testTypes.json b/packages/turf-geojson-rbush/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-geojson-rbush/tsconfig.testTypes.json +++ b/packages/turf-geojson-rbush/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-great-circle/tsconfig.testTypes.json b/packages/turf-great-circle/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-great-circle/tsconfig.testTypes.json +++ b/packages/turf-great-circle/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-helpers/package.json b/packages/turf-helpers/package.json index 2cc324fa20..7009bbb072 100644 --- a/packages/turf-helpers/package.json +++ b/packages/turf-helpers/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-helpers/tsconfig.json b/packages/turf-helpers/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-helpers/tsconfig.json +++ b/packages/turf-helpers/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-helpers/tsconfig.testTypes.json b/packages/turf-helpers/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-helpers/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-helpers/types.ts b/packages/turf-helpers/types.ts deleted file mode 100644 index f414108041..0000000000 --- a/packages/turf-helpers/types.ts +++ /dev/null @@ -1,213 +0,0 @@ -import { BBox, GeometryCollection, LineString, Polygon, Point } from "geojson"; -import { - feature, - featureCollection, - geometry, - geometryCollection, - isNumber, - isObject, - lengthToDegrees, - lengthToRadians, - lineString, - multiLineString, - multiPoint, - multiPolygon, - // Typescript types - point, - polygon, - radiansToLength, -} from "./index.js"; - -// Fixtures -const bbox: BBox = [-180, -90, 180, 90]; -const properties = { foo: "bar" }; -const pt = point([0, 1]); -const line = lineString([ - [0, 1], - [2, 3], -]); -const poly = polygon([ - [ - [0, 1], - [0, 0], - [2, 3], - [0, 1], - ], -]); -const feat = feature({ coordinates: [1, 0], type: "Point" }); -const multiPt = multiPoint([ - [0, 1], - [2, 3], - [0, 1], -]); -const multiLine = multiLineString([ - [ - [0, 1], - [2, 3], - [0, 1], - ], -]); -const multiPoly = multiPolygon([ - [ - [ - [0, 1], - [0, 0], - [2, 3], - [0, 1], - ], - ], -]); - -// radiansToLength & lengthToRadians -radiansToLength(5); -lengthToRadians(10); -lengthToDegrees(45); - -// default import & import * as -point([0, 1]); -lineString([ - [0, 1], - [2, 3], -]); -polygon([ - [ - [0, 1], - [0, 0], - [2, 3], - [0, 1], - ], -]); -feature({ coordinates: [1, 0], type: "Point" }); -feature(null); -multiPoint([ - [0, 1], - [2, 3], - [0, 1], -]); -multiLineString([ - [ - [0, 1], - [2, 3], - [0, 1], - ], -]); -multiPolygon([ - [ - [ - [0, 1], - [0, 0], - [2, 3], - [0, 1], - ], - ], -]); - -// Mixed collection is defiend as FeatureCollection -const mixed = featureCollection([pt, poly]); -mixed.features.push(pt); -mixed.features.push(line); -mixed.features.push(poly); - -// Blank collection is defined as FeatureCollection -const blank = featureCollection([]); -blank.features.push(pt); -blank.features.push(line); -blank.features.push(poly); - -// Collection with only Points -const points = featureCollection([]); -points.features.push(pt); -// points.features.push(line) -// Argument of type 'Feature' is not assignable to parameter of type 'Feature'. - -// Collection with only LineStrings -const lines = featureCollection([line]); -lines.features.push(line); -// lines.features.push(pt) -// Argument of type 'Feature' is not assignable to parameter of type 'Feature'. - -// Collection with only Polygons -const polygons = featureCollection([]); -polygons.features.push(poly); - -// bbox & id -point(pt.geometry.coordinates, properties, { bbox, id: 1 }); -lineString(line.geometry.coordinates, properties, { bbox, id: 1 }); -polygon(poly.geometry.coordinates, properties, { bbox, id: 1 }); -multiPoint(multiPt.geometry.coordinates, properties, { bbox, id: 1 }); -multiLineString(multiLine.geometry.coordinates, properties, { bbox, id: 1 }); -multiPolygon(multiPoly.geometry.coordinates, properties, { bbox, id: 1 }); -geometryCollection([pt.geometry], properties, { bbox, id: 1 }); - -// properties -point(pt.geometry.coordinates, { foo: "bar" }); -point(pt.geometry.coordinates, { 1: 2 }); -point(pt.geometry.coordinates, { 1: { foo: "bar" } }); - -// isNumber -- true -isNumber(123); -isNumber(1.23); -isNumber(-1.23); -isNumber(-123); -isNumber("123"); -isNumber(+"123"); -isNumber("1e10000"); -isNumber(1e100); -isNumber(Infinity); -isNumber(-Infinity); - -// isNumber -- false -isNumber(+"ciao"); -isNumber("foo"); -isNumber("10px"); -isNumber(NaN); -isNumber(undefined); -isNumber(null); -isNumber({ a: 1 }); -isNumber({}); -isNumber([1, 2, 3]); -isNumber([]); -isNumber(isNumber); - -// isObject -- true -isObject({ a: 1 }); -isObject({}); -isObject(point([0, 1])); - -// isObject -- false -isObject(123); -isObject(Infinity); -isObject(-123); -isObject("foo"); -isObject(NaN); -isObject(undefined); -isObject(null); -isObject([1, 2, 3]); -isObject([]); -isObject(isNumber); - -// Geometry -const ptGeom = geometry("Point", pt.geometry.coordinates); -const lineGeom = geometry("LineString", line.geometry.coordinates); -const polyGeom = geometry("Polygon", poly.geometry.coordinates); -const multiPtGeom = geometry("MultiPoint", multiPt.geometry.coordinates); -const multiLineGeom = geometry( - "MultiLineString", - multiLine.geometry.coordinates -); -const multiPolyGeom = geometry("MultiPolygon", multiPoly.geometry.coordinates); - -// Custom Properties -const customPt = point([10, 50], { foo: "bar" }); - -// Handle GeometryCollection & Feature.GeometryCollection -const geomCollection = geometryCollection([pt.geometry, line.geometry]); -const p1 = geomCollection.geometry.geometries[0]; -const l1 = geomCollection.geometry.geometries[0]; - -const mixedGeomCollection = featureCollection([ - pt, - geomCollection, -]); -const fc = featureCollection([pt, line]); -const featureGeomCollection = feature(geomCollection.geometry); diff --git a/packages/turf-hex-grid/package.json b/packages/turf-hex-grid/package.json index 7ecd3c48d7..ec44781491 100644 --- a/packages/turf-hex-grid/package.json +++ b/packages/turf-hex-grid/package.json @@ -59,7 +59,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-hex-grid/tsconfig.json b/packages/turf-hex-grid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-hex-grid/tsconfig.json +++ b/packages/turf-hex-grid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-hex-grid/tsconfig.testTypes.json b/packages/turf-hex-grid/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-hex-grid/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-hex-grid/types.ts b/packages/turf-hex-grid/types.ts deleted file mode 100644 index 1b07967130..0000000000 --- a/packages/turf-hex-grid/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { BBox } from "geojson"; -import { hexGrid } from "./index.js"; - -// prettier-ignore -const bbox: BBox = [ - -96.6357421875, - 31.12819929911196, - -84.9462890625, - 40.58058466412764, -]; - -hexGrid(bbox, 50); -hexGrid(bbox, 50, { units: "miles" }); -hexGrid(bbox, 50, { units: "miles", triangles: true }); - -// Access Custom Properties -const foo = hexGrid(bbox, 50, { - units: "miles", - triangles: true, - properties: { foo: "bar" }, -}); -foo.features[0].properties.foo; -// foo.features[0].properties.bar // => [ts] Property 'bar' does not exist on type '{ foo: string; }'. diff --git a/packages/turf-interpolate/tsconfig.testTypes.json b/packages/turf-interpolate/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-interpolate/tsconfig.testTypes.json +++ b/packages/turf-interpolate/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-intersect/package.json b/packages/turf-intersect/package.json index 2220c2b83c..d2ea6c9216 100644 --- a/packages/turf-intersect/package.json +++ b/packages/turf-intersect/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-intersect/tsconfig.json b/packages/turf-intersect/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-intersect/tsconfig.json +++ b/packages/turf-intersect/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-intersect/tsconfig.testTypes.json b/packages/turf-intersect/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-intersect/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-intersect/types.ts b/packages/turf-intersect/types.ts deleted file mode 100644 index 588c1800f1..0000000000 --- a/packages/turf-intersect/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { featureCollection, polygon } from "@turf/helpers"; -import { intersect } from "./index.js"; - -const poly1 = polygon([ - [ - [0, 0], - [1, 1], - [3, 0], - [0, 0], - ], -]); -const poly2 = polygon([ - [ - [10, 10], - [21, 21], - [0, 4], - [10, 10], - ], -]); - -const match = intersect(featureCollection([poly1, poly2])); - -if (match === null) console.log("foo"); - -const foo = intersect(featureCollection([poly1, poly2])) || "bar"; diff --git a/packages/turf-invariant/package.json b/packages/turf-invariant/package.json index 57007826a8..f0567f64cb 100644 --- a/packages/turf-invariant/package.json +++ b/packages/turf-invariant/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-invariant/tsconfig.json b/packages/turf-invariant/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-invariant/tsconfig.json +++ b/packages/turf-invariant/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-invariant/tsconfig.testTypes.json b/packages/turf-invariant/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-invariant/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-invariant/types.ts b/packages/turf-invariant/types.ts deleted file mode 100644 index 4b019b95f9..0000000000 --- a/packages/turf-invariant/types.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as helpers from "@turf/helpers"; -import { - GeometryCollection, - LineString, - Point, - Polygon, - Position, -} from "geojson"; -import * as invariant from "./index.js"; - -/** - * Fixtures - */ -const pt = helpers.point([0, 0]); -const line = helpers.lineString([ - [0, 0], - [1, 1], -]); -const poly = helpers.polygon([ - [ - [0, 0], - [1, 1], - [2, 2], - [0, 0], - ], -]); -const gc = helpers.geometryCollection([ - pt.geometry, - line.geometry, - poly.geometry, -]); -const fc = helpers.featureCollection([ - pt, - line, - poly, -]); - -/** - * invariant.getGeom - */ -// invariant.getGeom(fc); // Argument of type 'FeatureCollection' is not assignable to parameter of type -const gcGeom: GeometryCollection = invariant.getGeom(gc); -const pointGeom: Point = invariant.getGeom(pt); -const lineGeom: LineString = invariant.getGeom(line); -const polyGeom: Polygon = invariant.getGeom(poly); - -/** - * invariant.getType - */ -const type = invariant.getType(pt); - -/** - * getCoord - */ -invariant.getCoord(pt); -invariant.getCoord(pt.geometry); -invariant.getCoord(pt.geometry.coordinates); -let coordZ = [10, 30, 2000]; -coordZ = invariant.getCoord(coordZ); - -/** - * getCoords - */ -invariant.getCoords(pt.geometry)[0].toFixed(); -invariant.getCoords(pt.geometry.coordinates)[0].toFixed(); -invariant.getCoords(pt)[0].toFixed(); -invariant.getCoords(line.geometry)[0][0].toFixed(); -invariant.getCoords(line.geometry.coordinates)[0][0].toFixed(); -invariant.getCoords(line)[0][0].toFixed(); -invariant.getCoords(poly)[0][0][0].toFixed(); -invariant.getCoords(poly.geometry)[0][0][0].toFixed(); -invariant.getCoords(poly.geometry.coordinates)[0][0][0].toFixed(); -const lineCoords: Position[] = [ - [10, 30], - [40, 40], -]; -invariant.getCoords(lineCoords)[0][0].toFixed(); diff --git a/packages/turf-isobands/package.json b/packages/turf-isobands/package.json index b692076f60..4dd9d2c9bd 100644 --- a/packages/turf-isobands/package.json +++ b/packages/turf-isobands/package.json @@ -54,7 +54,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/envelope": "workspace:^", diff --git a/packages/turf-isobands/tsconfig.json b/packages/turf-isobands/tsconfig.json index 563bf86442..dec1a231df 100644 --- a/packages/turf-isobands/tsconfig.json +++ b/packages/turf-isobands/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts", "marchingsquares.d.ts"] } diff --git a/packages/turf-isolines/package.json b/packages/turf-isolines/package.json index 89aa48c950..7364b0c7e9 100644 --- a/packages/turf-isolines/package.json +++ b/packages/turf-isolines/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/envelope": "workspace:^", diff --git a/packages/turf-isolines/tsconfig.json b/packages/turf-isolines/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-isolines/tsconfig.json +++ b/packages/turf-isolines/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-isolines/tsconfig.testTypes.json b/packages/turf-isolines/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-isolines/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-isolines/types.ts b/packages/turf-isolines/types.ts deleted file mode 100644 index 94275d8c23..0000000000 --- a/packages/turf-isolines/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { randomPoint } from "@turf/random"; -import { isolines } from "./index.js"; - -const points = randomPoint(100, { - bbox: [0, 30, 20, 50], -}); -for (let i = 0; i < points.features.length; i++) { - points.features[i].properties.z = Math.random() * 10; -} -const breaks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; -const lines = isolines(points, breaks, { zProperty: "temperature" }); -const properties = { apply: "all" }; - -// Properties option -isolines(points, breaks, { - zProperty: "temperature", - commonProperties: properties, -}); -isolines(points, breaks, { - zProperty: "temperature", - commonProperties: properties, - breaksProperties: [{ name: "break1" }, { name: "break2" }], -}); diff --git a/packages/turf-kinks/package.json b/packages/turf-kinks/package.json index af3a9fa1d6..d00596232f 100644 --- a/packages/turf-kinks/package.json +++ b/packages/turf-kinks/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/meta": "workspace:^", diff --git a/packages/turf-kinks/tsconfig.json b/packages/turf-kinks/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-kinks/tsconfig.json +++ b/packages/turf-kinks/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-kinks/tsconfig.testTypes.json b/packages/turf-kinks/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-kinks/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-kinks/types.ts b/packages/turf-kinks/types.ts deleted file mode 100644 index 105060ec0f..0000000000 --- a/packages/turf-kinks/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { polygon } from "@turf/helpers"; -import { kinks } from "./index.js"; - -const hourglass = polygon([ - [ - [-50, 5], - [-40, -10], - [-50, -10], - [-40, 5], - [-50, 5], - ], -]); -kinks(hourglass); diff --git a/packages/turf-length/package.json b/packages/turf-length/package.json index 70200b583c..8884f16d73 100644 --- a/packages/turf-length/package.json +++ b/packages/turf-length/package.json @@ -54,7 +54,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-length/tsconfig.json b/packages/turf-length/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-length/tsconfig.json +++ b/packages/turf-length/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-line-arc/package.json b/packages/turf-line-arc/package.json index 43e9900c20..eabebeffb1 100644 --- a/packages/turf-line-arc/package.json +++ b/packages/turf-line-arc/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-line-arc/tsconfig.json b/packages/turf-line-arc/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-line-arc/tsconfig.json +++ b/packages/turf-line-arc/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-line-arc/tsconfig.testTypes.json b/packages/turf-line-arc/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-line-arc/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-line-arc/types.ts b/packages/turf-line-arc/types.ts deleted file mode 100644 index 8a82bb3473..0000000000 --- a/packages/turf-line-arc/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { point } from "@turf/helpers"; -import { lineArc } from "./index.js"; - -const center = point([-75.343, 39.984]); -const bearing1 = 10; -const bearing2 = -30; -const radius = 5; -const steps = 10; -const units = "miles"; - -lineArc(center, radius, bearing1, bearing2); -lineArc(center, radius, bearing1, bearing2, { steps }); -lineArc(center, radius, bearing1, bearing2, { steps, units }); diff --git a/packages/turf-line-chunk/tsconfig.json b/packages/turf-line-chunk/tsconfig.json index 563bf86442..1a50e1399c 100644 --- a/packages/turf-line-chunk/tsconfig.json +++ b/packages/turf-line-chunk/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "include": ["index.d.ts"] } diff --git a/packages/turf-line-chunk/tsconfig.testTypes.json b/packages/turf-line-chunk/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-line-chunk/tsconfig.testTypes.json +++ b/packages/turf-line-chunk/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-line-intersect/package.json b/packages/turf-line-intersect/package.json index 9ef13fde35..5285645bce 100644 --- a/packages/turf-line-intersect/package.json +++ b/packages/turf-line-intersect/package.json @@ -53,7 +53,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-line-intersect/tsconfig.json b/packages/turf-line-intersect/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-line-intersect/tsconfig.json +++ b/packages/turf-line-intersect/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-line-offset/tsconfig.testTypes.json b/packages/turf-line-offset/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-line-offset/tsconfig.testTypes.json +++ b/packages/turf-line-offset/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-line-overlap/package.json b/packages/turf-line-overlap/package.json index 4ffe77ddf9..30c09ed9ea 100644 --- a/packages/turf-line-overlap/package.json +++ b/packages/turf-line-overlap/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-line-overlap/tsconfig.json b/packages/turf-line-overlap/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-line-overlap/tsconfig.json +++ b/packages/turf-line-overlap/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-line-overlap/tsconfig.testTypes.json b/packages/turf-line-overlap/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-line-overlap/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-line-overlap/types.ts b/packages/turf-line-overlap/types.ts deleted file mode 100644 index 9b1f420234..0000000000 --- a/packages/turf-line-overlap/types.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { - lineString, - multiLineString, - polygon, - multiPolygon, -} from "@turf/helpers"; -import { lineOverlap } from "./index.js"; - -const line = lineString([ - [0, 0], - [10, 10], -]); -const multiLine = multiLineString([ - [ - [0, 0], - [10, 10], - ], - [ - [30, 30], - [50, 50], - ], -]); -const poly = polygon([ - [ - [0, 0], - [10, 10], - [15, 15], - [0, 0], - ], -]); -const multiPoly = multiPolygon([ - [ - [ - [0, 0], - [10, 10], - [15, 15], - [0, 0], - ], - ], - [ - [ - [5, 5], - [30, 30], - [45, 45], - [5, 5], - ], - ], -]); - -lineOverlap(line, poly); -lineOverlap(line, line); -lineOverlap(multiPoly, line); -lineOverlap(multiPoly, multiLine); -lineOverlap(multiPoly, multiLine, { tolerance: 5 }); diff --git a/packages/turf-line-segment/package.json b/packages/turf-line-segment/package.json index 4a85c0e4e7..2164e4b2a5 100644 --- a/packages/turf-line-segment/package.json +++ b/packages/turf-line-segment/package.json @@ -47,7 +47,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-line-segment/tsconfig.json b/packages/turf-line-segment/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-line-segment/tsconfig.json +++ b/packages/turf-line-segment/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-line-slice-along/package.json b/packages/turf-line-slice-along/package.json index 3a7489e82d..226e417c82 100644 --- a/packages/turf-line-slice-along/package.json +++ b/packages/turf-line-slice-along/package.json @@ -47,7 +47,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/along": "workspace:^", diff --git a/packages/turf-boolean-touches/tsconfig.testTypes.json b/packages/turf-line-slice-along/tsconfig.testTypes.json similarity index 78% rename from packages/turf-boolean-touches/tsconfig.testTypes.json rename to packages/turf-line-slice-along/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-boolean-touches/tsconfig.testTypes.json +++ b/packages/turf-line-slice-along/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-line-slice-along/types.ts b/packages/turf-line-slice-along/types.ts new file mode 100644 index 0000000000..51af5a26f3 --- /dev/null +++ b/packages/turf-line-slice-along/types.ts @@ -0,0 +1 @@ +import { lineSliceAlong } from "./index"; diff --git a/packages/turf-line-slice/package.json b/packages/turf-line-slice/package.json index f2c94cc197..99c2f94c7c 100644 --- a/packages/turf-line-slice/package.json +++ b/packages/turf-line-slice/package.json @@ -51,7 +51,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-center-mean/tsconfig.testTypes.json b/packages/turf-line-slice/tsconfig.testTypes.json similarity index 78% rename from packages/turf-center-mean/tsconfig.testTypes.json rename to packages/turf-line-slice/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-center-mean/tsconfig.testTypes.json +++ b/packages/turf-line-slice/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-line-slice/types.ts b/packages/turf-line-slice/types.ts new file mode 100644 index 0000000000..ec4bc9af66 --- /dev/null +++ b/packages/turf-line-slice/types.ts @@ -0,0 +1 @@ +import { lineSlice } from "./index"; diff --git a/packages/turf-line-split/package.json b/packages/turf-line-split/package.json index f3b77ef585..8d8117c3d6 100644 --- a/packages/turf-line-split/package.json +++ b/packages/turf-line-split/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc -p ./tsconfig.testTypes.json" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-boolean-within/tsconfig.testTypes.json b/packages/turf-line-split/tsconfig.testTypes.json similarity index 78% rename from packages/turf-boolean-within/tsconfig.testTypes.json rename to packages/turf-line-split/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-boolean-within/tsconfig.testTypes.json +++ b/packages/turf-line-split/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-line-split/types.ts b/packages/turf-line-split/types.ts new file mode 100644 index 0000000000..a41b124edb --- /dev/null +++ b/packages/turf-line-split/types.ts @@ -0,0 +1 @@ +import { lineSplit } from "./index"; diff --git a/packages/turf-line-to-polygon/package.json b/packages/turf-line-to-polygon/package.json index b0762a44ed..daae69f77e 100644 --- a/packages/turf-line-to-polygon/package.json +++ b/packages/turf-line-to-polygon/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-line-to-polygon/tsconfig.json b/packages/turf-line-to-polygon/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-line-to-polygon/tsconfig.json +++ b/packages/turf-line-to-polygon/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-line-to-polygon/tsconfig.testTypes.json b/packages/turf-line-to-polygon/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-line-to-polygon/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-line-to-polygon/types.ts b/packages/turf-line-to-polygon/types.ts deleted file mode 100644 index 6cd6193272..0000000000 --- a/packages/turf-line-to-polygon/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { LineString, MultiLineString } from "geojson"; -import { featureCollection, lineString, multiLineString } from "@turf/helpers"; -import { lineToPolygon } from "./index.js"; - -// Fixtures -const coords = [ - [125, -30], - [145, -30], - [145, -20], - [125, -20], - [125, -30], -]; -const line = lineString(coords); -const multiLine = multiLineString([coords, coords]); -const fc = featureCollection([line, multiLine]); - -// Assert results with types -const poly1 = lineToPolygon(line); // Feature -const poly2 = lineToPolygon(multiLine); // Feature -const poly3 = lineToPolygon(fc); // Feature diff --git a/packages/turf-mask/package.json b/packages/turf-mask/package.json index 1f0d6b4c84..166a7d9c2a 100644 --- a/packages/turf-mask/package.json +++ b/packages/turf-mask/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-mask/tsconfig.json b/packages/turf-mask/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-mask/tsconfig.json +++ b/packages/turf-mask/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-mask/tsconfig.testTypes.json b/packages/turf-mask/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-mask/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-mask/types.ts b/packages/turf-mask/types.ts deleted file mode 100644 index be388c913d..0000000000 --- a/packages/turf-mask/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { polygon } from "@turf/helpers"; -import { mask } from "./index.js"; - -const poly1 = polygon([ - [ - [-50, 5], - [-40, -10], - [-50, -10], - [-40, 5], - [-50, 5], - ], -]); -const poly2 = polygon([ - [ - [30, 5], - [-40, -10], - [-50, -10], - [-40, 5], - [30, 5], - ], -]); - -mask(poly1); -mask(poly1, poly2); -mask(poly1, poly2, { mutate: true }); diff --git a/packages/turf-meta/tsconfig.testTypes.json b/packages/turf-meta/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/packages/turf-meta/tsconfig.testTypes.json +++ b/packages/turf-meta/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } diff --git a/packages/turf-midpoint/package.json b/packages/turf-midpoint/package.json index 19ac9944f4..a844d65440 100644 --- a/packages/turf-midpoint/package.json +++ b/packages/turf-midpoint/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-midpoint/tsconfig.json b/packages/turf-midpoint/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-midpoint/tsconfig.json +++ b/packages/turf-midpoint/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-moran-index/package.json b/packages/turf-moran-index/package.json index 219e372659..2297be2f69 100644 --- a/packages/turf-moran-index/package.json +++ b/packages/turf-moran-index/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-moran-index/tsconfig.json b/packages/turf-moran-index/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-moran-index/tsconfig.json +++ b/packages/turf-moran-index/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-nearest-neighbor-analysis/package.json b/packages/turf-nearest-neighbor-analysis/package.json index 95181012c4..ab248e2654 100644 --- a/packages/turf-nearest-neighbor-analysis/package.json +++ b/packages/turf-nearest-neighbor-analysis/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-nearest-neighbor-analysis/tsconfig.json b/packages/turf-nearest-neighbor-analysis/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-nearest-neighbor-analysis/tsconfig.json +++ b/packages/turf-nearest-neighbor-analysis/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-nearest-point-on-line/package.json b/packages/turf-nearest-point-on-line/package.json index 171c07d4ec..79cbf537a0 100644 --- a/packages/turf-nearest-point-on-line/package.json +++ b/packages/turf-nearest-point-on-line/package.json @@ -43,7 +43,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/along": "workspace:^", diff --git a/packages/turf-nearest-point-on-line/tsconfig.json b/packages/turf-nearest-point-on-line/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-nearest-point-on-line/tsconfig.json +++ b/packages/turf-nearest-point-on-line/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-nearest-point-on-line/tsconfig.testTypes.json b/packages/turf-nearest-point-on-line/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-nearest-point-on-line/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-nearest-point-on-line/types.ts b/packages/turf-nearest-point-on-line/types.ts deleted file mode 100644 index 8f428a149f..0000000000 --- a/packages/turf-nearest-point-on-line/types.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { nearestPointOnLine } from "./index.js"; -import { point, lineString, multiLineString } from "@turf/helpers"; - -const pt = point([1.5, 1.5]); -const line = lineString([ - [0, 0], - [1, 1], -]); -const multiLine = multiLineString([ - [ - [0, 0], - [1, 1], - [2, 2], - [0, 0], - ], -]); - -// All combinations of parameters -nearestPointOnLine(line, pt); -nearestPointOnLine(multiLine, pt); -nearestPointOnLine(line.geometry, pt); -nearestPointOnLine(multiLine.geometry, pt); -nearestPointOnLine(line, pt, { units: "miles" }); - -// Output can be used as Input -const output = nearestPointOnLine(line, pt); -nearestPointOnLine(line, output); - -// Extra properties being generated from module -output.properties.dist; -output.properties.multiFeatureIndex; -output.properties.index; -output.properties.location; diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index 3965b68b09..6f2831b6c4 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/circle": "workspace:^", diff --git a/packages/turf-nearest-point-to-line/tsconfig.json b/packages/turf-nearest-point-to-line/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-nearest-point-to-line/tsconfig.json +++ b/packages/turf-nearest-point-to-line/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-nearest-point-to-line/tsconfig.testTypes.json b/packages/turf-nearest-point-to-line/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-nearest-point-to-line/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-nearest-point-to-line/types.ts b/packages/turf-nearest-point-to-line/types.ts deleted file mode 100644 index aca829901d..0000000000 --- a/packages/turf-nearest-point-to-line/types.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { - geometryCollection, - featureCollection, - point, - lineString, -} from "@turf/helpers"; -import { nearestPointToLine } from "./index.js"; - -const points = featureCollection([point([0, 0]), point([0.5, 0.5])]); -const line = lineString([ - [1, 1], - [-1, 1], -]); - -const nearest = nearestPointToLine<{ foo: string; dist: number }>( - points, - line, - { properties: { foo: "bar" } } -); -nearest.properties.foo; -nearest.properties.dist; -// nearest.properties.bar // [ts] Property 'bar' does not exist on type '{ dist?: number; foo: string; }'. - -// GeometryCollection -const geomPoints = geometryCollection([ - point([0, 0]).geometry, - point([0.5, 0.5]).geometry, -]); -nearestPointToLine(geomPoints, line); diff --git a/packages/turf-nearest-point/package.json b/packages/turf-nearest-point/package.json index 44574f31bf..3f861a910a 100644 --- a/packages/turf-nearest-point/package.json +++ b/packages/turf-nearest-point/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-nearest-point/tsconfig.json b/packages/turf-nearest-point/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-nearest-point/tsconfig.json +++ b/packages/turf-nearest-point/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-nearest-point/tsconfig.testTypes.json b/packages/turf-nearest-point/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-nearest-point/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-nearest-point/types.ts b/packages/turf-nearest-point/types.ts deleted file mode 100644 index 4aeb5ac610..0000000000 --- a/packages/turf-nearest-point/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { point, featureCollection } from "@turf/helpers"; -import { nearestPoint } from "./index.js"; - -const targetPoint = point([28.965797, 41.010086], { "marker-color": "#0F0" }); -const points = featureCollection([ - point([28.973865, 41.011122]), - point([28.948459, 41.024204]), - point([28.938674, 41.013324]), -]); -const nearest = nearestPoint(targetPoint, points, { units: "kilometers" }); -nearest.properties.distanceToPoint; -nearest.properties.featureIndex; diff --git a/packages/turf-planepoint/package.json b/packages/turf-planepoint/package.json index 5fee72af0d..0f4cdb18ad 100644 --- a/packages/turf-planepoint/package.json +++ b/packages/turf-planepoint/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-planepoint/tsconfig.json b/packages/turf-planepoint/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-planepoint/tsconfig.json +++ b/packages/turf-planepoint/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-planepoint/tsconfig.testTypes.json b/packages/turf-planepoint/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-planepoint/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-planepoint/types.ts b/packages/turf-planepoint/types.ts deleted file mode 100644 index edbbb1739c..0000000000 --- a/packages/turf-planepoint/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { point, polygon } from "@turf/helpers"; -import { planepoint } from "./index.js"; - -const pt = point([1, 1]); -const triangle = polygon([ - [ - [0, 0, 0], - [2, 0, 0], - [1, 2, 2], - [0, 0, 0], - ], -]); - -planepoint(pt, triangle); -planepoint(pt.geometry.coordinates, triangle); -planepoint(pt.geometry, triangle.geometry); diff --git a/packages/turf-point-grid/package.json b/packages/turf-point-grid/package.json index 02ba8206bd..addf71b062 100644 --- a/packages/turf-point-grid/package.json +++ b/packages/turf-point-grid/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-point-grid/tsconfig.json b/packages/turf-point-grid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-point-grid/tsconfig.json +++ b/packages/turf-point-grid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-point-grid/tsconfig.testTypes.json b/packages/turf-point-grid/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-point-grid/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-point-grid/types.ts b/packages/turf-point-grid/types.ts deleted file mode 100644 index 8eb9a3eb13..0000000000 --- a/packages/turf-point-grid/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { BBox } from "geojson"; -import { polygon } from "@turf/helpers"; -import { pointGrid } from "./index.js"; - -const cellSide = 50; -const bbox: BBox = [-95, 30, -85, 40]; -const poly = polygon([ - [ - [20, 30], - [10, 10], - [20, 20], - [20, 30], - ], -]); - -pointGrid(bbox, cellSide); -pointGrid(bbox, cellSide, { units: "miles" }); -pointGrid(bbox, cellSide, { units: "miles", mask: poly }); -pointGrid(bbox, cellSide, { - units: "miles", - mask: poly, - properties: { foo: "bar" }, -}); diff --git a/packages/turf-point-on-feature/package.json b/packages/turf-point-on-feature/package.json index 2b908161b0..4fd67a06a1 100644 --- a/packages/turf-point-on-feature/package.json +++ b/packages/turf-point-on-feature/package.json @@ -50,7 +50,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/meta": "workspace:^", diff --git a/packages/turf-point-on-feature/tsconfig.json b/packages/turf-point-on-feature/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-point-on-feature/tsconfig.json +++ b/packages/turf-point-on-feature/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-point-to-line-distance/package.json b/packages/turf-point-to-line-distance/package.json index 67c4ca1b5d..143401a1f1 100644 --- a/packages/turf-point-to-line-distance/package.json +++ b/packages/turf-point-to-line-distance/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/circle": "workspace:^", diff --git a/packages/turf-point-to-line-distance/tsconfig.json b/packages/turf-point-to-line-distance/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-point-to-line-distance/tsconfig.json +++ b/packages/turf-point-to-line-distance/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-point-to-line-distance/tsconfig.testTypes.json b/packages/turf-point-to-line-distance/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-point-to-line-distance/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-point-to-line-distance/types.ts b/packages/turf-point-to-line-distance/types.ts deleted file mode 100644 index b9c198b17b..0000000000 --- a/packages/turf-point-to-line-distance/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { point, lineString } from "@turf/helpers"; -import { pointToLineDistance } from "./index.js"; - -const pt = point([0, 0]); -const line = lineString([ - [1, 1], - [-1, 1], -]); -const distance: number = pointToLineDistance(pt, line, { units: "miles" }); - -pointToLineDistance(pt, line); -pointToLineDistance(pt, line, { units: "miles" }); -pointToLineDistance(pt, line, { units: "miles", method: "planar" }); diff --git a/packages/turf-points-within-polygon/package.json b/packages/turf-points-within-polygon/package.json index b664988db6..6230a95788 100644 --- a/packages/turf-points-within-polygon/package.json +++ b/packages/turf-points-within-polygon/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-points-within-polygon/tsconfig.json b/packages/turf-points-within-polygon/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-points-within-polygon/tsconfig.json +++ b/packages/turf-points-within-polygon/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-points-within-polygon/tsconfig.testTypes.json b/packages/turf-points-within-polygon/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-points-within-polygon/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-points-within-polygon/types.ts b/packages/turf-points-within-polygon/types.ts deleted file mode 100644 index 8597843653..0000000000 --- a/packages/turf-points-within-polygon/types.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Point, MultiPoint } from "geojson"; -import { pointsWithinPolygon } from "./index.js"; -import { points, polygon, multiPoint, featureCollection } from "@turf/helpers"; - -const pts = points([ - [-46.6318, -23.5523], - [-46.6246, -23.5325], - [-46.6062, -23.5513], - [-46.663, -23.554], - [-46.643, -23.557], -]); -const mpt1 = multiPoint( - [ - [50, 50], - [100, 100], - ], - {} -); -const mpt2 = multiPoint( - [ - [75, 75], - [150, 150], - ], - {} -); -const mpts = featureCollection([mpt1, mpt2]); - -const searchWithin = polygon([ - [ - [-46.653, -23.543], - [-46.634, -23.5346], - [-46.613, -23.543], - [-46.614, -23.559], - [-46.631, -23.567], - [-46.653, -23.56], - [-46.653, -23.543], - ], -]); -const ptsWithin = pointsWithinPolygon(pts, searchWithin); -const mptsWithin = pointsWithinPolygon(mpts, searchWithin); - -// Accepts a mixture of Point and MultiPoint -const mix = featureCollection([...pts.features, mpt1]); -const mixWithin = pointsWithinPolygon(mix, searchWithin); diff --git a/packages/turf-polygon-smooth/package.json b/packages/turf-polygon-smooth/package.json index be0705832c..8b3507413c 100644 --- a/packages/turf-polygon-smooth/package.json +++ b/packages/turf-polygon-smooth/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygon-smooth/tsconfig.json b/packages/turf-polygon-smooth/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-polygon-smooth/tsconfig.json +++ b/packages/turf-polygon-smooth/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-polygon-smooth/tsconfig.testTypes.json b/packages/turf-polygon-smooth/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-polygon-smooth/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-polygon-smooth/types.ts b/packages/turf-polygon-smooth/types.ts deleted file mode 100644 index 1519280ad0..0000000000 --- a/packages/turf-polygon-smooth/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { polygon } from "@turf/helpers"; -import { polygonSmooth } from "./index.js"; - -const poly = polygon([ - [ - [100.0, 0.0], - [101.0, 0.0], - [101.0, 1.0], - [100.0, 1.0], - [100.0, 0.0], - ], -]); - -polygonSmooth(poly); -polygonSmooth(poly, { iterations: 3 }); diff --git a/packages/turf-polygon-tangents/package.json b/packages/turf-polygon-tangents/package.json index d5afef45c4..fd42f9bc6d 100644 --- a/packages/turf-polygon-tangents/package.json +++ b/packages/turf-polygon-tangents/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygon-tangents/tsconfig.json b/packages/turf-polygon-tangents/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-polygon-tangents/tsconfig.json +++ b/packages/turf-polygon-tangents/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-polygon-tangents/tsconfig.testTypes.json b/packages/turf-polygon-tangents/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-polygon-tangents/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-polygon-tangents/types.ts b/packages/turf-polygon-tangents/types.ts deleted file mode 100644 index dd02ba927d..0000000000 --- a/packages/turf-polygon-tangents/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { polygon, point } from "@turf/helpers"; -import { polygonTangents as tangents } from "./index.js"; - -const poly = polygon([ - [ - [11, 0], - [22, 4], - [31, 0], - [31, 11], - [21, 15], - [11, 11], - [11, 0], - ], -]); -const pt = point([61, 5]); -tangents(pt, poly); diff --git a/packages/turf-polygon-to-line/package.json b/packages/turf-polygon-to-line/package.json index 7bc7252da6..1e0c02cc56 100644 --- a/packages/turf-polygon-to-line/package.json +++ b/packages/turf-polygon-to-line/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygon-to-line/tsconfig.json b/packages/turf-polygon-to-line/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-polygon-to-line/tsconfig.json +++ b/packages/turf-polygon-to-line/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-polygonize/package.json b/packages/turf-polygonize/package.json index 57d2f49705..eee147c6cc 100644 --- a/packages/turf-polygonize/package.json +++ b/packages/turf-polygonize/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-polygonize/tsconfig.json b/packages/turf-polygonize/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-polygonize/tsconfig.json +++ b/packages/turf-polygonize/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-polygonize/tsconfig.testTypes.json b/packages/turf-polygonize/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-polygonize/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-polygonize/types.ts b/packages/turf-polygonize/types.ts deleted file mode 100644 index 80bc1e456c..0000000000 --- a/packages/turf-polygonize/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { lineString } from "@turf/helpers"; -import { polygonize } from "./index.js"; - -const line = lineString([ - [10, 10], - [0, 0], - [3, -5], - [10, 10], -]); -polygonize(line); diff --git a/packages/turf-projection/package.json b/packages/turf-projection/package.json index cf328765ee..9c2d96e270 100644 --- a/packages/turf-projection/package.json +++ b/packages/turf-projection/package.json @@ -61,7 +61,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-projection/tsconfig.json b/packages/turf-projection/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-projection/tsconfig.json +++ b/packages/turf-projection/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-projection/tsconfig.testTypes.json b/packages/turf-projection/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-projection/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-projection/types.ts b/packages/turf-projection/types.ts deleted file mode 100644 index 55e7ead1f2..0000000000 --- a/packages/turf-projection/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as projection from "./index.js"; -import { toMercator, toWgs84 } from "./index.js"; -import { point } from "@turf/helpers"; - -// Types test -const pt = point([3, 51]); -const projected = toMercator(pt); -const degrees = toWgs84(projected); - -// default import -projection.toMercator(pt); -projection.toWgs84(projected); diff --git a/packages/turf-quadrat-analysis/package.json b/packages/turf-quadrat-analysis/package.json index 642763e2fc..be55677ea1 100644 --- a/packages/turf-quadrat-analysis/package.json +++ b/packages/turf-quadrat-analysis/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/nearest-neighbor-analysis": "workspace:^", diff --git a/packages/turf-quadrat-analysis/tsconfig.json b/packages/turf-quadrat-analysis/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-quadrat-analysis/tsconfig.json +++ b/packages/turf-quadrat-analysis/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-random/package.json b/packages/turf-random/package.json index 30d4368b19..0198098106 100644 --- a/packages/turf-random/package.json +++ b/packages/turf-random/package.json @@ -46,7 +46,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-random/tsconfig.json b/packages/turf-random/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-random/tsconfig.json +++ b/packages/turf-random/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-rectangle-grid/package.json b/packages/turf-rectangle-grid/package.json index 79583c2c4e..7e9a82021a 100644 --- a/packages/turf-rectangle-grid/package.json +++ b/packages/turf-rectangle-grid/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-rectangle-grid/tsconfig.json b/packages/turf-rectangle-grid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-rectangle-grid/tsconfig.json +++ b/packages/turf-rectangle-grid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-rewind/package.json b/packages/turf-rewind/package.json index 34d7e84cd9..2c82db6e9f 100644 --- a/packages/turf-rewind/package.json +++ b/packages/turf-rewind/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-rewind/tsconfig.json b/packages/turf-rewind/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-rewind/tsconfig.json +++ b/packages/turf-rewind/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-rewind/tsconfig.testTypes.json b/packages/turf-rewind/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-rewind/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-rewind/types.ts b/packages/turf-rewind/types.ts deleted file mode 100644 index a87727cd83..0000000000 --- a/packages/turf-rewind/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { - polygon, - lineString, - multiLineString, - multiPolygon, -} from "@turf/helpers"; -import { rewind } from "./index.js"; - -const coords = [ - [121, -29], - [138, -29], - [138, -18], - [121, -18], - [121, -29], -]; -const poly = polygon([coords]); -const line = lineString(coords); -const multiPoly = multiPolygon([[coords], [coords]]); -const multiLine = multiLineString([coords, coords]); - -rewind(line); -rewind(poly); -rewind(multiPoly); -rewind(multiLine); -rewind(poly, { mutate: true }); -rewind(poly, { mutate: true, reverse: true }); diff --git a/packages/turf-rhumb-bearing/package.json b/packages/turf-rhumb-bearing/package.json index befe3b3692..921678b622 100644 --- a/packages/turf-rhumb-bearing/package.json +++ b/packages/turf-rhumb-bearing/package.json @@ -54,7 +54,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/destination": "workspace:^", diff --git a/packages/turf-rhumb-bearing/tsconfig.json b/packages/turf-rhumb-bearing/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-rhumb-bearing/tsconfig.json +++ b/packages/turf-rhumb-bearing/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-rhumb-destination/package.json b/packages/turf-rhumb-destination/package.json index 0164ee5411..dd5f1c5a4d 100644 --- a/packages/turf-rhumb-destination/package.json +++ b/packages/turf-rhumb-destination/package.json @@ -58,7 +58,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-rhumb-destination/tsconfig.json b/packages/turf-rhumb-destination/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-rhumb-destination/tsconfig.json +++ b/packages/turf-rhumb-destination/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-rhumb-distance/package.json b/packages/turf-rhumb-distance/package.json index 7dbd605ec3..803465942a 100644 --- a/packages/turf-rhumb-distance/package.json +++ b/packages/turf-rhumb-distance/package.json @@ -56,7 +56,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/distance": "workspace:^", diff --git a/packages/turf-rhumb-distance/tsconfig.json b/packages/turf-rhumb-distance/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-rhumb-distance/tsconfig.json +++ b/packages/turf-rhumb-distance/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-sample/package.json b/packages/turf-sample/package.json index 5520b986d4..041238bb65 100644 --- a/packages/turf-sample/package.json +++ b/packages/turf-sample/package.json @@ -48,7 +48,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-sample/tsconfig.json b/packages/turf-sample/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-sample/tsconfig.json +++ b/packages/turf-sample/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-sector/package.json b/packages/turf-sector/package.json index 5254853830..261351bad2 100644 --- a/packages/turf-sector/package.json +++ b/packages/turf-sector/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-sector/tsconfig.json b/packages/turf-sector/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-sector/tsconfig.json +++ b/packages/turf-sector/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-sector/tsconfig.testTypes.json b/packages/turf-sector/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-sector/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-sector/types.ts b/packages/turf-sector/types.ts deleted file mode 100644 index acc42b6b33..0000000000 --- a/packages/turf-sector/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { point } from "@turf/helpers"; -import { sector } from "./index.js"; - -const center = point([-75.343, 39.984]); -const units = "kilometers"; -const bearing1 = 10; -const bearing2 = -30; -const radius = 5; -const steps = 10; - -sector(center, radius, bearing1, bearing2); -sector(center, radius, bearing1, bearing2, { steps }); -sector(center, radius, bearing1, bearing2, { steps, units }); diff --git a/packages/turf-shortest-path/package.json b/packages/turf-shortest-path/package.json index 5c242c4ae5..4a86eb514d 100644 --- a/packages/turf-shortest-path/package.json +++ b/packages/turf-shortest-path/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-shortest-path/tsconfig.json b/packages/turf-shortest-path/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-shortest-path/tsconfig.json +++ b/packages/turf-shortest-path/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-shortest-path/tsconfig.testTypes.json b/packages/turf-shortest-path/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-shortest-path/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-shortest-path/types.ts b/packages/turf-shortest-path/types.ts deleted file mode 100644 index 845fa80144..0000000000 --- a/packages/turf-shortest-path/types.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { point, featureCollection, polygon } from "@turf/helpers"; -import { shortestPath } from "./index.js"; - -const start = point([-5, -6]); -const end = point([9, -6]); - -shortestPath(start.geometry, end.geometry.coordinates); -shortestPath(start, end); -shortestPath(start, end, { - obstacles: polygon([ - [ - [0, -7], - [5, -7], - [5, -3], - [0, -3], - [0, -7], - ], - ]), -}); -shortestPath(start, end, { - obstacles: featureCollection([ - polygon([ - [ - [0, -7], - [5, -7], - [5, -3], - [0, -3], - [0, -7], - ], - ]), - ]), -}); -shortestPath(start, end, { - resolution: 1000, -}); diff --git a/packages/turf-simplify/package.json b/packages/turf-simplify/package.json index 270267e581..513565c666 100644 --- a/packages/turf-simplify/package.json +++ b/packages/turf-simplify/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-simplify/tsconfig.json b/packages/turf-simplify/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-simplify/tsconfig.json +++ b/packages/turf-simplify/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-simplify/tsconfig.testTypes.json b/packages/turf-simplify/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-simplify/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-simplify/types.ts b/packages/turf-simplify/types.ts deleted file mode 100644 index c5d5dda23a..0000000000 --- a/packages/turf-simplify/types.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Feature, Polygon } from "geojson"; -import { polygon } from "@turf/helpers"; -import { simplify } from "./index.js"; - -const poly = polygon([ - [ - [0, 0], - [10, 10], - [20, 20], - [0, 0], - ], -]); - -// Output type is the same as Input type -const simple: Feature = simplify(poly); - -// Extra params -simplify(poly, { tolerance: 1 }); -simplify(poly, { tolerance: 1, highQuality: true }); diff --git a/packages/turf-square-grid/package.json b/packages/turf-square-grid/package.json index 6ff4766ea3..690ae07e13 100644 --- a/packages/turf-square-grid/package.json +++ b/packages/turf-square-grid/package.json @@ -49,7 +49,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-square-grid/tsconfig.json b/packages/turf-square-grid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-square-grid/tsconfig.json +++ b/packages/turf-square-grid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-square/package.json b/packages/turf-square/package.json index 11393db1ee..362dd04ae2 100644 --- a/packages/turf-square/package.json +++ b/packages/turf-square/package.json @@ -48,7 +48,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-square/tsconfig.json b/packages/turf-square/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-square/tsconfig.json +++ b/packages/turf-square/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-standard-deviational-ellipse/package.json b/packages/turf-standard-deviational-ellipse/package.json index 92fe24098d..7a723c2261 100644 --- a/packages/turf-standard-deviational-ellipse/package.json +++ b/packages/turf-standard-deviational-ellipse/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/random": "workspace:^", diff --git a/packages/turf-standard-deviational-ellipse/tsconfig.json b/packages/turf-standard-deviational-ellipse/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-standard-deviational-ellipse/tsconfig.json +++ b/packages/turf-standard-deviational-ellipse/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json b/packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-standard-deviational-ellipse/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-standard-deviational-ellipse/types.ts b/packages/turf-standard-deviational-ellipse/types.ts deleted file mode 100644 index 3b7760de92..0000000000 --- a/packages/turf-standard-deviational-ellipse/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { points } from "@turf/helpers"; -import { standardDeviationalEllipse } from "./index.js"; - -const pts = points([ - [10, 10], - [0, 5], -]); -const stdEllipse = standardDeviationalEllipse(pts); - -// Access custom properties -// It's correct to use optional chaining here ?. as even though the function -// *always* adds properties, that does not change the overall optional nature of -// the containing properties attribute. -stdEllipse.properties?.standardDeviationalEllipse.meanCenterCoordinates; diff --git a/packages/turf-tag/package.json b/packages/turf-tag/package.json index 694b172be3..039be6af9e 100644 --- a/packages/turf-tag/package.json +++ b/packages/turf-tag/package.json @@ -52,7 +52,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-tag/tsconfig.json b/packages/turf-tag/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-tag/tsconfig.json +++ b/packages/turf-tag/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-tesselate/package.json b/packages/turf-tesselate/package.json index c9e879a607..1fd278ce43 100644 --- a/packages/turf-tesselate/package.json +++ b/packages/turf-tesselate/package.json @@ -56,7 +56,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-tesselate/tsconfig.json b/packages/turf-tesselate/tsconfig.json index 563bf86442..05f6b84c5a 100644 --- a/packages/turf-tesselate/tsconfig.json +++ b/packages/turf-tesselate/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts", "earcut.d.ts"] } diff --git a/packages/turf-tin/package.json b/packages/turf-tin/package.json index b8273d91df..f3bcd545dd 100644 --- a/packages/turf-tin/package.json +++ b/packages/turf-tin/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-tin/tsconfig.json b/packages/turf-tin/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-tin/tsconfig.json +++ b/packages/turf-tin/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-tin/tsconfig.testTypes.json b/packages/turf-tin/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-tin/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-tin/types.ts b/packages/turf-tin/types.ts deleted file mode 100644 index 2802fb41f8..0000000000 --- a/packages/turf-tin/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { featureCollection, point } from "@turf/helpers"; -import { tin } from "./index.js"; - -const points = featureCollection([ - point([0, 0], { elevation: 20 }), - point([10, 10], { elevation: 10 }), - point([30, 30], { elevation: 50 }), -]); -tin(points); -tin(points, "elevation"); diff --git a/packages/turf-transform-rotate/package.json b/packages/turf-transform-rotate/package.json index e3080ccb30..e415f6743a 100644 --- a/packages/turf-transform-rotate/package.json +++ b/packages/turf-transform-rotate/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-transform-rotate/tsconfig.json b/packages/turf-transform-rotate/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-transform-rotate/tsconfig.json +++ b/packages/turf-transform-rotate/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-transform-rotate/tsconfig.testTypes.json b/packages/turf-transform-rotate/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-transform-rotate/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-transform-rotate/types.ts b/packages/turf-transform-rotate/types.ts deleted file mode 100644 index cb0f0af6fb..0000000000 --- a/packages/turf-transform-rotate/types.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Point, Feature, Polygon, FeatureCollection } from "geojson"; -import { - polygon, - point, - featureCollection, - geometryCollection, -} from "@turf/helpers"; -import { transformRotate as rotate } from "./index.js"; - -const pt = point([15, 15]); -const poly = polygon([ - [ - [0, 29], - [3.5, 29], - [2.5, 32], - [0, 29], - ], -]); - -// Does not mutate Geometry type -const rotatedPoly: Feature = rotate(poly, 100, { pivot: pt }); -const rotatedFCPoly: FeatureCollection = rotate( - featureCollection([poly]), - 100, - { pivot: pt } -); - -// Different Geometry Inputs -rotate(poly, 100, { pivot: pt }); -rotate(poly, 100, { pivot: pt.geometry }); -rotate(poly.geometry, 100, { pivot: pt.geometry.coordinates }); -rotate(featureCollection([poly]), 100, { pivot: pt.geometry }); -rotate(featureCollection([poly, pt]), 100, { pivot: pt }); -rotate(geometryCollection([poly.geometry]).geometry, 100, { - pivot: pt.geometry, -}); -rotate(geometryCollection([poly.geometry]), 100, { pivot: pt.geometry }); -rotate(geometryCollection([poly.geometry, pt.geometry]), 100, { pivot: pt }); - -// Allow mutating -rotate(poly, 100, { pivot: pt, mutate: true }); diff --git a/packages/turf-transform-scale/package.json b/packages/turf-transform-scale/package.json index df01dbd941..2fb1f3d84c 100644 --- a/packages/turf-transform-scale/package.json +++ b/packages/turf-transform-scale/package.json @@ -57,7 +57,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-transform-scale/tsconfig.json b/packages/turf-transform-scale/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-transform-scale/tsconfig.json +++ b/packages/turf-transform-scale/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-transform-scale/tsconfig.testTypes.json b/packages/turf-transform-scale/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-transform-scale/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-transform-scale/types.ts b/packages/turf-transform-scale/types.ts deleted file mode 100644 index e4e3bcf0d8..0000000000 --- a/packages/turf-transform-scale/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { LineString, Feature, Polygon } from "geojson"; -import { lineString, polygon, featureCollection } from "@turf/helpers"; -import { transformScale as scale } from "./index.js"; - -const line = lineString([ - [0, 0], - [10, 29], -]); -const poly = polygon([ - [ - [0, 29], - [3.5, 29], - [2.5, 32], - [0, 29], - ], -]); - -// Does not mutate Geometry type -const scaledPt: LineString = scale(line.geometry, 1.5); -const scaledPoly: Feature = scale(poly, 1.5); - -// Diferent Geometry inputs -scale(line.geometry, 1.5); -scale(poly.geometry, 1.5); -scale(featureCollection([poly]), 1.5); - -// All params -scale(poly, 1.5); -scale(poly, 1.5, { origin: [10, 10] }); -scale(poly, 1.5, { origin: "ne", mutate: true }); diff --git a/packages/turf-transform-translate/package.json b/packages/turf-transform-translate/package.json index 12dcf0b2ae..c86b502a11 100644 --- a/packages/turf-transform-translate/package.json +++ b/packages/turf-transform-translate/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", diff --git a/packages/turf-transform-translate/tsconfig.json b/packages/turf-transform-translate/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-transform-translate/tsconfig.json +++ b/packages/turf-transform-translate/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-transform-translate/tsconfig.testTypes.json b/packages/turf-transform-translate/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-transform-translate/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-transform-translate/types.ts b/packages/turf-transform-translate/types.ts deleted file mode 100644 index 303eebe68f..0000000000 --- a/packages/turf-transform-translate/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Point, Feature, Polygon } from "geojson"; -import { point, polygon, featureCollection } from "@turf/helpers"; -import { transformTranslate as translate } from "./index.js"; - -const pt = point([0, 0]); -const poly = polygon([ - [ - [0, 29], - [3.5, 29], - [2.5, 32], - [0, 29], - ], -]); - -// Does not mutate Geometry type -const translatedPt: Point = translate(pt.geometry, 100, 35); -const translatedPoly: Feature = translate(poly, 100, 35); - -// Diferent Geometry inputs -translate(pt.geometry, 100, 35); -translate(poly.geometry, 100, 35); -translate(featureCollection([poly]), 100, 35); - -// All params -translate(poly, 100, 35, { units: "kilometers" }); -translate(poly, 100, 35, { units: "kilometers", zTranslation: 10 }); -translate(poly, 100, 35, { - units: "kilometers", - zTranslation: 10, - mutate: true, -}); diff --git a/packages/turf-triangle-grid/package.json b/packages/turf-triangle-grid/package.json index 59e3c66b3c..79ca0ba5fe 100644 --- a/packages/turf-triangle-grid/package.json +++ b/packages/turf-triangle-grid/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", diff --git a/packages/turf-triangle-grid/tsconfig.json b/packages/turf-triangle-grid/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-triangle-grid/tsconfig.json +++ b/packages/turf-triangle-grid/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-triangle-grid/tsconfig.testTypes.json b/packages/turf-triangle-grid/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-triangle-grid/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-triangle-grid/types.ts b/packages/turf-triangle-grid/types.ts deleted file mode 100644 index 33a7b1c88a..0000000000 --- a/packages/turf-triangle-grid/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BBox } from "geojson"; -import { triangleGrid } from "./index.js"; - -// prettier-ignore -const bbox: BBox = [ - -96.6357421875, - 31.12819929911196, - -84.9462890625, - 40.58058466412764, -]; -const grid = triangleGrid(bbox, 50, { - units: "miles", - properties: { foo: "bar" }, -}); -grid.features[0].properties.foo; -// grid.features[0].properties.bar // [ts] Property 'bar' does not exist on type '{ 'foo': string; }'. diff --git a/packages/turf-truncate/package.json b/packages/turf-truncate/package.json index 8f887b6fe4..fec9ed3d58 100644 --- a/packages/turf-truncate/package.json +++ b/packages/turf-truncate/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-truncate/tsconfig.json b/packages/turf-truncate/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-truncate/tsconfig.json +++ b/packages/turf-truncate/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-truncate/tsconfig.testTypes.json b/packages/turf-truncate/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-truncate/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-truncate/types.ts b/packages/turf-truncate/types.ts deleted file mode 100644 index e67fac78f2..0000000000 --- a/packages/turf-truncate/types.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { - featureCollection, - point, - lineString, - geometryCollection, -} from "@turf/helpers"; -import { truncate } from "./index.js"; - -const pt = point([120.1234567, 40.1234567]); -const ptGeom = pt.geometry; -const line = lineString([ - [20, 80], - [50, 40], -]); -const lineGeom = line.geometry; -const points = featureCollection([pt]); -const lines = featureCollection([line]); -const geomCollection = geometryCollection([ptGeom, lineGeom]); - -truncate(pt); -truncate(ptGeom); -truncate(line); -truncate(lineGeom); -truncate(lines); -truncate(points); -truncate(geomCollection); -truncate(pt, { precision: 6 }); -truncate(pt, { precision: 3, coordinates: 2 }); -truncate(pt, { precision: 3, coordinates: 2, mutate: false }); diff --git a/packages/turf-union/package.json b/packages/turf-union/package.json index 6daff5017f..4528a986b0 100644 --- a/packages/turf-union/package.json +++ b/packages/turf-union/package.json @@ -47,7 +47,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-union/tsconfig.json b/packages/turf-union/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-union/tsconfig.json +++ b/packages/turf-union/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-union/tsconfig.testTypes.json b/packages/turf-union/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-union/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-union/types.ts b/packages/turf-union/types.ts deleted file mode 100644 index fff2c5aed2..0000000000 --- a/packages/turf-union/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { polygon, featureCollection } from "@turf/helpers"; -import { union } from "./index.js"; - -const poly1 = polygon([ - [ - [0, 0], - [10, 10], - [20, 20], - [0, 0], - ], -]); -const poly2 = polygon([ - [ - [20, 30], - [10, 10], - [20, 20], - [20, 30], - ], -]); -union(featureCollection([poly1, poly2])); diff --git a/packages/turf-unkink-polygon/package.json b/packages/turf-unkink-polygon/package.json index 3bb7200921..5268654ccb 100644 --- a/packages/turf-unkink-polygon/package.json +++ b/packages/turf-unkink-polygon/package.json @@ -50,7 +50,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/kinks": "workspace:^", diff --git a/packages/turf-unkink-polygon/tsconfig.json b/packages/turf-unkink-polygon/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-unkink-polygon/tsconfig.json +++ b/packages/turf-unkink-polygon/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/packages/turf-unkink-polygon/tsconfig.testTypes.json b/packages/turf-unkink-polygon/tsconfig.testTypes.json deleted file mode 100644 index 9ec75a08c6..0000000000 --- a/packages/turf-unkink-polygon/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["types.ts"] -} diff --git a/packages/turf-unkink-polygon/types.ts b/packages/turf-unkink-polygon/types.ts deleted file mode 100644 index 721492b8e1..0000000000 --- a/packages/turf-unkink-polygon/types.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { polygon, multiPolygon } from "@turf/helpers"; -import { unkinkPolygon as unkink } from "./index.js"; - -const poly = polygon([ - [ - [20, 30], - [10, 10], - [20, 20], - [20, 30], - ], -]); -const multiPoly = multiPolygon([ - [ - [ - [20, 30], - [10, 10], - [20, 20], - [20, 30], - ], - ], - [ - [ - [0, 0], - [10, 10], - [20, 20], - [0, 0], - ], - ], -]); - -unkink(poly); -unkink(multiPoly); diff --git a/packages/turf-voronoi/package.json b/packages/turf-voronoi/package.json index 38d0e16e8f..aa1a2afa57 100644 --- a/packages/turf-voronoi/package.json +++ b/packages/turf-voronoi/package.json @@ -55,7 +55,8 @@ "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" + "test:tape": "tsx test.ts", + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/turf-voronoi/tsconfig.json b/packages/turf-voronoi/tsconfig.json index 563bf86442..1ced55f826 100644 --- a/packages/turf-voronoi/tsconfig.json +++ b/packages/turf-voronoi/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "../../tsconfig.shared.json" + "extends": "../../tsconfig.shared.json", + "files": ["index.ts"] } diff --git a/templates/tsconfig.testTypes.json b/templates/tsconfig.testTypes.json index 9ec75a08c6..fd44a42945 100644 --- a/templates/tsconfig.testTypes.json +++ b/templates/tsconfig.testTypes.json @@ -3,5 +3,5 @@ "compilerOptions": { "noEmit": true }, - "include": ["types.ts"] + "files": ["types.ts"] } From 88ce05a007526df5194560bda725254f0e458c87 Mon Sep 17 00:00:00 2001 From: James Beard Date: Thu, 15 Aug 2024 17:27:19 +1000 Subject: [PATCH 07/10] Fixed a couple of build errors that seem to be related to how typescript infers type dependencies of imported types. These must have surfaced due to this PRs new approach to linking package dependencies. Solution was to explicitly define a few return types that previously were being inferred. Should be fixed permanently in typescript 5.5, though nothing really for us to revert. See https://github.com/microsoft/TypeScript/issues/47663#issuecomment-2094122451 Also synced some JSDoc with the function's actual type definition. --- packages/turf-line-to-polygon/README.md | 29 +++++++++--------------- packages/turf-line-to-polygon/index.ts | 8 ++++--- packages/turf-polygonize/README.md | 10 ++++---- packages/turf-polygonize/index.ts | 2 +- packages/turf-polygonize/lib/Edge.ts | 3 ++- packages/turf-polygonize/lib/EdgeRing.ts | 4 ++-- 6 files changed, 25 insertions(+), 31 deletions(-) diff --git a/packages/turf-line-to-polygon/README.md b/packages/turf-line-to-polygon/README.md index 93e53f3a13..a731b4f439 100644 --- a/packages/turf-line-to-polygon/README.md +++ b/packages/turf-line-to-polygon/README.md @@ -8,13 +8,12 @@ Converts (Multi)LineString(s) to Polygon(s). ### Parameters -* `lines` **([FeatureCollection][1] | [Feature][2]<([LineString][3] | [MultiLineString][4])>)** Features to convert -* `options` **[Object][5]** Optional parameters (optional, default `{}`) +* `options` **[Object][1]** Optional parameters (optional, default `{}`) - * `options.properties` **[Object][5]** translates GeoJSON properties to Feature (optional, default `{}`) - * `options.autoComplete` **[boolean][6]** auto complete linestrings (matches first & last coordinates) (optional, default `true`) - * `options.orderCoords` **[boolean][6]** sorts linestrings to place outer ring at the first position of the coordinates (optional, default `true`) - * `options.mutate` **[boolean][6]** mutate the original linestring using autoComplete (matches first & last coordinates) (optional, default `false`) + * `options.properties` **[Object][1]** translates GeoJSON properties to Feature (optional, default `{}`) + * `options.autoComplete` **[boolean][2]** auto complete linestrings (matches first & last coordinates) (optional, default `true`) + * `options.orderCoords` **[boolean][2]** sorts linestrings to place outer ring at the first position of the coordinates (optional, default `true`) + * `options.mutate` **[boolean][2]** mutate the original linestring using autoComplete (matches first & last coordinates) (optional, default `false`) ### Examples @@ -27,23 +26,17 @@ var polygon = turf.lineToPolygon(line); var addToMap = [polygon]; ``` -Returns **[Feature][2]<([Polygon][7] | [MultiPolygon][8])>** converted to Polygons +Returns **[Feature][3]<([Polygon][4] | [MultiPolygon][5])>** converted to Polygons -[1]: https://tools.ietf.org/html/rfc7946#section-3.3 +[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[2]: https://tools.ietf.org/html/rfc7946#section-3.2 +[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean -[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4 +[3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object - -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean - -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6 - -[8]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7 diff --git a/packages/turf-line-to-polygon/index.ts b/packages/turf-line-to-polygon/index.ts index 78fb031417..92a4a7e529 100644 --- a/packages/turf-line-to-polygon/index.ts +++ b/packages/turf-line-to-polygon/index.ts @@ -6,6 +6,8 @@ import { GeoJsonProperties, BBox, Position, + Polygon, + MultiPolygon, } from "geojson"; import { bbox as turfBBox } from "@turf/bbox"; import { getCoords, getGeom } from "@turf/invariant"; @@ -16,7 +18,7 @@ import { clone } from "@turf/clone"; * Converts (Multi)LineString(s) to Polygon(s). * * @name lineToPolygon - * @param {FeatureCollection|Feature} lines Features to convert + * @param {FeatureCollection|Feature|} lines Features to convert * @param {Object} [options={}] Optional parameters * @param {Object} [options.properties={}] translates GeoJSON properties to Feature * @param {boolean} [options.autoComplete=true] auto complete linestrings (matches first & last coordinates) @@ -39,7 +41,7 @@ function lineToPolygon( orderCoords?: boolean; mutate?: boolean; } = {} -) { +): Feature { // Optional parameters var properties = options.properties; var autoComplete = options.autoComplete ?? true; @@ -68,7 +70,7 @@ function lineToPolygon( * LineString to Polygon * * @private - * @param {Feature} line line + * @param {Feature|LineString|MultiLineString} line line * @param {Object} [properties] translates GeoJSON properties to Feature * @param {boolean} [autoComplete=true] auto complete linestrings * @param {boolean} [orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates diff --git a/packages/turf-polygonize/README.md b/packages/turf-polygonize/README.md index 48f42a366f..131ce19403 100644 --- a/packages/turf-polygonize/README.md +++ b/packages/turf-polygonize/README.md @@ -18,11 +18,11 @@ The implementation correctly handles: ### Parameters -* `geoJson` **([FeatureCollection][3] | [Geometry][4] | [Feature][5]<([LineString][1] | [MultiLineString][6])>)** Lines in order to polygonize +* `geoJson` **([FeatureCollection][3]<([LineString][1] | [MultiLineString][4])> | [Feature][5]<([LineString][1] | [MultiLineString][4])> | [LineString][1] | [MultiLineString][4])** Lines in order to polygonize -* Throws **[Error][7]** if geoJson is invalid. +* Throws **[Error][6]** if geoJson is invalid. Returns **[FeatureCollection][3]<[Polygon][2]>** Polygons created @@ -32,13 +32,11 @@ Returns **[FeatureCollection][3]<[Polygon][2]>** Polygons created [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5 [5]: https://tools.ietf.org/html/rfc7946#section-3.2 -[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5 - -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error diff --git a/packages/turf-polygonize/index.ts b/packages/turf-polygonize/index.ts index 30f4e75295..1ccc3eb1b1 100644 --- a/packages/turf-polygonize/index.ts +++ b/packages/turf-polygonize/index.ts @@ -23,7 +23,7 @@ import { EdgeRing } from "./lib/EdgeRing.js"; * - Cut Edges (bridges): edges that are connected at both ends but which do not form part of a polygon. * * @name polygonize - * @param {FeatureCollection|Geometry|Feature} geoJson Lines in order to polygonize + * @param {FeatureCollection|Feature|LineString|MultiLineString} geoJson Lines in order to polygonize * @returns {FeatureCollection} Polygons created * @throws {Error} if geoJson is invalid. */ diff --git a/packages/turf-polygonize/lib/Edge.ts b/packages/turf-polygonize/lib/Edge.ts index 76239e3530..96f71820e8 100644 --- a/packages/turf-polygonize/lib/Edge.ts +++ b/packages/turf-polygonize/lib/Edge.ts @@ -1,3 +1,4 @@ +import { Feature, LineString } from "geojson"; import { lineString } from "@turf/helpers"; import { orientationIndex } from "./util.js"; import { Node } from "./Node.js"; @@ -74,7 +75,7 @@ class Edge { * * @returns {Feature} - LineString representation of the Edge */ - toLineString() { + toLineString(): Feature { return lineString([this.from.coordinates, this.to.coordinates]); } diff --git a/packages/turf-polygonize/lib/EdgeRing.ts b/packages/turf-polygonize/lib/EdgeRing.ts index c087cb3887..9d469aef5b 100644 --- a/packages/turf-polygonize/lib/EdgeRing.ts +++ b/packages/turf-polygonize/lib/EdgeRing.ts @@ -1,4 +1,4 @@ -import { Polygon, Feature, Point, Position } from "geojson"; +import { Polygon, Feature, MultiPoint, Point, Position } from "geojson"; import { orientationIndex, envelopeIsEqual, @@ -156,7 +156,7 @@ class EdgeRing { * @memberof EdgeRing * @returns {Feature} - Multipoint representation of the EdgeRing */ - toMultiPoint() { + toMultiPoint(): Feature { return multiPoint(this.edges.map((edge) => edge.from.coordinates)); } From cd4b7d647a8e30600ac197a71308f529c7bc6a35 Mon Sep 17 00:00:00 2001 From: James Beard Date: Fri, 16 Aug 2024 14:43:17 +1000 Subject: [PATCH 08/10] Refactoring "last-checks" into "bundleCdn" which seems more descriptive. Adding empty marchingsquares d.ts to isolines (same as we've done for isobands) to retire a ts-expect-error. Also believe prepublishOnly better target to use than prepublish. --- .monorepolint.config.mjs | 21 +++++++-------------- package.json | 2 +- packages/turf-isolines/index.ts | 1 - packages/turf-isolines/marchingsquares.d.ts | 1 + packages/turf-isolines/tsconfig.json | 2 +- packages/turf/package.json | 10 +++++----- 6 files changed, 15 insertions(+), 22 deletions(-) create mode 100644 packages/turf-isolines/marchingsquares.d.ts diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index b2c1ffcc37..932367f023 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -63,11 +63,14 @@ export default { `, }, includePackages: TS_PACKAGES.filter( - (elem) => !["@turf/isobands", "@turf/tesselate"].includes(elem) + (elem) => + !["@turf/isobands", "@turf/isolines", "@turf/tesselate"].includes( + elem + ) ), }), - // Special treatment for two packages with locally defined .d.ts files for + // Special treatment for three packages with locally defined .d.ts files for // untyped Javascript dependencies. Might be possible to remove should those // libraries be retired / types added to DefinitelyTyped. fileContents({ @@ -79,7 +82,7 @@ export default { } `, }, - includePackages: ["@turf/isobands"], + includePackages: ["@turf/isobands", "@turf/isolines"], }), fileContents({ options: { @@ -226,17 +229,7 @@ export default { build: "tsup --config ../../tsup.config.ts", }, }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], - }), - - packageScript({ - options: { - scripts: { - build: - "tsup --config ../../tsup.config.ts && rollup -c rollup.config.js", - }, - }, - includePackages: [MAIN_PACKAGE], + includePackages: [MAIN_PACKAGE, ...TS_PACKAGES, ...JS_PACKAGES], }), packageScript({ diff --git a/package.json b/package.json index 2fe01652cb..865d74ff72 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:prettier": "prettier --check .", "postinstall": "husky install", "preinstall": "npx only-allow pnpm", - "prepublish": "lerna run build && lerna run --scope @turf/turf last-checks", + "prepublishOnly": "lerna run build && lerna run --scope @turf/turf cdnBundle", "test": "lerna run test" }, "lint-staged": { diff --git a/packages/turf-isolines/index.ts b/packages/turf-isolines/index.ts index bade82833a..248732a175 100644 --- a/packages/turf-isolines/index.ts +++ b/packages/turf-isolines/index.ts @@ -2,7 +2,6 @@ import { bbox } from "@turf/bbox"; import { coordEach } from "@turf/meta"; import { collectionOf } from "@turf/invariant"; import { multiLineString, featureCollection, isObject } from "@turf/helpers"; -// @ts-expect-error Legacy JS library with no types defined import { isoContours } from "marchingsquares"; import { gridToMatrix } from "./lib/grid-to-matrix.js"; import { diff --git a/packages/turf-isolines/marchingsquares.d.ts b/packages/turf-isolines/marchingsquares.d.ts new file mode 100644 index 0000000000..5e3233864f --- /dev/null +++ b/packages/turf-isolines/marchingsquares.d.ts @@ -0,0 +1 @@ +declare module "marchingsquares"; diff --git a/packages/turf-isolines/tsconfig.json b/packages/turf-isolines/tsconfig.json index 1ced55f826..dec1a231df 100644 --- a/packages/turf-isolines/tsconfig.json +++ b/packages/turf-isolines/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "files": ["index.ts", "marchingsquares.d.ts"] } diff --git a/packages/turf/package.json b/packages/turf/package.json index 0624dedfe9..fe7ff00fcc 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -67,11 +67,11 @@ "turf.min.js" ], "scripts": { - "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", - "test": "echo '@turf/turf tests run in the last-checks step'" + "build": "tsup --config ../../tsup.config.ts", + "cdnBundle": "npm-run-all cdnBundle:minify cdnBundle:checks", + "cdnBundle:checks": "tsx test.ts && tsx test.example.js && tsx test.ts", + "cdnBundle:minify": "rollup -c rollup.config.js", + "test": "echo '@turf/turf tests run in the cdnBundle:checks step'" }, "devDependencies": { "@babel/core": "^7.23.2", From 7997ffe446b9cff7da8494522a681e4f137ca53d Mon Sep 17 00:00:00 2001 From: James Beard Date: Fri, 23 Aug 2024 17:23:33 +1000 Subject: [PATCH 09/10] Simplified MRL config significantly by treating almost all TS and JS packages the same. Only exception now is @turf/turf. Run tsc static type checking in all packages (except @turf/turf), even the JS ones. It's a no-op for JS, though standardises our package structure somewhat. Added a bunch of standard devDependencies to all projects including typescript, tslib, bench, tape, npm-run-all. Same rationale as above. Upgraded to typescript 5.5.4. Retired types.ts tests as most of them weren't adding much value any more now that we use tsc --noEmit to type check TS code. --- .monorepolint.config.mjs | 159 ++------ packages/turf-along/tsconfig.json | 3 +- packages/turf-angle/tsconfig.json | 3 +- packages/turf-area/tsconfig.json | 3 +- packages/turf-bbox-clip/tsconfig.json | 3 +- packages/turf-bbox-polygon/tsconfig.json | 3 +- packages/turf-bbox/tsconfig.json | 3 +- packages/turf-bearing/tsconfig.json | 3 +- packages/turf-bezier-spline/tsconfig.json | 3 +- packages/turf-boolean-clockwise/tsconfig.json | 3 +- packages/turf-boolean-concave/tsconfig.json | 3 +- packages/turf-boolean-contains/tsconfig.json | 3 +- packages/turf-boolean-crosses/tsconfig.json | 3 +- packages/turf-boolean-disjoint/tsconfig.json | 3 +- packages/turf-boolean-equal/tsconfig.json | 3 +- .../turf-boolean-intersects/tsconfig.json | 3 +- packages/turf-boolean-overlap/tsconfig.json | 3 +- packages/turf-boolean-parallel/tsconfig.json | 3 +- .../tsconfig.json | 3 +- .../turf-boolean-point-on-line/tsconfig.json | 3 +- packages/turf-boolean-touches/tsconfig.json | 3 +- packages/turf-boolean-valid/tsconfig.json | 3 +- packages/turf-boolean-within/tsconfig.json | 3 +- packages/turf-buffer/package.json | 6 +- packages/turf-buffer/tsconfig.testTypes.json | 7 - packages/turf-buffer/types.ts | 90 ----- packages/turf-center-mean/tsconfig.json | 3 +- packages/turf-center-median/tsconfig.json | 3 +- packages/turf-center-of-mass/tsconfig.json | 3 +- packages/turf-center/tsconfig.json | 3 +- packages/turf-centroid/tsconfig.json | 3 +- packages/turf-circle/tsconfig.json | 3 +- packages/turf-clean-coords/tsconfig.json | 3 +- packages/turf-clone/tsconfig.json | 3 +- packages/turf-clusters-dbscan/tsconfig.json | 3 +- packages/turf-clusters-kmeans/tsconfig.json | 3 +- packages/turf-clusters/tsconfig.json | 3 +- packages/turf-collect/tsconfig.json | 3 +- packages/turf-combine/tsconfig.json | 3 +- packages/turf-concave/tsconfig.json | 3 +- packages/turf-convex/tsconfig.json | 3 +- packages/turf-destination/tsconfig.json | 3 +- packages/turf-difference/tsconfig.json | 3 +- packages/turf-directional-mean/tsconfig.json | 3 +- packages/turf-dissolve/tsconfig.json | 3 +- packages/turf-distance-weight/tsconfig.json | 3 +- packages/turf-distance/tsconfig.json | 3 +- packages/turf-ellipse/tsconfig.json | 3 +- packages/turf-envelope/tsconfig.json | 3 +- packages/turf-explode/tsconfig.json | 3 +- packages/turf-flatten/tsconfig.json | 3 +- packages/turf-flip/tsconfig.json | 3 +- packages/turf-geojson-rbush/package.json | 7 +- .../tsconfig.testTypes.json | 7 - packages/turf-geojson-rbush/types.ts | 45 --- packages/turf-great-circle/package.json | 6 +- .../turf-great-circle/tsconfig.testTypes.json | 7 - packages/turf-great-circle/types.ts | 11 - packages/turf-helpers/tsconfig.json | 3 +- packages/turf-hex-grid/tsconfig.json | 3 +- packages/turf-interpolate/package.json | 6 +- .../turf-interpolate/tsconfig.testTypes.json | 7 - packages/turf-interpolate/types.ts | 27 -- packages/turf-intersect/tsconfig.json | 3 +- packages/turf-invariant/tsconfig.json | 3 +- packages/turf-kinks/tsconfig.json | 3 +- packages/turf-length/tsconfig.json | 3 +- packages/turf-line-arc/tsconfig.json | 3 +- packages/turf-line-chunk/package.json | 6 +- packages/turf-line-chunk/tsconfig.json | 3 +- .../turf-line-chunk/tsconfig.testTypes.json | 7 - packages/turf-line-chunk/types.ts | 20 -- packages/turf-line-intersect/tsconfig.json | 3 +- packages/turf-line-offset/package.json | 6 +- .../turf-line-offset/tsconfig.testTypes.json | 7 - packages/turf-line-offset/types.ts | 23 -- packages/turf-line-overlap/tsconfig.json | 3 +- packages/turf-line-segment/tsconfig.json | 3 +- packages/turf-line-slice-along/package.json | 8 +- .../tsconfig.testTypes.json | 7 - packages/turf-line-slice-along/types.ts | 1 - packages/turf-line-slice/package.json | 6 +- .../turf-line-slice/tsconfig.testTypes.json | 7 - packages/turf-line-slice/types.ts | 1 - packages/turf-line-split/package.json | 6 +- .../turf-line-split/tsconfig.testTypes.json | 7 - packages/turf-line-split/types.ts | 1 - packages/turf-line-to-polygon/tsconfig.json | 3 +- packages/turf-mask/tsconfig.json | 3 +- packages/turf-meta/package.json | 9 +- packages/turf-meta/tsconfig.testTypes.json | 7 - packages/turf-meta/types.ts | 340 ------------------ packages/turf-midpoint/tsconfig.json | 3 +- packages/turf-moran-index/tsconfig.json | 3 +- .../tsconfig.json | 3 +- .../turf-nearest-point-on-line/tsconfig.json | 3 +- .../turf-nearest-point-to-line/tsconfig.json | 3 +- packages/turf-nearest-point/tsconfig.json | 3 +- packages/turf-planepoint/tsconfig.json | 3 +- packages/turf-point-grid/tsconfig.json | 3 +- packages/turf-point-on-feature/tsconfig.json | 3 +- .../turf-point-to-line-distance/tsconfig.json | 3 +- .../turf-points-within-polygon/tsconfig.json | 3 +- packages/turf-polygon-smooth/tsconfig.json | 3 +- packages/turf-polygon-tangents/tsconfig.json | 3 +- packages/turf-polygon-to-line/tsconfig.json | 3 +- packages/turf-polygonize/tsconfig.json | 3 +- packages/turf-projection/tsconfig.json | 3 +- packages/turf-quadrat-analysis/tsconfig.json | 3 +- packages/turf-random/tsconfig.json | 3 +- packages/turf-rectangle-grid/tsconfig.json | 3 +- packages/turf-rewind/tsconfig.json | 3 +- packages/turf-rhumb-bearing/tsconfig.json | 3 +- packages/turf-rhumb-destination/tsconfig.json | 3 +- packages/turf-rhumb-distance/tsconfig.json | 3 +- packages/turf-sample/tsconfig.json | 3 +- packages/turf-sector/tsconfig.json | 3 +- packages/turf-shortest-path/tsconfig.json | 3 +- packages/turf-simplify/tsconfig.json | 3 +- packages/turf-square-grid/tsconfig.json | 3 +- packages/turf-square/tsconfig.json | 3 +- .../tsconfig.json | 3 +- packages/turf-tag/tsconfig.json | 3 +- packages/turf-tin/tsconfig.json | 3 +- packages/turf-transform-rotate/tsconfig.json | 3 +- packages/turf-transform-scale/tsconfig.json | 3 +- .../turf-transform-translate/tsconfig.json | 3 +- packages/turf-triangle-grid/tsconfig.json | 3 +- packages/turf-truncate/tsconfig.json | 3 +- packages/turf-union/tsconfig.json | 3 +- packages/turf-unkink-polygon/tsconfig.json | 3 +- packages/turf-voronoi/tsconfig.json | 3 +- packages/turf/package.json | 5 +- pnpm-lock.yaml | 121 ++++--- templates/tsconfig.testTypes.json | 7 - tsconfig.shared.json | 3 + 136 files changed, 244 insertions(+), 1049 deletions(-) delete mode 100644 packages/turf-buffer/tsconfig.testTypes.json delete mode 100644 packages/turf-buffer/types.ts delete mode 100644 packages/turf-geojson-rbush/tsconfig.testTypes.json delete mode 100644 packages/turf-geojson-rbush/types.ts delete mode 100644 packages/turf-great-circle/tsconfig.testTypes.json delete mode 100644 packages/turf-great-circle/types.ts delete mode 100644 packages/turf-interpolate/tsconfig.testTypes.json delete mode 100644 packages/turf-interpolate/types.ts delete mode 100644 packages/turf-line-chunk/tsconfig.testTypes.json delete mode 100644 packages/turf-line-chunk/types.ts delete mode 100644 packages/turf-line-offset/tsconfig.testTypes.json delete mode 100644 packages/turf-line-offset/types.ts delete mode 100644 packages/turf-line-slice-along/tsconfig.testTypes.json delete mode 100644 packages/turf-line-slice-along/types.ts delete mode 100644 packages/turf-line-slice/tsconfig.testTypes.json delete mode 100644 packages/turf-line-slice/types.ts delete mode 100644 packages/turf-line-split/tsconfig.testTypes.json delete mode 100644 packages/turf-line-split/types.ts delete mode 100644 packages/turf-meta/tsconfig.testTypes.json delete mode 100644 packages/turf-meta/types.ts delete mode 100644 templates/tsconfig.testTypes.json diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index ebef97cb20..d7b8e13820 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -1,7 +1,4 @@ // @ts-check -import * as path from "node:path"; -import { glob } from "glob"; -import * as fs from "node:fs"; import { alphabeticalDependencies, alphabeticalScripts, @@ -12,62 +9,19 @@ import { requireDependency, } from "@monorepolint/rules"; -const TS_PACKAGES = []; // projects that use typescript to build -const JS_PACKAGES = []; // projects that use javascript/rollup to build const MAIN_PACKAGE = "@turf/turf"; -const TAPE_PACKAGES = []; // projects that have tape tests -const BENCH_PACKAGES = []; // projects that have benchmarks - -// iterate all the packages and figure out what buckets everything falls into -const __dirname = new URL(".", import.meta.url).pathname; -glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => { - const name = JSON.parse( - fs.readFileSync(path.join(pk, "package.json"), "utf8") - ).name; - - if (fs.existsSync(path.join(pk, "index.ts"))) { - TS_PACKAGES.push(name); - } else { - JS_PACKAGES.push(name); - } - - if (fs.existsSync(path.join(pk, "test.js"))) { - TAPE_PACKAGES.push(name); - } -}); - -const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter( - (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) -); -const JS_TAPE_PACKAGES = TAPE_PACKAGES.filter( - (pkg) => -1 !== JS_PACKAGES.indexOf(pkg) -); - export default { rules: [ - fileContents({ - options: { - file: "tsconfig.testTypes.json", - templateFile: "./templates/tsconfig.testTypes.json", - }, - includePackages: JS_PACKAGES, - }), fileContents({ options: { file: "tsconfig.json", template: `{ - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } `, }, - includePackages: TS_PACKAGES.filter( - (elem) => - !["@turf/isobands", "@turf/isolines", "@turf/tesselate"].includes( - elem - ) - ), + excludePackages: ["@turf/isobands", "@turf/isolines", "@turf/tesselate"], }), // Special treatment for three packages with locally defined .d.ts files for @@ -132,41 +86,8 @@ export default { }), alphabeticalDependencies({ includeWorkspaceRoot: true }), alphabeticalScripts({ includeWorkspaceRoot: true }), - packageEntry({ - options: { - entries: { - type: "module", - main: "dist/cjs/index.cjs", - module: "dist/esm/index.js", - types: "dist/esm/index.d.ts", - sideEffects: false, - publishConfig: { - access: "public", - }, - // @turf/turf is commonly consumed through CDNs, moving this output file is a breaking change for anyone - // who has a hardcoded reference to this specific file, instead of letting the CDN pick the path. - // Example of a URL that will break: https://unpkg.com/@turf/turf/dist/turf.min.js - // Example of a URL that will keep working: https://unpkg.com/@turf/turf - browser: "turf.min.js", - files: ["dist", "turf.min.js"], - exports: { - "./package.json": "./package.json", - ".": { - import: { - types: "./dist/esm/index.d.ts", - default: "./dist/esm/index.js", - }, - require: { - types: "./dist/cjs/index.d.cts", - default: "./dist/cjs/index.cjs", - }, - }, - }, - }, - }, - includePackages: [MAIN_PACKAGE], - }), + // All packages ... packageEntry({ options: { entries: { @@ -175,6 +96,7 @@ export default { module: "dist/esm/index.js", types: "dist/esm/index.d.ts", sideEffects: false, + funding: "https://opencollective.com/turf", publishConfig: { access: "public", }, @@ -193,24 +115,29 @@ export default { }, }, }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], }), - + // All except @turf/turf packageEntry({ options: { entries: { files: ["dist"], }, }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], + excludePackages: [MAIN_PACKAGE], }), - + // @turf/turf only packageEntry({ options: { entries: { - funding: "https://opencollective.com/turf", + // @turf/turf is commonly consumed through CDNs, moving this output file is a breaking change for anyone + // who has a hardcoded reference to this specific file, instead of letting the CDN pick the path. + // Example of a URL that will break: https://unpkg.com/@turf/turf/dist/turf.min.js + // Example of a URL that will keep working: https://unpkg.com/@turf/turf + browser: "turf.min.js", + files: ["dist", "turf.min.js"], }, }, + includePackages: [MAIN_PACKAGE], }), packageScript({ @@ -218,72 +145,37 @@ export default { scripts: { docs: "tsx ../../scripts/generate-readmes.ts", test: "npm-run-all --npm-path npm test:*", - }, - }, - excludePackages: [MAIN_PACKAGE], - }), - - packageScript({ - options: { - scripts: { - build: "tsup --config ../../tsup.config.ts", - }, - }, - includePackages: [MAIN_PACKAGE, ...TS_PACKAGES, ...JS_PACKAGES], - }), - - packageScript({ - options: { - scripts: { - bench: "tsx bench.ts", "test:tape": "tsx test.ts", - }, - }, - includePackages: [...TS_TAPE_PACKAGES, ...JS_TAPE_PACKAGES], - }), - - packageScript({ - options: { - scripts: { "test:types": "tsc --noEmit", }, }, - includePackages: TS_PACKAGES, + excludePackages: [MAIN_PACKAGE], }), packageScript({ options: { scripts: { - "test:types": "tsc -p ./tsconfig.testTypes.json", - }, - }, - includePackages: JS_PACKAGES, - }), - - requireDependency({ - options: { - devDependencies: { - benchmark: "^2.1.4", - "npm-run-all": "^4.1.5", - tape: "^5.7.2", - tsx: "^4.6.2", + build: "tsup --config ../../tsup.config.ts", }, }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], }), requireDependency({ options: { dependencies: { + "@types/geojson": "^7946.0.10", tslib: "^2.6.2", }, devDependencies: { "@types/benchmark": "^2.1.5", "@types/tape": "^4.2.32", + benchmark: "^2.1.4", + "npm-run-all": "^4.1.5", + tape: "^5.7.2", + tsx: "^4.6.2", typescript: "^5.5.4", }, }, - includePackages: TS_PACKAGES, }), requireDependency({ @@ -294,14 +186,5 @@ export default { }, includePackages: [MAIN_PACKAGE], }), - - requireDependency({ - options: { - dependencies: { - "@types/geojson": "^7946.0.10", - }, - }, - includePackages: [MAIN_PACKAGE, ...TS_PACKAGES, ...JS_PACKAGES], - }), ], }; diff --git a/packages/turf-along/tsconfig.json b/packages/turf-along/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-along/tsconfig.json +++ b/packages/turf-along/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-angle/tsconfig.json b/packages/turf-angle/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-angle/tsconfig.json +++ b/packages/turf-angle/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-area/tsconfig.json b/packages/turf-area/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-area/tsconfig.json +++ b/packages/turf-area/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-bbox-clip/tsconfig.json b/packages/turf-bbox-clip/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-bbox-clip/tsconfig.json +++ b/packages/turf-bbox-clip/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-bbox-polygon/tsconfig.json b/packages/turf-bbox-polygon/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-bbox-polygon/tsconfig.json +++ b/packages/turf-bbox-polygon/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-bbox/tsconfig.json b/packages/turf-bbox/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-bbox/tsconfig.json +++ b/packages/turf-bbox/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-bearing/tsconfig.json b/packages/turf-bearing/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-bearing/tsconfig.json +++ b/packages/turf-bearing/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-bezier-spline/tsconfig.json b/packages/turf-bezier-spline/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-bezier-spline/tsconfig.json +++ b/packages/turf-bezier-spline/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-clockwise/tsconfig.json b/packages/turf-boolean-clockwise/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-clockwise/tsconfig.json +++ b/packages/turf-boolean-clockwise/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-concave/tsconfig.json b/packages/turf-boolean-concave/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-concave/tsconfig.json +++ b/packages/turf-boolean-concave/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-contains/tsconfig.json b/packages/turf-boolean-contains/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-contains/tsconfig.json +++ b/packages/turf-boolean-contains/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-crosses/tsconfig.json b/packages/turf-boolean-crosses/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-crosses/tsconfig.json +++ b/packages/turf-boolean-crosses/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-disjoint/tsconfig.json b/packages/turf-boolean-disjoint/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-disjoint/tsconfig.json +++ b/packages/turf-boolean-disjoint/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-equal/tsconfig.json b/packages/turf-boolean-equal/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-equal/tsconfig.json +++ b/packages/turf-boolean-equal/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-intersects/tsconfig.json b/packages/turf-boolean-intersects/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-intersects/tsconfig.json +++ b/packages/turf-boolean-intersects/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-overlap/tsconfig.json b/packages/turf-boolean-overlap/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-overlap/tsconfig.json +++ b/packages/turf-boolean-overlap/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-parallel/tsconfig.json b/packages/turf-boolean-parallel/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-parallel/tsconfig.json +++ b/packages/turf-boolean-parallel/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-point-in-polygon/tsconfig.json b/packages/turf-boolean-point-in-polygon/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-point-in-polygon/tsconfig.json +++ b/packages/turf-boolean-point-in-polygon/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-point-on-line/tsconfig.json b/packages/turf-boolean-point-on-line/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-point-on-line/tsconfig.json +++ b/packages/turf-boolean-point-on-line/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-touches/tsconfig.json b/packages/turf-boolean-touches/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-touches/tsconfig.json +++ b/packages/turf-boolean-touches/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-valid/tsconfig.json b/packages/turf-boolean-valid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-valid/tsconfig.json +++ b/packages/turf-boolean-valid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-boolean-within/tsconfig.json b/packages/turf-boolean-within/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-boolean-within/tsconfig.json +++ b/packages/turf-boolean-within/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-buffer/package.json b/packages/turf-buffer/package.json index 5b24d14ccc..fc8ac30048 100644 --- a/packages/turf-buffer/package.json +++ b/packages/turf-buffer/package.json @@ -57,7 +57,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", @@ -69,6 +69,7 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { @@ -79,6 +80,7 @@ "@turf/meta": "workspace:^", "@turf/projection": "workspace:^", "@types/geojson": "^7946.0.10", - "d3-geo": "1.7.1" + "d3-geo": "1.7.1", + "tslib": "^2.6.2" } } diff --git a/packages/turf-buffer/tsconfig.testTypes.json b/packages/turf-buffer/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-buffer/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-buffer/types.ts b/packages/turf-buffer/types.ts deleted file mode 100644 index 8a6ff304a0..0000000000 --- a/packages/turf-buffer/types.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { - point, - lineString, - polygon, - multiPoint, - multiLineString, - multiPolygon, - featureCollection, - geometryCollection, -} from "@turf/helpers"; -import { Point, LineString } from "geojson"; -import { buffer } from "./index.js"; - -// Standard Geometry -const pt = point([100, 0]); -const line = lineString([ - [100, 0], - [50, 0], -]); -const poly = polygon([ - [ - [100, 0], - [50, 0], - [0, 50], - [100, 0], - ], -]); - -buffer(pt, 5); -buffer(line, 5); -buffer(poly, 5); -buffer(pt, 5, { units: "miles" }); -buffer(pt, 10, { units: "meters", steps: 64 }); - -// Multi Geometry -const multiPt = multiPoint([ - [100, 0], - [0, 100], -]); -const multiLine = multiLineString([ - [ - [100, 0], - [50, 0], - ], - [ - [100, 0], - [50, 0], - ], -]); -const multiPoly = multiPolygon([ - [ - [ - [100, 0], - [50, 0], - [0, 50], - [100, 0], - ], - ], - [ - [ - [100, 0], - [50, 0], - [0, 50], - [100, 0], - ], - ], -]); - -buffer(multiPt, 5); -buffer(multiLine, 5); -buffer(multiPoly, 5); - -// Collections -const fc = featureCollection([pt, line]); -const gc = geometryCollection([pt.geometry, line.geometry]); - -buffer(fc, 5); -buffer(gc, 5); - -// Mixed Collections -const fcMixed = featureCollection([pt, line, multiPt, multiLine]); -const gcMixed = geometryCollection([ - pt.geometry, - line.geometry, - multiPt.geometry, - multiLine.geometry, -]); - -buffer(fcMixed, 5); -buffer(gcMixed, 5); diff --git a/packages/turf-center-mean/tsconfig.json b/packages/turf-center-mean/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-center-mean/tsconfig.json +++ b/packages/turf-center-mean/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-center-median/tsconfig.json b/packages/turf-center-median/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-center-median/tsconfig.json +++ b/packages/turf-center-median/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-center-of-mass/tsconfig.json b/packages/turf-center-of-mass/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-center-of-mass/tsconfig.json +++ b/packages/turf-center-of-mass/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-center/tsconfig.json b/packages/turf-center/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-center/tsconfig.json +++ b/packages/turf-center/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-centroid/tsconfig.json b/packages/turf-centroid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-centroid/tsconfig.json +++ b/packages/turf-centroid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-circle/tsconfig.json b/packages/turf-circle/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-circle/tsconfig.json +++ b/packages/turf-circle/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-clean-coords/tsconfig.json b/packages/turf-clean-coords/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-clean-coords/tsconfig.json +++ b/packages/turf-clean-coords/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-clone/tsconfig.json b/packages/turf-clone/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-clone/tsconfig.json +++ b/packages/turf-clone/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-clusters-dbscan/tsconfig.json b/packages/turf-clusters-dbscan/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-clusters-dbscan/tsconfig.json +++ b/packages/turf-clusters-dbscan/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-clusters-kmeans/tsconfig.json b/packages/turf-clusters-kmeans/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-clusters-kmeans/tsconfig.json +++ b/packages/turf-clusters-kmeans/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-clusters/tsconfig.json b/packages/turf-clusters/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-clusters/tsconfig.json +++ b/packages/turf-clusters/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-collect/tsconfig.json b/packages/turf-collect/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-collect/tsconfig.json +++ b/packages/turf-collect/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-combine/tsconfig.json b/packages/turf-combine/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-combine/tsconfig.json +++ b/packages/turf-combine/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-concave/tsconfig.json b/packages/turf-concave/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-concave/tsconfig.json +++ b/packages/turf-concave/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-convex/tsconfig.json b/packages/turf-convex/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-convex/tsconfig.json +++ b/packages/turf-convex/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-destination/tsconfig.json b/packages/turf-destination/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-destination/tsconfig.json +++ b/packages/turf-destination/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-difference/tsconfig.json b/packages/turf-difference/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-difference/tsconfig.json +++ b/packages/turf-difference/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-directional-mean/tsconfig.json b/packages/turf-directional-mean/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-directional-mean/tsconfig.json +++ b/packages/turf-directional-mean/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-dissolve/tsconfig.json b/packages/turf-dissolve/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-dissolve/tsconfig.json +++ b/packages/turf-dissolve/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-distance-weight/tsconfig.json b/packages/turf-distance-weight/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-distance-weight/tsconfig.json +++ b/packages/turf-distance-weight/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-distance/tsconfig.json b/packages/turf-distance/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-distance/tsconfig.json +++ b/packages/turf-distance/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-ellipse/tsconfig.json b/packages/turf-ellipse/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-ellipse/tsconfig.json +++ b/packages/turf-ellipse/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-envelope/tsconfig.json b/packages/turf-envelope/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-envelope/tsconfig.json +++ b/packages/turf-envelope/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-explode/tsconfig.json b/packages/turf-explode/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-explode/tsconfig.json +++ b/packages/turf-explode/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-flatten/tsconfig.json b/packages/turf-flatten/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-flatten/tsconfig.json +++ b/packages/turf-flatten/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-flip/tsconfig.json b/packages/turf-flip/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-flip/tsconfig.json +++ b/packages/turf-flip/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-geojson-rbush/package.json b/packages/turf-geojson-rbush/package.json index d66d7a7796..30585d17d6 100644 --- a/packages/turf-geojson-rbush/package.json +++ b/packages/turf-geojson-rbush/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/bbox-polygon": "workspace:^", @@ -68,7 +68,7 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", - "typescript": "^5.2.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { @@ -76,6 +76,7 @@ "@turf/helpers": "workspace:^", "@turf/meta": "workspace:^", "@types/geojson": "^7946.0.10", - "rbush": "^3.0.1" + "rbush": "^3.0.1", + "tslib": "^2.6.2" } } diff --git a/packages/turf-geojson-rbush/tsconfig.testTypes.json b/packages/turf-geojson-rbush/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-geojson-rbush/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-geojson-rbush/types.ts b/packages/turf-geojson-rbush/types.ts deleted file mode 100644 index e094f03eed..0000000000 --- a/packages/turf-geojson-rbush/types.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { point, polygon, featureCollection } from "@turf/helpers"; -import { BBox, Point, Polygon } from "geojson"; -import { geojsonRbush as rbush } from "./index.js"; - -// Fixtures -const bbox: BBox = [-180, -90, 180, 90]; -const pt = point([0, 0]); -const points = featureCollection([pt, pt]); -const poly = polygon([ - [ - [0, 0], - [1, 1], - [1, 1], - [0, 0], - ], -]); -const polygons = featureCollection([poly, poly]); - -// Initialize GeoJSON RBush Tree -const tree = rbush(); - -// Load Tree with a FeatureCollection -tree.load(points); -tree.load(polygons); - -// Insert by Feature -tree.insert(pt); -tree.insert(poly); - -// Find All (returns FeatureCollection) -const all = tree.all(); - -// Search by Feature (returns FeatureCollection) -const search = tree.search(poly); - -// Collides by Feature (returns FeatureCollection) -const collides = tree.collides(poly); - -// Remove by Feature -tree.remove(pt); -tree.remove(poly); - -// BBox support -tree.search(bbox); -tree.collides(bbox); diff --git a/packages/turf-great-circle/package.json b/packages/turf-great-circle/package.json index 7fa6208756..ff678534e1 100644 --- a/packages/turf-great-circle/package.json +++ b/packages/turf-great-circle/package.json @@ -55,7 +55,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", @@ -67,11 +67,13 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { "@turf/helpers": "workspace:^", "@turf/invariant": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-great-circle/tsconfig.testTypes.json b/packages/turf-great-circle/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-great-circle/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-great-circle/types.ts b/packages/turf-great-circle/types.ts deleted file mode 100644 index c12a7901c8..0000000000 --- a/packages/turf-great-circle/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { point } from "@turf/helpers"; -import { greatCircle } from "./index.js"; - -const pt1 = point([0, 0]); -const pt2 = point([60, 0]); -greatCircle(pt1, pt2); -greatCircle(pt1.geometry, pt2.geometry); -greatCircle(pt1.geometry.coordinates, pt2.geometry.coordinates); -greatCircle(pt1, pt2, { properties: { name: "Seattle to DC" } }); -greatCircle(pt1, pt2, { npoints: 10 }); -greatCircle(pt1, pt2, { offset: 100, npoints: 10 }); diff --git a/packages/turf-helpers/tsconfig.json b/packages/turf-helpers/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-helpers/tsconfig.json +++ b/packages/turf-helpers/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-hex-grid/tsconfig.json b/packages/turf-hex-grid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-hex-grid/tsconfig.json +++ b/packages/turf-hex-grid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-interpolate/package.json b/packages/turf-interpolate/package.json index ac00747383..faf952e990 100644 --- a/packages/turf-interpolate/package.json +++ b/packages/turf-interpolate/package.json @@ -51,7 +51,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", @@ -64,6 +64,7 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { @@ -78,6 +79,7 @@ "@turf/point-grid": "workspace:^", "@turf/square-grid": "workspace:^", "@turf/triangle-grid": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-interpolate/tsconfig.testTypes.json b/packages/turf-interpolate/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-interpolate/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-interpolate/types.ts b/packages/turf-interpolate/types.ts deleted file mode 100644 index 61281353d5..0000000000 --- a/packages/turf-interpolate/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { point, featureCollection } from "@turf/helpers"; -import { interpolate } from "./index.js"; - -const cellSize = 1; -const property = "pressure"; -const gridType = "square"; -const weight = 0.5; -const units = "miles"; -const points = featureCollection([ - point([1, 2]), - point([12, 13]), - point([23, 22]), -]); - -const grid = interpolate(points, cellSize, { - gridType, - property, - units, - weight, -}); -grid.features[0].properties?.pressure; - -// Optional properties -interpolate(points, cellSize, { gridType, property, units }); -interpolate(points, cellSize, { gridType, property }); -interpolate(points, cellSize, { gridType }); -interpolate(points, cellSize, { gridType: "point" }); diff --git a/packages/turf-intersect/tsconfig.json b/packages/turf-intersect/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-intersect/tsconfig.json +++ b/packages/turf-intersect/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-invariant/tsconfig.json b/packages/turf-invariant/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-invariant/tsconfig.json +++ b/packages/turf-invariant/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-kinks/tsconfig.json b/packages/turf-kinks/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-kinks/tsconfig.json +++ b/packages/turf-kinks/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-length/tsconfig.json b/packages/turf-length/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-length/tsconfig.json +++ b/packages/turf-length/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-line-arc/tsconfig.json b/packages/turf-line-arc/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-line-arc/tsconfig.json +++ b/packages/turf-line-arc/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-line-chunk/package.json b/packages/turf-line-chunk/package.json index bb4db39926..b6df22437e 100644 --- a/packages/turf-line-chunk/package.json +++ b/packages/turf-line-chunk/package.json @@ -56,7 +56,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", @@ -68,6 +68,7 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { @@ -75,6 +76,7 @@ "@turf/length": "workspace:^", "@turf/line-slice-along": "workspace:^", "@turf/meta": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-line-chunk/tsconfig.json b/packages/turf-line-chunk/tsconfig.json index 1a50e1399c..563bf86442 100644 --- a/packages/turf-line-chunk/tsconfig.json +++ b/packages/turf-line-chunk/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "include": ["index.d.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-line-chunk/tsconfig.testTypes.json b/packages/turf-line-chunk/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-line-chunk/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-line-chunk/types.ts b/packages/turf-line-chunk/types.ts deleted file mode 100644 index fbd45b54aa..0000000000 --- a/packages/turf-line-chunk/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { - lineString, - geometryCollection, - featureCollection, -} from "@turf/helpers"; -import { lineChunk } from "./index.js"; - -const line = lineString([ - [0, 0], - [1, 1], - [2, 2], -]); -const collection = featureCollection([line]); -const geomCollection = geometryCollection([line.geometry]); - -lineChunk(line, 2); -lineChunk(line, 2, { units: "kilometers" }); -lineChunk(line.geometry, 2); -lineChunk(collection, 2); -lineChunk(geomCollection, 2); diff --git a/packages/turf-line-intersect/tsconfig.json b/packages/turf-line-intersect/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-line-intersect/tsconfig.json +++ b/packages/turf-line-intersect/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-line-offset/package.json b/packages/turf-line-offset/package.json index d49f237b72..70a12820da 100644 --- a/packages/turf-line-offset/package.json +++ b/packages/turf-line-offset/package.json @@ -54,7 +54,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", @@ -66,12 +66,14 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { "@turf/helpers": "workspace:^", "@turf/invariant": "workspace:^", "@turf/meta": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-line-offset/tsconfig.testTypes.json b/packages/turf-line-offset/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-line-offset/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-line-offset/types.ts b/packages/turf-line-offset/types.ts deleted file mode 100644 index 43789bcaa3..0000000000 --- a/packages/turf-line-offset/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { lineOffset } from "./index.js"; -import { lineString, multiLineString } from "@turf/helpers"; - -const line = lineString([ - [0, 0], - [10, 10], -]); -const multiLine = multiLineString([ - [ - [0, 0], - [10, 10], - ], - [ - [5, 5], - [15, 15], - ], -]); - -lineOffset(line, 50); -lineOffset(line.geometry, 50); -lineOffset(multiLine, 50); -lineOffset(multiLine.geometry, 50); -lineOffset(line, 50, { units: "miles" }); diff --git a/packages/turf-line-overlap/tsconfig.json b/packages/turf-line-overlap/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-line-overlap/tsconfig.json +++ b/packages/turf-line-overlap/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-line-segment/tsconfig.json b/packages/turf-line-segment/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-line-segment/tsconfig.json +++ b/packages/turf-line-segment/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-line-slice-along/package.json b/packages/turf-line-slice-along/package.json index 226e417c82..07d2ba7fa0 100644 --- a/packages/turf-line-slice-along/package.json +++ b/packages/turf-line-slice-along/package.json @@ -48,7 +48,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/along": "workspace:^", @@ -60,13 +60,15 @@ "npm-run-all": "^4.1.5", "tape": "^5.7.2", "tsup": "^8.0.1", - "tsx": "^4.6.2" + "tsx": "^4.6.2", + "typescript": "^5.5.4" }, "dependencies": { "@turf/bearing": "workspace:^", "@turf/destination": "workspace:^", "@turf/distance": "workspace:^", "@turf/helpers": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-line-slice-along/tsconfig.testTypes.json b/packages/turf-line-slice-along/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-line-slice-along/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-line-slice-along/types.ts b/packages/turf-line-slice-along/types.ts deleted file mode 100644 index 51af5a26f3..0000000000 --- a/packages/turf-line-slice-along/types.ts +++ /dev/null @@ -1 +0,0 @@ -import { lineSliceAlong } from "./index"; diff --git a/packages/turf-line-slice/package.json b/packages/turf-line-slice/package.json index 99c2f94c7c..94c268cd7d 100644 --- a/packages/turf-line-slice/package.json +++ b/packages/turf-line-slice/package.json @@ -52,7 +52,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/truncate": "workspace:^", @@ -64,12 +64,14 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { "@turf/helpers": "workspace:^", "@turf/invariant": "workspace:^", "@turf/nearest-point-on-line": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-line-slice/tsconfig.testTypes.json b/packages/turf-line-slice/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-line-slice/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-line-slice/types.ts b/packages/turf-line-slice/types.ts deleted file mode 100644 index ec4bc9af66..0000000000 --- a/packages/turf-line-slice/types.ts +++ /dev/null @@ -1 +0,0 @@ -import { lineSlice } from "./index"; diff --git a/packages/turf-line-split/package.json b/packages/turf-line-split/package.json index 8d8117c3d6..517b55b9ed 100644 --- a/packages/turf-line-split/package.json +++ b/packages/turf-line-split/package.json @@ -53,7 +53,7 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@types/benchmark": "^2.1.5", @@ -64,6 +64,7 @@ "tape": "^5.7.2", "tsup": "^8.0.1", "tsx": "^4.6.2", + "typescript": "^5.5.4", "write-json-file": "^5.0.0" }, "dependencies": { @@ -77,6 +78,7 @@ "@turf/nearest-point-on-line": "workspace:^", "@turf/square": "workspace:^", "@turf/truncate": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-line-split/tsconfig.testTypes.json b/packages/turf-line-split/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-line-split/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-line-split/types.ts b/packages/turf-line-split/types.ts deleted file mode 100644 index a41b124edb..0000000000 --- a/packages/turf-line-split/types.ts +++ /dev/null @@ -1 +0,0 @@ -import { lineSplit } from "./index"; diff --git a/packages/turf-line-to-polygon/tsconfig.json b/packages/turf-line-to-polygon/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-line-to-polygon/tsconfig.json +++ b/packages/turf-line-to-polygon/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-mask/tsconfig.json b/packages/turf-mask/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-mask/tsconfig.json +++ b/packages/turf-mask/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-meta/package.json b/packages/turf-meta/package.json index efb512b446..ecc8475635 100644 --- a/packages/turf-meta/package.json +++ b/packages/turf-meta/package.json @@ -70,19 +70,22 @@ "docs": "tsx ../../scripts/generate-readmes.ts", "test": "npm-run-all --npm-path npm test:*", "test:tape": "tsx test.ts", - "test:types": "tsc -p ./tsconfig.testTypes.json" + "test:types": "tsc --noEmit" }, "devDependencies": { "@turf/random": "workspace:^", "@types/benchmark": "^2.1.5", + "@types/tape": "^4.2.32", "benchmark": "^2.1.4", "npm-run-all": "^4.1.5", "tape": "^5.7.2", "tsup": "^8.0.1", - "tsx": "^4.6.2" + "tsx": "^4.6.2", + "typescript": "^5.5.4" }, "dependencies": { "@turf/helpers": "workspace:^", - "@types/geojson": "^7946.0.10" + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" } } diff --git a/packages/turf-meta/tsconfig.testTypes.json b/packages/turf-meta/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/packages/turf-meta/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/packages/turf-meta/types.ts b/packages/turf-meta/types.ts deleted file mode 100644 index cd2e3a04ba..0000000000 --- a/packages/turf-meta/types.ts +++ /dev/null @@ -1,340 +0,0 @@ -import { Point, LineString } from "geojson"; -import * as helpers from "@turf/helpers"; -import { featureCollection, point, lineString } from "@turf/helpers"; -import * as meta from "./index.js"; -import { - coordReduce, - coordEach, - propEach, - propReduce, - featureReduce, - featureEach, - coordAll, - geomReduce, - geomEach, - flattenReduce, - flattenEach, - segmentReduce, - segmentEach, - lineReduce, - lineEach, -} from "./index.js"; - -// Fixtures -const pt = helpers.point([0, 0]); -const line = helpers.lineString([ - [0, 0], - [1, 1], -]); -const poly = helpers.polygon([ - [ - [0, 0], - [1, 1], - [0, 1], - [0, 0], - ], -]); -const multiPoly = helpers.multiPolygon([ - [ - [ - [0, 0], - [1, 1], - [0, 1], - [0, 0], - ], - ], -]); -const multiLine = helpers.multiLineString([ - [ - [0, 0], - [1, 1], - [0, 1], - [0, 0], - ], - [ - [2, 2], - [3, 3], - ], -]); -const geomCollection = helpers.geometryCollection([pt.geometry, line.geometry]); -const features = helpers.featureCollection([pt, line]); - -const customPoint = point([10, 20], { foo: "abc", bar: 123 }); -const customPoints = featureCollection([customPoint]); -const customLineString = lineString( - [ - [0, 0], - [10, 20], - ], - { foo: "abc", bar: 123 } -); -const customLineStrings = featureCollection([customLineString]); - -/** - * meta.coordEach - */ -const coordEachValue: void = meta.coordEach(pt, (coords) => coords); -coordEach(pt, (coords, index) => coords); -meta.coordEach(pt, (coords, index) => coords); -meta.coordEach(pt.geometry, (coords) => { - const equal: number[] = coords; -}); -meta.coordEach(line, (coords) => { - const equal: number[] = coords; -}); -meta.coordEach(poly, (coords) => { - const equal: number[] = coords; -}); -meta.coordEach(multiPoly, (coords) => { - const equal: number[] = coords; -}); -meta.coordEach(geomCollection, (coords) => coords); - -/** - * meta.coordReduce - */ -const coordReduceValue: number = meta.coordReduce( - pt, - (previous, coords) => 1 + 1 -); -coordReduce(pt, (previous, coords, index) => coords); -meta.coordReduce(pt, (previous, coords, index) => coords); -meta.coordReduce(pt, (previous, coords, index) => 1 + 1, 0); -meta.coordReduce(pt, (previous, coords) => coords); -meta.coordReduce(geomCollection, (previous, coords) => coords); - -/** - * meta.propReduce - */ -const propReduceValue: number = meta.propReduce( - poly, - (previous, prop) => 1 + 1 -); -propReduce(poly, (previous, prop) => 1 + 1, 0); -meta.propReduce(poly, (previous, prop) => 1 + 1, 0); -meta.propReduce(features, (previous, prop) => prop); -meta.propReduce(poly, (previous, prop, index) => prop); -meta.propReduce(poly, (previous, prop) => 1 + 1); -meta.propReduce(geomCollection, (previous, prop) => prop); - -/** - * meta.propEach - */ -const propEachValue: void = meta.propEach(poly, (prop) => prop); -propEach(features, (prop) => prop); -meta.propEach(features, (prop) => prop); -meta.propEach(poly, (prop, index) => prop); -meta.propEach<{ bar: string }>(poly, (prop) => prop.bar); -meta.propEach(geomCollection, (prop) => prop); - -/** - * meta.coordAll - */ -coordAll(poly); -const coords: Array> = meta.coordAll(poly); - -/** - * meta.featureReduce - */ -const featureReduceValue: number = meta.featureReduce( - poly, - (previous, feature) => 1 + 1 -); -featureReduce(poly, (previous, feature) => 1 + 1, 0); -meta.featureReduce(poly, (previous, feature) => 1 + 1, 0); -meta.featureReduce(features, (previous, feature) => feature); -meta.featureReduce(poly, (previous, feature, index) => feature); -meta.featureReduce(geomCollection, (previous, feature, index) => feature); - -/** - * meta.featureEach - */ -const featureEachValue: void = meta.featureEach(poly, (feature) => feature); -featureEach(features, (feature) => feature); -meta.featureEach(features, (feature) => feature); -meta.featureEach(poly, (feature, index) => feature); -meta.featureEach(geomCollection, (feature, index) => feature); - -// Access custom properties -featureEach(customPoints, (pt) => { - pt.properties.bar; - // pt.properties.hello // [ts] Property 'hello' does not exist on type '{ foo: string; bar: number; }'. -}); - -/** - * meta.geomReduce - */ -const geomReduceValue: number = meta.geomReduce( - poly, - (previous, geom) => 1 + 1 -); -geomReduce(poly, (previous, geom) => 1 + 1, 0); -meta.geomReduce(poly, (previous, geom) => 1 + 1, 0); -meta.geomReduce(features, (previous, geom) => geom); -meta.geomReduce(poly, (previous, geom, index, props) => geom); -meta.geomReduce(geomCollection, (previous, geom, index, props) => geom); - -/** - * meta.geomEach - */ -const geomEachValue: void = meta.geomEach(poly, (geom) => geom); -geomEach(features, (geom) => geom); -meta.geomEach(features, (geom) => geom); -meta.geomEach(poly, (geom, index, props) => geom); -meta.geomEach(geomCollection, (geom, index, props) => geom); - -/** - * meta.flattenReduce - */ -const flattenReduceValue: number = meta.flattenReduce( - poly, - (previous, feature) => 1 + 1 -); -flattenReduce(poly, (previous, feature) => 1 + 1, 0); -meta.flattenReduce(poly, (previous, feature) => 1 + 1, 0); -meta.flattenReduce(features, (previous, feature) => feature); -meta.flattenReduce(poly, (previous, feature, index, props) => feature); -meta.flattenReduce( - geomCollection, - (previous, feature, index, props) => feature -); - -/** - * meta.flattenEach - */ -const flattenEachValue: void = meta.flattenEach(poly, (feature) => feature); -flattenEach(features, (feature) => feature); -meta.flattenEach(features, (feature) => feature); -meta.flattenEach(poly.geometry, (feature, index, props) => feature); -meta.flattenEach(geomCollection, (feature, index, props) => feature); - -/** - * meta.segmentReduce - */ -const lines = helpers.featureCollection([line]); -const segmentReduceValue: number = meta.segmentReduce(poly, () => 1 + 1); -segmentReduce(poly, (previousValue) => previousValue); -meta.segmentReduce(poly, (previousValue) => previousValue); -meta.segmentReduce(poly, (previousValue, currentSegment) => currentSegment); -meta.segmentReduce(poly, (previousValue, currentSegment) => 1 + 1, 0); -meta.segmentReduce(lines, (previousValue, currentSegment) => currentSegment); -meta.segmentReduce( - poly, - (previousValue, currentSegment, currentIndex) => currentSegment -); -meta.segmentReduce( - geomCollection, - (previousValue, currentSegment, currentIndex) => currentSegment -); -meta.segmentReduce( - geomCollection, - (previousValue, currentSegment, currentIndex, currentSubIndex) => - currentSegment -); - -/** - * meta.segmentEach - */ -const segmentEachValue: void = meta.segmentEach(poly, () => { - /* no-op */ -}); -segmentEach(poly, (currentSegment) => currentSegment); -meta.segmentEach(poly, (currentSegment) => currentSegment); -meta.segmentEach(features, (currentSegment) => currentSegment); -meta.segmentEach( - poly.geometry, - (currentSegment, currentIndex) => currentSegment -); -meta.segmentEach( - geomCollection, - (currentSegment, currentIndex) => currentSegment -); -meta.segmentEach( - geomCollection, - (currentSegment, currentIndex, currentSubIndex) => currentSegment -); - -/** - * meta.lineEach - */ -// meta.lineEach(pt, () => {}) // Argument of type 'Feature' is not assignable to parameter of type 'LineString | Polygon | MultiPolygon | MultiLineString | Feature'. -const lineEachValue: void = meta.lineEach(line, () => { - /* no-op */ -}); -lineEach(line, (currentLine) => currentLine); -meta.lineEach(line, (currentLine) => currentLine); -meta.lineEach( - multiLine, - (currentLine, featureIndex, featureSubIndex) => currentLine -); -meta.lineEach(poly, (currentLine) => currentLine); -meta.lineEach( - poly, - (currentLine, featureIndex, featureSubIndex, lineIndex) => currentLine -); -meta.lineEach( - multiPoly, - (currentLine, featureIndex, featureSubIndex, lineIndex) => currentLine -); - -// Able to load custom LineStrings -lineEach(customLineString, (line) => { - /* no-op */ -}); -lineEach(customLineStrings, (line) => { - line.properties.bar; - // line.properties.hello // [ts] Property 'hello' does not exist on type '{ foo: string; bar: string; }'. -}); - -/** - * meta.lineReduce - */ -// meta.lineReduce(pt, () => {}) // Argument of type 'Feature' is not assignable to parameter of type 'LineString | Polygon | MultiPolygon | MultiLineString | Feature'. -const lineReduceValue: number = meta.lineReduce(line, () => 1 + 1); -lineReduce(line, (previousValue) => previousValue); -meta.lineReduce(line, (previousValue) => previousValue); -meta.lineReduce(line, (previousValue, currentLine) => currentLine); -meta.lineReduce(line, (previousValue, currentLine) => 1 + 1, 0); -meta.lineReduce(multiLine, (previousValue, currentLine) => currentLine); -meta.lineReduce( - multiLine, - (previousValue, currentLine, featureIndex, featureSubIndex) => currentLine -); -meta.lineReduce(poly, (previousValue, currentLine) => currentLine); -meta.lineReduce( - poly, - (previousValue, currentLine, featureIndex, featureSubIndex) => currentLine -); -meta.lineReduce( - poly, - (previousValue, currentLine, featureIndex, featureSubIndex) => 1 + 1, - 1 -); -meta.lineReduce( - multiPoly, - (previousValue, currentLine, featureIndex, featureSubIndex, lineIndex) => - currentLine -); -meta.lineReduce( - multiPoly, - (previousValue, currentLine, featureIndex, featureSubIndex, lineIndex) => - 1 + 1, - 1 -); - -/** - * findSegment - */ -meta.findSegment(line); -meta.findSegment(line.geometry); -meta.findSegment(line, { segmentIndex: -1 }); - -/** - * findPoint - */ -meta.findPoint(line); -meta.findPoint(line.geometry); -meta.findPoint(line, { coordIndex: -1 }); -meta.findPoint(customLineString).properties.foo; -meta.findPoint(customLineString).properties.bar; -// meta.findPoint(customLineString).properties.hello // [ts] Property 'hello' does not exist on type '{ foo: string; bar: number; }'. diff --git a/packages/turf-midpoint/tsconfig.json b/packages/turf-midpoint/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-midpoint/tsconfig.json +++ b/packages/turf-midpoint/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-moran-index/tsconfig.json b/packages/turf-moran-index/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-moran-index/tsconfig.json +++ b/packages/turf-moran-index/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-nearest-neighbor-analysis/tsconfig.json b/packages/turf-nearest-neighbor-analysis/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-nearest-neighbor-analysis/tsconfig.json +++ b/packages/turf-nearest-neighbor-analysis/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-nearest-point-on-line/tsconfig.json b/packages/turf-nearest-point-on-line/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-nearest-point-on-line/tsconfig.json +++ b/packages/turf-nearest-point-on-line/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-nearest-point-to-line/tsconfig.json b/packages/turf-nearest-point-to-line/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-nearest-point-to-line/tsconfig.json +++ b/packages/turf-nearest-point-to-line/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-nearest-point/tsconfig.json b/packages/turf-nearest-point/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-nearest-point/tsconfig.json +++ b/packages/turf-nearest-point/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-planepoint/tsconfig.json b/packages/turf-planepoint/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-planepoint/tsconfig.json +++ b/packages/turf-planepoint/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-point-grid/tsconfig.json b/packages/turf-point-grid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-point-grid/tsconfig.json +++ b/packages/turf-point-grid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-point-on-feature/tsconfig.json b/packages/turf-point-on-feature/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-point-on-feature/tsconfig.json +++ b/packages/turf-point-on-feature/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-point-to-line-distance/tsconfig.json b/packages/turf-point-to-line-distance/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-point-to-line-distance/tsconfig.json +++ b/packages/turf-point-to-line-distance/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-points-within-polygon/tsconfig.json b/packages/turf-points-within-polygon/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-points-within-polygon/tsconfig.json +++ b/packages/turf-points-within-polygon/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-polygon-smooth/tsconfig.json b/packages/turf-polygon-smooth/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-polygon-smooth/tsconfig.json +++ b/packages/turf-polygon-smooth/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-polygon-tangents/tsconfig.json b/packages/turf-polygon-tangents/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-polygon-tangents/tsconfig.json +++ b/packages/turf-polygon-tangents/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-polygon-to-line/tsconfig.json b/packages/turf-polygon-to-line/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-polygon-to-line/tsconfig.json +++ b/packages/turf-polygon-to-line/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-polygonize/tsconfig.json b/packages/turf-polygonize/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-polygonize/tsconfig.json +++ b/packages/turf-polygonize/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-projection/tsconfig.json b/packages/turf-projection/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-projection/tsconfig.json +++ b/packages/turf-projection/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-quadrat-analysis/tsconfig.json b/packages/turf-quadrat-analysis/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-quadrat-analysis/tsconfig.json +++ b/packages/turf-quadrat-analysis/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-random/tsconfig.json b/packages/turf-random/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-random/tsconfig.json +++ b/packages/turf-random/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-rectangle-grid/tsconfig.json b/packages/turf-rectangle-grid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-rectangle-grid/tsconfig.json +++ b/packages/turf-rectangle-grid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-rewind/tsconfig.json b/packages/turf-rewind/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-rewind/tsconfig.json +++ b/packages/turf-rewind/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-rhumb-bearing/tsconfig.json b/packages/turf-rhumb-bearing/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-rhumb-bearing/tsconfig.json +++ b/packages/turf-rhumb-bearing/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-rhumb-destination/tsconfig.json b/packages/turf-rhumb-destination/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-rhumb-destination/tsconfig.json +++ b/packages/turf-rhumb-destination/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-rhumb-distance/tsconfig.json b/packages/turf-rhumb-distance/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-rhumb-distance/tsconfig.json +++ b/packages/turf-rhumb-distance/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-sample/tsconfig.json b/packages/turf-sample/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-sample/tsconfig.json +++ b/packages/turf-sample/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-sector/tsconfig.json b/packages/turf-sector/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-sector/tsconfig.json +++ b/packages/turf-sector/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-shortest-path/tsconfig.json b/packages/turf-shortest-path/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-shortest-path/tsconfig.json +++ b/packages/turf-shortest-path/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-simplify/tsconfig.json b/packages/turf-simplify/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-simplify/tsconfig.json +++ b/packages/turf-simplify/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-square-grid/tsconfig.json b/packages/turf-square-grid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-square-grid/tsconfig.json +++ b/packages/turf-square-grid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-square/tsconfig.json b/packages/turf-square/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-square/tsconfig.json +++ b/packages/turf-square/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-standard-deviational-ellipse/tsconfig.json b/packages/turf-standard-deviational-ellipse/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-standard-deviational-ellipse/tsconfig.json +++ b/packages/turf-standard-deviational-ellipse/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-tag/tsconfig.json b/packages/turf-tag/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-tag/tsconfig.json +++ b/packages/turf-tag/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-tin/tsconfig.json b/packages/turf-tin/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-tin/tsconfig.json +++ b/packages/turf-tin/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-transform-rotate/tsconfig.json b/packages/turf-transform-rotate/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-transform-rotate/tsconfig.json +++ b/packages/turf-transform-rotate/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-transform-scale/tsconfig.json b/packages/turf-transform-scale/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-transform-scale/tsconfig.json +++ b/packages/turf-transform-scale/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-transform-translate/tsconfig.json b/packages/turf-transform-translate/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-transform-translate/tsconfig.json +++ b/packages/turf-transform-translate/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-triangle-grid/tsconfig.json b/packages/turf-triangle-grid/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-triangle-grid/tsconfig.json +++ b/packages/turf-triangle-grid/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-truncate/tsconfig.json b/packages/turf-truncate/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-truncate/tsconfig.json +++ b/packages/turf-truncate/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-union/tsconfig.json b/packages/turf-union/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-union/tsconfig.json +++ b/packages/turf-union/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-unkink-polygon/tsconfig.json b/packages/turf-unkink-polygon/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-unkink-polygon/tsconfig.json +++ b/packages/turf-unkink-polygon/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf-voronoi/tsconfig.json b/packages/turf-voronoi/tsconfig.json index 1ced55f826..563bf86442 100644 --- a/packages/turf-voronoi/tsconfig.json +++ b/packages/turf-voronoi/tsconfig.json @@ -1,4 +1,3 @@ { - "extends": "../../tsconfig.shared.json", - "files": ["index.ts"] + "extends": "../../tsconfig.shared.json" } diff --git a/packages/turf/package.json b/packages/turf/package.json index 96416796dd..3b0b3a2d9a 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -69,7 +69,7 @@ "scripts": { "build": "tsup --config ../../tsup.config.ts", "cdnBundle": "npm-run-all cdnBundle:minify cdnBundle:checks", - "cdnBundle:checks": "tsx test.ts && tsx test.example.js && tsx test.ts", + "cdnBundle:checks": "tsx test.ts && tsx test.example.js", "cdnBundle:minify": "rollup -c rollup.config.js", "test": "echo '@turf/turf tests run in the cdnBundle:checks step'" }, @@ -80,10 +80,13 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-terser": "^0.4.4", + "@types/benchmark": "^2.1.5", "@types/tape": "^4.2.32", + "benchmark": "^2.1.4", "camelcase": "^8.0.0", "documentation": "^14.0.3", "glob": "^10.3.10", + "npm-run-all": "^4.1.5", "rollup": "^2.79.1", "rollup-plugin-polyfill-node": "^0.13.0", "tape": "^5.7.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa4529be13..36eab4434f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -471,9 +471,15 @@ importers: '@rollup/plugin-terser': specifier: ^0.4.4 version: 0.4.4(rollup@2.79.1) + '@types/benchmark': + specifier: ^2.1.5 + version: 2.1.5 '@types/tape': specifier: ^4.2.32 version: 4.13.4 + benchmark: + specifier: ^2.1.4 + version: 2.1.4 camelcase: specifier: ^8.0.0 version: 8.0.0 @@ -483,6 +489,9 @@ importers: glob: specifier: ^10.3.10 version: 10.3.10 + npm-run-all: + specifier: ^4.1.5 + version: 4.1.5 rollup: specifier: ^2.79.1 version: 2.79.1 @@ -1678,6 +1687,9 @@ importers: d3-geo: specifier: 1.7.1 version: 1.7.1 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/truncate': specifier: workspace:^ @@ -1706,6 +1718,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -3127,6 +3142,9 @@ importers: rbush: specifier: ^3.0.1 version: 3.0.1 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/bbox-polygon': specifier: workspace:^ @@ -3154,13 +3172,13 @@ importers: version: 5.7.2 tsup: specifier: ^8.0.1 - version: 8.0.1(postcss@8.4.40)(ts-node@9.1.1)(typescript@5.3.3) + version: 8.0.1(postcss@8.4.40)(ts-node@9.1.1)(typescript@5.5.4) tsx: specifier: ^4.6.2 version: 4.6.2 typescript: - specifier: ^5.2.2 - version: 5.3.3 + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -3176,6 +3194,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/truncate': specifier: workspace:^ @@ -3204,6 +3225,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -3338,6 +3362,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/truncate': specifier: workspace:^ @@ -3369,6 +3396,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -3775,6 +3805,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/truncate': specifier: workspace:^ @@ -3803,6 +3836,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -3870,6 +3906,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/truncate': specifier: workspace:^ @@ -3898,6 +3937,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -4029,6 +4071,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/truncate': specifier: workspace:^ @@ -4057,6 +4102,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -4078,6 +4126,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/along': specifier: workspace:^ @@ -4109,6 +4160,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 packages/turf-line-split: dependencies: @@ -4145,6 +4199,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@types/benchmark': specifier: ^2.1.5 @@ -4170,6 +4227,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 write-json-file: specifier: ^5.0.0 version: 5.0.0 @@ -4286,6 +4346,9 @@ importers: '@types/geojson': specifier: ^7946.0.10 version: 7946.0.14 + tslib: + specifier: ^2.6.2 + version: 2.6.2 devDependencies: '@turf/random': specifier: workspace:^ @@ -4293,6 +4356,9 @@ importers: '@types/benchmark': specifier: ^2.1.5 version: 2.1.5 + '@types/tape': + specifier: ^4.2.32 + version: 4.13.4 benchmark: specifier: ^2.1.4 version: 2.1.4 @@ -4308,6 +4374,9 @@ importers: tsx: specifier: ^4.6.2 version: 4.6.2 + typescript: + specifier: ^5.5.4 + version: 5.5.4 packages/turf-midpoint: dependencies: @@ -16244,46 +16313,6 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsup@8.0.1(postcss@8.4.40)(ts-node@9.1.1)(typescript@5.3.3): - resolution: {integrity: sha512-hvW7gUSG96j53ZTSlT4j/KL0q1Q2l6TqGBFc6/mu/L46IoNWqLLUzLRLP1R8Q7xrJTmkDxxDoojV5uCVs1sVOg==} - engines: {node: '>=18'} - hasBin: true - peerDependencies: - '@microsoft/api-extractor': ^7.36.0 - '@swc/core': ^1 - postcss: ^8.4.12 - typescript: '>=4.5.0' - peerDependenciesMeta: - '@microsoft/api-extractor': - optional: true - '@swc/core': - optional: true - postcss: - optional: true - typescript: - optional: true - dependencies: - bundle-require: 4.0.2(esbuild@0.19.11) - cac: 6.7.14 - chokidar: 3.5.3 - debug: 4.3.4 - esbuild: 0.19.11 - execa: 5.1.1 - globby: 11.1.0 - joycon: 3.1.1 - postcss: 8.4.40 - postcss-load-config: 4.0.2(postcss@8.4.40)(ts-node@9.1.1) - resolve-from: 5.0.0 - rollup: 4.9.0 - source-map: 0.8.0-beta.0 - sucrase: 3.34.0 - tree-kill: 1.2.2 - typescript: 5.3.3 - transitivePeerDependencies: - - supports-color - - ts-node - dev: true - /tsup@8.0.1(postcss@8.4.40)(ts-node@9.1.1)(typescript@5.5.4): resolution: {integrity: sha512-hvW7gUSG96j53ZTSlT4j/KL0q1Q2l6TqGBFc6/mu/L46IoNWqLLUzLRLP1R8Q7xrJTmkDxxDoojV5uCVs1sVOg==} engines: {node: '>=18'} @@ -16436,12 +16465,6 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - /typescript@5.5.4: resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} diff --git a/templates/tsconfig.testTypes.json b/templates/tsconfig.testTypes.json deleted file mode 100644 index fd44a42945..0000000000 --- a/templates/tsconfig.testTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "noEmit": true - }, - "files": ["types.ts"] -} diff --git a/tsconfig.shared.json b/tsconfig.shared.json index 511ff491e6..e7a99c086a 100644 --- a/tsconfig.shared.json +++ b/tsconfig.shared.json @@ -1,5 +1,8 @@ { + "include": ["${configDir}/index.?s"], // While we have a mix of TS and JS packages "compilerOptions": { + "allowJs": true, // Required to run tsc in legacy JS projects + "outDir": "${configDir}/dist", // Required to run tsc in legacy JS projects "target": "es2017", "module": "esnext", "declaration": true, From 8a3974e40bba6bfa25a072acbb3b6791533de534 Mon Sep 17 00:00:00 2001 From: James Beard Date: Fri, 23 Aug 2024 21:36:28 +1000 Subject: [PATCH 10/10] Decoupled linting of hand written code (prettier, eslint, etc) from linting of generated code (escheck). We now run the former during top level test, and the latter only during pre-publish after we've run a top level build. Upgraded the eslint plugin to match new typescript version, fixed a couple of minor "new" lint errors. --- package.json | 17 +- packages/turf-polygon-tangents/test.ts | 2 +- packages/turf/rollup.config.js | 2 +- pnpm-lock.yaml | 286 ++++++++++++------------- 4 files changed, 152 insertions(+), 155 deletions(-) diff --git a/package.json b/package.json index 99029f2aa8..87c1039c19 100644 --- a/package.json +++ b/package.json @@ -3,18 +3,19 @@ "funding": "https://opencollective.com/turf", "scripts": { "docs": "tsx ./scripts/generate-readmes.ts", + "escheck": "npm-run-all escheck:*", + "escheck:cjs": "es-check es8 packages/*/dist/cjs/index.cjs packages/turf/turf.min.js", + "escheck:esm": "es-check --module es8 packages/*/dist/esm/index.js", + "escheck:web": "es-check es5 packages/turf/turf.min.js", "lint": "npm-run-all lint:*", "lint:docs": "documentation lint packages/turf-*/index.js", - "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.js", - "lint:escheck-web": "es-check es5 packages/turf/turf.min.js", "lint:eslint": "eslint packages", "lint:mrl": "mrl check", "lint:prettier": "prettier --check .", "postinstall": "husky install", "preinstall": "npx only-allow pnpm", - "prepublishOnly": "lerna run build && lerna run --scope @turf/turf cdnBundle", - "test": "lerna run test" + "prepublishOnly": "lerna run build && lerna run --scope @turf/turf cdnBundle && pnpm run escheck", + "test": "pnpm run lint && lerna run test" }, "lint-staged": { "package.json": [ @@ -35,8 +36,8 @@ "@monorepolint/core": "0.5.0-alpha.132", "@monorepolint/rules": "0.5.0-alpha.132", "@types/node": "18.11.9", - "@typescript-eslint/eslint-plugin": "^6.10.0", - "@typescript-eslint/parser": "^6.10.0", + "@typescript-eslint/eslint-plugin": "^8.2.0", + "@typescript-eslint/parser": "^8.2.0", "acorn": "^7.4.1", "camelcase": "^8.0.0", "d3-queue": "*", @@ -44,7 +45,7 @@ "dependency-tree": "^11.0.0", "documentation": "^14.0.3", "es-check": "^7.1.1", - "eslint": "^8.53.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", "esm": "^3.2.25", diff --git a/packages/turf-polygon-tangents/test.ts b/packages/turf-polygon-tangents/test.ts index cae2f35ab5..19b4f21e4d 100644 --- a/packages/turf-polygon-tangents/test.ts +++ b/packages/turf-polygon-tangents/test.ts @@ -105,7 +105,7 @@ test("turf-polygon-tangents - Issue #1050", (t) => { try { t.assert(polygonTangents(pt, poly)); } catch (e) { - t.skip("issue #1050 failed"); + t.skip("issue #1050 failed", e); } t.end(); }); diff --git a/packages/turf/rollup.config.js b/packages/turf/rollup.config.js index fc94e72a95..f7c14db656 100644 --- a/packages/turf/rollup.config.js +++ b/packages/turf/rollup.config.js @@ -4,7 +4,7 @@ import terser from "@rollup/plugin-terser"; import { babel } from "@rollup/plugin-babel"; import nodePolyfills from "rollup-plugin-polyfill-node"; -const pckg = require("./package.json"); +import pckg from "./package.json"; const input = "index.ts"; export default [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36eab4434f..c848e7636c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,11 +24,11 @@ importers: specifier: 18.11.9 version: 18.11.9 '@typescript-eslint/eslint-plugin': - specifier: ^6.10.0 - version: 6.13.2(@typescript-eslint/parser@6.13.2)(eslint@8.55.0)(typescript@5.5.4) + specifier: ^8.2.0 + version: 8.2.0(@typescript-eslint/parser@8.2.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': - specifier: ^6.10.0 - version: 6.13.2(eslint@8.55.0)(typescript@5.5.4) + specifier: ^8.2.0 + version: 8.2.0(eslint@8.57.0)(typescript@5.5.4) acorn: specifier: ^7.4.1 version: 7.4.1 @@ -51,14 +51,14 @@ importers: specifier: ^7.1.1 version: 7.1.1 eslint: - specifier: ^8.53.0 - version: 8.55.0 + specifier: ^8.57.0 + version: 8.57.0 eslint-config-prettier: specifier: ^9.0.0 - version: 9.1.0(eslint@8.55.0) + version: 9.1.0(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.0.1 - version: 5.0.1(eslint-config-prettier@9.1.0)(eslint@8.55.0)(prettier@3.3.3) + version: 5.0.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.3) esm: specifier: ^3.2.25 version: 3.2.25 @@ -6712,7 +6712,7 @@ packages: '@babel/core': 7.23.5 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4 + debug: 4.3.6 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -7773,7 +7773,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.5 '@babel/types': 7.23.5 - debug: 4.3.4 + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -8223,13 +8223,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.55.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.55.0 + eslint: 8.57.0 eslint-visitor-keys: 3.4.3 dev: true @@ -8238,15 +8238,20 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true + /@eslint-community/regexpp@4.11.0: + resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + /@eslint/eslintrc@2.1.4: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.6 espree: 9.6.1 - globals: 13.23.0 - ignore: 5.3.0 + globals: 13.24.0 + ignore: 5.3.2 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -8255,8 +8260,8 @@ packages: - supports-color dev: true - /@eslint/js@8.55.0: - resolution: {integrity: sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==} + /@eslint/js@8.57.0: + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -8265,12 +8270,13 @@ packages: engines: {node: '>=12.20'} dev: true - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead dependencies: - '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4 + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.3.6 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -8281,8 +8287,9 @@ packages: engines: {node: '>=12.22'} dev: true - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} + /@humanwhocodes/object-schema@2.0.3: + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead dev: true /@hutson/parse-repository-url@3.0.2: @@ -9386,10 +9393,6 @@ packages: '@types/unist': 2.0.10 dev: true - /@types/json-schema@7.0.15: - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - dev: true - /@types/mdast@3.0.15: resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} dependencies: @@ -9432,10 +9435,6 @@ packages: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: true - /@types/semver@7.5.6: - resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} - dev: true - /@types/skmeans@0.11.7: resolution: {integrity: sha512-3fT48uRSRppOdQIlNCQKNNJRVaqzxkdCSTZM+NeHNxEpw6JejLLH78OHP54BxUHYEsa7pVsGn6uON552jwv9ZQ==} dev: true @@ -9485,127 +9484,125 @@ packages: resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} dev: true - /@typescript-eslint/eslint-plugin@6.13.2(@typescript-eslint/parser@6.13.2)(eslint@8.55.0)(typescript@5.5.4): - resolution: {integrity: sha512-3+9OGAWHhk4O1LlcwLBONbdXsAhLjyCFogJY/cWy2lxdVJ2JrcTF2pTGMaLl2AE7U1l31n8Py4a8bx5DLf/0dQ==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0)(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.13.2(eslint@8.55.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 6.13.2 - '@typescript-eslint/type-utils': 6.13.2(eslint@8.55.0)(typescript@5.5.4) - '@typescript-eslint/utils': 6.13.2(eslint@8.55.0)(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 6.13.2 - debug: 4.3.4 - eslint: 8.55.0 + '@typescript-eslint/parser': 8.2.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.2.0 + '@typescript-eslint/type-utils': 8.2.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.2.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.2.0 + eslint: 8.57.0 graphemer: 1.4.0 - ignore: 5.3.0 + ignore: 5.3.2 natural-compare: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.5.4) + ts-api-utils: 1.3.0(typescript@5.5.4) typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.5.4): - resolution: {integrity: sha512-MUkcC+7Wt/QOGeVlM8aGGJZy1XV5YKjTpq9jK6r6/iLsGXhBVaGP5N0UYvFsu9BFlSpwY9kMretzdBH01rkRXg==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/parser@8.2.0(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.13.2 - '@typescript-eslint/types': 6.13.2 - '@typescript-eslint/typescript-estree': 6.13.2(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 6.13.2 - debug: 4.3.4 - eslint: 8.55.0 + '@typescript-eslint/scope-manager': 8.2.0 + '@typescript-eslint/types': 8.2.0 + '@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.2.0 + debug: 4.3.6 + eslint: 8.57.0 typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@6.13.2: - resolution: {integrity: sha512-CXQA0xo7z6x13FeDYCgBkjWzNqzBn8RXaE3QVQVIUm74fWJLkJkaHmHdKStrxQllGh6Q4eUGyNpMe0b1hMkXFA==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/scope-manager@8.2.0: + resolution: {integrity: sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: - '@typescript-eslint/types': 6.13.2 - '@typescript-eslint/visitor-keys': 6.13.2 + '@typescript-eslint/types': 8.2.0 + '@typescript-eslint/visitor-keys': 8.2.0 dev: true - /@typescript-eslint/type-utils@6.13.2(eslint@8.55.0)(typescript@5.5.4): - resolution: {integrity: sha512-Qr6ssS1GFongzH2qfnWKkAQmMUyZSyOr0W54nZNU1MDfo+U4Mv3XveeLZzadc/yq8iYhQZHYT+eoXJqnACM1tw==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/type-utils@8.2.0(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-g1CfXGFMQdT5S+0PSO0fvGXUaiSkl73U1n9LTK5aRAFnPlJ8dLKkXr4AaLFvPedW8lVDoMgLLE3JN98ZZfsj0w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.13.2(typescript@5.5.4) - '@typescript-eslint/utils': 6.13.2(eslint@8.55.0)(typescript@5.5.4) - debug: 4.3.4 - eslint: 8.55.0 - ts-api-utils: 1.0.3(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.2.0(eslint@8.57.0)(typescript@5.5.4) + debug: 4.3.6 + ts-api-utils: 1.3.0(typescript@5.5.4) typescript: 5.5.4 transitivePeerDependencies: + - eslint - supports-color dev: true - /@typescript-eslint/types@6.13.2: - resolution: {integrity: sha512-7sxbQ+EMRubQc3wTfTsycgYpSujyVbI1xw+3UMRUcrhSy+pN09y/lWzeKDbvhoqcRbHdc+APLs/PWYi/cisLPg==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: true - /@typescript-eslint/types@7.18.0: resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} dev: true - /@typescript-eslint/typescript-estree@6.13.2(typescript@5.5.4): - resolution: {integrity: sha512-SuD8YLQv6WHnOEtKv8D6HZUzOub855cfPnPMKvdM/Bh1plv1f7Q/0iFUDLKKlxHcEstQnaUU4QZskgQq74t+3w==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/types@8.2.0: + resolution: {integrity: sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4): + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} + engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.13.2 - '@typescript-eslint/visitor-keys': 6.13.2 - debug: 4.3.4 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.5.4) + minimatch: 9.0.4 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4): - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/typescript-estree@8.2.0(typescript@5.5.4): + resolution: {integrity: sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.4 + '@typescript-eslint/types': 8.2.0 + '@typescript-eslint/visitor-keys': 8.2.0 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -9616,33 +9613,22 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.13.2(eslint@8.55.0)(typescript@5.5.4): - resolution: {integrity: sha512-b9Ptq4eAZUym4idijCRzl61oPCwwREcfDI8xGk751Vhzig5fFZR9CyzDz4Sp/nxSLBYxUPyh4QdIDqWykFhNmQ==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/utils@8.2.0(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-O46eaYKDlV3TvAVDNcoDzd5N550ckSe8G4phko++OCSC1dYIb9LTc3HDGYdWqWIAT5qDUKphO6sd9RrpIJJPfg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.55.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.13.2 - '@typescript-eslint/types': 6.13.2 - '@typescript-eslint/typescript-estree': 6.13.2(typescript@5.5.4) - eslint: 8.55.0 - semver: 7.5.4 + eslint: ^8.57.0 || ^9.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@typescript-eslint/scope-manager': 8.2.0 + '@typescript-eslint/types': 8.2.0 + '@typescript-eslint/typescript-estree': 8.2.0(typescript@5.5.4) + eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@6.13.2: - resolution: {integrity: sha512-OGznFs0eAQXJsp+xSd6k/O1UbFi/K/L7WjqeRoFE7vadjAF9y0uppXhYNQNEqygjou782maGClOoZwPqF0Drlw==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.13.2 - eslint-visitor-keys: 3.4.3 - dev: true - /@typescript-eslint/visitor-keys@7.18.0: resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -9651,6 +9637,14 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@8.2.0: + resolution: {integrity: sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@typescript-eslint/types': 8.2.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true @@ -9733,12 +9727,12 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true - /acorn-jsx@5.3.2(acorn@8.11.2): + /acorn-jsx@5.3.2(acorn@8.12.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.11.2 + acorn: 8.12.1 dev: true /acorn@7.4.1: @@ -9753,6 +9747,12 @@ packages: hasBin: true dev: true + /acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} @@ -9767,7 +9767,7 @@ packages: resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} dependencies: - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -11316,16 +11316,16 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier@9.1.0(eslint@8.55.0): + /eslint-config-prettier@9.1.0(eslint@8.57.0): resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.55.0 + eslint: 8.57.0 dev: true - /eslint-plugin-prettier@5.0.1(eslint-config-prettier@9.1.0)(eslint@8.55.0)(prettier@3.3.3): + /eslint-plugin-prettier@5.0.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.3): resolution: {integrity: sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -11339,8 +11339,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.55.0 - eslint-config-prettier: 9.1.0(eslint@8.55.0) + eslint: 8.57.0 + eslint-config-prettier: 9.1.0(eslint@8.57.0) prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.8.6 @@ -11359,23 +11359,23 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.55.0: - resolution: {integrity: sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==} + /eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.55.0) - '@eslint-community/regexpp': 4.10.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/regexpp': 4.11.0 '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.55.0 - '@humanwhocodes/config-array': 0.11.13 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.6 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -11387,9 +11387,9 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.23.0 + globals: 13.24.0 graphemer: 1.4.0 - ignore: 5.3.0 + ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -11415,8 +11415,8 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) eslint-visitor-keys: 3.4.3 dev: true @@ -12020,8 +12020,8 @@ packages: engines: {node: '>=4'} dev: true - /globals@13.23.0: - resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -12277,7 +12277,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.1 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -12287,7 +12287,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.1 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -12345,6 +12345,11 @@ packages: engines: {node: '>= 4'} dev: true + /ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + dev: true + /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -13808,7 +13813,7 @@ packages: resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} dependencies: '@types/debug': 4.1.12 - debug: 4.3.4 + debug: 4.3.6 decode-named-character-reference: 1.0.2 micromark-core-commonmark: 1.1.0 micromark-factory-space: 1.1.0 @@ -15719,7 +15724,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.1 - debug: 4.3.4 + debug: 4.3.6 socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -16263,15 +16268,6 @@ packages: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} dev: true - /ts-api-utils@1.0.3(typescript@5.5.4): - resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} - engines: {node: '>=16.13.0'} - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.5.4 - dev: true - /ts-api-utils@1.3.0(typescript@5.5.4): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} @@ -16369,7 +16365,7 @@ packages: engines: {node: ^16.14.0 || >=18.0.0} dependencies: '@tufjs/models': 2.0.1 - debug: 4.3.4 + debug: 4.3.6 make-fetch-happen: 13.0.1 transitivePeerDependencies: - supports-color