Skip to content

Commit

Permalink
Upgrade lerna, et al to address security vulnerabilities, modernise b…
Browse files Browse the repository at this point in the history
…uild environment (#2507)

* Upgrading to newest @types/node for the typescript version we currently use (3.8.3). https://www.npmjs.com/package/@types/node?activeTab=versions

* Big update to lerna to address security vulnerabilities. bootstrap command no longer required. Seems to build and test ok. May need some tweaking. Will add build caching at a later date.

* Updating documentation (the NPM library) to address security vulnerabilities. Had to wrap body of script so as be async, though otherwise unchanged.

* Updating es-check to address security vulnerabilities.

* Updating tape library to address security vulnerabilities.

* Add lerna caching (via nx). Simplistic setup so will need some tweaking. Remove redundant packages setting from lerna.json (will default to packages setting in package.json instead). Have to add --npm-path to all npm-run-all calls so that lerna doesn't accidentally end up being used as the npm binary. mysticatea/npm-run-all#218 and lerna/lerna#1842 have more details.

* Missed a couple of carats in package.json dependency specs.

* Also need to commit a new yarn.lock file to reflect version spec changes in previous commit.

---------

Co-authored-by: mfedderly <[email protected]>
  • Loading branch information
smallsaucepan and mfedderly authored Oct 6, 2023
1 parent 7c62021 commit f6e64ff
Show file tree
Hide file tree
Showing 118 changed files with 4,548 additions and 2,284 deletions.
4 changes: 2 additions & 2 deletions .monorepolint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ module.exports = {
options: {
scripts: {
docs: "tsx ../../scripts/generate-readmes",
test: "npm-run-all test:*",
test: "npm-run-all --npm-path npm test:*",
},
},
excludePackages: [MAIN_PACKAGE],
},
{
options: {
scripts: {
build: "npm-run-all build:*",
build: "npm-run-all --npm-path npm build:*",
"build:js": "tsc",
"build:es":
'tsc --outDir dist/es --module esnext --declaration false && echo \'{"type":"module"}\' > dist/es/package.json',
Expand Down
13 changes: 3 additions & 10 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{
"packages": [
"packages/*"
],
"npmClient": "yarn",
"version": "7.0.0-alpha.2",
"command": {
"bootstrap": {
"useWorkspaces": true,
"ignoreScripts": true
},
"publish": {
"registry": "https://registry.npmjs.org"
}
},
"npmClient": "yarn",
"version": "7.0.0-alpha.2"
}
}
52 changes: 52 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"build:es",
"build:js",
"test",
"test:tape",
"test:types",
"last-checks",
"last-checks:example",
"last-checks:testjs"
]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"]
},
"build:es": {
"dependsOn": ["^build:es"],
"outputs": ["{projectRoot}/dist"]
},
"build:js": {
"dependsOn": ["^build:js"],
"outputs": ["{projectRoot}/dist"]
},
"test": {
"dependsOn": ["^test"]
},
"test:tape": {
"dependsOn": ["^test:tape"]
},
"test:types": {
"dependsOn": ["^test:types"]
},
"last-checks": {
"dependsOn": ["^last-checks"]
},
"last-checks:example": {
"dependsOn": ["^last-checks:example"]
},
"last-checks:testjs": {
"dependsOn": ["^last-checks:testjs"]
}
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint:escheck-esm": "es-check --module es8 packages/*/dist/es/index.js",
"lint:escheck-es5": "es-check es5 packages/turf/turf.min.js",
"postlint": "documentation lint packages/turf-*/index.js",
"prepare": "lerna bootstrap && lerna run build && node ./scripts/add-import-extensions.js",
"prepare": "lerna run build && node ./scripts/add-import-extensions.js",
"pretest": "npm run lint",
"test": "lerna run test",
"posttest": "lerna run --scope @turf/turf last-checks",
Expand All @@ -39,22 +39,22 @@
},
"devDependencies": {
"@types/geojson": "7946.0.8",
"@types/node": "^17.0.2",
"@types/node": "^17.0.21",
"@typescript-eslint/eslint-plugin": "^4.8.0",
"@typescript-eslint/parser": "^4.8.0",
"acorn": "^7.4.1",
"camelcase": "*",
"d3-queue": "*",
"decamelize": "*",
"dependency-tree": "^8.1.2",
"documentation": "^13.2.5",
"es-check": "^5.1.4",
"documentation": "^14.0.2",
"es-check": "^7.1.1",
"eslint": "~7.13.0",
"eslint-config-prettier": "^6.15.0",
"esm": "^3.2.25",
"fs-extra": "*",
"husky": "^4.2.3",
"lerna": "^4.0.0",
"lerna": "^7.3.0",
"lint-staged": "^10.0.8",
"load-json-file": "*",
"meow": "*",
Expand All @@ -63,7 +63,7 @@
"prettier": "^2.1.2",
"progress": "*",
"rollup": "^2.34.2",
"tape": "*",
"tape": "^5.7.0",
"ts-node": "^9.0.0",
"tsx": "^3.12.8",
"typescript": "^3.8.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-along/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-angle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-bbox-clip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-bbox-polygon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-bbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-bearing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-bezier-spline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-clockwise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-concave/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-contains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-crosses/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-disjoint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-equal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-intersects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-overlap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-parallel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-boolean-point-in-polygon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
],
"scripts": {
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build": "npm-run-all --npm-path npm build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "tsx ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test": "npm-run-all --npm-path npm test:*",
"test:tape": "tsx test.js"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit f6e64ff

Please sign in to comment.