From 1fdd7ed4be473999d99b1ca8e29ea1e0fd0b990c Mon Sep 17 00:00:00 2001 From: Elliot Goodrich Date: Sun, 7 Jul 2024 10:08:42 +0100 Subject: [PATCH] Remove cruft from configure script Continue the effort to remove things from the configure script that should be handled by default in the plugins. In this case it is, 1. `phony` supports extracting `orderOnlyDeps` from the input so we can depend on formatted files 2. all plugins now support passing `orderOnlyDeps` when creating rules, which we use to replace our `inject` function 3. the `biome` plugin takes a `configPath` so we no longer need to wrap the function and inject it ourselves Upgrade to the latest biome as part of this, which also requires fixing a few small linting errors. --- configure/biome.json | 2 +- configure/configure.mjs | 76 ++------ configure/package-lock.json | 305 ++++++++++++++++++------------ configure/package.json | 8 +- package-lock.json | 12 +- packages/biome/src/biome.ts | 2 +- packages/esbuild/src/esbuild.ts | 2 +- packages/node/src/depfile.cts | 2 - packages/node/src/hookImport.mts | 2 +- packages/node/src/hookRequire.cts | 2 +- packages/node/src/node.ts | 2 +- packages/tsc/src/tsc.ts | 2 +- 12 files changed, 214 insertions(+), 203 deletions(-) diff --git a/configure/biome.json b/configure/biome.json index b372052..e1d852a 100644 --- a/configure/biome.json +++ b/configure/biome.json @@ -5,7 +5,7 @@ "indentStyle": "space", "indentWidth": 2, "lineWidth": 80, - "lineEnding": "crlf", + "lineEnding": "lf", "ignore": [] }, "linter": { diff --git a/configure/configure.mjs b/configure/configure.mjs index 78ec815..19e688e 100644 --- a/configure/configure.mjs +++ b/configure/configure.mjs @@ -15,7 +15,6 @@ import { basename, dirname, extname, join, relative } from "node:path/posix"; import { resolve as resolveNative, relative as relativeNative, - sep, } from "node:path"; import { existsSync, readFileSync, writeFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; @@ -26,19 +25,6 @@ if (isCi) { console.log("Running in CI mode"); } -// Copy from `@ninjutsu-build/core` for the moment until we widen the -// contract of `phony` -function getOrderOnlyDeps(input) { - if (typeof input !== "object") { - return input; - } - - if (Array.isArray(input)) { - return input.map(getOrderOnlyDeps); - } - return input[orderOnlyDeps] ?? input.file; -} - const extLookup = { ".ts": ".js", ".mts": ".mjs", @@ -136,28 +122,7 @@ function formatAndLint(file) { return lint({ in: formatted }); } -// Return a function that will append `args[orderOnlyDeps]` with the build arguments -// before passing to `rule`. -function inject(rule, args) { - return (a) => { - const { [orderOnlyDeps]: _orderOnlyDeps = [], ...rest } = a; - const deps = - typeof _orderOnlyDeps === "string" ? [_orderOnlyDeps] : _orderOnlyDeps; - return rule({ - ...rest, - [orderOnlyDeps]: deps.concat(args[orderOnlyDeps]), - }); - }; -} - -function addBiomeConfig(rule) { - return (a) => { - return rule({ - ...a, - configPath: join("configure", "biome.json"), - }); - }; -} +const biomeConfig = join("configure", "biome.json"); async function loadSourcesFromTSConfig(tsConfig) { tsConfig = getInput(tsConfig); @@ -209,37 +174,34 @@ let checkFormatted; const toolsInstalled = ci({ in: "configure/package.json", [validations]: (out) => { - checkFormatted = addBiomeConfig( - inject(makeCheckFormattedRule(ninja), { - [orderOnlyDeps]: out, - }), - ); + checkFormatted = makeCheckFormattedRule(ninja, { + configPath: biomeConfig, + [orderOnlyDeps]: out, + }); // Add a validation that `package.json` is formatted correctly. // If we formatted after running `npmci` it would cause us to run it again return checkFormatted({ in: "configure/package.json" })[validations]; }, }); -const tsc = inject(makeTSCRule(ninja), { [orderOnlyDeps]: toolsInstalled }); -const typecheck = inject(makeTypeCheckRule(ninja), { +const tsc = makeTSCRule(ninja, { [orderOnlyDeps]: toolsInstalled }); +const typecheck = makeTypeCheckRule(ninja, { [orderOnlyDeps]: toolsInstalled, }); const test = makeNodeTestRule(ninja); const tar = makeTarRule(ninja); const format = isCi ? checkFormatted - : addBiomeConfig( - inject(makeFormatRule(ninja), { - [orderOnlyDeps]: toolsInstalled, - }), - ); + : makeFormatRule(ninja, { + configPath: biomeConfig, + [orderOnlyDeps]: toolsInstalled, + }); const copy = makeCopyRule(ninja); -const lint = addBiomeConfig( - inject(makeLintRule(ninja), { - [orderOnlyDeps]: toolsInstalled, - }), -); -const transpile = inject(makeSWCRule(ninja), { +const lint = makeLintRule(ninja, { + configPath: biomeConfig, + [orderOnlyDeps]: toolsInstalled, +}); +const transpile = makeSWCRule(ninja, { [orderOnlyDeps]: toolsInstalled, }); @@ -298,9 +260,7 @@ for (const cwd of workspaceJSON.workspaces) { // and it is ready to be executed. const packageRunnable = phony({ out: `${localPKGJSON.name}/runnable`, - in: [packageJSON, ...javascript, ...dependenciesRunnable].map( - getOrderOnlyDeps, - ), + in: [packageJSON, ...javascript, ...dependenciesRunnable], }); // Create the TypeScript type declaration files and do typechecking @@ -319,7 +279,7 @@ for (const cwd of workspaceJSON.workspaces) { // check their own code. const packageHasTypes = phony({ out: `${localPKGJSON.name}/typed`, - in: [packageJSON, ...typeDeclarations].map(getOrderOnlyDeps), + in: [packageJSON, ...typeDeclarations], }); docsDependencies.push(packageHasTypes); diff --git a/configure/package-lock.json b/configure/package-lock.json index fa4fd46..a0653f7 100644 --- a/configure/package-lock.json +++ b/configure/package-lock.json @@ -6,11 +6,11 @@ "": { "license": "MIT", "devDependencies": { - "@biomejs/biome": "1.4.0", - "@ninjutsu-build/biome": "^0.8.3", + "@biomejs/biome": "1.8.0", + "@ninjutsu-build/biome": "^0.9.0", "@ninjutsu-build/core": "^0.8.9", - "@ninjutsu-build/node": "^0.9.5", - "@ninjutsu-build/tsc": "^0.12.8", + "@ninjutsu-build/node": "^0.12.1", + "@ninjutsu-build/tsc": "^0.13.0", "@swc/cli": "^0.3.12", "@swc/core": "^1.4.17", "@types/node": "^20.12.7", @@ -21,34 +21,36 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.4.0.tgz", - "integrity": "sha512-/rDlao6ra38nhxo4IYCqWCzfTJcpMk4YHjSVBI9yN/ifdhnzSwirL25xDVH7G9hZdNhpF9g78FaPJhFa9DX0Cw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.8.0.tgz", + "integrity": "sha512-34xcE2z8GWrIz1sCFEmlHT/+4d+SN7YOqqvzlAKXKvaWPRJ2/NUwxPbRsP01P9QODkQ5bvGvc9rpBihmP+7RJQ==", "dev": true, "hasInstallScript": true, "bin": { "biome": "bin/biome" }, "engines": { - "node": ">=14.*" + "node": ">=14.21.3" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.4.0", - "@biomejs/cli-darwin-x64": "1.4.0", - "@biomejs/cli-linux-arm64": "1.4.0", - "@biomejs/cli-linux-x64": "1.4.0", - "@biomejs/cli-win32-arm64": "1.4.0", - "@biomejs/cli-win32-x64": "1.4.0" + "@biomejs/cli-darwin-arm64": "1.8.0", + "@biomejs/cli-darwin-x64": "1.8.0", + "@biomejs/cli-linux-arm64": "1.8.0", + "@biomejs/cli-linux-arm64-musl": "1.8.0", + "@biomejs/cli-linux-x64": "1.8.0", + "@biomejs/cli-linux-x64-musl": "1.8.0", + "@biomejs/cli-win32-arm64": "1.8.0", + "@biomejs/cli-win32-x64": "1.8.0" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.4.0.tgz", - "integrity": "sha512-nBrtVRwr4IlTtxLOHwBwLv1sWvggf9/DnT5/ALIANJZOpoING6u8jHWipods69wK8kGa8Ld7iwHm3W5BrJJFFQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.8.0.tgz", + "integrity": "sha512-dBAYzfIJ1JmWigKlWourT3sJ3I60LZPjqNwwlsyFjiv5AV7vPeWlHVVIImV2BpINwNjZQhpXnwDfVnGS4vr7AA==", "cpu": [ "arm64" ], @@ -58,13 +60,13 @@ "darwin" ], "engines": { - "node": ">=14.*" + "node": ">=14.21.3" } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.4.0.tgz", - "integrity": "sha512-nny0VgOj3ksUGzU5GblgtQEvrAZFgFe1IJBoYOP978OQdDrg7BpS+GX5udfof87Dl4ZlHPRBU951ceHOxF7BTg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.8.0.tgz", + "integrity": "sha512-ZTTSD0bP0nn9UpRDGQrQNTILcYSj+IkxTYr3CAV64DWBDtQBomlk2oVKWzDaA1LOhpAsTh0giLCbPJaVk2jfMQ==", "cpu": [ "x64" ], @@ -74,13 +76,13 @@ "darwin" ], "engines": { - "node": ">=14.*" + "node": ">=14.21.3" } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.4.0.tgz", - "integrity": "sha512-gyLkT/Yh9xfW1T9yjQs/2txkCeG0e+LRs0adLugMwN0ptcNTRyusBvUoiHnpB+9rS6hWu9ZCedGMNmKQ8v2GSw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.8.0.tgz", + "integrity": "sha512-cx725jTlJS6dskvJJwwCQaaMRBKE2Qss7ukzmx27Rn/DXRxz6tnnBix4FUGPf1uZfwrERkiJlbWM05JWzpvvXg==", "cpu": [ "arm64" ], @@ -90,13 +92,45 @@ "linux" ], "engines": { - "node": ">=14.*" + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.8.0.tgz", + "integrity": "sha512-+ee/pZWsvhDv6eRI00krRNSgAg8DKSxzOv3LUsCjto6N1VzqatTASeQv2HRfG1nitf79rRKM75LkMJbqEfiKww==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.4.0.tgz", - "integrity": "sha512-LIxTuU2zSbIHM9XDYjQphJ5UU8h2eS7yR8uIvGYSba7Qt9AKqfbenyVJTsVnoj1CXxxgKNVSc/wVmlOlGz5DBQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.8.0.tgz", + "integrity": "sha512-cmgmhlD4QUxMhL1VdaNqnB81xBHb3R7huVNyYnPYzP+AykZ7XqJbPd1KcWAszNjUk2AHdx0aLKEBwCOWemxb2g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.8.0.tgz", + "integrity": "sha512-VPA4ocrAOak50VYl8gOAVnjuFFDpIUolShntc/aWM0pZfSIMbRucxnrfUfp44EVwayxjK6ruJTR5xEWj93WvDA==", "cpu": [ "x64" ], @@ -106,13 +140,13 @@ "linux" ], "engines": { - "node": ">=14.*" + "node": ">=14.21.3" } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.4.0.tgz", - "integrity": "sha512-U2jT1/0wZLJIRqnU8qHAfi/A/+yUwlL3sYJgqs+wO0BbR22WGQZlj03u5FdpEoyLXdsLv1pbeIcjNp+V0NYXWA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.8.0.tgz", + "integrity": "sha512-J31spvlh39FfRHQacYXxJX9PvTCH/a8+2Jx9D1lxw+LSF0JybqZcw/4JrlFUWUl4kF3yv8AuYUK0sENScc3g9w==", "cpu": [ "arm64" ], @@ -122,13 +156,13 @@ "win32" ], "engines": { - "node": ">=14.*" + "node": ">=14.21.3" } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.4.0.tgz", - "integrity": "sha512-gN6DgyyBxIwoCovAUFJHFWVallb0cLosayDRtNyxU3MDv/atZxSXOWQezfVKBIbgmFPxYWJObd+awvbPYXwwww==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.8.0.tgz", + "integrity": "sha512-uPHHvu76JC1zYe9zZDcOU9PAg+1MZmPuNgWkb5jljaDeATvzLFPB+0nuJTilf603LXL+E8IdPQAO61Wy2VuEJA==", "cpu": [ "x64" ], @@ -138,7 +172,7 @@ "win32" ], "engines": { - "node": ">=14.*" + "node": ">=14.21.3" } }, "node_modules/@isaacs/cliui": { @@ -178,9 +212,9 @@ } }, "node_modules/@ninjutsu-build/biome": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@ninjutsu-build/biome/-/biome-0.8.3.tgz", - "integrity": "sha512-cycFQG4cwmY4YNuJQd+BUzdVNHzPf/cKLiYBqFRIX23yB/QROtEpUuiHyms0aroh3eXj1AVBQZpKycGUX/eJ8Q==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@ninjutsu-build/biome/-/biome-0.9.0.tgz", + "integrity": "sha512-VMA9a7uO3IOOQJWFguS3Ci/3AOuGKmlMaG3TS6qs/hgV4g2KTNOmwpps/4daniSUFZm1TIH5WTVsb89+mNc82w==", "dev": true, "engines": { "node": ">=18.0.0" @@ -191,18 +225,18 @@ } }, "node_modules/@ninjutsu-build/core": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/@ninjutsu-build/core/-/core-0.8.9.tgz", - "integrity": "sha512-+PhAtaz0kMl/oMf+JN9NDZtpgN208WRwt5gTJsAN4fcwVRAlsaPxun3PBVIT7hJXZ2PW2IQ4VYretvNWta6pFA==", + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@ninjutsu-build/core/-/core-0.8.10.tgz", + "integrity": "sha512-oeHXI6nM/QUPjh5Tf3Zszo0s9nfEnpjfYMmk3O5mWZVGLDdGstoTJi61uAKkQY56BtNtPY2sZ9L8Oa+plyd6VA==", "dev": true, "engines": { "node": ">=18.0.0" } }, "node_modules/@ninjutsu-build/node": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@ninjutsu-build/node/-/node-0.9.5.tgz", - "integrity": "sha512-y/DaYlR2mKeMdlw5dSWHjmvXu7c8W2cFnOeGDnDJrDSLrhL1tZ7F1W7wcHmWkQL5Jl7UtMyIaS7ZiB+Ej3bALg==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@ninjutsu-build/node/-/node-0.12.1.tgz", + "integrity": "sha512-Gm2UYLKgsU/uomhkz8UlYbolPjiNcfMFZIKHjrjQ3Iyi8F+YORDyh5jqLo8qTfxwxZ+4oM9qnD01LjLyJ+Cjbg==", "dev": true, "engines": { "node": ">=18.18.0" @@ -212,9 +246,9 @@ } }, "node_modules/@ninjutsu-build/tsc": { - "version": "0.12.8", - "resolved": "https://registry.npmjs.org/@ninjutsu-build/tsc/-/tsc-0.12.8.tgz", - "integrity": "sha512-6WbLRY1N99/byoHvD+ylBnTFsCWrxyNrgCHA8mH3+NyBnW5TtSpHPnF4VVP+Zp0nE3N5f66qHZ5KYXA8D/PzLQ==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@ninjutsu-build/tsc/-/tsc-0.13.0.tgz", + "integrity": "sha512-EIgNfWl+MMgLzGttSxiRyIIYTDCkVDwOxm2Lyl//qLSM3HpvfDY/asE5/Njm53UirtglOwy3GubtHL8spYZ7IQ==", "dev": true, "dependencies": { "typescript": "^5.2.2" @@ -272,10 +306,13 @@ } }, "node_modules/@shikijs/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.10.0.tgz", - "integrity": "sha512-BZcr6FCmPfP6TXaekvujZcnkFmJHZ/Yglu97r/9VjzVndQA56/F4WjUKtJRQUnK59Wi7p/UTAOekMfCJv7jnYg==", - "dev": true + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.10.3.tgz", + "integrity": "sha512-D45PMaBaeDHxww+EkcDQtDAtzv00Gcsp72ukBtaLSmqRvh0WgGMq3Al0rl1QQBZfuneO75NXMIzEZGFitThWbg==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.4" + } }, "node_modules/@sindresorhus/is": { "version": "4.6.0", @@ -324,9 +361,9 @@ } }, "node_modules/@swc/core": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.6.tgz", - "integrity": "sha512-sHfmIUPUXNrQTwFMVCY5V5Ena2GTOeaWjS2GFUpjLhAgVfP90OP67DWow7+cYrfFtqBdILHuWnjkTcd0+uPKlg==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.13.tgz", + "integrity": "sha512-eailUYex6fkfaQTev4Oa3mwn0/e3mQU4H8y1WPuImYQESOQDtVrowwUGDSc19evpBbHpKtwM+hw8nLlhIsF+Tw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -341,16 +378,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.6.6", - "@swc/core-darwin-x64": "1.6.6", - "@swc/core-linux-arm-gnueabihf": "1.6.6", - "@swc/core-linux-arm64-gnu": "1.6.6", - "@swc/core-linux-arm64-musl": "1.6.6", - "@swc/core-linux-x64-gnu": "1.6.6", - "@swc/core-linux-x64-musl": "1.6.6", - "@swc/core-win32-arm64-msvc": "1.6.6", - "@swc/core-win32-ia32-msvc": "1.6.6", - "@swc/core-win32-x64-msvc": "1.6.6" + "@swc/core-darwin-arm64": "1.6.13", + "@swc/core-darwin-x64": "1.6.13", + "@swc/core-linux-arm-gnueabihf": "1.6.13", + "@swc/core-linux-arm64-gnu": "1.6.13", + "@swc/core-linux-arm64-musl": "1.6.13", + "@swc/core-linux-x64-gnu": "1.6.13", + "@swc/core-linux-x64-musl": "1.6.13", + "@swc/core-win32-arm64-msvc": "1.6.13", + "@swc/core-win32-ia32-msvc": "1.6.13", + "@swc/core-win32-x64-msvc": "1.6.13" }, "peerDependencies": { "@swc/helpers": "*" @@ -362,9 +399,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.6.tgz", - "integrity": "sha512-5DA8NUGECcbcK1YLKJwNDKqdtTYDVnkfDU1WvQSXq/rU+bjYCLtn5gCe8/yzL7ISXA6rwqPU1RDejhbNt4ARLQ==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.13.tgz", + "integrity": "sha512-SOF4buAis72K22BGJ3N8y88mLNfxLNprTuJUpzikyMGrvkuBFNcxYtMhmomO0XHsgLDzOJ+hWzcgjRNzjMsUcQ==", "cpu": [ "arm64" ], @@ -378,9 +415,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.6.6.tgz", - "integrity": "sha512-2nbh/RHpweNRsJiYDFk1KcX7UtaKgzzTNUjwtvK5cp0wWrpbXmPvdlWOx3yzwoiSASDFx78242JHHXCIOlEdsw==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.6.13.tgz", + "integrity": "sha512-AW8akFSC+tmPE6YQQvK9S2A1B8pjnXEINg+gGgw0KRUUXunvu1/OEOeC5L2Co1wAwhD7bhnaefi06Qi9AiwOag==", "cpu": [ "x64" ], @@ -394,9 +431,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.6.6.tgz", - "integrity": "sha512-YgytuyUfR7b0z0SRHKV+ylr83HmgnROgeT7xryEkth6JGpAEHooCspQ4RrWTU8+WKJ7aXiZlGXPgybQ4TiS+TA==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.6.13.tgz", + "integrity": "sha512-f4gxxvDXVUm2HLYXRd311mSrmbpQF2MZ4Ja6XCQz1hWAxXdhRl1gpnZ+LH/xIfGSwQChrtLLVrkxdYUCVuIjFg==", "cpu": [ "arm" ], @@ -410,9 +447,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.6.6.tgz", - "integrity": "sha512-yGwx9fddzEE0iURqRVwKBQ4IwRHE6hNhl15WliHpi/PcYhzmYkUIpcbRXjr0dssubXAVPVnx6+jZVDSbutvnfg==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.6.13.tgz", + "integrity": "sha512-Nf/eoW2CbG8s+9JoLtjl9FByBXyQ5cjdBsA4efO7Zw4p+YSuXDgc8HRPC+E2+ns0praDpKNZtLvDtmF2lL+2Gg==", "cpu": [ "arm64" ], @@ -426,9 +463,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.6.6.tgz", - "integrity": "sha512-a6fMbqzSAsS5KCxFJyg1mD5kwN3ZFO8qQLyJ75R/htZP/eCt05jrhmOI7h2n+1HjiG332jLnZ9S8lkVE5O8Nqw==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.6.13.tgz", + "integrity": "sha512-2OysYSYtdw79prJYuKIiux/Gj0iaGEbpS2QZWCIY4X9sGoETJ5iMg+lY+YCrIxdkkNYd7OhIbXdYFyGs/w5LDg==", "cpu": [ "arm64" ], @@ -442,9 +479,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.6.6.tgz", - "integrity": "sha512-hRGsUKNzzZle28YF0dYIpN0bt9PceR9LaVBq7x8+l9TAaDLFbgksSxcnU/ubTtsy+WsYSYGn+A83w3xWC0O8CQ==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.6.13.tgz", + "integrity": "sha512-PkR4CZYJNk5hcd2+tMWBpnisnmYsUzazI1O5X7VkIGFcGePTqJ/bWlfUIVVExWxvAI33PQFzLbzmN5scyIUyGQ==", "cpu": [ "x64" ], @@ -458,9 +495,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.6.6.tgz", - "integrity": "sha512-NokIUtFxJDVv3LzGeEtYMTV3j2dnGKLac59luTeq36DQLZdJQawQIdTbzzWl2jE7lxxTZme+dhsVOH9LxE3ceg==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.6.13.tgz", + "integrity": "sha512-OdsY7wryTxCKwGQcwW9jwWg3cxaHBkTTHi91+5nm7hFPpmZMz1HivJrWAMwVE7iXFw+M4l6ugB/wCvpYrUAAjA==", "cpu": [ "x64" ], @@ -474,9 +511,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.6.6.tgz", - "integrity": "sha512-lzYdI4qb4k1dFG26yv+9Jaq/bUMAhgs/2JsrLncGjLof86+uj74wKYCQnbzKAsq2hDtS5DqnHnl+//J+miZfGA==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.6.13.tgz", + "integrity": "sha512-ap6uNmYjwk9M/+bFEuWRNl3hq4VqgQ/Lk+ID/F5WGqczNr0L7vEf+pOsRAn0F6EV+o/nyb3ePt8rLhE/wjHpPg==", "cpu": [ "arm64" ], @@ -490,9 +527,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.6.6.tgz", - "integrity": "sha512-bvl7FMaXIJQ76WZU0ER4+RyfKIMGb6S2MgRkBhJOOp0i7VFx4WLOnrmMzaeoPJaJSkityVKAftfNh7NBzTIydQ==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.6.13.tgz", + "integrity": "sha512-IJ8KH4yIUHTnS/U1jwQmtbfQals7zWPG0a9hbEfIr4zI0yKzjd83lmtS09lm2Q24QBWOCFGEEbuZxR4tIlvfzA==", "cpu": [ "ia32" ], @@ -506,9 +543,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.6.6.tgz", - "integrity": "sha512-WAP0JoCTfgeYKgOeYJoJV4ZS0sQUmU3OwvXa2dYYtMLF7zsNqOiW4niU7QlThBHgUv/qNZm2p6ITEgh3w1cltw==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.6.13.tgz", + "integrity": "sha512-f6/sx6LMuEnbuxtiSL/EkR0Y6qUHFw1XVrh6rwzKXptTipUdOY+nXpKoh+1UsBm/r7H0/5DtOdrn3q5ZHbFZjQ==", "cpu": [ "x64" ], @@ -566,6 +603,15 @@ "@types/responselike": "^1.0.0" } }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -582,9 +628,9 @@ } }, "node_modules/@types/node": { - "version": "20.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", - "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -605,6 +651,12 @@ "integrity": "sha512-sQNk65vbC36+UixCkcky+dCr7MlflHcVILg1FVGqlUntsLFv9xd9ToWIVko/gTuin+cVe16t+2YubEFkhnSuPQ==", "dev": true }, + "node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, "node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -1296,9 +1348,9 @@ } }, "node_modules/glob": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", - "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.3.tgz", + "integrity": "sha512-Q38SGlYRpVtDBPSWEylRyctn7uDeTp4NQERTLiCT1FqA9JXPYWqAVmQU6qh4r/zMM5ehxTcbaO8EjhWnvEhmyg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", @@ -1312,7 +1364,7 @@ "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1485,15 +1537,15 @@ "dev": true }, "node_modules/jackspeak": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", - "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.1.tgz", + "integrity": "sha512-U23pQPDnmYybVkYjObcuYMk43VRlMLLqLI+RdZy8s8WV8WsxO9SnqSroKaluuvcNOdCAlauKszDwd+umbot5Mg==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1797,18 +1849,18 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", - "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.1.tgz", + "integrity": "sha512-9/8QXrtbGeMB6LxwQd4x1tIMnsmUxMvIH/qWGsccz6bt9Uln3S+sgAaqfQNhbGA8ufzs2fHuP/yqapGgP9Hh2g==", "dev": true, "engines": { - "node": "14 || >=16.14" + "node": ">=18" } }, "node_modules/peek-readable": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", - "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.1.1.tgz", + "integrity": "sha512-4hEOSH7KeEaZpMDF/xfm1W9fS5rT7Ett3BkXWHqAEzRLLwLaHkwOL+GvvpIEh9UrvX9BDhzfkvteslgraoH69w==", "dev": true, "engines": { "node": ">=14.16" @@ -2067,12 +2119,13 @@ } }, "node_modules/shiki": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.10.0.tgz", - "integrity": "sha512-YD2sXQ+TMD/F9BimV9Jn0wj35pqOvywvOG/3PB6hGHyGKlM7TJ9tyJ02jOb2kF8F0HfJwKNYrh3sW7jEcuRlXA==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.10.3.tgz", + "integrity": "sha512-eneCLncGuvPdTutJuLyUGS8QNPAVFO5Trvld2wgEq1e002mwctAhJKeMGWtWVXOIEzmlcLRqcgPSorR6AVzOmQ==", "dev": true, "dependencies": { - "@shikijs/core": "1.10.0" + "@shikijs/core": "1.10.3", + "@types/hast": "^3.0.4" } }, "node_modules/signal-exit": { @@ -2259,13 +2312,13 @@ } }, "node_modules/strtok3": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", - "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.1.0.tgz", + "integrity": "sha512-19dQEwG6Jd+VabjPRyBhymIF069vZiqWSZa2jJBoKJTsqGKnTxowGoQaLnz+yLARfDI041IUQekyPUMWElOgsQ==", "dev": true, "dependencies": { "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.0.0" + "peek-readable": "^5.1.1" }, "engines": { "node": ">=14.16" @@ -2339,9 +2392,9 @@ } }, "node_modules/typescript": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", - "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/configure/package.json b/configure/package.json index 8ad75c4..135748e 100644 --- a/configure/package.json +++ b/configure/package.json @@ -3,11 +3,11 @@ "author": "Elliot Goodrich", "license": "MIT", "devDependencies": { - "@biomejs/biome": "1.4.0", - "@ninjutsu-build/biome": "^0.8.3", + "@biomejs/biome": "1.8.0", + "@ninjutsu-build/biome": "^0.9.0", "@ninjutsu-build/core": "^0.8.9", - "@ninjutsu-build/node": "^0.9.5", - "@ninjutsu-build/tsc": "^0.12.8", + "@ninjutsu-build/node": "^0.12.1", + "@ninjutsu-build/tsc": "^0.13.0", "@swc/cli": "^0.3.12", "@swc/core": "^1.4.17", "@types/node": "^20.12.7", diff --git a/package-lock.json b/package-lock.json index 4decfb1..cf3ab07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1999,7 +1999,7 @@ }, "packages/biome": { "name": "@ninjutsu-build/biome", - "version": "0.8.3", + "version": "0.9.0", "license": "MIT", "engines": { "node": ">=18.0.0" @@ -2011,7 +2011,7 @@ }, "packages/bun": { "name": "@ninjutsu-build/bun", - "version": "0.1.3", + "version": "0.2.0", "license": "MIT", "engines": { "node": ">=18.0.0" @@ -2022,7 +2022,7 @@ }, "packages/core": { "name": "@ninjutsu-build/core", - "version": "0.8.9", + "version": "0.8.10", "license": "MIT", "devDependencies": { "tsafe": "^1.6.6" @@ -2033,7 +2033,7 @@ }, "packages/esbuild": { "name": "@ninjutsu-build/esbuild", - "version": "0.1.1", + "version": "0.2.0", "license": "MIT", "engines": { "node": ">=18.0.0" @@ -2046,7 +2046,7 @@ }, "packages/node": { "name": "@ninjutsu-build/node", - "version": "0.11.0", + "version": "0.12.0", "license": "MIT", "engines": { "node": ">=18.18.0" @@ -2057,7 +2057,7 @@ }, "packages/tsc": { "name": "@ninjutsu-build/tsc", - "version": "0.12.4", + "version": "0.13.0", "license": "MIT", "dependencies": { "typescript": "^5.2.2" diff --git a/packages/biome/src/biome.ts b/packages/biome/src/biome.ts index 4935f74..f0a2758 100644 --- a/packages/biome/src/biome.ts +++ b/packages/biome/src/biome.ts @@ -9,7 +9,7 @@ import { orderOnlyDeps, } from "@ninjutsu-build/core"; import { join, relative, resolve } from "node:path"; -import { platform, arch } from "os"; +import { platform, arch } from "node:os"; const exe = platform() === "win32" ? ".exe" : ""; const prefix = platform() === "win32" ? "cmd /c " : ""; diff --git a/packages/esbuild/src/esbuild.ts b/packages/esbuild/src/esbuild.ts index 140856a..902f66a 100644 --- a/packages/esbuild/src/esbuild.ts +++ b/packages/esbuild/src/esbuild.ts @@ -7,7 +7,7 @@ import { validations, orderOnlyDeps, } from "@ninjutsu-build/core"; -import { type BuildOptions } from "esbuild"; +import type { BuildOptions } from "esbuild"; import { join, relative, resolve } from "node:path"; function serializeBuildOptions(args: Omit): string { diff --git a/packages/node/src/depfile.cts b/packages/node/src/depfile.cts index a0e58df..2be933c 100644 --- a/packages/node/src/depfile.cts +++ b/packages/node/src/depfile.cts @@ -2,9 +2,7 @@ import { openSync, writeFileSync } from "node:fs"; import { resolve, relative, isAbsolute } from "node:path"; declare global { - // biome-ignore lint/style/noVar: `let` require to type `global` in TypeScript var fd: number; - // biome-ignore lint/style/noVar: `let` require to type `global` in TypeScript var cwd: string | undefined; } diff --git a/packages/node/src/hookImport.mts b/packages/node/src/hookImport.mts index 2c2b620..5ba9bc3 100644 --- a/packages/node/src/hookImport.mts +++ b/packages/node/src/hookImport.mts @@ -1,6 +1,6 @@ import { fileURLToPath } from "node:url"; import { isBuiltin } from "node:module"; -import { type MessagePort } from "node:worker_threads"; +import type { MessagePort } from "node:worker_threads"; let port: MessagePort; diff --git a/packages/node/src/hookRequire.cts b/packages/node/src/hookRequire.cts index eb31f83..7a2a99d 100644 --- a/packages/node/src/hookRequire.cts +++ b/packages/node/src/hookRequire.cts @@ -1,4 +1,4 @@ -const Module: NodeRequire = require("module"); +const Module: NodeRequire = require("node:module"); import { addDependency } from "./depfile.cjs"; const r: RequireResolve = Module.prototype.require; diff --git a/packages/node/src/node.ts b/packages/node/src/node.ts index c6ee6f5..fcc65f2 100644 --- a/packages/node/src/node.ts +++ b/packages/node/src/node.ts @@ -7,7 +7,7 @@ import { validations, orderOnlyDeps, } from "@ninjutsu-build/core"; -import { platform } from "os"; +import { platform } from "node:os"; import { relative, resolve } from "node:path"; import { isAbsolute } from "node:path/posix"; diff --git a/packages/tsc/src/tsc.ts b/packages/tsc/src/tsc.ts index cce775e..e3e0433 100644 --- a/packages/tsc/src/tsc.ts +++ b/packages/tsc/src/tsc.ts @@ -15,7 +15,7 @@ import type { CompilerOptionsValue, } from "typescript"; import ts from "typescript"; -import { platform } from "os"; +import { platform } from "node:os"; import { relative, resolve } from "node:path"; import { dirname, join } from "node:path/posix"; import { readFile as readFileCb } from "node:fs";