Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 23 additions & 0 deletions .yarn/versions/typescript-compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-compat": patch
"@yarnpkg/plugin-patch": 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-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@hapi/joi",
"version": "17.99.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@types/hapi__joi",
"version": "17.99.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ describe(`Plugins`, () => {
makeTemporaryEnv({}, {
tsEnableAutoTypes: true,
}, async ({path, run, source}) => {
await run(`add`, `@babel/traverse@7.99.0`);
await run(`add`, `@hapi/joi@17.99.0`);

await expect(readManifest(path)).resolves.toMatchObject({
dependencies: {
[`@babel/traverse`]: `7.99.0`,
[`@hapi/joi`]: `17.99.0`,
},
devDependencies: {
[`@types/babel__traverse`]: `^7`,
[`@types/hapi__joi`]: `^17`,
},
});
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ const SLICES = [
from: `99f3e130bbe02473680bfa040d131c1f7f08fcc0`,
to: `99f3e130bbe02473680bfa040d131c1f7f08fcc0`,
onto: `c1216dea1a504da7b89b5221b925abcd1702d7e4`,
range: `>=5.7.1-rc`,
range: `>=5.7.1-rc <7.0.0-0`,
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/lib/_tsc.js b/lib/_tsc.js
index d06c7ff6c..97860c4cc 100644
semver exclusivity >=5.7.1-rc
semver exclusivity >=5.7.1-rc <7.0.0-0
--- a/lib/_tsc.js
+++ b/lib/_tsc.js
@@ -5104,6 +5104,9 @@ var sys = (() => {
Expand Down Expand Up @@ -333,7 +333,7 @@ semver exclusivity >=5.7.1-rc
break;
diff --git a/lib/_tsserver.js b/lib/_tsserver.js
index 473b8d224..ee2581d3d 100644
semver exclusivity >=5.7.1-rc
semver exclusivity >=5.7.1-rc <7.0.0-0
--- a/lib/_tsserver.js
+++ b/lib/_tsserver.js
@@ -53,6 +53,25 @@ var import_net = __toESM(require("net"));
Expand Down Expand Up @@ -386,7 +386,7 @@ semver exclusivity >=5.7.1-rc
this.installer.on("message", (m) => this.handleMessage(m));
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 0ed1d1e83..0e64ca342 100644
semver exclusivity >=5.7.1-rc
semver exclusivity >=5.7.1-rc <7.0.0-0
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -3284,6 +3284,7 @@ declare namespace ts {
Expand Down Expand Up @@ -416,7 +416,7 @@ semver exclusivity >=5.7.1-rc
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
diff --git a/lib/typescript.js b/lib/typescript.js
index 366e30eeb..542b87e90 100644
semver exclusivity >=5.7.1-rc
semver exclusivity >=5.7.1-rc <7.0.0-0
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -8470,6 +8470,9 @@ var sys = (() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-compat/sources/patches/resolve.patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let patch: string;

export function getPatch() {
if (typeof patch === `undefined`)
patch = require(`zlib`).brotliDecompressSync(Buffer.from(`G8MSIIzURnVBnObTcvb3XE6v2S9Qgc2K801Oa5otNKEtK8BINZNcaQHy+9/vf/WXBimwutXC33P2DPc64pps5rz7NGGWaOKNSPL4Y2KRE8twut2lFOIN+OXPtRmPMRhMTILib2bEQx43az2I5d3YS8Roa5UZpF/ujHb3Djd3GDvYUfvFYSUQ39vb2cmifp/rgB4J/65JK3wRBTvMBoNBmn3mbXC63/gbBkW/2IRPri0O8bcsRBsmarF328pAln04nyJFkwUAvNu934supAqLtyerZZpJ8I8suJHhf/ocMV+scKwa8NOiDKIPXw6Ex/EEZD6TEGaW8N5zvNHYF10l6Lfooj7D5W2k3dgvQSbp2Wv8TGOayS978gxlOLVjTGXs66ozewbrjwElLtyrYNnWTfzzdEutgROUFPVMhnMoy8EjJLLlWwIEoySxliim9kYW30JUHiPVyjt0iAw/ZpPmCbUCltYPnq6ZNblIKhTNhqS/oqC9iya5sGKZTOVsTEg34n92uZTf2iPpcZih8rPW8CzA+adIGmyCPcKdLMsBLShd+zuEbTrqpwuh+DLmracZcjPC5Sdf5odDAhKpFuOsQS67RT+1VgWWygSv3YwxDnylc04/PYuaMeIzhBkLrvs7e/OUzRTF56MmfY6rI63QtEjEQzq637zQqJ39nNhu3NmoRRhW/086bHGBUtx0PE0j3aEGvkdh9WJC8y8j8mqqke9/dQ5la+Q3ba4RlhvTbnfQhPDDab3tUifkjKuOsp13mXEmO00Mu88F/M67R7LXfoFDFLNtgCSWjWX+3Jn1371pJTK9xPBiMJafvDjtFyAzu8rxeQ0TKMQXNPs5xxiBOd+BRJP8KP88XPtJIbZKh/cdW8KvBUkpqKpGoiIaA32c3/JnQr4efXt85mXvidOvn/eU3Pase1typLYBalJ14mCso9h79nuMOuCa/kZAOkJHmTjP5RM2WNoPasZUAnT1TAE/NH25hUxcQv6hQWR/m1PKk4ooXMcM4SR1iYU3fUohvqk4RY2hbmTVVIXv6TvqO+0doOjgeVFAcom+RlwJQmOVH7pr1Q9LoJT6n1DeQEB+NHygsATbIwTcOKZlJsY8G4+suX1uQLjUWwLjjs0mvSvZcLTpIGAekeR7GCgl8eo3ndAqEe2XCav4huliHjdbIPBsGJuPX7lrO9HX1UbXRH5opOe1x6JsOSgHZR+EaxuXVhpLLxm6jk1LJtZfHSc6BKPun3CpYYVMJGwEUyk8MTGG0XL5MfEwaXpnc9TKnBmlGn6nHiGREc3ysn47XIBDzA+YvFdjZzVIEDcKGpS6PbUJehFRjEne8D0lVU1XuRtlgszq6pTNlQ/3MzNOEgCWPyTct22V2mEi2krizn5VDo9B19/X2DB3hCGRMM7ONbtnAcIx/OWB1u5uPbW1gsH8irXxT/IzG0PoXWYjhbMsH3KTuoOl5o17PulcgvsfTSnKFM354GWI8luqZnrswWjiXy3G+Vbyo1KMopFmmvBwNELgaS8z8dNZchx/Cl/xjddxhMcyqtzFyONb2Zdu90NkI8pAeufe7YlXrp53v8Dj/l8vWeVspRKBGXScBBPI/HinSTGmLDOGGOCIyH0JFdOZx0gWsacNlQLJMIrBhqRxXxHF/5pseWwejlAAvZ3klZSDSYY8mkToaWejXhgNomeGtx1DTLEUFMRkgF5yFB22WYdJnaWN14r1YJj81hGi45+jrADS5nYRhCiSlCJJ1nL8pYX+HDSMhdTEWyRcgHVp/IsUIZYMfT+YYncUQPgcxNGCHfZ88vDdrcUuaGIl6zhAsiaq7R5dfqrqXH/JcBhfjT8D0azayIyEz75Nxp6YkcyDxlJq3EXnJUpqDohJJOysL1t1uNiHESlvsxPb5cpbW0+ICZqJmUZus1BMW0F5IVBODLIo2zHHjA0=`, `base64`)).toString();
patch = require(`zlib`).brotliDecompressSync(Buffer.from(`G70SIIzURnVBnObTmvZ3L6cX9xewwLKl81s5batuNEoStoADpDrmSguQ3//aq41xiRI5PtbmzrtvssshKgApmnm7H1WJVB2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LNibD59Za/NRF83a9WQ8kMnPe89iqLnoBwtMxCu7lxaaSw9p+k6Vj2ZWH81rSMPSBZDCYFIUgeg0nZoAgxzZXJi4lvS6I7HSOUxG/Jq4J1yBH5CKPPLmm13Ad4wJ6CSXozdVCc73ChoUN72Gu00wqPok7zjewhVPV3frpcGsqlpUlYn3t2PzXhIAFjyEHDf2Cr0QoWzLok7/lUtLAZNtq+yYeIIQyKhnJ3odk8ChKP32wO9xV0/NfWBzvCKnbFP8tMaQ9xNNkPCadYf+ci4g6ZmzXo66VSCh4+6EGKK5qTzL0TtNVU1OvqgNLGvGuNkL/leKbpoFLNLeDjpIfG0z7T/dJwcwV/CV3zjfRzhsYgqddF5ZMsz6TY/PjaidKQ3jt2ev7I1vIcSj/v/vGC1NXUVCMyg4zCYQObrnUuKMSWZ0cf0ekQeS6iYjj1GMo09LS08xv0oBhsSRnxFFP9rsqWxeRpCAfR2kldSAiZZcW8SoaeNiXqqN4iWGdZ29DHFUkTgkwF6wUU02CZdpegmbXGKdW+Y7NYO0bHPXlYAaXW7/EEURkphJOs3/tJCfXYK2qDUxHtKWAdjw8gXIUIsFvpx0AXuKHqweYeTgh2m3rj77rrYBU2sZOmHRo6JxhaPJidVDK5/ZDj0r7o9A1GtWmcWwmbchmNP1EimQWP5NO682+IlNQXEMBI21pftOUzs/YiUttmB7XJlra0lxBDNxFgnt0koRq2gvBAohwaZl22fV8YG`, `base64`)).toString();

return patch;
}
2 changes: 1 addition & 1 deletion packages/plugin-compat/sources/patches/typescript.patch.ts

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion packages/plugin-compat/tests/patches.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import PatchPlugin
import CompatPlugin from '../sources/index';

function getConfiguration(p: PortablePath) {
return Configuration.create(p, p, new Map([
const configuration = Configuration.create(p, p, new Map([
[`@yarnpkg/plugin-compat`, CompatPlugin],
[`@yarnpkg/plugin-npm`, NpmPlugin],
[`@yarnpkg/plugin-patch`, PatchPlugin],
]));

// The compatibility matrix intentionally checks prereleases such as TypeScript RCs.
configuration.use(`<tests>`, {npmMinimalAgeGate: `0`}, p, {overwrite: true});

return configuration;
}

async function createProject(configuration: Configuration, p: PortablePath, manifest: object = {}) {
Expand Down Expand Up @@ -95,6 +100,8 @@ const TEST_RANGES: Array<[string, Array<string>]> = [
], [
`typescript`, [
`>=3.2`,
`npm:@typescript/typescript6@^6.0.0`,
`7.0.1-rc`,
`latest`,
`next`,
],
Expand Down
19 changes: 14 additions & 5 deletions packages/plugin-patch/sources/PatchFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import * as patchUtils
import {UnmatchedHunkError} from './tools/UnmatchedHunkError';
import {reportHunk} from './tools/format';

function isMissingFileError(err: unknown) {
return err instanceof Error && `code` in err && err.code === `ENOENT`;
}

export class PatchFetcher implements Fetcher {
supports(locator: Locator, opts: MinimalFetchOptions) {
if (!patchUtils.isPatchLocator(locator))
Expand Down Expand Up @@ -83,20 +87,25 @@ export class PatchFetcher implements Fetcher {
version: sourceVersion,
});
} catch (err) {
if (!(err instanceof UnmatchedHunkError))
const unmatchedHunkError = err instanceof UnmatchedHunkError
? err
: null;
const shouldFallback = unmatchedHunkError !== null || (optional && isMissingFileError(err));

if (!shouldFallback)
throw err;

const enableInlineHunks = opts.project.configuration.get(`enableInlineHunks`);
const suggestion = !enableInlineHunks && !optional
const suggestion = unmatchedHunkError !== null && !enableInlineHunks && !optional
? ` (set enableInlineHunks for details)`
: ``;

const message = `${structUtils.prettyLocator(opts.project.configuration, locator)}: ${err.message}${suggestion}`;
const message = `${structUtils.prettyLocator(opts.project.configuration, locator)}: ${(err as Error).message}${suggestion}`;
const reportExtra = (report: Report) => {
if (!enableInlineHunks)
if (unmatchedHunkError === null || !enableInlineHunks)
return;

reportHunk(err.hunk, {
reportHunk(unmatchedHunkError.hunk, {
configuration: opts.project.configuration,
report,
});
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19033,36 +19033,36 @@ pem@dexus/pem:

"resolve@patch:resolve@npm%3A1.22.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.1.6#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.17.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.19.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin<compat/resolve>":
version: 1.22.2
resolution: "resolve@patch:resolve@npm%3A1.22.2#optional!builtin<compat/resolve>::version=1.22.2&hash=c3c19d"
resolution: "resolve@patch:resolve@npm%3A1.22.2#optional!builtin<compat/resolve>::version=1.22.2&hash=9bd1a5"
dependencies:
is-core-module: "npm:^2.11.0"
path-parse: "npm:^1.0.7"
supports-preserve-symlinks-flag: "npm:^1.0.0"
bin:
resolve: bin/resolve
checksum: 10/14594f99dbff19c1f51f6daac0caf0b75ed345256ada3722c23f63935eace79532dcfa349b3d8889d2771c143822c38dd5d7d8eb85fb8cff257b7abccbad7872
checksum: 10/8b645560f64ead246a2118d7bf2ee5a78e62ed9ece4846744616c506b204d33122cf8cab60fb15c2d0162fcc7b091fbbbc22687a106811a81b6c2b21e2636dec
languageName: node
linkType: hard

"resolve@patch:resolve@npm%3A1.9.0#optional!builtin<compat/resolve>":
version: 1.9.0
resolution: "resolve@patch:resolve@npm%3A1.9.0#optional!builtin<compat/resolve>::version=1.9.0&hash=c3c19d"
resolution: "resolve@patch:resolve@npm%3A1.9.0#optional!builtin<compat/resolve>::version=1.9.0&hash=9bd1a5"
dependencies:
path-parse: "npm:^1.0.6"
checksum: 10/2f534b82eb59b37d459f045dd339d9eacc2407474859ed82f753f56ed0d4207b5d4d1d0fd6b050e1ea5bfce7e4324290b50b0c753a3cee48a0ec5c6d4af3ddf2
checksum: 10/a14dd5def5f846d20f1c0c5eda0d6024b99de7b9d2d77515950e34f75c6768c01dd58c66ddb07d30bbd6507e6fd810809707771a35532bc5a018f15289d6b8bc
languageName: node
linkType: hard

"resolve@patch:resolve@npm%3A^2.0.0-next.5#optional!builtin<compat/resolve>":
version: 2.0.0-next.5
resolution: "resolve@patch:resolve@npm%3A2.0.0-next.5#optional!builtin<compat/resolve>::version=2.0.0-next.5&hash=c3c19d"
resolution: "resolve@patch:resolve@npm%3A2.0.0-next.5#optional!builtin<compat/resolve>::version=2.0.0-next.5&hash=9bd1a5"
dependencies:
is-core-module: "npm:^2.13.0"
path-parse: "npm:^1.0.7"
supports-preserve-symlinks-flag: "npm:^1.0.0"
bin:
resolve: bin/resolve
checksum: 10/05fa778de9d0347c8b889eb7a18f1f06bf0f801b0eb4610b4871a4b2f22e220900cf0ad525e94f990bb8d8921c07754ab2122c0c225ab4cdcea98f36e64fa4c2
checksum: 10/76c221deb1d986c0a80cd576373b0ee09f42871e0085a1f76beda84f73ce04e0d21bab28dffd326eb006a7af83bbc582404566b384aa3b0baa217f56cf7e8618
languageName: node
linkType: hard

Expand Down
Loading