VSCode sdk

This commit is contained in:
Siwoo Jeon 2024-06-22 00:02:56 +09:00
parent 98d0e121d3
commit a3c15d470a
Signed by: migan
GPG key ID: C4151385FFD2082A
11 changed files with 94 additions and 21 deletions

View file

@ -1,3 +1,6 @@
{ {
"recommendations": ["arcanis.vscode-zipfs", "esbenp.prettier-vscode"] "recommendations": [
"arcanis.vscode-zipfs",
"esbenp.prettier-vscode"
]
} }

9
.yarn/sdks/prettier/bin/prettier.cjs vendored Normal file → Executable file
View file

@ -1,18 +1,25 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) { if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) { if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/bin/prettier.cjs // Setup the environment to be able to require prettier/bin/prettier.cjs
require(absPnpApiPath).setup(); require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
} }
} }

View file

@ -1,18 +1,25 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../.pnp.cjs"; const relPnpApiPath = "../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) { if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) { if (!process.versions.pnp) {
// Setup the environment to be able to require prettier // Setup the environment to be able to require prettier
require(absPnpApiPath).setup(); require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "prettier", "name": "prettier",
"version": "3.0.3-sdk", "version": "3.2.5-sdk",
"main": "./index.cjs", "main": "./index.cjs",
"type": "commonjs", "type": "commonjs",
"bin": "./bin/prettier.cjs" "bin": "./bin/prettier.cjs"

View file

@ -1,18 +1,25 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) { if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) { if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc // Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup(); require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
} }
} }

View file

@ -1,18 +1,25 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) { if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) { if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsserver // Setup the environment to be able to require typescript/bin/tsserver
require(absPnpApiPath).setup(); require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
} }
} }

View file

@ -1,18 +1,25 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) { if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) { if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsc.js // Setup the environment to be able to require typescript/lib/tsc.js
require(absPnpApiPath).setup(); require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
} }
} }

View file

@ -1,14 +1,28 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserver.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const moduleWrapper = tsserver => { const moduleWrapper = tsserver => {
if (!process.versions.pnp) { if (!process.versions.pnp) {
return tsserver; return tsserver;
@ -214,11 +228,11 @@ const moduleWrapper = tsserver => {
return tsserver; return tsserver;
}; };
if (existsSync(absPnpApiPath)) { const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
if (!process.versions.pnp) { // In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
// Setup the environment to be able to require typescript/lib/tsserver.js // Ref https://github.com/microsoft/TypeScript/pull/55326
require(absPnpApiPath).setup(); if (major > 5 || (major === 5 && minor >= 5)) {
} moduleWrapper(absRequire(`typescript`));
} }
// Defer to the real typescript/lib/tsserver.js your application uses // Defer to the real typescript/lib/tsserver.js your application uses

View file

@ -1,14 +1,28 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const moduleWrapper = tsserver => { const moduleWrapper = tsserver => {
if (!process.versions.pnp) { if (!process.versions.pnp) {
return tsserver; return tsserver;
@ -214,11 +228,11 @@ const moduleWrapper = tsserver => {
return tsserver; return tsserver;
}; };
if (existsSync(absPnpApiPath)) { const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
if (!process.versions.pnp) { // In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js // Ref https://github.com/microsoft/TypeScript/pull/55326
require(absPnpApiPath).setup(); if (major > 5 || (major === 5 && minor >= 5)) {
} moduleWrapper(absRequire(`typescript`));
} }
// Defer to the real typescript/lib/tsserverlibrary.js your application uses // Defer to the real typescript/lib/tsserverlibrary.js your application uses

View file

@ -1,18 +1,25 @@
#!/usr/bin/env node #!/usr/bin/env node
const {existsSync} = require(`fs`); const {existsSync} = require(`fs`);
const {createRequire} = require(`module`); const {createRequire, register} = require(`module`);
const {resolve} = require(`path`); const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) { if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) { if (!process.versions.pnp) {
// Setup the environment to be able to require typescript // Setup the environment to be able to require typescript
require(absPnpApiPath).setup(); require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "typescript", "name": "typescript",
"version": "5.2.2-sdk", "version": "5.4.5-sdk",
"main": "./lib/typescript.js", "main": "./lib/typescript.js",
"type": "commonjs", "type": "commonjs",
"bin": { "bin": {