-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pre and post install patches to yarn_install and npm_install (
- Loading branch information
Greg Magolan
authored
Apr 14, 2021
1 parent
ab0b372
commit d805f33
Showing
14 changed files
with
184 additions
and
0 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
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
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,9 @@ | ||
load("//:index.bzl", "nodejs_test") | ||
|
||
nodejs_test( | ||
name = "test", | ||
data = [ | ||
"@internal_npm_install_test_patches_npm//semver", | ||
], | ||
entry_point = "test.js", | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
{ | ||
"dependencies": { | ||
"__invalid_dependency__": "removed by pre_install_patches", | ||
"semver": "1.0.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,9 @@ | ||
--- internal/npm_install/test/patches_npm/package.json | ||
+++ internal/npm_install/test/patches_npm/package.json | ||
@@ -1,6 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
- "__invalid_dependency__": "removed by pre_install_patches", | ||
"semver": "1.0.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,10 @@ | ||
--- internal/npm_install/test/patches_npm/node_modules/semver/semver.js | ||
+++ internal/npm_install/test/patches_npm/node_modules/semver/semver.js | ||
@@ -34,6 +34,7 @@ exports.valid = valid | ||
exports.validPackage = validPackage | ||
exports.validRange = validRange | ||
exports.maxSatisfying = maxSatisfying | ||
+exports.patched = true | ||
|
||
function clean (ver) { | ||
v = exports.parse(ver) |
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,5 @@ | ||
const semver = require('semver') | ||
if (!semver.patched) { | ||
console.error('Expected semver to be patched'); | ||
process.exitCode = 1; | ||
} |
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,9 @@ | ||
load("//:index.bzl", "nodejs_test") | ||
|
||
nodejs_test( | ||
name = "test", | ||
data = [ | ||
"@internal_npm_install_test_patches_yarn//semver", | ||
], | ||
entry_point = "test.js", | ||
) |
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,6 @@ | ||
{ | ||
"dependencies": { | ||
"__invalid_dependency__": "removed by pre_install_patches", | ||
"semver": "1.0.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,9 @@ | ||
--- internal/npm_install/test/patches_yarn/package.json | ||
+++ internal/npm_install/test/patches_yarn/package.json | ||
@@ -1,6 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
- "__invalid_dependency__": "removed by pre_install_patches", | ||
"semver": "1.0.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,10 @@ | ||
--- internal/npm_install/test/patches_yarn/node_modules/semver/semver.js | ||
+++ internal/npm_install/test/patches_yarn/node_modules/semver/semver.js | ||
@@ -34,6 +34,7 @@ exports.valid = valid | ||
exports.validPackage = validPackage | ||
exports.validRange = validRange | ||
exports.maxSatisfying = maxSatisfying | ||
+exports.patched = true | ||
|
||
function clean (ver) { | ||
v = exports.parse(ver) |
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,5 @@ | ||
const semver = require('semver') | ||
if (!semver.patched) { | ||
console.error('Expected semver to be patched'); | ||
process.exitCode = 1; | ||
} |
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 | ||
|
||
|
||
[email protected]: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-1.0.0.tgz#11f18a0c08ed21c988fc2b0257f1951969816615" | ||
integrity sha1-EfGKDAjtIcmI/CsCV/GVGWmBZhU= |