mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 06:33:28 +00:00
Merge pull request #1326 from balena-io/1293-add-npm-shrinkwrap
Add npm-shrinkwrap.json to control dependency updates
This commit is contained in:
commit
a6b282598b
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,7 +24,6 @@ build/Release
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
||||
node_modules
|
||||
|
||||
npm-shrinkwrap.json
|
||||
package-lock.json
|
||||
.resinconf
|
||||
.balenaconf
|
||||
|
17822
npm-shrinkwrap.json
generated
Normal file
17822
npm-shrinkwrap.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -106,7 +106,7 @@
|
||||
"gulp-mocha": "^2.0.0",
|
||||
"gulp-shell": "^0.5.2",
|
||||
"mochainon": "^2.0.0",
|
||||
"pkg": "4.4.0",
|
||||
"pkg": "^4.4.0",
|
||||
"prettier": "1.17.0",
|
||||
"publish-release": "^1.6.0",
|
||||
"resin-lint": "^3.0.1",
|
||||
@ -168,7 +168,7 @@
|
||||
"mixpanel": "^0.10.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"moment": "^2.24.0",
|
||||
"moment-duration-format": "~2.2.2",
|
||||
"moment-duration-format": "^2.2.2",
|
||||
"mz": "^2.7.0",
|
||||
"node-cleanup": "^2.1.2",
|
||||
"oclif": "^1.13.1",
|
||||
|
@ -36,7 +36,7 @@ index a9d4276..75c2f8b 100644
|
||||
exports.default = PackWin;
|
||||
const scripts = {
|
||||
diff --git a/node_modules/@oclif/dev-cli/lib/tarballs/build.js b/node_modules/@oclif/dev-cli/lib/tarballs/build.js
|
||||
index 3e613e0..621d52b 100644
|
||||
index 3e613e0..dd53603 100644
|
||||
--- a/node_modules/@oclif/dev-cli/lib/tarballs/build.js
|
||||
+++ b/node_modules/@oclif/dev-cli/lib/tarballs/build.js
|
||||
@@ -19,6 +19,9 @@ const pack = async (from, to) => {
|
||||
@ -49,7 +49,7 @@ index 3e613e0..621d52b 100644
|
||||
const packCLI = async () => {
|
||||
const stdout = await qq.x.stdout('npm', ['pack', '--unsafe-perm'], { cwd: c.root });
|
||||
return path.join(c.root, stdout.split('\n').pop());
|
||||
@@ -34,6 +37,30 @@ async function build(c, options = {}) {
|
||||
@@ -34,6 +37,23 @@ async function build(c, options = {}) {
|
||||
await qq.mv(f, '.');
|
||||
await qq.rm('package', tarball, 'bin/run.cmd');
|
||||
};
|
||||
@ -59,19 +59,12 @@ index 3e613e0..621d52b 100644
|
||||
+ qq.cd(ws);
|
||||
+ const sources = [
|
||||
+ 'bin', 'build', 'patches', 'typings', 'CHANGELOG.md', 'INSTALL.md',
|
||||
+ 'LICENSE', 'package.json', 'package-lock.json', 'README.md',
|
||||
+ 'LICENSE', 'package.json', 'npm-shrinkwrap.json', 'README.md',
|
||||
+ 'TROUBLESHOOTING.md',
|
||||
+ ];
|
||||
+ for (const source of sources) {
|
||||
+ console.log(`cp "${source}" -> "${ws}"`);
|
||||
+ try {
|
||||
+ await qq.cp(path.join(c.root, source), ws);
|
||||
+ } catch (err) {
|
||||
+ // OK if package-lock.json doesn't exist
|
||||
+ if (source !== 'package-lock.json') {
|
||||
+ throw err;
|
||||
+ }
|
||||
+ }
|
||||
+ await qq.cp(path.join(c.root, source), ws);
|
||||
+ }
|
||||
+ // rename the original balena-cli ./bin/balena entry point for oclif compatibility
|
||||
+ await qq.mv('bin/balena', 'bin/run');
|
||||
@ -80,7 +73,7 @@ index 3e613e0..621d52b 100644
|
||||
const updatePJSON = async () => {
|
||||
qq.cd(c.workspace());
|
||||
const pjson = await qq.readJSON('package.json');
|
||||
@@ -55,7 +82,11 @@ async function build(c, options = {}) {
|
||||
@@ -55,7 +75,11 @@ async function build(c, options = {}) {
|
||||
if (!await qq.exists(lockpath)) {
|
||||
lockpath = qq.join(c.root, 'npm-shrinkwrap.json');
|
||||
}
|
||||
@ -93,7 +86,7 @@ index 3e613e0..621d52b 100644
|
||||
await qq.x('npm install --production');
|
||||
}
|
||||
};
|
||||
@@ -124,7 +155,8 @@ async function build(c, options = {}) {
|
||||
@@ -124,7 +148,8 @@ async function build(c, options = {}) {
|
||||
await qq.writeJSON(c.dist(config.s3Key('manifest')), manifest);
|
||||
};
|
||||
log_1.log(`gathering workspace for ${config.bin} to ${c.workspace()}`);
|
||||
|
Loading…
Reference in New Issue
Block a user