Skip to content

Commit 3861cc1

Browse files
authored
Update VS Code SDKs (#5718)
All changes were generated by the following command: ``` $ yarn dlx @yarnpkg/sdks vscode ➤ YN0000: · Yarn 4.0.2 ➤ YN0000: ┌ Resolution step ➤ YN0085: │ + @yarnpkg/sdks@npm:3.2.0, @arcanis/slice-ansi@npm:1.1.1, and 102 more. ➤ YN0000: └ Completed in 0s 540ms ➤ YN0000: ┌ Fetch step ➤ YN0013: │ 104 packages were added to the project (+ 2.89 MiB). ➤ YN0000: └ Completed in 0s 293ms ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed in 1s 72ms ➤ YN0000: · Done in 1s 942ms ➤ YN0000: Cleaning up the existing SDK files... ➤ YN0000: ┌ Generating SDKs inside .yarn/sdks ➤ YN0000: │ ✓ Eslint ➤ YN0000: │ ✓ Prettier ➤ YN0000: │ ✓ Typescript ➤ YN0000: │ • 5 SDKs were skipped based on your root dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Generating settings ➤ YN0000: │ ✓ Vscode (updated 🔼) ➤ YN0000: └ Completed ```
1 parent 10abeff commit 3861cc1

File tree

16 files changed

+433
-90
lines changed

16 files changed

+433
-90
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"**/.pnp.*": true
55
},
66
"eslint.nodePath": ".yarn/sdks",
7-
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
7+
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
88
"typescript.tsdk": ".yarn/sdks/typescript/lib",
99
"typescript.enablePromptUseWorkspaceTsdk": true
1010
}

.yarn/sdks/eslint/bin/eslint.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
1116

1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require eslint/bin/eslint.js
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real eslint/bin/eslint.js your application uses
20-
module.exports = absRequire(`eslint/bin/eslint.js`);
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));

.yarn/sdks/eslint/lib/api.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
1116

1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
14-
// Setup the environment to be able to require eslint/lib/api.js
19+
// Setup the environment to be able to require eslint
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

19-
// Defer to the real eslint/lib/api.js your application uses
20-
module.exports = absRequire(`eslint/lib/api.js`);
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require eslint/use-at-your-own-risk
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real eslint/use-at-your-own-risk your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));

.yarn/sdks/eslint/package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"name": "eslint",
3-
"version": "6.8.0-sdk",
3+
"version": "8.51.0-sdk",
44
"main": "./lib/api.js",
5-
"type": "commonjs"
5+
"type": "commonjs",
6+
"bin": {
7+
"eslint": "./bin/eslint.js"
8+
},
9+
"exports": {
10+
"./package.json": "./package.json",
11+
".": "./lib/api.js",
12+
"./use-at-your-own-risk": "./lib/unsupported-api.js"
13+
}
614
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require prettier/bin/prettier.cjs
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real prettier/bin/prettier.cjs your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));

.yarn/sdks/prettier/index.cjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
16+
17+
if (existsSync(absPnpApiPath)) {
18+
if (!process.versions.pnp) {
19+
// Setup the environment to be able to require prettier
20+
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
24+
}
25+
}
26+
27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
31+
// Defer to the real prettier your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`prettier`));

.yarn/sdks/prettier/index.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

.yarn/sdks/prettier/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "prettier",
3-
"version": "1.19.1-sdk",
4-
"main": "./index.js",
5-
"type": "commonjs"
3+
"version": "3.0.3-sdk",
4+
"main": "./index.cjs",
5+
"type": "commonjs",
6+
"bin": "./bin/prettier.cjs"
67
}

.yarn/sdks/typescript/bin/tsc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/usr/bin/env node
22

33
const {existsSync} = require(`fs`);
4-
const {createRequire, createRequireFromPath} = require(`module`);
4+
const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
67

78
const relPnpApiPath = "../../../../.pnp.cjs";
89

910
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
10-
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
11+
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
12+
const absRequire = createRequire(absPnpApiPath);
13+
14+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
15+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
1116

1217
if (existsSync(absPnpApiPath)) {
1318
if (!process.versions.pnp) {
1419
// Setup the environment to be able to require typescript/bin/tsc
1520
require(absPnpApiPath).setup();
21+
if (isPnpLoaderEnabled && register) {
22+
register(pathToFileURL(absPnpLoaderPath));
23+
}
1624
}
1725
}
1826

27+
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
28+
? exports => absRequire(absUserWrapperPath)(exports)
29+
: exports => exports;
30+
1931
// Defer to the real typescript/bin/tsc your application uses
20-
module.exports = absRequire(`typescript/bin/tsc`);
32+
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));

0 commit comments

Comments
 (0)