From 068f5f2b8d577dc78ebd05fa8ce30500c5c3eeb4 Mon Sep 17 00:00:00 2001 From: Benjamin Lupton Date: Sat, 28 Oct 2023 12:27:13 +0800 Subject: [PATCH] v1.80.0 - intelligent shrinking and expanding of node versions --- HISTORY.md | 23 + package-lock.json | 1110 ++++--------------------------------------- package.json | 24 +- source/base.js | 1 - source/ci.js | 67 ++- source/data.js | 12 +- source/package.js | 5 - source/questions.js | 164 +++++-- source/runtime.js | 15 +- source/versions.js | 146 ++++-- 10 files changed, 414 insertions(+), 1153 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 8c6632b..a3191ee 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,28 @@ # History +## v1.80.0 2023 November 2 + +- Improved core: + - No longer uses `node-fetch`, instead uses the Node.js fetch builtin +- Improved questions: + - New `maintainedNodeVersions`, `expandNodeVersions`, `shrinkNodeVersions` questions + - These replace the oldschool `lts` question, that was removed ages ago. + - TypeScript no longer has targets it doesn't support + - Ensure that `nodeVersionsSupported` and `nodeVersionsTested` are constrained to their minimum and maximum + - Corrected the description of `nodeVersionsTested` as it is not (by default) an automated property +- Improved CI: + - Don't test Node.js versions before 16 on GitHub Actions, as they will be ignored as [they are no longer supported on GitHub Actions](https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/) + - Verify the Node.js and NPM versions on GitHub Actions + - Update the versions of the GitHub Actions + - Resolved `make-deno-edition` failing on GitHub ACtions + - Deno is setup on GitHub Actions if the project uses Deno (determined by `deno` keyword) +- Improved runtime: + - Resolved an issue with aggressive Node.js engine changes: + - The `package.json:engines:node` is no longer always updated to the supported or desired version beforehand, now it is only updated once we know what Node.js versions we target + - `package.json:scripts:our:compile:deno` is only added if the project uses Deno (determined by `deno` keyword) +- Improved versions: + - Boundation is much more intelligent and helpful when it comes to expanding or shrinking the editions and Node.js engine support as necessary. + ## v1.79.0 2023 October 30 - Made the generated npm scripts compatible with Windows by use `printf` instead of `echo` diff --git a/package-lock.json b/package-lock.json index 435310e..32c5e18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,20 +10,19 @@ "license": "Artistic-2.0", "dependencies": { "@bevry/ansi": "^3.3.0", - "@bevry/ecmascript-versions": "^3.5.0", - "@bevry/github-orgs": "^1.4.0", + "@bevry/ecmascript-versions": "^3.6.0", + "@bevry/github-orgs": "^2.1.0", "@bevry/list": "^1.7.0", - "@bevry/nodejs-ecmascript-compatibility": "^4.5.0", + "@bevry/nodejs-ecmascript-compatibility": "^5.0.0", "@bevry/nodejs-versions": "^2.3.0", - "@bevry/testen": "^3.7.1", - "arrange-package-json": "^2.3.0", - "arrangekeys": "^4.24.0", - "errlop": "^4.5.0", - "filedirname": "^2.7.0", - "get-cli-arg": "^7.3.0", + "@bevry/testen": "^5.0.2", + "arrange-package-json": "^2.4.0", + "arrangekeys": "^4.25.0", + "errlop": "^4.6.0", + "filedirname": "^2.8.0", + "get-cli-arg": "^7.4.0", "inquirer": "^9.2.11", "js-yaml": "^4.1.0", - "node-fetch": "^3.3.2", "safeps": "^10.17.0", "semver": "^7.5.4", "typechecker": "^7.18.0", @@ -35,10 +34,9 @@ }, "devDependencies": { "@bevry/update-contributors": "^1.22.0", - "@types/node-fetch": "^2.6.7", "assert-helpers": "^8.4.0", "eslint": "^8.52.0", - "eslint-config-bevry": "^3.27.0", + "eslint-config-bevry": "^3.28.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", "kava": "^5.15.0", @@ -75,8 +73,9 @@ } }, "node_modules/@bevry/ecmascript-versions": { - "version": "3.5.0", - "license": "MIT", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@bevry/ecmascript-versions/-/ecmascript-versions-3.6.0.tgz", + "integrity": "sha512-a7AwMXRL2/4jPGadK0kvpFJM+smcJ+fxCR+J6BZCFTlOqZ6pW50zwAHRCCt2HNG5JbsHlAGRk8R5MwcTQaOevg==", "engines": { "node": ">=10" }, @@ -84,6 +83,17 @@ "url": "https://bevry.me/fund" } }, + "node_modules/@bevry/figures": { + "version": "6.1.0-next.1698850111.f5bb3c31370762d9ad6c5c5dac50637a8dc1840d", + "resolved": "https://registry.npmjs.org/@bevry/figures/-/figures-6.1.0-next.1698850111.f5bb3c31370762d9ad6c5c5dac50637a8dc1840d.tgz", + "integrity": "sha512-AFYmvIbmcU8S2dQ8WLjjCJRHub8fY66hZZ9+GDuoySTil6Y1TCqjqYipGtoM5IM3WyY21nYJjOtSkfyjzfRBIg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, "node_modules/@bevry/file": { "version": "1.2.0", "dev": true, @@ -169,10 +179,11 @@ } }, "node_modules/@bevry/github-orgs": { - "version": "1.4.0", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@bevry/github-orgs/-/github-orgs-2.1.0.tgz", + "integrity": "sha512-kRrBi6HIhBvO+6HN72C0hcvborjkqNij0LfAj9FEsqeQLM/NMif30Y9SbUNvjL2T28QNN6Rk4qVGNZDLe9YN6g==", "engines": { - "node": ">=0.8" + "node": ">=10" }, "funding": { "url": "https://bevry.me/fund" @@ -221,38 +232,35 @@ } }, "node_modules/@bevry/nodejs-ecmascript-compatibility": { - "version": "4.5.0", - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@bevry/nodejs-ecmascript-compatibility/-/nodejs-ecmascript-compatibility-5.0.0.tgz", + "integrity": "sha512-XALyd4BP8easP+S7dNv4qfyVazeeinfHb6mlJPw3Tx/N2SxZ0WXkktIujq5tluedXWmRWjNWaWZsqtRS9tdxpg==", "dependencies": { - "@bevry/ecmascript-versions": "^3.5.0", - "@bevry/list": "^1.5.0", - "@bevry/nodejs-releases": "^1.2.0", - "errlop": "^4.5.0", - "node-fetch": "^2.6.1" + "@bevry/ecmascript-versions": "^3.6.0", + "@bevry/list": "^1.7.0", + "@bevry/nodejs-releases": "^2.0.0", + "errlop": "^4.6.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://bevry.me/fund" } }, - "node_modules/@bevry/nodejs-ecmascript-compatibility/node_modules/node-fetch": { - "version": "2.7.0", - "license": "MIT", + "node_modules/@bevry/nodejs-ecmascript-compatibility/node_modules/@bevry/nodejs-releases": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@bevry/nodejs-releases/-/nodejs-releases-2.0.0.tgz", + "integrity": "sha512-eBy3X9UCgyE5f4gILT9/SVClIV7rY+LqVLHOqPvNkW+1iv/8mtPoII+Kj5LWeteSDyYva90offHfb9OlA0lsfg==", "dependencies": { - "whatwg-url": "^5.0.0" + "errlop": "^4.6.0", + "version-compare": "^1.4.0" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" + "node": ">=18" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "funding": { + "url": "https://bevry.me/fund" } }, "node_modules/@bevry/nodejs-releases": { @@ -339,26 +347,27 @@ } }, "node_modules/@bevry/testen": { - "version": "3.7.1", - "license": "MIT", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@bevry/testen/-/testen-5.0.2.tgz", + "integrity": "sha512-fbTn/jklZ/o0yIdoVThPtlGe1/WleX0Y5jcabMOmF2qDW+s/VRVuAfVyXhdibApd9q/UElTQGLvWZfdavGaz0g==", "dependencies": { - "chalk": "^4.0.0", - "figures": "^3.2.0", - "logger-clearable": "^3.0.0", - "minimist": "^1.2.5", - "semver": "^7.3.2", - "spinner-title": "^3.0.0", + "@bevry/ansi": "^3.3.0", + "@bevry/figures": "^6.1.0-next.1698850111.f5bb3c31370762d9ad6c5c5dac50637a8dc1840d", + "@bevry/nodejs-versions": "^2.3.0", + "@bevry/wait": "^1.0.0", + "logger-clearable": "^3.16.0", + "minimist": "^1.2.8", + "semver": "^7.5.4", + "spinner-title": "^3.16.0", "string-width": "^4.2.0", "text-table": "^0.2.0", - "then-exec": "0.0.1", - "travis-or-circle": "^1.0.2", - "update-notifier": "^4.1.0" + "then-exec": "^0.0.1" }, "bin": { - "testen": "source/bin.js" + "testen": "bin.cjs" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://bevry.me/fund" @@ -400,7 +409,6 @@ }, "node_modules/@bevry/wait": { "version": "1.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -552,40 +560,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "license": "MIT", - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@types/node": { - "version": "20.8.9", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/node-fetch": { - "version": "2.6.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "dev": true, @@ -680,13 +654,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "license": "ISC", - "dependencies": { - "string-width": "^4.1.0" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "license": "MIT", @@ -735,10 +702,11 @@ "license": "Python-2.0" }, "node_modules/arrange-package-json": { - "version": "2.3.0", - "license": "MIT", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/arrange-package-json/-/arrange-package-json-2.4.0.tgz", + "integrity": "sha512-+LrQEYjy2yYvMLkfEWcaMDbGkkXG/DprkL4sIIrNQ/eVGSLj8xe8uFr5yLXWqR8hEDOI2eIxUU6GlYz4EHUe/Q==", "dependencies": { - "arrangekeys": "^4.23.0" + "arrangekeys": "^4.24.0" }, "engines": { "node": ">=10" @@ -748,8 +716,9 @@ } }, "node_modules/arrangekeys": { - "version": "4.24.0", - "license": "MIT", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/arrangekeys/-/arrangekeys-4.25.0.tgz", + "integrity": "sha512-f9OZfsmz8IDivWR6DZ1M4IEYpluX+uLblXUajsBiwrsJyg3NkwzB55dq16AguXoT8mWC2kumv/TlhjyWBHCMUQ==", "engines": { "node": ">=10" }, @@ -774,11 +743,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, "node_modules/badges": { "version": "4.28.0", "dev": true, @@ -792,6 +756,7 @@ }, "node_modules/balanced-match": { "version": "1.0.2", + "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -829,44 +794,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/boxen": { - "version": "4.2.0", - "license": "MIT", - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/chalk": { - "version": "3.0.0", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/node_modules/type-fest": { - "version": "0.8.1", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=8" - } - }, "node_modules/bplist-parser": { "version": "0.2.0", "dev": true, @@ -880,6 +807,7 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -933,53 +861,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "license": "MIT", - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/json-buffer": { - "version": "3.0.0", - "license": "MIT" - }, - "node_modules/cacheable-request/node_modules/keyv": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.0" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind": { "version": "1.0.5", "license": "MIT", @@ -1000,13 +881,6 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/caterpillar": { "version": "6.8.0", "dev": true, @@ -1041,20 +915,6 @@ "version": "0.7.0", "license": "MIT" }, - "node_modules/ci-info": { - "version": "2.0.0", - "license": "MIT" - }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cli-cursor": { "version": "3.1.0", "license": "MIT", @@ -1089,16 +949,6 @@ "node": ">=0.8" } }, - "node_modules/clone-response": { - "version": "1.0.3", - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/color-convert": { "version": "2.0.1", "license": "MIT", @@ -1113,36 +963,11 @@ "version": "1.1.4", "license": "MIT" }, - "node_modules/combined-stream": { - "version": "1.0.8", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/concat-map": { "version": "0.0.1", + "dev": true, "license": "MIT" }, - "node_modules/configstore": { - "version": "5.0.1", - "license": "BSD-2-Clause", - "dependencies": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "dev": true, @@ -1156,30 +981,6 @@ "node": ">= 8" } }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cwd": { - "version": "0.9.1", - "license": "MIT", - "dependencies": { - "find-pkg": "^0.1.0" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, "node_modules/debug": { "version": "4.3.4", "dev": true, @@ -1196,23 +997,6 @@ } } }, - "node_modules/decompress-response": { - "version": "3.3.0", - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "dev": true, @@ -1260,10 +1044,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/defer-to-connect": { - "version": "1.1.3", - "license": "MIT" - }, "node_modules/define-data-property": { "version": "1.1.1", "license": "MIT", @@ -1287,14 +1067,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/doctrine": { "version": "3.0.0", "dev": true, @@ -1306,20 +1078,6 @@ "node": ">=6.0.0" } }, - "node_modules/dot-prop": { - "version": "5.3.0", - "license": "MIT", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/duplexer3": { - "version": "0.1.5", - "license": "BSD-3-Clause" - }, "node_modules/eachr": { "version": "4.5.0", "license": "MIT", @@ -1360,16 +1118,10 @@ "version": "8.0.0", "license": "MIT" }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/errlop": { - "version": "4.5.0", - "license": "MIT", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/errlop/-/errlop-4.6.0.tgz", + "integrity": "sha512-9a1m+bGJeZiCQHZmXwjdpmiSXfOVbp6g/BvLFeJ4Xx2Iu/3ReWGdG5+z4ZPE+F1JU66S+CY9dp4Bm7vw0l3LGA==", "engines": { "node": ">=4" }, @@ -1377,13 +1129,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/escape-goat": { - "version": "2.1.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/escape-string-regexp": { "version": "4.0.0", "dev": true, @@ -1451,12 +1196,12 @@ } }, "node_modules/eslint-config-bevry": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/eslint-config-bevry/-/eslint-config-bevry-3.27.0.tgz", - "integrity": "sha512-4A64zuBmQHwQMYzOvpoSqyPtLssEOfG3Cq8x0OX/8vmRjWlrU9NlCDM/k9TiLN94qDGbnzEir2OWShhP5Zps8w==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/eslint-config-bevry/-/eslint-config-bevry-3.28.0.tgz", + "integrity": "sha512-lLoxygaVctEtz6bjDmPo6M6DeW4L3NZ0vzR0YPWuQDmP5pjeAOIk74e85aJ7Ksz1eOg3DiDLVrTvsqdTXz6DiA==", "dev": true, "dependencies": { - "semver": "^7.3.5" + "semver": "^7.5.4" }, "engines": { "node": ">=10" @@ -1648,16 +1393,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/expand-tilde": { - "version": "1.2.2", - "license": "MIT", - "dependencies": { - "os-homedir": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/extendr": { "version": "5.19.0", "license": "MIT", @@ -1786,47 +1521,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/figures": { - "version": "3.2.0", - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/file-entry-cache": { "version": "6.0.1", "dev": true, @@ -1839,10 +1533,11 @@ } }, "node_modules/filedirname": { - "version": "2.7.0", - "license": "MIT", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/filedirname/-/filedirname-2.8.0.tgz", + "integrity": "sha512-+NWRoWq4BGYSrQrvcxDVv36Duc0aJC4sD/ELWCKtLnWEBGPNM8K2zMTRQMhhY5ggCQZhlSdjQ+wCbv2l7CuHsg==", "dependencies": { - "get-current-line": "^6.5.0" + "get-current-line": "^6.6.0" }, "engines": { "node": ">=10" @@ -1862,27 +1557,6 @@ "node": ">=8" } }, - "node_modules/find-file-up": { - "version": "0.1.3", - "license": "MIT", - "dependencies": { - "fs-exists-sync": "^0.1.0", - "resolve-dir": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/find-pkg": { - "version": "0.1.2", - "license": "MIT", - "dependencies": { - "find-file-up": "^0.1.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/find-up": { "version": "5.0.0", "dev": true, @@ -1916,38 +1590,9 @@ "dev": true, "license": "ISC" }, - "node_modules/form-data": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/fs-exists-sync": { - "version": "0.1.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", + "dev": true, "license": "ISC" }, "node_modules/function-bind": { @@ -1958,10 +1603,11 @@ } }, "node_modules/get-cli-arg": { - "version": "7.3.0", - "license": "MIT", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/get-cli-arg/-/get-cli-arg-7.4.0.tgz", + "integrity": "sha512-5/AgKgM3d0RNbjPLLhj5z/5fp1Fzh1ccJzpsEc/0O8vcB/v2ITvFWeQ7KoXIomiPuzaeEQCR8VHAHbTeHkcJDg==", "dependencies": { - "normalify": "^2.22.0" + "normalify": "^2.24.0" }, "engines": { "node": ">=10" @@ -2006,6 +1652,7 @@ }, "node_modules/glob": { "version": "7.2.3", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -2033,57 +1680,6 @@ "node": ">=10.13.0" } }, - "node_modules/global-dirs": { - "version": "2.1.0", - "license": "MIT", - "dependencies": { - "ini": "1.3.7" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/global-dirs/node_modules/ini": { - "version": "1.3.7", - "license": "ISC" - }, - "node_modules/global-modules": { - "version": "0.2.3", - "license": "MIT", - "dependencies": { - "global-prefix": "^0.1.4", - "is-windows": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/global-prefix": { - "version": "0.1.5", - "license": "MIT", - "dependencies": { - "homedir-polyfill": "^1.0.0", - "ini": "^1.3.4", - "is-windows": "^0.2.0", - "which": "^1.2.12" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/global-prefix/node_modules/which": { - "version": "1.3.1", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "node_modules/globals": { "version": "13.23.0", "dev": true, @@ -2108,36 +1704,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/got": { - "version": "9.6.0", - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/got/node_modules/get-stream": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "license": "ISC" @@ -2184,13 +1750,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-yarn": { - "version": "2.1.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/hasown": { "version": "2.0.0", "license": "MIT", @@ -2201,20 +1760,6 @@ "node": ">= 0.4" } }, - "node_modules/homedir-polyfill": { - "version": "1.0.3", - "license": "MIT", - "dependencies": { - "parse-passwd": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "license": "BSD-2-Clause" - }, "node_modules/human-signals": { "version": "4.3.1", "dev": true, @@ -2274,15 +1819,9 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-lazy": { - "version": "2.1.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", + "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -2290,6 +1829,7 @@ }, "node_modules/inflight": { "version": "1.0.6", + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -2300,10 +1840,6 @@ "version": "2.0.4", "license": "ISC" }, - "node_modules/ini": { - "version": "1.3.8", - "license": "ISC" - }, "node_modules/inquirer": { "version": "9.2.11", "license": "MIT", @@ -2372,16 +1908,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "license": "MIT", - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-docker": { "version": "3.0.0", "dev": true, @@ -2439,20 +1965,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-installed-globally": { - "version": "0.3.2", - "license": "MIT", - "dependencies": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-interactive": { "version": "1.0.0", "license": "MIT", @@ -2460,13 +1972,6 @@ "node": ">=8" } }, - "node_modules/is-npm": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-number": { "version": "7.0.0", "dev": true, @@ -2475,15 +1980,9 @@ "node": ">=0.12.0" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -2500,10 +1999,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "license": "MIT", @@ -2514,13 +2009,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-windows": { - "version": "0.2.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-wsl": { "version": "2.2.0", "dev": true, @@ -2546,12 +2034,9 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-yarn-global": { - "version": "0.3.0", - "license": "MIT" - }, "node_modules/isexe": { "version": "2.0.0", + "dev": true, "license": "ISC" }, "node_modules/js-yaml": { @@ -2603,16 +2088,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/latest-version": { - "version": "5.1.0", - "license": "MIT", - "dependencies": { - "package-json": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/levn": { "version": "0.4.1", "dev": true, @@ -2672,13 +2147,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "license": "ISC", @@ -2689,26 +2157,6 @@ "node": ">=10" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "dev": true, @@ -2734,25 +2182,6 @@ "node": ">=8.6" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/mimic-fn": { "version": "2.1.0", "license": "MIT", @@ -2760,15 +2189,9 @@ "node": ">=6" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { "version": "3.1.2", + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -2779,7 +2202,8 @@ }, "node_modules/minimist": { "version": "1.2.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2812,39 +2236,6 @@ "dev": true, "license": "MIT" }, - "node_modules/node-domexception": { - "version": "1.0.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/normalify": { "version": "2.24.0", "license": "MIT", @@ -2855,13 +2246,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/normalize-url": { - "version": "4.5.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/npm-run-path": { "version": "5.1.0", "dev": true, @@ -2889,6 +2273,7 @@ }, "node_modules/once": { "version": "1.4.0", + "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -2961,13 +2346,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/os-homedir": { - "version": "1.0.2", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/os-tmpdir": { "version": "1.0.2", "license": "MIT", @@ -2975,13 +2353,6 @@ "node": ">=0.10.0" } }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/p-limit": { "version": "3.1.0", "dev": true, @@ -3010,26 +2381,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json": { - "version": "6.5.0", - "license": "MIT", - "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/package-json/node_modules/semver": { - "version": "6.3.1", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/parent-module": { "version": "1.0.1", "dev": true, @@ -3041,13 +2392,6 @@ "node": ">=6" } }, - "node_modules/parse-passwd": { - "version": "1.0.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -3058,6 +2402,7 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3112,13 +2457,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/prettier": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", @@ -3171,14 +2509,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/pump": { - "version": "3.0.0", - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "2.3.0", "dev": true, @@ -3187,16 +2517,6 @@ "node": ">=6" } }, - "node_modules/pupa": { - "version": "2.1.1", - "license": "MIT", - "dependencies": { - "escape-goat": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "dev": true, @@ -3216,26 +2536,6 @@ ], "license": "MIT" }, - "node_modules/rc": { - "version": "1.2.8", - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "license": "MIT", @@ -3248,37 +2548,6 @@ "node": ">= 6" } }, - "node_modules/registry-auth-token": { - "version": "4.2.2", - "license": "MIT", - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/registry-url": { - "version": "5.1.0", - "license": "MIT", - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-dir": { - "version": "0.1.1", - "license": "MIT", - "dependencies": { - "expand-tilde": "^1.2.2", - "global-modules": "^0.2.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "dev": true, @@ -3287,13 +2556,6 @@ "node": ">=4" } }, - "node_modules/responselike": { - "version": "1.0.2", - "license": "MIT", - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, "node_modules/restore-cursor": { "version": "3.1.0", "license": "MIT", @@ -3513,23 +2775,6 @@ "node": ">=10" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "license": "MIT", - "dependencies": { - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.1", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/set-function-length": { "version": "1.1.1", "license": "MIT", @@ -3617,10 +2862,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "license": "BSD-3-Clause" - }, "node_modules/string_decoder": { "version": "1.3.0", "license": "MIT", @@ -3713,16 +2954,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/term-size": { - "version": "2.2.1", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/text-table": { "version": "0.2.0", "license": "MIT" @@ -3758,13 +2989,6 @@ "node": ">=0.6.0" } }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "dev": true, @@ -3780,28 +3004,6 @@ "version": "0.0.3", "license": "MIT" }, - "node_modules/travis-or-circle": { - "version": "1.0.2", - "license": "MIT", - "dependencies": { - "cwd": "^0.9.1", - "path-exists": "^2.1.0", - "yamljs": "^0.2.6" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/travis-or-circle/node_modules/path-exists": { - "version": "2.1.0", - "license": "MIT", - "dependencies": { - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tslib": { "version": "2.6.2", "license": "0BSD" @@ -3838,13 +3040,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "license": "MIT", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typescript": { "version": "5.2.2", "dev": true, @@ -3868,21 +3063,6 @@ "url": "https://bevry.me/fund" } }, - "node_modules/undici-types": { - "version": "5.26.5", - "dev": true, - "license": "MIT" - }, - "node_modules/unique-string": { - "version": "2.0.0", - "license": "MIT", - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/untildify": { "version": "4.0.0", "dev": true, @@ -3891,42 +3071,6 @@ "node": ">=8" } }, - "node_modules/update-notifier": { - "version": "4.1.3", - "license": "BSD-2-Clause", - "dependencies": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/chalk": { - "version": "3.0.0", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/uri-js": { "version": "4.4.1", "dev": true, @@ -3935,16 +3079,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url-parse-lax": { - "version": "3.0.0", - "license": "MIT", - "dependencies": { - "prepend-http": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" @@ -3998,13 +3132,6 @@ "defaults": "^1.0.3" } }, - "node_modules/web-streams-polyfill": { - "version": "3.2.1", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "license": "BSD-2-Clause" @@ -4031,16 +3158,6 @@ "node": ">= 8" } }, - "node_modules/widest-line": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi": { "version": "6.2.0", "license": "MIT", @@ -4055,48 +3172,13 @@ }, "node_modules/wrappy": { "version": "1.0.2", + "dev": true, "license": "ISC" }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/xdg-basedir": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/yallist": { "version": "4.0.0", "license": "ISC" }, - "node_modules/yamljs": { - "version": "0.2.10", - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "glob": "^7.0.5" - }, - "bin": { - "json2yaml": "bin/json2yaml", - "yaml2json": "bin/yaml2json" - } - }, - "node_modules/yamljs/node_modules/argparse": { - "version": "1.0.10", - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "dev": true, diff --git a/package.json b/package.json index b8b6947..ee73a56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "boundation", - "version": "1.79.0", + "version": "1.80.0", "description": "Automatic scaffolding and upgrading of your JavaScript ecosystem projects using Bevry's best practices", "homepage": "https://github.com/bevry/boundation", "license": "Artistic-2.0", @@ -96,20 +96,19 @@ }, "dependencies": { "@bevry/ansi": "^3.3.0", - "@bevry/ecmascript-versions": "^3.5.0", - "@bevry/github-orgs": "^1.4.0", + "@bevry/ecmascript-versions": "^3.6.0", + "@bevry/github-orgs": "^2.1.0", "@bevry/list": "^1.7.0", - "@bevry/nodejs-ecmascript-compatibility": "^4.5.0", + "@bevry/nodejs-ecmascript-compatibility": "^5.0.0", "@bevry/nodejs-versions": "^2.3.0", - "@bevry/testen": "^3.7.1", - "arrange-package-json": "^2.3.0", - "arrangekeys": "^4.24.0", - "errlop": "^4.5.0", - "filedirname": "^2.7.0", - "get-cli-arg": "^7.3.0", + "@bevry/testen": "^5.0.2", + "arrange-package-json": "^2.4.0", + "arrangekeys": "^4.25.0", + "errlop": "^4.6.0", + "filedirname": "^2.8.0", + "get-cli-arg": "^7.4.0", "inquirer": "^9.2.11", "js-yaml": "^4.1.0", - "node-fetch": "^3.3.2", "safeps": "^10.17.0", "semver": "^7.5.4", "typechecker": "^7.18.0", @@ -118,10 +117,9 @@ }, "devDependencies": { "@bevry/update-contributors": "^1.22.0", - "@types/node-fetch": "^2.6.7", "assert-helpers": "^8.4.0", "eslint": "^8.52.0", - "eslint-config-bevry": "^3.27.0", + "eslint-config-bevry": "^3.28.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", "kava": "^5.15.0", diff --git a/source/base.js b/source/base.js index 686d12c..3d6c70a 100644 --- a/source/base.js +++ b/source/base.js @@ -6,7 +6,6 @@ import * as urlUtil from 'url' // external import Errlop from 'errlop' -import fetch from 'node-fetch' import { is as isBevryOrganisation } from '@bevry/github-orgs' // local diff --git a/source/ci.js b/source/ci.js index 59267e6..9df912d 100644 --- a/source/ci.js +++ b/source/ci.js @@ -4,6 +4,13 @@ import { readYAML, unlink, exists, writeYAML, spawn } from './fs.js' import { trimEmpty } from './util.js' import { intersect } from '@bevry/list' import { allLanguages } from './data.js' +import { filterNodeVersions } from '@bevry/nodejs-versions' + +// github actions no longer supports node versions prior to 16 +// https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/ +function filterSetupNodeVersions(nodeVersions) { + return filterNodeVersions(nodeVersions, { gte: 16 }) +} // generate the json file function generateGitHubActionsJSON(state) { @@ -11,18 +18,28 @@ function generateGitHubActionsJSON(state) { const { packageData, answers } = state // prepare vars - const os = answers.npm + const actionsOperatingSystems = answers.npm ? ['ubuntu-latest', 'macos-latest', 'windows-latest'] : ['ubuntu-latest'] - const osExperimental = intersect(os, ['macos-latest', 'windows-latest']) - const node = answers.nodeVersionsTested + const actionsOperatingSystemsExperimental = intersect( + actionsOperatingSystems, + ['macos-latest', 'windows-latest'], + ) const { desiredNodeVersion } = answers + const actionsNodeVersions = filterSetupNodeVersions( + answers.nodeVersionsTested, + ) + const actionsNodeVersionsOptional = filterSetupNodeVersions( + state.nodeVersionsOptional, + ) const continueOnErrors = [ - state.nodeVersionsOptional.length - ? `contains('${state.nodeVersionsOptional.join(' ')}', matrix.node)` + actionsNodeVersionsOptional.length + ? `contains('${actionsNodeVersionsOptional.join(' ')}', matrix.node)` : '', - osExperimental.length - ? `contains('${osExperimental.join(' ')}', matrix.os)` + actionsOperatingSystemsExperimental.length + ? `contains('${actionsOperatingSystemsExperimental.join( + ' ', + )}', matrix.os)` : '', ] .filter((i) => i) @@ -43,6 +60,12 @@ function generateGitHubActionsJSON(state) { run: 'npm run our:verify', }, ] + const verifyNodeVersionSteps = [ + { + name: 'Verify Node.js Versions', + run: "printf '%s' 'node: ' && node --version && printf '%s' 'npm: ' && npm --version && node -e 'console.log(process.versions)'", + }, + ] const testSteps = [ { run: 'npm test', @@ -109,29 +132,47 @@ function generateGitHubActionsJSON(state) { // github actions const setupSteps = [ { - uses: 'actions/checkout@v2', + uses: 'actions/checkout@v4', }, ] const desiredNodeSteps = [ { name: 'Install desired Node.js version', - uses: 'actions/setup-node@v2', + uses: 'actions/setup-node@v4', + // uses: 'dcodeIO/setup-node-nvm@master', with: { 'node-version': desiredNodeVersion, }, }, + ...verifyNodeVersionSteps, ] const targetNodeSteps = [ { name: 'Install targeted Node.js', if: `\${{ matrix.node != ${desiredNodeVersion} }}`, - uses: 'actions/setup-node@v2', + uses: 'actions/setup-node@v4', + // uses: 'dcodeIO/setup-node-nvm@master', with: { 'node-version': '${{ matrix.node }}', }, }, + ...verifyNodeVersionSteps, + ] + const setupDenoSteps = [ + { + name: 'Install Deno', + uses: 'denoland/setup-deno@v1', + with: { + 'deno-version': 'vx.x.x', + }, + }, ] + // add deno steps if needed + if (answers.keywords.has('deno')) { + setupSteps.push(...setupDenoSteps) + } + // merge return trimEmpty({ name: 'bevry', @@ -140,8 +181,8 @@ function generateGitHubActionsJSON(state) { test: { strategy: { matrix: { - os, - node, + os: actionsOperatingSystems, + node: actionsNodeVersions, }, }, 'runs-on': '${{ matrix.os }}', @@ -217,7 +258,7 @@ export async function updateCI(state) { automerge: { 'runs-on': 'ubuntu-latest', steps: [ - { uses: 'actions/checkout@v2' }, + { uses: 'actions/checkout@v4' }, { uses: 'ahmadnassri/action-dependabot-auto-merge@v2', with: { diff --git a/source/data.js b/source/data.js index 7ba0feb..d97a856 100644 --- a/source/data.js +++ b/source/data.js @@ -3,7 +3,7 @@ import { cwd } from 'process' // external import { - getESVersionsByNow, + getESVersionsByDate, getESVersionByDate, getDateWithYearOffset, } from '@bevry/ecmascript-versions' @@ -29,18 +29,20 @@ export const allLanguages = [ 'css', ] +// both browsers and typescript lag behind +// as it is 2023-11-01 and ES2023 isn't available to typescript, even though it has been ratified (they get ratified in the middle of year) +const aYearAgo = getDateWithYearOffset(-1) + // we reverse, to make sure it is newest first export const allTypescriptTargets = [ 'ESNext', - ...getESVersionsByNow().reverse(), + ...getESVersionsByDate(aYearAgo).reverse(), ] export const defaultCoffeeTarget = 'ESNext' // previous year -export const defaultBrowserTarget = getESVersionByDate( - getDateWithYearOffset(-1), -) +export const defaultBrowserTarget = getESVersionByDate(aYearAgo) export const languageNames = { typescript: 'TypeScript', diff --git a/source/package.js b/source/package.js index fd58ccd..7a5749a 100644 --- a/source/package.js +++ b/source/package.js @@ -595,11 +595,6 @@ export async function updatePackageData(state) { ) // engines - if (answers.website) { - packageData.engines.node = `>=${answers.desiredNodeVersion}` - } else { - packageData.engines.node = `>=${answers.nodeVersionSupportedMinimum}` - } delete packageData.engines.docpad // license diff --git a/source/questions.js b/source/questions.js index 583dfed..c834879 100644 --- a/source/questions.js +++ b/source/questions.js @@ -2,7 +2,7 @@ import * as pathUtil from 'path' // external -import { unique, last, first } from '@bevry/list' +import { unique, last, first, intersect } from '@bevry/list' import { filterNodeVersions, filterSignificantNodeVersions, @@ -12,7 +12,7 @@ import { fetchExclusiveCompatibleESVersionsForNodeVersions } from '@bevry/nodejs // local import _getAnswers from './answers.js' -import { pwd, allLanguages } from './data.js' +import { pwd, allLanguages, allTypescriptTargets } from './data.js' import { isNumber, isGitUrl, @@ -597,18 +597,10 @@ export async function getQuestions(state) { return bin }, }, - { - name: 'desiredNodeOnly', - message: `Should we only support the most desired node version?`, - type: 'confirm', - default({ website }) { - return Boolean(website) - }, - }, { name: 'nodeVersions', message: - 'Automated property to provide node versions for the upcoming questions', + 'Automated property to provide Node.js versions for the upcoming questions', type: 'checkbox', validate: isSpecified, choices({ vercelWebsite, targetModules }) { @@ -634,7 +626,7 @@ export async function getQuestions(state) { }, { name: 'desiredNodeVersion', - message: 'What is the desired node version?', + message: 'What is the desired Node.js version?', type: 'list', validate: isNumber, choices({ nodeVersions }) { @@ -650,14 +642,72 @@ export async function getQuestions(state) { return last(nodeVersions) }, }, + { + name: 'desiredNodeOnly', + message: `Should we only support the desired Node.js version?`, + type: 'confirm', + default({ website }) { + return Boolean(website) + }, + }, + { + name: 'maintainedNodeVersions', + message: + 'Should unmaintained Node.js versions be trimmed from our support?', + type: 'confirm', + default({ desiredNodeOnly }) { + if (desiredNodeOnly) return false + return false + }, + skip({ desiredNodeOnly }) { + return Boolean(desiredNodeOnly) + }, + }, + { + name: 'expandNodeVersions', + message: + 'Should unsupported Node.js versions be supported if they pass the tests?', + type: 'confirm', + default({ desiredNodeOnly }) { + if (desiredNodeOnly) return false + return false + }, + skip({ desiredNodeOnly }) { + return Boolean(desiredNodeOnly) + }, + }, + { + name: 'shrinkNodeVersions', + message: + 'Should unsupported Node.js versions be trimmed if they fail the tests?', + type: 'confirm', + default({ desiredNodeOnly }) { + if (desiredNodeOnly) return false + return false + }, + skip({ desiredNodeOnly }) { + return Boolean(desiredNodeOnly) + }, + }, { name: 'nodeVersionsSupported', message: 'Which Node.js versions must your package support?', type: 'checkbox', validate: isSpecified, - choices({ nodeVersions, desiredNodeOnly, desiredNodeVersion }) { - if (desiredNodeOnly) return [desiredNodeVersion] - if ( + choices({ + nodeVersions, + desiredNodeOnly, + desiredNodeVersion, + maintainedNodeVersions, + }) { + if (desiredNodeOnly) { + return [desiredNodeVersion] + } else if (maintainedNodeVersions) { + return filterNodeVersions(nodeVersions, { + maintained: true, + gte: nodeEngineVersion, + }) + } else if ( nodeEngineVersion && isNodeVersionActiveOrCurrent(nodeEngineVersion) ) { @@ -682,7 +732,7 @@ export async function getQuestions(state) { { name: 'nodeVersionSupportedMinimum', message: - 'Automated property for the minimum node version to be supported', + 'Automated property for constraining the minimum Node.js version to be supported', type: 'list', validate: isNumber, choices({ nodeVersionsSupported }) { @@ -696,7 +746,7 @@ export async function getQuestions(state) { { name: 'nodeVersionSupportedMaximum', message: - 'Automated property for the maximum node version to be supported support', + 'Automated property for constraining the maximum Node.js version to be supported support', type: 'list', validate: isNumber, choices({ nodeVersionsSupported }) { @@ -707,38 +757,23 @@ export async function getQuestions(state) { }, skip: true, }, - { - name: 'nodeVersionsTestedRange', - message: - 'Is there a semver range that you want to constrain test versions to?', - filter: trim, - skip({ desiredNodeOnly }) { - return Boolean(desiredNodeOnly) - }, - }, { name: 'nodeVersionsTested', - message: 'Automated property for providing the tested node versions', + message: 'Which Node.js versions must your package test against?', type: 'checkbox', validate: isSpecified, - choices({ - nodeVersions, - desiredNodeOnly, - desiredNodeVersion, - nodeVersionsTestedRange, - }) { - if (desiredNodeOnly) return [desiredNodeVersion] - if ( + choices({ nodeVersions, desiredNodeOnly, desiredNodeVersion }) { + if (desiredNodeOnly) { + return [desiredNodeVersion] + } else if ( !nodeEngineVersion || isNodeVersionActiveOrCurrent(nodeEngineVersion) ) { return filterNodeVersions(nodeVersions, { maintained: true, - range: nodeVersionsTestedRange, }) } else { return filterNodeVersions(nodeVersions, { - range: nodeVersionsTestedRange, gte: nodeEngineVersion, }) } @@ -746,10 +781,14 @@ export async function getQuestions(state) { default(opts) { return this.choices(opts) }, + skip({ desiredNodeOnly }) { + return Boolean(desiredNodeOnly) + }, }, { name: 'nodeVersionTestedMinimum', - message: 'Automated property for the minimum node version for testing', + message: + 'Automated property for constraining the minimum Node.js version for testing', type: 'list', validate: isNumber, choices({ language, desiredNodeVersion, nodeVersionsTested }) { @@ -763,7 +802,8 @@ export async function getQuestions(state) { }, { name: 'nodeVersionTestedMaximum', - message: 'Automated property for the maximum node version for testing', + message: + 'Automated property for constraining the maximum Node.js version for testing', type: 'list', validate: isNumber, choices({ language, desiredNodeVersion, nodeVersionsTested }) { @@ -789,19 +829,21 @@ export async function getQuestions(state) { }) { // ensure versions are in order of most preferred to least preferred // otherwise edition trimming will not work as expected - return ( - compilerNode === 'babel' - ? unique([ - desiredNodeVersion, - nodeVersionSupportedMinimum, - nodeVersionSupportedMaximum, - ]).sort(versionCompare) - : compilerNode === 'typescript' - ? await fetchExclusiveCompatibleESVersionsForNodeVersions( + return compilerNode === 'babel' + ? unique([ + desiredNodeVersion, + nodeVersionSupportedMinimum, + nodeVersionSupportedMaximum, + ]) + .sort(versionCompare) + .reverse() + : compilerNode === 'typescript' + ? intersect(allTypescriptTargets, [ + ...(await fetchExclusiveCompatibleESVersionsForNodeVersions( nodeVersionsSupported, - ) - : [] - ).reverse() + )), + ]) // don't add ESNext as it is ephemeral + : [] }, default(opts) { return this.choices(opts) @@ -859,9 +901,27 @@ export async function getAnswers(state) { answers.targets = answers.targets || [] answers.keywords = new Set((answers.keywords || '').split(/,\s*/)) + // constrain versions + answers.nodeVersionsSupported = filterNodeVersions( + answers.nodeVersionsSupported, + { + gte: answers.nodeVersionSupportedMinimum, + lte: answers.nodeVersionSupportedMaximum, + }, + ) + answers.nodeVersionsTested = filterNodeVersions(answers.nodeVersionsTested, { + gte: answers.nodeVersionTestedMinimum, + lte: answers.nodeVersionTestedMaximum, + }) + // ensure we don't have a situation where node 14 is about to be released, but we only support node 13 and up if (answers.desiredNodeVersion && answers.nodeVersionSupportedMaximum) { - if (answers.desiredNodeVersion > answers.nodeVersionSupportedMaximum) { + if ( + versionCompare( + answers.desiredNodeVersion, + answers.nodeVersionSupportedMaximum, + ) === 1 + ) { console.log( 'constrained desiredNodeVersion to the nodeVersionSupportedMaximum of', answers.nodeVersionSupportedMaximum, diff --git a/source/runtime.js b/source/runtime.js index 4581771..d001c02 100644 --- a/source/runtime.js +++ b/source/runtime.js @@ -2,6 +2,7 @@ import * as pathUtil from 'path' // external +import versionCompare from 'version-compare' import { unique, toggle } from '@bevry/list' // local @@ -346,12 +347,12 @@ export async function updateRuntime(state) { const devDependencyCompat = { kava: 3, } - if (answers.nodeVersionSupportedMinimum < 8) { + if (versionCompare(answers.nodeVersionSupportedMinimum, 8) === -1) { for (const [key, value] of Object.entries(dependencyCompat)) { versions[key] = value } } - if (answers.nodeVersionTestedMinimum < 8) { + if (versionCompare(answers.nodeVersionTestedMinimum, 8) === -1) { for (const [key, value] of Object.entries(devDependencyCompat)) { versions[key] = value } @@ -520,11 +521,11 @@ export async function updateRuntime(state) { // typescript // primarily typescript if (answers.language === 'typescript') { - // @todo import make-deno-edition and use the api instead of the bin - // deno compat layer - if (answers.sourceModule && answers.npm) { - if (packageData.name === 'make-deno-edition') { - // @todo, once make-deno-edition API is used, this can be fixzed + // @todo import make-deno-edition and use the api instead of the bin, so we can add/remove the keywords and script based on compatibility + // @todo fix windows support for make-deno-edition + if (answers.sourceModule && answers.npm && answers.keywords.has('deno')) { + if (['make-deno-edition', '@bevry/figures'].includes(packageData.name)) { + // @todo, once make-deno-edition API is used, this can be fixed // it is currently disabled because it cannot call itself during the compile step // as it has not finished compiling // state.scripts['our:compile:deno'] = 'npm run our:bin -- --attempt' diff --git a/source/versions.js b/source/versions.js index 912d321..a98a3f1 100644 --- a/source/versions.js +++ b/source/versions.js @@ -22,6 +22,7 @@ export async function updateEngines(state) { const serial = ['testen', 'safefs', 'lazy-require'].includes(answers.name) || answers.name.includes('docpad') + let useSpecificEngineVersions = false // ================================= // run each edition against the supported node version @@ -45,7 +46,7 @@ export async function updateEngines(state) { )}] which the project's tests passed`, ) } else { - packageData.engines.node = nodeMajorVersions(passed).join(' || ') + useSpecificEngineVersions = true } // add the versions to the list @@ -63,6 +64,8 @@ export async function updateEngines(state) { let recompile = false /* eslint no-loop-func:0 */ + // to determine the import edition, there can only be one, so use onlyAllSupported mode (to remove all editions that don't support everything (or at least just the supported versions), or fail) + // to determine the require edition, there can be many, so use allUnique mode (to remove duplicates) for (const { list, nodeVersions, mode } of [ { list: nodeEditionsImport, @@ -82,12 +85,12 @@ export async function updateEngines(state) { // Prepare const listPassedVersions = new Set() - let skip = false + let skipRemainderBecausePassedEverything = false let debug = '' // Determine for (const edition of list) { - if (skip) { + if (skipRemainderBecausePassedEverything) { console.log( `The edition [${edition.directory}] will be trimmed, as a previous edition already passes all targets`, ) @@ -127,7 +130,10 @@ export async function updateEngines(state) { listPassedVersions.has(nodeMajorVersion(version)) === false, ) const range = nodeMajorVersions(passed).join(' || ') - skip = failed.length === 0 + skipRemainderBecausePassedEverything = failed.length === 0 + + // make engines of the edition the passed versions + edition.engines.node = range // log the results debug += versions.messages.join('\n\n') @@ -142,21 +148,23 @@ export async function updateEngines(state) { ].join('\n'), ) - // trim - if (mode === 'allUnique') { - // is this one redundant - if (passedUnique.length === 0) { - console.log( - `The edition [${edition.directory}] will be trimmed, as it has no unique passing versions`, - ) - edition.active = false - recompile = true - continue - } - } else if (mode === 'onlyAllSupported') { - // does this one pass for all targets? - if (skip) { - // if so, deactivate all those prior + // trim non-unique version + if (passedUnique.length === 0) { + // if this one has no unique passes, then it is redundant and can be trimmed + console.log( + `The edition [${edition.directory}] will be trimmed, as it has no unique passing versions`, + ) + edition.active = false + recompile = true + } else { + // had unique passing + + // handle onlyAllSupported mode + if ( + mode === 'onlyAllSupported' && + skipRemainderBecausePassedEverything + ) { + // if this one passes for all targets, then trim on all prior targets for (const priorEdition of list) { if (priorEdition === edition) break console.log( @@ -164,25 +172,21 @@ export async function updateEngines(state) { ) priorEdition.active = false recompile = true - continue } } - } - // make engines the passed versions - edition.engines.node = range - - // add the unique versions to the list - passedUnique.forEach((version) => - listPassedVersions.add(nodeMajorVersion(version)), - ) + // add the unique versions to the list + passedUnique.forEach((version) => + listPassedVersions.add(nodeMajorVersion(version)), + ) - // log - status( - `...determined engines for edition [${edition.directory}] as [${ - edition.engines.node - }] against [${numbers.join(', ')}]`, - ) + // log + status( + `...determined engines for edition [${edition.directory}] as [${ + edition.engines.node + }] against [${numbers.join(', ')}]`, + ) + } } // fetch the editions we've kept @@ -202,7 +206,11 @@ export async function updateEngines(state) { // verify we have editions that pass on our targets for (const version of nodeVersions) { - if (!listPassedVersions.has(version)) { + if ( + !listPassedVersions.has(version) && + answers.nodeVersionsSupported.includes(version) + ) { + // all kept editions should pass for all supported versions console.error(debug.trim()) throw new Error( `The kept editions [${keptEditions @@ -254,17 +262,69 @@ export async function updateEngines(state) { ) } - // if we are testing all supported versions - // then make the engines the first passed version - if (answers.nodeVersionSupportedMinimum >= answers.nodeVersionTestedMinimum) { - packageData.engines.node = '>=' + testedAndPassed[0] + if (failedAndUnsupported.length) { + console.log( + `The project failed on the unsupported versions: ${failedAndUnsupported.join( + ', ', + )}`, + ) + } + + // @todo use state instead of mutating + + // handle expansion + // @todo there is a bug when using expandNodeVersionsed, as it defaults to Node.js 18, 20, 21 + // which if there is engines >=10, and tests only pass on 16 and above, then it will change to >=16, as 18 is greater than 16. + if ( + answers.expandNodeVersions && + versionCompare(answers.nodeVersionSupportedMinimum, testedAndPassed[0]) === + 1 + ) { + // our tests revealed we support a lower version than originally supported so expand + const oldValue = packageData.engines.node + const newValue = '>=' + testedAndPassed[0] + packageData.engines.node = newValue + if (oldValue !== newValue) { + console.log( + `The project's Node.js engine has expanded from ${oldValue} to ${newValue}`, + ) + } else { + console.log(`The project's Node.js engine has stayed as ${oldValue}`) + } } else { - // otherwise use the supported version, as all our tests passed - packageData.engines.node = '>=' + answers.nodeVersionSupportedMinimum + const oldValue = packageData.engines.node + const newValue = + (useSpecificEngineVersions && + nodeMajorVersions(testedAndPassed).join(' || ')) || + (answers.website && `>=${answers.desiredNodeVersion}`) || + `>=${answers.nodeVersionSupportedMinimum}` + if (oldValue !== newValue) { + console.log( + `The project's Node.js engine has changed from ${oldValue} to ${newValue}`, + ) + } else { + console.log(`The project's Node.js engine has stayed as ${oldValue}`) + } } - // apply the optional versions so that ci has access - state.nodeVersionsOptional = failedAndUnsupported + // handle shrinking in case min test version failed + if ( + answers.shrinkNodeVersions && + versionCompare(answers.nodeVersionTestedMinimum, testedAndPassed[0]) === -1 + ) { + const oldValue = answers.nodeVersionTestedMinimum + const newValue = testedAndPassed[0] + answers.nodeVersionTestedMinimum = newValue + answers.nodeVersionsTested = testedAndPassed + if (answers.expandNodeVersions === false) { + state.nodeVersionsOptional = passedAndUnsupported + } + console.log( + `The project's Node.js tests have been shrunk from ${oldValue} to ${newValue}`, + ) + } else { + state.nodeVersionsOptional = failedAndUnsupported + } // ================================= // update the package.json file