diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c952ba6d08f1..d6082d38fb487 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -317,6 +317,16 @@ jobs: GOOS: ${{ matrix.config.goos }} GOARCH: ${{ matrix.config.goarch }} + knip: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 'lts/*' + - run: npm ci + - run: npm run knip + format: runs-on: ubuntu-slim steps: @@ -401,6 +411,7 @@ jobs: - format - generate - go-test + - knip - go-test-wasm - lint - misc diff --git a/Herebyfile.mjs b/Herebyfile.mjs index cd7a8c45fc9d4..fbcd480d70e1b 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -1399,6 +1399,25 @@ export const lint = task({ run: runLint, }); +export const knip = task({ + name: "knip", + description: "Runs knip.", + run: runKnip, +}); + +async function runKnip() { + const fixArgs = options.fix ? ["--fix"] : []; + await run(process.execPath, ["node_modules/knip/bin/knip.js", ...fixArgs]); + await run(process.execPath, [ + "node_modules/knip/bin/knip.js", + "--include-entry-exports", + "--tags=+internal", + "--tags=-knipignore", + "--include=exports,types", + ...fixArgs, + ]); +} + async function runLint() { const lintArgs = ["run"]; if (defaultGoBuildTags.length) { @@ -1506,6 +1525,7 @@ export const validate = task({ }); await runValidation("test:smoke", runSmokeTest); // in CI this is run with `--race` } + await runValidation("knip", runKnip); await runValidation("lint", runLint); await runValidation("format", runFormat); diff --git a/knip.jsonc b/knip.jsonc new file mode 100644 index 0000000000000..231463bd28104 --- /dev/null +++ b/knip.jsonc @@ -0,0 +1,63 @@ +{ + "$schema": "https://unpkg.com/knip@6/schema.json", + "exclude": ["duplicates", "enumMembers"], + "tags": ["-knipignore"], + "includeEntryExports": false, + "ignoreExportsUsedInFile": { + "enum": true, + "interface": true, + "type": true + }, + "workspaces": { + ".": { + "entry": [ + "Herebyfile.mjs", + "tools/scripts/lsp/fetchModel.mts", + "tools/scripts/tsc/generate.ts", + "tools/scripts/wasm/go-wasip1-exec.mts", + "tools/scripts/**/*.test.{mts,ts}", + "tsc/internal/stringutil/_scripts/*.mts" + ], + "project": [ + "tools/scripts/**/*.{mjs,mts,ts}", + "tsc/internal/stringutil/_scripts/*.mts" + ], + "ignore": ["tools/scripts/lsp/metaModelSchema.mts"], + "ignoreDependencies": [ + "@dprint/json", + "@dprint/typescript", + "@jakebailey/dprint-plugin-gofumpt", + // Loaded through a computed import in generate-unicode-data.mts. + "@unicode/unicode-15.1.0", + "dprint", + "dprint-plugin-yaml" + ] + }, + "packages/typescript": { + "entry": [ + "test/**/*.test.ts", + "test/**/*.bench.ts" + ], + "paths": { + "#enums/*": ["src/enums/*.ts"] + }, + "project": [ + "scripts/**/*.ts", + "src/**/*.ts", + "test/**/*.ts" + ], + "ignoreDependencies": [ + "vscode-jsonrpc", + // Browser smoke tests use the extension workspace's build tool. + "esbuild" + ] + }, + "packages/vscode-typescript": { + "project": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "ignoreDependencies": ["@vscode/vsce", "vscode-languageserver-protocol"] + } + } +} diff --git a/package-lock.json b/package-lock.json index e3662ee7728c0..2cb2d6936113a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "dprint": "^0.57.4", "dprint-plugin-yaml": "^0.6.0", "hereby": "^1.15.2", + "knip": "^6.38.0", "tar": "^7.5.22", "tinyexec": "^1.3.1", "typescript": "^6.0.3" @@ -461,6 +462,40 @@ "win32" ] }, + "node_modules/@emnapi/core": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.2.tgz", + "integrity": "sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.2.tgz", + "integrity": "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", @@ -1195,29 +1230,743 @@ "node": ">= 10" } }, - "node_modules/@napi-rs/keyring-linux-arm-gnueabihf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-arm-gnueabihf/-/keyring-linux-arm-gnueabihf-1.3.0.tgz", - "integrity": "sha512-KiWdMMu/Inz/bHHIAGrnF7r54FZDYXuHO6UFF/rhIrshUsxbMG1Rl9lEymNtqqsVo927G0VYcb02FzWQ3iBQRQ==", + "node_modules/@napi-rs/keyring-linux-arm-gnueabihf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-arm-gnueabihf/-/keyring-linux-arm-gnueabihf-1.3.0.tgz", + "integrity": "sha512-KiWdMMu/Inz/bHHIAGrnF7r54FZDYXuHO6UFF/rhIrshUsxbMG1Rl9lEymNtqqsVo927G0VYcb02FzWQ3iBQRQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-linux-arm64-gnu": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-arm64-gnu/-/keyring-linux-arm64-gnu-1.3.0.tgz", + "integrity": "sha512-eyKGpY40lm9Jvs1aD294XRH4y7+TlJM0YVAryZeXA6TX0mb4gMkxVXwSQv7MCwgah7raeUd0dKUb4BPAYIgcMg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-linux-arm64-musl": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-arm64-musl/-/keyring-linux-arm64-musl-1.3.0.tgz", + "integrity": "sha512-iIK6JWHXAJqDrEyLY3TmswwloVyt2vj+04TZnew+uSJ9gnDO8EwRbp3/iw3LpWaXiDO7VomGO6y8I0Id8uBZSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-linux-riscv64-gnu": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-riscv64-gnu/-/keyring-linux-riscv64-gnu-1.3.0.tgz", + "integrity": "sha512-/PGqrwn6EwgtK6vccASSXJRfOSP4vN1F4ASsIQ+7MdrK6hNvAJ1FZPrIuD5gGGdxezo3F++To2Wq7DbuGIeuNQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-linux-x64-gnu": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-x64-gnu/-/keyring-linux-x64-gnu-1.3.0.tgz", + "integrity": "sha512-2PDK1WKWTu9lBGq9VvNEkSlQD3O7YwVpmnyN2M3cy4v7NJ/8gDMd9GXv3G+FVXN13uhp4gnnPBS+ScefmEeD2A==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-linux-x64-musl": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-x64-musl/-/keyring-linux-x64-musl-1.3.0.tgz", + "integrity": "sha512-oJ2HkX8YUo46QBkn0pG+HuIKQNqr523q6vBobCn+P95s4C4K6/kLBqHY/1bg5J4ap31DzsznhnFKcfBNBsjCnw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-win32-arm64-msvc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-win32-arm64-msvc/-/keyring-win32-arm64-msvc-1.3.0.tgz", + "integrity": "sha512-tOd3c/uAaeoE4ycVlmAdSvygz0Zt3zdca6Y7gokBeIbaRDWpjDIUOpU3MvML59XAaqyuKGsVVu0F/DZb1lHPmw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-win32-ia32-msvc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-win32-ia32-msvc/-/keyring-win32-ia32-msvc-1.3.0.tgz", + "integrity": "sha512-sPSqeAFZMGqP1R++M2JTza7GQJJ/TpCo6JU6Vcd4jnebvOaEDs9b7eipakU1PJdSvhpC2yXMCNRk9gXfrhuwHQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/keyring-win32-x64-msvc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@napi-rs/keyring-win32-x64-msvc/-/keyring-win32-x64-msvc-1.3.0.tgz", + "integrity": "sha512-4DnCWXwDc0HRKwyRlG5y0VhKZW2tNRQfKKfyj6IX/KWfDNyq9hn4n+GL1auyDcOO/v8PwnhmYo2+rOOqCkvvOg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.4.tgz", + "integrity": "sha512-AJxoUD2/15ESHbvpcyjU274nsAPLuOtPHCk0vKJM5pj//Fg/B1FXNWjPnXTT9PymCYYiHo4zPj0ZomXBKhoy7g==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" + } + }, + "node_modules/@nevware21/ts-async": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.6.1.tgz", + "integrity": "sha512-W2kFiT5oPuxTrB3NrxUId/U+1AuAhIaiDQkLC4HcxkjNc+85GfELYdPQXnsDWDG8yji24F5qk6QpBDxZX3/0+g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/nevware21" + }, + { + "type": "buymeacoffee", + "url": "https://www.buymeacoffee.com/nevware21" + } + ], + "license": "MIT", + "dependencies": { + "@nevware21/ts-utils": ">= 0.15.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.16.0.tgz", + "integrity": "sha512-DDln15VUBSw5JjJlNno1UCSzgAGzHHklm7u695jXDCzwSn7W2F7B2VYHwLLcT1cOWQQBQAJK6e2/Y8oTG+W0Ig==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/nevware21" + }, + { + "type": "other", + "url": "https://buymeacoffee.com/nevware21" + } + ], + "license": "MIT" + }, + "node_modules/@oxc-parser/binding-android-arm-eabi": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.150.0.tgz", + "integrity": "sha512-oQef2Zu4Prz1KLKznz3HqZzU9uVoA5PMoDZuuLmqms7hKmKSAPzlaMnLllJq3t+rgKmfJJ2siPrpZfFrW06btw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.150.0.tgz", + "integrity": "sha512-B6ofpoFiAUwIZ0MJ2IgHPvZK8FAtL4qzSZRwOkAKIfxEobE1mQC8nDdiFZj7pUaJiVUVCsfkMsBJKedzO8rZvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.150.0.tgz", + "integrity": "sha512-J+9IHKzx/bSz1JetOfD4zKXSK9sOm4/a7+0qomJODcTL6JsRXGeV/ZdkAPSIDydfFmWzYCraMlQEosSZEyBYkQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.150.0.tgz", + "integrity": "sha512-v6IPfcAcSYrBWXV5Tce1DmxDMXLhEYpIIWiRFPJopgCVscZdLaV4MRQOUxvL3usQlw+yrwYOjBFB9IwBx+jUiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.150.0.tgz", + "integrity": "sha512-AoR/4jD02HET0KO0yNT4nbTE+XJUxiO9jB1X/ycEjUE3WrIJ3IjV/Vf+gskhWLcqqeXfvNnkDtBR7epllAm88A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.150.0.tgz", + "integrity": "sha512-A/hycCFjLUrCmLoL5O/vBp40ohlaXO1Ta3v5hqYZxicYFs129wZmgZJggcW4mYGYbZebQLhup+N8JjeQl8qwyw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.150.0.tgz", + "integrity": "sha512-pbqahg1Pkz7J4RKmXm30s/iQu99hv64ayXCu8P4p75HcEH5azOdR4eGqiB6lFGkFR3mMpzaYsSKLkS8oJbjmeQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.150.0.tgz", + "integrity": "sha512-HV11aRbBQGwqv8bEo+K/6qr88uB4fEe1mhXncMhlVCrj+WpBSraxrUzHaPVmeQRU6x6x8v/3DuCbbo93rpp+fw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.150.0.tgz", + "integrity": "sha512-k6pVkJqALwtEuP4zukVhGRhdIy4+ofChUIUUsAHHyqDZlNsknmel3JjbggrJiWGaes6h/dIcWmEXsKW4SmK9oQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.150.0.tgz", + "integrity": "sha512-tEFg39mw/rHO5n8GK2DR4ZMFfsPQZtnQIPbsIpjoQRomJc/2tRfsCSmCT6gNit+NZGoeJG5aH9ATDH5bf0WnoQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.150.0.tgz", + "integrity": "sha512-0JO7IFkoek6HqV589Menx3hJySNXi6quRhO4tq2P7kpEHKEXoDATnoPVUpn5B7gDH2KLkdo751N0uIrGJFCTCw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-musl": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.150.0.tgz", + "integrity": "sha512-7XPzREnyAS5wHU9aB+49Uaqgoo1gVCklHc3DRlc3fJy2tXD/eAJFN1QFz/crj+Ulup5P1+axNREF+/RGaB/IRA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.150.0.tgz", + "integrity": "sha512-7n7ZxcbRWDFaTdyj8M8p0O9OfzoMKm8O6syBAIgcSutbOALq0Bb9G52Me+XH0anMLZV+NgXc726gqgG2q39vcQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.150.0.tgz", + "integrity": "sha512-Vx0GSA9ZCRTUiczoEQnIIyXkMvtEY8uc6IiwLQtMe5ci2sXPqjrry0Ek5fsPP1k2kCzkML3ow9UOOEgnEDi7Bw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.150.0.tgz", + "integrity": "sha512-ii4/9m3viDLssMnfXU7/Pni/3nYplApuGayceX4qsVGaqqQJCx3tHIH9M/HWIeSty5i8LjS21zPYT6lVIkwLxw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-openharmony-arm64": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.150.0.tgz", + "integrity": "sha512-ZtoxX5rez36ZWkwtiEhjkCPnlTPoQ2I7lIL0IYZ1yjxMYohbvoOjBmUIZzrf9W/HouONq0omIfTeCWEY+R380w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.150.0.tgz", + "integrity": "sha512-VqeRb5JX/bKYBrff7TUDvJyKY0914UzuCkuXIGxJS4FUmvMNfqkCbc7Sq90iMz9DlmAtlggwaBYQ9eg3h3ltiw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-ia32-msvc": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.150.0.tgz", + "integrity": "sha512-EPqJfeZ4Pgg2BJSsCV8GozxV0FDltRzpVtGVa1r2noJu1iu+opOw3gtBWXwIo9odCT/MdFfyHxdy0/CRqs3OqA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.150.0.tgz", + "integrity": "sha512-n5YMzbqwPQqozbkrexi0lNZrUz5cnPHalYpFWe6Dau7AmKIWNo+y24IwzDuZEQtEdUHuKhXmMMih/MPjOI+CMw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.150.0.tgz", + "integrity": "sha512-rDS5/31E9HfPl/CIzGrn0DOlvBbXFseQ5URJ9sYMfstbKLD/c6Gm9vmRzRGDdAXyOIL4zmO37lc9RIwYqVruZw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@oxc-resolver/binding-android-arm-eabi": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.24.2.tgz", + "integrity": "sha512-y09e0L0SRI2OA2tUIrjBgoV3eH5hvUKXNkJqXmNo5V2WxIjyC7I7aJfRLMEVpA8yi95f90gFDvO0VMgrDw+vwA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-android-arm64": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.24.2.tgz", + "integrity": "sha512-cl4icWaZFnLdg8m6qtnh5rBMuGbxc/ptStFHLeCNwr+2cZjkjNwQu/jYRS0CHlnPecOJMpuS5M6/BH+0J/YkEg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.24.2.tgz", + "integrity": "sha512-At29QEMF6HajbQvgY8K6OXnHD1x9rad74xBEfmCB6ZqCGsdq75aK7tOYcTbOanMy8qdIBrfL3SMr3p/lfSlb9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.24.2.tgz", + "integrity": "sha512-A5Kqr1EUj4oIL5CF4WRssq/o5P0Y11cwoFouMRmQ7YnC/A8V93nv1nb7aSU8HwcgmXropjLNkVTl4MN87cu28Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.24.2.tgz", + "integrity": "sha512-R5xkRBRRz7ceH/P5Jrc6G7FmdUdgpLYyESFAUDVTNQ9K0sGPxcp4ljiwEwEqsvNcQ4sYbMRrWcHHBCu7ksAJVw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.24.2.tgz", + "integrity": "sha512-k/RuYL4L/R58IBn3wT5ma3Wh4k62bp1eYCFRWCmMsasUOqL+H6sW0VGFadEzKWXFFlz+2uIMoeMk9ySSZJHgbg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.24.2.tgz", + "integrity": "sha512-bnHAak3ujYfH5pKk4NieFNbvYvernfoQDgwLddbZ3OtMYrem87/qjlA+u+aKG0oZcqSLGCful/6/CEA+aeAgaA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.24.2.tgz", + "integrity": "sha512-vDT3KHgzYp47gmtNOqL2VNhCyl5Zv643eyxm//A68J8DeUGXrvD1pZFiaT4jSfe+RInfnn1R2yVHye4enx6RnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.24.2.tgz", + "integrity": "sha512-+kMlQvbzfyEYtu5FcjE4p+ttBLpKW4d/AsAsuE69BxV6V4twZJeIQZFfD8gh/wqglY0MkPSezWXQH0jBV13MUw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.24.2.tgz", + "integrity": "sha512-shjfMhmZ3gq9fv/w7bi3PnZlgOPG+2QAOFf0BJF0EgBSIGZ6PMLN2zbGEblTUYB/NKVDRyYhE2ff3dJ1QqNPkA==", "cpu": [ - "arm" + "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-linux-arm64-gnu": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-arm64-gnu/-/keyring-linux-arm64-gnu-1.3.0.tgz", - "integrity": "sha512-eyKGpY40lm9Jvs1aD294XRH4y7+TlJM0YVAryZeXA6TX0mb4gMkxVXwSQv7MCwgah7raeUd0dKUb4BPAYIgcMg==", + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.24.2.tgz", + "integrity": "sha512-zGelwFR5oRo+b69k8Lrzun86DyUHzfKN6cnjbR9l7Z7NIRznOE/2ZvPa1IUKqAL2PzAXOdwkfVqNvO1H2RlpAw==", "cpu": [ - "arm64" + "riscv64" ], "dev": true, "libc": [ @@ -1227,17 +1976,14 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-linux-arm64-musl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-arm64-musl/-/keyring-linux-arm64-musl-1.3.0.tgz", - "integrity": "sha512-iIK6JWHXAJqDrEyLY3TmswwloVyt2vj+04TZnew+uSJ9gnDO8EwRbp3/iw3LpWaXiDO7VomGO6y8I0Id8uBZSw==", + "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.24.2.tgz", + "integrity": "sha512-qxZ1SWCXJY0eyhAlP6Lmo9F2Nrtx7EkYj9oCgL8apDPCwXwCEDA2U697bbT81JIc2IrVjxO4KX6WU2N+oN9Z4w==", "cpu": [ - "arm64" + "riscv64" ], "dev": true, "libc": [ @@ -1247,17 +1993,14 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-linux-riscv64-gnu": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-riscv64-gnu/-/keyring-linux-riscv64-gnu-1.3.0.tgz", - "integrity": "sha512-/PGqrwn6EwgtK6vccASSXJRfOSP4vN1F4ASsIQ+7MdrK6hNvAJ1FZPrIuD5gGGdxezo3F++To2Wq7DbuGIeuNQ==", + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.24.2.tgz", + "integrity": "sha512-sGCecF3cx2DFlH4t/z7ApnOnXqN48p5p5mlHDEnHTAukQa2P+qMVE4CwyWE9W+q/m3QJ7kKfGrIjax31f44oFQ==", "cpu": [ - "riscv64" + "s390x" ], "dev": true, "libc": [ @@ -1267,15 +2010,12 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-linux-x64-gnu": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-x64-gnu/-/keyring-linux-x64-gnu-1.3.0.tgz", - "integrity": "sha512-2PDK1WKWTu9lBGq9VvNEkSlQD3O7YwVpmnyN2M3cy4v7NJ/8gDMd9GXv3G+FVXN13uhp4gnnPBS+ScefmEeD2A==", + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.24.2.tgz", + "integrity": "sha512-k/VlMMcSzMlahb3/fENM4rTlsJ0s3fFROA0KXPBmKggqmTSaE383sl8F3KCOXPLmVsYfW6hCitMhXCEtNeZxxg==", "cpu": [ "x64" ], @@ -1287,15 +2027,12 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-linux-x64-musl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-linux-x64-musl/-/keyring-linux-x64-musl-1.3.0.tgz", - "integrity": "sha512-oJ2HkX8YUo46QBkn0pG+HuIKQNqr523q6vBobCn+P95s4C4K6/kLBqHY/1bg5J4ap31DzsznhnFKcfBNBsjCnw==", + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.24.2.tgz", + "integrity": "sha512-8hbnZyNi97b/8wapYaIF9+t9GmZKBW2vunaOc3h9HGJptH7b7XpvZqOTBSm/MpTjr7H497BlgOaSfLUdhmy2bw==", "cpu": [ "x64" ], @@ -1307,15 +2044,12 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-win32-arm64-msvc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-win32-arm64-msvc/-/keyring-win32-arm64-msvc-1.3.0.tgz", - "integrity": "sha512-tOd3c/uAaeoE4ycVlmAdSvygz0Zt3zdca6Y7gokBeIbaRDWpjDIUOpU3MvML59XAaqyuKGsVVu0F/DZb1lHPmw==", + "node_modules/@oxc-resolver/binding-openharmony-arm64": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.24.2.tgz", + "integrity": "sha512-MvyGik3a6pVgZ0t/kWlbmFxFLmXQJwgLsY2eYFHLpy0wGwRbfzeIGgDwQ3kXqE30z+kSXennRkCrT7TUvkptNg==", "cpu": [ "arm64" ], @@ -1323,33 +2057,46 @@ "license": "MIT", "optional": true, "os": [ - "win32" + "openharmony" + ] + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.24.2.tgz", + "integrity": "sha512-vHcssMPwO08RTvj/c0iOBz90attxyG3wQJ0dTcyEQK43LRpcdLWZlV5feBhv6Isn6ahbQIzHbCgfa81+RiML0Q==", + "cpu": [ + "wasm32" ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.2", + "@emnapi/runtime": "1.11.2", + "@napi-rs/wasm-runtime": "^1.1.6" + }, "engines": { - "node": ">= 10" + "node": ">=14.0.0" } }, - "node_modules/@napi-rs/keyring-win32-ia32-msvc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-win32-ia32-msvc/-/keyring-win32-ia32-msvc-1.3.0.tgz", - "integrity": "sha512-sPSqeAFZMGqP1R++M2JTza7GQJJ/TpCo6JU6Vcd4jnebvOaEDs9b7eipakU1PJdSvhpC2yXMCNRk9gXfrhuwHQ==", + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.24.2.tgz", + "integrity": "sha512-uokJqro2iBqkFvJdKQLP7d8/BUmFwESQFVmIJUQKj1Xn1a/LysJoe1vmeECLF5b3jsV8CAL5sEMJXX6SdK9Nhg==", "cpu": [ - "ia32" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ "win32" - ], - "engines": { - "node": ">= 10" - } + ] }, - "node_modules/@napi-rs/keyring-win32-x64-msvc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@napi-rs/keyring-win32-x64-msvc/-/keyring-win32-x64-msvc-1.3.0.tgz", - "integrity": "sha512-4DnCWXwDc0HRKwyRlG5y0VhKZW2tNRQfKKfyj6IX/KWfDNyq9hn4n+GL1auyDcOO/v8PwnhmYo2+rOOqCkvvOg==", + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.24.2.tgz", + "integrity": "sha512-UqGPmo56KDfLlfXFAFIrNflHT8tFxWGEivWg3Zeyp4Uy2NlKN1FGPr6/BxcLGG3+kZ6Wp14g5Uj+n71boqZfiw==", "cpu": [ "x64" ], @@ -1358,45 +2105,7 @@ "optional": true, "os": [ "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nevware21/ts-async": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.6.1.tgz", - "integrity": "sha512-W2kFiT5oPuxTrB3NrxUId/U+1AuAhIaiDQkLC4HcxkjNc+85GfELYdPQXnsDWDG8yji24F5qk6QpBDxZX3/0+g==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/nevware21" - }, - { - "type": "buymeacoffee", - "url": "https://www.buymeacoffee.com/nevware21" - } - ], - "license": "MIT", - "dependencies": { - "@nevware21/ts-utils": ">= 0.15.0 < 2.x" - } - }, - "node_modules/@nevware21/ts-utils": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.16.0.tgz", - "integrity": "sha512-DDln15VUBSw5JjJlNno1UCSzgAGzHHklm7u695jXDCzwSn7W2F7B2VYHwLLcT1cOWQQBQAJK6e2/Y8oTG+W0Ig==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/nevware21" - }, - { - "type": "other", - "url": "https://buymeacoffee.com/nevware21" - } - ], - "license": "MIT" + ] }, "node_modules/@secretlint/core": { "version": "10.2.2", @@ -1468,6 +2177,17 @@ "node": ">=20.0.0" } }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/node": { "version": "22.20.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.1.tgz", @@ -2618,6 +3338,16 @@ "node": ">=6" } }, + "node_modules/fd-package-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fd-package-json/-/fd-package-json-2.0.0.tgz", + "integrity": "sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "walk-up-path": "^4.0.0" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -2636,6 +3366,23 @@ } } }, + "node_modules/formatly": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.7.1.tgz", + "integrity": "sha512-ESuCEJE0SGgabl9q+zABI8LhJDmF+8nhpuqDzuM48HfJ9QTD5o6PqFJDFZY7w6f8xsh5lixuj5nJsQNvYOWvKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fd-package-json": "^2.0.0", + "package-manager-detector": "^1.8.0" + }, + "bin": { + "formatly": "bin/index.mjs" + }, + "engines": { + "node": ">=18.3.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -2695,6 +3442,19 @@ "node": ">= 0.4" } }, + "node_modules/get-tsconfig": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.3.tgz", + "integrity": "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -2874,6 +3634,16 @@ "url": "https://bevry.me/fund" } }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/jsonc-parser": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", @@ -2927,6 +3697,45 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/knip": { + "version": "6.38.0", + "resolved": "https://registry.npmjs.org/knip/-/knip-6.38.0.tgz", + "integrity": "sha512-umytiMCaZf02MV9SOO1FEDgbDf6h20VZk3ruJE0kh52kkGjYZFRUAXHJWYoLhvhoHGINO/7GXVJmQ2vxTBvl6A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/webpro" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/knip" + } + ], + "license": "ISC", + "dependencies": { + "fdir": "^6.5.0", + "formatly": "^0.7.0", + "get-tsconfig": "4.14.3", + "jiti": "^2.7.0", + "oxc-parser": "^0.150.0", + "oxc-resolver": "11.24.2", + "picomatch": "^4.0.7", + "smol-toml": "^1.8.0", + "strip-json-comments": "5.0.3", + "tinyglobby": "^0.2.17", + "unbash": "^4.0.11", + "yaml": "^2.9.1", + "zod": "^4.4.3" + }, + "bin": { + "knip": "bin/knip.js", + "knip-bun": "bin/knip-bun.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -3120,6 +3929,81 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/oxc-parser": { + "version": "0.150.0", + "resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.150.0.tgz", + "integrity": "sha512-zwajKw1GUa57IOdafIS7/yOObGF2NihwIfZfs5yJTRprMSkiwhWOc/k+n8bwnUPbHr2/XsjfBO8KyTPaW3VpWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "^0.150.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxc-parser/binding-android-arm-eabi": "0.150.0", + "@oxc-parser/binding-android-arm64": "0.150.0", + "@oxc-parser/binding-darwin-arm64": "0.150.0", + "@oxc-parser/binding-darwin-x64": "0.150.0", + "@oxc-parser/binding-freebsd-x64": "0.150.0", + "@oxc-parser/binding-linux-arm-gnueabihf": "0.150.0", + "@oxc-parser/binding-linux-arm-musleabihf": "0.150.0", + "@oxc-parser/binding-linux-arm64-gnu": "0.150.0", + "@oxc-parser/binding-linux-arm64-musl": "0.150.0", + "@oxc-parser/binding-linux-ppc64-gnu": "0.150.0", + "@oxc-parser/binding-linux-riscv64-gnu": "0.150.0", + "@oxc-parser/binding-linux-riscv64-musl": "0.150.0", + "@oxc-parser/binding-linux-s390x-gnu": "0.150.0", + "@oxc-parser/binding-linux-x64-gnu": "0.150.0", + "@oxc-parser/binding-linux-x64-musl": "0.150.0", + "@oxc-parser/binding-openharmony-arm64": "0.150.0", + "@oxc-parser/binding-win32-arm64-msvc": "0.150.0", + "@oxc-parser/binding-win32-ia32-msvc": "0.150.0", + "@oxc-parser/binding-win32-x64-msvc": "0.150.0" + } + }, + "node_modules/oxc-resolver": { + "version": "11.24.2", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.24.2.tgz", + "integrity": "sha512-FY91FiDBj7ls5MsFS9jN3tjz2o0/zsdSsymlakySaBwVJZorHhkWyICLZMKxlu1R9vYo+sd3z1jwb4J8x7bNDw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-resolver/binding-android-arm-eabi": "11.24.2", + "@oxc-resolver/binding-android-arm64": "11.24.2", + "@oxc-resolver/binding-darwin-arm64": "11.24.2", + "@oxc-resolver/binding-darwin-x64": "11.24.2", + "@oxc-resolver/binding-freebsd-x64": "11.24.2", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.24.2", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.24.2", + "@oxc-resolver/binding-linux-arm64-gnu": "11.24.2", + "@oxc-resolver/binding-linux-arm64-musl": "11.24.2", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.24.2", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.24.2", + "@oxc-resolver/binding-linux-riscv64-musl": "11.24.2", + "@oxc-resolver/binding-linux-s390x-gnu": "11.24.2", + "@oxc-resolver/binding-linux-x64-gnu": "11.24.2", + "@oxc-resolver/binding-linux-x64-musl": "11.24.2", + "@oxc-resolver/binding-openharmony-arm64": "11.24.2", + "@oxc-resolver/binding-wasm32-wasi": "11.24.2", + "@oxc-resolver/binding-win32-arm64-msvc": "11.24.2", + "@oxc-resolver/binding-win32-x64-msvc": "11.24.2" + } + }, + "node_modules/package-manager-detector": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.8.0.tgz", + "integrity": "sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==", + "dev": true, + "license": "MIT" + }, "node_modules/parse5": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz", @@ -3248,6 +4132,16 @@ "node": ">=0.10.0" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -3397,6 +4291,19 @@ "dev": true, "license": "ISC" }, + "node_modules/smol-toml": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.1.tgz", + "integrity": "sha512-j7WyPdf0CJoutMzMoPLF/bVXHtKZIT9Rb4eGeEbWw8X2t5oirjPgpL+OpaENZrILYaXqYwnVH+qgUwVbl+pUJQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3425,6 +4332,19 @@ "node": ">=8" } }, + "node_modules/strip-json-comments": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/structured-source": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/structured-source/-/structured-source-4.0.0.tgz", @@ -3556,6 +4476,16 @@ "node": ">=14.17" } }, + "node_modules/unbash": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/unbash/-/unbash-4.0.11.tgz", + "integrity": "sha512-FoSOKV7NEofQSkAefMVHam4ZPKYMxjAydxiV72UFEDNV/YofxjGfiZ2A9pZjdL/lRJzTjcu4PABo1JYJX8N5iQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + } + }, "node_modules/underscore": { "version": "1.13.8", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.8.tgz", @@ -3652,6 +4582,16 @@ "resolved": "packages/vscode-typescript-nightly", "link": true }, + "node_modules/walk-up-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", + "integrity": "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -3730,6 +4670,22 @@ "node": ">=18" } }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yargs": { "version": "17.7.3", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", @@ -3782,6 +4738,16 @@ "buffer-crc32": "~0.2.3" } }, + "node_modules/zod": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz", + "integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "packages/typescript": { "name": "@typescript/typescript", "version": "0.0.0", diff --git a/package.json b/package.json index f6b4cf0bf6ab4..a81e72a606013 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "build:watch:debug": "hereby build:watch --debug", "test": "hereby test", "lint": "hereby lint", + "knip": "hereby knip", "format": "hereby format", "check:format": "hereby check:format", "generate": "hereby generate", @@ -35,6 +36,7 @@ "dprint": "^0.57.4", "dprint-plugin-yaml": "^0.6.0", "hereby": "^1.15.2", + "knip": "^6.38.0", "tar": "^7.5.22", "tinyexec": "^1.3.1", "typescript": "^6.0.3" diff --git a/packages/typescript/src/api/async/client.ts b/packages/typescript/src/api/async/client.ts index a394f01698146..b44f840a4a4b8 100644 --- a/packages/typescript/src/api/async/client.ts +++ b/packages/typescript/src/api/async/client.ts @@ -44,8 +44,7 @@ import { type TransportClient, } from "./transportClient.ts"; -export type { AsyncClientOptions as ClientOptions, AsyncClientTransportOptions, ClientSocketOptions, ClientSpawnOptions } from "../options.ts"; -export type { AsyncTransport } from "./transport.ts"; +export type { ClientSocketOptions, ClientSpawnOptions } from "../options.ts"; export type Client = TransportClient | RpcClient; diff --git a/packages/typescript/src/api/node/node.ts b/packages/typescript/src/api/node/node.ts index 77f2c9366fcd8..8037fd5a8a3ed 100644 --- a/packages/typescript/src/api/node/node.ts +++ b/packages/typescript/src/api/node/node.ts @@ -47,7 +47,7 @@ import { Wtf8Decoder } from "./wtf8.ts"; // Re-export everything consumers need from the other two files. export { RemoteNode, RemoteNodeList } from "./node.generated.ts"; -export { readParseOptionsKey, readSourceFileHash, readSourceFileLease, readSourceFileNodeId, RemoteNodeBase } from "./node.infrastructure.ts"; +export { readParseOptionsKey, readSourceFileHash, readSourceFileLease } from "./node.infrastructure.ts"; const sourceFileExtendedDataOffsets = { Text: 0, @@ -467,28 +467,6 @@ function computeLineOfPosition(lineStarts: readonly number[], position: number): return low - 1; } -/** - * Find a descendant node at a specific position with matching kind and end position. - */ -export function findDescendant(root: Node, pos: number, end: number, kind: SyntaxKind): Node | undefined { - if (root.pos === pos && root.end === end && root.kind === kind) { - return root; - } - - // Search children - let result: Node | undefined; - root.forEachChild(child => { - if (result) return result; // Already found - // Only search in children that could contain our target - if (child.pos <= pos && child.end >= end) { - result = findDescendant(child, pos, end, kind); - } - return undefined; - }); - - return result; -} - /** * Parsed components of a node handle. */ diff --git a/packages/typescript/src/api/node/protocol.generated.ts b/packages/typescript/src/api/node/protocol.generated.ts index 8c224bc9a9196..3f8cba2df0527 100644 --- a/packages/typescript/src/api/node/protocol.generated.ts +++ b/packages/typescript/src/api/node/protocol.generated.ts @@ -177,68 +177,3 @@ export const childProperties: Readonly>> = { - [SyntaxKind.ComputedPropertyName]: "expression", - [SyntaxKind.Decorator]: "expression", - [SyntaxKind.BreakStatement]: "label", - [SyntaxKind.ContinueStatement]: "label", - [SyntaxKind.ReturnStatement]: "expression", - [SyntaxKind.CaseBlock]: "clauses", - [SyntaxKind.DefaultClause]: "statements", - [SyntaxKind.ThrowStatement]: "expression", - [SyntaxKind.ExpressionStatement]: "expression", - [SyntaxKind.Block]: "statements", - [SyntaxKind.VariableDeclarationList]: "declarations", - [SyntaxKind.ObjectBindingPattern]: "elements", - [SyntaxKind.ArrayBindingPattern]: "elements", - [SyntaxKind.MissingDeclaration]: "modifiers", - [SyntaxKind.HeritageClause]: "types", - [SyntaxKind.ModuleBlock]: "statements", - [SyntaxKind.ExternalModuleReference]: "expression", - [SyntaxKind.NamespaceImport]: "name", - [SyntaxKind.NamedImports]: "elements", - [SyntaxKind.NamespaceExport]: "name", - [SyntaxKind.NamedExports]: "elements", - [SyntaxKind.PrefixUnaryExpression]: "operand", - [SyntaxKind.PostfixUnaryExpression]: "operand", - [SyntaxKind.MetaProperty]: "name", - [SyntaxKind.NonNullExpression]: "expression", - [SyntaxKind.SpreadElement]: "expression", - [SyntaxKind.ParenthesizedExpression]: "expression", - [SyntaxKind.ArrayLiteralExpression]: "elements", - [SyntaxKind.ObjectLiteralExpression]: "properties", - [SyntaxKind.SpreadAssignment]: "expression", - [SyntaxKind.DeleteExpression]: "expression", - [SyntaxKind.TypeOfExpression]: "expression", - [SyntaxKind.VoidExpression]: "expression", - [SyntaxKind.AwaitExpression]: "expression", - [SyntaxKind.UnionType]: "types", - [SyntaxKind.IntersectionType]: "types", - [SyntaxKind.TypeOperator]: "type", - [SyntaxKind.InferType]: "typeParameter", - [SyntaxKind.ArrayType]: "elementType", - [SyntaxKind.LiteralType]: "literal", - [SyntaxKind.ImportAttributes]: "attributes", - [SyntaxKind.TypeLiteral]: "members", - [SyntaxKind.TupleType]: "elements", - [SyntaxKind.OptionalType]: "type", - [SyntaxKind.RestType]: "type", - [SyntaxKind.ParenthesizedType]: "type", - [SyntaxKind.SyntheticExpression]: "tupleNameSource", - [SyntaxKind.PartiallyEmittedExpression]: "expression", - [SyntaxKind.JsxAttributes]: "properties", - [SyntaxKind.JsxSpreadAttribute]: "expression", - [SyntaxKind.JsxClosingElement]: "tagName", - [SyntaxKind.SyntaxList]: "children", - [SyntaxKind.JSDocTypeExpression]: "type", - [SyntaxKind.JSDocNonNullableType]: "type", - [SyntaxKind.JSDocNullableType]: "type", - [SyntaxKind.JSDocVariadicType]: "type", - [SyntaxKind.JSDocOptionalType]: "type", - [SyntaxKind.JSDocNameReference]: "name", - [SyntaxKind.JSDocLink]: "name", - [SyntaxKind.JSDocLinkPlain]: "name", - [SyntaxKind.JSDocLinkCode]: "name", - [SyntaxKind.JSDocTypeLiteral]: "jsdocPropertyTags", -}; diff --git a/packages/typescript/src/api/node/protocol.ts b/packages/typescript/src/api/node/protocol.ts index bf01e29560665..a0531ab3f9f74 100644 --- a/packages/typescript/src/api/node/protocol.ts +++ b/packages/typescript/src/api/node/protocol.ts @@ -13,7 +13,6 @@ export const HEADER_OFFSET_STRUCTURED_DATA = 36; export const HEADER_OFFSET_NODES = 40; export const HEADER_OFFSET_SOURCE_FILE_ID = 44; export const HEADER_OFFSET_SOURCE_FILE_LEASE = 52; -export const HEADER_OFFSET_BINDER_DATA = 60; export const HEADER_SIZE = 64; export const NODE_LEN = 28; @@ -32,8 +31,5 @@ export const NODE_DATA_TYPE_CHILDREN = 0x00000000; export const NODE_DATA_TYPE_STRING = 0x40000000; export const NODE_DATA_TYPE_EXTENDED = 0x80000000; -export const NODE_STRING_INDEX_MASK = 0x00FFFFFF; -export const NODE_EXTENDED_DATA_MASK = 0x00FFFFFF; - // Re-export generated child properties -export { childProperties, singleChildNodePropertyNames } from "./protocol.generated.ts"; +export { childProperties } from "./protocol.generated.ts"; diff --git a/packages/typescript/src/api/path.ts b/packages/typescript/src/api/path.ts index e692cdf1b3833..8c9bf819ed4eb 100644 --- a/packages/typescript/src/api/path.ts +++ b/packages/typescript/src/api/path.ts @@ -180,14 +180,14 @@ function lastOrUndefined(array: T[]): T | undefined { /** * Determines whether a path has a trailing separator (`/` or `\\`). */ -export function hasTrailingDirectorySeparator(path: string): boolean { +function hasTrailingDirectorySeparator(path: string): boolean { return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); } /** * Removes a trailing directory separator from a path, if it does not already have one. */ -export function removeTrailingDirectorySeparator(path: string): string { +function removeTrailingDirectorySeparator(path: string): string { if (hasTrailingDirectorySeparator(path)) { return path.substr(0, path.length - 1); } @@ -197,7 +197,7 @@ export function removeTrailingDirectorySeparator(path: string): string { /** * Adds a trailing directory separator to a path, if it does not already have one. */ -export function ensureTrailingDirectorySeparator(path: string): string { +function ensureTrailingDirectorySeparator(path: string): string { if (!hasTrailingDirectorySeparator(path)) { return path + directorySeparator; } @@ -207,7 +207,7 @@ export function ensureTrailingDirectorySeparator(path: string): string { /** * Normalize path separators, converting `\\` into `/`. */ -export function normalizeSlashes(path: string): string { +function normalizeSlashes(path: string): string { return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path; @@ -216,7 +216,7 @@ export function normalizeSlashes(path: string): string { /** * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. */ -export function combinePaths(path: string, ...paths: (string | undefined)[]): string { +function combinePaths(path: string, ...paths: (string | undefined)[]): string { if (path) path = normalizeSlashes(path); for (let relativePath of paths) { if (!relativePath) continue; @@ -253,7 +253,7 @@ function simpleNormalizePath(path: string): string | undefined { /** * Returns the normalized absolute path, resolving `.` and `..` segments. */ -export function getNormalizedAbsolutePath(path: string, currentDirectory: string | undefined): string { +function getNormalizedAbsolutePath(path: string, currentDirectory: string | undefined): string { let rootLength = getRootLength(path); if (rootLength === 0 && currentDirectory) { path = combinePaths(currentDirectory, path); @@ -364,7 +364,7 @@ export function normalizePath(path: string): string { * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a DOS path * like `c:`, `c:\\` or `c:/`). */ -export function isRootedDiskPath(path: string): boolean { +function isRootedDiskPath(path: string): boolean { return getEncodedRootLength(path) > 0; } @@ -601,7 +601,7 @@ const dynamicURIPathSegmentEscapeRegExp = /(?:^|\/)(?:\.{1,2}(?:\/|$)|~ts-uri-es /** * Returns true if the path refers to a bundled library file. */ -export function isBundled(path: string): boolean { +function isBundled(path: string): boolean { return path.startsWith(bundledScheme); } @@ -609,7 +609,7 @@ export function isBundled(path: string): boolean { * Returns true if the file name represents a dynamic/virtual file * that doesn't exist on disk (e.g., untitled files with paths like "^/untitled/..."). */ -export function isDynamicFileName(fileName: string): boolean { +function isDynamicFileName(fileName: string): boolean { return fileName.startsWith("^/"); } @@ -617,7 +617,7 @@ export function isDynamicFileName(fileName: string): boolean { * Splits a Windows volume (e.g., "c:") from the rest of the path. * Returns [volume, rest, ok] where ok is true if a volume was found. */ -export function splitVolumePath(path: string): [volume: string, rest: string, ok: boolean] { +function splitVolumePath(path: string): [volume: string, rest: string, ok: boolean] { if (path.length >= 2 && isVolumeCharacter(path.charCodeAt(0)) && path.charCodeAt(1) === CharacterCodesColon) { return [path.substring(0, 2).toLowerCase(), path.substring(2), true]; } diff --git a/packages/typescript/src/api/sync/client.ts b/packages/typescript/src/api/sync/client.ts index d440bc46d4558..6b96ce60b4d0b 100644 --- a/packages/typescript/src/api/sync/client.ts +++ b/packages/typescript/src/api/sync/client.ts @@ -17,8 +17,6 @@ import { TimingDump } from "../timingDump.ts"; import { TransportClient } from "./transportClient.ts"; export type { ClientSocketOptions, ClientSpawnOptions }; -export type { ClientTransportOptions, SyncClientOptions as ClientOptions } from "../options.ts"; -export type { SyncTransport } from "./transport.ts"; export class Client extends TransportClient { private readonly channel: SyncRpcChannel | undefined; diff --git a/packages/typescript/src/api/syncChannel.ts b/packages/typescript/src/api/syncChannel.ts index 0adfd45ab2c0c..6a002f7f22317 100644 --- a/packages/typescript/src/api/syncChannel.ts +++ b/packages/typescript/src/api/syncChannel.ts @@ -87,7 +87,7 @@ function trackChild(process: NodeJS.Process, child: ChildProcess): void { liveChildren.add(child); } -export function createPipePath(): string { +function createPipePath(): string { const process = nodeProcess(); return `\\\\.\\pipe\\tsgo-sync-${process.pid}-${process.getBuiltinModule("node:crypto").randomBytes(16).toString("hex")}`; } diff --git a/packages/typescript/src/api/timing.ts b/packages/typescript/src/api/timing.ts index b4d719d4c2869..05672d852bb3f 100644 --- a/packages/typescript/src/api/timing.ts +++ b/packages/typescript/src/api/timing.ts @@ -14,7 +14,7 @@ */ /** Number of most-recent requests retained in the ring buffer. */ -export const RECENT_REQUEST_CAPACITY = 5; +const RECENT_REQUEST_CAPACITY = 5; /** A single request's measured timing and transfer sample. */ export interface RequestTiming { diff --git a/packages/typescript/src/ast/is.ts b/packages/typescript/src/ast/is.ts index f69661af7a03f..5516ccc2f3ff6 100644 --- a/packages/typescript/src/ast/is.ts +++ b/packages/typescript/src/ast/is.ts @@ -476,7 +476,7 @@ function isUnaryExpressionKind(kind: SyntaxKind): boolean { } /** @internal */ -export function isOuterExpression(node: Node, kinds: OuterExpressionKinds = OuterExpressionKinds.All): node is OuterExpression { +function isOuterExpression(node: Node, kinds: OuterExpressionKinds = OuterExpressionKinds.All): node is OuterExpression { switch (node.kind) { case SyntaxKind.ParenthesizedExpression: if (kinds & OuterExpressionKinds.ExcludeJSDocTypeAssertion && isJSDocTypeAssertion(node as ParenthesizedExpression)) { diff --git a/packages/typescript/src/internal/utils.ts b/packages/typescript/src/internal/utils.ts index f04a0462035d2..ecfb47c8e4fb3 100644 --- a/packages/typescript/src/internal/utils.ts +++ b/packages/typescript/src/internal/utils.ts @@ -24,7 +24,7 @@ export interface MapLike { * @param map A map-like. * @param key A property key. */ -export function hasProperty(map: MapLike, key: string): boolean { +function hasProperty(map: MapLike, key: string): boolean { return hasOwnProperty.call(map, key); } @@ -33,7 +33,7 @@ export function assertNever(member: never, message = "Illegal value:", stackCraw return fail(`${message} ${detail}`, stackCrawlMark || assertNever); } -export function fail(message?: string, stackCrawlMark?: AnyFunction): never { +function fail(message?: string, stackCrawlMark?: AnyFunction): never { // eslint-disable-next-line no-debugger debugger; const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); diff --git a/packages/vscode-typescript/src/configurationMiddleware.ts b/packages/vscode-typescript/src/configurationMiddleware.ts index 75928b54be531..9cb77ad716382 100644 --- a/packages/vscode-typescript/src/configurationMiddleware.ts +++ b/packages/vscode-typescript/src/configurationMiddleware.ts @@ -1,7 +1,9 @@ import * as vscode from "vscode"; -import type { ConfigurationMiddleware } from "vscode-languageclient"; -import type { MessageSignature } from "vscode-languageserver-protocol"; +import type { + ConfigurationMiddleware, + MessageSignature, +} from "vscode-languageclient"; /** * Configuration middleware for the TypeScript language server. diff --git a/packages/vscode-typescript/src/contentMapperContributions.ts b/packages/vscode-typescript/src/contentMapperContributions.ts index 8be5dc01a8acd..596f2a8037a73 100644 --- a/packages/vscode-typescript/src/contentMapperContributions.ts +++ b/packages/vscode-typescript/src/contentMapperContributions.ts @@ -1,5 +1,5 @@ import type { ContentMapperContribution } from "@typescript/typescript/vscode"; -export type { ContentMapperContribution, ContentMapperManifest } from "@typescript/typescript/vscode"; +export type { ContentMapperContribution } from "@typescript/typescript/vscode"; export interface SerializedContentMapperContribution { readonly contributorId: string; diff --git a/packages/vscode-typescript/src/managedFileContext.ts b/packages/vscode-typescript/src/managedFileContext.ts deleted file mode 100644 index d1da83b63332f..0000000000000 --- a/packages/vscode-typescript/src/managedFileContext.ts +++ /dev/null @@ -1,56 +0,0 @@ -import * as vscode from "vscode"; -import { ActiveJsTsEditorTracker } from "./activeJsTsEditorTracker"; -import { - disabledSchemes, - isJsConfigOrTsConfigFileName, - isSupportedLanguageMode, -} from "./util"; - -/** - * When-clause context set when the current file is managed by tsgo. - */ -export class ManagedFileContextManager implements vscode.Disposable { - private static readonly contextName = "typescript.isManagedFile"; - - private isInManagedFileContext = false; - private disposables: vscode.Disposable[] = []; - - constructor(activeJsTsEditorTracker: ActiveJsTsEditorTracker) { - this.disposables.push( - activeJsTsEditorTracker.onDidChangeActiveJsTsEditor( - editor => this.onDidChangeActiveTextEditor(editor), - ), - ); - this.onDidChangeActiveTextEditor(activeJsTsEditorTracker.activeJsTsEditor); - } - - private onDidChangeActiveTextEditor(editor?: vscode.TextEditor): void { - if (editor) { - this.updateContext(this.isManagedFile(editor)); - } - else { - this.updateContext(false); - } - } - - private isManagedFile(editor: vscode.TextEditor): boolean { - if (disabledSchemes.has(editor.document.uri.scheme)) { - return false; - } - return isSupportedLanguageMode(editor.document) - || isJsConfigOrTsConfigFileName(editor.document.fileName); - } - - private updateContext(newValue: boolean): void { - if (newValue === this.isInManagedFileContext) { - return; - } - vscode.commands.executeCommand("setContext", ManagedFileContextManager.contextName, newValue); - this.isInManagedFileContext = newValue; - } - - dispose(): void { - this.updateContext(false); - this.disposables.forEach(d => d.dispose()); - } -} diff --git a/packages/vscode-typescript/src/telemetryReporting.ts b/packages/vscode-typescript/src/telemetryReporting.ts index 03f01b19b0e55..30a31e61bf125 100644 --- a/packages/vscode-typescript/src/telemetryReporting.ts +++ b/packages/vscode-typescript/src/telemetryReporting.ts @@ -90,14 +90,6 @@ export type LSErrorResponse = { stack: string; }; -export type EnableNativePreview = {}; - -export type DisableNativePreview = {}; - -export type RestartLanguageServer = {}; - -export type ReportIssue = {}; - export type UnexpectedTelemetryPurpose = { telemetryPurpose: string; }; diff --git a/packages/vscode-typescript/src/util.ts b/packages/vscode-typescript/src/util.ts index f81fe724d6c95..f2eeef7dd006a 100644 --- a/packages/vscode-typescript/src/util.ts +++ b/packages/vscode-typescript/src/util.ts @@ -7,7 +7,7 @@ import { resolvePackageExecutable } from "./tsdkPackage"; export const aiConnectionString = "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255"; export const languageClientName = "TypeScript Language Server"; -export const enableContributedNightlyVersion = true; +const enableContributedNightlyVersion = true; export const jsTsLanguageModes = [ "typescript", @@ -16,7 +16,7 @@ export const jsTsLanguageModes = [ "javascriptreact", ]; -export const builtinTSExtensionId = "vscode.typescript-language-features"; +const builtinTSExtensionId = "vscode.typescript-language-features"; /** * URI schemes for which JS/TS language features should be disabled. @@ -47,7 +47,7 @@ export interface ExeInfo { const packagedExeBaseNames = ["tsc", "tsgo"]; -export async function getBuiltinExePath(context: vscode.ExtensionContext): Promise { +async function getBuiltinExePath(context: vscode.ExtensionContext): Promise { if (context.extensionMode === vscode.ExtensionMode.Development) { const exeName = `tsc${process.platform === "win32" ? ".exe" : ""}`; const exe = context.asAbsolutePath(path.join("../../", "built", "local", exeName)); @@ -65,7 +65,7 @@ export async function getBuiltinExePath(context: vscode.ExtensionContext): Promi return getPackagedExePath(context.extension.extensionUri); } -export async function getNightlyExePath(): Promise { +async function getNightlyExePath(): Promise { const extension = vscode.extensions.getExtension(nightlyExtensionId); if (!extension) { return undefined; @@ -149,32 +149,6 @@ export async function getExe(context: vscode.ExtensionContext): Promise return getDefaultExePath(context); } -export async function hasTsdkConfigured(): Promise { - return (await getTsdkCandidates({ nativeOnly: false })).length > 0; -} - -export async function hasNativeTsdkConfigured(context: vscode.ExtensionContext): Promise { - return await getTsdkServerKind(context) === "lsp"; -} - -export async function getTsdkServerKind(context: vscode.ExtensionContext): Promise<"lsp" | "tsserver" | undefined> { - for (const candidate of getTrustedTsdkCandidates(context, await getTsdkCandidates({ nativeOnly: false }))) { - const kind = await classifyTsdk(candidate.value); - if (kind) { - return kind; - } - } -} - -async function classifyTsdk(tsdkPath: string): Promise<"lsp" | "tsserver" | undefined> { - if (await pathHasTsserverJs(tsdkPath)) { - return "tsserver"; - } - if (await resolveTsdkPathToExe(tsdkPath)) { - return "lsp"; - } -} - function getTrustedTsdkCandidates(context: vscode.ExtensionContext, tsdkCandidates: ExplicitConfigValue[]): ExplicitConfigValue[] { // If tsdk is set at the workspace level, require both workspace trust and // explicit user opt-in. Workspace trust can be revoked after the memento is @@ -414,8 +388,3 @@ export function readUnifiedConfig( export function contentMappersEnabled(): boolean { return vscode.workspace.getConfiguration("js/ts").get("contentMappers.enabled", true); } - -export interface PackageInfo { - name: string; - version: string; -} diff --git a/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts b/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts index a0dabf2062f80..69d9aa5069455 100644 --- a/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts +++ b/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; import type { CancellationToken } from "vscode"; -import type { MessageSignature } from "vscode-languageserver-protocol"; +import type { MessageSignature } from "vscode-languageclient/node"; import { isSupportedLanguageMode } from "./util"; const supportedSchemes = new Set(["file", "untitled"]); diff --git a/tools/scripts/gen/utils.mts b/tools/scripts/gen/utils.mts index 0ce2bfcfd34f0..6d4b121472d72 100644 --- a/tools/scripts/gen/utils.mts +++ b/tools/scripts/gen/utils.mts @@ -80,7 +80,7 @@ export interface RunOptions { signal?: AbortSignal; } -export function formatCommandArg(arg: string) { +function formatCommandArg(arg: string) { return arg && /^[\w@%+=:,./-]+$/.test(arg) ? arg : JSON.stringify(arg); } @@ -99,7 +99,7 @@ export async function run(command: string, args: readonly string[] = [], options ); } -export function globInputs(patterns: string[], exclude: string[] = []): string[] { +function globInputs(patterns: string[], exclude: string[] = []): string[] { return fs.globSync(patterns, { cwd: repoRoot, exclude }).map(file => path.join(repoRoot, file)); } diff --git a/tools/scripts/post-vsts-artifact-comment.mjs b/tools/scripts/post-vsts-artifact-comment.mjs deleted file mode 100644 index 1f8bec395c008..0000000000000 --- a/tools/scripts/post-vsts-artifact-comment.mjs +++ /dev/null @@ -1,111 +0,0 @@ -import { Octokit } from "@octokit/rest"; -import assert from "assert"; -import ado from "azure-devops-node-api"; - -/** - * @param {string} name - */ -function mustGetEnv(name) { - const value = process.env[name]; - assert(value, `No ${name} specified`); - return value; -} - -const REQUESTING_USER = mustGetEnv("REQUESTING_USER"); -const SOURCE_ISSUE = +mustGetEnv("SOURCE_ISSUE"); -const BUILD_BUILDID = +mustGetEnv("BUILD_BUILDID"); -const DISTINCT_ID = mustGetEnv("DISTINCT_ID"); -const STATUS_COMMENT = +mustGetEnv("STATUS_COMMENT"); - -const gh = new Octokit({ - auth: process.argv[2], -}); - -async function main() { - // The pipelines API does _not_ make getting the direct URL to a specific file _within_ an artifact trivial - const cli = new ado.WebApi("https://typescript.visualstudio.com/defaultcollection", ado.getHandlerFromToken("")); // Empty token, anon auth - const build = await cli.getBuildApi(); - const artifact = await build.getArtifact("typescript", BUILD_BUILDID, "tgz"); - assert(artifact.resource?.url); - const updatedUrl = new URL(artifact.resource.url); - updatedUrl.search = `artifactName=tgz&fileId=${artifact.resource.data}&fileName=manifest`; - const resp = await (await fetch(`${updatedUrl}`)).json(); - const file = /** @type {any} */ (resp).items[0]; - const tgzUrl = new URL(artifact.resource.url); - tgzUrl.search = `artifactName=tgz&fileId=${file.blob.id}&fileName=${file.path}`; - const link = "" + tgzUrl; - - // Please keep the strings "an installable tgz" and "packed" in this message, as well as the devDependencies section, - // so that the playgrounds deployment process can find these comments. - - const comment = `Hey @${REQUESTING_USER}, I've packed this into [an installable tgz](${link}). You can install it for testing by referencing it in your \`package.json\` like so: -\`\`\` -{ - "devDependencies": { - "typescript": "${link}" - } -} -\`\`\` -and then running \`npm install\`. -`; - - // Temporarily disable until we get access controls set up right - // Send a ping to https://github.com/microsoft/typescript-make-monaco-builds#pull-request-builds - await gh.request("POST /repos/microsoft/typescript-make-monaco-builds/dispatches", { event_type: `${SOURCE_ISSUE}`, headers: { Accept: "application/vnd.github.everest-preview+json" } }); - - return comment; -} - -let newComment; -let emoji; - -try { - newComment = await main(); - emoji = "✅"; -} -catch (e) { - console.error(e); - newComment = `Hey @${REQUESTING_USER}, something went wrong when looking for the build artifact. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${BUILD_BUILDID}&_a=summary)).`; - emoji = "❌"; -} - -const resultsComment = await gh.issues.createComment({ - issue_number: SOURCE_ISSUE, - owner: "microsoft", - repo: "TypeScript", - body: newComment, -}); - -const toReplace = ``; -let posted = false; -for (let i = 0; i < 5; i++) { - // Get status comment contents - const statusComment = await gh.rest.issues.getComment({ - comment_id: STATUS_COMMENT, - owner: "microsoft", - repo: "TypeScript", - }); - - const oldComment = statusComment.data.body; - if (!oldComment?.includes(toReplace)) { - posted = true; - break; - } - - const newComment = oldComment.replace(toReplace, `[${emoji} Results](${resultsComment.data.html_url})`); - - // Update status comment - await gh.rest.issues.updateComment({ - comment_id: STATUS_COMMENT, - owner: "microsoft", - repo: "TypeScript", - body: newComment, - }); - - // Repeat; someone may have edited the comment at the same time. - await new Promise(resolve => setTimeout(resolve, 1000)); -} - -if (!posted) { - throw new Error("Failed to update status comment"); -} diff --git a/tools/scripts/tsc/generate-encoder.ts b/tools/scripts/tsc/generate-encoder.ts index fa8d7236adf21..33684f2f006e4 100644 --- a/tools/scripts/tsc/generate-encoder.ts +++ b/tools/scripts/tsc/generate-encoder.ts @@ -1050,27 +1050,6 @@ function generateTSProtocol(): string { w.write("};"); w.write(""); - // singleChildNodePropertyNames mapping - w.write("export const singleChildNodePropertyNames: Readonly>> = {"); - w.push(); - - for (const node of api.nodes()) { - const info = analyzeNode(node); - if (info.dataType === "extended") continue; - if (info.childProps.length !== 1) continue; - - const kinds = getTSKinds(node); - const prop = api.uncapitalize(info.childProps[0].name); - - for (const kind of kinds) { - w.write(`[SyntaxKind.${kind}]: "${prop}",`); - } - } - - w.pop(); - w.write("};"); - w.write(""); - return w.toString(); } diff --git a/tools/scripts/tsc/schema.ts b/tools/scripts/tsc/schema.ts index eb48ac6a1d919..61f9d7c96cab4 100644 --- a/tools/scripts/tsc/schema.ts +++ b/tools/scripts/tsc/schema.ts @@ -783,7 +783,7 @@ export interface Schema { * Wraps the parsed ast.json schema and provides common query/resolution * methods used by both the Go and TS code generators. */ -export class SchemaAPI { +class SchemaAPI { readonly schema: Schema; private readonly listAliasNameMap = new Map(); private readonly instantiationAliasMap = new Map();