Skip to content

Commit

Permalink
Upgrade sdk's for yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Sep 20, 2024
1 parent a3ed44c commit 8ceff39
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// 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`));
7 changes: 6 additions & 1 deletion .yarn/sdks/eslint/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real eslint your application uses
module.exports = absRequire(`eslint`);
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
7 changes: 6 additions & 1 deletion .yarn/sdks/eslint/lib/unsupported-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

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 = absRequire(`eslint/use-at-your-own-risk`);
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));
2 changes: 1 addition & 1 deletion .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "8.57.0-sdk",
"version": "8.57.1-sdk",
"main": "./lib/api.js",
"type": "commonjs",
"bin": {
Expand Down
7 changes: 6 additions & 1 deletion .yarn/sdks/prettier/bin/prettier.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real prettier/bin/prettier.cjs your application uses
module.exports = absRequire(`prettier/bin/prettier.cjs`);
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));
7 changes: 6 additions & 1 deletion .yarn/sdks/prettier/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real prettier your application uses
module.exports = absRequire(`prettier`);
module.exports = wrapWithUserWrapper(absRequire(`prettier`));
7 changes: 6 additions & 1 deletion .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real typescript/bin/tsc your application uses
module.exports = absRequire(`typescript/bin/tsc`);
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));
7 changes: 6 additions & 1 deletion .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real typescript/bin/tsserver your application uses
module.exports = absRequire(`typescript/bin/tsserver`);
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`));
7 changes: 6 additions & 1 deletion .yarn/sdks/typescript/lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// 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`));
11 changes: 10 additions & 1 deletion .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,7 +24,15 @@ if (existsSync(absPnpApiPath)) {
}
}

const moduleWrapper = tsserver => {
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

const moduleWrapper = exports => {
return wrapWithUserWrapper(moduleWrapperFn(exports));
};

const moduleWrapperFn = tsserver => {
if (!process.versions.pnp) {
return tsserver;
}
Expand Down
11 changes: 10 additions & 1 deletion .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,7 +24,15 @@ if (existsSync(absPnpApiPath)) {
}
}

const moduleWrapper = tsserver => {
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

const moduleWrapper = exports => {
return wrapWithUserWrapper(moduleWrapperFn(exports));
};

const moduleWrapperFn = tsserver => {
if (!process.versions.pnp) {
return tsserver;
}
Expand Down
7 changes: 6 additions & 1 deletion .yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`);
Expand All @@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real typescript your application uses
module.exports = absRequire(`typescript`);
module.exports = wrapWithUserWrapper(absRequire(`typescript`));
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "5.5.3-sdk",
"version": "5.6.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs",
"bin": {
Expand Down

0 comments on commit 8ceff39

Please sign in to comment.