Skip to content

Commit

Permalink
fix(compat): update patch for typescript@4.8.0-beta (#4568)
Browse files Browse the repository at this point in the history
* fix(compat): update patch for `typescript@4.8.0-beta`

* test: update expected value
  • Loading branch information
merceyz authored Jun 24, 2022
1 parent 483e1c2 commit 82a5ec4
Show file tree
Hide file tree
Showing 21 changed files with 3,289 additions and 69 deletions.
48 changes: 24 additions & 24 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions .yarn/versions/55dc1a63.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/libui": patch
"@yarnpkg/plugin-compat": patch
"@yarnpkg/plugin-workspace-tools": patch

declined:
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The following changes only affect people writing Yarn plugins:
### Compatibility

- The patched filesystem now supports `ftruncate`.
- Updates the PnP compatibility layer for TypeScript 4.8 Beta

## 3.2.1

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"eslint": "^8.2.0",
"jest": "^26.0.1",
"tslib": "^1.13.0",
"typescript": "4.7.0-beta"
"typescript": "4.8.0-beta"
},
"resolutions": {
"ink": "patch:ink@npm%3A3.0.8#~/.yarn/patches/ink-npm-3.0.8-3a8005f59f.patch",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"typedoc": "next",
"typedoc-neo-theme": "^1.0.7",
"typedoc-plugin-yarn": "portal:./typedoc-plugin-yarn",
"typescript": "4.7.0-beta",
"typescript": "4.8.0-beta",
"unescape-html": "^1.1.0",
"unfetch": "^4.1.0",
"unified": "^7.1.0",
Expand Down
31 changes: 16 additions & 15 deletions packages/plugin-compat/extra/typescript/gen-typescript-patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const TMP_DIR = `/tmp/ts-builds`;

const IGNORED_VERSIONS = new Set([
`3.3.3333`,
`3.7.0-beta`,
`3.9.0-beta`,
`4.0.0-beta`,
`4.3.0-beta`,
`4.4.0-beta`,
]);

const SLICES = [
Expand Down Expand Up @@ -97,7 +102,14 @@ const SLICES = [
from: `cd8d000510ed2d2910e0ebaa903a51adda546a0a`,
to: `cd8d000510ed2d2910e0ebaa903a51adda546a0a`,
onto: `6e62273fa1e7469b89b589667c2c233789c62176`,
range: `>=4.7.0-beta`,
range: `>=4.7.0-beta <4.8`,
},
// https://github.com/merceyz/TypeScript/tree/merceyz/pnp-4.8
{
from: `3287098f4785fd652112beadf3b33a960fcd19aa`,
to: `3287098f4785fd652112beadf3b33a960fcd19aa`,
onto: `9a09c37878a45b06994485fdb510eb4d24587dcb`,
range: `>=4.8.0-beta`,
},
];

Expand Down Expand Up @@ -170,26 +182,15 @@ async function fetchVersions(range) {

relevantVersions = [];

let highestPre;
for (const version of allVersions) {
if (IGNORED_VERSIONS.has(version))
continue;

const pre = semver.prerelease(version);
if (pre) {
if (pre[0] !== `beta` && pre[0] !== `rc`)
continue;

if (!highestPre || semver.gt(version, highestPre)) {
highestPre = version;
}
} else {
relevantVersions.push(version);
}
}
if (pre && pre[0] !== `beta` && pre[0] !== `rc`)
continue;

if (highestPre) {
relevantVersions.push(highestPre);
relevantVersions.push(version);
}
}

Expand Down
Loading

0 comments on commit 82a5ec4

Please sign in to comment.