Skip to content

Commit 42793f8

Browse files
committed
chore: slash 3.0 is used by patch-package now
1 parent 0f2eae0 commit 42793f8

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

integration-tests/dev-only-patches/__snapshots__/dev-only-patches.test.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`Test dev-only-patches: 00: patch-package happily ignores slash on CI be
55
patch-package 0.0.0
66
Applying patches...
77
left-pad@1.3.0 ✔
8-
Skipping dev-only slash@3.0.0 ✔
8+
Skipping dev-only slash@2.0.0 ✔
99
END SNAPSHOT"
1010
`;
1111

@@ -14,12 +14,12 @@ exports[`Test dev-only-patches: 01: patch-package fails to find fake-package 1`]
1414
patch-package 0.0.0
1515
Applying patches...
1616
left-pad@1.3.0 ✔
17-
Skipping dev-only slash@3.0.0 ✔
17+
Skipping dev-only slash@2.0.0 ✔
1818
Error: Patch file found for package fake-package which is not present at node_modules/fake-package
1919
2020
If this package is a dev dependency, rename the patch file to
2121
22-
fake-package+3.0.0.dev.patch
22+
fake-package+2.0.0.dev.patch
2323
2424
---
2525
patch-package finished with 1 error(s).
@@ -30,8 +30,8 @@ exports[`Test dev-only-patches: 02: fake-package should be skipped 1`] = `
3030
"SNAPSHOT: fake-package should be skipped
3131
patch-package 0.0.0
3232
Applying patches...
33-
Skipping dev-only fake-package@3.0.0 ✔
33+
Skipping dev-only fake-package@2.0.0 ✔
3434
left-pad@1.3.0 ✔
35-
Skipping dev-only slash@3.0.0 ✔
35+
Skipping dev-only slash@2.0.0 ✔
3636
END SNAPSHOT"
3737
`;

integration-tests/dev-only-patches/dev-only-patches.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ echo "SNAPSHOT: patch-package happily ignores slash on CI because it's a dev dep
1313
patch-package
1414
echo "END SNAPSHOT"
1515

16-
echo "create fake-package+3.0.0.patch"
17-
cp patches/slash+3.0.0.patch patches/fake-package+3.0.0.patch
16+
echo "create fake-package+2.0.0.patch"
17+
cp patches/slash+2.0.0.patch patches/fake-package+2.0.0.patch
1818

1919
echo "SNAPSHOT: patch-package fails to find fake-package"
2020
if patch-package
@@ -24,7 +24,7 @@ fi
2424
echo "END SNAPSHOT"
2525

2626
echo "rename fake-package patch file to .dev.patch"
27-
mv patches/fake-package+3.0.0.patch patches/fake-package+3.0.0.dev.patch
27+
mv patches/fake-package+2.0.0.patch patches/fake-package+2.0.0.dev.patch
2828

2929
echo "SNAPSHOT: fake-package should be skipped"
3030
patch-package

integration-tests/dev-only-patches/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"rimraf": "3.0.0"
1111
},
1212
"devDependencies": {
13-
"slash": "3.0.0"
13+
"slash": "2.0.0"
1414
}
1515
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/node_modules/slash/index.js b/node_modules/slash/index.js
2+
index 75d7250..bc742e7 100644
3+
--- a/node_modules/slash/index.js
4+
+++ b/node_modules/slash/index.js
5+
@@ -1,5 +1,5 @@
6+
'use strict';
7+
-module.exports = input => {
8+
+module.patchPackage = input => {
9+
const isExtendedLengthPath = /^\\\\\?\\/.test(input);
10+
const hasNonAscii = /[^\u0000-\u0080]+/.test(input); // eslint-disable-line no-control-regex
11+

integration-tests/dev-only-patches/patches/slash+3.0.0.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

integration-tests/dev-only-patches/yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ inherits@2:
5050
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
5151
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
5252

53-
left-pad@^1.3.0:
53+
left-pad@1.3.0:
5454
version "1.3.0"
5555
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
5656
integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
@@ -74,17 +74,17 @@ path-is-absolute@^1.0.0:
7474
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
7575
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
7676

77-
rimraf@^3.0.0:
77+
rimraf@3.0.0:
7878
version "3.0.0"
7979
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b"
8080
integrity sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==
8181
dependencies:
8282
glob "^7.1.3"
8383

84-
slash@^3.0.0:
85-
version "3.0.0"
86-
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
87-
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
84+
slash@2.0.0:
85+
version "2.0.0"
86+
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
87+
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
8888

8989
wrappy@1:
9090
version "1.0.2"

0 commit comments

Comments
 (0)