mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Update yarn SDK
This commit is contained in:
parent
e6e4c24cbb
commit
35bb7541d3
16
.yarn/sdks/eslint/bin/eslint.js
vendored
16
.yarn/sdks/eslint/bin/eslint.js
vendored
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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 eslint/bin/eslint.js
|
// Setup the environment to be able to require eslint/bin/eslint.js
|
||||||
require(absPnpApiPath).setup();
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real eslint/bin/eslint.js your application uses
|
// Defer to the real eslint/bin/eslint.js your application uses
|
||||||
module.exports = absRequire(`eslint/bin/eslint.js`);
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));
|
||||||
|
16
.yarn/sdks/eslint/lib/api.js
vendored
16
.yarn/sdks/eslint/lib/api.js
vendored
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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 eslint
|
// Setup the environment to be able to require eslint
|
||||||
require(absPnpApiPath).setup();
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real eslint your application uses
|
// Defer to the real eslint your application uses
|
||||||
module.exports = absRequire(`eslint`);
|
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
|
||||||
|
5
.yarn/sdks/eslint/package.json
vendored
5
.yarn/sdks/eslint/package.json
vendored
@ -2,5 +2,8 @@
|
|||||||
"name": "eslint",
|
"name": "eslint",
|
||||||
"version": "7.26.0-sdk",
|
"version": "7.26.0-sdk",
|
||||||
"main": "./lib/api.js",
|
"main": "./lib/api.js",
|
||||||
"type": "commonjs"
|
"type": "commonjs",
|
||||||
|
"bin": {
|
||||||
|
"eslint": "./bin/eslint.js"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
32
.yarn/sdks/prettier/bin-prettier.js
vendored
Executable file
32
.yarn/sdks/prettier/bin-prettier.js
vendored
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
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 prettier/bin-prettier.js
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real prettier/bin-prettier.js your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin-prettier.js`));
|
20
.yarn/sdks/prettier/index.js
vendored
Executable file → Normal file
20
.yarn/sdks/prettier/index.js
vendored
Executable file → Normal file
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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/index.js
|
// Setup the environment to be able to require prettier
|
||||||
require(absPnpApiPath).setup();
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defer to the real prettier/index.js your application uses
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
module.exports = absRequire(`prettier/index.js`);
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real prettier your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`prettier`));
|
||||||
|
5
.yarn/sdks/prettier/package.json
vendored
5
.yarn/sdks/prettier/package.json
vendored
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "prettier",
|
"name": "prettier",
|
||||||
"version": "2.8.1-sdk",
|
"version": "2.8.8-sdk",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"type": "commonjs"
|
"type": "commonjs",
|
||||||
|
"bin": "./bin-prettier.js"
|
||||||
}
|
}
|
||||||
|
16
.yarn/sdks/typescript/bin/tsc
vendored
16
.yarn/sdks/typescript/bin/tsc
vendored
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real typescript/bin/tsc your application uses
|
// Defer to the real typescript/bin/tsc your application uses
|
||||||
module.exports = absRequire(`typescript/bin/tsc`);
|
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));
|
||||||
|
16
.yarn/sdks/typescript/bin/tsserver
vendored
16
.yarn/sdks/typescript/bin/tsserver
vendored
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real typescript/bin/tsserver your application uses
|
// Defer to the real typescript/bin/tsserver your application uses
|
||||||
module.exports = absRequire(`typescript/bin/tsserver`);
|
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`));
|
||||||
|
16
.yarn/sdks/typescript/lib/tsc.js
vendored
16
.yarn/sdks/typescript/lib/tsc.js
vendored
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real typescript/lib/tsc.js your application uses
|
// Defer to the real typescript/lib/tsc.js your application uses
|
||||||
module.exports = absRequire(`typescript/lib/tsc.js`);
|
module.exports = wrapWithUserWrapper(absRequire(`typescript/lib/tsc.js`));
|
||||||
|
37
.yarn/sdks/typescript/lib/tsserver.js
vendored
37
.yarn/sdks/typescript/lib/tsserver.js
vendored
@ -1,15 +1,38 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
const absRequire = createRequire(absPnpApiPath);
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
const moduleWrapper = tsserver => {
|
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 wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
const moduleWrapper = exports => {
|
||||||
|
return wrapWithUserWrapper(moduleWrapperFn(exports));
|
||||||
|
};
|
||||||
|
|
||||||
|
const moduleWrapperFn = tsserver => {
|
||||||
if (!process.versions.pnp) {
|
if (!process.versions.pnp) {
|
||||||
return tsserver;
|
return tsserver;
|
||||||
}
|
}
|
||||||
@ -214,11 +237,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
|
||||||
|
37
.yarn/sdks/typescript/lib/tsserverlibrary.js
vendored
37
.yarn/sdks/typescript/lib/tsserverlibrary.js
vendored
@ -1,15 +1,38 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
const absRequire = createRequire(absPnpApiPath);
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
const moduleWrapper = tsserver => {
|
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 wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
const moduleWrapper = exports => {
|
||||||
|
return wrapWithUserWrapper(moduleWrapperFn(exports));
|
||||||
|
};
|
||||||
|
|
||||||
|
const moduleWrapperFn = tsserver => {
|
||||||
if (!process.versions.pnp) {
|
if (!process.versions.pnp) {
|
||||||
return tsserver;
|
return tsserver;
|
||||||
}
|
}
|
||||||
@ -214,11 +237,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
|
||||||
|
20
.yarn/sdks/typescript/lib/typescript.js
vendored
20
.yarn/sdks/typescript/lib/typescript.js
vendored
@ -1,20 +1,32 @@
|
|||||||
#!/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 absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
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/typescript.js
|
// Setup the environment to be able to require typescript
|
||||||
require(absPnpApiPath).setup();
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defer to the real typescript/lib/typescript.js your application uses
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
module.exports = absRequire(`typescript/lib/typescript.js`);
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real typescript your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`typescript`));
|
||||||
|
6
.yarn/sdks/typescript/package.json
vendored
6
.yarn/sdks/typescript/package.json
vendored
@ -2,5 +2,9 @@
|
|||||||
"name": "typescript",
|
"name": "typescript",
|
||||||
"version": "4.9.5-sdk",
|
"version": "4.9.5-sdk",
|
||||||
"main": "./lib/typescript.js",
|
"main": "./lib/typescript.js",
|
||||||
"type": "commonjs"
|
"type": "commonjs",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "./bin/tsc",
|
||||||
|
"tsserver": "./bin/tsserver"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user