Skip to content

Commit

Permalink
Replace ts-node with tsx in doc and test related build scripts (#2489)
Browse files Browse the repository at this point in the history
* MRL configuration changes to replace ts-node with tsx, a more robust TS runtime. Will run MRL --fix and commit per-package changes next.

* JS projects can also rely on tsx to run scripts that used to be run by node.

* Need to keep ts-node around (at the monorepo level at least) for monorepolint.

* Almost entirely MRL automatic fixes for tsx dev dependencies, bench, doc, and test:tape. Hand edited last-checks scripts in packages/turf/
  • Loading branch information
smallsaucepan authored Sep 11, 2023
1 parent 9129ff2 commit 4469661
Show file tree
Hide file tree
Showing 116 changed files with 670 additions and 439 deletions.
13 changes: 7 additions & 6 deletions .monorepolint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ module.exports = {
{
options: {
scripts: {
docs: "node ../../scripts/generate-readmes",
docs: "tsx ../../scripts/generate-readmes",
test: "npm-run-all test:*",
},
},
Expand Down Expand Up @@ -202,31 +202,31 @@ module.exports = {
{
options: {
scripts: {
"test:tape": "node -r esm test.js",
"test:tape": "tsx test.js",
},
},
includePackages: JS_TAPE_PACKAGES,
},
{
options: {
scripts: {
"test:tape": "ts-node -r esm test.js",
"test:tape": "tsx test.js",
},
},
includePackages: TS_TAPE_PACKAGES,
},
{
options: {
scripts: {
bench: "node -r esm bench.js",
bench: "tsx bench.js",
},
},
includePackages: JS_TAPE_PACKAGES,
},
{
options: {
scripts: {
bench: "ts-node bench.js",
bench: "tsx bench.js",
},
},
includePackages: TS_TAPE_PACKAGES,
Expand Down Expand Up @@ -260,7 +260,7 @@ module.exports = {
tslib: "^2.3.0",
},
devDependencies: {
"ts-node": "*",
tsx: "*",
typescript: "*",
},
},
Expand All @@ -270,6 +270,7 @@ module.exports = {
options: {
devDependencies: {
rollup: "*",
tsx: "*",
},
},
includePackages: JS_PACKAGES,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"rollup": "^2.34.2",
"tape": "*",
"ts-node": "^9.0.0",
"tsx": "^3.12.8",
"typescript": "^3.8.3",
"yamljs": "*"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-along/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-angle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@turf/distance": "^7.0.0-alpha.0",
Expand All @@ -57,8 +57,8 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-bbox-clip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@turf/bbox": "^7.0.0-alpha.0",
Expand All @@ -59,8 +59,8 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-bbox-polygon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-bbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-bearing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@turf/destination": "^7.0.0-alpha.0",
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-bezier-spline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*",
"write-json-file": "*"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-boolean-clockwise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -58,8 +58,8 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-boolean-concave/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -57,8 +57,8 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-boolean-contains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -59,8 +59,8 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/turf-boolean-crosses/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -58,8 +58,8 @@
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"tsx": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 4469661

Please sign in to comment.