diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index 63dbad501b..33e84ab110 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: [ @@ -209,8 +217,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 885f4db306..ffc0160034 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-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/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-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-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-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 631db8e22b..f3e9fcc827 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 253427d44a..d7fa8a13bf 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/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-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-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; 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 431dcab0de..c41daa63e6 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 f921c11a91..0790372547 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 d86e15c167..0ea7df2229 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": { "@types/benchmark": "^2.1.5", 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 2c072bb5d4..88037b119a 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 e917fb179b..436274d9a5 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 2133675063..8096ed3d0d 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 f58bdce0df..d11ece528d 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 6c365891ae..ef4162402b 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"] +} 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-*"] + } } } diff --git a/tsup.config.ts b/tsup.config.ts index 283f087732..4ade659d29 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",