From 4df59348d5abb6ca4b2786ef73a22c67120ac95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 25 May 2017 11:25:49 -0700 Subject: pkglock: add --no-package-lock option as --no-shrinkwrap alias --- lib/config/defaults.js | 2 ++ lib/install/inflate-shrinkwrap.js | 4 +++- lib/install/save.js | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 391419a1c..da019ac4d 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -178,6 +178,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { 'onload-script': false, only: null, optional: true, + 'package-lock': true, parseable: false, 'prefer-offline': false, 'prefer-online': false, @@ -305,6 +306,7 @@ exports.types = { 'onload-script': [null, String], only: [null, 'dev', 'development', 'prod', 'production'], optional: Boolean, + 'package-lock': Boolean, parseable: Boolean, 'prefer-offline': Boolean, 'prefer-online': Boolean, diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js index 596885613..02f7eaedd 100644 --- a/lib/install/inflate-shrinkwrap.js +++ b/lib/install/inflate-shrinkwrap.js @@ -15,7 +15,9 @@ const validate = require('aproba') const path = require('path') module.exports = function (tree, swdeps, opts, finishInflating) { - if (!npm.config.get('shrinkwrap')) return finishInflating() + if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) { + return finishInflating() + } if (arguments.length === 3) { finishInflating = opts opts = {} diff --git a/lib/install/save.js b/lib/install/save.js index 044b12023..56a4a892a 100644 --- a/lib/install/save.js +++ b/lib/install/save.js @@ -43,6 +43,9 @@ function andWarnErrors (cb) { function saveShrinkwrap (tree, next) { validate('OF', arguments) + if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) { + next() + } createShrinkwrap(tree, {silent: false}, next) } -- cgit v1.2.3