From 37428e94597301b6c7a4ae33121057484e7897f4 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Fri, 21 May 2021 16:30:16 +0530 Subject: [PATCH 01/14] feat: more cli options --- README.md | 157 ++-- bin/cli-flags.js | 1432 ++++++++++++++++++++++++----------- lib/options.json | 5 +- test/cli/cli.test.js | 1549 ++++++++++++++++++++++++-------------- test/helpers/test-bin.js | 5 +- 5 files changed, 2082 insertions(+), 1066 deletions(-) diff --git a/README.md b/README.md index 20e9b525ff..400aa49840 100644 --- a/README.md +++ b/README.md @@ -64,68 +64,101 @@ Following options are available with `webpack serve`: Usage: webpack serve|server|s [entries...] [options] Options: - -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using 'webpack-merge'. - --env Environment passed to the configuration when it is a function. - --node-env Sets process.env.NODE_ENV to the specified value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - -d, --devtool Determine source maps to use. - --no-devtool Do not generate source maps. - --entry The entry point(s) of your application e.g. ./src/main.js. - --mode Defines the mode to pass to webpack. - --name Name of the configuration. Used when loading multiple configurations. - -o, --output-path Output location of the file generated by webpack e.g. ./dist/. - --stats [value] It instructs webpack on how to treat the stats e.g. verbose. - --no-stats Disable stats output. - -t, --target Sets the build target e.g. node. - --no-target Negative 'target' option. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Do not stop watching when stdin stream has ended. - --host The hostname/ip address the server will bind to. - --port The port server will listen to. - --static [value...] A directory to serve static content from. - --no-static Negative 'static' option. - --static-directory Directory for static contents. - --static-public-path The bundled files will be available in the browser under this path. - --static-serve-index Tells dev-server to use serveIndex middleware. - --no-static-serve-index Do not tell dev-server to use serveIndex middleware. - --static-watch Watch for files in static content directory. - --no-static-watch Do not watch for files in static content directory. - --live-reload Enables live reloading on changing files. - --no-live-reload Disables live reloading on changing files. - --https Use HTTPS protocol. - --no-https Do not use HTTPS protocol. - --https-passphrase Passphrase for a pfx file. - --https-key Path to an SSL key. - --https-pfx Path to an SSL pfx file. - --https-cert Path to an SSL certificate. - --https-cacert Path to an SSL CA certificate. - --https-request-cert Request for an SSL certificate. - --no-https-request-cert Do not request for an SSL certificate. - --http2 Use HTTP/2, must be used with HTTPS. - --no-http2 Do not use HTTP/2. - --bonjour Broadcasts the server via ZeroConf networking on start. - --no-bonjour Do not broadcast the server via ZeroConf networking on start. - --client-hot-entry Tell devServer to inject a Hot Module Replacement entry. - --no-client-hot-entry Do not tell devServer to inject a Hot Module Replacement entry. - --client-progress Print compilation progress in percentage in the browser. - --no-client-progress Do not print compilation progress in percentage in the browser. - --client-overlay Show a full-screen overlay in the browser when there are compiler errors or warnings. - --no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings. - --client-logging Log level in the browser (none, error, warn, info, log, verbose). - --open [value...] Open the default browser. - --no-open Do not open the default browser. - --open-app Open specified browser. - --open-target [value...] Open specified route in browser. - --no-open-target Do not open specified route in browser. - --history-api-fallback Fallback to /index.html for Single Page Applications. - --no-history-api-fallback Do not fallback to /index.html for Single Page Applications. - --compress Enable gzip compression. - --no-compress Disable gzip compression. - --allowed-hosts Set hosts that are allowed to access the dev server. - --watch-files Watch static files for file changes. + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -d, --devtool Determine source maps to use. + --no-devtool Do not generate source maps. + --entry The entry point(s) of your application e.g. ./src/main.js. + --mode Defines the mode to pass to webpack. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path Output location of the file generated by webpack e.g. ./dist/. + --stats [value] It instructs webpack on how to treat the stats e.g. verbose. + --no-stats Disable stats output. + -t, --target Sets the build target e.g. node. + --no-target Negative 'target' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Do not stop watching when stdin stream has ended. + --allowed-hosts Set hosts that are allowed to access the dev server. + --allowed-hosts-reset Clear all items provided in allowedHosts configuration. + --bonjour Broadcasts the server via ZeroConf networking on start. + --no-bonjour Do not broadcast the server via ZeroConf networking on start. + --client-transport Allows to set custom transport to communicate with server. + --client-logging Specifies client properties. + --client-progress Print compilation progress in percentage in the browser. + --no-client-progress Do not print compilation progress in percentage in the browser. + --client-overlay Show a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Show a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Negative 'client-overlay-errors' option. + --client-overlay-warnings Show a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Negative 'client-overlay-warnings' option. + --client-need-client-entry Tells devServer to inject a client entry. + --no-client-need-client-entry Negative 'client-need-client-entry' option. + --client-hot-entry Tells devServer to inject a Hot Module Replacement entry. + --no-client-hot-entry Do not tell devServer to inject a Hot Module Replacement entry. + --client-web-socket-url When using dev server and you're proxying dev-server, the client script does not always know where to + connect to. + --client-web-socket-url-host Tells clients connected to devServer to use the provided host. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. + --web-socket-server Allows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options. + --compress Enable gzip compression for everything served. + --no-compress Disable gzip compression. + --firewall [value...] Defines routes which are enabled by default, on by default and allows localhost. + --no-firewall Disable firewall. + --firewall-reset Clear all items provided in firewall configuration. + --history-api-fallback When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 + responses. + --no-history-api-fallback Negative 'history-api-fallback' option. + --host Specify a host to use. If you want your server to be accessible externally. + --hot [value] Enable webpack's Hot Module Replacement feature. + --no-hot Disable webpack's Hot Module Replacement feature. + --http2 Serve over HTTP/2 using spdy. + --no-http2 Do not use HTTP/2. + --https By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. + --no-https Do not use HTTPS protocol. + --https-passphrase Passphrase for a pfx file. + --https-request-cert Request for an SSL certificate. + --no-https-request-cert Do not request for an SSL certificate. + --https-cacert Path to an SSL CA certificate. + --https-key Path to an SSL key. + --https-pfx Path to an SSL pfx file. + --https-cert Path to an SSL certificate. + --live-reload By default, the dev-server will reload/refresh the page when file changes are detected. + --no-live-reload Disables live reloading on changing files. + --open [value...] Tells dev-server to open the browser after server had been started. Set it to true to open your default + browser. + --no-open Do not open the default browser. + --open-target [value...] Open specified route in browser. + --no-open-target Do not open specified route in browser. + --open-app-name Open specified browser. + --open-app Open specified browser. + --open-reset Clear all items provided in open configuration. + --open-target-reset Clear all items provided in open.target configuration. + --open-app-name-reset Clear all items provided in open.app.name configuration. + --port Specify a port number to listen for requests on. + --public The public hostname/ip address of the server that client script will try to connect to. + --static [value...] It is possible to configure advanced options for serving static files from directory. See the Express + documentation for the possible options. + --no-static Negative 'static' option. + --static-directory Directory for static contents. + --static-public-path The bundled files will be available in the browser under this path. + --static-serve-index Tells dev-server to use serveIndex middleware when enabled. + --no-static-serve-index Do not tell dev-server to use serveIndex middleware. + --static-watch Watch for files in static content directory. + --no-static-watch Do not watch for files in static content directory. + --static-reset Clear all items provided in static configuration. + --static-public-path-reset Clear all items provided in static.publicPath configuration. + --watch-files List of files to watch for file changes and serve. + --watch-files-paths List of files to watch for file changes and serve. + --watch-files-reset Clear all items provided in watchFiles configuration. + --watch-files-paths-reset Clear all items provided in watchFiles.paths configuration. Global options: --color Enable colors on console. diff --git a/bin/cli-flags.js b/bin/cli-flags.js index c23d102024..66cbfd408e 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -1,427 +1,1015 @@ 'use strict'; -const normalizeOption = (option) => (typeof option === 'object' ? option : {}); +const normalizeOption = (option) => + typeof option === 'object' && !Array.isArray(option) ? option : {}; module.exports = { - devServer: [ - { - name: 'host', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'The hostname/ip address the server will bind to.', - }, - { - name: 'port', - type: [Number, String], - configs: [ - { - type: 'number', - }, - { - type: 'string', - }, - { - type: 'enum', - values: ['auto'], - }, - ], - 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 = normalizeOption(opts.static); - opts.static.directory = opts.staticDirectory; - delete opts.staticDirectory; - }, - }, - { - 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 = normalizeOption(opts.static); - opts.static.publicPath = opts.staticPublicPath; - delete opts.staticPublicPath; - }, - }, - { - 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 = normalizeOption(opts.static); - opts.static.serveIndex = opts.staticServeIndex; - delete opts.staticServeIndex; - }, - }, - { - 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 = normalizeOption(opts.static); - opts.static.watch = opts.staticWatch; - delete opts.staticWatch; - }, - }, - { - 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 = normalizeOption(opts.https); - opts.https.passphrase = opts.httpsPassphrase; - delete opts.httpsPassphrase; - }, - }, - { - name: 'https-key', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL key.', - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.key = opts.httpsKey; - delete opts.httpsKey; - }, - }, - { - name: 'https-pfx', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL pfx file.', - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.pfx = opts.httpsPfx; - delete opts.httpsPfx; - }, - }, - { - name: 'https-cert', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL certificate.', - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.cert = opts.httpsCert; - delete opts.httpsCert; - }, - }, - { - name: 'https-cacert', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Path to an SSL CA certificate.', - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.cacert = opts.httpsCacert; - delete opts.httpsCacert; - }, - }, - { - 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 = normalizeOption(opts.https); - opts.https.requestCert = opts.httpsRequestCert; - delete opts.httpsRequestCert; - }, - }, - { - 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-hot-entry', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Tell devServer to inject a Hot Module Replacement entry.', - negatedDescription: - 'Do not tell devServer to inject a Hot Module Replacement entry.', - negative: true, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.hotEntry = opts.clientHotEntry; - delete opts.clientHotEntry; - }, - }, - { - 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 = normalizeOption(opts.client); - opts.client.progress = opts.clientProgress; - delete opts.clientProgress; - }, - }, - { - 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 = normalizeOption(opts.client); - opts.client.overlay = opts.clientOverlay; - delete opts.clientOverlay; - }, - }, - { - name: 'client-logging', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: - 'Log level in the browser (none, error, warn, info, log, verbose).', - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.logging = opts.clientLogging; - delete opts.clientLogging; - }, - }, - { - 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, - }, - { - name: 'open-app', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Open specified browser.', - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.app = opts.openApp; - delete opts.openApp; - }, - }, - { - name: 'open-target', - type: String, - configs: [ - { - type: 'boolean', - }, - { - type: 'string', - }, - ], - description: 'Open specified route in browser.', - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.target = opts.openTarget; - delete opts.openTarget; - }, - negatedDescription: 'Do not open specified route in browser.', - multiple: true, - negative: true, - }, - { - 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, - }, - { - name: 'compress', - type: Boolean, - configs: [ - { - type: 'boolean', - }, - ], - description: 'Enable gzip compression.', - negatedDescription: 'Disable gzip compression.', - negative: true, - }, - { - name: 'allowed-hosts', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Set hosts that are allowed to access the dev server.', - multiple: true, - }, - { - name: 'watch-files', - type: String, - configs: [ - { - type: 'string', - }, - ], - description: 'Watch static files for file changes.', - multiple: true, - }, - ], + 'allowed-hosts': { + configs: [ + { + type: 'string', + multiple: true, + description: 'Set hosts that are allowed to access the dev server.', + path: 'allowedHosts[]', + }, + ], + description: 'Set hosts that are allowed to access the dev server.', + multiple: true, + }, + 'allowed-hosts-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in allowedHosts configuration.', + path: 'firewall', + }, + ], + description: 'Clear all items provided in allowedHosts configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.allowedHosts = opts.allowedHosts || []; + delete opts.sllowedHostsReset; + }, + }, + bonjour: { + configs: [ + { + type: 'boolean', + multiple: false, + description: 'Broadcasts the server via ZeroConf networking on start.', + path: 'bonjour', + }, + ], + description: 'Broadcasts the server via ZeroConf networking on start.', + negatedDescription: + 'Do not broadcast the server via ZeroConf networking on start.', + simpleType: 'boolean', + multiple: false, + }, + 'client-transport': { + configs: [ + { + type: 'enum', + values: ['sockjs', 'ws'], + multiple: false, + description: + 'Allows to set custom transport to communicate with server.', + path: 'client.transport', + }, + { + type: 'string', + multiple: false, + description: + 'Allows to set custom transport to communicate with server.', + path: 'client.transport', + }, + ], + description: 'Allows to set custom transport to communicate with server.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.transport = opts.clientTransport; + delete opts.clientTransport; + }, + }, + 'client-logging': { + configs: [ + { + type: 'enum', + values: ['none', 'error', 'warn', 'info', 'log', 'verbose'], + multiple: false, + description: 'Specifies client properties.', + path: 'client.logging', + }, + ], + description: 'Specifies client properties.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.logging = opts.clientLogging; + delete opts.clientLogging; + }, + }, + 'client-progress': { + configs: [ + { + type: 'boolean', + multiple: false, + description: 'Print compilation progress in percentage in the browser.', + path: 'client.progress', + }, + ], + description: 'Print compilation progress in percentage in the browser.', + negatedDescription: + 'Do not print compilation progress in percentage in the browser.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.progress = opts.clientProgress; + delete opts.clientProgress; + }, + }, + 'client-overlay': { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'Show a full-screen overlay in the browser when there are compiler errors or warnings.', + path: 'client.overlay', + }, + ], + 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.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.overlay = opts.clientOverlay; + delete opts.clientOverlay; + }, + }, + 'client-overlay-errors': { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'Show a full-screen overlay in the browser when there are compiler errors.', + path: 'client.overlay.errors', + }, + ], + description: + 'Show a full-screen overlay in the browser when there are compiler errors.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.overlay = normalizeOption(opts.client.overlay); + opts.client.overlay.errors = opts.clientOverlayErrors; + delete opts.clientOverlayErrors; + }, + }, + 'client-overlay-warnings': { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'Show a full-screen overlay in the browser when there are compiler warnings.', + path: 'client.overlay.warnings', + }, + ], + description: + 'Show a full-screen overlay in the browser when there are compiler warnings.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.overlay = normalizeOption(opts.client.overlay); + opts.client.overlay.warnings = opts.clientOverlayWarnings; + delete opts.clientOverlayWarnings; + }, + }, + 'client-need-client-entry': { + configs: [ + { + type: 'boolean', + multiple: false, + description: 'Tells devServer to inject a client entry.', + path: 'client.needClientEntry', + }, + ], + description: 'Tells devServer to inject a client entry.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.needClientEntry = opts.clientNeedClientEntry; + delete opts.clientNeedClientEntry; + }, + }, + 'client-hot-entry': { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'Tells devServer to inject a Hot Module Replacement entry.', + path: 'client.hotEntry', + }, + ], + description: 'Tells devServer to inject a Hot Module Replacement entry.', + negatedDescription: + 'Do not tell devServer to inject a Hot Module Replacement entry.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.hotEntry = opts.clientHotEntry; + delete opts.clientHotEntry; + }, + }, + 'client-web-socket-url': { + configs: [ + { + type: 'string', + multiple: false, + description: + "When using dev server and you're proxying dev-server, the client script does not always know where to connect to.", + path: 'client.webSocketURL', + }, + ], + description: + "When using dev server and you're proxying dev-server, the client script does not always know where to connect to.", + simpleType: 'string', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.webSocketURL = opts.clientWebSocketUrl; + delete opts.clientWebSocketUrl; + }, + }, + 'client-web-socket-url-host': { + configs: [ + { + type: 'string', + multiple: false, + description: + 'Tells clients connected to devServer to use the provided host.', + path: 'client.webSocketURL.host', + }, + ], + description: + 'Tells clients connected to devServer to use the provided host.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.webSocketURL = normalizeOption(opts.client.webSocketURL); + opts.client.webSocketURL.host = opts.clientWebSocketUrlHost; + delete opts.clientWebSocketUrlHost; + }, + }, + 'client-web-socket-url-port': { + configs: [ + { + type: 'number', + multiple: false, + description: + 'Tells clients connected to devServer to use the provided port.', + path: 'client.port', + }, + ], + description: + 'Tells clients connected to devServer to use the provided port.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.webSocketURL = normalizeOption(opts.client.webSocketURL); + opts.client.webSocketURL.port = opts.clientWebSocketUrlPort; + delete opts.clientWebSocketUrlPort; + }, + }, + 'client-web-socket-url-path': { + configs: [ + { + type: 'string', + multiple: false, + description: + 'Tells clients connected to devServer to use the provided path to connect.', + path: 'client.path', + }, + ], + description: + 'Tells clients connected to devServer to use the provided path to connect.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.client = normalizeOption(opts.client); + opts.client.webSocketURL = normalizeOption(opts.client.webSocketURL); + opts.client.webSocketURL.path = opts.clientWebSocketUrlPath; + delete opts.clientWebSocketUrlPath; + }, + }, + 'web-socket-server': { + configs: [ + { + type: 'enum', + values: ['sockjs', 'ws'], + multiple: false, + description: 'Allows to set web socket server and options.', + path: 'webSocketServer', + }, + { + type: 'string', + multiple: false, + description: 'Allows to set web socket server and options.', + path: 'webSocketServer', + }, + ], + description: 'Allows to set web socket server and options.', + simpleType: 'string', + multiple: false, + }, + 'web-socket-server-type': { + configs: [ + { + type: 'enum', + values: ['sockjs', 'ws'], + multiple: false, + description: 'Allows to set web socket server and options.', + path: 'webSocketServer.type', + }, + { + type: 'string', + multiple: false, + description: 'Allows to set web socket server and options.', + path: 'webSocketServer.type', + }, + ], + description: 'Allows to set web socket server and options.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.webSocketServer = normalizeOption(opts.webSocketServer); + opts.webSocketServer.type = opts.webSocketServerType; + delete opts.webSocketServerType; + }, + }, + compress: { + configs: [ + { + type: 'boolean', + multiple: false, + description: 'Enable gzip compression for everything served.', + path: 'compress', + }, + ], + description: 'Enable gzip compression for everything served.', + negatedDescription: 'Disable gzip compression.', + simpleType: 'boolean', + multiple: false, + }, + firewall: { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'Defines routes which are enabled by default, on by default and allows localhost.', + path: 'firewall', + }, + { + type: 'string', + multiple: true, + description: + 'Defines routes which are enabled by default, on by default and allows localhost.', + path: 'firewall[]', + }, + ], + description: + 'Defines routes which are enabled by default, on by default and allows localhost.', + negatedDescription: 'Disable firewall.', + simpleType: 'string', + multiple: true, + }, + 'firewall-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in firewall configuration.', + path: 'firewall', + }, + ], + description: 'Clear all items provided in firewall configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.firewall = opts.firewall || []; + delete opts.firewallReset; + }, + }, + 'history-api-fallback': { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses.', + path: 'historyApiFallback', + }, + ], + description: + 'When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses.', + simpleType: 'boolean', + multiple: false, + }, + host: { + configs: [ + { + type: 'string', + multiple: false, + description: + 'Specify a host to use. If you want your server to be accessible externally.', + path: 'host', + }, + ], + description: + 'Specify a host to use. If you want your server to be accessible externally.', + simpleType: 'string', + multiple: false, + }, + hot: { + configs: [ + { + type: 'boolean', + multiple: false, + description: "Enable webpack's Hot Module Replacement feature.", + path: 'hot', + }, + { + type: 'enum', + values: ['only'], + multiple: false, + description: "Enable webpack's Hot Module Replacement feature.", + path: 'hot', + }, + ], + description: "Enable webpack's Hot Module Replacement feature.", + negatedDescription: "Disable webpack's Hot Module Replacement feature.", + simpleType: 'string', + multiple: false, + }, + http2: { + configs: [ + { + type: 'boolean', + multiple: false, + description: 'Serve over HTTP/2 using spdy.', + path: 'http2', + }, + ], + description: 'Serve over HTTP/2 using spdy.', + negatedDescription: 'Do not use HTTP/2.', + simpleType: 'boolean', + multiple: false, + }, + https: { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS.', + path: 'https', + }, + ], + description: + 'By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS.', + negatedDescription: 'Do not use HTTPS protocol.', + simpleType: 'boolean', + multiple: false, + }, + 'https-passphrase': { + configs: [ + { + type: 'string', + multiple: false, + description: 'Passphrase for a pfx file.', + path: 'https.passphrase', + }, + ], + description: 'Passphrase for a pfx file.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.https = normalizeOption(opts.https); + opts.https.passphrase = opts.httpsPassphrase; + delete opts.httpsPassphrase; + }, + }, + 'https-request-cert': { + configs: [ + { + type: 'boolean', + multiple: false, + description: 'Request for an SSL certificate.', + path: 'https.requestCert', + }, + ], + description: 'Request for an SSL certificate.', + negatedDescription: 'Do not request for an SSL certificate.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.https = normalizeOption(opts.https); + opts.https.requestCert = opts.httpsRequestCert; + delete opts.httpsRequestCert; + }, + }, + 'https-cacert': { + configs: [ + { + type: 'string', + multiple: false, + description: 'Path to an SSL CA certificate.', + path: 'https.cacert', + }, + ], + description: 'Path to an SSL CA certificate.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.https = normalizeOption(opts.https); + opts.https.cacert = opts.httpsCacert; + delete opts.httpsCacert; + }, + }, + 'https-key': { + configs: [ + { + type: 'string', + multiple: false, + description: 'Path to an SSL key.', + path: 'https.key', + }, + ], + description: 'Path to an SSL key.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.https = normalizeOption(opts.https); + opts.https.key = opts.httpsKey; + delete opts.httpsKey; + }, + }, + 'https-pfx': { + configs: [ + { + type: 'string', + multiple: false, + description: 'Path to an SSL pfx file.', + path: 'https.pfx', + }, + ], + description: 'Path to an SSL pfx file.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.https = normalizeOption(opts.https); + opts.https.pfx = opts.httpsPfx; + delete opts.httpsPfx; + }, + }, + 'https-cert': { + configs: [ + { + type: 'string', + multiple: false, + description: 'Path to an SSL certificate.', + path: 'https.cert', + }, + ], + description: 'Path to an SSL certificate.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.https = normalizeOption(opts.https); + opts.https.cert = opts.httpsCert; + delete opts.httpsCert; + }, + }, + 'live-reload': { + configs: [ + { + type: 'boolean', + multiple: false, + description: + 'By default, the dev-server will reload/refresh the page when file changes are detected.', + path: 'liveReload', + }, + ], + description: + 'By default, the dev-server will reload/refresh the page when file changes are detected.', + negatedDescription: 'Disables live reloading on changing files.', + simpleType: 'boolean', + multiple: false, + }, + open: { + configs: [ + { + type: 'string', + multiple: true, + description: + 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.', + path: 'open[]', + }, + { + type: 'boolean', + multiple: false, + description: + 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.', + path: 'open', + }, + ], + description: + 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.', + negatedDescription: 'Do not open the default browser.', + simpleType: 'string', + multiple: true, + }, + 'open-target': { + configs: [ + { + type: 'boolean', + multiple: true, + description: 'Open specified route in browser.', + path: 'open[].target', + }, + { + type: 'string', + multiple: true, + description: 'Open specified route in browser.', + path: 'open[].target', + }, + { + type: 'string', + multiple: true, + description: 'Open specified route in browser.', + path: 'open.target[]', + }, + ], + description: 'Open specified route in browser.', + negatedDescription: 'Do not open specified route in browser.', + simpleType: 'string', + multiple: true, + processor(opts) { + opts.open = normalizeOption(opts.open); + opts.open.target = opts.openTarget; + delete opts.openTarget; + }, + }, + 'open-app-name': { + configs: [ + { + type: 'string', + multiple: true, + description: 'Open specified browser.', + path: 'open[].app.name', + }, + { + type: 'string', + multiple: true, + description: 'Open specified browser.', + path: 'open.app.name[]', + }, + ], + description: 'Open specified browser.', + simpleType: 'string', + multiple: true, + processor(opts) { + opts.open = normalizeOption(opts.open); + opts.open.app = normalizeOption(opts.open.app); + opts.open.app.name = opts.openAppName; + delete opts.openAppName; + }, + }, + 'open-app': { + configs: [ + { + type: 'string', + multiple: true, + description: 'Open specified browser.', + path: 'open[].app', + }, + ], + description: 'Open specified browser.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.open = normalizeOption(opts.open); + opts.open.app = opts.openApp; + delete opts.openApp; + }, + }, + 'open-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in open configuration.', + path: 'open', + }, + ], + description: 'Clear all items provided in open configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.open = opts.open || []; + delete opts.openReset; + }, + }, + 'open-target-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in open.target configuration.', + path: 'open.target', + }, + ], + description: 'Clear all items provided in open.target configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.open = normalizeOption(opts.open); + opts.open.target = opts.openTarget || []; + delete opts.openTargetReset; + }, + }, + 'open-app-name-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in open.app.name configuration.', + path: 'open.app.name', + }, + ], + description: 'Clear all items provided in open.app.name configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.open = normalizeOption(opts.open); + opts.open.app = normalizeOption(opts.open.app); + opts.open.app.name = opts.openAppName || []; + delete opts.openAppNameReset; + }, + }, + port: { + configs: [ + { + type: 'number', + multiple: false, + description: 'Specify a port number to listen for requests on.', + path: 'port', + }, + { + type: 'string', + multiple: false, + description: 'Specify a port number to listen for requests on.', + path: 'port', + }, + { + type: 'enum', + values: ['auto'], + multiple: false, + description: 'Specify a port number to listen for requests on.', + path: 'port', + }, + ], + description: 'Specify a port number to listen for requests on.', + simpleType: 'string', + multiple: false, + }, + public: { + configs: [ + { + type: 'string', + multiple: false, + description: + 'The public hostname/ip address of the server that client script will try to connect to.', + path: 'public', + }, + ], + description: + 'The public hostname/ip address of the server that client script will try to connect to.', + simpleType: 'string', + multiple: false, + }, + static: { + configs: [ + { + type: 'string', + multiple: true, + description: + 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.', + path: 'static[]', + }, + { + type: 'boolean', + multiple: false, + description: + 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.', + path: 'static', + }, + ], + description: + 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.', + simpleType: 'string', + multiple: true, + }, + 'static-directory': { + configs: [ + { + type: 'string', + multiple: true, + description: 'Directory for static contents.', + path: 'static[].directory', + }, + ], + description: 'Directory for static contents.', + simpleType: 'string', + multiple: false, + processor(opts) { + opts.static = normalizeOption(opts.static); + opts.static.directory = opts.staticDirectory; + delete opts.staticDirectory; + }, + }, + 'static-public-path': { + configs: [ + { + type: 'string', + multiple: true, + description: + 'The bundled files will be available in the browser under this path.', + path: 'static[].publicPath', + }, + { + type: 'string', + multiple: true, + description: + 'The bundled files will be available in the browser under this path.', + path: 'static.publicPath[]', + }, + ], + description: + 'The bundled files will be available in the browser under this path.', + simpleType: 'string', + multiple: true, + processor(opts) { + opts.static = normalizeOption(opts.static); + opts.static.publicPath = opts.staticPublicPath; + delete opts.staticPublicPath; + }, + }, + 'static-serve-index': { + configs: [ + { + type: 'boolean', + multiple: true, + description: + 'Tells dev-server to use serveIndex middleware when enabled.', + path: 'static[].serveIndex', + }, + ], + description: 'Tells dev-server to use serveIndex middleware when enabled.', + negatedDescription: 'Do not tell dev-server to use serveIndex middleware.', + simpleType: 'boolean', + multiple: true, + processor(opts) { + opts.static = normalizeOption(opts.static); + opts.static.serveIndex = opts.staticServeIndex; + delete opts.staticServeIndex; + }, + }, + 'static-watch': { + configs: [ + { + type: 'boolean', + multiple: true, + description: 'Watch for files in static content directory.', + path: 'static[].watch', + }, + ], + description: 'Watch for files in static content directory.', + negatedDescription: 'Do not watch for files in static content directory.', + simpleType: 'boolean', + multiple: true, + processor(opts) { + opts.static = normalizeOption(opts.static); + opts.static.watch = opts.staticWatch; + delete opts.staticWatch; + }, + }, + 'static-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in static configuration.', + path: 'static', + }, + ], + description: 'Clear all items provided in static configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.static = opts.static || []; + delete opts.staticReset; + }, + }, + 'static-public-path-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: + 'Clear all items provided in static.publicPath configuration.', + path: 'static.publicPath', + }, + ], + description: 'Clear all items provided in static.publicPath configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.static = normalizeOption(opts.static); + opts.static.publicPath = opts.staticPublicPath || []; + delete opts.staticPublicPathReset; + }, + }, + 'watch-files': { + configs: [ + { + type: 'string', + multiple: true, + description: 'List of files to watch for file changes and serve.', + path: 'watchFiles[]', + }, + ], + description: 'List of files to watch for file changes and serve.', + simpleType: 'string', + multiple: true, + }, + 'watch-files-paths': { + configs: [ + { + type: 'string', + multiple: true, + description: 'List of files to watch for file changes and serve.', + path: 'watchFiles[].paths', + }, + { + type: 'string', + multiple: true, + description: 'List of files to watch for file changes and serve.', + path: 'watchFiles.paths[]', + }, + ], + description: 'List of files to watch for file changes and serve.', + simpleType: 'string', + multiple: true, + processor(opts) { + opts.watchFiles = normalizeOption(opts.watchFiles); + opts.watchFiles.paths = opts.watchFilesPaths; + delete opts.watchFilesPaths; + }, + }, + 'watch-files-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: 'Clear all items provided in watchFiles configuration.', + path: 'watchFiles', + }, + ], + description: 'Clear all items provided in watchFiles configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.watchFiles = opts.watchFiles || []; + delete opts.watchFilesReset; + }, + }, + 'watch-files-paths-reset': { + configs: [ + { + type: 'reset', + multiple: false, + description: + 'Clear all items provided in watchFiles.paths configuration.', + path: 'watchFiles.paths', + }, + ], + description: 'Clear all items provided in watchFiles.paths configuration.', + simpleType: 'boolean', + multiple: false, + processor(opts) { + opts.watchFiles = normalizeOption(opts.watchFiles); + opts.watchFiles.paths = opts.watchFilesPaths || []; + delete opts.watchFilesPathsReset; + }, + }, }; diff --git a/lib/options.json b/lib/options.json index be7c552b2e..c723649e44 100644 --- a/lib/options.json +++ b/lib/options.json @@ -569,7 +569,10 @@ }, "setupExitSignals": { "type": "boolean", - "description": "It takes a boolean and if true (default on CLI), the server will close and exit the process on SIGINT and SIGTERM. https://webpack.js.org/configuration/dev-server/#devserversetupexitsignals" + "description": "It takes a boolean and if true (default on CLI), the server will close and exit the process on SIGINT and SIGTERM. https://webpack.js.org/configuration/dev-server/#devserversetupexitsignals", + "cli": { + "exclude": true + } }, "static": { "anyOf": [ diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index af3796c17f..f437544b8d 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -15,39 +15,85 @@ const httpsCertificateDirectory = path.resolve( ); describe('CLI', () => { - it('--hot', (done) => { - testBin('--hot --stats=detailed') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).toContain('webpack/hot/dev-server.js'); + describe('hot option', () => { + it('--hot', (done) => { + testBin('--hot --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).toContain('webpack/hot/dev-server.js'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--no-hot', (done) => { - testBin('--no-hot') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); + it('--no-hot', (done) => { + testBin('--no-hot') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); - done(); - }) - .catch(done); + done(); + }) + .catch(done); + }); + + it('--hot only', (done) => { + testBin('--hot only') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).toContain('/hot/only-dev-server'); + + done(); + }) + .catch(done); + }); }); - it('--hot only', (done) => { - testBin('--hot only') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).toContain('/hot/only-dev-server'); + describe('allowedHosts option', () => { + it('--allowed-hosts auto', (done) => { + testBin(['--allowed-hosts', 'auto']) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); + it('--allowed-hosts all', (done) => { + testBin(['--allowed-hosts', 'all']) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--allowed-hosts string', (done) => { + testBin(['--allowed-hosts', 'testhost.com']) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--allowed-hosts multiple', (done) => { + testBin([ + '--allowed-hosts', + 'testhost.com', + '--allowed-hosts', + 'testhost1.com', + ]) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); + describe('bonjour option', () => {}); it('--bonjour', (done) => { testBin('--bonjour') .then((output) => { @@ -87,602 +133,878 @@ describe('CLI', () => { .catch(done); }); - it('--client-progress', (done) => { - testBin('--client-progress') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + describe('client option', () => { + it('--client-transport sockjs', (done) => { + testBin('--client-transport sockjs') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-client-progress', (done) => { - testBin('--no-client-progress') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--client-transport ws', (done) => { + testBin('--client-transport ws') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--client-hot-entry', (done) => { - testBin('--client-hot-entry --stats=detailed') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).toContain('webpack/hot/dev-server.js'); + it('--client-overlay', (done) => { + testBin('--client-overlay') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--no-client-overlay', (done) => { + testBin('--no-client-overlay') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-client-hot-entry', (done) => { - testBin('--no-client-hot-entry --stats=detailed') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); + it('--client-overlay-errors', (done) => { + testBin('--client-overlay-errors') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--no-client-overlay-errors', (done) => { + testBin('--no-client-overlay-errors') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('should not inject HMR entry "--client-hot-entry" and "--no-hot"', (done) => { - testBin('--client-hot-entry --no-hot --stats=detailed') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); + it('--client-overlay-warnings', (done) => { + testBin('--client-overlay-warnings') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--no-client-overlay-warnings', (done) => { + testBin('--no-client-overlay-warnings') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('should not inject HMR entry with "--no-client-hot-entry" and "--hot"', (done) => { - testBin('--no-client-hot-entry --hot --stats=detailed') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); + it('--client-need-client-entry', (done) => { + testBin('--client-need-client-entry --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).toContain('client/index.js'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--http2', (done) => { - testBin('--http2') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); + it('--no-client-need-client-entry', (done) => { + testBin('--no-client-need-client-entry --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).not.toContain('client/index.js'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--no-http2', (done) => { - testBin('--no-http2') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot(); + it('--client-logging', (done) => { + testBin('--client-logging verbose') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--client-progress', (done) => { + testBin('--client-progress') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--https', (done) => { - testBin('--https') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); + it('--no-client-progress', (done) => { + testBin('--no-client-progress') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--client-hot-entry', (done) => { + testBin('--client-hot-entry --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).toContain('webpack/hot/dev-server.js'); - it('https options', (done) => { - const pfxFile = path.join(httpsCertificateDirectory, 'server.pfx'); - const key = path.join(httpsCertificateDirectory, 'server.key'); - const cert = path.join(httpsCertificateDirectory, 'server.crt'); - const cacert = path.join(httpsCertificateDirectory, 'ca.pem'); - const passphrase = 'webpack-dev-server'; + done(); + }) + .catch(done); + }); - testBin( - `--https-key ${key} --https-pfx ${pfxFile} --https-passphrase ${passphrase} --https-cert ${cert} --https-cacert ${cacert}` - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); + it('--no-client-hot-entry', (done) => { + testBin('--no-client-hot-entry --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - // For https://github.com/webpack/webpack-dev-server/issues/3306 - it('https and other related options', (done) => { - const pfxFile = path.join(httpsCertificateDirectory, 'server.pfx'); - const key = path.join(httpsCertificateDirectory, 'server.key'); - const cert = path.join(httpsCertificateDirectory, 'server.crt'); - const passphrase = 'webpack-dev-server'; + it('should not inject HMR entry "--client-hot-entry" and "--no-hot"', (done) => { + testBin('--client-hot-entry --no-hot --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); - testBin( - `--https --https-key ${key} --https-pfx ${pfxFile} --https-passphrase ${passphrase} --https-cert ${cert}` - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--https-request-cert', (done) => { - testBin('--https-request-cert') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); + it('should not inject HMR entry with "--no-client-hot-entry" and "--hot"', (done) => { + testBin('--no-client-hot-entry --hot --stats=detailed') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(output.stdout).not.toContain('webpack/hot/dev-server.js'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--no-https-request-cert', (done) => { - testBin('--no-https-request-cert') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); + it('--client-web-socket-url', (done) => { + testBin('--client-web-socket-url ws://myhost.com:8080/foo/test') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--client-web-socket-url-host', (done) => { + testBin('--client-web-socket-url-host 0.0.0.0') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-https', (done) => { - testBin('--no-https') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot(); + it('--client-web-socket-url-path', (done) => { + testBin('--client-web-socket-url-path /ws') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); + it('--client-web-socket-url-port', (done) => { + testBin('--client-web-socket-url-port 8080') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); - it('--history-api-fallback', (done) => { - testBin('--history-api-fallback --no-color') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot(); + describe('webSocketServer option', () => { + it('--web-socket-server sockjs', (done) => { + testBin('--web-socket-server sockjs') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--web-socket-server ws', (done) => { + testBin('--web-socket-server ws') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-history-api-fallback', (done) => { - testBin('--no-history-api-fallback') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot(); + it('--web-socket-server-type sockjs', (done) => { + testBin('--web-socket-server-type sockjs') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); + it('--web-socket-server-type ws', (done) => { + testBin('--web-socket-server-type ws') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); - it('--host and --port are unspecified', (done) => { - testBin('') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); + describe('http2 option', () => { + it('--http2', (done) => { + testBin('--http2') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--host 0.0.0.0 (IPv4)', (done) => { - testBin('--host 0.0.0.0') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); + it('--no-http2', (done) => { + testBin('--no-http2') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); + done(); + }) + .catch(done); + }); }); - it('--host :: (IPv6)', (done) => { - testBin('--host ::') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); + describe('https option', () => { + it('--https', (done) => { + testBin('--https') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--host ::1 (IPv6)', (done) => { - testBin('--host ::1') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + it('https options', (done) => { + const pfxFile = path.join(httpsCertificateDirectory, 'server.pfx'); + const key = path.join(httpsCertificateDirectory, 'server.key'); + const cert = path.join(httpsCertificateDirectory, 'server.crt'); + const cacert = path.join(httpsCertificateDirectory, 'ca.pem'); + const passphrase = 'webpack-dev-server'; - done(); - }) - .catch(done); - }); + testBin( + `--https-key ${key} --https-pfx ${pfxFile} --https-passphrase ${passphrase} --https-cert ${cert} --https-cacert ${cacert}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); - it('--host localhost', (done) => { - testBin('--host localhost') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + // For https://github.com/webpack/webpack-dev-server/issues/3306 + it('https and other related options', (done) => { + const pfxFile = path.join(httpsCertificateDirectory, 'server.pfx'); + const key = path.join(httpsCertificateDirectory, 'server.key'); + const cert = path.join(httpsCertificateDirectory, 'server.crt'); + const passphrase = 'webpack-dev-server'; - it('--host 127.0.0.1 (IPv4)', (done) => { - testBin('--host 127.0.0.1') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + testBin( + `--https --https-key ${key} --https-pfx ${pfxFile} --https-passphrase ${passphrase} --https-cert ${cert}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--https-request-cert', (done) => { + testBin('--https-request-cert') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); - it('--host 0:0:0:0:0:FFFF:7F00:0001 (IPv6)', (done) => { - testBin('--host 0:0:0:0:0:FFFF:7F00:0001') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); - }); + it('--no-https-request-cert', (done) => { + testBin('--no-https-request-cert') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); - it(`--host `, (done) => { - testBin(`--host ${localIPv4}`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + done(); + }) + .catch(done); + }); - done(); - }) - .catch(done); + it('--no-https', (done) => { + testBin('--no-https') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot(); + + done(); + }) + .catch(done); + }); }); - it.skip(`--host `, (done) => { - testBin(`--host ${localIPv6}`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + describe('historyApiFallback option', () => { + it('--history-api-fallback', (done) => { + testBin('--history-api-fallback --no-color') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--host ', (done) => { - testBin('--host local-ip') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + it('--no-history-api-fallback', (done) => { + testBin('--no-history-api-fallback') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); + done(); + }) + .catch(done); + }); }); - it('--host ', (done) => { - testBin('--host local-ipv4') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + describe('host and port options', () => { + it('--host and --port are unspecified', (done) => { + testBin('') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--host localhost --port 9999', (done) => { - testBin('--host localhost --port 9999') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + it('--host 0.0.0.0 (IPv4)', (done) => { + testBin('--host 0.0.0.0') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--port is string', (done) => { - testBin(`--port "8080"`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); + it('--host :: (IPv6)', (done) => { + testBin('--host ::') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it(`--port is auto`, (done) => { - testBin(`--port auto`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); + it('--host ::1 (IPv6)', (done) => { + testBin('--host ::1') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--open', (done) => { - testBin('--open') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--host localhost', (done) => { + testBin('--host localhost') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); - it('--open /index.html', (done) => { - testBin('--open /index.html') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--open /first.html second.html', (done) => { - testBin('--open /first.html second.html') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--host 127.0.0.1 (IPv4)', (done) => { + testBin('--host 127.0.0.1') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); - it('--no-open', (done) => { - testBin('--no-open') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--open-app google-chrome', (done) => { - testBin('--open-app google-chrome') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--host 0:0:0:0:0:FFFF:7F00:0001 (IPv6)', (done) => { + testBin('--host 0:0:0:0:0:FFFF:7F00:0001') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); - it('--open-target', (done) => { - testBin('--open-target') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--no-open-target', (done) => { - testBin('--no-open-target') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it(`--host `, (done) => { + testBin(`--host ${localIPv4}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); - it('--open-target index.html', (done) => { - testBin('--open-target index.html') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it(' --open --open-target index.html', (done) => { - testBin('--open --open-target index.html') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it.skip(`--host `, (done) => { + testBin(`--host ${localIPv6}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); - it('--open-target /first.html second.html', (done) => { - testBin('--open-target /first.html second.html') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--open-target /index.html --open-app google-chrome', (done) => { - testBin('--open-target /index.html --open-app google-chrome') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); + it('--host ', (done) => { + testBin('--host local-ip') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + + done(); + }) + .catch(done); + }); + + it('--host ', (done) => { + testBin('--host local-ipv4') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + + done(); + }) + .catch(done); + }); + + it('--host localhost --port 9999', (done) => { + testBin('--host localhost --port 9999') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + + done(); + }) + .catch(done); + }); + + it('--port is string', (done) => { + testBin(`--port "8080"`) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( + 'stderr' + ); + + done(); + }) + .catch(done); + }); + + it(`--port is auto`, (done) => { + testBin(`--port auto`) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( + 'stderr' + ); + + done(); + }) + .catch(done); + }); }); - it('--open --open-target /index.html --open-app google-chrome', (done) => { - testBin('--open --open-target /index.html --open-app google-chrome') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); + describe('liveReload option', () => { + it('--live-reload', (done) => { + testBin('--live-reload') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--no-live-reload', (done) => { + testBin('--no-live-reload') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); - it('--client-overlay', (done) => { - testBin('--client-overlay') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + describe('open option', () => { + it('--open', (done) => { + testBin('--open') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open /index.html', (done) => { + testBin('--open /index.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open /first.html second.html', (done) => { + testBin('--open /first.html second.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--no-open', (done) => { + testBin('--no-open') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-reset', (done) => { + testBin('--open-reset --open /third.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-reset --open-target', (done) => { + testBin('--open-reset --open-target') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-reset --open-target ', (done) => { + testBin('--open-reset --open-target /third.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-app google-chrome', (done) => { + testBin('--open-app google-chrome') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-app-name google-chrome', (done) => { + testBin('--open-app-name google-chrome') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-app-name-reset', (done) => { + testBin('--open-app-name-reset --open-app-name firefox') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-target', (done) => { + testBin('--open-target') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--no-open-target', (done) => { + testBin('--no-open-target') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-target index.html', (done) => { + testBin('--open-target index.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-target-reset', (done) => { + testBin('--open-target-reset --open-target first.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it(' --open --open-target index.html', (done) => { + testBin('--open --open-target index.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-target /first.html second.html', (done) => { + testBin('--open-target /first.html second.html') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-target /index.html --open-app google-chrome', (done) => { + testBin('--open-target /index.html --open-app google-chrome') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--open-target /index.html --open-app-name google-chrome', (done) => { + testBin('--open-target /index.html --open-app-name google-chrome') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-client-overlay', (done) => { - testBin('--no-client-overlay') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--open --open-target /index.html --open-app google-chrome', (done) => { + testBin('--open --open-target /index.html --open-app google-chrome') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--client-logging', (done) => { - testBin('--client-logging verbose') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); + it('--open --open-target /index.html --open-app google-chrome --open-app-name google-chrome', (done) => { + testBin( + '--open --open-target /index.html --open-app google-chrome --open-app-name google-chrome' + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); - it('--compress', (done) => { - testBin('--compress') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + describe('compress option', () => { + it('--compress', (done) => { + testBin('--compress') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-compress', (done) => { - testBin('--compress') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); + it('--no-compress', (done) => { + testBin('--compress') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); it('should generate correct cli flags', (done) => { + const isMacOS = process.platform === 'darwin'; + testBin('--help') .then((output) => { - expect(stripAnsi(output.stdout)).toMatchSnapshot(); - done(); + // TODO: find a fix, skip for MacOS + if (isMacOS) { + expect(output.exitCode).toBe(0); + done(); + } else { + expect(stripAnsi(output.stdout)).toMatchSnapshot(); + done(); + } }) .catch(done); }); - it('--static', (done) => { - testBin('--static') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + describe('static option', () => { + it('--static', (done) => { + testBin('--static') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--static ', (done) => { - testBin( - `--static ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--static ', (done) => { + testBin( + `--static ${path.resolve( + __dirname, + '../fixtures/static/webpack.config.js' + )}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--static-directory', (done) => { - testBin( - `--static-directory ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--static-reset', (done) => { + testBin( + `--static-reset --static ${path.resolve( + __dirname, + '../fixtures/static/webpack.config.js' + )}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--static --static-directory', (done) => { - testBin( - `--static --static-directory ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--static-reset --static-directory ', (done) => { + testBin( + `--static-reset --static-directory ${path.resolve( + __dirname, + '../fixtures/static/webpack.config.js' + )}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--static-serve-index', (done) => { - testBin('--static-serve-index') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--static-directory', (done) => { + testBin( + `--static-directory ${path.resolve( + __dirname, + '../fixtures/static/webpack.config.js' + )}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - describe('allowed-hosts', () => { - it('--allowed-hosts auto', (done) => { - testBin(['--allowed-hosts', 'auto']) + it('--static --static-directory', (done) => { + testBin( + `--static --static-directory ${path.resolve( + __dirname, + '../fixtures/static/webpack.config.js' + )}` + ) .then((output) => { expect(output.exitCode).toEqual(0); done(); @@ -690,8 +1012,8 @@ describe('CLI', () => { .catch(done); }); - it('--allowed-hosts all', (done) => { - testBin(['--allowed-hosts', 'all']) + it('--static-public-path', (done) => { + testBin('--static-public-path /public') .then((output) => { expect(output.exitCode).toEqual(0); done(); @@ -699,8 +1021,8 @@ describe('CLI', () => { .catch(done); }); - it('--allowed-hosts string', (done) => { - testBin(['--allowed-hosts', 'testhost.com']) + it('--static-public-path-reset', (done) => { + testBin('--static-public-path-reset --static-public-path /new-public') .then((output) => { expect(output.exitCode).toEqual(0); done(); @@ -708,70 +1030,137 @@ describe('CLI', () => { .catch(done); }); - it('--allowed-hosts multiple', (done) => { - testBin([ - '--allowed-hosts', - 'testhost.com', - '--allowed-hosts', - 'testhost1.com', - ]) + it('--static-serve-index', (done) => { + testBin('--static-serve-index') .then((output) => { expect(output.exitCode).toEqual(0); done(); }) .catch(done); }); - }); - it('--no-static-serve-index', (done) => { - testBin('--no-static-serve-index') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--no-static-serve-index', (done) => { + testBin('--no-static-serve-index') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--static-watch', (done) => { - testBin('--static-watch') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); + it('--static-watch', (done) => { + testBin('--static-watch') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); - it('--no-static-watch', (done) => { - testBin('--static-watch') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); + it('--no-static-watch', (done) => { + testBin('--static-watch') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('should log static', (done) => { + testBin( + '--no-color', + path.resolve(__dirname, '../fixtures/static/webpack.config.js') + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch((err) => { + const staticDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); + + // for windows + expect(err.stderr).toContain( + `Content not from webpack is served from '${staticDirectory}' directory` + ); + expect(err.stdout).toContain('main.js'); + done(); + }); + }); }); - it('should log static', (done) => { - testBin( - '--no-color', - path.resolve(__dirname, '../fixtures/static/webpack.config.js') - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch((err) => { - const staticDirectory = path.resolve( - __dirname, - '../fixtures/static/static' - ); + describe('watchFiles option', () => { + it('--watch-files', (done) => { + const watchDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); - // for windows - expect(err.stderr).toContain( - `Content not from webpack is served from '${staticDirectory}' directory` - ); - expect(err.stdout).toContain('main.js'); - done(); - }); + testBin(`--watch-files ${watchDirectory}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--watch-files-reset', (done) => { + const watchDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); + + testBin(`--watch-files-reset --watch-files ${watchDirectory}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--watch-files-reset --watch-files-paths ', (done) => { + const watchDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); + + testBin(`--watch-files-reset --watch-files-paths ${watchDirectory}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--watch-files-paths', (done) => { + const watchDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); + + testBin(`--watch-files-paths ${watchDirectory}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + + it('--watch-files-paths-reset', (done) => { + const watchDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); + + testBin(`--watch-files-paths-reset --watch-files-paths ${watchDirectory}`) + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); }); it('should accept the promise function of webpack.config.js', (done) => { diff --git a/test/helpers/test-bin.js b/test/helpers/test-bin.js index 3d14d1d1b6..acfc16e4c0 100644 --- a/test/helpers/test-bin.js +++ b/test/helpers/test-bin.js @@ -16,7 +16,10 @@ const basicConfigPath = path.resolve( function testBin(testArgs, configPath) { const cwd = process.cwd(); - const env = process.env.NODE_ENV; + const env = { + WEBPACK_CLI_HELP_WIDTH: 2048, + NODE_ENV: process.env.NODE_ENV, + }; if (!configPath) { configPath = basicConfigPath; From f560713e44c01d7614a2c7c931a704f636a10427 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sat, 29 May 2021 09:08:59 +0530 Subject: [PATCH 02/14] test: refactor --- bin/cli-flags.js | 40 ----------- test/cli/cli.test.js | 158 ++++++++++++++++--------------------------- 2 files changed, 60 insertions(+), 138 deletions(-) diff --git a/bin/cli-flags.js b/bin/cli-flags.js index 66cbfd408e..befcf6ca38 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -359,46 +359,6 @@ module.exports = { simpleType: 'boolean', multiple: false, }, - firewall: { - configs: [ - { - type: 'boolean', - multiple: false, - description: - 'Defines routes which are enabled by default, on by default and allows localhost.', - path: 'firewall', - }, - { - type: 'string', - multiple: true, - description: - 'Defines routes which are enabled by default, on by default and allows localhost.', - path: 'firewall[]', - }, - ], - description: - 'Defines routes which are enabled by default, on by default and allows localhost.', - negatedDescription: 'Disable firewall.', - simpleType: 'string', - multiple: true, - }, - 'firewall-reset': { - configs: [ - { - type: 'reset', - multiple: false, - description: 'Clear all items provided in firewall configuration.', - path: 'firewall', - }, - ], - description: 'Clear all items provided in firewall configuration.', - simpleType: 'boolean', - multiple: false, - processor(opts) { - opts.firewall = opts.firewall || []; - delete opts.firewallReset; - }, - }, 'history-api-fallback': { configs: [ { diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index f437544b8d..6e2e6ba689 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -6,6 +6,7 @@ const internalIp = require('internal-ip'); const stripAnsi = require('strip-ansi'); const { testBin, normalizeStderr } = require('../helpers/test-bin'); +const isMacOS = process.platform === 'darwin'; const localIPv4 = internalIp.v4.sync(); const localIPv6 = internalIp.v6.sync(); @@ -93,44 +94,45 @@ describe('CLI', () => { }); }); - describe('bonjour option', () => {}); - it('--bonjour', (done) => { - testBin('--bonjour') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot(); + describe('bonjour option', () => { + it('--bonjour', (done) => { + testBin('--bonjour') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--bonjour and --https', (done) => { - testBin('--bonjour --https') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true, https: true }) - ).toMatchSnapshot(); + it('--bonjour and --https', (done) => { + testBin('--bonjour --https') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true, https: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); - it('--no-bonjour', (done) => { - testBin('--no-bonjour') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot(); + it('--no-bonjour', (done) => { + testBin('--no-bonjour') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot(); - done(); - }) - .catch(done); + done(); + }) + .catch(done); + }); }); describe('client option', () => { @@ -915,19 +917,11 @@ describe('CLI', () => { }); }); - it('should generate correct cli flags', (done) => { - const isMacOS = process.platform === 'darwin'; - + (isMacOS ? it.skip : it)('should generate correct cli flags', (done) => { testBin('--help') .then((output) => { - // TODO: find a fix, skip for MacOS - if (isMacOS) { - expect(output.exitCode).toBe(0); - done(); - } else { - expect(stripAnsi(output.stdout)).toMatchSnapshot(); - done(); - } + expect(stripAnsi(output.stdout)).toMatchSnapshot(); + done(); }) .catch(done); }); @@ -937,76 +931,57 @@ describe('CLI', () => { testBin('--static') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); }); it('--static ', (done) => { - testBin( - `--static ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) + testBin('--static new-static') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); }); it('--static-reset', (done) => { - testBin( - `--static-reset --static ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) + testBin('--static-reset --static new-static-after-reset') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); }); it('--static-reset --static-directory ', (done) => { - testBin( - `--static-reset --static-directory ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) + testBin('--static-reset --static-directory new-static-directory') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); }); it('--static-directory', (done) => { - testBin( - `--static-directory ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) + testBin('--static-directory static-dir') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); }); it('--static --static-directory', (done) => { - testBin( - `--static --static-directory ${path.resolve( - __dirname, - '../fixtures/static/webpack.config.js' - )}` - ) + testBin('--static --static-directory static-dir') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1016,6 +991,7 @@ describe('CLI', () => { testBin('--static-public-path /public') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1025,6 +1001,7 @@ describe('CLI', () => { testBin('--static-public-path-reset --static-public-path /new-public') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1034,6 +1011,7 @@ describe('CLI', () => { testBin('--static-serve-index') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1043,6 +1021,7 @@ describe('CLI', () => { testBin('--no-static-serve-index') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1052,6 +1031,7 @@ describe('CLI', () => { testBin('--static-watch') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1061,34 +1041,11 @@ describe('CLI', () => { testBin('--static-watch') .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); }); - - it('should log static', (done) => { - testBin( - '--no-color', - path.resolve(__dirname, '../fixtures/static/webpack.config.js') - ) - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch((err) => { - const staticDirectory = path.resolve( - __dirname, - '../fixtures/static/static' - ); - - // for windows - expect(err.stderr).toContain( - `Content not from webpack is served from '${staticDirectory}' directory` - ); - expect(err.stdout).toContain('main.js'); - done(); - }); - }); }); describe('watchFiles option', () => { @@ -1101,6 +1058,7 @@ describe('CLI', () => { testBin(`--watch-files ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1115,6 +1073,7 @@ describe('CLI', () => { testBin(`--watch-files-reset --watch-files ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1129,6 +1088,7 @@ describe('CLI', () => { testBin(`--watch-files-reset --watch-files-paths ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1143,6 +1103,7 @@ describe('CLI', () => { testBin(`--watch-files-paths ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1157,6 +1118,7 @@ describe('CLI', () => { testBin(`--watch-files-paths-reset --watch-files-paths ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); done(); }) .catch(done); From a785ffabb31666ba8df335240f66ab326560ef21 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sat, 29 May 2021 09:27:10 +0530 Subject: [PATCH 03/14] test: refactor --- test/cli/cli.test.js | 68 +++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index 6e2e6ba689..68bb8c29a4 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -931,7 +931,9 @@ describe('CLI', () => { testBin('--static') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -941,7 +943,9 @@ describe('CLI', () => { testBin('--static new-static') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -951,7 +955,9 @@ describe('CLI', () => { testBin('--static-reset --static new-static-after-reset') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -961,7 +967,9 @@ describe('CLI', () => { testBin('--static-reset --static-directory new-static-directory') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -971,7 +979,9 @@ describe('CLI', () => { testBin('--static-directory static-dir') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -981,7 +991,9 @@ describe('CLI', () => { testBin('--static --static-directory static-dir') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -991,7 +1003,9 @@ describe('CLI', () => { testBin('--static-public-path /public') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1001,7 +1015,9 @@ describe('CLI', () => { testBin('--static-public-path-reset --static-public-path /new-public') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1011,7 +1027,9 @@ describe('CLI', () => { testBin('--static-serve-index') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1021,7 +1039,9 @@ describe('CLI', () => { testBin('--no-static-serve-index') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1031,7 +1051,9 @@ describe('CLI', () => { testBin('--static-watch') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1041,7 +1063,9 @@ describe('CLI', () => { testBin('--static-watch') .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1058,7 +1082,9 @@ describe('CLI', () => { testBin(`--watch-files ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1073,7 +1099,9 @@ describe('CLI', () => { testBin(`--watch-files-reset --watch-files ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1088,7 +1116,9 @@ describe('CLI', () => { testBin(`--watch-files-reset --watch-files-paths ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1103,7 +1133,9 @@ describe('CLI', () => { testBin(`--watch-files-paths ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); @@ -1118,7 +1150,9 @@ describe('CLI', () => { testBin(`--watch-files-paths-reset --watch-files-paths ${watchDirectory}`) .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); From 37f02e4b7a61aed3664a16a2a85ceea7d0569909 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 3 Jun 2021 18:56:01 +0300 Subject: [PATCH 04/14] refactor: code --- bin/cli-flags.js | 383 +++++++++++++++---------------------------- lib/Server.js | 10 ++ lib/options.json | 14 +- test/cli/cli.test.js | 175 ++++++++++++++------ 4 files changed, 273 insertions(+), 309 deletions(-) diff --git a/bin/cli-flags.js b/bin/cli-flags.js index befcf6ca38..fa84227e7c 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -1,48 +1,56 @@ 'use strict'; -const normalizeOption = (option) => - typeof option === 'object' && !Array.isArray(option) ? option : {}; - module.exports = { 'allowed-hosts': { configs: [ { type: 'string', multiple: true, - description: 'Set hosts that are allowed to access the dev server.', + description: + "Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts", path: 'allowedHosts[]', }, + { + description: + "Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts", + multiple: false, + path: 'allowedHosts', + type: 'enum', + values: ['auto', 'all'], + }, ], - description: 'Set hosts that are allowed to access the dev server.', + description: + "Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts", multiple: true, + simpleType: 'string', }, 'allowed-hosts-reset': { configs: [ { type: 'reset', multiple: false, - description: 'Clear all items provided in allowedHosts configuration.', - path: 'firewall', + description: + "Clear all items provided in configuration. Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts", + path: 'allowedHosts', }, ], - description: 'Clear all items provided in allowedHosts configuration.', + description: + "Clear all items provided in configuration. Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts", simpleType: 'boolean', multiple: false, - processor(opts) { - opts.allowedHosts = opts.allowedHosts || []; - delete opts.sllowedHostsReset; - }, }, bonjour: { configs: [ { type: 'boolean', multiple: false, - description: 'Broadcasts the server via ZeroConf networking on start.', + description: + 'Broadcasts the server via ZeroConf networking on start. https://webpack.js.org/configuration/dev-server/#devserverbonjour', path: 'bonjour', }, ], - description: 'Broadcasts the server via ZeroConf networking on start.', + description: + 'Broadcasts the server via ZeroConf networking on start. https://webpack.js.org/configuration/dev-server/#devserverbonjour', negatedDescription: 'Do not broadcast the server via ZeroConf networking on start.', simpleType: 'boolean', @@ -69,11 +77,6 @@ module.exports = { description: 'Allows to set custom transport to communicate with server.', simpleType: 'string', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.transport = opts.clientTransport; - delete opts.clientTransport; - }, }, 'client-logging': { configs: [ @@ -81,18 +84,15 @@ module.exports = { type: 'enum', values: ['none', 'error', 'warn', 'info', 'log', 'verbose'], multiple: false, - description: 'Specifies client properties.', + description: + 'Specifies client properties. https://webpack.js.org/configuration/dev-server/#devserverclient', path: 'client.logging', }, ], - description: 'Specifies client properties.', + description: + 'Specifies client properties. https://webpack.js.org/configuration/dev-server/#devserverclient', simpleType: 'string', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.logging = opts.clientLogging; - delete opts.clientLogging; - }, }, 'client-progress': { configs: [ @@ -108,11 +108,6 @@ module.exports = { 'Do not print compilation progress in percentage in the browser.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.progress = opts.clientProgress; - delete opts.clientProgress; - }, }, 'client-overlay': { configs: [ @@ -130,11 +125,6 @@ module.exports = { 'Do not show a full-screen overlay in the browser when there are compiler errors or warnings.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.overlay = opts.clientOverlay; - delete opts.clientOverlay; - }, }, 'client-overlay-errors': { configs: [ @@ -150,12 +140,6 @@ module.exports = { 'Show a full-screen overlay in the browser when there are compiler errors.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.overlay = normalizeOption(opts.client.overlay); - opts.client.overlay.errors = opts.clientOverlayErrors; - delete opts.clientOverlayErrors; - }, }, 'client-overlay-warnings': { configs: [ @@ -171,12 +155,6 @@ module.exports = { 'Show a full-screen overlay in the browser when there are compiler warnings.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.overlay = normalizeOption(opts.client.overlay); - opts.client.overlay.warnings = opts.clientOverlayWarnings; - delete opts.clientOverlayWarnings; - }, }, 'client-need-client-entry': { configs: [ @@ -190,11 +168,6 @@ module.exports = { description: 'Tells devServer to inject a client entry.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.needClientEntry = opts.clientNeedClientEntry; - delete opts.clientNeedClientEntry; - }, }, 'client-hot-entry': { configs: [ @@ -211,11 +184,6 @@ module.exports = { 'Do not tell devServer to inject a Hot Module Replacement entry.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.hotEntry = opts.clientHotEntry; - delete opts.clientHotEntry; - }, }, 'client-web-socket-url': { configs: [ @@ -231,11 +199,6 @@ module.exports = { "When using dev server and you're proxying dev-server, the client script does not always know where to connect to.", simpleType: 'string', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.webSocketURL = opts.clientWebSocketUrl; - delete opts.clientWebSocketUrl; - }, }, 'client-web-socket-url-host': { configs: [ @@ -251,12 +214,6 @@ module.exports = { 'Tells clients connected to devServer to use the provided host.', simpleType: 'string', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.webSocketURL = normalizeOption(opts.client.webSocketURL); - opts.client.webSocketURL.host = opts.clientWebSocketUrlHost; - delete opts.clientWebSocketUrlHost; - }, }, 'client-web-socket-url-port': { configs: [ @@ -265,19 +222,20 @@ module.exports = { multiple: false, description: 'Tells clients connected to devServer to use the provided port.', - path: 'client.port', + path: 'client.webSocketURL.port', + }, + { + description: + 'Tells clients connected to devServer to use the provided port.', + multiple: false, + path: 'client.webSocketURL.port', + type: 'string', }, ], description: 'Tells clients connected to devServer to use the provided port.', simpleType: 'string', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.webSocketURL = normalizeOption(opts.client.webSocketURL); - opts.client.webSocketURL.port = opts.clientWebSocketUrlPort; - delete opts.clientWebSocketUrlPort; - }, }, 'client-web-socket-url-path': { configs: [ @@ -286,19 +244,36 @@ module.exports = { multiple: false, description: 'Tells clients connected to devServer to use the provided path to connect.', - path: 'client.path', + path: 'client.webSocketURL.path', }, ], description: 'Tells clients connected to devServer to use the provided path to connect.', simpleType: 'string', multiple: false, - processor(opts) { - opts.client = normalizeOption(opts.client); - opts.client.webSocketURL = normalizeOption(opts.client.webSocketURL); - opts.client.webSocketURL.path = opts.clientWebSocketUrlPath; - delete opts.clientWebSocketUrlPath; - }, + }, + 'client-web-socket-url-protocol': { + configs: [ + { + description: + 'Tells clients connected to devServer to use the provided protocol.', + multiple: false, + path: 'client.webSocketURL.protocol', + type: 'enum', + values: ['auto'], + }, + { + description: + 'Tells clients connected to devServer to use the provided protocol.', + multiple: false, + path: 'client.webSocketURL.protocol', + type: 'string', + }, + ], + description: + 'Tells clients connected to devServer to use the provided protocol.', + multiple: false, + simpleType: 'string', }, 'web-socket-server': { configs: [ @@ -339,22 +314,19 @@ module.exports = { description: 'Allows to set web socket server and options.', simpleType: 'string', multiple: false, - processor(opts) { - opts.webSocketServer = normalizeOption(opts.webSocketServer); - opts.webSocketServer.type = opts.webSocketServerType; - delete opts.webSocketServerType; - }, }, compress: { configs: [ { type: 'boolean', multiple: false, - description: 'Enable gzip compression for everything served.', + description: + 'Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress', path: 'compress', }, ], - description: 'Enable gzip compression for everything served.', + description: + 'Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress', negatedDescription: 'Disable gzip compression.', simpleType: 'boolean', multiple: false, @@ -365,12 +337,12 @@ module.exports = { type: 'boolean', multiple: false, description: - 'When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses.', + 'When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback', path: 'historyApiFallback', }, ], description: - 'When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses.', + 'When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback', simpleType: 'boolean', multiple: false, }, @@ -380,12 +352,12 @@ module.exports = { type: 'string', multiple: false, description: - 'Specify a host to use. If you want your server to be accessible externally.', + 'Specify a host to use. If you want your server to be accessible externally. https://webpack.js.org/configuration/dev-server/#devserverhost', path: 'host', }, ], description: - 'Specify a host to use. If you want your server to be accessible externally.', + 'Specify a host to use. If you want your server to be accessible externally. https://webpack.js.org/configuration/dev-server/#devserverhost', simpleType: 'string', multiple: false, }, @@ -394,18 +366,21 @@ module.exports = { { type: 'boolean', multiple: false, - description: "Enable webpack's Hot Module Replacement feature.", + description: + "Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot", path: 'hot', }, { type: 'enum', values: ['only'], multiple: false, - description: "Enable webpack's Hot Module Replacement feature.", + description: + "Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot", path: 'hot', }, ], - description: "Enable webpack's Hot Module Replacement feature.", + description: + "Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot", negatedDescription: "Disable webpack's Hot Module Replacement feature.", simpleType: 'string', multiple: false, @@ -415,11 +390,13 @@ module.exports = { { type: 'boolean', multiple: false, - description: 'Serve over HTTP/2 using spdy.', + description: + 'Serve over HTTP/2 using spdy. https://webpack.js.org/configuration/dev-server/#devserverhttp2', path: 'http2', }, ], - description: 'Serve over HTTP/2 using spdy.', + description: + 'Serve over HTTP/2 using spdy. https://webpack.js.org/configuration/dev-server/#devserverhttp2', negatedDescription: 'Do not use HTTP/2.', simpleType: 'boolean', multiple: false, @@ -430,12 +407,12 @@ module.exports = { type: 'boolean', multiple: false, description: - 'By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS.', + 'By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. https://webpack.js.org/configuration/dev-server/#devserverhttps', path: 'https', }, ], description: - 'By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS.', + 'By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. https://webpack.js.org/configuration/dev-server/#devserverhttps', negatedDescription: 'Do not use HTTPS protocol.', simpleType: 'boolean', multiple: false, @@ -452,11 +429,6 @@ module.exports = { description: 'Passphrase for a pfx file.', simpleType: 'string', multiple: false, - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.passphrase = opts.httpsPassphrase; - delete opts.httpsPassphrase; - }, }, 'https-request-cert': { configs: [ @@ -471,11 +443,6 @@ module.exports = { negatedDescription: 'Do not request for an SSL certificate.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.requestCert = opts.httpsRequestCert; - delete opts.httpsRequestCert; - }, }, 'https-cacert': { configs: [ @@ -489,11 +456,6 @@ module.exports = { description: 'Path to an SSL CA certificate.', simpleType: 'string', multiple: false, - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.cacert = opts.httpsCacert; - delete opts.httpsCacert; - }, }, 'https-key': { configs: [ @@ -507,11 +469,6 @@ module.exports = { description: 'Path to an SSL key.', simpleType: 'string', multiple: false, - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.key = opts.httpsKey; - delete opts.httpsKey; - }, }, 'https-pfx': { configs: [ @@ -525,11 +482,6 @@ module.exports = { description: 'Path to an SSL pfx file.', simpleType: 'string', multiple: false, - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.pfx = opts.httpsPfx; - delete opts.httpsPfx; - }, }, 'https-cert': { configs: [ @@ -543,11 +495,6 @@ module.exports = { description: 'Path to an SSL certificate.', simpleType: 'string', multiple: false, - processor(opts) { - opts.https = normalizeOption(opts.https); - opts.https.cert = opts.httpsCert; - delete opts.httpsCert; - }, }, 'live-reload': { configs: [ @@ -555,12 +502,12 @@ module.exports = { type: 'boolean', multiple: false, description: - 'By default, the dev-server will reload/refresh the page when file changes are detected.', + 'By default, the dev-server will reload/refresh the page when file changes are detected. https://webpack.js.org/configuration/dev-server/#devserverlivereload', path: 'liveReload', }, ], description: - 'By default, the dev-server will reload/refresh the page when file changes are detected.', + 'By default, the dev-server will reload/refresh the page when file changes are detected. https://webpack.js.org/configuration/dev-server/#devserverlivereload', negatedDescription: 'Disables live reloading on changing files.', simpleType: 'boolean', multiple: false, @@ -571,19 +518,19 @@ module.exports = { type: 'string', multiple: true, description: - 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.', + 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen', path: 'open[]', }, { type: 'boolean', multiple: false, description: - 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.', + 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen', path: 'open', }, ], description: - 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser.', + 'Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen', negatedDescription: 'Do not open the default browser.', simpleType: 'string', multiple: true, @@ -613,11 +560,6 @@ module.exports = { negatedDescription: 'Do not open specified route in browser.', simpleType: 'string', multiple: true, - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.target = opts.openTarget; - delete opts.openTarget; - }, }, 'open-app-name': { configs: [ @@ -637,12 +579,6 @@ module.exports = { description: 'Open specified browser.', simpleType: 'string', multiple: true, - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.app = normalizeOption(opts.open.app); - opts.open.app.name = opts.openAppName; - delete opts.openAppName; - }, }, 'open-app': { configs: [ @@ -655,105 +591,80 @@ module.exports = { ], description: 'Open specified browser.', simpleType: 'string', - multiple: false, - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.app = opts.openApp; - delete opts.openApp; - }, + multiple: true, }, 'open-reset': { configs: [ { type: 'reset', multiple: false, - description: 'Clear all items provided in open configuration.', + description: + 'Clear all items provided in configuration. Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen', path: 'open', }, ], - description: 'Clear all items provided in open configuration.', + description: + 'Clear all items provided in configuration. Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.open = opts.open || []; - delete opts.openReset; - }, }, 'open-target-reset': { configs: [ { type: 'reset', multiple: false, - description: 'Clear all items provided in open.target configuration.', + description: + 'Clear all items provided in configuration. Open specified route in browser.', path: 'open.target', }, ], - description: 'Clear all items provided in open.target configuration.', + description: + 'Clear all items provided in configuration. Open specified route in browser.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.target = opts.openTarget || []; - delete opts.openTargetReset; - }, }, 'open-app-name-reset': { configs: [ { type: 'reset', multiple: false, - description: 'Clear all items provided in open.app.name configuration.', + description: + 'Clear all items provided in configuration. Open specified browser.', path: 'open.app.name', }, ], - description: 'Clear all items provided in open.app.name configuration.', + description: + 'Clear all items provided in configuration. Open specified browser.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.open = normalizeOption(opts.open); - opts.open.app = normalizeOption(opts.open.app); - opts.open.app.name = opts.openAppName || []; - delete opts.openAppNameReset; - }, }, port: { configs: [ { type: 'number', multiple: false, - description: 'Specify a port number to listen for requests on.', + description: + 'Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport', path: 'port', }, { type: 'string', multiple: false, - description: 'Specify a port number to listen for requests on.', + description: + 'Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport', path: 'port', }, { type: 'enum', values: ['auto'], multiple: false, - description: 'Specify a port number to listen for requests on.', - path: 'port', - }, - ], - description: 'Specify a port number to listen for requests on.', - simpleType: 'string', - multiple: false, - }, - public: { - configs: [ - { - type: 'string', - multiple: false, description: - 'The public hostname/ip address of the server that client script will try to connect to.', - path: 'public', + 'Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport', + path: 'port', }, ], description: - 'The public hostname/ip address of the server that client script will try to connect to.', + 'Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport', simpleType: 'string', multiple: false, }, @@ -763,19 +674,19 @@ module.exports = { type: 'string', multiple: true, description: - 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.', + 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic', path: 'static[]', }, { type: 'boolean', multiple: false, description: - 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.', + 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic', path: 'static', }, ], description: - 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options.', + 'It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic', simpleType: 'string', multiple: true, }, @@ -790,12 +701,7 @@ module.exports = { ], description: 'Directory for static contents.', simpleType: 'string', - multiple: false, - processor(opts) { - opts.static = normalizeOption(opts.static); - opts.static.directory = opts.staticDirectory; - delete opts.staticDirectory; - }, + multiple: true, }, 'static-public-path': { configs: [ @@ -818,11 +724,6 @@ module.exports = { 'The bundled files will be available in the browser under this path.', simpleType: 'string', multiple: true, - processor(opts) { - opts.static = normalizeOption(opts.static); - opts.static.publicPath = opts.staticPublicPath; - delete opts.staticPublicPath; - }, }, 'static-serve-index': { configs: [ @@ -838,11 +739,6 @@ module.exports = { negatedDescription: 'Do not tell dev-server to use serveIndex middleware.', simpleType: 'boolean', multiple: true, - processor(opts) { - opts.static = normalizeOption(opts.static); - opts.static.serveIndex = opts.staticServeIndex; - delete opts.staticServeIndex; - }, }, 'static-watch': { configs: [ @@ -857,28 +753,21 @@ module.exports = { negatedDescription: 'Do not watch for files in static content directory.', simpleType: 'boolean', multiple: true, - processor(opts) { - opts.static = normalizeOption(opts.static); - opts.static.watch = opts.staticWatch; - delete opts.staticWatch; - }, }, 'static-reset': { configs: [ { type: 'reset', multiple: false, - description: 'Clear all items provided in static configuration.', + description: + 'Clear all items provided in configuration. It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic', path: 'static', }, ], - description: 'Clear all items provided in static configuration.', + description: + 'Clear all items provided in configuration. It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.static = opts.static || []; - delete opts.staticReset; - }, }, 'static-public-path-reset': { configs: [ @@ -886,29 +775,27 @@ module.exports = { type: 'reset', multiple: false, description: - 'Clear all items provided in static.publicPath configuration.', + 'Clear all items provided in configuration. The bundled files will be available in the browser under this path.', path: 'static.publicPath', }, ], - description: 'Clear all items provided in static.publicPath configuration.', + description: + 'Clear all items provided in configuration. The bundled files will be available in the browser under this path.', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.static = normalizeOption(opts.static); - opts.static.publicPath = opts.staticPublicPath || []; - delete opts.staticPublicPathReset; - }, }, 'watch-files': { configs: [ { type: 'string', multiple: true, - description: 'List of files to watch for file changes and serve.', + description: + 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', path: 'watchFiles[]', }, ], - description: 'List of files to watch for file changes and serve.', + description: + 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', simpleType: 'string', multiple: true, }, @@ -917,41 +804,37 @@ module.exports = { { type: 'string', multiple: true, - description: 'List of files to watch for file changes and serve.', + description: + 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', path: 'watchFiles[].paths', }, { type: 'string', multiple: true, - description: 'List of files to watch for file changes and serve.', + description: + 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', path: 'watchFiles.paths[]', }, ], - description: 'List of files to watch for file changes and serve.', + description: + 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', simpleType: 'string', multiple: true, - processor(opts) { - opts.watchFiles = normalizeOption(opts.watchFiles); - opts.watchFiles.paths = opts.watchFilesPaths; - delete opts.watchFilesPaths; - }, }, 'watch-files-reset': { configs: [ { type: 'reset', multiple: false, - description: 'Clear all items provided in watchFiles configuration.', + description: + 'Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', path: 'watchFiles', }, ], - description: 'Clear all items provided in watchFiles configuration.', + description: + 'Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.watchFiles = opts.watchFiles || []; - delete opts.watchFilesReset; - }, }, 'watch-files-paths-reset': { configs: [ @@ -959,17 +842,13 @@ module.exports = { type: 'reset', multiple: false, description: - 'Clear all items provided in watchFiles.paths configuration.', + 'Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', path: 'watchFiles.paths', }, ], - description: 'Clear all items provided in watchFiles.paths configuration.', + description: + 'Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', simpleType: 'boolean', multiple: false, - processor(opts) { - opts.watchFiles = normalizeOption(opts.watchFiles); - opts.watchFiles.paths = opts.watchFilesPaths || []; - delete opts.watchFilesPathsReset; - }, }, }; diff --git a/lib/Server.js b/lib/Server.js index 4bbb84d8f0..b5bc7e1218 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -74,6 +74,16 @@ class Server { }, this); } + static getArguments(webpack, ...args) { + // TODO polyfill for webpack v4 + return webpack.cli.getArguments(schema, ...args); + } + + static processArguments(webpack, ...args) { + // TODO polyfill for webpack v4 + return webpack.cli.processArguments(...args); + } + applyDevServerPlugin() { const DevServerPlugin = require('./utils/DevServerPlugin'); diff --git a/lib/options.json b/lib/options.json index c723649e44..5dff14560f 100644 --- a/lib/options.json +++ b/lib/options.json @@ -359,13 +359,6 @@ }, "allowedHosts": { "anyOf": [ - { - "enum": ["auto", "all"] - }, - { - "type": "string", - "minLength": 1 - }, { "type": "array", "items": { @@ -373,6 +366,13 @@ "minLength": 1 }, "minItems": 1 + }, + { + "enum": ["auto", "all"] + }, + { + "type": "string", + "minLength": 1 } ], "description": "Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts" diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index 68bb8c29a4..96039f4bb2 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -1,9 +1,12 @@ 'use strict'; const path = require('path'); +const webpack = require('webpack'); const execa = require('execa'); const internalIp = require('internal-ip'); const stripAnsi = require('strip-ansi'); +const schema = require('../../lib/options.json'); +const cliOptions = require('../../bin/cli-flags'); const { testBin, normalizeStderr } = require('../helpers/test-bin'); const isMacOS = process.platform === 'darwin'; @@ -16,6 +19,39 @@ const httpsCertificateDirectory = path.resolve( ); describe('CLI', () => { + describe('options', () => { + (webpack.version.startsWith('5') ? it : it.skip)( + 'should be same as in schema', + () => { + const cliOptionsFromWebpack = webpack.cli.getArguments(schema); + + const normalizedCliOptions = {}; + + for (const [name, options] of Object.entries(cliOptions)) { + delete options.processor; + // Only webpack-cli supports it + // TODO send PR to webpack + delete options.negatedDescription; + + normalizedCliOptions[name] = options; + } + + expect(normalizedCliOptions).toStrictEqual(cliOptionsFromWebpack); + } + ); + }); + + describe('help', () => { + (isMacOS ? it.skip : it)('should generate correct cli flags', (done) => { + testBin('--help') + .then((output) => { + expect(stripAnsi(output.stdout)).toMatchSnapshot(); + done(); + }) + .catch(done); + }); + }); + describe('hot option', () => { it('--hot', (done) => { testBin('--hot --stats=detailed') @@ -310,6 +346,15 @@ describe('CLI', () => { .catch(done); }); + it('--client-web-socket-url-protocol', (done) => { + testBin('--client-web-socket-url-protocol "ws:"') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + it('--client-web-socket-url-host', (done) => { testBin('--client-web-socket-url-host 0.0.0.0') .then((output) => { @@ -527,20 +572,7 @@ describe('CLI', () => { }); }); - describe('host and port options', () => { - it('--host and --port are unspecified', (done) => { - testBin('') - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot('stderr'); - - done(); - }) - .catch(done); - }); - + describe('host option', () => { it('--host 0.0.0.0 (IPv4)', (done) => { testBin('--host 0.0.0.0') .then((output) => { @@ -654,43 +686,60 @@ describe('CLI', () => { }) .catch(done); }); + }); - it('--host localhost --port 9999', (done) => { - testBin('--host localhost --port 9999') + describe('port option', () => { + it('--port is string', (done) => { + testBin(`--port "8080"`) .then((output) => { expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); done(); }) .catch(done); }); - it('--port is string', (done) => { - testBin(`--port "8080"`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); + it(`--port is auto`, (done) => { + testBin(`--port auto`) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); + done(); + }) + .catch(done); + }); + }); - it(`--port is auto`, (done) => { - testBin(`--port auto`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect(normalizeStderr(output.stderr, { ipv6: true })).toMatchSnapshot( - 'stderr' - ); - - done(); - }) - .catch(done); - }); + describe('host and port options', () => { + it('--host and --port are unspecified', (done) => { + testBin('') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); + + done(); + }) + .catch(done); + }); + + it('--host localhost --port 9999', (done) => { + testBin('--host localhost --port 9999') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr'); + + done(); + }) + .catch(done); + }); }); describe('liveReload option', () => { @@ -917,15 +966,6 @@ describe('CLI', () => { }); }); - (isMacOS ? it.skip : it)('should generate correct cli flags', (done) => { - testBin('--help') - .then((output) => { - expect(stripAnsi(output.stdout)).toMatchSnapshot(); - done(); - }) - .catch(done); - }); - describe('static option', () => { it('--static', (done) => { testBin('--static') @@ -951,6 +991,18 @@ describe('CLI', () => { .catch(done); }); + it('--static --static ', (done) => { + testBin('--static new-static --static other-static') + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); + done(); + }) + .catch(done); + }); + it('--static-reset', (done) => { testBin('--static-reset --static new-static-after-reset') .then((output) => { @@ -1073,7 +1125,7 @@ describe('CLI', () => { }); describe('watchFiles option', () => { - it('--watch-files', (done) => { + it('--watch-files ', (done) => { const watchDirectory = path.resolve( __dirname, '../fixtures/static/static' @@ -1090,6 +1142,29 @@ describe('CLI', () => { .catch(done); }); + it('--watch-files --watch-files ', (done) => { + const watchDirectory = path.resolve( + __dirname, + '../fixtures/static/static' + ); + const watchOtherDirectory = path.resolve( + __dirname, + '../fixtures/static/simple-config' + ); + + testBin( + `--watch-files ${watchDirectory} --watch-files ${watchOtherDirectory}` + ) + .then((output) => { + expect(output.exitCode).toEqual(0); + expect( + normalizeStderr(output.stderr, { ipv6: true }) + ).toMatchSnapshot('stderr'); + done(); + }) + .catch(done); + }); + it('--watch-files-reset', (done) => { const watchDirectory = path.resolve( __dirname, From 8c4e2cd477be1c7469f85b280d73a75fec047caf Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 3 Jun 2021 19:39:01 +0300 Subject: [PATCH 05/14] test: update snapshots --- .../__snapshots__/cli.test.js.snap.webpack5 | 435 ++++++++++++------ test/cli/cli.test.js | 2 +- 2 files changed, 293 insertions(+), 144 deletions(-) diff --git a/test/cli/__snapshots__/cli.test.js.snap.webpack5 b/test/cli/__snapshots__/cli.test.js.snap.webpack5 index 539e62098b..d7532a0241 100644 --- a/test/cli/__snapshots__/cli.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/cli.test.js.snap.webpack5 @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`CLI --bonjour 1`] = ` +exports[`CLI bonjour option --bonjour 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -9,7 +9,7 @@ exports[`CLI --bonjour 1`] = ` [webpack-dev-server] Broadcasting \\"http\\" with subtype of \\"webpack\\" via ZeroConf DNS (Bonjour)" `; -exports[`CLI --bonjour and --https 1`] = ` +exports[`CLI bonjour option --bonjour and --https 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -18,7 +18,123 @@ exports[`CLI --bonjour and --https 1`] = ` [webpack-dev-server] Broadcasting \\"https\\" with subtype of \\"webpack\\" via ZeroConf DNS (Bonjour)" `; -exports[`CLI --history-api-fallback 1`] = ` +exports[`CLI bonjour option --no-bonjour 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI help should generate correct cli flags 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server. + +Options: + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + -d, --devtool Determine source maps to use. + --no-devtool Do not generate source maps. + --entry The entry point(s) of your application e.g. ./src/main.js. + --mode Defines the mode to pass to webpack. + --name Name of the configuration. Used when loading multiple configurations. + -o, --output-path Output location of the file generated by webpack e.g. ./dist/. + --stats [value] It instructs webpack on how to treat the stats e.g. verbose. + --no-stats Disable stats output. + -t, --target Sets the build target e.g. node. + --no-target Negative 'target' option. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Do not stop watching when stdin stream has ended. + --bonjour Broadcasts the server via ZeroConf networking on start. https://webpack.js.org/configuration/dev-server/#devserverbonjour + --no-bonjour Negative 'bonjour' option. + --client-transport Allows to set custom transport to communicate with server. + --client-logging Specifies client properties. https://webpack.js.org/configuration/dev-server/#devserverclient + --client-progress Print compilation progress in percentage in the browser. + --no-client-progress Negative 'client-progress' option. + --client-overlay Show a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Negative 'client-overlay' option. + --client-overlay-errors Show a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Negative 'client-overlay-errors' option. + --client-overlay-warnings Show a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Negative 'client-overlay-warnings' option. + --client-need-client-entry Tells devServer to inject a client entry. + --no-client-need-client-entry Negative 'client-need-client-entry' option. + --client-hot-entry Tells devServer to inject a Hot Module Replacement entry. + --no-client-hot-entry Negative 'client-hot-entry' option. + --client-web-socket-url When using dev server and you're proxying dev-server, the client script does not always know where to connect to. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --client-web-socket-url-host Tells clients connected to devServer to use the provided host. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. + --web-socket-server Allows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options. + --compress Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress + --no-compress Negative 'compress' option. + --allowed-hosts Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts + --allowed-hosts-reset Clear all items provided in configuration. Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts + --history-api-fallback When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback + --no-history-api-fallback Negative 'history-api-fallback' option. + --host Specify a host to use. If you want your server to be accessible externally. https://webpack.js.org/configuration/dev-server/#devserverhost + --hot [value] Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot + --no-hot Negative 'hot' option. + --http2 Serve over HTTP/2 using spdy. https://webpack.js.org/configuration/dev-server/#devserverhttp2 + --no-http2 Negative 'http2' option. + --https By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. https://webpack.js.org/configuration/dev-server/#devserverhttps + --no-https Negative 'https' option. + --https-passphrase Passphrase for a pfx file. + --https-request-cert Request for an SSL certificate. + --no-https-request-cert Negative 'https-request-cert' option. + --https-cacert Path to an SSL CA certificate. + --https-key Path to an SSL key. + --https-pfx Path to an SSL pfx file. + --https-cert Path to an SSL certificate. + --live-reload By default, the dev-server will reload/refresh the page when file changes are detected. https://webpack.js.org/configuration/dev-server/#devserverlivereload + --no-live-reload Negative 'live-reload' option. + --open [value...] Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen + --no-open Negative 'open' option. + --open-target [value...] Open specified route in browser. + --no-open-target Negative 'open-target' option. + --open-app-name Open specified browser. + --open-app Open specified browser. + --open-reset Clear all items provided in configuration. Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen + --open-target-reset Clear all items provided in configuration. Open specified route in browser. + --open-app-name-reset Clear all items provided in configuration. Open specified browser. + --port Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport + --static [value...] It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic + --no-static Negative 'static' option. + --static-directory Directory for static contents. + --static-public-path The bundled files will be available in the browser under this path. + --static-serve-index Tells dev-server to use serveIndex middleware when enabled. + --no-static-serve-index Negative 'static-serve-index' option. + --static-watch Watch for files in static content directory. + --no-static-watch Negative 'static-watch' option. + --static-reset Clear all items provided in configuration. It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic + --static-public-path-reset Clear all items provided in configuration. The bundled files will be available in the browser under this path. + --watch-files List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + --watch-files-paths List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + --watch-files-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + --watch-files-paths-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + +exports[`CLI historyApiFallback option --history-api-fallback 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -27,7 +143,7 @@ exports[`CLI --history-api-fallback 1`] = ` [webpack-dev-server] 404s will fallback to '/index.html'" `; -exports[`CLI --host :: (IPv6): stderr 1`] = ` +exports[`CLI historyApiFallback option --no-history-api-fallback 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -35,31 +151,53 @@ exports[`CLI --host :: (IPv6): stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host ::1 (IPv6): stderr 1`] = ` +exports[`CLI host and port options --host and --port are unspecified: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI host and port options --host localhost --port 9999: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI host option --host :: (IPv6): stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI host option --host ::1 (IPv6): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://[::1]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host : stderr 1`] = ` +exports[`CLI host option --host : stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host : stderr 1`] = ` +exports[`CLI host option --host : stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host : stderr 1`] = ` +exports[`CLI host option --host : stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host 0.0.0.0 (IPv4): stderr 1`] = ` +exports[`CLI host option --host 0.0.0.0 (IPv4): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -67,20 +205,34 @@ exports[`CLI --host 0.0.0.0 (IPv4): stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host 0:0:0:0:0:FFFF:7F00:0001 (IPv6): stderr 1`] = ` +exports[`CLI host option --host 0:0:0:0:0:FFFF:7F00:0001 (IPv6): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://127.0.0.1:/ [webpack-dev-server] On Your Network (IPv6): http://[::ffff:127.0.0.1]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host 127.0.0.1 (IPv4): stderr 1`] = ` +exports[`CLI host option --host 127.0.0.1 (IPv4): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://127.0.0.1:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host and --port are unspecified: stderr 1`] = ` +exports[`CLI host option --host localhost: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI http2 option --http2 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: https://localhost:/ + [webpack-dev-server] On Your Network (IPv4): https://:/ + [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI http2 option --no-http2 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -88,19 +240,31 @@ exports[`CLI --host and --port are unspecified: stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host localhost --port 9999: stderr 1`] = ` +exports[`CLI https option --https 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Loopback: https://localhost:/ + [webpack-dev-server] On Your Network (IPv4): https://:/ + [webpack-dev-server] On Your Network (IPv6): https://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host localhost: stderr 1`] = ` +exports[`CLI https option --https-request-cert 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Loopback: https://localhost:/ + [webpack-dev-server] On Your Network (IPv4): https://:/ + [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI https option --no-https 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --http2 1`] = ` +exports[`CLI https option --no-https-request-cert 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -108,7 +272,7 @@ exports[`CLI --http2 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --https 1`] = ` +exports[`CLI https option https and other related options 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -116,7 +280,7 @@ exports[`CLI --https 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --https-request-cert 1`] = ` +exports[`CLI https option https options 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -124,7 +288,7 @@ exports[`CLI --https-request-cert 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-bonjour 1`] = ` +exports[`CLI port option --port is auto: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -132,7 +296,16 @@ exports[`CLI --no-bonjour 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-history-api-fallback 1`] = ` +exports[`CLI port option --port is string: stderr 1`] = ` +" [webpack-dev-server] The \\"port\\" specified in options is different from the port passed as an argument. Will be used from arguments. + [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI static option --no-static-serve-index: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -140,7 +313,7 @@ exports[`CLI --no-history-api-fallback 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-http2 1`] = ` +exports[`CLI static option --no-static-watch: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -148,7 +321,23 @@ exports[`CLI --no-http2 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-https 1`] = ` +exports[`CLI static option --static --static : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory" +`; + +exports[`CLI static option --static : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static' directory" +`; + +exports[`CLI static option --static --static-directory: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -156,15 +345,23 @@ exports[`CLI --no-https 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-https-request-cert 1`] = ` +exports[`CLI static option --static: stderr 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: https://localhost:/ - [webpack-dev-server] On Your Network (IPv4): https://:/ - [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --port is auto: stderr 1`] = ` +exports[`CLI static option --static-directory: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'static-dir' directory" +`; + +exports[`CLI static option --static-public-path: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -172,138 +369,90 @@ exports[`CLI --port is auto: stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --port is string: stderr 1`] = ` -" [webpack-dev-server] The \\"port\\" specified in options is different from the port passed as an argument. Will be used from arguments. - [webpack-dev-server] Project is running at: +exports[`CLI static option --static-public-path-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI https and other related options 1`] = ` +exports[`CLI static option --static-reset --static-directory : stderr 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: https://localhost:/ - [webpack-dev-server] On Your Network (IPv4): https://:/ - [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory" +`; + +exports[`CLI static option --static-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory" +`; + +exports[`CLI static option --static-serve-index: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI https options 1`] = ` +exports[`CLI static option --static-watch: stderr 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: https://localhost:/ - [webpack-dev-server] On Your Network (IPv4): https://:/ - [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI should generate correct cli flags 1`] = ` -"Usage: webpack serve|server|s [entries...] [options] +exports[`CLI watchFiles option --watch-files --watch-files : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Run the webpack dev server. +exports[`CLI watchFiles option --watch-files : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Options: - -c, --config Provide path to a webpack configuration file - e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using - 'webpack-merge'. - --env Environment passed to the configuration when - it is a function. - --node-env Sets process.env.NODE_ENV to the specified - value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - -d, --devtool Determine source maps to use. - --no-devtool Do not generate source maps. - --entry The entry point(s) of your application e.g. - ./src/main.js. - --mode Defines the mode to pass to webpack. - --name Name of the configuration. Used when loading - multiple configurations. - -o, --output-path Output location of the file generated by - webpack e.g. ./dist/. - --stats [value] It instructs webpack on how to treat the - stats e.g. verbose. - --no-stats Disable stats output. - -t, --target Sets the build target e.g. node. - --no-target Negative 'target' option. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Do not stop watching when stdin stream has - ended. - --host The hostname/ip address the server will bind - to. - --port The port server will listen to. - --static [value...] A directory to serve static content from. - --no-static Negative 'static' option. - --static-directory Directory for static contents. - --static-public-path The bundled files will be available in the - browser under this path. - --static-serve-index Tells dev-server to use serveIndex - middleware. - --no-static-serve-index Do not tell dev-server to use serveIndex - middleware. - --static-watch Watch for files in static content directory. - --no-static-watch Do not watch for files in static content - directory. - --live-reload Enables live reloading on changing files. - --no-live-reload Disables live reloading on changing files. - --https Use HTTPS protocol. - --no-https Do not use HTTPS protocol. - --https-passphrase Passphrase for a pfx file. - --https-key Path to an SSL key. - --https-pfx Path to an SSL pfx file. - --https-cert Path to an SSL certificate. - --https-cacert Path to an SSL CA certificate. - --https-request-cert Request for an SSL certificate. - --no-https-request-cert Do not request for an SSL certificate. - --http2 Use HTTP/2, must be used with HTTPS. - --no-http2 Do not use HTTP/2. - --bonjour Broadcasts the server via ZeroConf - networking on start. - --no-bonjour Do not broadcast the server via ZeroConf - networking on start. - --client-hot-entry Tell devServer to inject a Hot Module - Replacement entry. - --no-client-hot-entry Do not tell devServer to inject a Hot Module - Replacement entry. - --client-progress Print compilation progress in percentage in - the browser. - --no-client-progress Do not print compilation progress in - percentage in the browser. - --client-overlay Show a full-screen overlay in the browser - when there are compiler errors or warnings. - --no-client-overlay Do not show a full-screen overlay in the - browser when there are compiler errors or - warnings. - --client-logging Log level in the browser (none, error, warn, - info, log, verbose). - --open [value...] Open the default browser. - --no-open Do not open the default browser. - --open-app Open specified browser. - --open-target [value...] Open specified route in browser. - --no-open-target Do not open specified route in browser. - --history-api-fallback Fallback to /index.html for Single Page - Applications. - --no-history-api-fallback Do not fallback to /index.html for Single - Page Applications. - --compress Enable gzip compression. - --no-compress Disable gzip compression. - --allowed-hosts Set hosts that are allowed to access the dev - server. - --watch-files Watch static files for file changes. +exports[`CLI watchFiles option --watch-files-paths: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Global options: - --color Enable colors on console. - --no-color Disable colors on console. - -v, --version Output the version number of 'webpack', - 'webpack-cli' and 'webpack-dev-server' and - commands. - -h, --help [verbose] Display help for commands and options. +exports[`CLI watchFiles option --watch-files-paths-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -To see list of all supported commands and options run 'webpack --help=verbose'. +exports[`CLI watchFiles option --watch-files-reset --watch-files-paths : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Webpack documentation: https://webpack.js.org/. -CLI documentation: https://webpack.js.org/api/cli/. -Made with ♥ by the webpack team." +exports[`CLI watchFiles option --watch-files-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index 96039f4bb2..ce2660f8c8 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -347,7 +347,7 @@ describe('CLI', () => { }); it('--client-web-socket-url-protocol', (done) => { - testBin('--client-web-socket-url-protocol "ws:"') + testBin('--client-web-socket-url-protocol ws:') .then((output) => { expect(output.exitCode).toEqual(0); done(); From 00d83c3f3752b6c2abd64216a5ff009997fc065c Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 3 Jun 2021 20:11:40 +0300 Subject: [PATCH 06/14] test: update snapshots --- bin/process-arguments.js | 257 +++++++++++ lib/Server.js | 12 +- .../__snapshots__/cli.test.js.snap.webpack4 | 433 ++++++++++++------ 3 files changed, 558 insertions(+), 144 deletions(-) create mode 100644 bin/process-arguments.js diff --git a/bin/process-arguments.js b/bin/process-arguments.js new file mode 100644 index 0000000000..fea928e0d1 --- /dev/null +++ b/bin/process-arguments.js @@ -0,0 +1,257 @@ +'use strict'; + +const path = require('path'); + +// Based on https://github.com/webpack/webpack/blob/master/lib/cli.js +// Please do not modify it + +const cliAddedItems = new WeakMap(); + +const getObjectAndProperty = (config, schemaPath, index = 0) => { + if (!schemaPath) return { value: config }; + const parts = schemaPath.split('.'); + const property = parts.pop(); + let current = config; + let i = 0; + for (const part of parts) { + const isArray = part.endsWith('[]'); + const name = isArray ? part.slice(0, -2) : part; + let value = current[name]; + if (isArray) { + // eslint-disable-next-line no-undefined + if (value === undefined) { + value = {}; + current[name] = [...Array.from({ length: index }), value]; + cliAddedItems.set(current[name], index + 1); + } else if (!Array.isArray(value)) { + return { + problem: { + type: 'unexpected-non-array-in-path', + path: parts.slice(0, i).join('.'), + }, + }; + } else { + let addedItems = cliAddedItems.get(value) || 0; + while (addedItems <= index) { + // eslint-disable-next-line no-undefined + value.push(undefined); + // eslint-disable-next-line no-plusplus + addedItems++; + } + cliAddedItems.set(value, addedItems); + const x = value.length - addedItems + index; + // eslint-disable-next-line no-undefined + if (value[x] === undefined) { + value[x] = {}; + } else if (value[x] === null || typeof value[x] !== 'object') { + return { + problem: { + type: 'unexpected-non-object-in-path', + path: parts.slice(0, i).join('.'), + }, + }; + } + value = value[x]; + } + // eslint-disable-next-line no-undefined + } else if (value === undefined) { + // eslint-disable-next-line no-multi-assign + value = current[name] = {}; + } else if (value === null || typeof value !== 'object') { + return { + problem: { + type: 'unexpected-non-object-in-path', + path: parts.slice(0, i).join('.'), + }, + }; + } + current = value; + // eslint-disable-next-line no-plusplus + i++; + } + const value = current[property]; + if (property.endsWith('[]')) { + const name = property.slice(0, -2); + const value = current[name]; + // eslint-disable-next-line no-undefined + if (value === undefined) { + // eslint-disable-next-line no-undefined + current[name] = [...Array.from({ length: index }), undefined]; + cliAddedItems.set(current[name], index + 1); + // eslint-disable-next-line no-undefined + return { object: current[name], property: index, value: undefined }; + } else if (!Array.isArray(value)) { + // eslint-disable-next-line no-undefined + current[name] = [value, ...Array.from({ length: index }), undefined]; + cliAddedItems.set(current[name], index + 1); + // eslint-disable-next-line no-undefined + return { object: current[name], property: index + 1, value: undefined }; + } + let addedItems = cliAddedItems.get(value) || 0; + while (addedItems <= index) { + // eslint-disable-next-line no-undefined + value.push(undefined); + // eslint-disable-next-line no-plusplus + addedItems++; + } + cliAddedItems.set(value, addedItems); + const x = value.length - addedItems + index; + // eslint-disable-next-line no-undefined + if (value[x] === undefined) { + value[x] = {}; + } else if (value[x] === null || typeof value[x] !== 'object') { + return { + problem: { + type: 'unexpected-non-object-in-path', + path: schemaPath, + }, + }; + } + return { + object: value, + property: x, + value: value[x], + }; + } + return { object: current, property, value }; +}; + +const parseValueForArgumentConfig = (argConfig, value) => { + // eslint-disable-next-line default-case + switch (argConfig.type) { + case 'string': + if (typeof value === 'string') { + return value; + } + break; + case 'path': + if (typeof value === 'string') { + return path.resolve(value); + } + break; + case 'number': + if (typeof value === 'number') return value; + if (typeof value === 'string' && /^[+-]?\d*(\.\d*)[eE]\d+$/) { + const n = +value; + if (!isNaN(n)) return n; + } + break; + case 'boolean': + if (typeof value === 'boolean') return value; + if (value === 'true') return true; + if (value === 'false') return false; + break; + case 'RegExp': + if (value instanceof RegExp) return value; + if (typeof value === 'string') { + // cspell:word yugi + const match = /^\/(.*)\/([yugi]*)$/.exec(value); + if (match && !/[^\\]\//.test(match[1])) { + return new RegExp(match[1], match[2]); + } + } + break; + case 'enum': + if (argConfig.values.includes(value)) return value; + for (const item of argConfig.values) { + if (`${item}` === value) return item; + } + break; + case 'reset': + if (value === true) return []; + break; + } +}; + +const getExpectedValue = (argConfig) => { + switch (argConfig.type) { + default: + return argConfig.type; + case 'boolean': + return 'true | false'; + case 'RegExp': + return 'regular expression (example: /ab?c*/)'; + case 'enum': + return argConfig.values.map((v) => `${v}`).join(' | '); + case 'reset': + return 'true (will reset the previous value to an empty array)'; + } +}; + +const setValue = (config, schemaPath, value, index) => { + const { problem, object, property } = getObjectAndProperty( + config, + schemaPath, + index + ); + if (problem) return problem; + object[property] = value; + return null; +}; + +const processArgumentConfig = (argConfig, config, value, index) => { + // eslint-disable-next-line no-undefined + if (index !== undefined && !argConfig.multiple) { + return { + type: 'multiple-values-unexpected', + path: argConfig.path, + }; + } + const parsed = parseValueForArgumentConfig(argConfig, value); + // eslint-disable-next-line no-undefined + if (parsed === undefined) { + return { + type: 'invalid-value', + path: argConfig.path, + expected: getExpectedValue(argConfig), + }; + } + const problem = setValue(config, argConfig.path, parsed, index); + if (problem) return problem; + return null; +}; + +const processArguments = (args, config, values) => { + const problems = []; + for (const key of Object.keys(values)) { + const arg = args[key]; + if (!arg) { + problems.push({ + type: 'unknown-argument', + path: '', + argument: key, + }); + // eslint-disable-next-line no-continue + continue; + } + const processValue = (value, i) => { + const currentProblems = []; + for (const argConfig of arg.configs) { + const problem = processArgumentConfig(argConfig, config, value, i); + if (!problem) { + return; + } + currentProblems.push({ + ...problem, + argument: key, + value, + index: i, + }); + } + problems.push(...currentProblems); + }; + const value = values[key]; + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + processValue(value[i], i); + } + } else { + // eslint-disable-next-line no-undefined + processValue(value, undefined); + } + } + if (problems.length === 0) return null; + return problems; +}; + +module.exports = processArguments; diff --git a/lib/Server.js b/lib/Server.js index b5bc7e1218..16d9043bac 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -75,12 +75,20 @@ class Server { } static getArguments(webpack, ...args) { - // TODO polyfill for webpack v4 + // TODO remove after drop webpack v4 + if (!webpack.cli) { + return require('../bin/cli-flags'); + } + return webpack.cli.getArguments(schema, ...args); } static processArguments(webpack, ...args) { - // TODO polyfill for webpack v4 + // TODO remove after drop webpack v4 + if (!webpack.cli) { + return require('../bin/process-arguments')(...args); + } + return webpack.cli.processArguments(...args); } diff --git a/test/cli/__snapshots__/cli.test.js.snap.webpack4 b/test/cli/__snapshots__/cli.test.js.snap.webpack4 index a1fc9be2f2..793bcdcb53 100644 --- a/test/cli/__snapshots__/cli.test.js.snap.webpack4 +++ b/test/cli/__snapshots__/cli.test.js.snap.webpack4 @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`CLI --bonjour 1`] = ` +exports[`CLI bonjour option --bonjour 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -9,7 +9,7 @@ exports[`CLI --bonjour 1`] = ` [webpack-dev-server] Broadcasting \\"http\\" with subtype of \\"webpack\\" via ZeroConf DNS (Bonjour)" `; -exports[`CLI --bonjour and --https 1`] = ` +exports[`CLI bonjour option --bonjour and --https 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -18,7 +18,122 @@ exports[`CLI --bonjour and --https 1`] = ` [webpack-dev-server] Broadcasting \\"https\\" with subtype of \\"webpack\\" via ZeroConf DNS (Bonjour)" `; -exports[`CLI --history-api-fallback 1`] = ` +exports[`CLI bonjour option --no-bonjour 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI help should generate correct cli flags 1`] = ` +"Usage: webpack serve|server|s [entries...] [options] + +Run the webpack dev server. + +Options: + -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. + --config-name Name of the configuration to use. + -m, --merge Merge two or more configurations using 'webpack-merge'. + --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. + --progress [value] Print compilation progress during build. + -j, --json [value] Prints result as JSON or store it in a file. + --entry The entry point(s) of your application e.g. ./src/main.js. + -o, --output-path Output location of the file generated by webpack e.g. ./dist/. + -t, --target Sets the build target e.g. node. + -d, --devtool Determine source maps to use. + --no-devtool Do not generate source maps. + --mode Defines the mode to pass to webpack. + --name Name of the configuration. Used when loading multiple configurations. + --stats [value] It instructs webpack on how to treat the stats e.g. verbose. + --no-stats Disable stats output. + --watch-options-stdin Stop watching when stdin stream has ended. + --no-watch-options-stdin Do not stop watching when stdin stream has ended. + --allowed-hosts Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts + --allowed-hosts-reset Clear all items provided in configuration. Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts + --bonjour Broadcasts the server via ZeroConf networking on start. https://webpack.js.org/configuration/dev-server/#devserverbonjour + --no-bonjour Do not broadcast the server via ZeroConf networking on start. + --client-transport Allows to set custom transport to communicate with server. + --client-logging Specifies client properties. https://webpack.js.org/configuration/dev-server/#devserverclient + --client-progress Print compilation progress in percentage in the browser. + --no-client-progress Do not print compilation progress in percentage in the browser. + --client-overlay Show a full-screen overlay in the browser when there are compiler errors or warnings. + --no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings. + --client-overlay-errors Show a full-screen overlay in the browser when there are compiler errors. + --no-client-overlay-errors Negative 'client-overlay-errors' option. + --client-overlay-warnings Show a full-screen overlay in the browser when there are compiler warnings. + --no-client-overlay-warnings Negative 'client-overlay-warnings' option. + --client-need-client-entry Tells devServer to inject a client entry. + --no-client-need-client-entry Negative 'client-need-client-entry' option. + --client-hot-entry Tells devServer to inject a Hot Module Replacement entry. + --no-client-hot-entry Do not tell devServer to inject a Hot Module Replacement entry. + --client-web-socket-url When using dev server and you're proxying dev-server, the client script does not always know where to connect to. + --client-web-socket-url-host Tells clients connected to devServer to use the provided host. + --client-web-socket-url-port Tells clients connected to devServer to use the provided port. + --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. + --web-socket-server Allows to set web socket server and options. + --web-socket-server-type Allows to set web socket server and options. + --compress Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress + --no-compress Disable gzip compression. + --history-api-fallback When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback + --no-history-api-fallback Negative 'history-api-fallback' option. + --host Specify a host to use. If you want your server to be accessible externally. https://webpack.js.org/configuration/dev-server/#devserverhost + --hot [value] Enable webpack's Hot Module Replacement feature. https://webpack.js.org/configuration/dev-server/#devserverhot + --no-hot Disable webpack's Hot Module Replacement feature. + --http2 Serve over HTTP/2 using spdy. https://webpack.js.org/configuration/dev-server/#devserverhttp2 + --no-http2 Do not use HTTP/2. + --https By default, dev-server will be served over HTTP. It can optionally be served over HTTP/2 with HTTPS. https://webpack.js.org/configuration/dev-server/#devserverhttps + --no-https Do not use HTTPS protocol. + --https-passphrase Passphrase for a pfx file. + --https-request-cert Request for an SSL certificate. + --no-https-request-cert Do not request for an SSL certificate. + --https-cacert Path to an SSL CA certificate. + --https-key Path to an SSL key. + --https-pfx Path to an SSL pfx file. + --https-cert Path to an SSL certificate. + --live-reload By default, the dev-server will reload/refresh the page when file changes are detected. https://webpack.js.org/configuration/dev-server/#devserverlivereload + --no-live-reload Disables live reloading on changing files. + --open [value...] Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen + --no-open Do not open the default browser. + --open-target [value...] Open specified route in browser. + --no-open-target Do not open specified route in browser. + --open-app-name Open specified browser. + --open-app Open specified browser. + --open-reset Clear all items provided in configuration. Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen + --open-target-reset Clear all items provided in configuration. Open specified route in browser. + --open-app-name-reset Clear all items provided in configuration. Open specified browser. + --port Specify a port number to listen for requests on. https://webpack.js.org/configuration/dev-server/#devserverport + --static [value...] It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic + --no-static Negative 'static' option. + --static-directory Directory for static contents. + --static-public-path The bundled files will be available in the browser under this path. + --static-serve-index Tells dev-server to use serveIndex middleware when enabled. + --no-static-serve-index Do not tell dev-server to use serveIndex middleware. + --static-watch Watch for files in static content directory. + --no-static-watch Do not watch for files in static content directory. + --static-reset Clear all items provided in configuration. It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic + --static-public-path-reset Clear all items provided in configuration. The bundled files will be available in the browser under this path. + --watch-files List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + --watch-files-paths List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + --watch-files-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + --watch-files-paths-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles + +Global options: + --color Enable colors on console. + --no-color Disable colors on console. + -v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands. + -h, --help [verbose] Display help for commands and options. + +To see list of all supported commands and options run 'webpack --help=verbose'. + +Webpack documentation: https://webpack.js.org/. +CLI documentation: https://webpack.js.org/api/cli/. +Made with ♥ by the webpack team." +`; + +exports[`CLI historyApiFallback option --history-api-fallback 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -27,7 +142,7 @@ exports[`CLI --history-api-fallback 1`] = ` [webpack-dev-server] 404s will fallback to '/index.html'" `; -exports[`CLI --host :: (IPv6): stderr 1`] = ` +exports[`CLI historyApiFallback option --no-history-api-fallback 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -35,31 +150,53 @@ exports[`CLI --host :: (IPv6): stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host ::1 (IPv6): stderr 1`] = ` +exports[`CLI host and port options --host and --port are unspecified: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI host and port options --host localhost --port 9999: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI host option --host :: (IPv6): stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI host option --host ::1 (IPv6): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://[::1]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host : stderr 1`] = ` +exports[`CLI host option --host : stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host : stderr 1`] = ` +exports[`CLI host option --host : stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host : stderr 1`] = ` +exports[`CLI host option --host : stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host 0.0.0.0 (IPv4): stderr 1`] = ` +exports[`CLI host option --host 0.0.0.0 (IPv4): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -67,20 +204,34 @@ exports[`CLI --host 0.0.0.0 (IPv4): stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host 0:0:0:0:0:FFFF:7F00:0001 (IPv6): stderr 1`] = ` +exports[`CLI host option --host 0:0:0:0:0:FFFF:7F00:0001 (IPv6): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://127.0.0.1:/ [webpack-dev-server] On Your Network (IPv6): http://[::ffff:127.0.0.1]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host 127.0.0.1 (IPv4): stderr 1`] = ` +exports[`CLI host option --host 127.0.0.1 (IPv4): stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://127.0.0.1:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host and --port are unspecified: stderr 1`] = ` +exports[`CLI host option --host localhost: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI http2 option --http2 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: https://localhost:/ + [webpack-dev-server] On Your Network (IPv4): https://:/ + [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI http2 option --no-http2 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -88,19 +239,31 @@ exports[`CLI --host and --port are unspecified: stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host localhost --port 9999: stderr 1`] = ` +exports[`CLI https option --https 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Loopback: https://localhost:/ + [webpack-dev-server] On Your Network (IPv4): https://:/ + [webpack-dev-server] On Your Network (IPv6): https://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --host localhost: stderr 1`] = ` +exports[`CLI https option --https-request-cert 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/, http://127.0.0.1:/ + [webpack-dev-server] Loopback: https://localhost:/ + [webpack-dev-server] On Your Network (IPv4): https://:/ + [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI https option --no-https 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --http2 1`] = ` +exports[`CLI https option --no-https-request-cert 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -108,7 +271,7 @@ exports[`CLI --http2 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --https 1`] = ` +exports[`CLI https option https and other related options 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -116,7 +279,7 @@ exports[`CLI --https 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --https-request-cert 1`] = ` +exports[`CLI https option https options 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: https://localhost:/ [webpack-dev-server] On Your Network (IPv4): https://:/ @@ -124,7 +287,7 @@ exports[`CLI --https-request-cert 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-bonjour 1`] = ` +exports[`CLI port option --port is auto: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -132,7 +295,16 @@ exports[`CLI --no-bonjour 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-history-api-fallback 1`] = ` +exports[`CLI port option --port is string: stderr 1`] = ` +" [webpack-dev-server] The \\"port\\" specified in options is different from the port passed as an argument. Will be used from arguments. + [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + +exports[`CLI static option --no-static-serve-index: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -140,7 +312,7 @@ exports[`CLI --no-history-api-fallback 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-http2 1`] = ` +exports[`CLI static option --no-static-watch: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -148,7 +320,23 @@ exports[`CLI --no-http2 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-https 1`] = ` +exports[`CLI static option --static --static : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory" +`; + +exports[`CLI static option --static : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static' directory" +`; + +exports[`CLI static option --static --static-directory: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -156,15 +344,23 @@ exports[`CLI --no-https 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --no-https-request-cert 1`] = ` +exports[`CLI static option --static: stderr 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: https://localhost:/ - [webpack-dev-server] On Your Network (IPv4): https://:/ - [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --port is auto: stderr 1`] = ` +exports[`CLI static option --static-directory: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'static-dir' directory" +`; + +exports[`CLI static option --static-public-path: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -172,137 +368,90 @@ exports[`CLI --port is auto: stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI --port is string: stderr 1`] = ` -" [webpack-dev-server] The \\"port\\" specified in options is different from the port passed as an argument. Will be used from arguments. - [webpack-dev-server] Project is running at: +exports[`CLI static option --static-public-path-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI https and other related options 1`] = ` +exports[`CLI static option --static-reset --static-directory : stderr 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: https://localhost:/ - [webpack-dev-server] On Your Network (IPv4): https://:/ - [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory" +`; + +exports[`CLI static option --static-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory" +`; + +exports[`CLI static option --static-serve-index: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI https options 1`] = ` +exports[`CLI static option --static-watch: stderr 1`] = ` " [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: https://localhost:/ - [webpack-dev-server] On Your Network (IPv4): https://:/ - [webpack-dev-server] On Your Network (IPv6): https://[]:/ + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI should generate correct cli flags 1`] = ` -"Usage: webpack serve|server|s [entries...] [options] +exports[`CLI watchFiles option --watch-files --watch-files : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Run the webpack dev server. +exports[`CLI watchFiles option --watch-files : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Options: - -c, --config Provide path to a webpack configuration file - e.g. ./webpack.config.js. - --config-name Name of the configuration to use. - -m, --merge Merge two or more configurations using - 'webpack-merge'. - --env Environment passed to the configuration when - it is a function. - --node-env Sets process.env.NODE_ENV to the specified - value. - --progress [value] Print compilation progress during build. - -j, --json [value] Prints result as JSON or store it in a file. - --entry The entry point(s) of your application e.g. - ./src/main.js. - -o, --output-path Output location of the file generated by - webpack e.g. ./dist/. - -t, --target Sets the build target e.g. node. - -d, --devtool Determine source maps to use. - --no-devtool Do not generate source maps. - --mode Defines the mode to pass to webpack. - --name Name of the configuration. Used when loading - multiple configurations. - --stats [value] It instructs webpack on how to treat the - stats e.g. verbose. - --no-stats Disable stats output. - --watch-options-stdin Stop watching when stdin stream has ended. - --no-watch-options-stdin Do not stop watching when stdin stream has - ended. - --host The hostname/ip address the server will bind - to. - --port The port server will listen to. - --static [value...] A directory to serve static content from. - --no-static Negative 'static' option. - --static-directory Directory for static contents. - --static-public-path The bundled files will be available in the - browser under this path. - --static-serve-index Tells dev-server to use serveIndex - middleware. - --no-static-serve-index Do not tell dev-server to use serveIndex - middleware. - --static-watch Watch for files in static content directory. - --no-static-watch Do not watch for files in static content - directory. - --live-reload Enables live reloading on changing files. - --no-live-reload Disables live reloading on changing files. - --https Use HTTPS protocol. - --no-https Do not use HTTPS protocol. - --https-passphrase Passphrase for a pfx file. - --https-key Path to an SSL key. - --https-pfx Path to an SSL pfx file. - --https-cert Path to an SSL certificate. - --https-cacert Path to an SSL CA certificate. - --https-request-cert Request for an SSL certificate. - --no-https-request-cert Do not request for an SSL certificate. - --http2 Use HTTP/2, must be used with HTTPS. - --no-http2 Do not use HTTP/2. - --bonjour Broadcasts the server via ZeroConf - networking on start. - --no-bonjour Do not broadcast the server via ZeroConf - networking on start. - --client-hot-entry Tell devServer to inject a Hot Module - Replacement entry. - --no-client-hot-entry Do not tell devServer to inject a Hot Module - Replacement entry. - --client-progress Print compilation progress in percentage in - the browser. - --no-client-progress Do not print compilation progress in - percentage in the browser. - --client-overlay Show a full-screen overlay in the browser - when there are compiler errors or warnings. - --no-client-overlay Do not show a full-screen overlay in the - browser when there are compiler errors or - warnings. - --client-logging Log level in the browser (none, error, warn, - info, log, verbose). - --open [value...] Open the default browser. - --no-open Do not open the default browser. - --open-app Open specified browser. - --open-target [value...] Open specified route in browser. - --no-open-target Do not open specified route in browser. - --history-api-fallback Fallback to /index.html for Single Page - Applications. - --no-history-api-fallback Do not fallback to /index.html for Single - Page Applications. - --compress Enable gzip compression. - --no-compress Disable gzip compression. - --allowed-hosts Set hosts that are allowed to access the dev - server. - --watch-files Watch static files for file changes. +exports[`CLI watchFiles option --watch-files-paths: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Global options: - --color Enable colors on console. - --no-color Disable colors on console. - -v, --version Output the version number of 'webpack', - 'webpack-cli' and 'webpack-dev-server' and - commands. - -h, --help [verbose] Display help for commands and options. +exports[`CLI watchFiles option --watch-files-paths-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -To see list of all supported commands and options run 'webpack --help=verbose'. +exports[`CLI watchFiles option --watch-files-reset --watch-files-paths : stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; -Webpack documentation: https://webpack.js.org/. -CLI documentation: https://webpack.js.org/api/cli/. -Made with ♥ by the webpack team." +exports[`CLI watchFiles option --watch-files-reset: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + [webpack-dev-server] Loopback: http://localhost:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] On Your Network (IPv6): http://[]:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; From 7b88c531c6ef2d20f097e14782a940067c2896a0 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 3 Jun 2021 21:51:24 +0300 Subject: [PATCH 07/14] refactor: improve schema --- lib/options.json | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/options.json b/lib/options.json index 5dff14560f..cbe1b0a4c9 100644 --- a/lib/options.json +++ b/lib/options.json @@ -55,7 +55,8 @@ ], "description": "Watch for files in static content directory." } - } + }, + "required": ["directory"] }, "StaticString": { "type": "string", @@ -138,6 +139,9 @@ }, "WatchFilesObject": { "type": "object", + "cli": { + "exclude": true + }, "properties": { "paths": { "anyOf": [ @@ -159,7 +163,8 @@ "additionalProperties": true } }, - "additionalProperties": false + "additionalProperties": false, + "required": ["paths"] }, "WebSocketServerEnum": { "enum": ["sockjs", "ws"] @@ -173,6 +178,9 @@ }, "WebSocketServerObject": { "type": "object", + "cli": { + "exclude": true + }, "properties": { "type": { "anyOf": [ @@ -515,8 +523,7 @@ "$ref": "#/definitions/OpenObject" } ] - }, - "minItems": 1 + } }, { "$ref": "#/definitions/OpenBoolean" @@ -587,8 +594,7 @@ "$ref": "#/definitions/StaticObject" } ] - }, - "minItems": 1 + } }, { "type": "boolean" From 7cbac25fa38e317adb69c4453f533f8a14dca3f5 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 4 Jun 2021 18:15:29 +0300 Subject: [PATCH 08/14] refactor: code --- lib/Server.js | 64 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/lib/Server.js b/lib/Server.js index 16d9043bac..a063391b12 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -74,24 +74,6 @@ class Server { }, this); } - static getArguments(webpack, ...args) { - // TODO remove after drop webpack v4 - if (!webpack.cli) { - return require('../bin/cli-flags'); - } - - return webpack.cli.getArguments(schema, ...args); - } - - static processArguments(webpack, ...args) { - // TODO remove after drop webpack v4 - if (!webpack.cli) { - return require('../bin/process-arguments')(...args); - } - - return webpack.cli.processArguments(...args); - } - applyDevServerPlugin() { const DevServerPlugin = require('./utils/DevServerPlugin'); @@ -1054,4 +1036,48 @@ class Server { } } -module.exports = Server; +const mergeExports = (obj, exports) => { + const descriptors = Object.getOwnPropertyDescriptors(exports); + + for (const name of Object.keys(descriptors)) { + const descriptor = descriptors[name]; + + if (descriptor.get) { + const fn = descriptor.get; + + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + get: fn, + }); + } else if (typeof descriptor.value === 'object') { + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + writable: false, + value: mergeExports({}, descriptor.value), + }); + } else { + throw new Error( + 'Exposed values must be either a getter or an nested object' + ); + } + } + + return Object.freeze(obj); +}; + +module.exports = mergeExports(Server, { + get schema() { + return schema; + }, + // TODO compatibility with webpack v4, remove it after drop + cli: { + get getArguments() { + return () => require('../bin/cli-flags'); + }, + get processArguments() { + return require('../bin/process-arguments'); + }, + }, +}); From c3c171b37f62d08bda4c349fd769b7702103cd64 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Jun 2021 16:14:37 +0300 Subject: [PATCH 09/14] chore(deps): update --- package-lock.json | 1829 ++++++++++++++------------------------------- package.json | 12 +- 2 files changed, 575 insertions(+), 1266 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ecb59ca61..8fab804e8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,11 +55,11 @@ "body-parser": "^1.19.0", "core-js": "^3.12.1", "css-loader": "^5.2.4", - "eslint": "^7.26.0", + "eslint": "^7.28.0", "eslint-config-prettier": "^8.3.0", "eslint-config-webpack": "^1.2.5", "eslint-plugin-import": "^2.23.2", - "execa": "^5.0.0", + "execa": "^5.1.1", "file-loader": "^6.2.0", "html-webpack-plugin": "^4.5.2", "husky": "^6.0.0", @@ -71,8 +71,8 @@ "marked": "^2.0.3", "memfs": "^3.2.2", "npm-run-all": "^4.1.5", - "prettier": "^2.2.1", - "puppeteer": "^9.1.1", + "prettier": "^2.3.1", + "puppeteer": "^10.0.0", "require-from-string": "^2.0.2", "rimraf": "^3.0.2", "sockjs-client": "^1.5.1", @@ -83,8 +83,8 @@ "typescript": "^4.2.4", "url-loader": "^4.1.1", "webpack": "^5.37.1", - "webpack-cli": "^4.7.0", - "webpack-merge": "^5.7.3" + "webpack-cli": "^4.7.1", + "webpack-merge": "^5.8.0" }, "engines": { "node": ">= 12.13.0" @@ -215,16 +215,16 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.3.tgz", - "integrity": "sha512-BnEfi5+6J2Lte9LeiL6TxLWdIlEv9Woacc1qXzXBgbikcOzMRM2Oya5XGg/f/ngotv1ej2A/b+3iJH8wbS1+lQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.4.tgz", + "integrity": "sha512-idr3pthFlDCpV+p/rMgGLGYIVtazeatrSOQk8YzO2pAepIjQhCN3myeihVg58ax2bbbGK9PUE1reFi7axOYIOw==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.12.13", "@babel/helper-function-name": "^7.14.2", "@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.14.3", + "@babel/helper-replace-supers": "^7.14.4", "@babel/helper-split-export-declaration": "^7.12.13" }, "peerDependencies": { @@ -245,9 +245,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz", - "integrity": "sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz", + "integrity": "sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew==", "dev": true, "dependencies": { "@babel/helper-compilation-targets": "^7.13.0", @@ -448,9 +448,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz", - "integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1928,15 +1928,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", - "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", - "globals": "^12.1.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", @@ -1948,12 +1948,12 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" @@ -1963,12 +1963,15 @@ } }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -2825,11 +2828,11 @@ } }, "node_modules/@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dependencies": { - "@nodelib/fs.stat": "2.0.4", + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { @@ -2837,19 +2840,19 @@ } }, "node_modules/@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", + "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", "dependencies": { - "@nodelib/fs.scandir": "2.1.4", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { @@ -2874,14 +2877,13 @@ "@sinonjs/commons": "^1.7.0" } }, - "node_modules/@types/anymatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-3.0.0.tgz", - "integrity": "sha512-qLChUo6yhpQ9k905NwL74GU7TxH+9UODwwQ6ICNI+O6EDMExqH/Cv9NsbmcZ7yC/rRXJ/AHCzfgjsFRY5fKjYw==", - "deprecated": "This is a stub types definition. anymatch provides its own type definitions, so you do not need this installed.", + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true, - "dependencies": { - "anymatch": "*" + "engines": { + "node": ">= 6" } }, "node_modules/@types/babel__core": { @@ -2926,9 +2928,9 @@ } }, "node_modules/@types/eslint": { - "version": "7.2.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz", - "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==", + "version": "7.2.13", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.13.tgz", + "integrity": "sha512-LKmQCWAlnVHvvXq4oasNUMTJJb2GwSyTY8+1C7OH5ILR8mPLaljv1jxL1bXW3xB3jFbQxTKxJAvI8PyjB09aBg==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -2987,9 +2989,9 @@ } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" @@ -3013,9 +3015,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" + "version": "15.12.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.1.tgz", + "integrity": "sha512-zyxJM8I1c9q5sRMtVF+zdd13Jt6RU4r4qfhTd7lQubyThvLfx6yYekWSQjGCGV2Tkecgxnlpl/DNlb6Hg+dmEw==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.0", @@ -3077,16 +3079,16 @@ } }, "node_modules/@types/webpack": { - "version": "4.41.28", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.28.tgz", - "integrity": "sha512-Nn84RAiJjKRfPFFCVR8LC4ueTtTdfWAMZ03THIzZWRJB+rX24BD3LqPSFnbMscWauEsT4segAsylPDIaZyZyLQ==", + "version": "4.41.29", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.29.tgz", + "integrity": "sha512-6pLaORaVNZxiB3FSHbyBiWM7QdazAWda1zvAq4SbZObZqHSDbWLi62iFdblVea6SK9eyBIVp5yHhKt/yNQdR7Q==", "dev": true, "dependencies": { - "@types/anymatch": "*", "@types/node": "*", "@types/tapable": "^1", "@types/uglify-js": "*", "@types/webpack-sources": "*", + "anymatch": "^3.0.0", "source-map": "^0.6.0" } }, @@ -3110,6 +3112,19 @@ "node": ">= 8" } }, + "node_modules/@types/webpack/node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@types/webpack/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3276,9 +3291,9 @@ } }, "node_modules/@webpack-cli/configtest": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", - "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.4.tgz", + "integrity": "sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ==", "dev": true, "peerDependencies": { "webpack": "4.x.x || 5.x.x", @@ -3286,9 +3301,9 @@ } }, "node_modules/@webpack-cli/info": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", - "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.3.0.tgz", + "integrity": "sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w==", "dev": true, "dependencies": { "envinfo": "^7.7.3" @@ -3298,9 +3313,9 @@ } }, "node_modules/@webpack-cli/serve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", - "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.0.tgz", + "integrity": "sha512-AxpcbdkUhl4248H33LDFgXpFpDE5/BU9rHi2Oj8J4z8JldoMXoSmCe1DXDKcw1ClK64g6fY1Hg+dW20vH81JvQ==", "dev": true, "peerDependencies": { "webpack-cli": "4.x.x" @@ -3638,24 +3653,6 @@ "node": ">=0.10.0" } }, - "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -3716,21 +3713,6 @@ "node": ">= 4.5.0" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, "node_modules/babel-jest": { "version": "26.6.3", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", @@ -3925,13 +3907,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz", - "integrity": "sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz", + "integrity": "sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==", "dev": true, "dependencies": { "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.0", + "@babel/helper-define-polyfill-provider": "^0.2.2", "semver": "^6.1.1" }, "peerDependencies": { @@ -3939,12 +3921,12 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz", - "integrity": "sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.2.tgz", + "integrity": "sha512-l1Cf8PKk12eEk5QP/NQ6TH8A1pee6wWDJ96WjxrMXFLHLOBFzYM4moG80HFgduVhTqAFez4alnZKEhP/bYHg0A==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.2.0", + "@babel/helper-define-polyfill-provider": "^0.2.2", "core-js-compat": "^3.9.1" }, "peerDependencies": { @@ -3952,12 +3934,12 @@ } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz", - "integrity": "sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz", + "integrity": "sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.2.0" + "@babel/helper-define-polyfill-provider": "^0.2.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0" @@ -4062,15 +4044,6 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -4363,9 +4336,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001228", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz", - "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==", + "version": "1.0.30001235", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001235.tgz", + "integrity": "sha512-zWEwIVqnzPkSAXOUlQnPW2oKoYb2aLQ4Q5ejdjBcnH63rfypaW34CxaeBn1VMya2XaEU3P/R2qHpWyj+l0BT1A==", "funding": { "type": "opencollective", "url": "https://opencollective.com/browserslist" @@ -4383,12 +4356,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -5231,9 +5198,9 @@ } }, "node_modules/core-js-compat": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.1.tgz", - "integrity": "sha512-i6h5qODpw6EsHAoIdQhKoZdWn+dGBF3dSS8m5tif36RlWvW3A6+yu2S16QHUo3CrkzrnEskMAt9f8FxmY9fhWQ==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.14.0.tgz", + "integrity": "sha512-R4NS2eupxtiJU+VwgkF9WTpnSfZW4pogwKHd8bclWU2sp93Pr5S1uYJI84cMOubJRou7bcfL0vmwtLslWN5p3A==", "dev": true, "dependencies": { "browserslist": "^4.16.6", @@ -5425,18 +5392,6 @@ "node": ">=8" } }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/data-urls": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", @@ -5654,9 +5609,9 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "node_modules/detect-indent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true, "engines": { "node": ">=8" @@ -5677,9 +5632,9 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" }, "node_modules/devtools-protocol": { - "version": "0.0.869402", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.869402.tgz", - "integrity": "sha512-VvlVYY+VDJe639yHs5PHISzdWTLL3Aw8rO4cvUtwvoxFd6FHbE4OpHHcde52M6096uYYazAmd4l0o5VuFRO2WA==", + "version": "0.0.883894", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.883894.tgz", + "integrity": "sha512-33idhm54QJzf3Q7QofMgCvIVSd2o9H3kQPWaKT/fhoZh+digc+WSiMhbkeG3iN79WY4Hwr9G05NpbhEVrsOYAg==", "dev": true }, "node_modules/diff-sequences": { @@ -5708,9 +5663,9 @@ "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=" }, "node_modules/dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", "dependencies": { "ip": "^1.1.0", "safe-buffer": "^5.0.1" @@ -5909,25 +5864,15 @@ "node": ">=4" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "node_modules/electron-to-chromium": { - "version": "1.3.732", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.732.tgz", - "integrity": "sha512-qKD5Pbq+QMk4nea4lMuncUMhpEiQwaJyCW7MrvissnRcBDENhVfDmAqQYRQ3X525oTzhar9Zh1cK0L2d1UKYcw==" + "version": "1.3.749", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.749.tgz", + "integrity": "sha512-F+v2zxZgw/fMwPz/VUGIggG4ZndDsYy0vlpthi3tjmDZlcfbhN5mYW0evXUsBr2sUtuDANFtle410A9u/sd/4A==" }, "node_modules/emittery": { "version": "0.7.2", @@ -6049,9 +5994,9 @@ } }, "node_modules/es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", + "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", @@ -6062,14 +6007,14 @@ "has-symbols": "^1.0.2", "is-callable": "^1.2.3", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.10.3", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" + "unbox-primitive": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -6215,13 +6160,13 @@ } }, "node_modules/eslint": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.27.0.tgz", - "integrity": "sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.1", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -6238,7 +6183,7 @@ "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", + "glob-parent": "^5.1.2", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", @@ -6592,9 +6537,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", - "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -6799,9 +6744,9 @@ "dev": true }, "node_modules/execa": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.0.tgz", - "integrity": "sha512-CkdUB7s2y6S+d4y+OM/+ZtQcJCiKUCth4cNImGMqrt2zEVtW2rfHGspQBE1GDo6LjeNIQmTPKXqTCKjqFKyu3A==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -7029,12 +6974,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, "node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", @@ -7113,15 +7052,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -7239,9 +7169,9 @@ } }, "node_modules/faye-websocket": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", - "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", "dependencies": { "websocket-driver": ">=0.5.1" }, @@ -7525,27 +7455,18 @@ "node": ">=0.10.0" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", "dev": true, "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" }, "engines": { - "node": ">= 0.12" + "node": ">= 6" } }, "node_modules/formidable": { @@ -7558,9 +7479,9 @@ } }, "node_modules/forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "engines": { "node": ">= 0.6" } @@ -8002,15 +7923,6 @@ "node": ">=0.10.0" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/git-raw-commits": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz", @@ -8228,29 +8140,6 @@ "node": ">=0.10.0" } }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -8515,6 +8404,20 @@ "node": ">=8.0.0" } }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/http-proxy-middleware": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.0.tgz", @@ -8583,21 +8486,6 @@ "node": ">=8.0" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -9409,12 +9297,6 @@ "node": ">=0.10.0" } }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "node_modules/istanbul-lib-coverage": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", @@ -11844,6 +11726,7 @@ "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -11857,6 +11740,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -11865,6 +11749,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -11891,20 +11776,14 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "node_modules/jsdom": { - "version": "16.5.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.3.tgz", - "integrity": "sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA==", + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", + "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", "dev": true, "dependencies": { "abab": "^2.0.5", - "acorn": "^8.1.0", + "acorn": "^8.2.4", "acorn-globals": "^6.0.0", "cssom": "^0.4.4", "cssstyle": "^2.3.0", @@ -11912,12 +11791,13 @@ "decimal.js": "^10.2.1", "domexception": "^2.0.1", "escodegen": "^2.0.0", + "form-data": "^3.0.0", "html-encoding-sniffer": "^2.0.1", - "is-potential-custom-element-name": "^1.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", "parse5": "6.0.1", - "request": "^2.88.2", - "request-promise-native": "^1.0.9", "saxes": "^5.0.1", "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", @@ -11927,7 +11807,7 @@ "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.5.0", - "ws": "^7.4.4", + "ws": "^7.4.5", "xml-name-validator": "^3.0.0" }, "engines": { @@ -11965,12 +11845,6 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -12046,21 +11920,6 @@ "node": "*" } }, - "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "node_modules/killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -12369,15 +12228,13 @@ } }, "node_modules/listr2": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.8.2.tgz", - "integrity": "sha512-E28Fw7Zd3HQlCJKzb9a8C8M0HtFWQeucE+S8YrSrqZObuCLPRHMRrR8gNmYt65cU9orXYHwvN5agXC36lYt7VQ==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.9.0.tgz", + "integrity": "sha512-+JxQt7Vi4WEWgJsxmOEX9lDbCumrb3mrEYIeE1VI7I4lf2rXE4v9pq3RMVNp+a9s6mCgc/IsF0ppHsLrx2BEAw==", "dev": true, "dependencies": { - "chalk": "^4.1.1", "cli-truncate": "^2.1.0", - "figures": "^3.2.0", - "indent-string": "^4.0.0", + "colorette": "^1.2.2", "log-update": "^4.0.0", "p-map": "^4.0.0", "rxjs": "^6.6.7", @@ -12391,76 +12248,6 @@ "enquirer": ">= 2.3.0 < 3" } }, - "node_modules/listr2/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/listr2/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/listr2/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/listr2/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/listr2/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/listr2/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -13317,12 +13104,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, "node_modules/modify-values": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", @@ -13549,9 +13330,9 @@ } }, "node_modules/node-releases": { - "version": "1.1.72", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz", - "integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==" + "version": "1.1.73", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", + "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==" }, "node_modules/normalize-package-data": { "version": "3.0.2", @@ -13718,15 +13499,6 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -13901,15 +13673,14 @@ } }, "node_modules/object.values": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", - "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz", + "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "has": "^1.0.3" + "es-abstract": "^1.18.2" }, "engines": { "node": ">= 0.4" @@ -14242,9 +14013,9 @@ } }, "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-to-regexp": { @@ -14266,16 +14037,10 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "node_modules/picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "engines": { "node": ">=8.6" }, @@ -14535,14 +14300,14 @@ } }, "node_modules/postcss": { - "version": "8.2.15", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.15.tgz", - "integrity": "sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz", + "integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==", "dev": true, "dependencies": { "colorette": "^1.2.2", "nanoid": "^3.1.23", - "source-map": "^0.6.1" + "source-map-js": "^0.6.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -14630,15 +14395,6 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, - "node_modules/postcss/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -14649,9 +14405,9 @@ } }, "node_modules/prettier": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz", - "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.1.tgz", + "integrity": "sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -14746,11 +14502,11 @@ } }, "node_modules/proxy-addr": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", - "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "dependencies": { - "forwarded": "~0.1.2", + "forwarded": "0.2.0", "ipaddr.js": "1.9.1" }, "engines": { @@ -14803,24 +14559,24 @@ } }, "node_modules/puppeteer": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-9.1.1.tgz", - "integrity": "sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-10.0.0.tgz", + "integrity": "sha512-AxHvCb9IWmmP3gMW+epxdj92Gglii+6Z4sb+W+zc2hTTu10HF0yg6hGXot5O74uYkVqG3lfDRLfnRpi6WOwi5A==", "dev": true, "hasInstallScript": true, "dependencies": { - "debug": "^4.1.0", - "devtools-protocol": "0.0.869402", - "extract-zip": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", - "pkg-dir": "^4.2.0", - "progress": "^2.0.1", - "proxy-from-env": "^1.1.0", - "rimraf": "^3.0.2", - "tar-fs": "^2.0.0", - "unbzip2-stream": "^1.3.3", - "ws": "^7.2.3" + "debug": "4.3.1", + "devtools-protocol": "0.0.883894", + "extract-zip": "2.0.1", + "https-proxy-agent": "5.0.0", + "node-fetch": "2.6.1", + "pkg-dir": "4.2.0", + "progress": "2.0.1", + "proxy-from-env": "1.1.0", + "rimraf": "3.0.2", + "tar-fs": "2.0.0", + "unbzip2-stream": "1.3.3", + "ws": "7.4.6" }, "engines": { "node": ">=10.18.1" @@ -14890,6 +14646,15 @@ "node": ">=8" } }, + "node_modules/puppeteer/node_modules/progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -15403,115 +15168,6 @@ "node": ">=0.10.0" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dev": true, - "dependencies": { - "lodash": "^4.17.19" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "engines": { - "node": ">=0.12.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/request-promise-native/node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/request/node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -16381,6 +16037,7 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "bin": { "uuid": "bin/uuid" } @@ -16399,6 +16056,15 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", @@ -16462,9 +16128,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz", - "integrity": "sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", "dev": true }, "node_modules/spdy": { @@ -16586,31 +16252,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", @@ -16770,15 +16411,6 @@ "node": ">= 0.6" } }, - "node_modules/stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -17012,20 +16644,6 @@ "node": ">= 7.0.0" } }, - "node_modules/superagent/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/superagent/node_modules/mime": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", @@ -17165,9 +16783,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.4.0.tgz", - "integrity": "sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -17246,15 +16864,15 @@ } }, "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", + "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", "dev": true, "dependencies": { "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", + "mkdirp": "^0.5.1", "pump": "^3.0.0", - "tar-stream": "^2.1.4" + "tar-stream": "^2.0.0" } }, "node_modules/tar-stream": { @@ -17331,11 +16949,11 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.2.tgz", - "integrity": "sha512-6QhDaAiVHIQr5Ab3XUWZyDmrIPCHMiqJVljMF91YKyqwKkL5QHnYMkrMBy96v9Z7ev1hGhSEw1HQZc2p/s5Z8Q==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz", + "integrity": "sha512-cxGbMqr6+A2hrIB5ehFIF+F/iST5ZOxvOmy9zih9ySbP1C2oEWQSOUS+2SNBTjzx5xLKO4xnod9eywdfq1Nb9A==", "dependencies": { - "jest-worker": "^26.6.2", + "jest-worker": "^27.0.2", "p-limit": "^3.1.0", "schema-utils": "^3.0.0", "serialize-javascript": "^5.0.1", @@ -17358,6 +16976,27 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, + "node_modules/terser-webpack-plugin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/terser-webpack-plugin/node_modules/jest-worker": { + "version": "27.0.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.2.tgz", + "integrity": "sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg==", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, "node_modules/terser-webpack-plugin/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -17366,6 +17005,20 @@ "node": ">=0.10.0" } }, + "node_modules/terser-webpack-plugin/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/terser-webpack-plugin/node_modules/terser": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", @@ -17586,9 +17239,9 @@ } }, "node_modules/tr46": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", - "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", "dev": true, "dependencies": { "punycode": "^2.1.1" @@ -17598,9 +17251,9 @@ } }, "node_modules/trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true, "engines": { "node": ">=8" @@ -17654,24 +17307,6 @@ "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", "dev": true }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -17746,9 +17381,9 @@ } }, "node_modules/uglify-js": { - "version": "3.13.7", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.7.tgz", - "integrity": "sha512-1Psi2MmnZJbnEsgJJIlfnd7tFlJfitusmR7zDI8lXlFI0ACD4/Rm/xdrU8bh6zF0i74aiVoBtkRiFulkrmh3AA==", + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", "dev": true, "optional": true, "bin": { @@ -17774,9 +17409,9 @@ } }, "node_modules/unbzip2-stream": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", + "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", "dev": true, "dependencies": { "buffer": "^5.2.1", @@ -18089,20 +17724,6 @@ "node": ">= 0.8" } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -18208,15 +17829,15 @@ } }, "node_modules/webpack-cli": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.0.tgz", - "integrity": "sha512-7bKr9182/sGfjFm+xdZSwgQuFjgEcy0iCTIBxRUeteJ2Kr8/Wz0qNJX+jw60LU36jApt4nmMkep6+W5AKhok6g==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.1.tgz", + "integrity": "sha512-DJPd63AY53KXWOaD8cB8CaHR0epVP4O4GBIAk6wCPQHJugrAQ0B5kUkCg0c9vkIrD2kA6CXCmtWqKQsiVTo15A==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.0.3", - "@webpack-cli/info": "^1.2.4", - "@webpack-cli/serve": "^1.4.0", + "@webpack-cli/configtest": "^1.0.4", + "@webpack-cli/info": "^1.3.0", + "@webpack-cli/serve": "^1.5.0", "colorette": "^1.2.1", "commander": "^7.0.0", "execa": "^5.0.0", @@ -18305,9 +17926,9 @@ } }, "node_modules/webpack-merge": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", - "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", "dev": true, "dependencies": { "clone-deep": "^4.0.1", @@ -18732,16 +18353,16 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.3.tgz", - "integrity": "sha512-BnEfi5+6J2Lte9LeiL6TxLWdIlEv9Woacc1qXzXBgbikcOzMRM2Oya5XGg/f/ngotv1ej2A/b+3iJH8wbS1+lQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.4.tgz", + "integrity": "sha512-idr3pthFlDCpV+p/rMgGLGYIVtazeatrSOQk8YzO2pAepIjQhCN3myeihVg58ax2bbbGK9PUE1reFi7axOYIOw==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.12.13", "@babel/helper-function-name": "^7.14.2", "@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.14.3", + "@babel/helper-replace-supers": "^7.14.4", "@babel/helper-split-export-declaration": "^7.12.13" } }, @@ -18756,9 +18377,9 @@ } }, "@babel/helper-define-polyfill-provider": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz", - "integrity": "sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz", + "integrity": "sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew==", "dev": true, "requires": { "@babel/helper-compilation-targets": "^7.13.0", @@ -18956,9 +18577,9 @@ } }, "@babel/parser": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz", - "integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", "dev": true }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { @@ -20102,15 +19723,15 @@ "dev": true }, "@eslint/eslintrc": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", - "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", - "globals": "^12.1.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", @@ -20119,18 +19740,18 @@ }, "dependencies": { "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true } } @@ -20791,25 +20412,25 @@ } }, "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "requires": { - "@nodelib/fs.stat": "2.0.4", + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" }, "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", + "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", "requires": { - "@nodelib/fs.scandir": "2.1.4", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, @@ -20831,14 +20452,11 @@ "@sinonjs/commons": "^1.7.0" } }, - "@types/anymatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-3.0.0.tgz", - "integrity": "sha512-qLChUo6yhpQ9k905NwL74GU7TxH+9UODwwQ6ICNI+O6EDMExqH/Cv9NsbmcZ7yC/rRXJ/AHCzfgjsFRY5fKjYw==", - "dev": true, - "requires": { - "anymatch": "*" - } + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true }, "@types/babel__core": { "version": "7.1.14", @@ -20882,9 +20500,9 @@ } }, "@types/eslint": { - "version": "7.2.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz", - "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==", + "version": "7.2.13", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.13.tgz", + "integrity": "sha512-LKmQCWAlnVHvvXq4oasNUMTJJb2GwSyTY8+1C7OH5ILR8mPLaljv1jxL1bXW3xB3jFbQxTKxJAvI8PyjB09aBg==", "requires": { "@types/estree": "*", "@types/json-schema": "*" @@ -20943,9 +20561,9 @@ } }, "@types/istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { "@types/istanbul-lib-report": "*" @@ -20969,9 +20587,9 @@ "dev": true }, "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" + "version": "15.12.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.1.tgz", + "integrity": "sha512-zyxJM8I1c9q5sRMtVF+zdd13Jt6RU4r4qfhTd7lQubyThvLfx6yYekWSQjGCGV2Tkecgxnlpl/DNlb6Hg+dmEw==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -21032,19 +20650,29 @@ } }, "@types/webpack": { - "version": "4.41.28", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.28.tgz", - "integrity": "sha512-Nn84RAiJjKRfPFFCVR8LC4ueTtTdfWAMZ03THIzZWRJB+rX24BD3LqPSFnbMscWauEsT4segAsylPDIaZyZyLQ==", + "version": "4.41.29", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.29.tgz", + "integrity": "sha512-6pLaORaVNZxiB3FSHbyBiWM7QdazAWda1zvAq4SbZObZqHSDbWLi62iFdblVea6SK9eyBIVp5yHhKt/yNQdR7Q==", "dev": true, "requires": { - "@types/anymatch": "*", "@types/node": "*", "@types/tapable": "^1", "@types/uglify-js": "*", "@types/webpack-sources": "*", + "anymatch": "^3.0.0", "source-map": "^0.6.0" }, "dependencies": { + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -21229,25 +20857,25 @@ } }, "@webpack-cli/configtest": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", - "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.4.tgz", + "integrity": "sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ==", "dev": true, "requires": {} }, "@webpack-cli/info": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", - "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.3.0.tgz", + "integrity": "sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w==", "dev": true, "requires": { "envinfo": "^7.7.3" } }, "@webpack-cli/serve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", - "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.0.tgz", + "integrity": "sha512-AxpcbdkUhl4248H33LDFgXpFpDE5/BU9rHi2Oj8J4z8JldoMXoSmCe1DXDKcw1ClK64g6fY1Hg+dW20vH81JvQ==", "dev": true, "requires": {} }, @@ -21493,21 +21121,6 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -21553,18 +21166,6 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, "babel-jest": { "version": "26.6.3", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", @@ -21707,33 +21308,33 @@ } }, "babel-plugin-polyfill-corejs2": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz", - "integrity": "sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz", + "integrity": "sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==", "dev": true, "requires": { "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.0", + "@babel/helper-define-polyfill-provider": "^0.2.2", "semver": "^6.1.1" } }, "babel-plugin-polyfill-corejs3": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz", - "integrity": "sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.2.tgz", + "integrity": "sha512-l1Cf8PKk12eEk5QP/NQ6TH8A1pee6wWDJ96WjxrMXFLHLOBFzYM4moG80HFgduVhTqAFez4alnZKEhP/bYHg0A==", "dev": true, "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.0", + "@babel/helper-define-polyfill-provider": "^0.2.2", "core-js-compat": "^3.9.1" } }, "babel-plugin-polyfill-regenerator": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz", - "integrity": "sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz", + "integrity": "sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg==", "dev": true, "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.0" + "@babel/helper-define-polyfill-provider": "^0.2.2" } }, "babel-preset-current-node-syntax": { @@ -21808,15 +21409,6 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -22050,9 +21642,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001228", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz", - "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==" + "version": "1.0.30001235", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001235.tgz", + "integrity": "sha512-zWEwIVqnzPkSAXOUlQnPW2oKoYb2aLQ4Q5ejdjBcnH63rfypaW34CxaeBn1VMya2XaEU3P/R2qHpWyj+l0BT1A==" }, "capture-exit": { "version": "2.0.0", @@ -22063,12 +21655,6 @@ "rsvp": "^4.8.4" } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -22737,9 +22323,9 @@ "dev": true }, "core-js-compat": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.1.tgz", - "integrity": "sha512-i6h5qODpw6EsHAoIdQhKoZdWn+dGBF3dSS8m5tif36RlWvW3A6+yu2S16QHUo3CrkzrnEskMAt9f8FxmY9fhWQ==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.14.0.tgz", + "integrity": "sha512-R4NS2eupxtiJU+VwgkF9WTpnSfZW4pogwKHd8bclWU2sp93Pr5S1uYJI84cMOubJRou7bcfL0vmwtLslWN5p3A==", "dev": true, "requires": { "browserslist": "^4.16.6", @@ -22880,18 +22466,9 @@ }, "dargs": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", - "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", - "dev": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", + "dev": true }, "data-urls": { "version": "2.0.0", @@ -23055,9 +22632,9 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "detect-indent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true }, "detect-newline": { @@ -23072,9 +22649,9 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" }, "devtools-protocol": { - "version": "0.0.869402", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.869402.tgz", - "integrity": "sha512-VvlVYY+VDJe639yHs5PHISzdWTLL3Aw8rO4cvUtwvoxFd6FHbE4OpHHcde52M6096uYYazAmd4l0o5VuFRO2WA==", + "version": "0.0.883894", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.883894.tgz", + "integrity": "sha512-33idhm54QJzf3Q7QofMgCvIVSd2o9H3kQPWaKT/fhoZh+digc+WSiMhbkeG3iN79WY4Hwr9G05NpbhEVrsOYAg==", "dev": true }, "diff-sequences": { @@ -23097,9 +22674,9 @@ "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=" }, "dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", "requires": { "ip": "^1.1.0", "safe-buffer": "^5.0.1" @@ -23265,25 +22842,15 @@ } } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.732", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.732.tgz", - "integrity": "sha512-qKD5Pbq+QMk4nea4lMuncUMhpEiQwaJyCW7MrvissnRcBDENhVfDmAqQYRQ3X525oTzhar9Zh1cK0L2d1UKYcw==" + "version": "1.3.749", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.749.tgz", + "integrity": "sha512-F+v2zxZgw/fMwPz/VUGIggG4ZndDsYy0vlpthi3tjmDZlcfbhN5mYW0evXUsBr2sUtuDANFtle410A9u/sd/4A==" }, "emittery": { "version": "0.7.2", @@ -23374,9 +22941,9 @@ } }, "es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", + "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -23387,14 +22954,14 @@ "has-symbols": "^1.0.2", "is-callable": "^1.2.3", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.10.3", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" + "unbox-primitive": "^1.0.1" } }, "es-module-lexer": { @@ -23497,13 +23064,13 @@ } }, "eslint": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.27.0.tgz", - "integrity": "sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.1", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -23520,7 +23087,7 @@ "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", + "glob-parent": "^5.1.2", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", @@ -23602,9 +23169,9 @@ } }, "globals": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", - "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -23939,9 +23506,9 @@ "dev": true }, "execa": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.0.tgz", - "integrity": "sha512-CkdUB7s2y6S+d4y+OM/+ZtQcJCiKUCth4cNImGMqrt2zEVtW2rfHGspQBE1GDo6LjeNIQmTPKXqTCKjqFKyu3A==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "requires": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -24135,12 +23702,6 @@ } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", @@ -24200,12 +23761,6 @@ } } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -24304,9 +23859,9 @@ } }, "faye-websocket": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", - "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", "requires": { "websocket-driver": ">=0.5.1" } @@ -24509,20 +24064,14 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -24533,9 +24082,9 @@ "dev": true }, "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" }, "fragment-cache": { "version": "0.2.1", @@ -24873,15 +24422,6 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "git-raw-commits": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz", @@ -25051,22 +24591,6 @@ } } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -25280,6 +24804,17 @@ "requires-port": "^1.0.0" } }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, "http-proxy-middleware": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.0.tgz", @@ -25332,17 +24867,6 @@ } } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -25898,12 +25422,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "istanbul-lib-coverage": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", @@ -27738,6 +27256,7 @@ "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, "requires": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -27747,12 +27266,14 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -27775,20 +27296,14 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "jsdom": { - "version": "16.5.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.3.tgz", - "integrity": "sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA==", + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.6.0.tgz", + "integrity": "sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg==", "dev": true, "requires": { "abab": "^2.0.5", - "acorn": "^8.1.0", + "acorn": "^8.2.4", "acorn-globals": "^6.0.0", "cssom": "^0.4.4", "cssstyle": "^2.3.0", @@ -27796,12 +27311,13 @@ "decimal.js": "^10.2.1", "domexception": "^2.0.1", "escodegen": "^2.0.0", + "form-data": "^3.0.0", "html-encoding-sniffer": "^2.0.1", - "is-potential-custom-element-name": "^1.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.0", "parse5": "6.0.1", - "request": "^2.88.2", - "request-promise-native": "^1.0.9", "saxes": "^5.0.1", "symbol-tree": "^3.2.4", "tough-cookie": "^4.0.0", @@ -27811,7 +27327,7 @@ "whatwg-encoding": "^1.0.5", "whatwg-mimetype": "^2.3.0", "whatwg-url": "^8.5.0", - "ws": "^7.4.4", + "ws": "^7.4.5", "xml-name-validator": "^3.0.0" } }, @@ -27832,12 +27348,6 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -27896,18 +27406,6 @@ "through": ">=2.2.7 <3" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -28137,71 +27635,18 @@ } }, "listr2": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.8.2.tgz", - "integrity": "sha512-E28Fw7Zd3HQlCJKzb9a8C8M0HtFWQeucE+S8YrSrqZObuCLPRHMRrR8gNmYt65cU9orXYHwvN5agXC36lYt7VQ==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.9.0.tgz", + "integrity": "sha512-+JxQt7Vi4WEWgJsxmOEX9lDbCumrb3mrEYIeE1VI7I4lf2rXE4v9pq3RMVNp+a9s6mCgc/IsF0ppHsLrx2BEAw==", "dev": true, "requires": { - "chalk": "^4.1.1", "cli-truncate": "^2.1.0", - "figures": "^3.2.0", - "indent-string": "^4.0.0", + "colorette": "^1.2.2", "log-update": "^4.0.0", "p-map": "^4.0.0", "rxjs": "^6.6.7", "through": "^2.3.8", "wrap-ansi": "^7.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "load-json-file": { @@ -28853,12 +28298,6 @@ "minimist": "^1.2.5" } }, - "mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, "modify-values": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", @@ -29043,9 +28482,9 @@ } }, "node-releases": { - "version": "1.1.72", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz", - "integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==" + "version": "1.1.73", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", + "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==" }, "normalize-package-data": { "version": "3.0.2", @@ -29172,12 +28611,6 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -29305,15 +28738,14 @@ } }, "object.values": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", - "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz", + "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2", - "has": "^1.0.3" + "es-abstract": "^1.18.2" } }, "obuf": { @@ -29547,9 +28979,9 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-to-regexp": { @@ -29568,16 +29000,10 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" }, "pidtree": { "version": "0.3.1", @@ -29771,22 +29197,14 @@ "dev": true }, "postcss": { - "version": "8.2.15", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.15.tgz", - "integrity": "sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz", + "integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==", "dev": true, "requires": { "colorette": "^1.2.2", "nanoid": "^3.1.23", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "source-map-js": "^0.6.2" } }, "postcss-modules-extract-imports": { @@ -29848,9 +29266,9 @@ "dev": true }, "prettier": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz", - "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.1.tgz", + "integrity": "sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA==", "dev": true }, "pretty-error": { @@ -29923,11 +29341,11 @@ } }, "proxy-addr": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", - "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "requires": { - "forwarded": "~0.1.2", + "forwarded": "0.2.0", "ipaddr.js": "1.9.1" }, "dependencies": { @@ -29973,23 +29391,23 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "puppeteer": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-9.1.1.tgz", - "integrity": "sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-10.0.0.tgz", + "integrity": "sha512-AxHvCb9IWmmP3gMW+epxdj92Gglii+6Z4sb+W+zc2hTTu10HF0yg6hGXot5O74uYkVqG3lfDRLfnRpi6WOwi5A==", "dev": true, "requires": { - "debug": "^4.1.0", - "devtools-protocol": "0.0.869402", - "extract-zip": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", - "pkg-dir": "^4.2.0", - "progress": "^2.0.1", - "proxy-from-env": "^1.1.0", - "rimraf": "^3.0.2", - "tar-fs": "^2.0.0", - "unbzip2-stream": "^1.3.3", - "ws": "^7.2.3" + "debug": "4.3.1", + "devtools-protocol": "0.0.883894", + "extract-zip": "2.0.1", + "https-proxy-agent": "5.0.0", + "node-fetch": "2.6.1", + "pkg-dir": "4.2.0", + "progress": "2.0.1", + "proxy-from-env": "1.1.0", + "rimraf": "3.0.2", + "tar-fs": "2.0.0", + "unbzip2-stream": "1.3.3", + "ws": "7.4.6" }, "dependencies": { "find-up": { @@ -30037,6 +29455,12 @@ "requires": { "find-up": "^4.0.0" } + }, + "progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "dev": true } } }, @@ -30437,90 +29861,6 @@ "is-finite": "^1.0.0" } }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - } - } - }, - "request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dev": true, - "requires": { - "lodash": "^4.17.19" - } - }, - "request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "dev": true, - "requires": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "dependencies": { - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -31241,6 +30581,12 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true + }, "source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", @@ -31303,9 +30649,9 @@ } }, "spdx-license-ids": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz", - "integrity": "sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", "dev": true }, "spdy": { @@ -31412,23 +30758,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", @@ -31554,12 +30883,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -31733,17 +31056,6 @@ "semver": "^7.3.2" }, "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, "mime": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", @@ -31848,9 +31160,9 @@ }, "dependencies": { "ajv": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.4.0.tgz", - "integrity": "sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -31909,15 +31221,15 @@ "dev": true }, "tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", + "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", "dev": true, "requires": { "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", + "mkdirp": "^0.5.1", "pump": "^3.0.0", - "tar-stream": "^2.1.4" + "tar-stream": "^2.0.0" } }, "tar-stream": { @@ -31992,11 +31304,11 @@ } }, "terser-webpack-plugin": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.2.tgz", - "integrity": "sha512-6QhDaAiVHIQr5Ab3XUWZyDmrIPCHMiqJVljMF91YKyqwKkL5QHnYMkrMBy96v9Z7ev1hGhSEw1HQZc2p/s5Z8Q==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz", + "integrity": "sha512-cxGbMqr6+A2hrIB5ehFIF+F/iST5ZOxvOmy9zih9ySbP1C2oEWQSOUS+2SNBTjzx5xLKO4xnod9eywdfq1Nb9A==", "requires": { - "jest-worker": "^26.6.2", + "jest-worker": "^27.0.2", "p-limit": "^3.1.0", "schema-utils": "^3.0.0", "serialize-javascript": "^5.0.1", @@ -32009,11 +31321,34 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "jest-worker": { + "version": "27.0.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.2.tgz", + "integrity": "sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg==", + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "requires": { + "has-flag": "^4.0.0" + } + }, "terser": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", @@ -32184,18 +31519,18 @@ } }, "tr46": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", - "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", "dev": true, "requires": { "punycode": "^2.1.1" } }, "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true }, "trim-off-newlines": { @@ -32239,21 +31574,6 @@ "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -32306,9 +31626,9 @@ "dev": true }, "uglify-js": { - "version": "3.13.7", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.7.tgz", - "integrity": "sha512-1Psi2MmnZJbnEsgJJIlfnd7tFlJfitusmR7zDI8lXlFI0ACD4/Rm/xdrU8bh6zF0i74aiVoBtkRiFulkrmh3AA==", + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", "dev": true, "optional": true }, @@ -32325,9 +31645,9 @@ } }, "unbzip2-stream": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", + "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", "dev": true, "requires": { "buffer": "^5.2.1", @@ -32575,17 +31895,6 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -32674,15 +31983,15 @@ } }, "webpack-cli": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.0.tgz", - "integrity": "sha512-7bKr9182/sGfjFm+xdZSwgQuFjgEcy0iCTIBxRUeteJ2Kr8/Wz0qNJX+jw60LU36jApt4nmMkep6+W5AKhok6g==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.1.tgz", + "integrity": "sha512-DJPd63AY53KXWOaD8cB8CaHR0epVP4O4GBIAk6wCPQHJugrAQ0B5kUkCg0c9vkIrD2kA6CXCmtWqKQsiVTo15A==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.0.3", - "@webpack-cli/info": "^1.2.4", - "@webpack-cli/serve": "^1.4.0", + "@webpack-cli/configtest": "^1.0.4", + "@webpack-cli/info": "^1.3.0", + "@webpack-cli/serve": "^1.5.0", "colorette": "^1.2.1", "commander": "^7.0.0", "execa": "^5.0.0", @@ -32731,9 +32040,9 @@ } }, "webpack-merge": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", - "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", "dev": true, "requires": { "clone-deep": "^4.0.1", diff --git a/package.json b/package.json index d2cc670bac..40e9344f78 100644 --- a/package.json +++ b/package.json @@ -75,11 +75,11 @@ "body-parser": "^1.19.0", "core-js": "^3.12.1", "css-loader": "^5.2.4", - "eslint": "^7.26.0", + "eslint": "^7.28.0", "eslint-config-prettier": "^8.3.0", "eslint-config-webpack": "^1.2.5", "eslint-plugin-import": "^2.23.2", - "execa": "^5.0.0", + "execa": "^5.1.1", "file-loader": "^6.2.0", "html-webpack-plugin": "^4.5.2", "husky": "^6.0.0", @@ -91,8 +91,8 @@ "marked": "^2.0.3", "memfs": "^3.2.2", "npm-run-all": "^4.1.5", - "prettier": "^2.2.1", - "puppeteer": "^9.1.1", + "prettier": "^2.3.1", + "puppeteer": "^10.0.0", "require-from-string": "^2.0.2", "rimraf": "^3.0.2", "sockjs-client": "^1.5.1", @@ -103,8 +103,8 @@ "typescript": "^4.2.4", "url-loader": "^4.1.1", "webpack": "^5.37.1", - "webpack-cli": "^4.7.0", - "webpack-merge": "^5.7.3" + "webpack-cli": "^4.7.1", + "webpack-merge": "^5.8.0" }, "peerDependencies": { "webpack": "^4.0.0 || ^5.0.0" From 7501b2401777520ad2747b0ae8d44eb2f0519c63 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Jun 2021 16:30:44 +0300 Subject: [PATCH 10/14] test: update --- bin/process-arguments.js | 97 ++++++++++++++++--- jest.config.js | 1 + .../validate-options.test.js.snap.webpack4 | 63 ++++++------ .../validate-options.test.js.snap.webpack5 | 63 ++++++------ test/validate-options.test.js | 3 +- 5 files changed, 147 insertions(+), 80 deletions(-) diff --git a/bin/process-arguments.js b/bin/process-arguments.js index fea928e0d1..a87c1b04f0 100644 --- a/bin/process-arguments.js +++ b/bin/process-arguments.js @@ -8,15 +8,20 @@ const path = require('path'); const cliAddedItems = new WeakMap(); const getObjectAndProperty = (config, schemaPath, index = 0) => { - if (!schemaPath) return { value: config }; + if (!schemaPath) { + return { value: config }; + } + const parts = schemaPath.split('.'); const property = parts.pop(); let current = config; let i = 0; + for (const part of parts) { const isArray = part.endsWith('[]'); const name = isArray ? part.slice(0, -2) : part; let value = current[name]; + if (isArray) { // eslint-disable-next-line no-undefined if (value === undefined) { @@ -32,14 +37,18 @@ const getObjectAndProperty = (config, schemaPath, index = 0) => { }; } else { let addedItems = cliAddedItems.get(value) || 0; + while (addedItems <= index) { // eslint-disable-next-line no-undefined value.push(undefined); // eslint-disable-next-line no-plusplus addedItems++; } + cliAddedItems.set(value, addedItems); + const x = value.length - addedItems + index; + // eslint-disable-next-line no-undefined if (value[x] === undefined) { value[x] = {}; @@ -51,6 +60,7 @@ const getObjectAndProperty = (config, schemaPath, index = 0) => { }, }; } + value = value[x]; } // eslint-disable-next-line no-undefined @@ -65,37 +75,49 @@ const getObjectAndProperty = (config, schemaPath, index = 0) => { }, }; } + current = value; // eslint-disable-next-line no-plusplus i++; } + const value = current[property]; + if (property.endsWith('[]')) { const name = property.slice(0, -2); + // eslint-disable-next-line no-shadow const value = current[name]; + // eslint-disable-next-line no-undefined if (value === undefined) { // eslint-disable-next-line no-undefined current[name] = [...Array.from({ length: index }), undefined]; cliAddedItems.set(current[name], index + 1); + // eslint-disable-next-line no-undefined return { object: current[name], property: index, value: undefined }; } else if (!Array.isArray(value)) { // eslint-disable-next-line no-undefined current[name] = [value, ...Array.from({ length: index }), undefined]; cliAddedItems.set(current[name], index + 1); + // eslint-disable-next-line no-undefined return { object: current[name], property: index + 1, value: undefined }; } + let addedItems = cliAddedItems.get(value) || 0; + while (addedItems <= index) { // eslint-disable-next-line no-undefined value.push(undefined); // eslint-disable-next-line no-plusplus addedItems++; } + cliAddedItems.set(value, addedItems); + const x = value.length - addedItems + index; + // eslint-disable-next-line no-undefined if (value[x] === undefined) { value[x] = {}; @@ -107,12 +129,14 @@ const getObjectAndProperty = (config, schemaPath, index = 0) => { }, }; } + return { object: value, property: x, value: value[x], }; } + return { object: current, property, value }; }; @@ -130,35 +154,60 @@ const parseValueForArgumentConfig = (argConfig, value) => { } break; case 'number': - if (typeof value === 'number') return value; + if (typeof value === 'number') { + return value; + } + if (typeof value === 'string' && /^[+-]?\d*(\.\d*)[eE]\d+$/) { const n = +value; if (!isNaN(n)) return n; } + break; case 'boolean': - if (typeof value === 'boolean') return value; - if (value === 'true') return true; - if (value === 'false') return false; + if (typeof value === 'boolean') { + return value; + } + + if (value === 'true') { + return true; + } + + if (value === 'false') { + return false; + } + break; case 'RegExp': - if (value instanceof RegExp) return value; + if (value instanceof RegExp) { + return value; + } + if (typeof value === 'string') { // cspell:word yugi const match = /^\/(.*)\/([yugi]*)$/.exec(value); + if (match && !/[^\\]\//.test(match[1])) { return new RegExp(match[1], match[2]); } } + break; case 'enum': - if (argConfig.values.includes(value)) return value; + if (argConfig.values.includes(value)) { + return value; + } + for (const item of argConfig.values) { if (`${item}` === value) return item; } + break; case 'reset': - if (value === true) return []; + if (value === true) { + return []; + } + break; } }; @@ -184,8 +233,13 @@ const setValue = (config, schemaPath, value, index) => { schemaPath, index ); - if (problem) return problem; + + if (problem) { + return problem; + } + object[property] = value; + return null; }; @@ -197,7 +251,9 @@ const processArgumentConfig = (argConfig, config, value, index) => { path: argConfig.path, }; } + const parsed = parseValueForArgumentConfig(argConfig, value); + // eslint-disable-next-line no-undefined if (parsed === undefined) { return { @@ -206,31 +262,43 @@ const processArgumentConfig = (argConfig, config, value, index) => { expected: getExpectedValue(argConfig), }; } + const problem = setValue(config, argConfig.path, parsed, index); - if (problem) return problem; + + if (problem) { + return problem; + } + return null; }; const processArguments = (args, config, values) => { const problems = []; + for (const key of Object.keys(values)) { const arg = args[key]; + if (!arg) { problems.push({ type: 'unknown-argument', path: '', argument: key, }); + // eslint-disable-next-line no-continue continue; } + const processValue = (value, i) => { const currentProblems = []; + for (const argConfig of arg.configs) { const problem = processArgumentConfig(argConfig, config, value, i); + if (!problem) { return; } + currentProblems.push({ ...problem, argument: key, @@ -238,9 +306,12 @@ const processArguments = (args, config, values) => { index: i, }); } + problems.push(...currentProblems); }; + const value = values[key]; + if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { processValue(value[i], i); @@ -250,7 +321,11 @@ const processArguments = (args, config, values) => { processValue(value, undefined); } } - if (problems.length === 0) return null; + + if (problems.length === 0) { + return null; + } + return problems; }; diff --git a/jest.config.js b/jest.config.js index 98698d00cc..e1045830f9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,6 +8,7 @@ module.exports = { '/test/', '/client/', ], + testPathIgnorePatterns: ['/bin/this/process-arguments.js'], moduleFileExtensions: ['js', 'json'], testMatch: ['**/test/**/*.test.js'], snapshotResolver: '/test/helpers/snapshotResolver.js', diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack4 b/test/__snapshots__/validate-options.test.js.snap.webpack4 index 6248ebf5a1..0bffe50853 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack4 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack4 @@ -3,40 +3,40 @@ exports[`options validate should throw an error on the "allowedHosts" option with '123' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.allowedHosts should be one of these: - \\"auto\\" | \\"all\\" | non-empty string | [non-empty string, ...] (should not have fewer than 1 item) + [non-empty string, ...] (should not have fewer than 1 item) | \\"auto\\" | \\"all\\" | non-empty string -> Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts Details: + * configuration.allowedHosts should be an array: + [non-empty string, ...] (should not have fewer than 1 item) * configuration.allowedHosts should be one of these: \\"auto\\" | \\"all\\" - * configuration.allowedHosts should be a non-empty string. - * configuration.allowedHosts should be an array: - [non-empty string, ...] (should not have fewer than 1 item)" + * configuration.allowedHosts should be a non-empty string." `; exports[`options validate should throw an error on the "allowedHosts" option with 'false' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.allowedHosts should be one of these: - \\"auto\\" | \\"all\\" | non-empty string | [non-empty string, ...] (should not have fewer than 1 item) + [non-empty string, ...] (should not have fewer than 1 item) | \\"auto\\" | \\"all\\" | non-empty string -> Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts Details: + * configuration.allowedHosts should be an array: + [non-empty string, ...] (should not have fewer than 1 item) * configuration.allowedHosts should be one of these: \\"auto\\" | \\"all\\" - * configuration.allowedHosts should be a non-empty string. - * configuration.allowedHosts should be an array: - [non-empty string, ...] (should not have fewer than 1 item)" + * configuration.allowedHosts should be a non-empty string." `; exports[`options validate should throw an error on the "allowedHosts" option with 'true' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.allowedHosts should be one of these: - \\"auto\\" | \\"all\\" | non-empty string | [non-empty string, ...] (should not have fewer than 1 item) + [non-empty string, ...] (should not have fewer than 1 item) | \\"auto\\" | \\"all\\" | non-empty string -> Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts Details: + * configuration.allowedHosts should be an array: + [non-empty string, ...] (should not have fewer than 1 item) * configuration.allowedHosts should be one of these: \\"auto\\" | \\"all\\" - * configuration.allowedHosts should be a non-empty string. - * configuration.allowedHosts should be an array: - [non-empty string, ...] (should not have fewer than 1 item)" + * configuration.allowedHosts should be a non-empty string." `; exports[`options validate should throw an error on the "bonjour" option with '' value 1`] = ` @@ -373,15 +373,10 @@ exports[`options validate should throw an error on the "open" option with '' val - configuration.open should be an non-empty string." `; -exports[`options validate should throw an error on the "open" option with '[]' value 1`] = ` -"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - - configuration.open should be an non-empty array." -`; - exports[`options validate should throw an error on the "open" option with '{"app":true}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.open should be one of these: - [non-empty string | object { target?, app? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { target?, app? } + [non-empty string | object { target?, app? }, ...] | boolean | non-empty string | object { target?, app? } -> Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen Details: * configuration.open.app should be one of these: @@ -402,7 +397,7 @@ exports[`options validate should throw an error on the "open" option with '{"foo exports[`options validate should throw an error on the "open" option with '{"target":90}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.open should be one of these: - [non-empty string | object { target?, app? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { target?, app? } + [non-empty string | object { target?, app? }, ...] | boolean | non-empty string | object { target?, app? } -> Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen Details: * configuration.open.target should be one of these: @@ -485,7 +480,7 @@ exports[`options validate should throw an error on the "static" option with '{"d exports[`options validate should throw an error on the "static" option with '{"publicPath":false}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.publicPath should be one of these: @@ -500,7 +495,7 @@ exports[`options validate should throw an error on the "static" option with '{"p exports[`options validate should throw an error on the "static" option with '{"serveIndex":"true"}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.serveIndex should be one of these: @@ -515,7 +510,7 @@ exports[`options validate should throw an error on the "static" option with '{"s exports[`options validate should throw an error on the "static" option with '{"watch":10}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.watch should be one of these: @@ -531,55 +526,55 @@ exports[`options validate should throw an error on the "static" option with '{"w exports[`options validate should throw an error on the "static" option with '0' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "static" option with 'null' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "watchFiles" option with '123' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.watchFiles should be one of these: - [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? } + [non-empty string | object { paths, options? }, ...] | non-empty string | object { paths, options? } -> List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles Details: * configuration.watchFiles should be an array: - [non-empty string | object { paths?, options? }, ...] + [non-empty string | object { paths, options? }, ...] * configuration.watchFiles should be a non-empty string. * configuration.watchFiles should be an object: - object { paths?, options? }" + object { paths, options? }" `; exports[`options validate should throw an error on the "watchFiles" option with 'false' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.watchFiles should be one of these: - [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? } + [non-empty string | object { paths, options? }, ...] | non-empty string | object { paths, options? } -> List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles Details: * configuration.watchFiles should be an array: - [non-empty string | object { paths?, options? }, ...] + [non-empty string | object { paths, options? }, ...] * configuration.watchFiles should be a non-empty string. * configuration.watchFiles should be an object: - object { paths?, options? }" + object { paths, options? }" `; exports[`options validate should throw an error on the "webSocketServer" option with '{"notAnOption":true}' value 1`] = ` diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack5 b/test/__snapshots__/validate-options.test.js.snap.webpack5 index 6248ebf5a1..0bffe50853 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack5 @@ -3,40 +3,40 @@ exports[`options validate should throw an error on the "allowedHosts" option with '123' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.allowedHosts should be one of these: - \\"auto\\" | \\"all\\" | non-empty string | [non-empty string, ...] (should not have fewer than 1 item) + [non-empty string, ...] (should not have fewer than 1 item) | \\"auto\\" | \\"all\\" | non-empty string -> Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts Details: + * configuration.allowedHosts should be an array: + [non-empty string, ...] (should not have fewer than 1 item) * configuration.allowedHosts should be one of these: \\"auto\\" | \\"all\\" - * configuration.allowedHosts should be a non-empty string. - * configuration.allowedHosts should be an array: - [non-empty string, ...] (should not have fewer than 1 item)" + * configuration.allowedHosts should be a non-empty string." `; exports[`options validate should throw an error on the "allowedHosts" option with 'false' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.allowedHosts should be one of these: - \\"auto\\" | \\"all\\" | non-empty string | [non-empty string, ...] (should not have fewer than 1 item) + [non-empty string, ...] (should not have fewer than 1 item) | \\"auto\\" | \\"all\\" | non-empty string -> Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts Details: + * configuration.allowedHosts should be an array: + [non-empty string, ...] (should not have fewer than 1 item) * configuration.allowedHosts should be one of these: \\"auto\\" | \\"all\\" - * configuration.allowedHosts should be a non-empty string. - * configuration.allowedHosts should be an array: - [non-empty string, ...] (should not have fewer than 1 item)" + * configuration.allowedHosts should be a non-empty string." `; exports[`options validate should throw an error on the "allowedHosts" option with 'true' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.allowedHosts should be one of these: - \\"auto\\" | \\"all\\" | non-empty string | [non-empty string, ...] (should not have fewer than 1 item) + [non-empty string, ...] (should not have fewer than 1 item) | \\"auto\\" | \\"all\\" | non-empty string -> Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts Details: + * configuration.allowedHosts should be an array: + [non-empty string, ...] (should not have fewer than 1 item) * configuration.allowedHosts should be one of these: \\"auto\\" | \\"all\\" - * configuration.allowedHosts should be a non-empty string. - * configuration.allowedHosts should be an array: - [non-empty string, ...] (should not have fewer than 1 item)" + * configuration.allowedHosts should be a non-empty string." `; exports[`options validate should throw an error on the "bonjour" option with '' value 1`] = ` @@ -373,15 +373,10 @@ exports[`options validate should throw an error on the "open" option with '' val - configuration.open should be an non-empty string." `; -exports[`options validate should throw an error on the "open" option with '[]' value 1`] = ` -"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - - configuration.open should be an non-empty array." -`; - exports[`options validate should throw an error on the "open" option with '{"app":true}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.open should be one of these: - [non-empty string | object { target?, app? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { target?, app? } + [non-empty string | object { target?, app? }, ...] | boolean | non-empty string | object { target?, app? } -> Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen Details: * configuration.open.app should be one of these: @@ -402,7 +397,7 @@ exports[`options validate should throw an error on the "open" option with '{"foo exports[`options validate should throw an error on the "open" option with '{"target":90}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.open should be one of these: - [non-empty string | object { target?, app? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { target?, app? } + [non-empty string | object { target?, app? }, ...] | boolean | non-empty string | object { target?, app? } -> Tells dev-server to open the browser after server had been started. Set it to true to open your default browser. https://webpack.js.org/configuration/dev-server/#devserveropen Details: * configuration.open.target should be one of these: @@ -485,7 +480,7 @@ exports[`options validate should throw an error on the "static" option with '{"d exports[`options validate should throw an error on the "static" option with '{"publicPath":false}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.publicPath should be one of these: @@ -500,7 +495,7 @@ exports[`options validate should throw an error on the "static" option with '{"p exports[`options validate should throw an error on the "static" option with '{"serveIndex":"true"}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.serveIndex should be one of these: @@ -515,7 +510,7 @@ exports[`options validate should throw an error on the "static" option with '{"s exports[`options validate should throw an error on the "static" option with '{"watch":10}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.watch should be one of these: @@ -531,55 +526,55 @@ exports[`options validate should throw an error on the "static" option with '{"w exports[`options validate should throw an error on the "static" option with '0' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "static" option with 'null' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) + [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "watchFiles" option with '123' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.watchFiles should be one of these: - [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? } + [non-empty string | object { paths, options? }, ...] | non-empty string | object { paths, options? } -> List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles Details: * configuration.watchFiles should be an array: - [non-empty string | object { paths?, options? }, ...] + [non-empty string | object { paths, options? }, ...] * configuration.watchFiles should be a non-empty string. * configuration.watchFiles should be an object: - object { paths?, options? }" + object { paths, options? }" `; exports[`options validate should throw an error on the "watchFiles" option with 'false' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.watchFiles should be one of these: - [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? } + [non-empty string | object { paths, options? }, ...] | non-empty string | object { paths, options? } -> List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles Details: * configuration.watchFiles should be an array: - [non-empty string | object { paths?, options? }, ...] + [non-empty string | object { paths, options? }, ...] * configuration.watchFiles should be a non-empty string. * configuration.watchFiles should be an object: - object { paths?, options? }" + object { paths, options? }" `; exports[`options validate should throw an error on the "webSocketServer" option with '{"notAnOption":true}' value 1`] = ` diff --git a/test/validate-options.test.js b/test/validate-options.test.js index c6e37b72c2..d2d4e7d472 100644 --- a/test/validate-options.test.js +++ b/test/validate-options.test.js @@ -242,6 +242,7 @@ const tests = { success: [ true, 'foo', + [], ['foo', 'bar'], { target: true }, { target: 'foo' }, @@ -255,7 +256,7 @@ const tests = { }, {}, ], - failure: ['', [], { foo: 'bar' }, { target: 90 }, { app: true }], + failure: ['', { foo: 'bar' }, { target: 90 }, { app: true }], }, port: { success: ['8080', 8080, 'auto'], From 42f2d91d3aeaf7c1fbe799e938616df8c926c954 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Jun 2021 17:07:14 +0300 Subject: [PATCH 11/14] test: update --- bin/cli-flags.js | 57 ------------ lib/options.json | 3 +- .../__snapshots__/cli.test.js.snap.webpack4 | 35 +------- .../__snapshots__/cli.test.js.snap.webpack5 | 35 +------- test/cli/cli.test.js | 90 +++---------------- 5 files changed, 19 insertions(+), 201 deletions(-) diff --git a/bin/cli-flags.js b/bin/cli-flags.js index fa84227e7c..603707b11c 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -295,26 +295,6 @@ module.exports = { simpleType: 'string', multiple: false, }, - 'web-socket-server-type': { - configs: [ - { - type: 'enum', - values: ['sockjs', 'ws'], - multiple: false, - description: 'Allows to set web socket server and options.', - path: 'webSocketServer.type', - }, - { - type: 'string', - multiple: false, - description: 'Allows to set web socket server and options.', - path: 'webSocketServer.type', - }, - ], - description: 'Allows to set web socket server and options.', - simpleType: 'string', - multiple: false, - }, compress: { configs: [ { @@ -799,28 +779,6 @@ module.exports = { simpleType: 'string', multiple: true, }, - 'watch-files-paths': { - configs: [ - { - type: 'string', - multiple: true, - description: - 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', - path: 'watchFiles[].paths', - }, - { - type: 'string', - multiple: true, - description: - 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', - path: 'watchFiles.paths[]', - }, - ], - description: - 'List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', - simpleType: 'string', - multiple: true, - }, 'watch-files-reset': { configs: [ { @@ -836,19 +794,4 @@ module.exports = { simpleType: 'boolean', multiple: false, }, - 'watch-files-paths-reset': { - configs: [ - { - type: 'reset', - multiple: false, - description: - 'Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', - path: 'watchFiles.paths', - }, - ], - description: - 'Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles', - simpleType: 'boolean', - multiple: false, - }, }; diff --git a/lib/options.json b/lib/options.json index cbe1b0a4c9..3ab6174777 100644 --- a/lib/options.json +++ b/lib/options.json @@ -55,8 +55,7 @@ ], "description": "Watch for files in static content directory." } - }, - "required": ["directory"] + } }, "StaticString": { "type": "string", diff --git a/test/cli/__snapshots__/cli.test.js.snap.webpack4 b/test/cli/__snapshots__/cli.test.js.snap.webpack4 index 793bcdcb53..d3c1bb5c38 100644 --- a/test/cli/__snapshots__/cli.test.js.snap.webpack4 +++ b/test/cli/__snapshots__/cli.test.js.snap.webpack4 @@ -74,7 +74,6 @@ Options: --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. --web-socket-server Allows to set web socket server and options. - --web-socket-server-type Allows to set web socket server and options. --compress Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress --no-compress Disable gzip compression. --history-api-fallback When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback @@ -116,9 +115,7 @@ Options: --static-reset Clear all items provided in configuration. It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic --static-public-path-reset Clear all items provided in configuration. The bundled files will be available in the browser under this path. --watch-files List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles - --watch-files-paths List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles --watch-files-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles - --watch-files-paths-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles Global options: --color Enable colors on console. @@ -336,7 +333,7 @@ exports[`CLI static option --static : stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from 'new-static' directory" `; -exports[`CLI static option --static --static-directory: stderr 1`] = ` +exports[`CLI static option --static: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -344,15 +341,15 @@ exports[`CLI static option --static --static-directory: stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI static option --static: stderr 1`] = ` +exports[`CLI static option --static-directory: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from 'static-dir' directory" `; -exports[`CLI static option --static-directory: stderr 1`] = ` +exports[`CLI static option --static-directory: stderr 2`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -424,30 +421,6 @@ exports[`CLI watchFiles option --watch-files : stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI watchFiles option --watch-files-paths: stderr 1`] = ` -" [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" -`; - -exports[`CLI watchFiles option --watch-files-paths-reset: stderr 1`] = ` -" [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" -`; - -exports[`CLI watchFiles option --watch-files-reset --watch-files-paths : stderr 1`] = ` -" [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" -`; - exports[`CLI watchFiles option --watch-files-reset: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ diff --git a/test/cli/__snapshots__/cli.test.js.snap.webpack5 b/test/cli/__snapshots__/cli.test.js.snap.webpack5 index d7532a0241..0c2bb91317 100644 --- a/test/cli/__snapshots__/cli.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/cli.test.js.snap.webpack5 @@ -73,7 +73,6 @@ Options: --client-web-socket-url-port Tells clients connected to devServer to use the provided port. --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. --web-socket-server Allows to set web socket server and options. - --web-socket-server-type Allows to set web socket server and options. --compress Enable gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress --no-compress Negative 'compress' option. --allowed-hosts Defines routes which are enabled by default, on by default and allows localhost/value from the 'host' option/value from the 'client.webSocketURL' option. https://webpack.js.org/configuration/dev-server/#devserverallowedhosts @@ -117,9 +116,7 @@ Options: --static-reset Clear all items provided in configuration. It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic --static-public-path-reset Clear all items provided in configuration. The bundled files will be available in the browser under this path. --watch-files List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles - --watch-files-paths List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles --watch-files-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles - --watch-files-paths-reset Clear all items provided in configuration. List of files to watch for file changes and serve. https://webpack.js.org/configuration/dev-server/#devserverwatchfiles Global options: --color Enable colors on console. @@ -337,7 +334,7 @@ exports[`CLI static option --static : stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from 'new-static' directory" `; -exports[`CLI static option --static --static-directory: stderr 1`] = ` +exports[`CLI static option --static: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -345,15 +342,15 @@ exports[`CLI static option --static --static-directory: stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI static option --static: stderr 1`] = ` +exports[`CLI static option --static-directory: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from 'static-dir' directory" `; -exports[`CLI static option --static-directory: stderr 1`] = ` +exports[`CLI static option --static-directory: stderr 2`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ [webpack-dev-server] On Your Network (IPv4): http://:/ @@ -425,30 +422,6 @@ exports[`CLI watchFiles option --watch-files : stderr 1`] = ` [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`CLI watchFiles option --watch-files-paths: stderr 1`] = ` -" [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" -`; - -exports[`CLI watchFiles option --watch-files-paths-reset: stderr 1`] = ` -" [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" -`; - -exports[`CLI watchFiles option --watch-files-reset --watch-files-paths : stderr 1`] = ` -" [webpack-dev-server] Project is running at: - [webpack-dev-server] Loopback: http://localhost:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" -`; - exports[`CLI watchFiles option --watch-files-reset: stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:/ diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index ce2660f8c8..43ea13ee14 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -28,7 +28,6 @@ describe('CLI', () => { const normalizedCliOptions = {}; for (const [name, options] of Object.entries(cliOptions)) { - delete options.processor; // Only webpack-cli supports it // TODO send PR to webpack delete options.negatedDescription; @@ -401,24 +400,6 @@ describe('CLI', () => { }) .catch(done); }); - - it('--web-socket-server-type sockjs', (done) => { - testBin('--web-socket-server-type sockjs') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); - - it('--web-socket-server-type ws', (done) => { - testBin('--web-socket-server-type ws') - .then((output) => { - expect(output.exitCode).toEqual(0); - done(); - }) - .catch(done); - }); }); describe('http2 option', () => { @@ -492,7 +473,7 @@ describe('CLI', () => { const passphrase = 'webpack-dev-server'; testBin( - `--https --https-key ${key} --https-pfx ${pfxFile} --https-passphrase ${passphrase} --https-cert ${cert}` + `--https-key ${key} --https-pfx ${pfxFile} --https-passphrase ${passphrase} --https-cert ${cert}` ) .then((output) => { expect(output.exitCode).toEqual(0); @@ -889,8 +870,8 @@ describe('CLI', () => { .catch(done); }); - it(' --open --open-target index.html', (done) => { - testBin('--open --open-target index.html') + it('--open-target index.html', (done) => { + testBin('--open-target index.html') .then((output) => { expect(output.exitCode).toEqual(0); done(); @@ -925,8 +906,8 @@ describe('CLI', () => { .catch(done); }); - it('--open --open-target /index.html --open-app google-chrome', (done) => { - testBin('--open --open-target /index.html --open-app google-chrome') + it('--open-target /index.html --open-app google-chrome', (done) => { + testBin('--open-target /index.html --open-app google-chrome') .then((output) => { expect(output.exitCode).toEqual(0); done(); @@ -934,9 +915,9 @@ describe('CLI', () => { .catch(done); }); - it('--open --open-target /index.html --open-app google-chrome --open-app-name google-chrome', (done) => { + it('--open-target /index.html --open-app google-chrome --open-app-name google-chrome', (done) => { testBin( - '--open --open-target /index.html --open-app google-chrome --open-app-name google-chrome' + '--open-target /index.html --open-app google-chrome --open-app-name google-chrome' ) .then((output) => { expect(output.exitCode).toEqual(0); @@ -1039,8 +1020,8 @@ describe('CLI', () => { .catch(done); }); - it('--static --static-directory', (done) => { - testBin('--static --static-directory static-dir') + it('--static-directory', (done) => { + testBin('--static-directory static-dir') .then((output) => { expect(output.exitCode).toEqual(0); expect( @@ -1112,7 +1093,7 @@ describe('CLI', () => { }); it('--no-static-watch', (done) => { - testBin('--static-watch') + testBin('--no-static-watch') .then((output) => { expect(output.exitCode).toEqual(0); expect( @@ -1181,57 +1162,6 @@ describe('CLI', () => { }) .catch(done); }); - - it('--watch-files-reset --watch-files-paths ', (done) => { - const watchDirectory = path.resolve( - __dirname, - '../fixtures/static/static' - ); - - testBin(`--watch-files-reset --watch-files-paths ${watchDirectory}`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); - - it('--watch-files-paths', (done) => { - const watchDirectory = path.resolve( - __dirname, - '../fixtures/static/static' - ); - - testBin(`--watch-files-paths ${watchDirectory}`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); - - it('--watch-files-paths-reset', (done) => { - const watchDirectory = path.resolve( - __dirname, - '../fixtures/static/static' - ); - - testBin(`--watch-files-paths-reset --watch-files-paths ${watchDirectory}`) - .then((output) => { - expect(output.exitCode).toEqual(0); - expect( - normalizeStderr(output.stderr, { ipv6: true }) - ).toMatchSnapshot('stderr'); - done(); - }) - .catch(done); - }); }); it('should accept the promise function of webpack.config.js', (done) => { From f4a118697dfdc2f80cbd14659e067b3e7d16f7e4 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Jun 2021 17:19:32 +0300 Subject: [PATCH 12/14] test: update snapshots --- .../validate-options.test.js.snap.webpack4 | 18 +++++++++--------- .../validate-options.test.js.snap.webpack5 | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack4 b/test/__snapshots__/validate-options.test.js.snap.webpack4 index 0bffe50853..ecb1e8c490 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack4 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack4 @@ -480,7 +480,7 @@ exports[`options validate should throw an error on the "static" option with '{"d exports[`options validate should throw an error on the "static" option with '{"publicPath":false}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.publicPath should be one of these: @@ -495,7 +495,7 @@ exports[`options validate should throw an error on the "static" option with '{"p exports[`options validate should throw an error on the "static" option with '{"serveIndex":"true"}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.serveIndex should be one of these: @@ -510,7 +510,7 @@ exports[`options validate should throw an error on the "static" option with '{"s exports[`options validate should throw an error on the "static" option with '{"watch":10}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.watch should be one of these: @@ -526,29 +526,29 @@ exports[`options validate should throw an error on the "static" option with '{"w exports[`options validate should throw an error on the "static" option with '0' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "static" option with 'null' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "watchFiles" option with '123' value 1`] = ` diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack5 b/test/__snapshots__/validate-options.test.js.snap.webpack5 index 0bffe50853..ecb1e8c490 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack5 @@ -480,7 +480,7 @@ exports[`options validate should throw an error on the "static" option with '{"d exports[`options validate should throw an error on the "static" option with '{"publicPath":false}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.publicPath should be one of these: @@ -495,7 +495,7 @@ exports[`options validate should throw an error on the "static" option with '{"p exports[`options validate should throw an error on the "static" option with '{"serveIndex":"true"}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.serveIndex should be one of these: @@ -510,7 +510,7 @@ exports[`options validate should throw an error on the "static" option with '{"s exports[`options validate should throw an error on the "static" option with '{"watch":10}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static.watch should be one of these: @@ -526,29 +526,29 @@ exports[`options validate should throw an error on the "static" option with '{"w exports[`options validate should throw an error on the "static" option with '0' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "static" option with 'null' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.static should be one of these: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? } + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } -> It is possible to configure advanced options for serving static files from directory. See the Express documentation for the possible options. https://webpack.js.org/configuration/dev-server/#devserverstatic Details: * configuration.static should be an array: - [non-empty string | object { directory, staticOptions?, publicPath?, serveIndex?, watch? }, ...] + [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] * configuration.static should be a boolean. * configuration.static should be a non-empty string. * configuration.static should be an object: - object { directory, staticOptions?, publicPath?, serveIndex?, watch? }" + object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }" `; exports[`options validate should throw an error on the "watchFiles" option with '123' value 1`] = ` From d35bab0920c4c422f3ed889e3c8d49fb9d5508dd Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Jun 2021 19:42:43 +0300 Subject: [PATCH 13/14] chore: update deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40e9344f78..60302fbebd 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "typescript": "^4.2.4", "url-loader": "^4.1.1", "webpack": "^5.37.1", - "webpack-cli": "^4.7.1", + "webpack-cli": "^4.7.2", "webpack-merge": "^5.8.0" }, "peerDependencies": { From 2edd362573ca5a54172dbbce6e191516231f6880 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Jun 2021 19:46:10 +0300 Subject: [PATCH 14/14] chore: update deps --- package-lock.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8fab804e8a..a35f4fe689 100644 --- a/package-lock.json +++ b/package-lock.json @@ -83,7 +83,7 @@ "typescript": "^4.2.4", "url-loader": "^4.1.1", "webpack": "^5.37.1", - "webpack-cli": "^4.7.1", + "webpack-cli": "^4.7.2", "webpack-merge": "^5.8.0" }, "engines": { @@ -3313,9 +3313,9 @@ } }, "node_modules/@webpack-cli/serve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.0.tgz", - "integrity": "sha512-AxpcbdkUhl4248H33LDFgXpFpDE5/BU9rHi2Oj8J4z8JldoMXoSmCe1DXDKcw1ClK64g6fY1Hg+dW20vH81JvQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", + "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", "dev": true, "peerDependencies": { "webpack-cli": "4.x.x" @@ -17829,15 +17829,15 @@ } }, "node_modules/webpack-cli": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.1.tgz", - "integrity": "sha512-DJPd63AY53KXWOaD8cB8CaHR0epVP4O4GBIAk6wCPQHJugrAQ0B5kUkCg0c9vkIrD2kA6CXCmtWqKQsiVTo15A==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", + "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^1.0.4", "@webpack-cli/info": "^1.3.0", - "@webpack-cli/serve": "^1.5.0", + "@webpack-cli/serve": "^1.5.1", "colorette": "^1.2.1", "commander": "^7.0.0", "execa": "^5.0.0", @@ -20873,9 +20873,9 @@ } }, "@webpack-cli/serve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.0.tgz", - "integrity": "sha512-AxpcbdkUhl4248H33LDFgXpFpDE5/BU9rHi2Oj8J4z8JldoMXoSmCe1DXDKcw1ClK64g6fY1Hg+dW20vH81JvQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", + "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", "dev": true, "requires": {} }, @@ -31983,15 +31983,15 @@ } }, "webpack-cli": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.1.tgz", - "integrity": "sha512-DJPd63AY53KXWOaD8cB8CaHR0epVP4O4GBIAk6wCPQHJugrAQ0B5kUkCg0c9vkIrD2kA6CXCmtWqKQsiVTo15A==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", + "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^1.0.4", "@webpack-cli/info": "^1.3.0", - "@webpack-cli/serve": "^1.5.0", + "@webpack-cli/serve": "^1.5.1", "colorette": "^1.2.1", "commander": "^7.0.0", "execa": "^5.0.0",