@modernpoacher/deps 1.6.20 → 1.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/common/index.js +3 -4
- package/bin/execute/app.js +0 -1
- package/lib/index.js +1 -1
- package/lib/install/index.js +1 -1
- package/package.json +2 -2
- package/src/index.js +2 -2
- package/src/install/index.js +2 -2
package/bin/common/index.js
CHANGED
|
@@ -108,10 +108,9 @@ function use (key) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
function handleError ({ code = CODE, message = MESSAGE } = {}) {
|
|
111
|
-
log(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
})
|
|
111
|
+
const log = debug('@modernpoacher/deps:error')
|
|
112
|
+
if (code > 1) log(code)
|
|
113
|
+
log(message)
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
const handlePackageError = ({ message = MESSAGE } = {}) => log(`Package error: "${message}"`)
|
package/bin/execute/app.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.executeBundle=executeBundle;exports.executeDev=executeDev;exports.executeOptional=executeOptional;exports.executeProd=executeProd;exports.getInstallCommands=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.executeBundle=executeBundle;exports.executeDev=executeDev;exports.executeOptional=executeOptional;exports.executeProd=executeProd;exports.getInstallCommands=getInstallCommands;exports.getInstallSaveBundleCommands=getInstallSaveBundleCommands;exports.getInstallSaveBundleSaveExactCommands=getInstallSaveBundleSaveExactCommands;exports.getInstallSaveDevCommands=getInstallSaveDevCommands;exports.getInstallSaveDevSaveExactCommands=getInstallSaveDevSaveExactCommands;exports.getInstallSaveExactCommands=getInstallSaveExactCommands;exports.getInstallSaveOptionalCommands=getInstallSaveOptionalCommands;exports.getInstallSaveOptionalSaveExactCommands=getInstallSaveOptionalSaveExactCommands;exports.getInstallSaveProdCommands=getInstallSaveProdCommands;exports.getInstallSaveProdSaveExactCommands=getInstallSaveProdSaveExactCommands;exports.installSaveBundle=installSaveBundle;exports.installSaveBundleSaveExact=installSaveBundleSaveExact;exports.installSaveDev=installSaveDev;exports.installSaveDevSaveExact=installSaveDevSaveExact;exports.installSaveOptional=installSaveOptional;exports.installSaveOptionalSaveExact=installSaveOptionalSaveExact;exports.installSaveProd=installSaveProd;exports.installSaveProdSaveExact=installSaveProdSaveExact;var _debug=_interopRequireDefault(require("debug"));var _path=require("path");var _child_process=require("child_process");var _env=require("./common/env");var _common=require("./common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps');log(`\`deps\` (${_env.PLATFORM}) is awake`);const OPTIONS={maxBuffer:1024*2000,shell:true,stdio:'inherit',env:{DEBUG_COLORS:'yes',FORCE_COLOR:_env.PLATFORM==='win32'?3:2}};function use(key){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function use(v){const s=v.trim();if(s==='')return;return log(s);};}function getInstallSaveExactCommands(p,r,f){log('getInstallSaveExactCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalizeCommands)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands))));}function getInstallCommands(p,r,f){log('getInstallCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalizeCommands)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands)));}function getInstallSaveBundleSaveExactCommands(p,r,f){log('getInstallSaveBundleSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveBundleCommands(p,r,f){log('getInstallSaveBundleCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveOptionalSaveExactCommands(p,r,f){log('getInstallSaveOptionalSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveOptionalCommands(p,r,f){log('getInstallSaveOptionalCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveDevSaveExactCommands(p,r,f){log('getInstallSaveDevSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveDevCommands(p,r,f){log('getInstallSaveDevCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveProdSaveExactCommands(p,r,f){log('getInstallSaveProdSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveProdParameter)(commands));}function getInstallSaveProdCommands(p,r,f){log('getInstallSaveProdCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalizeCommands)((0,_common.getSaveProdParameter)(commands));}function installSaveBundleSaveExact(d,p,r,f){log('installSaveBundleSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-bundle-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveBundleSaveExactCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveBundle(d,p,r,f){log('installSaveBundle');return new Promise((resolve,reject)=>{const log=use('install-save-bundle');const commands=(0,_common.getCommands)(d,getInstallSaveBundleCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveOptionalSaveExact(d,p,r,f){log('installSaveOptionalSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-otional-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveOptionalSaveExactCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveOptional(d,p,r,f){log('installSaveOptional');return new Promise((resolve,reject)=>{const log=use('install-save-otional');const commands=(0,_common.getCommands)(d,getInstallSaveOptionalCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveDevSaveExact(d,p,r,f){log('installSaveDevSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-dev-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveDevSaveExactCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveDev(d,p,r,f){log('installSaveDev');return new Promise((resolve,reject)=>{const log=use('install-save-dev');const commands=(0,_common.getCommands)(d,getInstallSaveDevCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveProdSaveExact(d,p,r,f){log('installSaveProdSaveExact');return new Promise((resolve,reject)=>{const log=use('install-save-prod-save-exact');const commands=(0,_common.getCommands)(d,getInstallSaveProdSaveExactCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function installSaveProd(d,p,r,f){log('installSaveProd');return new Promise((resolve,reject)=>{const log=use('install-save-prod');const commands=(0,_common.getCommands)(d,getInstallSaveProdCommands(p,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}async function executeBundle(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeBundle');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveBundleSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveBundle(directory,deps,registry,force);}async function executeOptional(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeOptional');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveOptionalSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveOptional(directory,deps,registry,force);}async function executeDev(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeDev');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveDevSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveDev(directory,deps,registry,force);}async function executeProd(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeProd');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveProdSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveProd(directory,deps,registry,force);}
|
package/lib/install/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.execute=execute;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.execute=execute;exports.getInstallCommands=getInstallCommands;exports.getInstallSaveExactCommands=getInstallSaveExactCommands;exports.install=install;exports.installSaveExact=installSaveExact;var _debug=_interopRequireDefault(require("debug"));var _path=require("path");var _os=require("os");var _child_process=require("child_process");var _env=require("../common/env");var _common=require("../common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps:install');log(`\`install\` (${_os.platform}) is awake`);const OPTIONS={maxBuffer:1024*2000,shell:true,stdio:'inherit',env:{DEBUG_COLORS:'yes',FORCE_COLOR:_env.PLATFORM==='win32'?3:2}};function getInstallSaveExactCommands(p,s,r,f){log('getInstallSaveExactCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalizeCommands)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands)))));}function getInstallCommands(p,s,r,f){log('getInstallCommands');const c=(0,_common.transform)(p);const commands=`npm i ${c}`;return(0,_common.normalizeCommands)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands))));}function installSaveExact(d,p,s,r,f){log('installSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveExactCommands(p,s,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}function install(d,p,s,r,f){log('install');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallCommands(p,s,r,f));const{stdout,stderr}=(0,_child_process.exec)(commands,{...OPTIONS,cwd:(0,_path.normalize)(d)},(e,v)=>!e?resolve(v):reject(e));stdout.on('data',log);stderr.on('data',log);});}async function execute(directory=_common.DIRECTORY,packages={},configuration={},save=false,registry=_common.REGISTRY,force=false){log('execute');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveExact(directory,depsExact,save,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await install(directory,deps,save,registry,force);}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.21",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"babel:watch": "npm run babel -- -w",
|
|
38
38
|
"lint": "eslint .",
|
|
39
39
|
"lint:fix": "npm run lint -- --fix",
|
|
40
|
-
"test": " DEBUG_COLORS=yes NODE_ENV=test mocha test --recursive -r @babel/register --verbose --color",
|
|
40
|
+
"test": "cross-env DEBUG_COLORS=yes NODE_ENV=test mocha test --recursive -r @babel/register --verbose --color",
|
|
41
41
|
"pre-commit": "npm run lint && npm run test && npm run build && git add lib"
|
|
42
42
|
},
|
|
43
43
|
"bin": {
|
package/src/index.js
CHANGED
|
@@ -70,7 +70,7 @@ function use (key) {
|
|
|
70
70
|
*
|
|
71
71
|
* @return {Array}
|
|
72
72
|
*/
|
|
73
|
-
export
|
|
73
|
+
export function getInstallSaveExactCommands (p, r, f) {
|
|
74
74
|
log('getInstallSaveExactCommands')
|
|
75
75
|
|
|
76
76
|
const c = transform(p)
|
|
@@ -92,7 +92,7 @@ export const getInstallSaveExactCommands = (p, r, f) => {
|
|
|
92
92
|
*
|
|
93
93
|
* @return {Array}
|
|
94
94
|
*/
|
|
95
|
-
export
|
|
95
|
+
export function getInstallCommands (p, r, f) {
|
|
96
96
|
log('getInstallCommands')
|
|
97
97
|
|
|
98
98
|
const c = transform(p)
|
package/src/install/index.js
CHANGED
|
@@ -58,7 +58,7 @@ const OPTIONS = {
|
|
|
58
58
|
*
|
|
59
59
|
* @return {Array}
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
61
|
+
export function getInstallSaveExactCommands (p, s, r, f) {
|
|
62
62
|
log('getInstallSaveExactCommands')
|
|
63
63
|
|
|
64
64
|
const c = transform(p)
|
|
@@ -81,7 +81,7 @@ export const getInstallSaveExactCommands = (p, s, r, f) => {
|
|
|
81
81
|
*
|
|
82
82
|
* @return {Array}
|
|
83
83
|
*/
|
|
84
|
-
export
|
|
84
|
+
export function getInstallCommands (p, s, r, f) {
|
|
85
85
|
log('getInstallCommands')
|
|
86
86
|
|
|
87
87
|
const c = transform(p)
|