-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from Threestup/feat/support-newer-lockfile-ve…
…rsions feat(packageresolution): add lockfileVersion 2+ packages support
- Loading branch information
Showing
5 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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,32 @@ | ||
# make sure errors stop the script | ||
set -e | ||
|
||
echo "add patch-package" | ||
npm i $1 | ||
alias patch-package=./node_modules/.bin/patch-package | ||
|
||
echo "Add left-pad" | ||
npm i left-pad@1.3.0 | ||
|
||
testLockFile() { | ||
echo "Version test $1" | ||
npm i --lockfile-version $1 | ||
|
||
echo "cleanup patches" | ||
npx rimraf patches | ||
|
||
echo "replace pad with yarn in left-pad/index.js" | ||
npx replace pad npm node_modules/left-pad/index.js | ||
|
||
echo "patch-package should run" | ||
patch-package left-pad | ||
|
||
echo "check that the patch is created" | ||
test -f patches/left-pad+1.3.0.patch || exit 1 | ||
} | ||
|
||
echo "test lockfile v2" | ||
testLockFile 2 | ||
|
||
echo "test lockfile v3" | ||
testLockFile 3 |
This file contains 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,2 @@ | ||
import { runIntegrationTest } from "../runIntegrationTest" | ||
runIntegrationTest({ projectName: "lockfile", shouldProduceSnapshots: false }) |
This file contains 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 @@ | ||
{ | ||
"name": "lockfile", | ||
"version": "1.0.0", | ||
"description": "integration test for patch-package", | ||
"main": "index.js", | ||
"author": "anas10", | ||
"license": "ISC", | ||
"dependencies": { | ||
"left-pad": "1.3.0" | ||
} | ||
} |
This file contains 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,8 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"left-pad@^1.1.3": | ||
"integrity" "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" | ||
"resolved" "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz" | ||
"version" "1.3.0" |
This file contains 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