Skip to content

Commit c7c0767

Browse files
authored
fix(compat): update patch for [email protected] (#6248)
**What's the problem this PR addresses?** The PnP compatibility patch for TypeScript doesn't apply to `[email protected]`. Ref microsoft/TypeScript#35206 **How did you fix it?** Rebased it. **Checklist** - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). - [x] I have set the packages that need to be released for my changes to be effective. - [x] I will check that all automated PR checks pass before the PR gets reviewed.
1 parent c8c59ff commit c7c0767

20 files changed

+1150
-59
lines changed

.pnp.cjs

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

.yarn/sdks/typescript/lib/tsserver.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ const relPnpApiPath = "../../../../.pnp.cjs";
99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
1010
const absRequire = createRequire(absPnpApiPath);
1111

12+
if (existsSync(absPnpApiPath)) {
13+
if (!process.versions.pnp) {
14+
// Setup the environment to be able to require typescript/lib/tsserver.js
15+
require(absPnpApiPath).setup();
16+
}
17+
}
18+
1219
const moduleWrapper = tsserver => {
1320
if (!process.versions.pnp) {
1421
return tsserver;
@@ -214,12 +221,7 @@ const moduleWrapper = tsserver => {
214221
return tsserver;
215222
};
216223

217-
if (existsSync(absPnpApiPath)) {
218-
if (!process.versions.pnp) {
219-
// Setup the environment to be able to require typescript/lib/tsserver.js
220-
require(absPnpApiPath).setup();
221-
}
222-
}
224+
moduleWrapper(absRequire(`typescript`));
223225

224226
// Defer to the real typescript/lib/tsserver.js your application uses
225227
module.exports = moduleWrapper(absRequire(`typescript/lib/tsserver.js`));

.yarn/sdks/typescript/lib/tsserverlibrary.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ const relPnpApiPath = "../../../../.pnp.cjs";
99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
1010
const absRequire = createRequire(absPnpApiPath);
1111

12+
if (existsSync(absPnpApiPath)) {
13+
if (!process.versions.pnp) {
14+
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
15+
require(absPnpApiPath).setup();
16+
}
17+
}
18+
1219
const moduleWrapper = tsserver => {
1320
if (!process.versions.pnp) {
1421
return tsserver;
@@ -214,12 +221,7 @@ const moduleWrapper = tsserver => {
214221
return tsserver;
215222
};
216223

217-
if (existsSync(absPnpApiPath)) {
218-
if (!process.versions.pnp) {
219-
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
220-
require(absPnpApiPath).setup();
221-
}
222-
}
224+
moduleWrapper(absRequire(`typescript`));
223225

224226
// Defer to the real typescript/lib/tsserverlibrary.js your application uses
225227
module.exports = moduleWrapper(absRequire(`typescript/lib/tsserverlibrary.js`));

.yarn/sdks/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript",
3-
"version": "5.4.1-rc-sdk",
3+
"version": "5.5.0-beta-sdk",
44
"main": "./lib/typescript.js",
55
"type": "commonjs",
66
"bin": {

.yarn/versions/80caa95b.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/plugin-compat": patch
4+
"@yarnpkg/sdks": patch
5+
6+
declined:
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-init"
11+
- "@yarnpkg/plugin-interactive-tools"
12+
- "@yarnpkg/plugin-nm"
13+
- "@yarnpkg/plugin-npm-cli"
14+
- "@yarnpkg/plugin-pack"
15+
- "@yarnpkg/plugin-patch"
16+
- "@yarnpkg/plugin-pnp"
17+
- "@yarnpkg/plugin-pnpm"
18+
- "@yarnpkg/plugin-stage"
19+
- "@yarnpkg/plugin-typescript"
20+
- "@yarnpkg/plugin-version"
21+
- "@yarnpkg/plugin-workspace-tools"
22+
- "@yarnpkg/builder"
23+
- "@yarnpkg/core"
24+
- "@yarnpkg/doctor"

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"jest": "^29.2.1",
2828
"pirates": "^4.0.5",
2929
"tslib": "^2.4.0",
30-
"typescript": "5.4.1-rc"
30+
"typescript": "5.5.0-beta"
3131
},
3232
"resolutions": {
3333
"ink": "patch:ink@npm%3A3.0.8#~/.yarn/patches/ink-npm-3.0.8-3a8005f59f.patch",
@@ -81,5 +81,6 @@
8181
"chalk": "^3.0.0",
8282
"micromatch": "^4.0.2",
8383
"semver": "^7.1.2"
84-
}
84+
},
85+
"packageManager": "[email protected]+sha256.f3cc0eda8e5560e529c7147565b30faa43b4e472d90e8634d7134a37c7f59781"
8586
}

packages/docusaurus/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"fast-glob": "^3.2.2",
102102
"mdast-util-mdx-jsx": "^3.0.0",
103103
"typedoc": "^0.25.7",
104-
"typescript": "5.4.1-rc",
104+
"typescript": "5.5.0-beta",
105105
"unified": "^11.0.4"
106106
},
107107
"browserslist": {

packages/plugin-compat/extra/typescript/gen-typescript-patch.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,14 @@ const SLICES = [
267267
from: `786e26825dad9dcc0eff79610bffd8bb121e7e8a`,
268268
to: `786e26825dad9dcc0eff79610bffd8bb121e7e8a`,
269269
onto: `db6b2a980280a9c87799b9c1edd6d71e92bb255b`,
270-
range: `>=5.4.1-rc`,
270+
range: `>=5.4.1-rc <5.5.0-beta`,
271+
},
272+
// https://github.com/yarnpkg/TypeScript/tree/merceyz/pnp-5.5-beta
273+
{
274+
from: `f90eb7508e66a3d5066b1d8a06606c6c23f3df43`,
275+
to: `43d2cbd6ac423e35a5a095a509fc90c03f0c22ba`,
276+
onto: `b574864abc989d0f8b15367baea1058819e126ba`,
277+
range: `>=5.5.0-beta`,
271278
},
272279
];
273280

@@ -531,10 +538,10 @@ async function main() {
531538
const patch = await run(slice);
532539
const versions = await fetchVersions(slice.range);
533540

534-
for (const version of versions) {
541+
await Promise.all(versions.map(async version => {
535542
console.log(`Validating ${version}...`);
536543
await validate(version, patch);
537-
}
544+
}));
538545

539546
patches.push(patch);
540547
}

packages/plugin-compat/extra/typescript/patch-14d8ce3d823cd5772f690ee6089998f1.diff

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff --git a/lib/tsc.js b/lib/tsc.js
22
index 49a42a27b..0625b052d 100644
3-
semver exclusivity >=5.4.1-rc
3+
semver exclusivity >=5.4.1-rc <5.5.0-beta
44
--- a/lib/tsc.js
55
+++ b/lib/tsc.js
66
@@ -5063,6 +5063,9 @@ var sys = (() => {
@@ -345,7 +345,7 @@ semver exclusivity >=5.4.1-rc
345345
function reloadFileNamesFromConfigFile() {
346346
diff --git a/lib/tsserver.js b/lib/tsserver.js
347347
index 707a6387a..491cb8fa7 100644
348-
semver exclusivity >=5.4.1-rc
348+
semver exclusivity >=5.4.1-rc <5.5.0-beta
349349
--- a/lib/tsserver.js
350350
+++ b/lib/tsserver.js
351351
@@ -8611,6 +8611,9 @@ var sys = (() => {
@@ -1002,7 +1002,7 @@ semver exclusivity >=5.4.1-rc
10021002
this.installer.on("message", (m) => this.handleMessage(m));
10031003
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
10041004
index a13173346..b0e8856e1 100644
1005-
semver exclusivity >=5.4.1-rc
1005+
semver exclusivity >=5.4.1-rc <5.5.0-beta
10061006
--- a/lib/typescript.d.ts
10071007
+++ b/lib/typescript.d.ts
10081008
@@ -9903,6 +9903,8 @@ declare namespace ts {
@@ -1016,7 +1016,7 @@ semver exclusivity >=5.4.1-rc
10161016
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
10171017
diff --git a/lib/typescript.js b/lib/typescript.js
10181018
index a75d7ba4b..fd5189269 100644
1019-
semver exclusivity >=5.4.1-rc
1019+
semver exclusivity >=5.4.1-rc <5.5.0-beta
10201020
--- a/lib/typescript.js
10211021
+++ b/lib/typescript.js
10221022
@@ -6370,6 +6370,9 @@ ${lanes.join("\n")}
@@ -1719,7 +1719,7 @@ semver exclusivity >=5.4.1-rc
17191719
let result = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(path);
17201720
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
17211721
index 7d305c002..0162dd8ae 100644
1722-
semver exclusivity >=5.4.1-rc
1722+
semver exclusivity >=5.4.1-rc <5.5.0-beta
17231723
--- a/lib/typingsInstaller.js
17241724
+++ b/lib/typingsInstaller.js
17251725
@@ -4475,6 +4475,9 @@ var sys = (() => {

0 commit comments

Comments
 (0)