@ngx-rocket/scripts
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -0,1 +1,5 @@ | ||
# 1.1.0 | ||
- Added yarn usage detection (https://github.com/ngx-rocket/generator-ngx-rocket/issues/49) | ||
- Fixed passing Cordova arbitrary options | ||
# 1.0.5 | ||
@@ -2,0 +6,0 @@ - Fixed extra resources copy on OS X/Linux (https://github.com/ngx-rocket/generator-ngx-rocket/issues/137) |
27
index.js
@@ -12,2 +12,3 @@ 'use strict'; | ||
const isWin = /^win/.test(process.platform); | ||
const generator = 'generator-ngx-rocket'; | ||
const appName = path.basename(process.argv[1]); | ||
@@ -34,2 +35,3 @@ const help = `${chalk.bold('Usage')} ${appName} ${chalk.blue('[command]')} [options]\n`; | ||
--release Create a Cordova release build | ||
--verbose Show Cordova debug output | ||
--yarn Use Yarn instead of NPM to run the ${chalk.cyan('build')} script | ||
@@ -58,5 +60,6 @@ | ||
this._options = minimist(args, { | ||
boolean: ['help', 'fast', 'dev', 'device', 'emulate', 'debug', 'release', 'yarn', 'cordova', 'dist'], | ||
boolean: ['help', 'fast', 'dev', 'device', 'emulate', 'debug', 'release', 'yarn', 'cordova', 'dist', 'verbose'], | ||
string: ['o', 'copy', 'env', 'path'], | ||
alias: {e: 'env'} | ||
alias: {e: 'env'}, | ||
'--': true | ||
}); | ||
@@ -69,2 +72,5 @@ } | ||
} | ||
if (this._packageManager() === 'yarn') { | ||
this._options.yarn = true; | ||
} | ||
switch (this._args[0]) { | ||
@@ -107,3 +113,3 @@ case 'env2json': | ||
if (!options.fast) { | ||
const buildOptions = ['run', 'build', '-s', '--']; | ||
const buildOptions = ['run', 'build'].concat(options.yarn ? [] : ['-s', '--']); | ||
if (options.dev) { | ||
@@ -124,3 +130,3 @@ buildOptions.push('--dev'); | ||
cordovaOptions.push('--no-telemetry'); | ||
['device', 'emulate', 'debug', 'release'].forEach(option => { | ||
['device', 'emulate', 'debug', 'release', 'verbose'].forEach(option => { | ||
if (options[option]) { | ||
@@ -130,2 +136,4 @@ cordovaOptions.push('--' + option); | ||
}); | ||
Array.prototype.push.apply(cordovaOptions, options['--']); | ||
const cordovaResult = child.spawnSync(`cordova`, cordovaOptions, spawnOptions); | ||
@@ -216,2 +224,13 @@ if (cordovaResult.status) { | ||
_packageManager() { | ||
let pm = null; | ||
try { | ||
const rc = require(path.join(process.cwd(), '.yo-rc.json')); | ||
pm = rc[generator].props.packageManager; | ||
} catch (err) { | ||
// Do nothing | ||
} | ||
return pm || process.env.NGX_PACKAGE_MANAGER || 'npm'; | ||
} | ||
_help(details) { | ||
@@ -218,0 +237,0 @@ console.log(asciiLogo(pkg.version, 'APP SUPPORT SCRIPTS')); |
{ | ||
"name": "@ngx-rocket/scripts", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Support scripts for ngX-Rocket projects", | ||
@@ -33,3 +33,3 @@ "repository": "ngx-rocket/scripts", | ||
"@ngx-rocket/ascii-logo": "^1.1.0", | ||
"chalk": "^2.0.1", | ||
"chalk": "^2.3.0", | ||
"fs-extra": "^4.0.0", | ||
@@ -39,3 +39,3 @@ "minimist": "^1.2.0" | ||
"devDependencies": { | ||
"eslint": "^4.2.0", | ||
"eslint": "^4.11.0", | ||
"eslint-config-xo-space": "^0.16.0" | ||
@@ -42,0 +42,0 @@ }, |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
15890
237
8
Updatedchalk@^2.3.0