File tree Expand file tree Collapse file tree 11 files changed +79
-11
lines changed
packages/yarnpkg-sdks/sources Expand file tree Collapse file tree 11 files changed +79
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real eslint/bin/eslint.js your application uses
27
- module . exports = absRequire ( `eslint/bin/eslint.js` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `eslint/bin/eslint.js` ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real eslint your application uses
27
- module . exports = absRequire ( `eslint` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `eslint` ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real eslint/use-at-your-own-risk your application uses
27
- module . exports = absRequire ( `eslint/use-at-your-own-risk` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `eslint/use-at-your-own-risk` ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real typescript/bin/tsc your application uses
27
- module . exports = absRequire ( `typescript/bin/tsc` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `typescript/bin/tsc` ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real typescript/bin/tsserver your application uses
27
- module . exports = absRequire ( `typescript/bin/tsserver` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `typescript/bin/tsserver` ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real typescript/lib/tsc.js your application uses
27
- module . exports = absRequire ( `typescript/lib/tsc.js` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `typescript/lib/tsc.js` ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,7 +24,15 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
26
- const moduleWrapper = tsserver => {
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
31
+ const moduleWrapper = exports => {
32
+ return wrapWithUserWrapper ( moduleWrapperFn ( exports ) ) ;
33
+ } ;
34
+
35
+ const moduleWrapperFn = tsserver => {
27
36
if ( ! process . versions . pnp ) {
28
37
return tsserver ;
29
38
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,7 +24,15 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
26
- const moduleWrapper = tsserver => {
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
31
+ const moduleWrapper = exports => {
32
+ return wrapWithUserWrapper ( moduleWrapperFn ( exports ) ) ;
33
+ } ;
34
+
35
+ const moduleWrapperFn = tsserver => {
27
36
if ( ! process . versions . pnp ) {
28
37
return tsserver ;
29
38
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
8
8
const relPnpApiPath = "../../../../.pnp.cjs" ;
9
9
10
10
const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
11
+ const absUserWrapperPath = resolve ( __dirname , `./sdk.user.cjs` ) ;
11
12
const absRequire = createRequire ( absPnpApiPath ) ;
12
13
13
14
const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
@@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
23
24
}
24
25
}
25
26
27
+ const wrapWithUserWrapper = existsSync ( absUserWrapperPath )
28
+ ? exports => absRequire ( absUserWrapperPath ) ( exports )
29
+ : exports => exports ;
30
+
26
31
// Defer to the real typescript your application uses
27
- module . exports = absRequire ( `typescript` ) ;
32
+ module . exports = wrapWithUserWrapper ( absRequire ( `typescript` ) ) ;
Original file line number Diff line number Diff line change
1
+ releases :
2
+ " @yarnpkg/sdks " : minor
You can’t perform that action at this time.
0 commit comments