Skip to content

Commit 4fc7ad8

Browse files
authored
Tweaks the ranges for the patches (#871)
* Tweaks the ranges for the patches * Applies cache changes
1 parent c1287a9 commit 4fc7ad8

File tree

10 files changed

+158
-136
lines changed

10 files changed

+158
-136
lines changed

.pnp.js

Lines changed: 129 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.
8.5 MB
Binary file not shown.

.yarn/versions/9fd024b1.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
releases:
2+
"@yarnpkg/cli": prerelease
3+
"@yarnpkg/plugin-compat": prerelease
4+
5+
declined:
6+
- "@yarnpkg/plugin-constraints"
7+
- "@yarnpkg/plugin-dlx"
8+
- "@yarnpkg/plugin-essentials"
9+
- "@yarnpkg/plugin-init"
10+
- "@yarnpkg/plugin-interactive-tools"
11+
- "@yarnpkg/plugin-node-modules"
12+
- "@yarnpkg/plugin-npm-cli"
13+
- "@yarnpkg/plugin-pack"
14+
- "@yarnpkg/plugin-patch"
15+
- "@yarnpkg/plugin-pnp"
16+
- "@yarnpkg/plugin-stage"
17+
- "@yarnpkg/plugin-typescript"
18+
- "@yarnpkg/plugin-version"
19+
- "@yarnpkg/plugin-workspace-tools"
20+
- "@yarnpkg/core"
21+
- "@yarnpkg/doctor"

packages/plugin-compat/extra/fsevents/2.1.2.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/fsevents.js b/fsevents.js
2-
semver exclusivity ^2
2+
semver exclusivity ^2.1
33
--- a/fsevents.js
44
+++ b/fsevents.js
55
@@ -21,5 +21,7 @@ function watch(path, handler) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ rm -f "$PATCHFILE" && touch "$PATCHFILE"
3535
echo 'export const patch =' \
3636
>> "$PATCHFILE"
3737
git diff --no-index "$TEMP_DIR"/orig "$TEMP_DIR"/patched \
38+
| perl -p -e"s#^--- #semver exclusivity >=3\n--- #" \
3839
| perl -p -e"s#$TEMP_DIR/orig##" \
3940
| perl -p -e"s#$TEMP_DIR/patched##" \
4041
| perl -p -e"s#__spreadArrays#[].concat#" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const patch =
2-
"diff --git a/fsevents.js b/fsevents.js\nsemver exclusivity ^1\n--- a/fsevents.js\n+++ b/fsevents.js\n@@ -36,11 +36,15 @@ module.exports.Constants = Native.Constants;\n var defer = global.setImmediate || process.nextTick;\n\n function watch(path) {\n- var fse = new FSEvents(String(path || ''), handler);\n+ var VFS = require('./vfs');\n+ var vfs = new VFS(String(path || ''));\n+\n+ var fse = new FSEvents(vfs.resolvedPath, handler);\n EventEmitter.call(fse);\n return fse;\n\n function handler(path, flags, id) {\n+ path = vfs.transpose(path);\n defer(function() {\n fse.emit('fsevent', path, flags, id);\n var info = getInfo(path, flags);\ndiff --git a/fsevents.js b/fsevents.js\nsemver exclusivity ^2\n--- a/fsevents.js\n+++ b/fsevents.js\n@@ -21,5 +21,7 @@ function watch(path, handler) {\n throw new TypeError(`fsevents argument 2 must be a function and not a ${typeof handler}`);\n }\n\n- let instance = Native.start(path, handler);\n+ let VFS = require('./vfs');\n+ let vfs = new VFS(path);\n+ let instance = Native.start(vfs.resolvedPath, vfs.wrap(handler));\n if (!instance) throw new Error(`could not watch: ${path}`);\ndiff --git a/vfs.js b/vfs.js\nnew file mode 100644\n--- /dev/null\n+++ b/vfs.js\n@@ -0,0 +1,41 @@\n+const path = require(`path`);\n+\n+const NUMBER_REGEXP = /^[0-9]+$/;\n+const VIRTUAL_REGEXP = /^(\\/(?:[^\\/]+\\/)*?\\$\\$virtual)((?:\\/([^\\/]+)(?:\\/([^\\/]+))?)?((?:\\/.*)?))$/;\n+\n+function resolveVirtual(p) {\n+ const match = p.match(VIRTUAL_REGEXP);\n+ if (!match)\n+ return p;\n+\n+ const target = path.dirname(match[1]);\n+ if (!match[3] || !match[4])\n+ return target;\n+\n+ const isnum = NUMBER_REGEXP.test(match[4]);\n+ if (!isnum)\n+ return p;\n+\n+ const depth = Number(match[4]);\n+ const backstep = `../`.repeat(depth);\n+ const subpath = (match[5] || `.`);\n+\n+ return resolveVirtual(path.join(target, backstep, subpath));\n+}\n+\n+module.exports = class FsePnp {\n+ constructor(p) {\n+ this.normalizedPath = path.resolve(p);\n+ this.resolvedPath = resolveVirtual(this.normalizedPath);\n+ }\n+\n+ transpose(p) {\n+ return this.normalizedPath + p.substr(this.resolvedPath.length);\n+ }\n+\n+ wrap(fn) {\n+ return (path, ...args) => {\n+ return fn(this.transpose(path), ...args);\n+ };\n+ }\n+};\n"
2+
"diff --git a/fsevents.js b/fsevents.js\nsemver exclusivity ^1\n--- a/fsevents.js\n+++ b/fsevents.js\n@@ -36,11 +36,15 @@ module.exports.Constants = Native.Constants;\n var defer = global.setImmediate || process.nextTick;\n\n function watch(path) {\n- var fse = new FSEvents(String(path || ''), handler);\n+ var VFS = require('./vfs');\n+ var vfs = new VFS(String(path || ''));\n+\n+ var fse = new FSEvents(vfs.resolvedPath, handler);\n EventEmitter.call(fse);\n return fse;\n\n function handler(path, flags, id) {\n+ path = vfs.transpose(path);\n defer(function() {\n fse.emit('fsevent', path, flags, id);\n var info = getInfo(path, flags);\ndiff --git a/fsevents.js b/fsevents.js\nsemver exclusivity ^2.1\n--- a/fsevents.js\n+++ b/fsevents.js\n@@ -21,5 +21,7 @@ function watch(path, handler) {\n throw new TypeError(`fsevents argument 2 must be a function and not a ${typeof handler}`);\n }\n\n- let instance = Native.start(path, handler);\n+ let VFS = require('./vfs');\n+ let vfs = new VFS(path);\n+ let instance = Native.start(vfs.resolvedPath, vfs.wrap(handler));\n if (!instance) throw new Error(`could not watch: ${path}`);\ndiff --git a/vfs.js b/vfs.js\nnew file mode 100644\n--- /dev/null\n+++ b/vfs.js\n@@ -0,0 +1,41 @@\n+const path = require(`path`);\n+\n+const NUMBER_REGEXP = /^[0-9]+$/;\n+const VIRTUAL_REGEXP = /^(\\/(?:[^\\/]+\\/)*?\\$\\$virtual)((?:\\/([^\\/]+)(?:\\/([^\\/]+))?)?((?:\\/.*)?))$/;\n+\n+function resolveVirtual(p) {\n+ const match = p.match(VIRTUAL_REGEXP);\n+ if (!match)\n+ return p;\n+\n+ const target = path.dirname(match[1]);\n+ if (!match[3] || !match[4])\n+ return target;\n+\n+ const isnum = NUMBER_REGEXP.test(match[4]);\n+ if (!isnum)\n+ return p;\n+\n+ const depth = Number(match[4]);\n+ const backstep = `../`.repeat(depth);\n+ const subpath = (match[5] || `.`);\n+\n+ return resolveVirtual(path.join(target, backstep, subpath));\n+}\n+\n+module.exports = class FsePnp {\n+ constructor(p) {\n+ this.normalizedPath = path.resolve(p);\n+ this.resolvedPath = resolveVirtual(this.normalizedPath);\n+ }\n+\n+ transpose(p) {\n+ return this.normalizedPath + p.substr(this.resolvedPath.length);\n+ }\n+\n+ wrap(fn) {\n+ return (path, ...args) => {\n+ return fn(this.transpose(path), ...args);\n+ };\n+ }\n+};\n"
33
;

packages/plugin-compat/sources/patches/typescript.patch.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11944,7 +11944,7 @@ fsevents@^1.2.2:
1194411944

1194511945
"fsevents@patch:fsevents@^1.0.0#builtin<compat/fsevents>, fsevents@patch:fsevents@^1.2.7#builtin<compat/fsevents>":
1194611946
version: 1.2.7
11947-
resolution: "fsevents@patch:fsevents@npm%3A1.2.7#builtin<compat/fsevents>::version=1.2.7&hash=e8cd9e"
11947+
resolution: "fsevents@patch:fsevents@npm%3A1.2.7#builtin<compat/fsevents>::version=1.2.7&hash=77dfe6"
1194811948
dependencies:
1194911949
nan: ^2.9.2
1195011950
node-pre-gyp: ^0.10.0
@@ -11954,7 +11954,7 @@ fsevents@^1.2.2:
1195411954

1195511955
"fsevents@patch:fsevents@^1.2.2#builtin<compat/fsevents>":
1195611956
version: 1.2.6
11957-
resolution: "fsevents@patch:fsevents@npm%3A1.2.6#builtin<compat/fsevents>::version=1.2.6&hash=e8cd9e"
11957+
resolution: "fsevents@patch:fsevents@npm%3A1.2.6#builtin<compat/fsevents>::version=1.2.6&hash=77dfe6"
1195811958
dependencies:
1195911959
nan: ^2.9.2
1196011960
node-pre-gyp: ^0.10.0
@@ -24308,11 +24308,11 @@ resolve@^1.10.1:
2430824308

2430924309
"typescript@patch:typescript@*#builtin<compat/typescript>, typescript@patch:typescript@^3.7.4#builtin<compat/typescript>":
2431024310
version: 3.7.4
24311-
resolution: "typescript@patch:typescript@npm%3A3.7.4#builtin<compat/typescript>::version=3.7.4&hash=226bd1"
24311+
resolution: "typescript@patch:typescript@npm%3A3.7.4#builtin<compat/typescript>::version=3.7.4&hash=273569"
2431224312
bin:
2431324313
tsc: ./bin/tsc
2431424314
tsserver: ./bin/tsserver
24315-
checksum: 2/f39de68fea020f03929159a25aefcb7194eb4a5ee85ade1b76733f99f009e3e3d46790778d6b700cd8ad30b0baade750a2f5fafbc71f75c1286b0e637e305aed
24315+
checksum: 2/783bad1234fd466f8b481e9d1d6fd2286af993731eb59c23e48a091805b8687cf0d68f992061da0f721b6f09b63e8da7e4f5d9f724c25c91cecbb8f53a643e47
2431624316
languageName: node
2431724317
linkType: hard
2431824318

0 commit comments

Comments
 (0)