Comparing version 2.11.0 to 2.12.0
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -12,5 +12,5 @@ * - All the amazing contributors | ||
const index = require('./cli-index.js'); | ||
const chalk = _interopDefault(require('chalk')); | ||
const env = _interopDefault(require('std-env')); | ||
const index$1 = require('./cli-index.js'); | ||
const consola = _interopDefault(require('consola')); | ||
@@ -70,3 +70,3 @@ const prettyBytes = _interopDefault(require('pretty-bytes')); | ||
process.stdout.write(index$1.successBox(messageLines.join('\n'), titleLines.join('\n'))); | ||
process.stdout.write(index.successBox(messageLines.join('\n'), titleLines.join('\n'))); | ||
} | ||
@@ -73,0 +73,0 @@ |
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -10,2 +10,3 @@ * - All the amazing contributors | ||
const index = require('./cli-index.js'); | ||
require('path'); | ||
@@ -19,4 +20,7 @@ require('@nuxt/config'); | ||
require('boxen'); | ||
const index$1 = require('./cli-index.js'); | ||
require('consola'); | ||
require('minimist'); | ||
require('hable'); | ||
require('fs'); | ||
require('execa'); | ||
@@ -28,4 +32,4 @@ const build = { | ||
options: { | ||
...index$1.common, | ||
...index$1.locking, | ||
...index.common, | ||
...index.locking, | ||
analyze: { | ||
@@ -89,3 +93,3 @@ alias: 'a', | ||
if (cmd.argv.lock) { | ||
await cmd.setLock(await index$1.createLock({ | ||
await cmd.setLock(await index.createLock({ | ||
id: 'build', | ||
@@ -92,0 +96,0 @@ dir: nuxt.options.buildDir, |
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -12,2 +12,3 @@ * - All the amazing contributors | ||
const index = require('./cli-index.js'); | ||
require('path'); | ||
@@ -21,4 +22,7 @@ require('@nuxt/config'); | ||
require('boxen'); | ||
const index$1 = require('./cli-index.js'); | ||
const consola = _interopDefault(require('consola')); | ||
require('minimist'); | ||
require('hable'); | ||
require('fs'); | ||
require('execa'); | ||
require('pretty-bytes'); | ||
@@ -33,4 +37,4 @@ const banner = require('./cli-banner.js'); | ||
options: { | ||
...index$1.common, | ||
...index$1.server, | ||
...index.common, | ||
...index.server, | ||
open: { | ||
@@ -106,2 +110,7 @@ alias: 'o', | ||
// Display server urls after the build | ||
for (const listener of nuxt.server.listeners) { | ||
consola.info(chalk.bold('Listening on: ') + listener.url); | ||
} | ||
// Return instance | ||
@@ -112,3 +121,3 @@ return nuxt | ||
logChanged ({ event, path }) { | ||
const { icon, color, action } = index$1.eventsMapping[event] || index$1.eventsMapping.change; | ||
const { icon, color, action } = index.eventsMapping[event] || index.eventsMapping.change; | ||
@@ -118,3 +127,3 @@ consola.log({ | ||
icon: chalk[color].bold(icon), | ||
message: `${action} ${chalk.cyan(index$1.formatPath(path))}` | ||
message: `${action} ${chalk.cyan(index.formatPath(path))}` | ||
}); | ||
@@ -121,0 +130,0 @@ }, |
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -10,2 +10,3 @@ * - All the amazing contributors | ||
const index = require('./cli-index.js'); | ||
require('path'); | ||
@@ -19,4 +20,7 @@ require('@nuxt/config'); | ||
require('boxen'); | ||
const index$1 = require('./cli-index.js'); | ||
require('consola'); | ||
require('minimist'); | ||
require('hable'); | ||
require('fs'); | ||
require('execa'); | ||
@@ -28,4 +32,4 @@ const generate = { | ||
options: { | ||
...index$1.common, | ||
...index$1.locking, | ||
...index.common, | ||
...index.locking, | ||
build: { | ||
@@ -61,6 +65,6 @@ type: 'boolean', | ||
modern: { | ||
...index$1.common.modern, | ||
...index.common.modern, | ||
description: 'Generate app in modern build (modern mode can be only client)', | ||
prepare (cmd, options, argv) { | ||
if (index$1.normalizeArg(argv.modern)) { | ||
if (index.normalizeArg(argv.modern)) { | ||
options.modern = 'client'; | ||
@@ -88,3 +92,3 @@ } | ||
if (cmd.argv.lock) { | ||
await cmd.setLock(await index$1.createLock({ | ||
await cmd.setLock(await index.createLock({ | ||
id: 'build', | ||
@@ -98,3 +102,3 @@ dir: nuxt.options.buildDir, | ||
await cmd.setLock(await index$1.createLock({ | ||
await cmd.setLock(await index.createLock({ | ||
id: 'generate', | ||
@@ -101,0 +105,0 @@ dir: nuxt.options.generate.dir, |
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -12,3 +12,3 @@ * - All the amazing contributors | ||
const command = require('./cli-command.js'); | ||
const index = require('./cli-index.js'); | ||
require('path'); | ||
@@ -22,7 +22,7 @@ require('@nuxt/config'); | ||
require('boxen'); | ||
const index$1 = require('./cli-index.js'); | ||
const consola = _interopDefault(require('consola')); | ||
require('minimist'); | ||
require('hable'); | ||
require('esm'); | ||
require('fs'); | ||
require('execa'); | ||
@@ -34,3 +34,3 @@ async function listCommands () { | ||
const _commands = await Promise.all( | ||
commandsOrder.map(cmd => command.getCommand(cmd)) | ||
commandsOrder.map(cmd => index.getCommand(cmd)) | ||
); | ||
@@ -47,14 +47,14 @@ | ||
const _cmds = commandsHelp.map(([cmd, description]) => { | ||
const i = index$1.indent(maxLength + index$1.optionSpaces - cmd.length); | ||
return index$1.foldLines( | ||
const i = index.indent(maxLength + index.optionSpaces - cmd.length); | ||
return index.foldLines( | ||
chalk.green(cmd) + i + description, | ||
index$1.startSpaces + maxLength + index$1.optionSpaces * 2, | ||
index$1.startSpaces + index$1.optionSpaces | ||
index.startSpaces + maxLength + index.optionSpaces * 2, | ||
index.startSpaces + index.optionSpaces | ||
) | ||
}).join('\n'); | ||
const usage = index$1.foldLines('Usage: nuxt <command> [--help|-h]', index$1.startSpaces); | ||
const cmds = index$1.foldLines('Commands:', index$1.startSpaces) + '\n\n' + _cmds; | ||
const usage = index.foldLines('Usage: nuxt <command> [--help|-h]', index.startSpaces); | ||
const cmds = index.foldLines('Commands:', index.startSpaces) + '\n\n' + _cmds; | ||
process.stderr.write(index$1.colorize(`${usage}\n\n${cmds}\n\n`)); | ||
process.stderr.write(index.colorize(`${usage}\n\n${cmds}\n\n`)); | ||
} | ||
@@ -67,4 +67,4 @@ | ||
options: { | ||
help: index$1.common.help, | ||
version: index$1.common.version | ||
help: index.common.help, | ||
version: index.common.version | ||
}, | ||
@@ -76,5 +76,5 @@ async run (cmd) { | ||
} | ||
const command$1 = await command.getCommand(name); | ||
const command = await index.getCommand(name); | ||
if (!command$1) { | ||
if (!command) { | ||
consola.info(`Unknown command: ${name}`); | ||
@@ -84,3 +84,3 @@ return | ||
command.NuxtCommand.from(command$1).showHelp(); | ||
index.NuxtCommand.from(command).showHelp(); | ||
} | ||
@@ -87,0 +87,0 @@ }; |
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -10,2 +10,3 @@ * - All the amazing contributors | ||
const index = require('./cli-index.js'); | ||
require('path'); | ||
@@ -19,4 +20,7 @@ require('@nuxt/config'); | ||
require('boxen'); | ||
const index$1 = require('./cli-index.js'); | ||
require('consola'); | ||
require('minimist'); | ||
require('hable'); | ||
require('fs'); | ||
require('execa'); | ||
require('pretty-bytes'); | ||
@@ -30,4 +34,4 @@ const banner = require('./cli-banner.js'); | ||
options: { | ||
...index$1.common, | ||
...index$1.server | ||
...index.common, | ||
...index.server | ||
}, | ||
@@ -34,0 +38,0 @@ async run (cmd) { |
118
dist/cli.js
/*! | ||
* @nuxt/cli v2.11.0 (c) 2016-2019 | ||
* @nuxt/cli v2.12.0 (c) 2016-2020 | ||
@@ -12,8 +12,6 @@ * - All the amazing contributors | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
const command = require('./cli-command.js'); | ||
const index = require('./cli-index.js'); | ||
require('path'); | ||
require('@nuxt/config'); | ||
const exit = _interopDefault(require('exit')); | ||
require('exit'); | ||
require('@nuxt/utils'); | ||
@@ -24,105 +22,17 @@ require('chalk'); | ||
require('boxen'); | ||
const index$1 = require('./cli-index.js'); | ||
const consola = _interopDefault(require('consola')); | ||
require('consola'); | ||
require('minimist'); | ||
require('hable'); | ||
require('esm'); | ||
const fs = _interopDefault(require('fs')); | ||
const execa = _interopDefault(require('execa')); | ||
require('fs'); | ||
require('execa'); | ||
let _setup = false; | ||
function setup ({ dev }) { | ||
// Apply default NODE_ENV if not provided | ||
if (!process.env.NODE_ENV) { | ||
process.env.NODE_ENV = dev ? 'development' : 'production'; | ||
} | ||
if (_setup) { | ||
return | ||
} | ||
_setup = true; | ||
// Global error handler | ||
/* istanbul ignore next */ | ||
process.on('unhandledRejection', (err) => { | ||
consola.error(err); | ||
}); | ||
// Exit process on fatal errors | ||
/* istanbul ignore next */ | ||
consola.addReporter({ | ||
log (logObj) { | ||
if (logObj.type === 'fatal') { | ||
const errorMessage = String(logObj.args[0]); | ||
process.stderr.write(index$1.fatalBox(errorMessage)); | ||
exit(1); | ||
} | ||
} | ||
}); | ||
// Wrap all console logs with consola for better DX | ||
consola.wrapConsole(); | ||
} | ||
function packageExists (name) { | ||
try { | ||
require.resolve(name); | ||
return true | ||
} catch (e) { | ||
return false | ||
} | ||
} | ||
async function run (_argv, hooks = {}) { | ||
// Check for not installing both nuxt and nuxt-edge | ||
const dupPkg = '@nuxt/' + ( 'cli-edge'); | ||
if (packageExists(dupPkg)) { | ||
throw new Error('Both `nuxt` and `nuxt-edge` dependencies are installed! This is unsupported, please choose one and remove the other one from dependencies.') | ||
} | ||
// Read from process.argv | ||
const argv = _argv ? Array.from(_argv) : process.argv.slice(2); | ||
// Check for internal command | ||
let cmd = await command.getCommand(argv[0]); | ||
// Matching `nuxt` or `nuxt [dir]` or `nuxt -*` for `nuxt dev` shortcut | ||
if (!cmd && (!argv[0] || argv[0][0] === '-' || fs.existsSync(argv[0]))) { | ||
argv.unshift('dev'); | ||
cmd = await command.getCommand('dev'); | ||
} | ||
// Check for dev | ||
const dev = argv[0] === 'dev'; | ||
// Setup env | ||
setup({ dev }); | ||
// Try internal command | ||
if (cmd) { | ||
return command.NuxtCommand.run(cmd, argv.slice(1), hooks) | ||
} | ||
// Try external command | ||
try { | ||
await execa(`nuxt-${argv[0]}`, argv.slice(1), { | ||
stdout: process.stdout, | ||
stderr: process.stderr, | ||
stdin: process.stdin | ||
}); | ||
} catch (error) { | ||
if (error.exitCode === 2) { | ||
throw String(`Command not found: nuxt-${argv[0]}`) | ||
} | ||
throw String(`Failed to run command \`nuxt-${argv[0]}\`:\n${error}`) | ||
} | ||
} | ||
exports.NuxtCommand = command.NuxtCommand; | ||
exports.commands = command.index; | ||
exports.imports = command.imports; | ||
exports.loadNuxtConfig = command.loadNuxtConfig; | ||
exports.options = index$1.index; | ||
exports.run = run; | ||
exports.setup = setup; | ||
exports.NuxtCommand = index.NuxtCommand; | ||
exports.commands = index.index; | ||
exports.getWebpackConfig = index.getWebpackConfig; | ||
exports.imports = index.imports; | ||
exports.loadNuxtConfig = index.loadNuxtConfig; | ||
exports.options = index.index$1; | ||
exports.run = index.run; | ||
exports.setup = index.setup; |
{ | ||
"name": "@nuxt/cli", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"repository": "nuxt/nuxt.js", | ||
"license": "MIT", | ||
"main": "dist/cli.js", | ||
"bin": { | ||
"nuxt-cli": "bin/nuxt-cli.js" | ||
}, | ||
"files": [ | ||
@@ -10,12 +14,8 @@ "bin", | ||
], | ||
"main": "dist/cli.js", | ||
"bin": { | ||
"nuxt-cli": "bin/nuxt-cli.js" | ||
}, | ||
"dependencies": { | ||
"@nuxt/config": "2.11.0", | ||
"@nuxt/utils": "2.11.0", | ||
"@nuxt/config": "2.12.0", | ||
"@nuxt/utils": "2.12.0", | ||
"boxen": "^4.2.0", | ||
"chalk": "^2.4.2", | ||
"consola": "^2.11.1", | ||
"chalk": "^3.0.0", | ||
"consola": "^2.11.3", | ||
"esm": "^3.2.25", | ||
@@ -25,4 +25,4 @@ "execa": "^3.4.0", | ||
"fs-extra": "^8.1.0", | ||
"hable": "^2.3.2", | ||
"minimist": "^1.2.0", | ||
"hable": "^3.0.0", | ||
"minimist": "^1.2.5", | ||
"opener": "1.5.1", | ||
@@ -29,0 +29,0 @@ "pretty-bytes": "^5.3.0", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
107524
3599
13
2
+ Added@nuxt/config@2.12.0(transitive)
+ Added@nuxt/utils@2.12.0(transitive)
+ Addedhable@3.0.0(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedserialize-javascript@3.1.0(transitive)
- Removed@nuxt/config@2.11.0(transitive)
- Removed@nuxt/utils@2.11.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhable@2.3.2(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedserialize-javascript@2.1.2(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@nuxt/config@2.12.0
Updated@nuxt/utils@2.12.0
Updatedchalk@^3.0.0
Updatedconsola@^2.11.3
Updatedhable@^3.0.0
Updatedminimist@^1.2.5