forked from ds300/patch-package
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Reduce installation size #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JounQin
merged 13 commits into
un-ts:fork-release
from
SukkaW:reduce-installation-size-1
Mar 1, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f122536
replace chalk with picocolors
SukkaW 4776393
reduce fs-extra usage
SukkaW 6abe2e2
replace json-stable-stringify
SukkaW 8fd654c
rework yarn.lock
SukkaW e665b94
add changeset
SukkaW e997dc1
chore: bump slash to v3 with definition
JounQin 366eea7
chore: remove unnecessary custom definitions
JounQin 679ce95
chore: improve changeset
JounQin 8f26944
fix: revert back some fs-extra changes
JounQin a1abcfd
fix: stay on chalk-cjs instead of picocolors for now
JounQin 0f2eae0
fix: stay on chalk for now...
JounQin 42793f8
chore: slash 3.0 is used by patch-package now
JounQin bc89c87
test: fix failing case
JounQin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@unts/patch-package": minor | ||
--- | ||
|
||
feat: reduce installation size by replacing `json-stable-stringify` to | ||
`@nolyfill/json-stable-stringify` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ exports[`Test dev-only-patches: 00: patch-package happily ignores slash on CI be | |
patch-package 0.0.0 | ||
Applying patches... | ||
[email protected] ✔ | ||
Skipping dev-only slash@3.0.0 ✔ | ||
Skipping dev-only slash@2.0.0 ✔ | ||
END SNAPSHOT" | ||
`; | ||
|
||
|
@@ -14,12 +14,12 @@ exports[`Test dev-only-patches: 01: patch-package fails to find fake-package 1`] | |
patch-package 0.0.0 | ||
Applying patches... | ||
[email protected] ✔ | ||
Skipping dev-only slash@3.0.0 ✔ | ||
Skipping dev-only slash@2.0.0 ✔ | ||
Error: Patch file found for package fake-package which is not present at node_modules/fake-package | ||
|
||
If this package is a dev dependency, rename the patch file to | ||
|
||
fake-package+3.0.0.dev.patch | ||
fake-package+2.0.0.dev.patch | ||
|
||
--- | ||
patch-package finished with 1 error(s). | ||
|
@@ -30,8 +30,8 @@ exports[`Test dev-only-patches: 02: fake-package should be skipped 1`] = ` | |
"SNAPSHOT: fake-package should be skipped | ||
patch-package 0.0.0 | ||
Applying patches... | ||
Skipping dev-only fake-package@3.0.0 ✔ | ||
Skipping dev-only fake-package@2.0.0 ✔ | ||
[email protected] ✔ | ||
Skipping dev-only slash@3.0.0 ✔ | ||
Skipping dev-only slash@2.0.0 ✔ | ||
END SNAPSHOT" | ||
`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
"rimraf": "3.0.0" | ||
}, | ||
"devDependencies": { | ||
"slash": "3.0.0" | ||
"slash": "2.0.0" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
integration-tests/dev-only-patches/patches/slash+2.0.0.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff --git a/node_modules/slash/index.js b/node_modules/slash/index.js | ||
index 75d7250..bc742e7 100644 | ||
--- a/node_modules/slash/index.js | ||
+++ b/node_modules/slash/index.js | ||
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
-module.exports = input => { | ||
+module.patchPackage = input => { | ||
const isExtendedLengthPath = /^\\\\\?\\/.test(input); | ||
const hasNonAscii = /[^\u0000-\u0080]+/.test(input); // eslint-disable-line no-control-regex | ||
|
11 changes: 0 additions & 11 deletions
11
integration-tests/dev-only-patches/patches/slash+3.0.0.patch
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ inherits@2: | |
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" | ||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== | ||
|
||
left-pad@^1.3.0: | ||
[email protected]: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" | ||
integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== | ||
|
@@ -74,17 +74,17 @@ path-is-absolute@^1.0.0: | |
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" | ||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= | ||
|
||
rimraf@^3.0.0: | ||
[email protected]: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b" | ||
integrity sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== | ||
dependencies: | ||
glob "^7.1.3" | ||
|
||
slash@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" | ||
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== | ||
slash@2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" | ||
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== | ||
|
||
wrappy@1: | ||
version "1.0.2" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.