From a2d0a2610e291b12498327e1635b8c8b831d95e2 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Mon, 13 Apr 2026 22:10:59 -0700 Subject: [PATCH 1/4] build: oxc.rs linting --- .husky/pre-commit | 1 + .oxfmtrc.json | 9 + .oxlintrc.json | 6 + .releaserc.json | 16 +- abi_registry.json | 42 +-- getNextTarget.js | 16 +- index.js | 211 ++++++------ package.json | 64 ++-- scripts/update-abi-registry.js | 161 +++++---- test/index.js | 286 ++++++++-------- yarn.lock | 581 +++++++++++++++++++++++++++++++++ 11 files changed, 1002 insertions(+), 391 deletions(-) create mode 100644 .husky/pre-commit create mode 100644 .oxfmtrc.json create mode 100644 .oxlintrc.json diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..3723623 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +yarn lint-staged diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..059e88f --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,9 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "trailingComma": "all", + "tabWidth": 2, + "singleQuote": true, + "printWidth": 100, + "sortPackageJson": false, + "ignorePatterns": ["*.md", "*.yml", "*.yaml"] +} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..1d845d7 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "categories": { + "correctness": "warn" + } +} diff --git a/.releaserc.json b/.releaserc.json index 21aaf38..1263871 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,9 +1,9 @@ { - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/npm", - "@semantic-release/github" - ], - "branches": [ "main" ] - } \ No newline at end of file + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + "@semantic-release/github" + ], + "branches": ["main"] +} diff --git a/abi_registry.json b/abi_registry.json index 1313343..f4740b1 100644 --- a/abi_registry.json +++ b/abi_registry.json @@ -9,10 +9,7 @@ { "runtime": "node", "target": "12.0.0", - "lts": [ - "2019-10-21", - "2020-11-30" - ], + "lts": ["2019-10-21", "2020-11-30"], "future": false, "abi": "72" }, @@ -26,10 +23,7 @@ { "runtime": "node", "target": "14.0.0", - "lts": [ - "2020-10-27", - "2021-10-19" - ], + "lts": ["2020-10-27", "2021-10-19"], "future": false, "abi": "83" }, @@ -43,10 +37,7 @@ { "runtime": "node", "target": "16.0.0", - "lts": [ - "2021-10-26", - "2022-10-18" - ], + "lts": ["2021-10-26", "2022-10-18"], "future": false, "abi": "93" }, @@ -60,10 +51,7 @@ { "runtime": "node", "target": "18.0.0", - "lts": [ - "2022-10-25", - "2023-10-18" - ], + "lts": ["2022-10-25", "2023-10-18"], "future": false, "abi": "108" }, @@ -77,10 +65,7 @@ { "runtime": "node", "target": "20.0.0", - "lts": [ - "2023-10-24", - "2024-10-22" - ], + "lts": ["2023-10-24", "2024-10-22"], "future": false, "abi": "115" }, @@ -94,10 +79,7 @@ { "runtime": "node", "target": "22.0.0", - "lts": [ - "2024-10-29", - "2025-10-21" - ], + "lts": ["2024-10-29", "2025-10-21"], "future": false, "abi": "127" }, @@ -111,10 +93,7 @@ { "runtime": "node", "target": "24.0.0", - "lts": [ - "2025-10-28", - "2026-10-20" - ], + "lts": ["2025-10-28", "2026-10-20"], "future": false, "abi": "137" }, @@ -128,10 +107,7 @@ { "runtime": "node", "target": "26.0.0", - "lts": [ - "2026-10-28", - "2027-10-20" - ], + "lts": ["2026-10-28", "2027-10-20"], "future": true, "abi": "144" }, @@ -436,4 +412,4 @@ "runtime": "electron", "target": "42.0.0-alpha.1" } -] \ No newline at end of file +] diff --git a/getNextTarget.js b/getNextTarget.js index f617fbd..deb1f29 100644 --- a/getNextTarget.js +++ b/getNextTarget.js @@ -1,13 +1,17 @@ import semver from 'semver'; -export function getNextTarget (runtime, targets) { - const latest = targets.filter((t) => { return t.runtime === runtime }).slice(-1)[0] - const increment = runtime === 'electron' ? 'minor' : 'major' - let next = semver.inc(latest.target, increment) +export function getNextTarget(runtime, targets) { + const latest = targets + .filter((t) => { + return t.runtime === runtime; + }) + .slice(-1)[0]; + const increment = runtime === 'electron' ? 'minor' : 'major'; + let next = semver.inc(latest.target, increment); // Electron releases appear in the registry in their beta form, sometimes there is // no active beta line. During this time we need to double bump if (runtime === 'electron' && semver.parse(latest.target).prerelease.length) { - next = semver.inc(next, 'major') + next = semver.inc(next, 'major'); } - return next + return next; } diff --git a/index.js b/index.js index 1aa9907..282bd5c 100644 --- a/index.js +++ b/index.js @@ -6,156 +6,171 @@ import semver from 'semver'; import { getNextTarget } from './getNextTarget.js'; -export function getAbi (target, runtime) { - if (target === String(Number(target))) return target - if (target) target = target.replace(/^v/, '') - if (!runtime) runtime = 'node' +export function getAbi(target, runtime) { + if (target === String(Number(target))) return target; + if (target) target = target.replace(/^v/, ''); + if (!runtime) runtime = 'node'; if (runtime === 'node') { - if (!target) return process.versions.modules - if (target === process.versions.node) return process.versions.modules + if (!target) return process.versions.modules; + if (target === process.versions.node) return process.versions.modules; } - let abi - let lastTarget + let abi; + let lastTarget; for (let i = 0; i < allTargets.length; i++) { - const t = allTargets[i] - if (t.runtime !== runtime) continue + const t = allTargets[i]; + if (t.runtime !== runtime) continue; if (semver.lte(t.target, target) && (!lastTarget || semver.gte(t.target, lastTarget))) { - abi = t.abi - lastTarget = t.target + abi = t.abi; + lastTarget = t.target; } } - if (abi && semver.lt(target, getNextTarget(runtime, allTargets))) return abi - throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime) + if (abi && semver.lt(target, getNextTarget(runtime, allTargets))) return abi; + throw new Error( + 'Could not detect abi for version ' + + target + + ' and runtime ' + + runtime + + '. Updating "node-abi" might help solve this issue if it is a new release of ' + + runtime, + ); } -export function getTarget (abi, runtime) { - if (abi && abi !== String(Number(abi))) return abi - if (!runtime) runtime = 'node' +export function getTarget(abi, runtime) { + if (abi && abi !== String(Number(abi))) return abi; + if (!runtime) runtime = 'node'; - if (runtime === 'node' && !abi) return process.versions.node + if (runtime === 'node' && !abi) return process.versions.node; const match = allTargets .filter(function (t) { - return t.abi === abi && t.runtime === runtime + return t.abi === abi && t.runtime === runtime; }) .map(function (t) { - return t.target - }) + return t.target; + }); if (match.length) { - const betaSeparatorIndex = match[0].indexOf("-") - return betaSeparatorIndex > -1 - ? match[0].substring(0, betaSeparatorIndex) - : match[0] + const betaSeparatorIndex = match[0].indexOf('-'); + return betaSeparatorIndex > -1 ? match[0].substring(0, betaSeparatorIndex) : match[0]; } - throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime) + throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime); } -function sortByTargetFn (a, b) { - const abiComp = Number(a.abi) - Number(b.abi) - if (abiComp !== 0) return abiComp - if (a.target < b.target) return -1 - if (a.target > b.target) return 1 - return 0 +function sortByTargetFn(a, b) { + const abiComp = Number(a.abi) - Number(b.abi); + if (abiComp !== 0) return abiComp; + if (a.target < b.target) return -1; + if (a.target > b.target) return 1; + return 0; } -function loadGeneratedTargets () { - const registry = JSON.parse(fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), 'abi_registry.json'), 'utf8')) +function loadGeneratedTargets() { + const registry = JSON.parse( + fs.readFileSync( + path.join(path.dirname(fileURLToPath(import.meta.url)), 'abi_registry.json'), + 'utf8', + ), + ); const targets = { supported: [], additional: [], - future: [] - } + future: [], + }; registry.forEach(function (item) { const target = { runtime: item.runtime, target: item.target, - abi: item.abi - } + abi: item.abi, + }; if (item.lts) { - const startDate = new Date(Date.parse(item.lts[0])) - const endDate = new Date(Date.parse(item.lts[1])) - const currentDate = new Date() - target.lts = startDate < currentDate && currentDate < endDate + const startDate = new Date(Date.parse(item.lts[0])); + const endDate = new Date(Date.parse(item.lts[1])); + const currentDate = new Date(); + target.lts = startDate < currentDate && currentDate < endDate; } else { - target.lts = false + target.lts = false; } if (target.runtime === 'node-webkit') { - targets.additional.push(target) + targets.additional.push(target); } else if (item.future) { - targets.future.push(target) + targets.future.push(target); } else { - targets.supported.push(target) + targets.supported.push(target); } - }) + }); - targets.supported.sort(sortByTargetFn) - targets.additional.sort(sortByTargetFn) - targets.future.sort(sortByTargetFn) + targets.supported.sort(sortByTargetFn); + targets.additional.sort(sortByTargetFn); + targets.future.sort(sortByTargetFn); - return targets + return targets; } -const generatedTargets = loadGeneratedTargets() +const generatedTargets = loadGeneratedTargets(); export const supportedTargets = [ - {runtime: 'node', target: '5.0.0', abi: '47', lts: false}, - {runtime: 'node', target: '6.0.0', abi: '48', lts: false}, - {runtime: 'node', target: '7.0.0', abi: '51', lts: false}, - {runtime: 'node', target: '8.0.0', abi: '57', lts: false}, - {runtime: 'node', target: '9.0.0', abi: '59', lts: false}, - {runtime: 'node', target: '10.0.0', abi: '64', lts: new Date(2018, 10, 1) < new Date() && new Date() < new Date(2020, 4, 31)}, - {runtime: 'electron', target: '0.36.0', abi: '47', lts: false}, - {runtime: 'electron', target: '1.1.0', abi: '48', lts: false}, - {runtime: 'electron', target: '1.3.0', abi: '49', lts: false}, - {runtime: 'electron', target: '1.4.0', abi: '50', lts: false}, - {runtime: 'electron', target: '1.5.0', abi: '51', lts: false}, - {runtime: 'electron', target: '1.6.0', abi: '53', lts: false}, - {runtime: 'electron', target: '1.7.0', abi: '54', lts: false}, - {runtime: 'electron', target: '1.8.0', abi: '57', lts: false}, - {runtime: 'electron', target: '2.0.0', abi: '57', lts: false}, - {runtime: 'electron', target: '3.0.0', abi: '64', lts: false}, - {runtime: 'electron', target: '4.0.0', abi: '64', lts: false}, - {runtime: 'electron', target: '4.0.4', abi: '69', lts: false}, - ...generatedTargets.supported -] + { runtime: 'node', target: '5.0.0', abi: '47', lts: false }, + { runtime: 'node', target: '6.0.0', abi: '48', lts: false }, + { runtime: 'node', target: '7.0.0', abi: '51', lts: false }, + { runtime: 'node', target: '8.0.0', abi: '57', lts: false }, + { runtime: 'node', target: '9.0.0', abi: '59', lts: false }, + { + runtime: 'node', + target: '10.0.0', + abi: '64', + lts: new Date(2018, 10, 1) < new Date() && new Date() < new Date(2020, 4, 31), + }, + { runtime: 'electron', target: '0.36.0', abi: '47', lts: false }, + { runtime: 'electron', target: '1.1.0', abi: '48', lts: false }, + { runtime: 'electron', target: '1.3.0', abi: '49', lts: false }, + { runtime: 'electron', target: '1.4.0', abi: '50', lts: false }, + { runtime: 'electron', target: '1.5.0', abi: '51', lts: false }, + { runtime: 'electron', target: '1.6.0', abi: '53', lts: false }, + { runtime: 'electron', target: '1.7.0', abi: '54', lts: false }, + { runtime: 'electron', target: '1.8.0', abi: '57', lts: false }, + { runtime: 'electron', target: '2.0.0', abi: '57', lts: false }, + { runtime: 'electron', target: '3.0.0', abi: '64', lts: false }, + { runtime: 'electron', target: '4.0.0', abi: '64', lts: false }, + { runtime: 'electron', target: '4.0.4', abi: '69', lts: false }, + ...generatedTargets.supported, +]; export const additionalTargets = [ - {runtime: 'node-webkit', target: '0.13.0', abi: '47', lts: false}, - {runtime: 'node-webkit', target: '0.15.0', abi: '48', lts: false}, - {runtime: 'node-webkit', target: '0.18.3', abi: '51', lts: false}, - {runtime: 'node-webkit', target: '0.23.0', abi: '57', lts: false}, - {runtime: 'node-webkit', target: '0.26.5', abi: '59', lts: false}, - ...generatedTargets.additional -] + { runtime: 'node-webkit', target: '0.13.0', abi: '47', lts: false }, + { runtime: 'node-webkit', target: '0.15.0', abi: '48', lts: false }, + { runtime: 'node-webkit', target: '0.18.3', abi: '51', lts: false }, + { runtime: 'node-webkit', target: '0.23.0', abi: '57', lts: false }, + { runtime: 'node-webkit', target: '0.26.5', abi: '59', lts: false }, + ...generatedTargets.additional, +]; export const deprecatedTargets = [ - {runtime: 'node', target: '0.2.0', abi: '1', lts: false}, - {runtime: 'node', target: '0.9.1', abi: '0x000A', lts: false}, - {runtime: 'node', target: '0.9.9', abi: '0x000B', lts: false}, - {runtime: 'node', target: '0.10.4', abi: '11', lts: false}, - {runtime: 'node', target: '0.11.0', abi: '0x000C', lts: false}, - {runtime: 'node', target: '0.11.8', abi: '13', lts: false}, - {runtime: 'node', target: '0.11.11', abi: '14', lts: false}, - {runtime: 'node', target: '1.0.0', abi: '42', lts: false}, - {runtime: 'node', target: '1.1.0', abi: '43', lts: false}, - {runtime: 'node', target: '2.0.0', abi: '44', lts: false}, - {runtime: 'node', target: '3.0.0', abi: '45', lts: false}, - {runtime: 'node', target: '4.0.0', abi: '46', lts: false}, - {runtime: 'electron', target: '0.30.0', abi: '44', lts: false}, - {runtime: 'electron', target: '0.31.0', abi: '45', lts: false}, - {runtime: 'electron', target: '0.33.0', abi: '46', lts: false} -] - -export const futureTargets = generatedTargets.future + { runtime: 'node', target: '0.2.0', abi: '1', lts: false }, + { runtime: 'node', target: '0.9.1', abi: '0x000A', lts: false }, + { runtime: 'node', target: '0.9.9', abi: '0x000B', lts: false }, + { runtime: 'node', target: '0.10.4', abi: '11', lts: false }, + { runtime: 'node', target: '0.11.0', abi: '0x000C', lts: false }, + { runtime: 'node', target: '0.11.8', abi: '13', lts: false }, + { runtime: 'node', target: '0.11.11', abi: '14', lts: false }, + { runtime: 'node', target: '1.0.0', abi: '42', lts: false }, + { runtime: 'node', target: '1.1.0', abi: '43', lts: false }, + { runtime: 'node', target: '2.0.0', abi: '44', lts: false }, + { runtime: 'node', target: '3.0.0', abi: '45', lts: false }, + { runtime: 'node', target: '4.0.0', abi: '46', lts: false }, + { runtime: 'electron', target: '0.30.0', abi: '44', lts: false }, + { runtime: 'electron', target: '0.31.0', abi: '45', lts: false }, + { runtime: 'electron', target: '0.33.0', abi: '46', lts: false }, +]; + +export const futureTargets = generatedTargets.future; export const allTargets = deprecatedTargets .concat(supportedTargets) .concat(additionalTargets) - .concat(futureTargets) + .concat(futureTargets); diff --git a/package.json b/package.json index 096b7f8..67f2331 100644 --- a/package.json +++ b/package.json @@ -2,42 +2,60 @@ "name": "node-abi", "version": "0.0.0-development", "description": "Get the Node ABI for a given target and runtime, and vice versa.", - "type": "module", - "exports": "./index.js", - "scripts": { - "test": "node --test test/index.js", - "update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js" - }, - "files": [ - "abi_registry.json", - "index.js", - "getNextTarget.js" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/electron/node-abi.git" - }, "keywords": [ - "node", + "abi", "electron", + "node", "node_module_version", - "abi", "v8" ], - "author": "Lukas Geiger", - "license": "MIT", + "homepage": "https://github.com/electron/node-abi#readme", "bugs": { "url": "https://github.com/electron/node-abi/issues" }, - "homepage": "https://github.com/electron/node-abi#readme", + "license": "MIT", + "author": "Lukas Geiger", + "repository": { + "type": "git", + "url": "git+https://github.com/electron/node-abi.git" + }, + "files": [ + "abi_registry.json", + "index.js", + "getNextTarget.js" + ], + "type": "module", + "exports": "./index.js", + "publishConfig": { + "provenance": true + }, + "scripts": { + "test": "node --test test/index.js", + "lint": "oxlint && oxfmt --check .", + "lint:fix": "oxlint --fix && oxfmt --write .", + "update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js", + "prepare": "husky" + }, "dependencies": { "semver": "^7.6.3" }, + "devDependencies": { + "husky": "^9.1.7", + "lint-staged": "^16.4.0", + "oxfmt": "^0", + "oxlint": "^0" + }, + "lint-staged": { + "*.{js,mjs,cjs}": [ + "oxfmt --check", + "oxlint" + ], + "*.{json,css,html}": [ + "oxfmt --check" + ] + }, "engines": { "node": ">=22.12.0" }, - "publishConfig": { - "provenance": true - }, "packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f" } diff --git a/scripts/update-abi-registry.js b/scripts/update-abi-registry.js index 9ad1c99..6f2c5b6 100644 --- a/scripts/update-abi-registry.js +++ b/scripts/update-abi-registry.js @@ -1,64 +1,64 @@ -import { writeFile } from 'node:fs/promises' -import path from 'node:path' +import { writeFile } from 'node:fs/promises'; +import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import semver from 'semver' +import semver from 'semver'; -function sortByElectronVersionFn (a, b) { - const modulesComp = Number(a.modules) - Number(b.modules) - if (modulesComp !== 0) return modulesComp - if (semver.lt(a.version, b.version)) return 1 - if (semver.gt(a.version, b.version)) return -1 - return 0 +function sortByElectronVersionFn(a, b) { + const modulesComp = Number(a.modules) - Number(b.modules); + if (modulesComp !== 0) return modulesComp; + if (semver.lt(a.version, b.version)) return 1; + if (semver.gt(a.version, b.version)) return -1; + return 0; } -function sortByNodeVersionFn (a, b) { - const abiComp = Number(a.abi) - Number(b.abi) - if (abiComp !== 0) return abiComp - if (semver.lt(a.target, b.target)) return 1 - if (semver.gt(a.target, b.target)) return -1 - return 0 +function sortByNodeVersionFn(a, b) { + const abiComp = Number(a.abi) - Number(b.abi); + if (abiComp !== 0) return abiComp; + if (semver.lt(a.target, b.target)) return 1; + if (semver.gt(a.target, b.target)) return -1; + return 0; } -async function getJSONFromCDN (urlPath) { - return fetch(`https://cdn.jsdelivr.net/gh/${urlPath}`).then((resp) => resp.json()) +async function getJSONFromCDN(urlPath) { + return fetch(`https://cdn.jsdelivr.net/gh/${urlPath}`).then((resp) => resp.json()); } -async function fetchElectronReleases () { - return fetch(`https://electronjs.org/headers/index.json`).then((resp) => resp.json()) +async function fetchElectronReleases() { + return fetch(`https://electronjs.org/headers/index.json`).then((resp) => resp.json()); } -async function fetchNodeVersions () { - const schedule = await getJSONFromCDN('nodejs/Release@main/schedule.json') - const versions = {} +async function fetchNodeVersions() { + const schedule = await getJSONFromCDN('nodejs/Release@main/schedule.json'); + const versions = {}; for (const [majorVersion, metadata] of Object.entries(schedule)) { if (majorVersion.startsWith('v0')) { - continue + continue; } - const version = `${majorVersion.slice(1)}.0.0` - const lts = metadata.hasOwnProperty('lts') ? [metadata.lts, metadata.maintenance] : false + const version = `${majorVersion.slice(1)}.0.0`; + const lts = metadata.hasOwnProperty('lts') ? [metadata.lts, metadata.maintenance] : false; versions[version] = { runtime: 'node', target: version, lts: lts, - future: new Date(Date.parse(metadata.start)) > new Date() - } + future: new Date(Date.parse(metadata.start)) > new Date(), + }; } - return versions + return versions; } -async function fetchAbiVersions () { - return (await getJSONFromCDN('nodejs/node@main/doc/abi_version_registry.json')) - .NODE_MODULE_VERSION - .filter(({ modules }) => modules > 66) +async function fetchAbiVersions() { + return ( + await getJSONFromCDN('nodejs/node@main/doc/abi_version_registry.json') + ).NODE_MODULE_VERSION.filter(({ modules }) => modules > 66); } -function electronReleasesToTargets (releases) { - const versions = releases.map(({ version }) => version) +function electronReleasesToTargets(releases) { + const versions = releases.map(({ version }) => version); const versionsByModules = releases - .filter(release => Number(release.modules) >= 70) + .filter((release) => Number(release.modules) >= 70) .map(({ version, modules }) => ({ version, modules, @@ -71,64 +71,53 @@ function electronReleasesToTargets (releases) { [`${version.split('.')[0]}-${modules}`]: { version, modules, - } + }, }), - {} - ) - - return Object.entries(versionsByModules) - .map( - ([major, {version, modules}]) => ({ - abi: modules, - future: !versions.find( - v => { - const major = version.split(".")[0] - return semver.satisfies( - v, - /^[0-9]/.test(major) ? `>= ${major}` : major - ) - } - ), - lts: false, - runtime: 'electron', - target: version - }) - ) + {}, + ); + + return Object.entries(versionsByModules).map(([_major, { version, modules }]) => ({ + abi: modules, + future: !versions.find((v) => { + const major = version.split('.')[0]; + return semver.satisfies(v, /^[0-9]/.test(major) ? `>= ${major}` : major); + }), + lts: false, + runtime: 'electron', + target: version, + })); } -function nodeVersionsToTargets (abiVersions, nodeVersions) { +function nodeVersionsToTargets(abiVersions, nodeVersions) { return Object.values( abiVersions .filter(({ runtime }) => runtime === 'node') - .reduce( - (acc, abiVersion) => { - const { version: nodeVersion } = semver.coerce(abiVersion.versions) - - return { - [nodeVersion]: { - ...nodeVersions[nodeVersion], - abi: abiVersion.modules.toString(), - }, - ...acc, - }; - }, - {} - ) - ).sort(sortByNodeVersionFn) + .reduce((acc, abiVersion) => { + const { version: nodeVersion } = semver.coerce(abiVersion.versions); + + return { + [nodeVersion]: { + ...nodeVersions[nodeVersion], + abi: abiVersion.modules.toString(), + }, + ...acc, + }; + }, {}), + ).sort(sortByNodeVersionFn); } -async function main () { - const nodeVersions = await fetchNodeVersions() - const abiVersions = await fetchAbiVersions() - const electronReleases = await fetchElectronReleases() - const electronTargets = electronReleasesToTargets(electronReleases) - const nodeTargets = nodeVersionsToTargets(abiVersions, nodeVersions) - const supportedTargets = [ - ...nodeTargets, - ...electronTargets, - ] - - await writeFile(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'abi_registry.json'), JSON.stringify(supportedTargets, null, 2)) +async function main() { + const nodeVersions = await fetchNodeVersions(); + const abiVersions = await fetchAbiVersions(); + const electronReleases = await fetchElectronReleases(); + const electronTargets = electronReleasesToTargets(electronReleases); + const nodeTargets = nodeVersionsToTargets(abiVersions, nodeVersions); + const supportedTargets = [...nodeTargets, ...electronTargets]; + + await writeFile( + path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'abi_registry.json'), + JSON.stringify(supportedTargets, null, 2), + ); } -main() +main(); diff --git a/test/index.js b/test/index.js index a2c1691..85c5752 100644 --- a/test/index.js +++ b/test/index.js @@ -1,156 +1,168 @@ -import assert from 'node:assert/strict' -import { it } from 'node:test' +import assert from 'node:assert/strict'; +import { it } from 'node:test'; -import { getAbi, getTarget } from '../index.js' -import { getNextTarget } from '../getNextTarget.js' +import { getAbi, getTarget } from '../index.js'; +import { getNextTarget } from '../getNextTarget.js'; it('getNextTarget gets the next unsupported target', () => { const mockTargets = [ - {runtime: 'node', target: '7.0.0', abi: '51', lts: false}, - {runtime: 'node', target: '8.0.0', abi: '57', lts: false}, - {runtime: 'electron', target: '0.36.0', abi: '47', lts: false}, - {runtime: 'electron', target: '1.1.0', abi: '48', lts: false} - ] - assert.strictEqual(getNextTarget('node', mockTargets), '9.0.0') - assert.strictEqual(getNextTarget('electron', mockTargets), '1.2.0') -}) + { runtime: 'node', target: '7.0.0', abi: '51', lts: false }, + { runtime: 'node', target: '8.0.0', abi: '57', lts: false }, + { runtime: 'electron', target: '0.36.0', abi: '47', lts: false }, + { runtime: 'electron', target: '1.1.0', abi: '48', lts: false }, + ]; + assert.strictEqual(getNextTarget('node', mockTargets), '9.0.0'); + assert.strictEqual(getNextTarget('electron', mockTargets), '1.2.0'); +}); it('getTarget calculates correct Node target', () => { - assert.strictEqual(getTarget(undefined), process.versions.node) - assert.strictEqual(getTarget(null), process.versions.node) - assert.strictEqual(getTarget('11'), '0.10.4') - assert.strictEqual(getTarget('14'), '0.11.11') - assert.strictEqual(getTarget('46'), '4.0.0') - assert.strictEqual(getTarget('47'), '5.0.0') - assert.strictEqual(getTarget('48'), '6.0.0') - assert.strictEqual(getTarget('51'), '7.0.0') - assert.strictEqual(getTarget('67'), '11.0.0') - assert.strictEqual(getTarget('72'), '12.0.0') - assert.strictEqual(getTarget('83'), '14.0.0') - assert.strictEqual(getTarget('88'), '15.0.0') -}) + assert.strictEqual(getTarget(undefined), process.versions.node); + assert.strictEqual(getTarget(null), process.versions.node); + assert.strictEqual(getTarget('11'), '0.10.4'); + assert.strictEqual(getTarget('14'), '0.11.11'); + assert.strictEqual(getTarget('46'), '4.0.0'); + assert.strictEqual(getTarget('47'), '5.0.0'); + assert.strictEqual(getTarget('48'), '6.0.0'); + assert.strictEqual(getTarget('51'), '7.0.0'); + assert.strictEqual(getTarget('67'), '11.0.0'); + assert.strictEqual(getTarget('72'), '12.0.0'); + assert.strictEqual(getTarget('83'), '14.0.0'); + assert.strictEqual(getTarget('88'), '15.0.0'); +}); it('getTarget calculates correct Electron target', () => { - assert.throws(getTarget.bind(null, '14', 'electron')) - assert.strictEqual(getTarget('47', 'electron'), '0.36.0') - assert.strictEqual(getTarget('48', 'electron'), '1.1.0') - assert.strictEqual(getTarget('49', 'electron'), '1.3.0') - assert.strictEqual(getTarget('50', 'electron'), '1.4.0') - assert.strictEqual(getTarget('76', 'electron'), '8.0.0') - assert.strictEqual(getTarget('82', 'electron'), '10.0.0') - assert.strictEqual(getTarget('89', 'electron'), '13.0.0') -}) + assert.throws(getTarget.bind(null, '14', 'electron')); + assert.strictEqual(getTarget('47', 'electron'), '0.36.0'); + assert.strictEqual(getTarget('48', 'electron'), '1.1.0'); + assert.strictEqual(getTarget('49', 'electron'), '1.3.0'); + assert.strictEqual(getTarget('50', 'electron'), '1.4.0'); + assert.strictEqual(getTarget('76', 'electron'), '8.0.0'); + assert.strictEqual(getTarget('82', 'electron'), '10.0.0'); + assert.strictEqual(getTarget('89', 'electron'), '13.0.0'); +}); it('getTarget calculates correct Node-Webkit target', () => { - assert.throws(getTarget.bind(null, '14', 'ode-webkit')) - assert.strictEqual(getTarget('47', 'node-webkit'), '0.13.0') - assert.strictEqual(getTarget('48', 'node-webkit'), '0.15.0') - assert.strictEqual(getTarget('51', 'node-webkit'), '0.18.3') - assert.strictEqual(getTarget('57', 'node-webkit'), '0.23.0') - assert.strictEqual(getTarget('59', 'node-webkit'), '0.26.5') -}) + assert.throws(getTarget.bind(null, '14', 'ode-webkit')); + assert.strictEqual(getTarget('47', 'node-webkit'), '0.13.0'); + assert.strictEqual(getTarget('48', 'node-webkit'), '0.15.0'); + assert.strictEqual(getTarget('51', 'node-webkit'), '0.18.3'); + assert.strictEqual(getTarget('57', 'node-webkit'), '0.23.0'); + assert.strictEqual(getTarget('59', 'node-webkit'), '0.26.5'); +}); it('getAbi calculates correct Node ABI', () => { - assert.strictEqual(getAbi(undefined), process.versions.modules) - assert.strictEqual(getAbi(null), process.versions.modules) - assert.throws(function () { getAbi('a.b.c') }) - assert.throws(function () { getAbi(getNextTarget('node')) }) - assert.strictEqual(getAbi('15.0.0'), '88') - assert.strictEqual(getAbi('14.0.0'), '83') - assert.strictEqual(getAbi('13.0.0'), '79') - assert.strictEqual(getAbi('12.0.0'), '72') - assert.strictEqual(getAbi('11.0.0'), '67') - assert.strictEqual(getAbi('7.2.0'), '51') - assert.strictEqual(getAbi('7.0.0'), '51') - assert.strictEqual(getAbi('6.9.9'), '48') - assert.strictEqual(getAbi('6.0.0'), '48') - assert.strictEqual(getAbi('5.9.9'), '47') - assert.strictEqual(getAbi('5.0.0'), '47') - assert.strictEqual(getAbi('4.9.9'), '46') - assert.strictEqual(getAbi('4.0.0'), '46') - assert.strictEqual(getAbi('0.12.17'), '14') - assert.strictEqual(getAbi('0.12.0'), '14') - assert.strictEqual(getAbi('0.11.16'), '14') - assert.strictEqual(getAbi('0.11.11'), '14') - assert.strictEqual(getAbi('0.11.10'), '13') - assert.strictEqual(getAbi('0.11.8'), '13') - assert.strictEqual(getAbi('0.11.7'), '0x000C') - assert.strictEqual(getAbi('0.11.0'), '0x000C') - assert.strictEqual(getAbi('0.10.48'), '11') - assert.strictEqual(getAbi('0.10.30'), '11') - assert.strictEqual(getAbi('0.10.4'), '11') - assert.strictEqual(getAbi('0.10.3'), '0x000B') - assert.strictEqual(getAbi('0.10.1'), '0x000B') - assert.strictEqual(getAbi('0.10.0'), '0x000B') - assert.strictEqual(getAbi('0.9.12'), '0x000B') - assert.strictEqual(getAbi('0.9.9'), '0x000B') - assert.strictEqual(getAbi('0.9.8'), '0x000A') - assert.strictEqual(getAbi('0.9.1'), '0x000A') - assert.strictEqual(getAbi('0.9.0'), '1') - assert.strictEqual(getAbi('0.8.0'), '1') - assert.strictEqual(getAbi('0.2.0'), '1') -}) + assert.strictEqual(getAbi(undefined), process.versions.modules); + assert.strictEqual(getAbi(null), process.versions.modules); + assert.throws(function () { + getAbi('a.b.c'); + }); + assert.throws(function () { + getAbi(getNextTarget('node')); + }); + assert.strictEqual(getAbi('15.0.0'), '88'); + assert.strictEqual(getAbi('14.0.0'), '83'); + assert.strictEqual(getAbi('13.0.0'), '79'); + assert.strictEqual(getAbi('12.0.0'), '72'); + assert.strictEqual(getAbi('11.0.0'), '67'); + assert.strictEqual(getAbi('7.2.0'), '51'); + assert.strictEqual(getAbi('7.0.0'), '51'); + assert.strictEqual(getAbi('6.9.9'), '48'); + assert.strictEqual(getAbi('6.0.0'), '48'); + assert.strictEqual(getAbi('5.9.9'), '47'); + assert.strictEqual(getAbi('5.0.0'), '47'); + assert.strictEqual(getAbi('4.9.9'), '46'); + assert.strictEqual(getAbi('4.0.0'), '46'); + assert.strictEqual(getAbi('0.12.17'), '14'); + assert.strictEqual(getAbi('0.12.0'), '14'); + assert.strictEqual(getAbi('0.11.16'), '14'); + assert.strictEqual(getAbi('0.11.11'), '14'); + assert.strictEqual(getAbi('0.11.10'), '13'); + assert.strictEqual(getAbi('0.11.8'), '13'); + assert.strictEqual(getAbi('0.11.7'), '0x000C'); + assert.strictEqual(getAbi('0.11.0'), '0x000C'); + assert.strictEqual(getAbi('0.10.48'), '11'); + assert.strictEqual(getAbi('0.10.30'), '11'); + assert.strictEqual(getAbi('0.10.4'), '11'); + assert.strictEqual(getAbi('0.10.3'), '0x000B'); + assert.strictEqual(getAbi('0.10.1'), '0x000B'); + assert.strictEqual(getAbi('0.10.0'), '0x000B'); + assert.strictEqual(getAbi('0.9.12'), '0x000B'); + assert.strictEqual(getAbi('0.9.9'), '0x000B'); + assert.strictEqual(getAbi('0.9.8'), '0x000A'); + assert.strictEqual(getAbi('0.9.1'), '0x000A'); + assert.strictEqual(getAbi('0.9.0'), '1'); + assert.strictEqual(getAbi('0.8.0'), '1'); + assert.strictEqual(getAbi('0.2.0'), '1'); +}); -it('getAbi calculates correct Electron ABI', function (t) { - assert.throws(function () { getAbi(undefined, 'electron') }) - assert.throws(function () { getAbi(getNextTarget('electron'), 'electron') }) - assert.strictEqual(getAbi('15.0.0-beta.1', 'electron'), '89') - assert.strictEqual(getAbi('14.1.1', 'electron'), '97') - assert.strictEqual(getAbi('14.0.0', 'electron'), '89') - assert.strictEqual(getAbi('13.0.0', 'electron'), '89') - assert.strictEqual(getAbi('12.0.0', 'electron'), '87') - assert.strictEqual(getAbi('11.0.0', 'electron'), '85') - assert.strictEqual(getAbi('10.0.0', 'electron'), '82') - assert.strictEqual(getAbi('9.0.0', 'electron'), '80') - assert.strictEqual(getAbi('8.0.0', 'electron'), '76') - assert.strictEqual(getAbi('7.0.0', 'electron'), '75') - assert.strictEqual(getAbi('6.0.0', 'electron'), '73') - assert.strictEqual(getAbi('5.0.0', 'electron'), '70') - assert.strictEqual(getAbi('4.1.4', 'electron'), '69') - assert.strictEqual(getAbi('4.0.4', 'electron'), '69') - assert.strictEqual(getAbi('4.0.3', 'electron'), '64') - assert.strictEqual(getAbi('3.1.8', 'electron'), '64') - assert.strictEqual(getAbi('2.0.18', 'electron'), '57') - assert.strictEqual(getAbi('1.4.0', 'electron'), '50') - assert.strictEqual(getAbi('1.3.0', 'electron'), '49') - assert.strictEqual(getAbi('1.2.0', 'electron'), '48') - assert.strictEqual(getAbi('1.1.0', 'electron'), '48') - assert.strictEqual(getAbi('1.0.0', 'electron'), '47') - assert.strictEqual(getAbi('0.37.0', 'electron'), '47') - assert.strictEqual(getAbi('0.36.0', 'electron'), '47') - assert.strictEqual(getAbi('0.35.0', 'electron'), '46') - assert.strictEqual(getAbi('0.34.0', 'electron'), '46') - assert.strictEqual(getAbi('0.33.0', 'electron'), '46') - assert.strictEqual(getAbi('0.32.0', 'electron'), '45') - assert.strictEqual(getAbi('0.31.0', 'electron'), '45') - assert.strictEqual(getAbi('0.30.0', 'electron'), '44') -}) +it('getAbi calculates correct Electron ABI', function (_t) { + assert.throws(function () { + getAbi(undefined, 'electron'); + }); + assert.throws(function () { + getAbi(getNextTarget('electron'), 'electron'); + }); + assert.strictEqual(getAbi('15.0.0-beta.1', 'electron'), '89'); + assert.strictEqual(getAbi('14.1.1', 'electron'), '97'); + assert.strictEqual(getAbi('14.0.0', 'electron'), '89'); + assert.strictEqual(getAbi('13.0.0', 'electron'), '89'); + assert.strictEqual(getAbi('12.0.0', 'electron'), '87'); + assert.strictEqual(getAbi('11.0.0', 'electron'), '85'); + assert.strictEqual(getAbi('10.0.0', 'electron'), '82'); + assert.strictEqual(getAbi('9.0.0', 'electron'), '80'); + assert.strictEqual(getAbi('8.0.0', 'electron'), '76'); + assert.strictEqual(getAbi('7.0.0', 'electron'), '75'); + assert.strictEqual(getAbi('6.0.0', 'electron'), '73'); + assert.strictEqual(getAbi('5.0.0', 'electron'), '70'); + assert.strictEqual(getAbi('4.1.4', 'electron'), '69'); + assert.strictEqual(getAbi('4.0.4', 'electron'), '69'); + assert.strictEqual(getAbi('4.0.3', 'electron'), '64'); + assert.strictEqual(getAbi('3.1.8', 'electron'), '64'); + assert.strictEqual(getAbi('2.0.18', 'electron'), '57'); + assert.strictEqual(getAbi('1.4.0', 'electron'), '50'); + assert.strictEqual(getAbi('1.3.0', 'electron'), '49'); + assert.strictEqual(getAbi('1.2.0', 'electron'), '48'); + assert.strictEqual(getAbi('1.1.0', 'electron'), '48'); + assert.strictEqual(getAbi('1.0.0', 'electron'), '47'); + assert.strictEqual(getAbi('0.37.0', 'electron'), '47'); + assert.strictEqual(getAbi('0.36.0', 'electron'), '47'); + assert.strictEqual(getAbi('0.35.0', 'electron'), '46'); + assert.strictEqual(getAbi('0.34.0', 'electron'), '46'); + assert.strictEqual(getAbi('0.33.0', 'electron'), '46'); + assert.strictEqual(getAbi('0.32.0', 'electron'), '45'); + assert.strictEqual(getAbi('0.31.0', 'electron'), '45'); + assert.strictEqual(getAbi('0.30.0', 'electron'), '44'); +}); it('getAbi calculates correct Node-Webkit ABI', () => { - assert.throws(function () { getAbi(undefined, 'node-webkit') }) - assert.throws(function () { getAbi(getNextTarget('node-webkit'), 'node-webkit') }) - assert.strictEqual(getAbi('0.13.0', 'node-webkit'), '47') - assert.strictEqual(getAbi('0.14.0', 'node-webkit'), '47') - assert.strictEqual(getAbi('0.15.0', 'node-webkit'), '48') - assert.strictEqual(getAbi('0.16.0', 'node-webkit'), '48') - assert.strictEqual(getAbi('0.17.0', 'node-webkit'), '48') - assert.strictEqual(getAbi('0.18.2', 'node-webkit'), '48') - assert.strictEqual(getAbi('0.18.3', 'node-webkit'), '51') - assert.strictEqual(getAbi('0.19.0', 'node-webkit'), '51') - assert.strictEqual(getAbi('0.20.0', 'node-webkit'), '51') - assert.strictEqual(getAbi('0.21.0', 'node-webkit'), '51') - assert.strictEqual(getAbi('0.22.0', 'node-webkit'), '51') - assert.strictEqual(getAbi('0.23.0', 'node-webkit'), '57') - assert.strictEqual(getAbi('0.24.0', 'node-webkit'), '57') - assert.strictEqual(getAbi('0.25.0', 'node-webkit'), '57') - assert.strictEqual(getAbi('0.26.4', 'node-webkit'), '57') - assert.strictEqual(getAbi('0.26.5', 'node-webkit'), '59') -}) + assert.throws(function () { + getAbi(undefined, 'node-webkit'); + }); + assert.throws(function () { + getAbi(getNextTarget('node-webkit'), 'node-webkit'); + }); + assert.strictEqual(getAbi('0.13.0', 'node-webkit'), '47'); + assert.strictEqual(getAbi('0.14.0', 'node-webkit'), '47'); + assert.strictEqual(getAbi('0.15.0', 'node-webkit'), '48'); + assert.strictEqual(getAbi('0.16.0', 'node-webkit'), '48'); + assert.strictEqual(getAbi('0.17.0', 'node-webkit'), '48'); + assert.strictEqual(getAbi('0.18.2', 'node-webkit'), '48'); + assert.strictEqual(getAbi('0.18.3', 'node-webkit'), '51'); + assert.strictEqual(getAbi('0.19.0', 'node-webkit'), '51'); + assert.strictEqual(getAbi('0.20.0', 'node-webkit'), '51'); + assert.strictEqual(getAbi('0.21.0', 'node-webkit'), '51'); + assert.strictEqual(getAbi('0.22.0', 'node-webkit'), '51'); + assert.strictEqual(getAbi('0.23.0', 'node-webkit'), '57'); + assert.strictEqual(getAbi('0.24.0', 'node-webkit'), '57'); + assert.strictEqual(getAbi('0.25.0', 'node-webkit'), '57'); + assert.strictEqual(getAbi('0.26.4', 'node-webkit'), '57'); + assert.strictEqual(getAbi('0.26.5', 'node-webkit'), '59'); +}); it('getAbi supports leading v', () => { - assert.strictEqual(getAbi('v7.2.0'), '51') -}) + assert.strictEqual(getAbi('v7.2.0'), '51'); +}); it('getAbi returns abi if passed as target', () => { - assert.strictEqual(getAbi('57'), '57') -}) + assert.strictEqual(getAbi('57'), '57'); +}); diff --git a/yarn.lock b/yarn.lock index 485398d..3dd53c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,14 +5,497 @@ __metadata: version: 8 cacheKey: 10c0 +"@oxfmt/binding-android-arm-eabi@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-android-arm-eabi@npm:0.43.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-android-arm64@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-android-arm64@npm:0.43.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-arm64@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-darwin-arm64@npm:0.43.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-x64@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-darwin-x64@npm:0.43.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-freebsd-x64@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-freebsd-x64@npm:0.43.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-gnueabihf@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-arm-gnueabihf@npm:0.43.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-musleabihf@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-arm-musleabihf@npm:0.43.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-gnu@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-arm64-gnu@npm:0.43.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-musl@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-arm64-musl@npm:0.43.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-ppc64-gnu@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-ppc64-gnu@npm:0.43.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-gnu@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-riscv64-gnu@npm:0.43.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-musl@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-riscv64-musl@npm:0.43.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-s390x-gnu@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-s390x-gnu@npm:0.43.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-gnu@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-x64-gnu@npm:0.43.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-musl@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-linux-x64-musl@npm:0.43.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-openharmony-arm64@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-openharmony-arm64@npm:0.43.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-arm64-msvc@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-win32-arm64-msvc@npm:0.43.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-ia32-msvc@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-win32-ia32-msvc@npm:0.43.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-x64-msvc@npm:0.43.0": + version: 0.43.0 + resolution: "@oxfmt/binding-win32-x64-msvc@npm:0.43.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@oxlint/darwin-arm64@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/darwin-arm64@npm:0.18.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/darwin-x64@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/darwin-x64@npm:0.18.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxlint/linux-arm64-gnu@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/linux-arm64-gnu@npm:0.18.1" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/linux-arm64-musl@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/linux-arm64-musl@npm:0.18.1" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxlint/linux-x64-gnu@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/linux-x64-gnu@npm:0.18.1" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/linux-x64-musl@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/linux-x64-musl@npm:0.18.1" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxlint/win32-arm64@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/win32-arm64@npm:0.18.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/win32-x64@npm:0.18.1": + version: 0.18.1 + resolution: "@oxlint/win32-x64@npm:0.18.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"ansi-escapes@npm:^7.0.0": + version: 7.3.0 + resolution: "ansi-escapes@npm:7.3.0" + dependencies: + environment: "npm:^1.0.0" + checksum: 10c0/068961d99f0ef28b661a4a9f84a5d645df93ccf3b9b93816cc7d46bbe1913321d4cdf156bb842a4e1e4583b7375c631fa963efb43001c4eb7ff9ab8f78fc0679 + languageName: node + linkType: hard + +"ansi-regex@npm:^6.2.2": + version: 6.2.2 + resolution: "ansi-regex@npm:6.2.2" + checksum: 10c0/05d4acb1d2f59ab2cf4b794339c7b168890d44dda4bf0ce01152a8da0213aca207802f930442ce8cd22d7a92f44907664aac6508904e75e038fa944d2601b30f + languageName: node + linkType: hard + +"ansi-styles@npm:^6.2.1, ansi-styles@npm:^6.2.3": + version: 6.2.3 + resolution: "ansi-styles@npm:6.2.3" + checksum: 10c0/23b8a4ce14e18fb854693b95351e286b771d23d8844057ed2e7d083cd3e708376c3323707ec6a24365f7d7eda3ca00327fe04092e29e551499ec4c8b7bfac868 + languageName: node + linkType: hard + +"cli-cursor@npm:^5.0.0": + version: 5.0.0 + resolution: "cli-cursor@npm:5.0.0" + dependencies: + restore-cursor: "npm:^5.0.0" + checksum: 10c0/7ec62f69b79f6734ab209a3e4dbdc8af7422d44d360a7cb1efa8a0887bbe466a6e625650c466fe4359aee44dbe2dc0b6994b583d40a05d0808a5cb193641d220 + languageName: node + linkType: hard + +"cli-truncate@npm:^5.0.0": + version: 5.2.0 + resolution: "cli-truncate@npm:5.2.0" + dependencies: + slice-ansi: "npm:^8.0.0" + string-width: "npm:^8.2.0" + checksum: 10c0/0d4ec94702ca85b64522ac93633837fb5ea7db17b79b1322a60f6045e6ae2b8cd7bd4c1d19ac7d1f9e10e3bbda1112e172e439b68c02b785ee00da8d6a5c5471 + languageName: node + linkType: hard + +"colorette@npm:^2.0.20": + version: 2.0.20 + resolution: "colorette@npm:2.0.20" + checksum: 10c0/e94116ff33b0ff56f3b83b9ace895e5bf87c2a7a47b3401b8c3f3226e050d5ef76cf4072fb3325f9dc24d1698f9b730baf4e05eeaf861d74a1883073f4c98a40 + languageName: node + linkType: hard + +"commander@npm:^14.0.3": + version: 14.0.3 + resolution: "commander@npm:14.0.3" + checksum: 10c0/755652564bbf56ff2ff083313912b326450d3f8d8c85f4b71416539c9a05c3c67dbd206821ca72635bf6b160e2afdefcb458e86b317827d5cb333b69ce7f1a24 + languageName: node + linkType: hard + +"emoji-regex@npm:^10.3.0": + version: 10.6.0 + resolution: "emoji-regex@npm:10.6.0" + checksum: 10c0/1e4aa097bb007301c3b4b1913879ae27327fdc48e93eeefefe3b87e495eb33c5af155300be951b4349ff6ac084f4403dc9eff970acba7c1c572d89396a9a32d7 + languageName: node + linkType: hard + +"environment@npm:^1.0.0": + version: 1.1.0 + resolution: "environment@npm:1.1.0" + checksum: 10c0/fb26434b0b581ab397039e51ff3c92b34924a98b2039dcb47e41b7bca577b9dbf134a8eadb364415c74464b682e2d3afe1a4c0eb9873dc44ea814c5d3103331d + languageName: node + linkType: hard + +"eventemitter3@npm:^5.0.1": + version: 5.0.4 + resolution: "eventemitter3@npm:5.0.4" + checksum: 10c0/575b8cac8d709e1473da46f8f15ef311b57ff7609445a7c71af5cd42598583eee6f098fa7a593e30f27e94b8865642baa0689e8fa97c016f742abdb3b1bf6d9a + languageName: node + linkType: hard + +"get-east-asian-width@npm:^1.0.0, get-east-asian-width@npm:^1.3.1, get-east-asian-width@npm:^1.5.0": + version: 1.5.0 + resolution: "get-east-asian-width@npm:1.5.0" + checksum: 10c0/bff8bbc8d81790b9477f7aa55b1806b9f082a8dc1359fff7bd8b96939622c86b729685afc2bfeb22def1fc6ef1e5228e4d87dd4e6da60bc43a5edfb03c4ee167 + languageName: node + linkType: hard + +"husky@npm:^9.1.7": + version: 9.1.7 + resolution: "husky@npm:9.1.7" + bin: + husky: bin.js + checksum: 10c0/35bb110a71086c48906aa7cd3ed4913fb913823715359d65e32e0b964cb1e255593b0ae8014a5005c66a68e6fa66c38dcfa8056dbbdfb8b0187c0ffe7ee3a58f + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^5.0.0, is-fullwidth-code-point@npm:^5.1.0": + version: 5.1.0 + resolution: "is-fullwidth-code-point@npm:5.1.0" + dependencies: + get-east-asian-width: "npm:^1.3.1" + checksum: 10c0/c1172c2e417fb73470c56c431851681591f6a17233603a9e6f94b7ba870b2e8a5266506490573b607fb1081318589372034aa436aec07b465c2029c0bc7f07a4 + languageName: node + linkType: hard + +"lint-staged@npm:^16.4.0": + version: 16.4.0 + resolution: "lint-staged@npm:16.4.0" + dependencies: + commander: "npm:^14.0.3" + listr2: "npm:^9.0.5" + picomatch: "npm:^4.0.3" + string-argv: "npm:^0.3.2" + tinyexec: "npm:^1.0.4" + yaml: "npm:^2.8.2" + bin: + lint-staged: bin/lint-staged.js + checksum: 10c0/67625a49a2a01368c7df2da7e553567a79c4b261d9faf3436e00fc3a2f9c4bbe7295909012c47b3d9029e269fd7d7469901a5120573527a032f15797aa497c26 + languageName: node + linkType: hard + +"listr2@npm:^9.0.5": + version: 9.0.5 + resolution: "listr2@npm:9.0.5" + dependencies: + cli-truncate: "npm:^5.0.0" + colorette: "npm:^2.0.20" + eventemitter3: "npm:^5.0.1" + log-update: "npm:^6.1.0" + rfdc: "npm:^1.4.1" + wrap-ansi: "npm:^9.0.0" + checksum: 10c0/46448d1ba0addc9d71aeafd05bb8e86ded9641ccad930ac302c2bd2ad71580375604743e18586fcb8f11906edf98e8e17fca75ba0759947bf275d381f68e311d + languageName: node + linkType: hard + +"log-update@npm:^6.1.0": + version: 6.1.0 + resolution: "log-update@npm:6.1.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + cli-cursor: "npm:^5.0.0" + slice-ansi: "npm:^7.1.0" + strip-ansi: "npm:^7.1.0" + wrap-ansi: "npm:^9.0.0" + checksum: 10c0/4b350c0a83d7753fea34dcac6cd797d1dc9603291565de009baa4aa91c0447eab0d3815a05c8ec9ac04fdfffb43c82adcdb03ec1fceafd8518e1a8c1cff4ff89 + languageName: node + linkType: hard + +"mimic-function@npm:^5.0.0": + version: 5.0.1 + resolution: "mimic-function@npm:5.0.1" + checksum: 10c0/f3d9464dd1816ecf6bdf2aec6ba32c0728022039d992f178237d8e289b48764fee4131319e72eedd4f7f094e22ded0af836c3187a7edc4595d28dd74368fd81d + languageName: node + linkType: hard + "node-abi@workspace:.": version: 0.0.0-use.local resolution: "node-abi@workspace:." dependencies: + husky: "npm:^9.1.7" + lint-staged: "npm:^16.4.0" + oxfmt: "npm:^0" + oxlint: "npm:^0" semver: "npm:^7.6.3" languageName: unknown linkType: soft +"onetime@npm:^7.0.0": + version: 7.0.0 + resolution: "onetime@npm:7.0.0" + dependencies: + mimic-function: "npm:^5.0.0" + checksum: 10c0/5cb9179d74b63f52a196a2e7037ba2b9a893245a5532d3f44360012005c9cadb60851d56716ebff18a6f47129dab7168022445df47c2aff3b276d92585ed1221 + languageName: node + linkType: hard + +"oxfmt@npm:^0": + version: 0.43.0 + resolution: "oxfmt@npm:0.43.0" + dependencies: + "@oxfmt/binding-android-arm-eabi": "npm:0.43.0" + "@oxfmt/binding-android-arm64": "npm:0.43.0" + "@oxfmt/binding-darwin-arm64": "npm:0.43.0" + "@oxfmt/binding-darwin-x64": "npm:0.43.0" + "@oxfmt/binding-freebsd-x64": "npm:0.43.0" + "@oxfmt/binding-linux-arm-gnueabihf": "npm:0.43.0" + "@oxfmt/binding-linux-arm-musleabihf": "npm:0.43.0" + "@oxfmt/binding-linux-arm64-gnu": "npm:0.43.0" + "@oxfmt/binding-linux-arm64-musl": "npm:0.43.0" + "@oxfmt/binding-linux-ppc64-gnu": "npm:0.43.0" + "@oxfmt/binding-linux-riscv64-gnu": "npm:0.43.0" + "@oxfmt/binding-linux-riscv64-musl": "npm:0.43.0" + "@oxfmt/binding-linux-s390x-gnu": "npm:0.43.0" + "@oxfmt/binding-linux-x64-gnu": "npm:0.43.0" + "@oxfmt/binding-linux-x64-musl": "npm:0.43.0" + "@oxfmt/binding-openharmony-arm64": "npm:0.43.0" + "@oxfmt/binding-win32-arm64-msvc": "npm:0.43.0" + "@oxfmt/binding-win32-ia32-msvc": "npm:0.43.0" + "@oxfmt/binding-win32-x64-msvc": "npm:0.43.0" + tinypool: "npm:2.1.0" + dependenciesMeta: + "@oxfmt/binding-android-arm-eabi": + optional: true + "@oxfmt/binding-android-arm64": + optional: true + "@oxfmt/binding-darwin-arm64": + optional: true + "@oxfmt/binding-darwin-x64": + optional: true + "@oxfmt/binding-freebsd-x64": + optional: true + "@oxfmt/binding-linux-arm-gnueabihf": + optional: true + "@oxfmt/binding-linux-arm-musleabihf": + optional: true + "@oxfmt/binding-linux-arm64-gnu": + optional: true + "@oxfmt/binding-linux-arm64-musl": + optional: true + "@oxfmt/binding-linux-ppc64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-musl": + optional: true + "@oxfmt/binding-linux-s390x-gnu": + optional: true + "@oxfmt/binding-linux-x64-gnu": + optional: true + "@oxfmt/binding-linux-x64-musl": + optional: true + "@oxfmt/binding-openharmony-arm64": + optional: true + "@oxfmt/binding-win32-arm64-msvc": + optional: true + "@oxfmt/binding-win32-ia32-msvc": + optional: true + "@oxfmt/binding-win32-x64-msvc": + optional: true + bin: + oxfmt: bin/oxfmt + checksum: 10c0/f78c05c2f834fb6ea1d5a421c964d2211bc519dc260b80ed846b078cd404b7f6ba71d0f34be83064bd4bacfbd2e451a974f11d31713bbead39495d9d8234bae5 + languageName: node + linkType: hard + +"oxlint@npm:^0": + version: 0.18.1 + resolution: "oxlint@npm:0.18.1" + dependencies: + "@oxlint/darwin-arm64": "npm:0.18.1" + "@oxlint/darwin-x64": "npm:0.18.1" + "@oxlint/linux-arm64-gnu": "npm:0.18.1" + "@oxlint/linux-arm64-musl": "npm:0.18.1" + "@oxlint/linux-x64-gnu": "npm:0.18.1" + "@oxlint/linux-x64-musl": "npm:0.18.1" + "@oxlint/win32-arm64": "npm:0.18.1" + "@oxlint/win32-x64": "npm:0.18.1" + dependenciesMeta: + "@oxlint/darwin-arm64": + optional: true + "@oxlint/darwin-x64": + optional: true + "@oxlint/linux-arm64-gnu": + optional: true + "@oxlint/linux-arm64-musl": + optional: true + "@oxlint/linux-x64-gnu": + optional: true + "@oxlint/linux-x64-musl": + optional: true + "@oxlint/win32-arm64": + optional: true + "@oxlint/win32-x64": + optional: true + bin: + oxc_language_server: bin/oxc_language_server + oxlint: bin/oxlint + checksum: 10c0/14f2a8255551ad02821ed5195fe089fec5ba817bdca93337a1a9dd177875183a80d5e245a045717d02cf2f1042451786c69374b154525c0310ada4f307882ebf + languageName: node + linkType: hard + +"picomatch@npm:^4.0.3": + version: 4.0.4 + resolution: "picomatch@npm:4.0.4" + checksum: 10c0/e2c6023372cc7b5764719a5ffb9da0f8e781212fa7ca4bd0562db929df8e117460f00dff3cb7509dacfc06b86de924b247f504d0ce1806a37fac4633081466b0 + languageName: node + linkType: hard + +"restore-cursor@npm:^5.0.0": + version: 5.1.0 + resolution: "restore-cursor@npm:5.1.0" + dependencies: + onetime: "npm:^7.0.0" + signal-exit: "npm:^4.1.0" + checksum: 10c0/c2ba89131eea791d1b25205bdfdc86699767e2b88dee2a590b1a6caa51737deac8bad0260a5ded2f7c074b7db2f3a626bcf1fcf3cdf35974cbeea5e2e6764f60 + languageName: node + linkType: hard + +"rfdc@npm:^1.4.1": + version: 1.4.1 + resolution: "rfdc@npm:1.4.1" + checksum: 10c0/4614e4292356cafade0b6031527eea9bc90f2372a22c012313be1dcc69a3b90c7338158b414539be863fa95bfcb2ddcd0587be696841af4e6679d85e62c060c7 + languageName: node + linkType: hard + "semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" @@ -21,3 +504,101 @@ __metadata: checksum: 10c0/88f33e148b210c153873cb08cfe1e281d518aaa9a666d4d148add6560db5cd3c582f3a08ccb91f38d5f379ead256da9931234ed122057f40bb5766e65e58adaf languageName: node linkType: hard + +"signal-exit@npm:^4.1.0": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 10c0/41602dce540e46d599edba9d9860193398d135f7ff72cab629db5171516cfae628d21e7bfccde1bbfdf11c48726bc2a6d1a8fb8701125852fbfda7cf19c6aa83 + languageName: node + linkType: hard + +"slice-ansi@npm:^7.1.0": + version: 7.1.2 + resolution: "slice-ansi@npm:7.1.2" + dependencies: + ansi-styles: "npm:^6.2.1" + is-fullwidth-code-point: "npm:^5.0.0" + checksum: 10c0/36742f2eb0c03e2e81a38ed14d13a64f7b732fe38c3faf96cce0599788a345011e840db35f1430ca606ea3f8db2abeb92a8d25c2753a819e3babaa10c2e289a2 + languageName: node + linkType: hard + +"slice-ansi@npm:^8.0.0": + version: 8.0.0 + resolution: "slice-ansi@npm:8.0.0" + dependencies: + ansi-styles: "npm:^6.2.3" + is-fullwidth-code-point: "npm:^5.1.0" + checksum: 10c0/0ce4aa91febb7cea4a00c2c27bb820fa53b6d2862ce0f80f7120134719f7914fc416b0ed966cf35250a3169e152916392f35917a2d7cad0fcc5d8b841010fa9a + languageName: node + linkType: hard + +"string-argv@npm:^0.3.2": + version: 0.3.2 + resolution: "string-argv@npm:0.3.2" + checksum: 10c0/75c02a83759ad1722e040b86823909d9a2fc75d15dd71ec4b537c3560746e33b5f5a07f7332d1e3f88319909f82190843aa2f0a0d8c8d591ec08e93d5b8dec82 + languageName: node + linkType: hard + +"string-width@npm:^7.0.0": + version: 7.2.0 + resolution: "string-width@npm:7.2.0" + dependencies: + emoji-regex: "npm:^10.3.0" + get-east-asian-width: "npm:^1.0.0" + strip-ansi: "npm:^7.1.0" + checksum: 10c0/eb0430dd43f3199c7a46dcbf7a0b34539c76fe3aa62763d0b0655acdcbdf360b3f66f3d58ca25ba0205f42ea3491fa00f09426d3b7d3040e506878fc7664c9b9 + languageName: node + linkType: hard + +"string-width@npm:^8.2.0": + version: 8.2.0 + resolution: "string-width@npm:8.2.0" + dependencies: + get-east-asian-width: "npm:^1.5.0" + strip-ansi: "npm:^7.1.2" + checksum: 10c0/d8915428b43519b0f494da6590dbe4491857d8a12e40250e50fc01fbb616ffd8400a436bbe25712255ee129511fe0414c49d3b6b9627e2bc3a33dcec1d2eda02 + languageName: node + linkType: hard + +"strip-ansi@npm:^7.1.0, strip-ansi@npm:^7.1.2": + version: 7.2.0 + resolution: "strip-ansi@npm:7.2.0" + dependencies: + ansi-regex: "npm:^6.2.2" + checksum: 10c0/544d13b7582f8254811ea97db202f519e189e59d35740c46095897e254e4f1aa9fe1524a83ad6bc5ad67d4dd6c0281d2e0219ed62b880a6238a16a17d375f221 + languageName: node + linkType: hard + +"tinyexec@npm:^1.0.4": + version: 1.0.4 + resolution: "tinyexec@npm:1.0.4" + checksum: 10c0/d4a5bbcf6bdb23527a4b74c4aa566f41432167112fe76f420ec7e3a90a3ecfd3a7d944383e2719fc3987b69400f7b928daf08700d145fb527c2e80ec01e198bd + languageName: node + linkType: hard + +"tinypool@npm:2.1.0": + version: 2.1.0 + resolution: "tinypool@npm:2.1.0" + checksum: 10c0/9fb1c760558c6264e0f4cfde96a63b12450b43f1730fbe6274aa24ddbdf488745c08924d0dea7a1303b47d555416a6415f2113898c69b6ecf731e75ac95238a5 + languageName: node + linkType: hard + +"wrap-ansi@npm:^9.0.0": + version: 9.0.2 + resolution: "wrap-ansi@npm:9.0.2" + dependencies: + ansi-styles: "npm:^6.2.1" + string-width: "npm:^7.0.0" + strip-ansi: "npm:^7.1.0" + checksum: 10c0/3305839b9a0d6fb930cb63a52f34d3936013d8b0682ff3ec133c9826512620f213800ffa19ea22904876d5b7e9a3c1f40682f03597d986a4ca881fa7b033688c + languageName: node + linkType: hard + +"yaml@npm:^2.8.2": + version: 2.8.3 + resolution: "yaml@npm:2.8.3" + bin: + yaml: bin.mjs + checksum: 10c0/ddff0e11c1b467728d7eb4633db61c5f5de3d8e9373cf84d08fb0cdee03e1f58f02b9f1c51a4a8a865751695addbd465a77f73f1079be91fe5493b29c305fd77 + languageName: node + linkType: hard From 4efc255a5df59e845d0c42569d86c0fad31a5363 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 14 Apr 2026 10:37:21 -0700 Subject: [PATCH 2/4] tweak --- .oxlintrc.json | 1 + package.json | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 1d845d7..92dbc59 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,5 +1,6 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["eslint", "unicorn", "oxc", "import"], "categories": { "correctness": "warn" } diff --git a/package.json b/package.json index 67f2331..4ea0c9f 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ }, "scripts": { "test": "node --test test/index.js", - "lint": "oxlint && oxfmt --check .", - "lint:fix": "oxlint --fix && oxfmt --write .", + "lint": "oxfmt --check . && oxlint", + "lint:fix": "oxfmt --write . && oxlint --fix", "update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js", "prepare": "husky" }, @@ -47,11 +47,11 @@ }, "lint-staged": { "*.{js,mjs,cjs}": [ - "oxfmt --check", + "oxfmt --write", "oxlint" ], "*.{json,css,html}": [ - "oxfmt --check" + "oxfmt --write" ] }, "engines": { From 0f642c3dc90e5b4d9a923babe1ff342bbc45403c Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 14 Apr 2026 10:38:14 -0700 Subject: [PATCH 3/4] deps --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4ea0c9f..a15322b 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "devDependencies": { "husky": "^9.1.7", "lint-staged": "^16.4.0", - "oxfmt": "^0", - "oxlint": "^0" + "oxfmt": "^0.45.0", + "oxlint": "^1.59.0" }, "lint-staged": { "*.{js,mjs,cjs}": [ From a064915fcbb87ca55a591f9fee7e600b41349feb Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 14 Apr 2026 10:38:47 -0700 Subject: [PATCH 4/4] install --- package.json | 2 +- yarn.lock | 368 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 242 insertions(+), 128 deletions(-) diff --git a/package.json b/package.json index a15322b..0fa14fc 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "devDependencies": { "husky": "^9.1.7", "lint-staged": "^16.4.0", - "oxfmt": "^0.45.0", + "oxfmt": "^0.44.0", "oxlint": "^1.59.0" }, "lint-staged": { diff --git a/yarn.lock b/yarn.lock index 3dd53c3..a3fd3d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,191 +5,268 @@ __metadata: version: 8 cacheKey: 10c0 -"@oxfmt/binding-android-arm-eabi@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-android-arm-eabi@npm:0.43.0" +"@oxfmt/binding-android-arm-eabi@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-android-arm-eabi@npm:0.44.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@oxfmt/binding-android-arm64@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-android-arm64@npm:0.43.0" +"@oxfmt/binding-android-arm64@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-android-arm64@npm:0.44.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@oxfmt/binding-darwin-arm64@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-darwin-arm64@npm:0.43.0" +"@oxfmt/binding-darwin-arm64@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-darwin-arm64@npm:0.44.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxfmt/binding-darwin-x64@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-darwin-x64@npm:0.43.0" +"@oxfmt/binding-darwin-x64@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-darwin-x64@npm:0.44.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxfmt/binding-freebsd-x64@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-freebsd-x64@npm:0.43.0" +"@oxfmt/binding-freebsd-x64@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-freebsd-x64@npm:0.44.0" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxfmt/binding-linux-arm-gnueabihf@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-arm-gnueabihf@npm:0.43.0" +"@oxfmt/binding-linux-arm-gnueabihf@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-arm-gnueabihf@npm:0.44.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxfmt/binding-linux-arm-musleabihf@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-arm-musleabihf@npm:0.43.0" +"@oxfmt/binding-linux-arm-musleabihf@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-arm-musleabihf@npm:0.44.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxfmt/binding-linux-arm64-gnu@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-arm64-gnu@npm:0.43.0" +"@oxfmt/binding-linux-arm64-gnu@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-arm64-gnu@npm:0.44.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxfmt/binding-linux-arm64-musl@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-arm64-musl@npm:0.43.0" +"@oxfmt/binding-linux-arm64-musl@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-arm64-musl@npm:0.44.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxfmt/binding-linux-ppc64-gnu@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-ppc64-gnu@npm:0.43.0" +"@oxfmt/binding-linux-ppc64-gnu@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-ppc64-gnu@npm:0.44.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@oxfmt/binding-linux-riscv64-gnu@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-riscv64-gnu@npm:0.43.0" +"@oxfmt/binding-linux-riscv64-gnu@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-riscv64-gnu@npm:0.44.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxfmt/binding-linux-riscv64-musl@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-riscv64-musl@npm:0.43.0" +"@oxfmt/binding-linux-riscv64-musl@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-riscv64-musl@npm:0.44.0" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@oxfmt/binding-linux-s390x-gnu@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-s390x-gnu@npm:0.43.0" +"@oxfmt/binding-linux-s390x-gnu@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-s390x-gnu@npm:0.44.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxfmt/binding-linux-x64-gnu@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-x64-gnu@npm:0.43.0" +"@oxfmt/binding-linux-x64-gnu@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-x64-gnu@npm:0.44.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxfmt/binding-linux-x64-musl@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-linux-x64-musl@npm:0.43.0" +"@oxfmt/binding-linux-x64-musl@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-linux-x64-musl@npm:0.44.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxfmt/binding-openharmony-arm64@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-openharmony-arm64@npm:0.43.0" +"@oxfmt/binding-openharmony-arm64@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-openharmony-arm64@npm:0.44.0" conditions: os=openharmony & cpu=arm64 languageName: node linkType: hard -"@oxfmt/binding-win32-arm64-msvc@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-win32-arm64-msvc@npm:0.43.0" +"@oxfmt/binding-win32-arm64-msvc@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-win32-arm64-msvc@npm:0.44.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxfmt/binding-win32-ia32-msvc@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-win32-ia32-msvc@npm:0.43.0" +"@oxfmt/binding-win32-ia32-msvc@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-win32-ia32-msvc@npm:0.44.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@oxfmt/binding-win32-x64-msvc@npm:0.43.0": - version: 0.43.0 - resolution: "@oxfmt/binding-win32-x64-msvc@npm:0.43.0" +"@oxfmt/binding-win32-x64-msvc@npm:0.44.0": + version: 0.44.0 + resolution: "@oxfmt/binding-win32-x64-msvc@npm:0.44.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@oxlint/darwin-arm64@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/darwin-arm64@npm:0.18.1" +"@oxlint/binding-android-arm-eabi@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-android-arm-eabi@npm:1.59.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxlint/binding-android-arm64@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-android-arm64@npm:1.59.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/binding-darwin-arm64@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-darwin-arm64@npm:1.59.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxlint/darwin-x64@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/darwin-x64@npm:0.18.1" +"@oxlint/binding-darwin-x64@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-darwin-x64@npm:1.59.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxlint/linux-arm64-gnu@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/linux-arm64-gnu@npm:0.18.1" +"@oxlint/binding-freebsd-x64@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-freebsd-x64@npm:1.59.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm-gnueabihf@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-arm-gnueabihf@npm:1.59.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm-musleabihf@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-arm-musleabihf@npm:1.59.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm64-gnu@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-arm64-gnu@npm:1.59.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxlint/linux-arm64-musl@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/linux-arm64-musl@npm:0.18.1" +"@oxlint/binding-linux-arm64-musl@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-arm64-musl@npm:1.59.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxlint/linux-x64-gnu@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/linux-x64-gnu@npm:0.18.1" +"@oxlint/binding-linux-ppc64-gnu@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-ppc64-gnu@npm:1.59.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-riscv64-gnu@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-riscv64-gnu@npm:1.59.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-riscv64-musl@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-riscv64-musl@npm:1.59.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxlint/binding-linux-s390x-gnu@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-s390x-gnu@npm:1.59.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-x64-gnu@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-x64-gnu@npm:1.59.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxlint/linux-x64-musl@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/linux-x64-musl@npm:0.18.1" +"@oxlint/binding-linux-x64-musl@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-linux-x64-musl@npm:1.59.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxlint/win32-arm64@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/win32-arm64@npm:0.18.1" +"@oxlint/binding-openharmony-arm64@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-openharmony-arm64@npm:1.59.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/binding-win32-arm64-msvc@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-win32-arm64-msvc@npm:1.59.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxlint/win32-x64@npm:0.18.1": - version: 0.18.1 - resolution: "@oxlint/win32-x64@npm:0.18.1" +"@oxlint/binding-win32-ia32-msvc@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-win32-ia32-msvc@npm:1.59.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxlint/binding-win32-x64-msvc@npm:1.59.0": + version: 1.59.0 + resolution: "@oxlint/binding-win32-x64-msvc@npm:1.59.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -352,8 +429,8 @@ __metadata: dependencies: husky: "npm:^9.1.7" lint-staged: "npm:^16.4.0" - oxfmt: "npm:^0" - oxlint: "npm:^0" + oxfmt: "npm:^0.44.0" + oxlint: "npm:^1.59.0" semver: "npm:^7.6.3" languageName: unknown linkType: soft @@ -367,29 +444,29 @@ __metadata: languageName: node linkType: hard -"oxfmt@npm:^0": - version: 0.43.0 - resolution: "oxfmt@npm:0.43.0" +"oxfmt@npm:^0.44.0": + version: 0.44.0 + resolution: "oxfmt@npm:0.44.0" dependencies: - "@oxfmt/binding-android-arm-eabi": "npm:0.43.0" - "@oxfmt/binding-android-arm64": "npm:0.43.0" - "@oxfmt/binding-darwin-arm64": "npm:0.43.0" - "@oxfmt/binding-darwin-x64": "npm:0.43.0" - "@oxfmt/binding-freebsd-x64": "npm:0.43.0" - "@oxfmt/binding-linux-arm-gnueabihf": "npm:0.43.0" - "@oxfmt/binding-linux-arm-musleabihf": "npm:0.43.0" - "@oxfmt/binding-linux-arm64-gnu": "npm:0.43.0" - "@oxfmt/binding-linux-arm64-musl": "npm:0.43.0" - "@oxfmt/binding-linux-ppc64-gnu": "npm:0.43.0" - "@oxfmt/binding-linux-riscv64-gnu": "npm:0.43.0" - "@oxfmt/binding-linux-riscv64-musl": "npm:0.43.0" - "@oxfmt/binding-linux-s390x-gnu": "npm:0.43.0" - "@oxfmt/binding-linux-x64-gnu": "npm:0.43.0" - "@oxfmt/binding-linux-x64-musl": "npm:0.43.0" - "@oxfmt/binding-openharmony-arm64": "npm:0.43.0" - "@oxfmt/binding-win32-arm64-msvc": "npm:0.43.0" - "@oxfmt/binding-win32-ia32-msvc": "npm:0.43.0" - "@oxfmt/binding-win32-x64-msvc": "npm:0.43.0" + "@oxfmt/binding-android-arm-eabi": "npm:0.44.0" + "@oxfmt/binding-android-arm64": "npm:0.44.0" + "@oxfmt/binding-darwin-arm64": "npm:0.44.0" + "@oxfmt/binding-darwin-x64": "npm:0.44.0" + "@oxfmt/binding-freebsd-x64": "npm:0.44.0" + "@oxfmt/binding-linux-arm-gnueabihf": "npm:0.44.0" + "@oxfmt/binding-linux-arm-musleabihf": "npm:0.44.0" + "@oxfmt/binding-linux-arm64-gnu": "npm:0.44.0" + "@oxfmt/binding-linux-arm64-musl": "npm:0.44.0" + "@oxfmt/binding-linux-ppc64-gnu": "npm:0.44.0" + "@oxfmt/binding-linux-riscv64-gnu": "npm:0.44.0" + "@oxfmt/binding-linux-riscv64-musl": "npm:0.44.0" + "@oxfmt/binding-linux-s390x-gnu": "npm:0.44.0" + "@oxfmt/binding-linux-x64-gnu": "npm:0.44.0" + "@oxfmt/binding-linux-x64-musl": "npm:0.44.0" + "@oxfmt/binding-openharmony-arm64": "npm:0.44.0" + "@oxfmt/binding-win32-arm64-msvc": "npm:0.44.0" + "@oxfmt/binding-win32-ia32-msvc": "npm:0.44.0" + "@oxfmt/binding-win32-x64-msvc": "npm:0.44.0" tinypool: "npm:2.1.0" dependenciesMeta: "@oxfmt/binding-android-arm-eabi": @@ -432,43 +509,80 @@ __metadata: optional: true bin: oxfmt: bin/oxfmt - checksum: 10c0/f78c05c2f834fb6ea1d5a421c964d2211bc519dc260b80ed846b078cd404b7f6ba71d0f34be83064bd4bacfbd2e451a974f11d31713bbead39495d9d8234bae5 + checksum: 10c0/c4e0239ff9c7480a820cffd43a805a70df1b4569bdae5c253a0547f93a48ab70bb22454487c50529a5e6b2080717d15db981a52a99da7d6b55fa365c9b03fdb9 languageName: node linkType: hard -"oxlint@npm:^0": - version: 0.18.1 - resolution: "oxlint@npm:0.18.1" +"oxlint@npm:^1.59.0": + version: 1.59.0 + resolution: "oxlint@npm:1.59.0" dependencies: - "@oxlint/darwin-arm64": "npm:0.18.1" - "@oxlint/darwin-x64": "npm:0.18.1" - "@oxlint/linux-arm64-gnu": "npm:0.18.1" - "@oxlint/linux-arm64-musl": "npm:0.18.1" - "@oxlint/linux-x64-gnu": "npm:0.18.1" - "@oxlint/linux-x64-musl": "npm:0.18.1" - "@oxlint/win32-arm64": "npm:0.18.1" - "@oxlint/win32-x64": "npm:0.18.1" + "@oxlint/binding-android-arm-eabi": "npm:1.59.0" + "@oxlint/binding-android-arm64": "npm:1.59.0" + "@oxlint/binding-darwin-arm64": "npm:1.59.0" + "@oxlint/binding-darwin-x64": "npm:1.59.0" + "@oxlint/binding-freebsd-x64": "npm:1.59.0" + "@oxlint/binding-linux-arm-gnueabihf": "npm:1.59.0" + "@oxlint/binding-linux-arm-musleabihf": "npm:1.59.0" + "@oxlint/binding-linux-arm64-gnu": "npm:1.59.0" + "@oxlint/binding-linux-arm64-musl": "npm:1.59.0" + "@oxlint/binding-linux-ppc64-gnu": "npm:1.59.0" + "@oxlint/binding-linux-riscv64-gnu": "npm:1.59.0" + "@oxlint/binding-linux-riscv64-musl": "npm:1.59.0" + "@oxlint/binding-linux-s390x-gnu": "npm:1.59.0" + "@oxlint/binding-linux-x64-gnu": "npm:1.59.0" + "@oxlint/binding-linux-x64-musl": "npm:1.59.0" + "@oxlint/binding-openharmony-arm64": "npm:1.59.0" + "@oxlint/binding-win32-arm64-msvc": "npm:1.59.0" + "@oxlint/binding-win32-ia32-msvc": "npm:1.59.0" + "@oxlint/binding-win32-x64-msvc": "npm:1.59.0" + peerDependencies: + oxlint-tsgolint: ">=0.18.0" dependenciesMeta: - "@oxlint/darwin-arm64": + "@oxlint/binding-android-arm-eabi": + optional: true + "@oxlint/binding-android-arm64": + optional: true + "@oxlint/binding-darwin-arm64": + optional: true + "@oxlint/binding-darwin-x64": + optional: true + "@oxlint/binding-freebsd-x64": + optional: true + "@oxlint/binding-linux-arm-gnueabihf": + optional: true + "@oxlint/binding-linux-arm-musleabihf": + optional: true + "@oxlint/binding-linux-arm64-gnu": + optional: true + "@oxlint/binding-linux-arm64-musl": + optional: true + "@oxlint/binding-linux-ppc64-gnu": + optional: true + "@oxlint/binding-linux-riscv64-gnu": + optional: true + "@oxlint/binding-linux-riscv64-musl": + optional: true + "@oxlint/binding-linux-s390x-gnu": optional: true - "@oxlint/darwin-x64": + "@oxlint/binding-linux-x64-gnu": optional: true - "@oxlint/linux-arm64-gnu": + "@oxlint/binding-linux-x64-musl": optional: true - "@oxlint/linux-arm64-musl": + "@oxlint/binding-openharmony-arm64": optional: true - "@oxlint/linux-x64-gnu": + "@oxlint/binding-win32-arm64-msvc": optional: true - "@oxlint/linux-x64-musl": + "@oxlint/binding-win32-ia32-msvc": optional: true - "@oxlint/win32-arm64": + "@oxlint/binding-win32-x64-msvc": optional: true - "@oxlint/win32-x64": + peerDependenciesMeta: + oxlint-tsgolint: optional: true bin: - oxc_language_server: bin/oxc_language_server oxlint: bin/oxlint - checksum: 10c0/14f2a8255551ad02821ed5195fe089fec5ba817bdca93337a1a9dd177875183a80d5e245a045717d02cf2f1042451786c69374b154525c0310ada4f307882ebf + checksum: 10c0/68614addf6b6a95df8a0c8ba764ee09d2d6d1693b55b62a4f31eda3be63915d24666a11b31dfe1fabbe88e1d7ab814243a1e7ecb40db87d0f567135d17f44e2c languageName: node linkType: hard