Skip to content

Commit e4b94b2

Browse files
committed
Update yarn SDKs
1 parent b08572c commit e4b94b2

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed
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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"name": "eslint",
3-
"version": "7.26.0-sdk",
3+
"version": "8.57.1-sdk",
44
"main": "./lib/api.js",
55
"type": "commonjs",
66
"bin": {
77
"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"
813
}
914
}

.yarn/sdks/prettier/bin-prettier.js renamed to .yarn/sdks/prettier/bin/prettier.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {createRequire, register} = require(`module`);
55
const {resolve} = require(`path`);
66
const {pathToFileURL} = require(`url`);
77

8-
const relPnpApiPath = "../../../.pnp.cjs";
8+
const relPnpApiPath = "../../../../.pnp.cjs";
99

1010
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
1111
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
@@ -16,7 +16,7 @@ const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
1616

1717
if (existsSync(absPnpApiPath)) {
1818
if (!process.versions.pnp) {
19-
// Setup the environment to be able to require prettier/bin-prettier.js
19+
// Setup the environment to be able to require prettier/bin/prettier.cjs
2020
require(absPnpApiPath).setup();
2121
if (isPnpLoaderEnabled && register) {
2222
register(pathToFileURL(absPnpLoaderPath));
@@ -28,5 +28,5 @@ const wrapWithUserWrapper = existsSync(absUserWrapperPath)
2828
? exports => absRequire(absUserWrapperPath)(exports)
2929
: exports => exports;
3030

31-
// Defer to the real prettier/bin-prettier.js your application uses
32-
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin-prettier.js`));
31+
// Defer to the real prettier/bin/prettier.cjs your application uses
32+
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));
File renamed without changes.

.yarn/sdks/prettier/package.json

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

.yarn/sdks/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript",
3-
"version": "4.9.5-sdk",
3+
"version": "5.8.3-sdk",
44
"main": "./lib/typescript.js",
55
"type": "commonjs",
66
"bin": {

0 commit comments

Comments
 (0)