Skip to content

Commit bfa7a1e

Browse files
committed
build: replace patch-package with git apply
- yarn patch-commit is used to generate patches. patch-package cannot be used to apply those patches on install due to directory mismatches (e.g. a/index.js vs a/node_modules/globby/index.js). patches cannot be created with patch-package either - ds300/patch-package#272 - https://git-scm.com/docs/git-apply - https://yarnpkg.com/cli/patch-commit - https://yarnpkg.com/cli/patch Signed-off-by: Lexus Drumgold <[email protected]>
1 parent a7209bf commit bfa7a1e

File tree

8 files changed

+93
-192
lines changed

8 files changed

+93
-192
lines changed

Diff for: .editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ insert_final_newline = true
1414
max_line_length = 80
1515
trim_trailing_whitespace = true
1616

17+
# shellscript
18+
[*.sh]
19+
max_line_length = 100
20+
1721
# yaml
1822
[*.yml]
1923
max_line_length = 100

Diff for: .vscode/settings.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
"editor.defaultFormatter": "foxundermoon.shell-format"
3232
},
3333
"[shellscript]": {
34-
"editor.defaultFormatter": "esbenp.prettier-vscode"
34+
"editor.defaultFormatter": "esbenp.prettier-vscode",
35+
"editor.rulers": [100],
36+
"editor.wordWrap": "wordWrapColumn",
37+
"editor.wordWrapColumn": 100,
38+
"rewrap.wrappingColumn": 100
3539
},
3640
"[typescript]": {
3741
"editor.defaultFormatter": "esbenp.prettier-vscode"

Diff for: .yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ defaultSemverRangePrefix: ''
1313

1414
enableInlineBuilds: true
1515

16+
enableInlineHunks: true
17+
1618
nmHoistingLimits: none
1719

1820
nodeLinker: node-modules

Diff for: package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
"fs-extra": "10.1.0",
9393
"globby": "13.1.2",
9494
"mlly": "0.5.14",
95-
"patch-package": "6.4.7",
9695
"pathe": "0.3.5",
9796
"postinstall-postinstall": "2.1.0"
9897
},
@@ -176,7 +175,9 @@
176175
},
177176
"resolutions": {
178177
"@ardatan/sync-fetch": "larsgw/sync-fetch#head=worker_threads",
179-
"graphql-config": "patch:[email protected]#patches/graphql-config+4.3.5.dev.patch"
178+
"globby@npm:13.1.2": "patch:globby@npm%3A13.1.2#patches/globby+13.1.2.patch",
179+
"graphql-config": "patch:graphql-config@npm%3A4.3.5#patches/graphql-config+4.3.5.dev.patch",
180+
"mlly": "patch:mlly@npm%3A0.5.14#patches/mlly+0.5.14.patch"
180181
},
181182
"engines": {
182183
"yarn": "4.0.0-rc.14"

Diff for: patches/globby+13.1.2.patch

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/index.js b/index.js
2+
index ce5a65639d49b3fc665b35d4b0d162e092c9d612..445bbadf62a85b4aab4728c3aafa34fd30c3caf9 100644
3+
--- a/index.js
4+
+++ b/index.js
5+
@@ -29,7 +29,7 @@ const checkCwdOption = options => {
6+
7+
let stat;
8+
try {
9+
- stat = fs.statSync(options.cwd);
10+
+ stat = (options?.fs ?? fs).statSync(options.cwd);
11+
} catch {
12+
return;
13+
}

Diff for: patches/mlly+0.5.14.patch

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/dist/index.cjs b/dist/index.cjs
2+
index 887890308b948028ddde32ae180f3d0ca4519f39..7fc5b3459971de6cf6ada18934f676717badcf24 100644
3+
--- a/dist/index.cjs
4+
+++ b/dist/index.cjs
5+
@@ -1096,8 +1096,8 @@ function createResolve(defaults) {
6+
7+
const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;)import\s*(["'\s]*(?<imports>[\w*${}\n\r\t, /]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][\s;]*/gm;
8+
const DYNAMIC_IMPORT_RE = /import\s*\((?<expression>(?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gm;
9+
-const EXPORT_DECAL_RE = /\bexport\s+(?<declaration>(async function|function|let|const enum|const|enum|var|class))\s+(?<name>[\w$_]+)/g;
10+
-const EXPORT_NAMED_RE = /\bexport\s+{(?<exports>[^}]+?)(?:[,\s]*)}(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][^\n;]*)?/g;
11+
+const EXPORT_DECAL_RE = /\bexport\s+(?<declaration>(async function|function|let|const enum|const|enum|var|class|type))\s+(?<name>[\w$_]+)/g;
12+
+const EXPORT_NAMED_RE = /\bexport( type)?\s+{(?<exports>[^}]+?)(?:[,\s]*)}(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][^\n;]*)?/g;
13+
const EXPORT_STAR_RE = /\bexport\s*(\*)(\s*as\s+(?<name>[\w$_]+)\s+)?\s*(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][^\n;]*)?/g;
14+
const EXPORT_DEFAULT_RE = /\bexport\s+default\s+/g;
15+
function findStaticImports(code) {
16+
diff --git a/dist/index.mjs b/dist/index.mjs
17+
index 2114bf00092fc74642243b3ded5a718183a01039..e9409fc1187a9579eeb5129113f226625798b95c 100644
18+
--- a/dist/index.mjs
19+
+++ b/dist/index.mjs
20+
@@ -1086,8 +1086,8 @@ function createResolve(defaults) {
21+
22+
const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;)import\s*(["'\s]*(?<imports>[\w*${}\n\r\t, /]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][\s;]*/gm;
23+
const DYNAMIC_IMPORT_RE = /import\s*\((?<expression>(?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gm;
24+
-const EXPORT_DECAL_RE = /\bexport\s+(?<declaration>(async function|function|let|const enum|const|enum|var|class))\s+(?<name>[\w$_]+)/g;
25+
-const EXPORT_NAMED_RE = /\bexport\s+{(?<exports>[^}]+?)(?:[,\s]*)}(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][^\n;]*)?/g;
26+
+const EXPORT_DECAL_RE = /\bexport\s+(?<declaration>(async function|function|let|const enum|const|enum|var|class|type))\s+(?<name>[\w$_]+)/g;
27+
+const EXPORT_NAMED_RE = /\bexport( type)?\s+{(?<exports>[^}]+?)(?:[,\s]*)}(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][^\n;]*)?/g;
28+
const EXPORT_STAR_RE = /\bexport\s*(\*)(\s*as\s+(?<name>[\w$_]+)\s+)?\s*(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^"\s](?=\s*")|(?<='\s*)[^']*[^'\s](?=\s*'))\s*["'][^\n;]*)?/g;
29+
const EXPORT_DEFAULT_RE = /\bexport\s+default\s+/g;
30+
function findStaticImports(code) {

Diff for: scripts/postinstall.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
#
55
# References:
66
#
7-
# - https://github.com/ds300/patch-package
7+
# - https://git-scm.com/docs/git-apply
88
# - https://typicode.github.io/husky
99

1010
if [ -f node_modules/.bin/husky ]; then
1111
chmod +x .husky/* && husky install
1212
else
13-
patch-package
13+
git apply --directory=node_modules/globby --reject patches/globby+13.1.2.patch
14+
git apply --directory=node_modules/mlly --reject patches/mlly+0.5.14.patch
1415
fi

0 commit comments

Comments
 (0)