diff --git a/bin/cli-flags.js b/bin/cli-flags.js index ba6dc2991b..b3abb0c265 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -1,417 +1,414 @@ 'use strict'; module.exports = { - devServer: [ - { - name: 'host', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'The hostname/ip address the server will bind to.', - }, - { - name: 'port', - type: Number, - configs: [ - { - type: 'number', - }, - ], - description: 'The port server will listen to.', - }, - { - name: 'static', - type: [String, Boolean], - configs: [ - { - type: 'string', - }, - { - type: 'boolean', - }, - ], - description: 'A directory to serve static content from.', - multiple: true, - negative: true, - }, - { - name: 'static-directory', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Directory for static contents.', - processor(opts) { - opts.static = opts.static || {}; - opts.static.directory = opts.staticDirectory; - delete opts.staticDirectory; + host: { + name: 'host', + type: String, + configs: [ + { + type: 'string', }, - }, - { - name: 'static-public-path', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: - 'The bundled files will be available in the browser under this path.', - multiple: true, - processor(opts) { - opts.static = opts.static || {}; - opts.static.publicPath = opts.staticPublicPath; - delete opts.staticPublicPath; + ], + description: 'The hostname/ip address the server will bind to.', + }, + port: { + name: 'port', + type: Number, + configs: [ + { + type: 'number', }, - }, - { - name: 'static-serve-index', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Tells dev-server to use serveIndex middleware.', - negatedDescription: - 'Do not tell dev-server to use serveIndex middleware.', - negative: true, - processor(opts) { - opts.static = opts.static || {}; - opts.static.serveIndex = opts.staticServeIndex; - delete opts.staticServeIndex; + ], + description: 'The port server will listen to.', + }, + static: { + name: 'static', + type: [String, Boolean], + configs: [ + { + type: 'string', }, - }, - { - name: 'static-watch', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Watch for files in static content directory.', - negatedDescription: 'Do not watch for files in static content directory.', - negative: true, - processor(opts) { - opts.static = opts.static || {}; - opts.static.watch = opts.staticWatch; - delete opts.staticWatch; + { + type: 'boolean', }, - }, - { - name: 'live-reload', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Enables live reloading on changing files.', - negatedDescription: 'Disables live reloading on changing files.', - negative: true, - }, - { - name: 'https', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Use HTTPS protocol.', - negatedDescription: 'Do not use HTTPS protocol.', - negative: true, - }, - { - name: 'https-passphrase', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Passphrase for a pfx file.', - processor(opts) { - opts.https = opts.https || {}; - opts.https.passphrase = opts.httpsPassphrase; - delete opts.httpsPassphrase; + ], + description: 'A directory to serve static content from.', + multiple: true, + negative: true, + }, + 'static-directory': { + name: 'static-directory', + type: String, + configs: [ + { + type: 'string', }, + ], + description: 'Directory for static contents.', + processor(opts) { + opts.static = opts.static || {}; + opts.static.directory = opts.staticDirectory; + delete opts.staticDirectory; }, - { - name: 'https-key', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL key.', - processor(opts) { - opts.https = opts.https || {}; - opts.https.key = opts.httpsKey; - delete opts.httpsKey; + }, + 'static-public-path': { + name: 'static-public-path', + type: String, + configs: [ + { + type: 'string', }, + ], + description: + 'The bundled files will be available in the browser under this path.', + multiple: true, + processor(opts) { + opts.static = opts.static || {}; + opts.static.publicPath = opts.staticPublicPath; + delete opts.staticPublicPath; }, - { - name: 'https-pfx', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL pfx file.', - processor(opts) { - opts.https = opts.https || {}; - opts.https.pfx = opts.httpsPfx; - delete opts.httpsPfx; + }, + 'static-serve-index': { + name: 'static-serve-index', + type: Boolean, + configs: [ + { + type: 'boolean', }, + ], + description: 'Tells dev-server to use serveIndex middleware.', + negatedDescription: 'Do not tell dev-server to use serveIndex middleware.', + negative: true, + processor(opts) { + opts.static = opts.static || {}; + opts.static.serveIndex = opts.staticServeIndex; + delete opts.staticServeIndex; }, - { - name: 'https-cert', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL certificate.', - processor(opts) { - opts.https = opts.https || {}; - opts.https.cert = opts.httpsCert; - delete opts.httpsCert; + }, + 'static-watch': { + name: 'static-watch', + type: Boolean, + configs: [ + { + type: 'boolean', }, + ], + description: 'Watch for files in static content directory.', + negatedDescription: 'Do not watch for files in static content directory.', + negative: true, + processor(opts) { + opts.static = opts.static || {}; + opts.static.watch = opts.staticWatch; + delete opts.staticWatch; }, - { - name: 'https-cacert', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL CA certificate.', - processor(opts) { - opts.https = opts.https || {}; - opts.https.cacert = opts.httpsCacert; - delete opts.httpsCacert; + }, + 'live-reload': { + name: 'live-reload', + type: Boolean, + configs: [ + { + type: 'boolean', }, - }, - { - name: 'https-request-cert', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Request for an SSL certificate.', - negatedDescription: 'Do not request for an SSL certificate.', - processor(opts) { - opts.https = opts.https || {}; - opts.https.requestCert = opts.httpsRequestCert; - delete opts.httpsRequestCert; + ], + description: 'Enables live reloading on changing files.', + negatedDescription: 'Disables live reloading on changing files.', + negative: true, + }, + https: { + name: 'https', + type: Boolean, + configs: [ + { + type: 'boolean', }, - }, - { - name: 'http2', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Use HTTP/2, must be used with HTTPS.', - negatedDescription: 'Do not use HTTP/2.', - negative: true, - }, - { - name: 'bonjour', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Broadcasts the server via ZeroConf networking on start.', - negatedDescription: - 'Do not broadcast the server via ZeroConf networking on start.', - negative: true, - }, - { - name: 'client-progress', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Print compilation progress in percentage in the browser.', - negatedDescription: - 'Do not print compilation progress in percentage in the browser.', - negative: true, - processor(opts) { - opts.client = opts.client || {}; - opts.client.progress = opts.clientProgress; - delete opts.clientProgress; + ], + description: 'Use HTTPS protocol.', + negatedDescription: 'Do not use HTTPS protocol.', + negative: true, + }, + 'https-passphrase': { + name: 'https-passphrase', + type: String, + configs: [ + { + type: 'string', }, + ], + description: 'Passphrase for a pfx file.', + processor(opts) { + opts.https = opts.https || {}; + opts.https.passphrase = opts.httpsPassphrase; + delete opts.httpsPassphrase; }, - { - name: 'client-overlay', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: - 'Show a full-screen overlay in the browser when there are compiler errors or warnings.', - negatedDescription: - 'Do not show a full-screen overlay in the browser when there are compiler errors or warnings.', - negative: true, - processor(opts) { - opts.client = opts.client || {}; - opts.client.overlay = opts.clientOverlay; - delete opts.clientOverlay; + }, + 'https-key': { + name: 'https-key', + type: String, + configs: [ + { + type: 'string', }, + ], + description: 'Path to an SSL key.', + processor(opts) { + opts.https = opts.https || {}; + opts.https.key = opts.httpsKey; + delete opts.httpsKey; }, - // TODO remove in the next major release in favor `--open-target` - { - name: 'open', - type: [Boolean, String], - multiple: true, - configs: [ - { - type: 'boolean', - }, - { - type: 'string', - }, - ], - description: 'Open the default browser.', - negatedDescription: 'Do not open the default browser.', - negative: true, + }, + 'https-pfx': { + name: 'https-pfx', + type: String, + configs: [ + { + type: 'string', + }, + ], + description: 'Path to an SSL pfx file.', + processor(opts) { + opts.https = opts.https || {}; + opts.https.pfx = opts.httpsPfx; + delete opts.httpsPfx; }, - { - name: 'open-app', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Open specified browser.', - processor(opts) { - opts.open = opts.open || {}; - opts.open.app = opts.openApp.split(' '); - delete opts.openApp; + }, + 'https-cert': { + name: 'https-cert', + type: String, + configs: [ + { + type: 'string', }, + ], + description: 'Path to an SSL certificate.', + processor(opts) { + opts.https = opts.https || {}; + opts.https.cert = opts.httpsCert; + delete opts.httpsCert; }, - { - name: 'open-target', - type: String, - configs: [ - { - type: 'boolean', - }, - { - type: 'string', - }, - ], - description: 'Open specified route in browser.', - processor(opts) { - opts.open = opts.open || {}; - opts.open.target = opts.openTarget; - delete opts.openTarget; - }, - negatedDescription: 'Do not open specified route in browser.', - multiple: true, - negative: true, + }, + 'https-cacert': { + name: 'https-cacert', + type: String, + configs: [ + { + type: 'string', + }, + ], + description: 'Path to an SSL CA certificate.', + processor(opts) { + opts.https = opts.https || {}; + opts.https.cacert = opts.httpsCacert; + delete opts.httpsCacert; }, - { - name: 'client-logging', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: - 'Log level in the browser (none, error, warn, info, log, verbose).', - processor(opts) { - opts.client = opts.client || {}; - opts.client.logging = opts.clientLogging; - delete opts.clientLogging; + }, + 'https-request-cert': { + name: 'https-request-cert', + type: Boolean, + configs: [ + { + type: 'boolean', }, + ], + description: 'Request for an SSL certificate.', + negatedDescription: 'Do not request for an SSL certificate.', + processor(opts) { + opts.https = opts.https || {}; + opts.https.requestCert = opts.httpsRequestCert; + delete opts.httpsRequestCert; }, - { - name: 'history-api-fallback', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Fallback to /index.html for Single Page Applications.', - negatedDescription: - 'Do not fallback to /index.html for Single Page Applications.', - negative: true, + }, + http2: { + name: 'http2', + type: Boolean, + configs: [ + { + type: 'boolean', + }, + ], + description: 'Use HTTP/2, must be used with HTTPS.', + negatedDescription: 'Do not use HTTP/2.', + negative: true, + }, + bonjour: { + name: 'bonjour', + type: Boolean, + configs: [ + { + type: 'boolean', + }, + ], + description: 'Broadcasts the server via ZeroConf networking on start.', + negatedDescription: + 'Do not broadcast the server via ZeroConf networking on start.', + negative: true, + }, + 'client-progress': { + name: 'client-progress', + type: Boolean, + configs: [ + { + type: 'boolean', + }, + ], + description: 'Print compilation progress in percentage in the browser.', + negatedDescription: + 'Do not print compilation progress in percentage in the browser.', + negative: true, + processor(opts) { + opts.client = opts.client || {}; + opts.client.progress = opts.clientProgress; + delete opts.clientProgress; }, - { - name: 'compress', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Enable gzip compression.', - negatedDescription: 'Disable gzip compression.', - negative: true, + }, + 'client-overlay': { + name: 'client-overlay', + type: Boolean, + configs: [ + { + type: 'boolean', + }, + ], + description: + 'Show a full-screen overlay in the browser when there are compiler errors or warnings.', + negatedDescription: + 'Do not show a full-screen overlay in the browser when there are compiler errors or warnings.', + negative: true, + processor(opts) { + opts.client = opts.client || {}; + opts.client.overlay = opts.clientOverlay; + delete opts.clientOverlay; }, - { - name: 'public', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'The public hostname/ip address of the server.', + }, + // TODO remove in the next major release in favor `--open-target` + open: { + name: 'open', + type: [Boolean, String], + multiple: true, + configs: [ + { + type: 'boolean', + }, + { + type: 'string', + }, + ], + description: 'Open the default browser.', + negatedDescription: 'Do not open the default browser.', + negative: true, + }, + 'open-app': { + name: 'open-app', + type: String, + configs: [ + { + type: 'string', + }, + ], + description: 'Open specified browser.', + processor(opts) { + opts.open = opts.open || {}; + opts.open.app = opts.openApp.split(' '); + delete opts.openApp; }, - { - name: 'firewall', - type: [Boolean, String], - configs: [ - { - type: 'boolean', - }, - { - type: 'string', - }, - ], - description: - 'Enable firewall or set hosts that are allowed to access the dev server.', - negatedDescription: 'Disable firewall.', - multiple: true, - negative: true, + }, + 'open-target': { + name: 'open-target', + type: [Boolean, String], + configs: [ + { + type: 'boolean', + }, + { + type: 'string', + }, + ], + description: 'Open specified route in browser.', + processor(opts) { + opts.open = opts.open || {}; + opts.open.target = opts.openTarget; + delete opts.openTarget; }, - { - name: 'watch-files', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Watch static files for file changes.', - multiple: true, + negatedDescription: 'Do not open specified route in browser.', + multiple: true, + negative: true, + }, + 'client-logging': { + name: 'client-logging', + type: String, + configs: [ + { + type: 'string', + }, + ], + description: + 'Log level in the browser (none, error, warn, info, log, verbose).', + processor(opts) { + opts.client = opts.client || {}; + opts.client.logging = opts.clientLogging; + delete opts.clientLogging; }, - ], + }, + 'history-api-fallback': { + name: 'history-api-fallback', + type: Boolean, + configs: [ + { + type: 'boolean', + }, + ], + description: 'Fallback to /index.html for Single Page Applications.', + negatedDescription: + 'Do not fallback to /index.html for Single Page Applications.', + negative: true, + }, + compress: { + name: 'compress', + type: Boolean, + configs: [ + { + type: 'boolean', + }, + ], + description: 'Enable gzip compression.', + negatedDescription: 'Disable gzip compression.', + negative: true, + }, + public: { + name: 'public', + type: String, + configs: [ + { + type: 'string', + }, + ], + description: 'The public hostname/ip address of the server.', + }, + firewall: { + name: 'firewall', + type: [Boolean, String], + configs: [ + { + type: 'boolean', + }, + { + type: 'string', + }, + ], + description: + 'Enable firewall or set hosts that are allowed to access the dev server.', + negatedDescription: 'Disable firewall.', + multiple: true, + negative: true, + }, + 'watch-files': { + name: 'watch-files', + type: String, + configs: [ + { + type: 'string', + }, + ], + description: 'Watch static files for file changes.', + multiple: true, + }, };