diff --git a/.yarn/sdks/eslint/bin/eslint.js b/.yarn/sdks/eslint/bin/eslint.js index 943e2be..e6604ff 100755 --- a/.yarn/sdks/eslint/bin/eslint.js +++ b/.yarn/sdks/eslint/bin/eslint.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real eslint/bin/eslint.js your application uses module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`)); diff --git a/.yarn/sdks/eslint/lib/api.js b/.yarn/sdks/eslint/lib/api.js index 4329f32..8addf97 100644 --- a/.yarn/sdks/eslint/lib/api.js +++ b/.yarn/sdks/eslint/lib/api.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real eslint your application uses module.exports = wrapWithUserWrapper(absRequire(`eslint`)); diff --git a/.yarn/sdks/eslint/lib/unsupported-api.js b/.yarn/sdks/eslint/lib/unsupported-api.js index f3eeafe..c2b464c 100644 --- a/.yarn/sdks/eslint/lib/unsupported-api.js +++ b/.yarn/sdks/eslint/lib/unsupported-api.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real eslint/use-at-your-own-risk your application uses module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`)); diff --git a/.yarn/sdks/eslint/package.json b/.yarn/sdks/eslint/package.json index 237a5ae..4110fb0 100644 --- a/.yarn/sdks/eslint/package.json +++ b/.yarn/sdks/eslint/package.json @@ -1,14 +1,14 @@ { "name": "eslint", "version": "8.57.1-sdk", + "main": "./lib/api.js", "type": "commonjs", + "bin": { + "eslint": "./bin/eslint.js" + }, "exports": { "./package.json": "./package.json", ".": "./lib/api.js", "./use-at-your-own-risk": "./lib/unsupported-api.js" - }, - "main": "./lib/api.js", - "bin": { - "eslint": "./bin/eslint.js" } } diff --git a/.yarn/sdks/prettier/bin/prettier.cjs b/.yarn/sdks/prettier/bin/prettier.cjs index 511756a..9a4098f 100755 --- a/.yarn/sdks/prettier/bin/prettier.cjs +++ b/.yarn/sdks/prettier/bin/prettier.cjs @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real prettier/bin/prettier.cjs your application uses module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`)); diff --git a/.yarn/sdks/prettier/index.cjs b/.yarn/sdks/prettier/index.cjs index f3c47d9..57cb2ab 100644 --- a/.yarn/sdks/prettier/index.cjs +++ b/.yarn/sdks/prettier/index.cjs @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../.pnp.cjs'; +const relPnpApiPath = "../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real prettier your application uses module.exports = wrapWithUserWrapper(absRequire(`prettier`)); diff --git a/.yarn/sdks/prettier/package.json b/.yarn/sdks/prettier/package.json index 1dc7b4e..b9ab57f 100644 --- a/.yarn/sdks/prettier/package.json +++ b/.yarn/sdks/prettier/package.json @@ -1,7 +1,7 @@ { "name": "prettier", "version": "3.4.2-sdk", - "type": "commonjs", "main": "./index.cjs", + "type": "commonjs", "bin": "./bin/prettier.cjs" } diff --git a/.yarn/sdks/typescript/bin/tsc b/.yarn/sdks/typescript/bin/tsc index 7ef886b..867a7bd 100755 --- a/.yarn/sdks/typescript/bin/tsc +++ b/.yarn/sdks/typescript/bin/tsc @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real typescript/bin/tsc your application uses module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`)); diff --git a/.yarn/sdks/typescript/bin/tsserver b/.yarn/sdks/typescript/bin/tsserver index caeb708..3fc5aa3 100755 --- a/.yarn/sdks/typescript/bin/tsserver +++ b/.yarn/sdks/typescript/bin/tsserver @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real typescript/bin/tsserver your application uses module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`)); diff --git a/.yarn/sdks/typescript/lib/tsc.js b/.yarn/sdks/typescript/lib/tsc.js index 705b83d..da411bd 100644 --- a/.yarn/sdks/typescript/lib/tsc.js +++ b/.yarn/sdks/typescript/lib/tsc.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real typescript/lib/tsc.js your application uses module.exports = wrapWithUserWrapper(absRequire(`typescript/lib/tsc.js`)); diff --git a/.yarn/sdks/typescript/lib/tsserver.js b/.yarn/sdks/typescript/lib/tsserver.js index 60ecd16..6249c46 100644 --- a/.yarn/sdks/typescript/lib/tsserver.js +++ b/.yarn/sdks/typescript/lib/tsserver.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,13 +24,15 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; -const moduleWrapper = (exports) => { +const moduleWrapper = exports => { return wrapWithUserWrapper(moduleWrapperFn(exports)); }; -const moduleWrapperFn = (tsserver) => { +const moduleWrapperFn = tsserver => { if (!process.versions.pnp) { return tsserver; } @@ -38,15 +40,13 @@ const moduleWrapperFn = (tsserver) => { const {isAbsolute} = require(`path`); const pnpApi = require(`pnpapi`); - const isVirtual = (str) => str.match(/\/(\$\$virtual|__virtual__)\//); - const isPortal = (str) => str.startsWith('portal:/'); - const normalize = (str) => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); + const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//); + const isPortal = str => str.startsWith("portal:/"); + const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); - const dependencyTreeRoots = new Set( - pnpApi.getDependencyTreeRoots().map((locator) => { - return `${locator.name}@${locator.reference}`; - }), - ); + const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => { + return `${locator.name}@${locator.reference}`; + })); // VSCode sends the zip paths to TS using the "zip://" prefix, that TS // doesn't understand. This layer makes sure to remove the protocol @@ -96,55 +96,41 @@ const moduleWrapperFn = (tsserver) => { // Before | ^/zip/c:/foo/bar.zip/package.json // After | ^/zip//c:/foo/bar.zip/package.json // - case `vscode <1.61`: - { - str = `^zip:${str}`; - } - break; + case `vscode <1.61`: { + str = `^zip:${str}`; + } break; - case `vscode <1.66`: - { - str = `^/zip/${str}`; - } - break; + case `vscode <1.66`: { + str = `^/zip/${str}`; + } break; - case `vscode <1.68`: - { - str = `^/zip${str}`; - } - break; + case `vscode <1.68`: { + str = `^/zip${str}`; + } break; - case `vscode`: - { - str = `^/zip/${str}`; - } - break; + case `vscode`: { + str = `^/zip/${str}`; + } break; // To make "go to definition" work, // We have to resolve the actual file system path from virtual path // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) - case `coc-nvim`: - { - str = normalize(resolved).replace(/\.zip\//, `.zip::`); - str = resolve(`zipfile:${str}`); - } - break; + case `coc-nvim`: { + str = normalize(resolved).replace(/\.zip\//, `.zip::`); + str = resolve(`zipfile:${str}`); + } break; // Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server) // We have to resolve the actual file system path from virtual path, // everything else is up to neovim - case `neovim`: - { - str = normalize(resolved).replace(/\.zip\//, `.zip::`); - str = `zipfile://${str}`; - } - break; - - default: - { - str = `zip:${str}`; - } - break; + case `neovim`: { + str = normalize(resolved).replace(/\.zip\//, `.zip::`); + str = `zipfile://${str}`; + } break; + + default: { + str = `zip:${str}`; + } break; } } else { str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`); @@ -156,30 +142,26 @@ const moduleWrapperFn = (tsserver) => { function fromEditorPath(str) { switch (hostInfo) { - case `coc-nvim`: - { - str = str.replace(/\.zip::/, `.zip/`); - // The path for coc-nvim is in format of //zipfile://.yarn/... - // So in order to convert it back, we use .* to match all the thing - // before `zipfile:` - return process.platform === `win32` ? str.replace(/^.*zipfile:\//, ``) : str.replace(/^.*zipfile:/, ``); - } - break; - - case `neovim`: - { - str = str.replace(/\.zip::/, `.zip/`); - // The path for neovim is in format of zipfile:////.yarn/... - return str.replace(/^zipfile:\/\//, ``); - } - break; + case `coc-nvim`: { + str = str.replace(/\.zip::/, `.zip/`); + // The path for coc-nvim is in format of //zipfile://.yarn/... + // So in order to convert it back, we use .* to match all the thing + // before `zipfile:` + return process.platform === `win32` + ? str.replace(/^.*zipfile:\//, ``) + : str.replace(/^.*zipfile:/, ``); + } break; + + case `neovim`: { + str = str.replace(/\.zip::/, `.zip/`); + // The path for neovim is in format of zipfile:////.yarn/... + return str.replace(/^zipfile:\/\//, ``); + } break; case `vscode`: - default: - { - return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`); - } - break; + default: { + return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`) + } break; } } @@ -192,7 +174,7 @@ const moduleWrapperFn = (tsserver) => { // https://github.com/microsoft/vscode/issues/45856 const ConfiguredProject = tsserver.server.ConfiguredProject; const {enablePluginsWithOptions: originalEnablePluginsWithOptions} = ConfiguredProject.prototype; - ConfiguredProject.prototype.enablePluginsWithOptions = function () { + ConfiguredProject.prototype.enablePluginsWithOptions = function() { this.projectService.allowLocalPluginLoads = true; return originalEnablePluginsWithOptions.apply(this, arguments); }; @@ -218,12 +200,10 @@ const moduleWrapperFn = (tsserver) => { ) { hostInfo = parsedMessage.arguments.hostInfo; if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) { - const [, major, minor] = ( - process.env.VSCODE_IPC_HOOK.match( - // The RegExp from https://semver.org/ but without the caret at the start - /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, - ) ?? [] - ).map(Number); + const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match( + // The RegExp from https://semver.org/ but without the caret at the start + /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/ + ) ?? []).map(Number) if (major === 1) { if (minor < 61) { @@ -241,27 +221,23 @@ const moduleWrapperFn = (tsserver) => { return typeof value === 'string' ? fromEditorPath(value) : value; }); - return originalOnMessage.call(this, isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)); - }, - - send(/** @type {any} */ msg) { - return originalSend.call( + return originalOnMessage.call( this, - JSON.parse( - JSON.stringify(msg, (key, value) => { - return typeof value === `string` ? toEditorPath(value) : value; - }), - ), + isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON) ); }, + + send(/** @type {any} */ msg) { + return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => { + return typeof value === `string` ? toEditorPath(value) : value; + }))); + } }); return tsserver; }; -const [major, minor] = absRequire(`typescript/package.json`) - .version.split(`.`, 2) - .map((value) => parseInt(value, 10)); +const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10)); // In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well. // Ref https://github.com/microsoft/TypeScript/pull/55326 if (major > 5 || (major === 5 && minor >= 5)) { diff --git a/.yarn/sdks/typescript/lib/tsserverlibrary.js b/.yarn/sdks/typescript/lib/tsserverlibrary.js index 5688ca6..0e50e0a 100644 --- a/.yarn/sdks/typescript/lib/tsserverlibrary.js +++ b/.yarn/sdks/typescript/lib/tsserverlibrary.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,13 +24,15 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; -const moduleWrapper = (exports) => { +const moduleWrapper = exports => { return wrapWithUserWrapper(moduleWrapperFn(exports)); }; -const moduleWrapperFn = (tsserver) => { +const moduleWrapperFn = tsserver => { if (!process.versions.pnp) { return tsserver; } @@ -38,15 +40,13 @@ const moduleWrapperFn = (tsserver) => { const {isAbsolute} = require(`path`); const pnpApi = require(`pnpapi`); - const isVirtual = (str) => str.match(/\/(\$\$virtual|__virtual__)\//); - const isPortal = (str) => str.startsWith('portal:/'); - const normalize = (str) => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); + const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//); + const isPortal = str => str.startsWith("portal:/"); + const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); - const dependencyTreeRoots = new Set( - pnpApi.getDependencyTreeRoots().map((locator) => { - return `${locator.name}@${locator.reference}`; - }), - ); + const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => { + return `${locator.name}@${locator.reference}`; + })); // VSCode sends the zip paths to TS using the "zip://" prefix, that TS // doesn't understand. This layer makes sure to remove the protocol @@ -96,55 +96,41 @@ const moduleWrapperFn = (tsserver) => { // Before | ^/zip/c:/foo/bar.zip/package.json // After | ^/zip//c:/foo/bar.zip/package.json // - case `vscode <1.61`: - { - str = `^zip:${str}`; - } - break; + case `vscode <1.61`: { + str = `^zip:${str}`; + } break; - case `vscode <1.66`: - { - str = `^/zip/${str}`; - } - break; + case `vscode <1.66`: { + str = `^/zip/${str}`; + } break; - case `vscode <1.68`: - { - str = `^/zip${str}`; - } - break; + case `vscode <1.68`: { + str = `^/zip${str}`; + } break; - case `vscode`: - { - str = `^/zip/${str}`; - } - break; + case `vscode`: { + str = `^/zip/${str}`; + } break; // To make "go to definition" work, // We have to resolve the actual file system path from virtual path // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) - case `coc-nvim`: - { - str = normalize(resolved).replace(/\.zip\//, `.zip::`); - str = resolve(`zipfile:${str}`); - } - break; + case `coc-nvim`: { + str = normalize(resolved).replace(/\.zip\//, `.zip::`); + str = resolve(`zipfile:${str}`); + } break; // Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server) // We have to resolve the actual file system path from virtual path, // everything else is up to neovim - case `neovim`: - { - str = normalize(resolved).replace(/\.zip\//, `.zip::`); - str = `zipfile://${str}`; - } - break; - - default: - { - str = `zip:${str}`; - } - break; + case `neovim`: { + str = normalize(resolved).replace(/\.zip\//, `.zip::`); + str = `zipfile://${str}`; + } break; + + default: { + str = `zip:${str}`; + } break; } } else { str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`); @@ -156,30 +142,26 @@ const moduleWrapperFn = (tsserver) => { function fromEditorPath(str) { switch (hostInfo) { - case `coc-nvim`: - { - str = str.replace(/\.zip::/, `.zip/`); - // The path for coc-nvim is in format of //zipfile://.yarn/... - // So in order to convert it back, we use .* to match all the thing - // before `zipfile:` - return process.platform === `win32` ? str.replace(/^.*zipfile:\//, ``) : str.replace(/^.*zipfile:/, ``); - } - break; - - case `neovim`: - { - str = str.replace(/\.zip::/, `.zip/`); - // The path for neovim is in format of zipfile:////.yarn/... - return str.replace(/^zipfile:\/\//, ``); - } - break; + case `coc-nvim`: { + str = str.replace(/\.zip::/, `.zip/`); + // The path for coc-nvim is in format of //zipfile://.yarn/... + // So in order to convert it back, we use .* to match all the thing + // before `zipfile:` + return process.platform === `win32` + ? str.replace(/^.*zipfile:\//, ``) + : str.replace(/^.*zipfile:/, ``); + } break; + + case `neovim`: { + str = str.replace(/\.zip::/, `.zip/`); + // The path for neovim is in format of zipfile:////.yarn/... + return str.replace(/^zipfile:\/\//, ``); + } break; case `vscode`: - default: - { - return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`); - } - break; + default: { + return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`) + } break; } } @@ -192,7 +174,7 @@ const moduleWrapperFn = (tsserver) => { // https://github.com/microsoft/vscode/issues/45856 const ConfiguredProject = tsserver.server.ConfiguredProject; const {enablePluginsWithOptions: originalEnablePluginsWithOptions} = ConfiguredProject.prototype; - ConfiguredProject.prototype.enablePluginsWithOptions = function () { + ConfiguredProject.prototype.enablePluginsWithOptions = function() { this.projectService.allowLocalPluginLoads = true; return originalEnablePluginsWithOptions.apply(this, arguments); }; @@ -218,12 +200,10 @@ const moduleWrapperFn = (tsserver) => { ) { hostInfo = parsedMessage.arguments.hostInfo; if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) { - const [, major, minor] = ( - process.env.VSCODE_IPC_HOOK.match( - // The RegExp from https://semver.org/ but without the caret at the start - /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, - ) ?? [] - ).map(Number); + const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match( + // The RegExp from https://semver.org/ but without the caret at the start + /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/ + ) ?? []).map(Number) if (major === 1) { if (minor < 61) { @@ -241,27 +221,23 @@ const moduleWrapperFn = (tsserver) => { return typeof value === 'string' ? fromEditorPath(value) : value; }); - return originalOnMessage.call(this, isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)); - }, - - send(/** @type {any} */ msg) { - return originalSend.call( + return originalOnMessage.call( this, - JSON.parse( - JSON.stringify(msg, (key, value) => { - return typeof value === `string` ? toEditorPath(value) : value; - }), - ), + isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON) ); }, + + send(/** @type {any} */ msg) { + return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => { + return typeof value === `string` ? toEditorPath(value) : value; + }))); + } }); return tsserver; }; -const [major, minor] = absRequire(`typescript/package.json`) - .version.split(`.`, 2) - .map((value) => parseInt(value, 10)); +const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10)); // In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well. // Ref https://github.com/microsoft/TypeScript/pull/55326 if (major > 5 || (major === 5 && minor >= 5)) { diff --git a/.yarn/sdks/typescript/lib/typescript.js b/.yarn/sdks/typescript/lib/typescript.js index aff44a0..7b6cc22 100644 --- a/.yarn/sdks/typescript/lib/typescript.js +++ b/.yarn/sdks/typescript/lib/typescript.js @@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`); const {resolve} = require(`path`); const {pathToFileURL} = require(`url`); -const relPnpApiPath = '../../../../.pnp.cjs'; +const relPnpApiPath = "../../../../.pnp.cjs"; const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`); @@ -24,7 +24,9 @@ if (existsSync(absPnpApiPath)) { } } -const wrapWithUserWrapper = existsSync(absUserWrapperPath) ? (exports) => absRequire(absUserWrapperPath)(exports) : (exports) => exports; +const wrapWithUserWrapper = existsSync(absUserWrapperPath) + ? exports => absRequire(absUserWrapperPath)(exports) + : exports => exports; // Defer to the real typescript your application uses module.exports = wrapWithUserWrapper(absRequire(`typescript`)); diff --git a/.yarn/sdks/typescript/package.json b/.yarn/sdks/typescript/package.json index b912992..4c87e4c 100644 --- a/.yarn/sdks/typescript/package.json +++ b/.yarn/sdks/typescript/package.json @@ -1,8 +1,8 @@ { "name": "typescript", - "version": "5.6.3-sdk", - "type": "commonjs", + "version": "5.7.2-sdk", "main": "./lib/typescript.js", + "type": "commonjs", "bin": { "tsc": "./bin/tsc", "tsserver": "./bin/tsserver" diff --git a/.yarnrc.yml b/.yarnrc.yml index dfe2f9c..13a7b19 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,5 +1,3 @@ -# checksumBehavior: update - enableTelemetry: false preferInteractive: true diff --git a/yarn.lock b/yarn.lock index f9dfbb6..3f0f3d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1563,12 +1563,10 @@ __metadata: languageName: node linkType: hard -"agent-base@npm:^7.0.2, agent-base@npm:^7.1.0, agent-base@npm:^7.1.1": - version: 7.1.1 - resolution: "agent-base@npm:7.1.1" - dependencies: - debug: "npm:^4.3.4" - checksum: 10c0/e59ce7bed9c63bf071a30cc471f2933862044c97fd9958967bfe22521d7a0f601ce4ed5a8c011799d0c726ca70312142ae193bbebb60f576b52be19d4a363b50 +"agent-base@npm:^7.1.0, agent-base@npm:^7.1.2": + version: 7.1.3 + resolution: "agent-base@npm:7.1.3" + checksum: 10c0/6192b580c5b1d8fb399b9c62bf8343d76654c2dd62afcb9a52b2cf44a8b6ace1e3b704d3fe3547d91555c857d3df02603341ff2cb961b9cfe2b12f9f3c38ee11 languageName: node linkType: hard @@ -1944,9 +1942,14 @@ __metadata: linkType: hard "byte-size@npm:^9.0.0": - version: 9.0.0 - resolution: "byte-size@npm:9.0.0" - checksum: 10c0/1ae27afb966981e8e8347657a5b81b407c03386026b502237bfc0c0c253f26def6795b0f3bf44788286c6c49d1cf562398f5646e4f3ceba48b964b4852d83b33 + version: 9.0.1 + resolution: "byte-size@npm:9.0.1" + peerDependencies: + "@75lb/nature": "*" + peerDependenciesMeta: + "@75lb/nature": + optional: true + checksum: 10c0/0d97d7444a6d4ceb733fe863098417814487fee9a77a8584312566d1990201abcdf0a353085385c775074bb3e2867c1f97f2ca66b0483031af268bdb7403e2ed languageName: node linkType: hard @@ -1970,16 +1973,25 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.2, call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7": - version: 1.0.7 - resolution: "call-bind@npm:1.0.7" +"call-bind-apply-helpers@npm:^1.0.0": + version: 1.0.1 + resolution: "call-bind-apply-helpers@npm:1.0.1" dependencies: - es-define-property: "npm:^1.0.0" es-errors: "npm:^1.3.0" function-bind: "npm:^1.1.2" + checksum: 10c0/acb2ab68bf2718e68a3e895f0d0b73ccc9e45b9b6f210f163512ba76f91dab409eb8792f6dae188356f9095747512a3101646b3dea9d37fb8c7c6bf37796d18c + languageName: node + linkType: hard + +"call-bind@npm:^1.0.2, call-bind@npm:^1.0.5, call-bind@npm:^1.0.6, call-bind@npm:^1.0.7, call-bind@npm:^1.0.8": + version: 1.0.8 + resolution: "call-bind@npm:1.0.8" + dependencies: + call-bind-apply-helpers: "npm:^1.0.0" + es-define-property: "npm:^1.0.0" get-intrinsic: "npm:^1.2.4" - set-function-length: "npm:^1.2.1" - checksum: 10c0/a3ded2e423b8e2a265983dba81c27e125b48eefb2655e7dfab6be597088da3d47c47976c24bc51b8fd9af1061f8f87b4ab78a314f3c77784b2ae2ba535ad8b8d + set-function-length: "npm:^1.2.2" + checksum: 10c0/a13819be0681d915144467741b69875ae5f4eba8961eb0bf322aab63ec87f8250eb6d6b0dcbb2e1349876412a56129ca338592b3829ef4343527f5f18a0752d4 languageName: node linkType: hard @@ -2432,14 +2444,14 @@ __metadata: linkType: hard "debug@npm:4, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.7": - version: 4.3.7 - resolution: "debug@npm:4.3.7" + version: 4.4.0 + resolution: "debug@npm:4.4.0" dependencies: ms: "npm:^2.1.3" peerDependenciesMeta: supports-color: optional: true - checksum: 10c0/1471db19c3b06d485a622d62f65947a19a23fbd0dd73f7fd3eafb697eec5360cde447fb075919987899b1a2096e85d35d4eb5a4de09a57600ac9cf7e6c8e768b + checksum: 10c0/db94f1a182bf886f57b4755f85b3a74c39b5114b9377b7ab375dc2cfa3454f09490cc6c30f829df3fc8042bc8b8995f6567ce5cd96f3bc3688bd24027197d9de languageName: node linkType: hard @@ -2580,6 +2592,17 @@ __metadata: languageName: node linkType: hard +"dunder-proto@npm:^1.0.0": + version: 1.0.0 + resolution: "dunder-proto@npm:1.0.0" + dependencies: + call-bind-apply-helpers: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.2.0" + checksum: 10c0/b321e5cbf64f0a4c786b0b3dc187eb5197a83f6e05a1e11b86db25251b3ae6747c4b805d9e0a4fbf481d22a86a539dc75f82d883daeac7fc2ce4bd72ff5ef5a2 + languageName: node + linkType: hard + "duplexer@npm:^0.1.1": version: 0.1.2 resolution: "duplexer@npm:0.1.2" @@ -2718,12 +2741,10 @@ __metadata: languageName: node linkType: hard -"es-define-property@npm:^1.0.0": - version: 1.0.0 - resolution: "es-define-property@npm:1.0.0" - dependencies: - get-intrinsic: "npm:^1.2.4" - checksum: 10c0/6bf3191feb7ea2ebda48b577f69bdfac7a2b3c9bcf97307f55fd6ef1bbca0b49f0c219a935aca506c993d8c5d8bddd937766cb760cd5e5a1071351f2df9f9aa4 +"es-define-property@npm:^1.0.0, es-define-property@npm:^1.0.1": + version: 1.0.1 + resolution: "es-define-property@npm:1.0.1" + checksum: 10c0/3f54eb49c16c18707949ff25a1456728c883e81259f045003499efba399c08bad00deebf65cccde8c0e07908c1a225c9d472b7107e558f2a48e28d530e34527c languageName: node linkType: hard @@ -3410,15 +3431,18 @@ __metadata: linkType: hard "get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4": - version: 1.2.4 - resolution: "get-intrinsic@npm:1.2.4" + version: 1.2.5 + resolution: "get-intrinsic@npm:1.2.5" dependencies: + call-bind-apply-helpers: "npm:^1.0.0" + dunder-proto: "npm:^1.0.0" + es-define-property: "npm:^1.0.1" es-errors: "npm:^1.3.0" function-bind: "npm:^1.1.2" - has-proto: "npm:^1.0.1" - has-symbols: "npm:^1.0.3" - hasown: "npm:^2.0.0" - checksum: 10c0/0a9b82c16696ed6da5e39b1267104475c47e3a9bdbe8b509dfe1710946e38a87be70d759f4bb3cda042d76a41ef47fe769660f3b7c0d1f68750299344ffb15b7 + gopd: "npm:^1.2.0" + has-symbols: "npm:^1.1.0" + hasown: "npm:^2.0.2" + checksum: 10c0/dcaace9fd4b4dd127b6668f580393e1a704bad308b7b88d694145e2599ee6c51b70cbfd49c6c96a5ffdb14a70824a0b3bd9b78bad84953932e5f0c5da4e508fd languageName: node linkType: hard @@ -3612,12 +3636,10 @@ __metadata: languageName: node linkType: hard -"gopd@npm:^1.0.1, gopd@npm:^1.1.0": - version: 1.1.0 - resolution: "gopd@npm:1.1.0" - dependencies: - get-intrinsic: "npm:^1.2.4" - checksum: 10c0/acfa9914889700cf42eaf676e1dc2d5a277217580e36119a9a6f5b77197700fd8294b8994f257963845820e7b414c8f06e1b9f8dff6456b0f71f61d175fecf3c +"gopd@npm:^1.0.1, gopd@npm:^1.1.0, gopd@npm:^1.2.0": + version: 1.2.0 + resolution: "gopd@npm:1.2.0" + checksum: 10c0/50fff1e04ba2b7737c097358534eacadad1e68d24cccee3272e04e007bed008e68d2614f3987788428fd192a5ae3889d08fb2331417e4fc4a9ab366b2043cead languageName: node linkType: hard @@ -3676,16 +3698,16 @@ __metadata: languageName: node linkType: hard -"has-proto@npm:^1.0.1, has-proto@npm:^1.0.3": - version: 1.1.0 - resolution: "has-proto@npm:1.1.0" +"has-proto@npm:^1.0.3": + version: 1.2.0 + resolution: "has-proto@npm:1.2.0" dependencies: - call-bind: "npm:^1.0.7" - checksum: 10c0/d0aeb83ca76aa265a7629bf973d6338c310b8307cb7fa8b85f8f01a7d95fc3d6ede54eaedeb538a6c1ee4fc8961abfbe89ea88d9a78244fa03097fe5b506c10d + dunder-proto: "npm:^1.0.0" + checksum: 10c0/46538dddab297ec2f43923c3d35237df45d8c55a6fc1067031e04c13ed8a9a8f94954460632fd4da84c31a1721eefee16d901cbb1ae9602bab93bb6e08f93b95 languageName: node linkType: hard -"has-symbols@npm:^1.0.3": +"has-symbols@npm:^1.0.3, has-symbols@npm:^1.1.0": version: 1.1.0 resolution: "has-symbols@npm:1.1.0" checksum: 10c0/dde0a734b17ae51e84b10986e651c664379018d10b91b6b0e9b293eddb32f0f069688c841fb40f19e9611546130153e0a2a48fd7f512891fb000ddfa36f5a20e @@ -3754,12 +3776,12 @@ __metadata: linkType: hard "https-proxy-agent@npm:^7.0.1": - version: 7.0.5 - resolution: "https-proxy-agent@npm:7.0.5" + version: 7.0.6 + resolution: "https-proxy-agent@npm:7.0.6" dependencies: - agent-base: "npm:^7.0.2" + agent-base: "npm:^7.1.2" debug: "npm:4" - checksum: 10c0/2490e3acec397abeb88807db52cac59102d5ed758feee6df6112ab3ccd8325e8a1ce8bce6f4b66e5470eca102d31e425ace904242e4fa28dbe0c59c4bafa7b2c + checksum: 10c0/f729219bc735edb621fa30e6e84e60ee5d00802b8247aac0d7b79b0bd6d4b3294737a337b93b86a0bd9e68099d031858a39260c976dc14cdbba238ba1f8779ac languageName: node linkType: hard @@ -5294,9 +5316,9 @@ __metadata: linkType: hard "p-map@npm:^7.0.2": - version: 7.0.2 - resolution: "p-map@npm:7.0.2" - checksum: 10c0/e10548036648d1c043153f9997112fe5a7de54a319210238628f8ea22ee36587fd6ee740811f88b60bbf29d932e23ae35df7fced40df477116c84c18e797047e + version: 7.0.3 + resolution: "p-map@npm:7.0.3" + checksum: 10c0/46091610da2b38ce47bcd1d8b4835a6fa4e832848a6682cf1652bc93915770f4617afc844c10a77d1b3e56d2472bb2d5622353fa3ead01a7f42b04fc8e744a5c languageName: node linkType: hard @@ -5829,17 +5851,18 @@ __metadata: linkType: hard "reflect.getprototypeof@npm:^1.0.6": - version: 1.0.7 - resolution: "reflect.getprototypeof@npm:1.0.7" + version: 1.0.8 + resolution: "reflect.getprototypeof@npm:1.0.8" dependencies: - call-bind: "npm:^1.0.7" + call-bind: "npm:^1.0.8" define-properties: "npm:^1.2.1" + dunder-proto: "npm:^1.0.0" es-abstract: "npm:^1.23.5" es-errors: "npm:^1.3.0" get-intrinsic: "npm:^1.2.4" - gopd: "npm:^1.0.1" - which-builtin-type: "npm:^1.1.4" - checksum: 10c0/841814f7631b55ee42e198cb14a5c25c0752431ab8f0ad9794c32d46ab9fb0d5ba4939edac1f99a174a21443a1400a72bccbbb9ccd9277e4b4bf6d14aabb31c8 + gopd: "npm:^1.2.0" + which-builtin-type: "npm:^1.2.0" + checksum: 10c0/720479dd7a72a20d66efaca507ed7c7e18403d24ce764f436130464d4a516a12ed8a9a2714dcabc3e1296f9a31f914ba1095e2371619df23d3ac56c4f8c8bae1 languageName: node linkType: hard @@ -6023,7 +6046,7 @@ __metadata: languageName: node linkType: hard -"set-function-length@npm:^1.2.1": +"set-function-length@npm:^1.2.2": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" dependencies: @@ -6146,13 +6169,13 @@ __metadata: linkType: hard "socks-proxy-agent@npm:^8.0.3": - version: 8.0.4 - resolution: "socks-proxy-agent@npm:8.0.4" + version: 8.0.5 + resolution: "socks-proxy-agent@npm:8.0.5" dependencies: - agent-base: "npm:^7.1.1" + agent-base: "npm:^7.1.2" debug: "npm:^4.3.4" socks: "npm:^2.8.3" - checksum: 10c0/345593bb21b95b0508e63e703c84da11549f0a2657d6b4e3ee3612c312cb3a907eac10e53b23ede3557c6601d63252103494caa306b66560f43af7b98f53957a + checksum: 10c0/5d2c6cecba6821389aabf18728325730504bf9bb1d9e342e7987a5d13badd7a98838cc9a55b8ed3cb866ad37cc23e1086f09c4d72d93105ce9dfe76330e9d2a6 languageName: node linkType: hard @@ -6897,7 +6920,7 @@ __metadata: languageName: node linkType: hard -"which-builtin-type@npm:^1.1.4": +"which-builtin-type@npm:^1.2.0": version: 1.2.0 resolution: "which-builtin-type@npm:1.2.0" dependencies: