From 25e093245088f7ee5adf5828dbf13d98fc1ee33b Mon Sep 17 00:00:00 2001 From: shellscape Date: Sun, 14 Jul 2019 22:11:39 -0400 Subject: [PATCH 1/8] feat: ramdisk option --- README.md | 11 +++++ lib/index.js | 12 +++++- lib/log.js | 3 ++ lib/{hmr-plugin.js => plugins/hmr.js} | 4 +- lib/plugins/ramdisk.js | 50 +++++++++++++++++++++ lib/validate.js | 11 +++++ package-lock.json | 55 ++++++++++-------------- package.json | 3 +- test/errors.test.js | 8 ++++ test/fixtures/ramdisk/app.js | 1 + test/fixtures/ramdisk/webpack.config.js | 29 +++++++++++++ test/plugin.test.js | 9 ++++ test/ramdisk.test.js | 33 ++++++++++++++ test/snapshots/errors.test.js.md | 20 +++++++++ test/snapshots/errors.test.js.snap | Bin 0 -> 230 bytes test/snapshots/plugin.test.js.md | 34 +++++++++++++++ test/snapshots/plugin.test.js.snap | Bin 692 -> 911 bytes test/snapshots/ramdisk.test.js.md | 12 ++++++ test/snapshots/ramdisk.test.js.snap | Bin 0 -> 129 bytes test/snapshots/validate.test.js.md | 28 ++++++++++++ test/snapshots/validate.test.js.snap | Bin 939 -> 1097 bytes test/validate.test.js | 7 ++- 22 files changed, 293 insertions(+), 37 deletions(-) rename lib/{hmr-plugin.js => plugins/hmr.js} (94%) create mode 100644 lib/plugins/ramdisk.js create mode 100644 test/errors.test.js create mode 100644 test/fixtures/ramdisk/app.js create mode 100644 test/fixtures/ramdisk/webpack.config.js create mode 100644 test/ramdisk.test.js create mode 100644 test/snapshots/errors.test.js.md create mode 100644 test/snapshots/errors.test.js.snap create mode 100644 test/snapshots/ramdisk.test.js.md create mode 100644 test/snapshots/ramdisk.test.js.snap diff --git a/README.md b/README.md index 0caeeb3..f1958d6 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,17 @@ If [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), the modul If a value of `'minimal'` is set, the progress indicator will render as a small, colored bar at the top of the window. This can be useful when the default fancy progress indicator interferes with elements in the page. +### `ramdisk` +Type: `boolean`
+Default: `false`
+Support: MacOS and Linux, Windows with WSL 2.0. + +If `true`, will apply [`webpack-plugin-ramdisk`](https://www.npmjs.com/package/webpack-plugin-ramdisk) to the build. This will change the output for the build, as the _last three segments_ of `output.path` are appended to the ramdisk mount point. e.g. If the `output.path` value in the webpack configuration is `'/usr/code/my-app/build'`, the modified output path would be `/mnt/wps/code/my-app/build` on Linux, or `/Volumes/wps/code/my-app/build` on MacOS. + +Leveraging this option can result in significant reduction of build time, which is especially useful when using `hmr: true` or `liveReload: true`. Typical build times can be cut by 25-32% or more depending on hardware and webpack configuration. This is also recommended for users with SSD, as it reduces hard disk thrashing. + +Windows users without WSL 2.0 are encouraged to install it to make use of this feature, or create a ramdisk manually using a tool like [ImDisk](https://sourceforge.net/projects/imdisk-toolkit/). + ### `static` Type: `String | Array(String) | Object`
Default: `compiler.context` diff --git a/lib/index.js b/lib/index.js index 04f6421..3432c8b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -15,7 +15,8 @@ const Koa = require('koa'); const nanoid = require('nanoid/generate'); const { DefinePlugin, ProgressPlugin } = require('webpack'); -const { init: initHmrPlugin } = require('./hmr-plugin'); +const { init: initHmrPlugin } = require('./plugins/hmr'); +const { init: initRamdiskPlugin } = require('./plugins/ramdisk'); const { forceError, getLogger } = require('./log'); const { start } = require('./server'); const { validate } = require('./validate'); @@ -34,6 +35,7 @@ const defaults = { open: false, port: 55555, progress: true, + ramdisk: false, secure: false, static: null, status: true @@ -59,6 +61,7 @@ class WebpackPluginServe extends EventEmitter { // NOTE: undocumented option. this is used primarily in testing to allow for multiple instances // of the plugin to be tested within the same context. If you find this, use this at your own // peril. + /* istanbul ignore if */ if (!opts.allowMany && instance) { instance.log.error( 'Duplicate instances created. Only the first instance of this plugin will be active.' @@ -117,6 +120,7 @@ class WebpackPluginServe extends EventEmitter { this.compiler = compiler; // only allow once instance of the plugin to run for a build + /* istanbul ignore if */ if (instance !== this) { return; } @@ -169,6 +173,10 @@ class WebpackPluginServe extends EventEmitter { initHmrPlugin(compiler, this.log); } + if (this.options.ramdisk) { + initRamdiskPlugin(compiler, this.log); + } + if (!this.options.static.length) { this.options.static.push(compiler.context); } @@ -187,6 +195,7 @@ class WebpackPluginServe extends EventEmitter { // track subsequent builds from watching this.on('invalid', () => { + /* istanbul ignore next */ this.state.compiling = new Promise((resolve) => { this.once('done', () => resolve()); }); @@ -198,6 +207,7 @@ class WebpackPluginServe extends EventEmitter { // webpack still has a 4 year old bug whereby in watch mode, file timestamps aren't properly // accounted for, which will trigger multiple builds of the same hash. // see: https://github.com/egoist/time-fix-plugin + /* istanbul ignore if */ if (this.lastHash === compilation.hash) { return; } diff --git a/lib/log.js b/lib/log.js index a7bb307..973a0d9 100644 --- a/lib/log.js +++ b/lib/log.js @@ -20,6 +20,7 @@ const colors = { error: 'red' }; +/* istanbul ignore next */ const forceError = (...args) => { const { error } = console; error(chalk.red(`${symbols.whoops} wps:`), ...args); @@ -29,12 +30,14 @@ const getLogger = (options) => { const prefix = { level: ({ level }) => { const color = colors[level]; + /* istanbul ignore next */ const symbol = ['error', 'warn'].includes(level) ? symbols.whoops : symbols.ok; return chalk[color](`${symbol} wps: `); }, template: '{{level}}' }; + /* istanbul ignore if */ if (options.timestamp) { prefix.template = `[{{time}}] ${prefix.template}`; } diff --git a/lib/hmr-plugin.js b/lib/plugins/hmr.js similarity index 94% rename from lib/hmr-plugin.js rename to lib/plugins/hmr.js index 8e13e51..58affe8 100644 --- a/lib/hmr-plugin.js +++ b/lib/plugins/hmr.js @@ -10,7 +10,7 @@ */ const { HotModuleReplacementPlugin } = require('webpack'); -const { PluginExistsError } = require('./errors'); +const { PluginExistsError } = require('../errors'); const addPlugin = (compiler) => { const hmrPlugin = new HotModuleReplacementPlugin(); @@ -27,6 +27,8 @@ const init = function init(compiler, log) { const hasHMRPlugin = compiler.options.plugins.some( (plugin) => plugin instanceof HotModuleReplacementPlugin ); + + /* istanbul ignore else */ if (!hasHMRPlugin) { addPlugin(compiler); } else { diff --git a/lib/plugins/ramdisk.js b/lib/plugins/ramdisk.js new file mode 100644 index 0000000..8c1429b --- /dev/null +++ b/lib/plugins/ramdisk.js @@ -0,0 +1,50 @@ +/* + Copyright © 2018 Andrew Powell + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of this Source Code Form. +*/ +const { sep } = require('path'); + +const { WebpackPluginRamdisk } = require('webpack-plugin-ramdisk'); + +const { PluginExistsError } = require('../errors'); + +const addPlugin = (compiler) => { + const plugin = new WebpackPluginRamdisk({ name: 'wps' }); + plugin.apply(compiler); +}; + +const init = function init(compiler, log) { + const { path } = compiler.options.output; + const newPath = path + .split(sep) + // only take the last three segments of a path + .slice(-3) + .join(sep); + + // eslint-disable-next-line no-param-reassign + compiler.options.output.path = newPath; + + log.info(`Ramdisk enabled`); + + const hasPlugin = compiler.options.plugins.some( + (plugin) => plugin instanceof WebpackPluginRamdisk + ); + + /* istanbul ignore else */ + if (!hasPlugin) { + addPlugin(compiler); + } else { + log.error( + 'webpack-plugin-serve adds WebpackRamdiskPlugin automatically. Please remove it from your config.' + ); + throw new PluginExistsError('WebpackRamdiskPlugin exists in the specified configuration.'); + } +}; + +module.exports = { init }; diff --git a/lib/validate.js b/lib/validate.js index 73ffb45..38b8065 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -1,3 +1,13 @@ +/* + Copyright © 2018 Andrew Powell + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of this Source Code Form. +*/ const Joi = require('@hapi/joi'); const isPromise = require('is-promise'); @@ -51,6 +61,7 @@ module.exports = { // prettier-ignore port: [number().integer().max(65535), any().promise()], progress: [boolean(), string().valid('minimal')], + ramdisk: [boolean()], secure: any().forbidden(), // prettier-ignore static: [ diff --git a/package-lock.json b/package-lock.json index 8d58533..2c07b7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4117,7 +4117,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -4684,7 +4683,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/execa/-/execa-2.0.3.tgz", "integrity": "sha512-iM124nlyGSrXmuyZF1EMe83ESY2chIYVyDRZKgmcDynid2Q2v/+GuE7gNMl6Sy9Niwf4MC0DDxagOxeMPjuLsw==", - "dev": true, "requires": { "cross-spawn": "^6.0.5", "get-stream": "^5.0.0", @@ -4701,7 +4699,6 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -4714,7 +4711,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", - "dev": true, "requires": { "pump": "^3.0.0" } @@ -4722,20 +4718,17 @@ "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "npm-run-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz", "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==", - "dev": true, "requires": { "path-key": "^3.0.0" }, @@ -4743,8 +4736,7 @@ "path-key": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz", - "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==", - "dev": true + "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==" } } }, @@ -4752,7 +4744,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", - "dev": true, "requires": { "mimic-fn": "^2.1.0" } @@ -4760,14 +4751,12 @@ "p-finally": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", - "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", - "dev": true + "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==" }, "semver": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" } } }, @@ -6884,8 +6873,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -7990,8 +7978,7 @@ "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "merge2": { "version": "1.2.3", @@ -8251,8 +8238,7 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-fetch": { "version": "2.6.0", @@ -8918,8 +8904,7 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -9264,7 +9249,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -9903,7 +9887,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -9911,14 +9894,12 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "slash": { "version": "3.0.0", @@ -10560,8 +10541,7 @@ "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" }, "strip-indent": { "version": "2.0.0", @@ -11328,6 +11308,16 @@ } } }, + "webpack-plugin-ramdisk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/webpack-plugin-ramdisk/-/webpack-plugin-ramdisk-0.1.2.tgz", + "integrity": "sha512-qH76u/Z6WsqCANtcfMMeUrn1TjQcgFK5rKTIL4ipRm5P69ImgdQGjIFmiEwc2TICMIeM52I1F0Ww19akTeta/g==", + "requires": { + "@hapi/joi": "^15.1.0", + "chalk": "^2.4.1", + "execa": "^2.0.0" + } + }, "webpack-sources": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", @@ -11356,7 +11346,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index 0d9eecc..4d6051e 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "opn": "^6.0.0", "p-defer": "^3.0.0", "strip-ansi": "^5.0.0", + "webpack-plugin-ramdisk": "^0.1.2", "ws": "^7.1.0" }, "devDependencies": { @@ -101,7 +102,7 @@ }, "nyc": { "include": [ - "lib/*.js" + "lib/**/*.js" ], "exclude": [ "lib/client*.js", diff --git a/test/errors.test.js b/test/errors.test.js new file mode 100644 index 0000000..8b1dfe2 --- /dev/null +++ b/test/errors.test.js @@ -0,0 +1,8 @@ +const test = require('ava'); + +const { PluginExistsError, WebpackPluginServeError } = require('../lib/errors'); + +test('errors', (t) => { + t.snapshot(new PluginExistsError()); + t.snapshot(new WebpackPluginServeError()); +}); diff --git a/test/fixtures/ramdisk/app.js b/test/fixtures/ramdisk/app.js new file mode 100644 index 0000000..709ff25 --- /dev/null +++ b/test/fixtures/ramdisk/app.js @@ -0,0 +1 @@ +console.log('batman'); diff --git a/test/fixtures/ramdisk/webpack.config.js b/test/fixtures/ramdisk/webpack.config.js new file mode 100644 index 0000000..3a4d0bb --- /dev/null +++ b/test/fixtures/ramdisk/webpack.config.js @@ -0,0 +1,29 @@ +const { resolve } = require('path'); + +const getPort = require('get-port'); + +const { WebpackPluginServe: Serve } = require('../../../lib/'); + +module.exports = { + context: __dirname, + entry: ['./app.js', 'webpack-plugin-serve/client'], + mode: 'development', + output: { + filename: './output.js', + path: resolve(__dirname, './output'), + publicPath: 'output/' + }, + plugins: [ + new Serve({ + host: 'localhost', + port: getPort({ port: 55555 }), + ramdisk: true + }) + ], + resolve: { + alias: { + 'webpack-plugin-serve/client': resolve(__dirname, '../../../client') + } + }, + watch: true +}; diff --git a/test/plugin.test.js b/test/plugin.test.js index 59fff19..3397158 100644 --- a/test/plugin.test.js +++ b/test/plugin.test.js @@ -12,6 +12,15 @@ test('defaults', (t) => { t.snapshot(plugin.options); }); +test('options manipulation', (t) => { + const plugin = new WebpackPluginServe({ + allowMany: true, + compress: true, + historyFallback: true + }); + t.snapshot(plugin.options); +}); + test('static → string', (t) => { const { options } = new WebpackPluginServe({ allowMany: true, diff --git a/test/ramdisk.test.js b/test/ramdisk.test.js new file mode 100644 index 0000000..b7785b6 --- /dev/null +++ b/test/ramdisk.test.js @@ -0,0 +1,33 @@ +const { join } = require('path'); + +const test = require('ava'); +const execa = require('execa'); +const strip = require('strip-ansi'); + +const getPath = (stream) => { + return { + then(r, f) { + stream.on('data', (data) => { + const content = strip(data.toString()); + const pathTest = 'Build being written to '; + if (content.includes(pathTest)) { + r(content.slice(content.lastIndexOf(pathTest) + pathTest.length)); + } + }); + + stream.on('error', f); + } + }; +}; + +test('ramdisk', async (t) => { + const fixturePath = join(__dirname, 'fixtures/ramdisk'); + const proc = execa('wp', [], { cwd: fixturePath }); + const { stdout } = proc; + + const path = await getPath(stdout); + + t.snapshot(path); + + proc.kill('SIGTERM'); +}); diff --git a/test/snapshots/errors.test.js.md b/test/snapshots/errors.test.js.md new file mode 100644 index 0000000..6415408 --- /dev/null +++ b/test/snapshots/errors.test.js.md @@ -0,0 +1,20 @@ +# Snapshot report for `test/errors.test.js` + +The actual snapshot is saved in `errors.test.js.snap`. + +Generated by [AVA](https://ava.li). + +## errors + +> Snapshot 1 + + PluginExistsError { + code: 'ERR_PLUGIN_EXISTS', + message: '', + } + +> Snapshot 2 + + WebpackPluginServeError { + message: '', + } diff --git a/test/snapshots/errors.test.js.snap b/test/snapshots/errors.test.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..b0975ab8a4b4d409924f351cd7c637459f1dac03 GIT binary patch literal 230 zcmVxEk00000000Bi zU|?WiWMEgcVodz1;kH_``yunz)y_-|Ag~OI)fgEVm>Jl?VvG`u%)vl95{TP@SeTJX zkWnxor!+k?&$S}6xTM&%s3^Zkn2`;eFe9TNBP*CCARxfN$jiXU#K6c8GDL)tnSqg2 zkdY-hKP45$5p)d-iVyG!b@%j(ca8824hcq6&7PZDT%4E=(}3(srf49Y2y>x$cxqBX gVsbXbMZu{>WvK{v;*!L4Eh7Q@0esPy3Qhq40RKf|bpQYW literal 0 HcmV?d00001 diff --git a/test/snapshots/plugin.test.js.md b/test/snapshots/plugin.test.js.md index 98b55ea..00b008f 100644 --- a/test/snapshots/plugin.test.js.md +++ b/test/snapshots/plugin.test.js.md @@ -29,6 +29,39 @@ Generated by [AVA](https://ava.li). then: Function then {}, }, progress: true, + ramdisk: false, + secure: false, + static: [], + status: true, + } + +## options manipulation + +> Snapshot 1 + + { + allowMany: true, + compress: {}, + headers: null, + historyFallback: {}, + hmr: true, + host: null, + liveReload: false, + log: { + level: 'info', + name: 'webpack-plugin-serve', + prefix: { + level: Function level {}, + template: '{{level}}', + }, + }, + middleware: Function middleware {}, + open: false, + port: { + then: Function then {}, + }, + progress: true, + ramdisk: false, secure: false, static: [], status: true, @@ -49,6 +82,7 @@ Generated by [AVA](https://ava.li). [ 'test/fixtures/multi', 'test/fixtures/proxy', + 'test/fixtures/ramdisk', 'test/fixtures/simple', 'test/fixtures/wait-for-build', ] diff --git a/test/snapshots/plugin.test.js.snap b/test/snapshots/plugin.test.js.snap index e9523aab15edc99946b59e668b2e74643f60890a..fbea4799aad0d3c862434d30376259d4f82c8463 100644 GIT binary patch literal 911 zcmV;A191F7RzVEQr#BAkxT)iqJwY zMJNcR6`=_A(1RzfA_YAZM7(+uDpU|FdMNls!Iw$0?oN}`3T^3+P2RkDZ{M3Ye=>>? z@}Qa7y))gz(GK6;sh+u)eJdCh|8@%qJ()iq)^i7%R)#;GU26I6!_<09M5s5i((P}3 zak71M;?U}3^F2(h6Tr3cGhgOj>)*QCqH8<4?qf`?%Ruw(r_I)n>*?oT->%*1SiXX( z^|K!#9{FfaEaFfKo(eDq%mQzLPk;cgbr5I+t^zlK5#S;43RnVu0uk&DWAEj7A4ymk z+aE)r5W)=z2aEp^%r#;jVNV!~2`#G|#5AdaZ(x>v86qW#QDZfjkxff83Z0Uo#HGXy zYUe_X7oW)*r4=^0kkL%5dgy>6_mdu?Xj0OSx(nkdhmajt(bCj--eC-6Sx|jDEQZ^}@HH!9{B#|?SGvBl$pVzb`OHQoY1lHW& zd?FU+VbcQe0f_L-@pA6tZ7RlcwSanyojEmO$(l-ws(hh4M9j57(4%Z%uRE|Z$_1aXJqc?==f@nF~S1ZcN*7Bky# zUNfHeG(0B%v6N=S;yGDK{sHNX)(CS7000y?tQ!CT literal 692 zcmV;l0!#ftRzVK@^|2AIT;)-Gqdq;3bIQ!4U9JR8X;pUQMGO#EZMhB-y%O>`sz~wg;=AM-haI zs37&=!QKT?p~oIP`WN(8u|f}C3cgI5?e4U}g&(u~K7McBZ{Dm+2vNw!$I}}Nk7nl5 zFW%HQw-$GS44*xjkUPcQg-rG9l^f4qUf6$KUI%WSQV6;C{MxV0ZGW$Jb>?8I_6~qs z?<2}4`GZNBR^nB}>A+v5+Op@EdasnlhGIF%&U zMqc%15Eui{#&5c=^Qn=AHdLGTs2z!Cxh+pr+cg|I{wVdS>EnDiGoaNQ6?-Y@seAylA|ugsbJLc zZG%P4WtNwD-0Esna+E04RFXBL`>v7#fyD7-xmu@& zm7|?cdL3aN{$4))k6RJBiwW+k)3up(7y~dN2yfETU>p=lSxN?l779zpQSvzI aY%;2ESgg|Wf{NL-?B+kXJnZkJ1polb!&Bn` diff --git a/test/snapshots/ramdisk.test.js.md b/test/snapshots/ramdisk.test.js.md new file mode 100644 index 0000000..9860b52 --- /dev/null +++ b/test/snapshots/ramdisk.test.js.md @@ -0,0 +1,12 @@ +# Snapshot report for `test/ramdisk.test.js` + +The actual snapshot is saved in `ramdisk.test.js.snap`. + +Generated by [AVA](https://ava.li). + +## ramdisk + +> Snapshot 1 + + `/Volumes/wps/fixtures/ramdisk/output␊ + ` diff --git a/test/snapshots/ramdisk.test.js.snap b/test/snapshots/ramdisk.test.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..fef2a835128a947371506bde23e4be4f31e88276 GIT binary patch literal 129 zcmZ<^b5sbhgkMpt%5p(lWFF literal 0 HcmV?d00001 diff --git a/test/snapshots/validate.test.js.md b/test/snapshots/validate.test.js.md index 578b188..a5969d5 100644 --- a/test/snapshots/validate.test.js.md +++ b/test/snapshots/validate.test.js.md @@ -99,3 +99,31 @@ Generated by [AVA](https://ava.li). }, }, } + +## throws + +> Snapshot 1 + + ValidationError (Error) { + _object: { + batman: 'nanananana', + }, + annotate: Function {}, + details: [ + { + context: { + child: 'batman', + key: 'batman', + label: 'batman', + value: 'nanananana', + }, + message: '"batman" is not allowed', + path: [ + 'batman', + ], + type: 'object.allowUnknown', + }, + ], + isJoi: true, + message: '"batman" is not allowed', + } diff --git a/test/snapshots/validate.test.js.snap b/test/snapshots/validate.test.js.snap index 4231ada2cf6833f074894f17945812607fca57d5..e89873e8ff707329da062ac05b9d7a7fbd5ad15d 100644 GIT binary patch literal 1097 zcmV-P1h)G@RzVnb}TmGTDu0-%Rq6`*ZF$ z=bU@anNw$s>FkGBM~3$wf8x!?-RE1I#$SA!SoGmKV<*QiJoei?C%!LU{O6;^^B4Zq z<*Hwbab;bMZ-*G0`ue@Y8?G*1svS7JySZH)Cb{}}IpQx$KDwO>FW~g^bspND`;_l{{umWT$&^E)bTl$D!e}ESlhH8IHJsf{I;Nvke9fyK6tz%p z+)1}KO5An5kcUF)e@SM~wGBX)UL++54$0DVtTW&2fp7hK_ih=DYnBGs> z%t_zp3uL6Da=9#>LW;6FbXy)*xzA|56dEG>SY9%i&9fN&3|t1rHO3y&6rIg>o$(w) zdU9IJc(UfXp?E#~cisZo@eG;KULeRrO<8*9J>c1&+6@tEvk++)Cj4~*iJp`X4UhvVxh;j>F}y>dI`*NrzN`G-G)ev zWsk09f;~bx30BWdu%m-bu>I22R%ONu!iqH&u~}77|9a2H)+wSx$(f#Y+K;7?vbAw7%{Ti5-09{)lT{ShvBR%EBVCq)W^TTvP zJ7q9vGLeThdG{DiViZLP@*u?U5bzjDk1%S8z*C$Vk2&Mn5{m2PdjL(y2to133LK@G@}7Sg|~P z0Fh%xukr-WuOM&|_zCz+iS=}UPZaH|n)vDyknmjsFFO6Fr z2g3SM{O?MNVgMXrihC$0tUt}P7G{lyHT9ZJ5tU0h(>KZ^XEH~Oa7MUtbty|E)l7>? z!mE@NO)V*juw-0C`Pqijb1$$i_x%8T|3;_pQ3~F{>JgRL?8t62Z3RK}33Yg-hed^Ui`KHQ_&cw0zbm(|*ge?3 zVoRmU!v=S|_U<;Gt1#(!(%6QB2ZJ9U?6e?R5Ov~~1duCx7R PnULHBjYDfMp$`B6`86S) literal 939 zcmV;c162G$RzVEfDXgx|X4iW*WyV%d}b{(gHFY0tBN(B0->ufJ~qn zU>?u5fr!%yJH4TuXhwCYrrQMKt_#7ktl530#%4mC z+l%H^+onTmFmFo^nr2ebYz5z;P+d1i)C_?b2!r?{9o*P3jL0eGn;WJ-WPxmBk$Wbw z<3%Iw1`lFr!px9u9GUJ0Y;vz<(Gp0(C?1cqqyXovh`ue3Q`91`ff+RdJYrXg%<=~u zeL~D3Is`%v2%OJyxzG3>iDhy~2xT&D8jgC+`L}E#*+hs;Do`iOF-cCTut?MD-E=o2 zIA`PxbHre=Od-n~#5aVD^|({yVu_T;f{8tWCMU)6#76nVN_>T+vznd>rIQYx%$$I^_UOYZ%PFVWrCh|g=)s^UB{Eg(c; zg?1JA8h8C<6N&I!1=DhZ3G8LXAh1Sm7TDe6s24|WgyU*;YLvQtrjUbw>UVHUm6Bn6T~a+hc?Y{w z)b%L_(mp(W5OD!9Dy=9__t4~_R7;+a^934AB0eI1@th6iocNEjIj!=KtjnuIdMPb^abQ^=#%GT&iZ)`5aOr_6W&JetX(6Ynljg5kR$aMdGqH&s zc^^6=Ia$?Us|#Tw=4K!!J})OJ0xv1PF=JeX{B)x9>_+tPf+kf&DliB8LxSz+7FUPE ztFHPGX!rP{r@a { @@ -32,3 +32,8 @@ test('promise', (t) => { t.falsy(result.error); t.snapshot(result); }); + +test('throws', (t) => { + const error = t.throws(() => new WebpackPluginServe({ batman: 'nanananana' })); + t.snapshot(error); +}); From bff050e3c1dbdcae593b5ab5c1d4c52bb52564bd Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 15 Jul 2019 13:42:29 -0400 Subject: [PATCH 2/8] feat: round out methodology for ramdisk option, tests --- README.md | 2 +- lib/index.js | 2 +- lib/plugins/ramdisk.js | 73 ++++++---- package-lock.json | 216 +++++++++++++++++++++++----- package.json | 1 + test/fixtures/ramdisk/app.js | 10 +- test/fixtures/ramdisk/component.js | 2 + test/fixtures/ramdisk/index.html | 10 ++ test/ramdisk.test.js | 2 + test/snapshots/ramdisk.test.js.md | 2 +- test/snapshots/ramdisk.test.js.snap | Bin 129 -> 146 bytes 11 files changed, 251 insertions(+), 69 deletions(-) create mode 100644 test/fixtures/ramdisk/component.js create mode 100644 test/fixtures/ramdisk/index.html diff --git a/README.md b/README.md index f1958d6..0bfa922 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ Type: `boolean`
Default: `false`
Support: MacOS and Linux, Windows with WSL 2.0. -If `true`, will apply [`webpack-plugin-ramdisk`](https://www.npmjs.com/package/webpack-plugin-ramdisk) to the build. This will change the output for the build, as the _last three segments_ of `output.path` are appended to the ramdisk mount point. e.g. If the `output.path` value in the webpack configuration is `'/usr/code/my-app/build'`, the modified output path would be `/mnt/wps/code/my-app/build` on Linux, or `/Volumes/wps/code/my-app/build` on MacOS. +If `true`, will apply [`webpack-plugin-ramdisk`](https://www.npmjs.com/package/webpack-plugin-ramdisk) to the build. `output` configuration does not have to be modified, a symlink will be created from the original output path to the output path on the ramdisk. Leveraging this option can result in significant reduction of build time, which is especially useful when using `hmr: true` or `liveReload: true`. Typical build times can be cut by 25-32% or more depending on hardware and webpack configuration. This is also recommended for users with SSD, as it reduces hard disk thrashing. diff --git a/lib/index.js b/lib/index.js index 3432c8b..9e31f71 100644 --- a/lib/index.js +++ b/lib/index.js @@ -174,7 +174,7 @@ class WebpackPluginServe extends EventEmitter { } if (this.options.ramdisk) { - initRamdiskPlugin(compiler, this.log); + initRamdiskPlugin.call(this, compiler); } if (!this.options.static.length) { diff --git a/lib/plugins/ramdisk.js b/lib/plugins/ramdisk.js index 8c1429b..efb2ee9 100644 --- a/lib/plugins/ramdisk.js +++ b/lib/plugins/ramdisk.js @@ -8,43 +8,54 @@ The above copyright notice and this permission notice shall be included in all copies or substantial portions of this Source Code Form. */ +/* eslint-disable no-param-reassign */ +const crypto = require('crypto'); +const { existsSync, symlinkSync, unlinkSync } = require('fs'); const { sep } = require('path'); +const readPkgUp = require('read-pkg-up'); const { WebpackPluginRamdisk } = require('webpack-plugin-ramdisk'); const { PluginExistsError } = require('../errors'); -const addPlugin = (compiler) => { - const plugin = new WebpackPluginRamdisk({ name: 'wps' }); - plugin.apply(compiler); -}; - -const init = function init(compiler, log) { - const { path } = compiler.options.output; - const newPath = path - .split(sep) - // only take the last three segments of a path - .slice(-3) - .join(sep); - - // eslint-disable-next-line no-param-reassign - compiler.options.output.path = newPath; - - log.info(`Ramdisk enabled`); - - const hasPlugin = compiler.options.plugins.some( - (plugin) => plugin instanceof WebpackPluginRamdisk - ); - - /* istanbul ignore else */ - if (!hasPlugin) { - addPlugin(compiler); - } else { - log.error( - 'webpack-plugin-serve adds WebpackRamdiskPlugin automatically. Please remove it from your config.' +module.exports = { + init(compiler) { + const hasPlugin = compiler.options.plugins.some( + (plugin) => plugin instanceof WebpackPluginRamdisk ); - throw new PluginExistsError('WebpackRamdiskPlugin exists in the specified configuration.'); + + /* istanbul ignore else */ + if (hasPlugin) { + this.log.error( + 'webpack-plugin-serve adds WebpackRamdiskPlugin automatically. Please remove it from your config.' + ); + throw new PluginExistsError('WebpackRamdiskPlugin exists in the specified configuration.'); + } + + const pkg = readPkgUp.sync() || {}; + const { path } = compiler.options.output; + const lastSegment = path.split(sep).slice(-1); + + if (!pkg.name) { + // use md5 for a short hash that'll be consistent between wps starts + const md5 = crypto.createHash('md5'); + md5.update(path); + pkg.name = md5.digest('hex'); + } + + const newPath = [pkg.name].concat(lastSegment).join(sep); + + // clean up the output path in prep for the ramdisk plugin + compiler.options.output.path = newPath; + + this.log.info(`Ramdisk enabled`); + + const plugin = new WebpackPluginRamdisk({ name: 'wps' }); + plugin.apply(compiler); + + if (existsSync(path)) { + unlinkSync(path); + } + symlinkSync(compiler.options.output.path, path); } }; - -module.exports = { init }; diff --git a/package-lock.json b/package-lock.json index 2c07b7f..52f299a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -225,7 +224,6 @@ "version": "7.5.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", - "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", @@ -723,6 +721,11 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.2.tgz", "integrity": "sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ==" }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -2975,6 +2978,16 @@ "trim-newlines": "^2.0.0" } }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, "text-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.0.0.tgz", @@ -3077,6 +3090,18 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } } }, "through2": { @@ -3130,6 +3155,18 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } } } } @@ -3241,6 +3278,18 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } } }, "readable-stream": { @@ -4151,7 +4200,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -4655,8 +4703,7 @@ "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "eventemitter3": { "version": "3.1.2", @@ -6010,6 +6057,18 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } } } } @@ -6057,6 +6116,18 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } } }, "semver": { @@ -6329,8 +6400,7 @@ "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", - "dev": true + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" }, "http-assert": { "version": "1.4.1", @@ -6566,8 +6636,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-binary-path": { "version": "1.0.1", @@ -7024,8 +7093,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "3.13.1", @@ -7052,8 +7120,7 @@ "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, "json-schema-traverse": { "version": "0.4.1", @@ -7281,6 +7348,11 @@ "type-check": "~0.3.2" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" + }, "lint-staged": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.2.0.tgz", @@ -7956,6 +8028,18 @@ "redent": "^2.0.0", "trim-newlines": "^2.0.0", "yargs-parser": "^10.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } } }, "merge-source-map": { @@ -8289,7 +8373,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -8300,8 +8383,7 @@ "semver": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" } } }, @@ -8909,8 +8991,7 @@ "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==", - "dev": true + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-to-regexp": { "version": "1.7.0", @@ -9392,13 +9473,87 @@ } }, "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-6.0.0.tgz", + "integrity": "sha512-odtTvLl+EXo1eTsMnoUHRmg/XmXdTkwXVxy4VFE9Kp6cCq7b3l7QMdBndND3eAFzrbSAXC/WCUOQQ9rLjifKZw==", "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" + "find-up": "^4.0.0", + "read-pkg": "^5.1.1", + "type-fest": "^0.5.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" + } + } + } } }, "readable-stream": { @@ -9599,7 +9754,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", - "dev": true, "requires": { "path-parse": "^1.0.6" } @@ -10088,7 +10242,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -10097,14 +10250,12 @@ "spdx-exceptions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -10113,8 +10264,7 @@ "spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" }, "split": { "version": "1.0.1", @@ -10939,8 +11089,7 @@ "type-fest": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz", - "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==", - "dev": true + "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==" }, "type-is": { "version": "1.6.18", @@ -11210,7 +11359,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" diff --git a/package.json b/package.json index 4d6051e..d4c4ca2 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "onetime": "^5.1.0", "opn": "^6.0.0", "p-defer": "^3.0.0", + "read-pkg-up": "^6.0.0", "strip-ansi": "^5.0.0", "webpack-plugin-ramdisk": "^0.1.2", "ws": "^7.1.0" diff --git a/test/fixtures/ramdisk/app.js b/test/fixtures/ramdisk/app.js index 709ff25..ad15d30 100644 --- a/test/fixtures/ramdisk/app.js +++ b/test/fixtures/ramdisk/app.js @@ -1 +1,9 @@ -console.log('batman'); +require('./component'); + +if (module.hot) { + module.hot.accept((err) => { + if (err) { + console.error('HMR', err); + } + }); +} diff --git a/test/fixtures/ramdisk/component.js b/test/fixtures/ramdisk/component.js new file mode 100644 index 0000000..9262226 --- /dev/null +++ b/test/fixtures/ramdisk/component.js @@ -0,0 +1,2 @@ +const main = document.querySelector('main'); +main.innerHTML = 'main'; diff --git a/test/fixtures/ramdisk/index.html b/test/fixtures/ramdisk/index.html new file mode 100644 index 0000000..fca1533 --- /dev/null +++ b/test/fixtures/ramdisk/index.html @@ -0,0 +1,10 @@ + + + + fixture: single + + +
+ + + diff --git a/test/ramdisk.test.js b/test/ramdisk.test.js index b7785b6..6eac775 100644 --- a/test/ramdisk.test.js +++ b/test/ramdisk.test.js @@ -1,3 +1,4 @@ +const { existsSync } = require('fs'); const { join } = require('path'); const test = require('ava'); @@ -28,6 +29,7 @@ test('ramdisk', async (t) => { const path = await getPath(stdout); t.snapshot(path); + t.truthy(existsSync(join(fixturePath, 'output/output.js'))); proc.kill('SIGTERM'); }); diff --git a/test/snapshots/ramdisk.test.js.md b/test/snapshots/ramdisk.test.js.md index 9860b52..02d1150 100644 --- a/test/snapshots/ramdisk.test.js.md +++ b/test/snapshots/ramdisk.test.js.md @@ -8,5 +8,5 @@ Generated by [AVA](https://ava.li). > Snapshot 1 - `/Volumes/wps/fixtures/ramdisk/output␊ + `/Volumes/wps/acd3b3c865a8bcadc8f64985be65bb62/output␊ ` diff --git a/test/snapshots/ramdisk.test.js.snap b/test/snapshots/ramdisk.test.js.snap index fef2a835128a947371506bde23e4be4f31e88276..9520ba898387fb9a6c66712e819f7da2d38898b6 100644 GIT binary patch delta 118 zcmV-+0Ez#B0g?eCK~_N^Q*L2!b7*gLAa*he0stMXMB_N=w2HlF^`pH=T5XXcB}*BI znHku@Y(`cFK}J*ku>73T+|*+I@`7Uh#N-s?B;#ZYGt)$iq~yeuWQ#O26H5!zq*OE0 Yq$D#V{ru9Bg3=N$0HTy^Lt_8{0NUO(%m4rY delta 101 zcmV-r0Gj`j0f7M`K~_N^Q*L2!b7*gLAa*he0stUL4r5*%B{^`Z0y#aY6A+OiB{~?0 znHku@Y(`cFK}J>mu>73T+|*+I@`7Uhw9JZ<(jp+IC^0uBvp8EnzqF*Fw1f))XnS{X HQvd(}5O^l) From 4fe3f873756f938b3a05a340bf2323211b12aca1 Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 15 Jul 2019 15:49:54 -0400 Subject: [PATCH 3/8] chore: npm audit fix --- package-lock.json | 280 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 152 insertions(+), 130 deletions(-) diff --git a/package-lock.json b/package-lock.json index 52f299a..f1918ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -364,19 +364,19 @@ } }, "@commitlint/cli": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-8.0.0.tgz", - "integrity": "sha512-wFu+g9v73I2rMRTv27ItIbcrhWqge0ZpUNUIJ9fw8TF7XpmhaUFvGqa2kU6st1F0TyEOrq5ZMzwI8kQZNVLuXg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-8.1.0.tgz", + "integrity": "sha512-83K5C2nIAgoZlzMegf0/MEBjX+ampUyc/u79RxgX9ZYjzos+RQtNyO7I43dztVxPXSwAnX9XRgoOfkGWA4nbig==", "dev": true, "requires": { - "@commitlint/format": "^8.0.0", - "@commitlint/lint": "^8.0.0", - "@commitlint/load": "^8.0.0", - "@commitlint/read": "^8.0.0", + "@commitlint/format": "^8.1.0", + "@commitlint/lint": "^8.1.0", + "@commitlint/load": "^8.1.0", + "@commitlint/read": "^8.1.0", "babel-polyfill": "6.26.0", "chalk": "2.3.1", "get-stdin": "7.0.0", - "lodash": "4.17.11", + "lodash": "4.17.14", "meow": "5.0.0", "resolve-from": "5.0.0", "resolve-global": "1.0.0" @@ -392,12 +392,6 @@ "escape-string-regexp": "^1.0.5", "supports-color": "^5.2.0" } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true } } }, @@ -408,102 +402,85 @@ "dev": true }, "@commitlint/ensure": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-8.0.0.tgz", - "integrity": "sha512-rhBO79L9vXeb26JU+14cxZQq46KyyVqlo31C33VIe7oJndUtWrDhZTvMjJeB1pdXh4EU4XWdMo+yzBmuypFgig==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-8.1.0.tgz", + "integrity": "sha512-dBU4CcjN0vJSDNOeSpaHNgQ1ra444u4USvI6PTaHVAS4aeDpZ5Cds1rxkZNsocu48WNycUu0jP84+zjcw2pPLQ==", "dev": true, "requires": { - "lodash": "4.17.11" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } + "lodash": "4.17.14" } }, "@commitlint/execute-rule": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.0.0.tgz", - "integrity": "sha512-E/A2xHqx3syclXAFl8vJY2o/+xtL9axrqbFFF42Bzke+Eflf0mOJviPxDodu2xP0wXMRQ9UokAi/reK9dMtA/A==", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.1.0.tgz", + "integrity": "sha512-+vpH3RFuO6ypuCqhP2rSqTjFTQ7ClzXtUvXphpROv9v9+7zH4L+Ex+wZLVkL8Xj2cxefSLn/5Kcqa9XyJTn3kg==", + "dev": true }, "@commitlint/format": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-8.0.0.tgz", - "integrity": "sha512-dFxKGLp1T4obi7+YZ2NcSAebJA/dBQwnerRJGz0hWtsO6pheJRe+qC50+GCb2fYGWUc5lIWawaRts0m7RkFGUw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-8.1.0.tgz", + "integrity": "sha512-D0cmabUTQIKdABgt08d9JAvO9+lMRAmkcsZx8TMScY502R67HCw77JhzRDcw1RmqX5rN8JO6ZjDHO92Pbwlt+Q==", "dev": true, "requires": { "chalk": "^2.0.1" } }, "@commitlint/is-ignored": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-8.0.0.tgz", - "integrity": "sha512-geWr/NXGMrZ3qc3exDM+S1qV+nMDxp1LwN3rLpEN2gXTwW3rIXq49RQQUkn0n3BHcpqJJ9EBhjqFoMU1TYx7Ng==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-8.1.0.tgz", + "integrity": "sha512-HUSxx6kuLbqrQ8jb5QRzo+yR+CIXgA9HNcIcZ1qWrb+O9GOixt3mlW8li1IcfIgfODlaWoxIz0jYCxR08IoQLg==", "dev": true, "requires": { - "semver": "6.0.0" + "@types/semver": "^6.0.1", + "semver": "6.1.1" + }, + "dependencies": { + "semver": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", + "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", + "dev": true + } } }, "@commitlint/lint": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-8.0.0.tgz", - "integrity": "sha512-5nKiJpBDR2iei+fre4+6M7FUrSX1cIMoxXKdrnb1GMOXkw9CsZSF5OvdrX08zHAFmOAeDaohoCV+XN/UN/vWYg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-8.1.0.tgz", + "integrity": "sha512-WYjbUgtqvnlVH3S3XPZMAa+N7KO0yQ+GuUG20Qra+EtER6SRYawykmEs4wAyrmY8VcFXUnKgSlIQUsqmGKwNZQ==", "dev": true, "requires": { - "@commitlint/is-ignored": "^8.0.0", - "@commitlint/parse": "^8.0.0", - "@commitlint/rules": "^8.0.0", + "@commitlint/is-ignored": "^8.1.0", + "@commitlint/parse": "^8.1.0", + "@commitlint/rules": "^8.1.0", "babel-runtime": "^6.23.0", - "lodash": "4.17.11" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } + "lodash": "4.17.14" } }, "@commitlint/load": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.0.0.tgz", - "integrity": "sha512-JXC3YjO7hN7Rv2Z/SaYz+oIvShsQWLL7gnOCe8+YgI1EusBqjV4mPI0HnBXVe9volfdxbl+Af/GoQZs2dvyOFA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.1.0.tgz", + "integrity": "sha512-ra02Dvmd7Gp1+uFLzTY3yGOpHjPzl5T9wYg/xrtPJNiOWXvQ0Mw7THw+ucd1M5iLUWjvdavv2N87YDRc428wHg==", "dev": true, "requires": { - "@commitlint/execute-rule": "^8.0.0", - "@commitlint/resolve-extends": "^8.0.0", + "@commitlint/execute-rule": "^8.1.0", + "@commitlint/resolve-extends": "^8.1.0", "babel-runtime": "^6.23.0", + "chalk": "2.4.2", "cosmiconfig": "^5.2.0", - "lodash": "4.17.11", + "lodash": "4.17.14", "resolve-from": "^5.0.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } } }, "@commitlint/message": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-8.0.0.tgz", - "integrity": "sha512-2oGUV8630nzsj17t6akq3mFguzWePADO069IwKJi+CN5L0YRBQj9zGRCB0P+zvh4EngjqMnuMwhEhaBEM8TTzA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-8.1.0.tgz", + "integrity": "sha512-AjHq022G8jQQ/3YrBOjwVBD4xF75hvC3vcvFoBIb7cC8vad1QWq+1w+aks0KlEK5IW+/+7ORZXIH+oyW7h3+8A==", "dev": true }, "@commitlint/parse": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-8.0.0.tgz", - "integrity": "sha512-6CyweJrBkI+Jqx7qkpYgVx2muBMoUZAZHWhUTgqHIDDmI+3d4UPZ2plGS2G0969KkHCgjtlwnwTjWqA9HLMwPA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-8.1.0.tgz", + "integrity": "sha512-n4fEbZ5kdK5HChvne7Mj8rGGkKMfA4H11IuWiWmmMzgmZTNb/B04LPrzdUm4lm3f10XzM2JMM7PLXqofQJOGvA==", "dev": true, "requires": { "conventional-changelog-angular": "^1.3.3", @@ -512,63 +489,106 @@ } }, "@commitlint/read": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-8.0.0.tgz", - "integrity": "sha512-IhNMiKPqkB5yxphe/FiOKgX2uCysbR8fGK6KOXON3uJaVND0dctxnfdv+vY9gDv2CtjIXgNFO+v6FLnqMfIvwA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-8.1.0.tgz", + "integrity": "sha512-PKsGMQFEr2sX/+orI71b82iyi8xFqb7F4cTvsLxzB5x6/QutxPVM3rg+tEVdi6rBKIDuqRIp2puDZQuREZs3vg==", "dev": true, "requires": { - "@commitlint/top-level": "^8.0.0", + "@commitlint/top-level": "^8.1.0", "@marionebl/sander": "^0.6.0", "babel-runtime": "^6.23.0", "git-raw-commits": "^1.3.0" } }, "@commitlint/resolve-extends": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.0.0.tgz", - "integrity": "sha512-SPkH+dXMCpYboVwpIhtOhpg1xYdE7L77fuHmEJWveXSmgfi0GosFm4aJ7Cer9DjNjW+KbD0TUfzZU0TrYUESjQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.1.0.tgz", + "integrity": "sha512-r/y+CeKW72Oa9BUctS1+I/MFCDiI3lfhwfQ65Tpfn6eZ4CuBYKzrCRi++GTHeAFKE3y8q1epJq5Rl/1GBejtBw==", "dev": true, "requires": { - "babel-runtime": "6.26.0", + "@types/node": "^12.0.2", "import-fresh": "^3.0.0", - "lodash": "4.17.11", + "lodash": "4.17.14", "resolve-from": "^5.0.0", "resolve-global": "^1.0.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } } }, "@commitlint/rules": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-8.0.0.tgz", - "integrity": "sha512-s9BehZQP5uAc/V4lMaUxwxFabVZTw5fZ18Ase1e5tbMKVIwq/7E00Ny1czN7xSFXfgffukWznsexpfFXYpbVsg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-8.1.0.tgz", + "integrity": "sha512-hlM8VfNjsOkbvMteFyqn0c3akiUjqG09Iid28MBLrXl/d+8BR3eTzwJ4wMta4oz/iqGyrIywvg1FpHrV977MPA==", "dev": true, "requires": { - "@commitlint/ensure": "^8.0.0", - "@commitlint/message": "^8.0.0", - "@commitlint/to-lines": "^8.0.0", + "@commitlint/ensure": "^8.1.0", + "@commitlint/message": "^8.1.0", + "@commitlint/to-lines": "^8.1.0", "babel-runtime": "^6.23.0" } }, "@commitlint/to-lines": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-8.0.0.tgz", - "integrity": "sha512-qqgNeyj+NJ1Xffwv6hGsipKlVFj30NmfPup751MS/me0GV8IBd//njTjiqHvf/3sKm/OcGn4Re4D7YXwTcC2RA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-8.1.0.tgz", + "integrity": "sha512-Lh4OH1bInI8GME/7FggS0/XkIMEJdTObMbXRyPRGaPcWH5S7zpB6y+b4qjzBHXAbEv2O46QAAMjZ+ywPQCpmYQ==", "dev": true }, "@commitlint/top-level": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-8.0.0.tgz", - "integrity": "sha512-If9hwfISHV8HXGKeXUKsUvOo4DuISWiU/VC2qHsKpeHSREAxkWESmQzzwYvOtyBjMiOTfAXfzgth18g36Fz2ow==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-8.1.0.tgz", + "integrity": "sha512-EvQuofuA/+0l1w9pkG/PRyIwACmZdIh9qxyax7w7mR8qqmSHscqf2jARIylh1TOx0uI9egO8MuPLiwC1RwyREA==", "dev": true, "requires": { - "find-up": "^2.1.0" + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } } }, "@concordance/react": { @@ -726,6 +746,12 @@ "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" }, + "@types/semver": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.1.tgz", + "integrity": "sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -3155,18 +3181,16 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" - }, - "dependencies": { - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" } } } @@ -6057,18 +6081,16 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" - }, - "dependencies": { - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" } } } diff --git a/package.json b/package.json index d4c4ca2..97c0910 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "ws": "^7.1.0" }, "devDependencies": { - "@commitlint/cli": "^8.0.0", + "@commitlint/cli": "^8.1.0", "@commitlint/config-conventional": "^8.0.0", "ava": "^2.2.0", "cpy": "^7.0.1", From 2eccce8a89995bc6838fe5e6ad6dde3eb6000fb9 Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 15 Jul 2019 21:15:10 -0400 Subject: [PATCH 4/8] chore: update circle with machine config for ramdisk tests --- .circleci/config.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1146d5f..490b953 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,25 +17,25 @@ jobs: key: dependency-cache-{{ checksum "package-lock.json" }} paths: - ./node_modules - node-v10-latest: - docker: - - image: rollupcabal/circleci-node-v10:latest + node-v12-latest: + machine: true steps: - checkout - restore_cache: key: dependency-cache-{{ checksum "package-lock.json" }} - run: - name: Node Info - command: node --version && npm --version - - run: - name: Workaround for GoogleChrome/puppeteer#290 - command: 'sh .circleci/setup-puppeteer.sh' - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run unit tests. - command: npm run ci:coverage + name: Setup Node 12 and Run Tests + command: | + set +e + touch $BASH_ENV + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash + export NVM_DIR="/opt/circleci/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm install 12 + nvm alias default 12 + node --version && npm --version + npm install + npm run ci:coverage - run: name: Submit coverage data to codecov. command: bash <(curl -s https://codecov.io/bash) @@ -70,7 +70,7 @@ workflows: filters: tags: only: /.*/ - - node-v10-latest: + - node-v12-latest: requires: - analysis filters: From a3c05bce6d6564108ca48c362387f7e37ec17052 Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 15 Jul 2019 21:24:37 -0400 Subject: [PATCH 5/8] test: make ramdisk test cross platform --- test/ramdisk.test.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/ramdisk.test.js b/test/ramdisk.test.js index 6eac775..d5bc0a4 100644 --- a/test/ramdisk.test.js +++ b/test/ramdisk.test.js @@ -5,14 +5,13 @@ const test = require('ava'); const execa = require('execa'); const strip = require('strip-ansi'); -const getPath = (stream) => { +const waitFor = (text, stream) => { return { then(r, f) { stream.on('data', (data) => { const content = strip(data.toString()); - const pathTest = 'Build being written to '; - if (content.includes(pathTest)) { - r(content.slice(content.lastIndexOf(pathTest) + pathTest.length)); + if (content.includes(text)) { + r(content.slice(content.lastIndexOf(text) + text.length)); } }); @@ -24,12 +23,19 @@ const getPath = (stream) => { test('ramdisk', async (t) => { const fixturePath = join(__dirname, 'fixtures/ramdisk'); const proc = execa('wp', [], { cwd: fixturePath }); - const { stdout } = proc; + const { stderr, stdout } = proc; + const pathTest = 'Build being written to '; + const doneTest = '[emitted]'; - const path = await getPath(stdout); + const path = await waitFor(pathTest, stdout); - t.snapshot(path); - t.truthy(existsSync(join(fixturePath, 'output/output.js'))); + t.regex(path, /(volumes|mnt)\/wps\/[a-f0-9]{32}\/output/i); + + await waitFor(doneTest, stderr); + + const exists = existsSync(join(fixturePath, 'output/output.js')); + + t.truthy(exists); proc.kill('SIGTERM'); }); From af25102b287747d978b70c14b4ba0f417d0265cc Mon Sep 17 00:00:00 2001 From: shellscape Date: Fri, 19 Jul 2019 10:16:52 -0400 Subject: [PATCH 6/8] chore: update for feedback, add path error checking --- lib/errors.js | 10 ++++- lib/plugins/ramdisk.js | 40 +++++++++++++++--- package-lock.json | 24 +++++------ package.json | 2 + test/fixtures/ramdisk/config-context-error.js | 29 +++++++++++++ test/fixtures/ramdisk/config-cwd-error.js | 29 +++++++++++++ test/fixtures/ramdisk/cwd-error/.gitkeep | 0 test/ramdisk.test.js | 31 +++++++++++++- test/snapshots/plugin.test.js.md | 1 + test/snapshots/plugin.test.js.snap | Bin 911 -> 927 bytes test/snapshots/ramdisk.test.js.md | 31 +++++++++++++- test/snapshots/ramdisk.test.js.snap | Bin 146 -> 736 bytes 12 files changed, 173 insertions(+), 24 deletions(-) create mode 100644 test/fixtures/ramdisk/config-context-error.js create mode 100644 test/fixtures/ramdisk/config-cwd-error.js create mode 100644 test/fixtures/ramdisk/cwd-error/.gitkeep diff --git a/lib/errors.js b/lib/errors.js index bd72754..df27a49 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -23,4 +23,12 @@ class PluginExistsError extends WebpackPluginServeError { } } -module.exports = { PluginExistsError, WebpackPluginServeError }; +class RamdiskPathError extends WebpackPluginServeError { + constructor(...args) { + super(...args); + this.name = 'RamdiskPathError'; + this.code = 'ERR_RAMDISK_PATH'; + } +} + +module.exports = { PluginExistsError, RamdiskPathError, WebpackPluginServeError }; diff --git a/lib/plugins/ramdisk.js b/lib/plugins/ramdisk.js index efb2ee9..f278613 100644 --- a/lib/plugins/ramdisk.js +++ b/lib/plugins/ramdisk.js @@ -10,13 +10,15 @@ */ /* eslint-disable no-param-reassign */ const crypto = require('crypto'); -const { existsSync, symlinkSync, unlinkSync } = require('fs'); -const { sep } = require('path'); +const { existsSync, symlinkSync } = require('fs'); +const { basename, join, resolve } = require('path'); +const isCwd = require('is-path-cwd'); const readPkgUp = require('read-pkg-up'); +const rm = require('rimraf'); const { WebpackPluginRamdisk } = require('webpack-plugin-ramdisk'); -const { PluginExistsError } = require('../errors'); +const { PluginExistsError, RamdiskPathError } = require('../errors'); module.exports = { init(compiler) { @@ -24,7 +26,7 @@ module.exports = { (plugin) => plugin instanceof WebpackPluginRamdisk ); - /* istanbul ignore else */ + /* istanbul ignore if */ if (hasPlugin) { this.log.error( 'webpack-plugin-serve adds WebpackRamdiskPlugin automatically. Please remove it from your config.' @@ -34,7 +36,30 @@ module.exports = { const pkg = readPkgUp.sync() || {}; const { path } = compiler.options.output; - const lastSegment = path.split(sep).slice(-1); + const lastSegment = basename(path); + const errorInfo = `The ramdisk option creates a symlink from \`output.path\`, to the ramdisk build output path, and must remove any existing \`output.path\` to do so.`; + + // if output.path is /batman/batcave, and the user is running the build with wsp from + // /batman/batcave, then the process will try and delete cwd, which we don't want for a number + // of reasons + // console.log('output.path:', resolve(path)); + // console.log('process.cwd:', process.cwd()); + if (isCwd(path)) { + throw new RamdiskPathError( + `Cannot remove current working directory. ${errorInfo} Please run from another path, or choose a different \`output.path\`.` + ); + } + + // if output.path is /batman/batcave, and the compiler context is not set and cwd is + // /batman/batcave, or the context is the same as output.path, then the process will try and + // delete the context directory, which probably contains src, configs, etc. throw an error + // and be overly cautious rather than let the user do something bad. oddly enough, webpack + // doesn't protect against context === output.path. + if (resolve(compiler.context) === resolve(path)) { + throw new RamdiskPathError( + `Cannot remove ${path}. ${errorInfo} Please set the \`context\` to a another path, choose a different \`output.path\`.` + ); + } if (!pkg.name) { // use md5 for a short hash that'll be consistent between wps starts @@ -43,7 +68,7 @@ module.exports = { pkg.name = md5.digest('hex'); } - const newPath = [pkg.name].concat(lastSegment).join(sep); + const newPath = join(pkg.name, lastSegment); // clean up the output path in prep for the ramdisk plugin compiler.options.output.path = newPath; @@ -54,8 +79,9 @@ module.exports = { plugin.apply(compiler); if (existsSync(path)) { - unlinkSync(path); + rm.sync(path); } + symlinkSync(compiler.options.output.path, path); } }; diff --git a/package-lock.json b/package-lock.json index f1918ca..5562e87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6843,8 +6843,7 @@ "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==" }, "is-path-in-cwd": { "version": "2.1.0", @@ -6853,15 +6852,17 @@ "dev": true, "requires": { "is-path-inside": "^2.1.0" - } - }, - "is-path-inside": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", - "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", - "dev": true, - "requires": { - "path-is-inside": "^1.0.2" + }, + "dependencies": { + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" + } + } } }, "is-plain-obj": { @@ -9893,7 +9894,6 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, "requires": { "glob": "^7.1.3" } diff --git a/package.json b/package.json index 97c0910..f516a30 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "connect-history-api-fallback": "^1.5.0", "globby": "^10.0.1", "http-proxy-middleware": "^0.19.0", + "is-path-cwd": "^2.2.0", "is-promise": "^2.1.0", "koa": "^2.5.3", "koa-compress": "^3.0.0", @@ -55,6 +56,7 @@ "opn": "^6.0.0", "p-defer": "^3.0.0", "read-pkg-up": "^6.0.0", + "rimraf": "^2.6.3", "strip-ansi": "^5.0.0", "webpack-plugin-ramdisk": "^0.1.2", "ws": "^7.1.0" diff --git a/test/fixtures/ramdisk/config-context-error.js b/test/fixtures/ramdisk/config-context-error.js new file mode 100644 index 0000000..fa0f821 --- /dev/null +++ b/test/fixtures/ramdisk/config-context-error.js @@ -0,0 +1,29 @@ +const { resolve } = require('path'); + +const getPort = require('get-port'); + +const { WebpackPluginServe: Serve } = require('../../../lib/'); + +module.exports = { + context: __dirname, + entry: ['./app.js', 'webpack-plugin-serve/client'], + mode: 'development', + output: { + filename: './output.js', + path: __dirname, + publicPath: 'output/' + }, + plugins: [ + new Serve({ + host: 'localhost', + port: getPort({ port: 55555 }), + ramdisk: true + }) + ], + resolve: { + alias: { + 'webpack-plugin-serve/client': resolve(__dirname, '../../../client') + } + }, + watch: true +}; diff --git a/test/fixtures/ramdisk/config-cwd-error.js b/test/fixtures/ramdisk/config-cwd-error.js new file mode 100644 index 0000000..b21c810 --- /dev/null +++ b/test/fixtures/ramdisk/config-cwd-error.js @@ -0,0 +1,29 @@ +const { resolve } = require('path'); + +const getPort = require('get-port'); + +const { WebpackPluginServe: Serve } = require('../../../lib/'); + +module.exports = { + context: __dirname, + entry: ['./app.js', 'webpack-plugin-serve/client'], + mode: 'development', + output: { + filename: './output.js', + path: resolve(__dirname, 'cwd-error'), + publicPath: 'output/' + }, + plugins: [ + new Serve({ + host: 'localhost', + port: getPort({ port: 55555 }), + ramdisk: true + }) + ], + resolve: { + alias: { + 'webpack-plugin-serve/client': resolve(__dirname, '../../../client') + } + }, + watch: true +}; diff --git a/test/fixtures/ramdisk/cwd-error/.gitkeep b/test/fixtures/ramdisk/cwd-error/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/ramdisk.test.js b/test/ramdisk.test.js index d5bc0a4..386bf5c 100644 --- a/test/ramdisk.test.js +++ b/test/ramdisk.test.js @@ -1,10 +1,12 @@ const { existsSync } = require('fs'); -const { join } = require('path'); +const { join, resolve } = require('path'); const test = require('ava'); const execa = require('execa'); const strip = require('strip-ansi'); +const fixturePath = join(__dirname, 'fixtures/ramdisk'); + const waitFor = (text, stream) => { return { then(r, f) { @@ -21,7 +23,6 @@ const waitFor = (text, stream) => { }; test('ramdisk', async (t) => { - const fixturePath = join(__dirname, 'fixtures/ramdisk'); const proc = execa('wp', [], { cwd: fixturePath }); const { stderr, stdout } = proc; const pathTest = 'Build being written to '; @@ -39,3 +40,29 @@ test('ramdisk', async (t) => { proc.kill('SIGTERM'); }); + +test('context error', async (t) => { + try { + await execa('wp', ['--config', 'ramdisk/config-context-error.js'], { + cwd: resolve(fixturePath, '..') + }); + } catch (e) { + t.regex(e.stderr, /Please set the `context` to a another path/); + t.is(e.exitCode, 1); + return; + } + t.fail(); +}); + +test('cwd error', async (t) => { + try { + await execa('wp', ['--config', '../config-cwd-error.js'], { + cwd: join(fixturePath, 'cwd-error') + }); + } catch (e) { + t.regex(e.stderr, /Please run from another path/); + t.is(e.exitCode, 1); + return; + } + t.fail(); +}); diff --git a/test/snapshots/plugin.test.js.md b/test/snapshots/plugin.test.js.md index 00b008f..0ef986a 100644 --- a/test/snapshots/plugin.test.js.md +++ b/test/snapshots/plugin.test.js.md @@ -83,6 +83,7 @@ Generated by [AVA](https://ava.li). 'test/fixtures/multi', 'test/fixtures/proxy', 'test/fixtures/ramdisk', + 'test/fixtures/ramdisk/cwd-error', 'test/fixtures/simple', 'test/fixtures/wait-for-build', ] diff --git a/test/snapshots/plugin.test.js.snap b/test/snapshots/plugin.test.js.snap index fbea4799aad0d3c862434d30376259d4f82c8463..acecc92449f95df23204e20c79c722bea1a2ac76 100644 GIT binary patch literal 927 zcmV;Q17Q3?RzV-jWdNj4rhY5-(3S z504#M9&fmhnRN`fHhTKY%p3h%TT^UhN81C8nRO9pxc#ib{Bgbe#n*Q$cUl&&U}ilK zL`Xn>RufA&oQ9_gi~!TXJK!@Q!fPD_nt-doO<)Lk1iS_ofS*7V`y$wPxvPgHO^ofI z;cyt?8iYfoZxnlKv4F5Qf~BOE)hRIyW)Nz)Wq*dqDMG8PhBAs_YP8rYt7?~=yus|A zFy|#?vb4Oy7Z)>{VOCBZRFz)RK~zmn*;#jC9P=P#=T)_CW<2jO2D3^krILb7313Xp zNzR$8;0P0SjhcLGbgFgRty%N(ekx~Eicw|LK7%CllsM~6I_mihQ#O_4njo;||JIYR zI152@zy}~IaL4O$A8%bLm#YQLTWZbclBS~N*ru#MEJDJbMo4;;PwaCimddN%bCk+O zELp!op%9xXf!l^xCA~zoTdU;K8h;i!IZLcRwFT0p!}P>;HQ%k|;s&9;gmvtK;OH1k zX{5jUwbYc3Gz%pfEk;uA~j=}d6jbY@~*otdwwGs|H81w=${ zPu_plnLt&YIVEnD&iJb6j2A_4jY$kM0h>2r8V!d8c@D$#7(%Y&!LH*8vTp4xRkq)} zYCiv2c(wv1X}b$N0X_jWc!L@~zDCqlBazLkrn2gTaTO=Ht9?bw$!_T$x6|s4wcG^D zt-hjLB3Veq38fmf0z`Z4+yRCH2S+R~ujRGR?NyK!GoIFHyeqG$sXxR8@<6Bx007V= ByQ=^I literal 911 zcmV;A191F7RzVEQr#BAkxT)iqJwY zMJNcR6`=_A(1RzfA_YAZM7(+uDpU|FdMNls!Iw$0?oN}`3T^3+P2RkDZ{M3Ye=>>? z@}Qa7y))gz(GK6;sh+u)eJdCh|8@%qJ()iq)^i7%R)#;GU26I6!_<09M5s5i((P}3 zak71M;?U}3^F2(h6Tr3cGhgOj>)*QCqH8<4?qf`?%Ruw(r_I)n>*?oT->%*1SiXX( z^|K!#9{FfaEaFfKo(eDq%mQzLPk;cgbr5I+t^zlK5#S;43RnVu0uk&DWAEj7A4ymk z+aE)r5W)=z2aEp^%r#;jVNV!~2`#G|#5AdaZ(x>v86qW#QDZfjkxff83Z0Uo#HGXy zYUe_X7oW)*r4=^0kkL%5dgy>6_mdu?Xj0OSx(nkdhmajt(bCj--eC-6Sx|jDEQZ^}@HH!9{B#|?SGvBl$pVzb`OHQoY1lHW& zd?FU+VbcQe0f_L-@pA6tZ7RlcwSanyojEmO$(l-ws(hh4M9j57(4%Z%uRE|Z$_1aXJqc?==f@nF~S1ZcN*7Bky# zUNfHeG(0B%v6N=S;yGDK{sHNX)(CS7000y?tQ!CT diff --git a/test/snapshots/ramdisk.test.js.md b/test/snapshots/ramdisk.test.js.md index 02d1150..2591098 100644 --- a/test/snapshots/ramdisk.test.js.md +++ b/test/snapshots/ramdisk.test.js.md @@ -8,5 +8,32 @@ Generated by [AVA](https://ava.li). > Snapshot 1 - `/Volumes/wps/acd3b3c865a8bcadc8f64985be65bb62/output␊ - ` + Error { + all: `/Users/powella/code/webpack/webpack-plugin-serve/test/fixtures/ramdisk␊ + /Users/powella/code/webpack/webpack-plugin-serve/test/fixtures␊ + RamdiskPathError: Cannot remove /Users/powella/code/webpack/webpack-plugin-serve/test/fixtures/ramdisk. The ramdisk option creates a symlink from `output.path`, to the ramdisk build output path, and must remove any existing `output.path` to do so. Please set the `context` to a another path, choose a different `output.path`.␊ + at WebpackPluginServe.init (/Users/powella/code/webpack/webpack-plugin-serve/lib/plugins/ramdisk.js:59:13)␊ + at WebpackPluginServe.hook (/Users/powella/code/webpack/webpack-plugin-serve/lib/index.js:177:25)␊ + at WebpackPluginServe.apply (/Users/powella/code/webpack/webpack-plugin-serve/lib/index.js:128:10)␊ + at webpack (/Users/powella/code/webpack/webpack-plugin-serve/node_modules/webpack/lib/webpack.js:49:13)␊ + at run (/Users/powella/code/webpack/webpack-plugin-serve/node_modules/webpack-nano/lib/compiler.js:16:20)␊ + at doeet (/Users/powella/code/webpack/webpack-plugin-serve/node_modules/webpack-nano/bin/wp.js:78:3)`, + command: 'wp --config ramdisk/config-context-error.js', + exitCode: 1, + exitCodeName: 'EPERM', + failed: true, + isCanceled: false, + killed: false, + signal: undefined, + stderr: `RamdiskPathError: Cannot remove /Users/powella/code/webpack/webpack-plugin-serve/test/fixtures/ramdisk. The ramdisk option creates a symlink from `output.path`, to the ramdisk build output path, and must remove any existing `output.path` to do so. Please set the `context` to a another path, choose a different `output.path`.␊ + at WebpackPluginServe.init (/Users/powella/code/webpack/webpack-plugin-serve/lib/plugins/ramdisk.js:59:13)␊ + at WebpackPluginServe.hook (/Users/powella/code/webpack/webpack-plugin-serve/lib/index.js:177:25)␊ + at WebpackPluginServe.apply (/Users/powella/code/webpack/webpack-plugin-serve/lib/index.js:128:10)␊ + at webpack (/Users/powella/code/webpack/webpack-plugin-serve/node_modules/webpack/lib/webpack.js:49:13)␊ + at run (/Users/powella/code/webpack/webpack-plugin-serve/node_modules/webpack-nano/lib/compiler.js:16:20)␊ + at doeet (/Users/powella/code/webpack/webpack-plugin-serve/node_modules/webpack-nano/bin/wp.js:78:3)`, + stdout: `/Users/powella/code/webpack/webpack-plugin-serve/test/fixtures/ramdisk␊ + /Users/powella/code/webpack/webpack-plugin-serve/test/fixtures`, + timedOut: false, + message: 'Command failed with exit code 1 (EPERM): wp --config ramdisk/config-context-error.js', + } diff --git a/test/snapshots/ramdisk.test.js.snap b/test/snapshots/ramdisk.test.js.snap index 9520ba898387fb9a6c66712e819f7da2d38898b6..02991f326d8e72f1dcca138d9dff5f023584e4f4 100644 GIT binary patch literal 736 zcmV<60w4WBRzV|M*dZqgGHQpJ0~ zv2TDlfW!mv0^E58Zj9|XrLJ13KL>=m(#ZSs?R>MNnNJ2n2qkZKo*tFk&)$9c_3^{z z=c7GJlJUDrNQqR^IlW6~9Q+EjACrXKD--erjibFs`-Jut?I+r|+k|*{_YiHKPR!Br zMii-No=)XcO7mH*RwHzV&}l+v6Yw2cBD6e5OU(C2^NHt^)@#ipZG~#UeVG{96zGxGQ8Gf&1JtTpP<1LlZ|_TM-Lfq5IXVxv6etZraTB(%5ZSXHqHy5f9Wp zhwF*50oy$eqXnqY2qnRZI72ir&u;EZ?c56(|o*2($Nr77+AP)7JbpNvW?>$?rD4VvE5u*JckY= z?O&2kNS6;2l4h%AFRz}*!otu$xH8T1n%#UbrWswhgjb1(oj|#Zf)nX*=9P8}K-AD7GS_tK5v-3Z=|;Qd#E zm-IN6XWrw7UDUe81vGTnrMFukP74J2Ve6BbgH SU9{l>>i!3`BU#583jhG*uwKLf literal 146 zcmZ<^b5sbF6wv zJS+7eaR2k8i^}%LuHGym>2N@@W2WSdgE?+tY>sZhe>eP@bLq~Nq`#k Date: Sat, 20 Jul 2019 12:34:20 -0400 Subject: [PATCH 7/8] docs: add note about directory removal --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bfa922..605b7eb 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ Type: `boolean`
Default: `false`
Support: MacOS and Linux, Windows with WSL 2.0. -If `true`, will apply [`webpack-plugin-ramdisk`](https://www.npmjs.com/package/webpack-plugin-ramdisk) to the build. `output` configuration does not have to be modified, a symlink will be created from the original output path to the output path on the ramdisk. +If `true`, will apply [`webpack-plugin-ramdisk`](https://www.npmjs.com/package/webpack-plugin-ramdisk) to the build. `output` configuration does not have to be modified, a symlink will be created from the original output path to the output path on the ramdisk. _**Note:** This will remove an existing directory at the defined output path._ Leveraging this option can result in significant reduction of build time, which is especially useful when using `hmr: true` or `liveReload: true`. Typical build times can be cut by 25-32% or more depending on hardware and webpack configuration. This is also recommended for users with SSD, as it reduces hard disk thrashing. From 490e4ccec9aa65f228b1964b9a6b1cd33d54179c Mon Sep 17 00:00:00 2001 From: shellscape Date: Wed, 24 Jul 2019 08:31:50 -0400 Subject: [PATCH 8/8] chore: pick package-lock.json from master --- package-lock.json | 291 +++++++++++++--------------------------------- 1 file changed, 79 insertions(+), 212 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5562e87..4dab6d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -224,6 +225,7 @@ "version": "7.5.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", @@ -741,11 +743,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.2.tgz", "integrity": "sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ==" }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" - }, "@types/semver": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.1.tgz", @@ -3004,16 +3001,6 @@ "trim-newlines": "^2.0.0" } }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - }, "text-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.0.0.tgz", @@ -3116,18 +3103,6 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" - }, - "dependencies": { - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } } }, "through2": { @@ -3182,16 +3157,6 @@ "redent": "^2.0.0", "trim-newlines": "^2.0.0" } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } } } }, @@ -3302,18 +3267,6 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" - }, - "dependencies": { - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } } }, "readable-stream": { @@ -4190,6 +4143,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -4224,6 +4178,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -4727,7 +4682,8 @@ "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true }, "eventemitter3": { "version": "3.1.2", @@ -4754,6 +4710,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/execa/-/execa-2.0.3.tgz", "integrity": "sha512-iM124nlyGSrXmuyZF1EMe83ESY2chIYVyDRZKgmcDynid2Q2v/+GuE7gNMl6Sy9Niwf4MC0DDxagOxeMPjuLsw==", + "dev": true, "requires": { "cross-spawn": "^6.0.5", "get-stream": "^5.0.0", @@ -4770,6 +4727,7 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -4782,6 +4740,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, "requires": { "pump": "^3.0.0" } @@ -4789,17 +4748,20 @@ "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true }, "npm-run-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz", "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==", + "dev": true, "requires": { "path-key": "^3.0.0" }, @@ -4807,7 +4769,8 @@ "path-key": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz", - "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==" + "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==", + "dev": true } } }, @@ -4815,6 +4778,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, "requires": { "mimic-fn": "^2.1.0" } @@ -4822,12 +4786,14 @@ "p-finally": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", - "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==" + "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", + "dev": true }, "semver": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true } } }, @@ -6082,16 +6048,6 @@ "redent": "^2.0.0", "trim-newlines": "^2.0.0" } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } } } }, @@ -6138,18 +6094,6 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" - }, - "dependencies": { - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } } }, "semver": { @@ -6422,7 +6366,8 @@ "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true }, "http-assert": { "version": "1.4.1", @@ -6658,7 +6603,8 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true }, "is-binary-path": { "version": "1.0.1", @@ -6843,7 +6789,8 @@ "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==" + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true }, "is-path-in-cwd": { "version": "2.1.0", @@ -6852,17 +6799,15 @@ "dev": true, "requires": { "is-path-inside": "^2.1.0" - }, - "dependencies": { - "is-path-inside": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", - "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", - "dev": true, - "requires": { - "path-is-inside": "^1.0.2" - } - } + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" } }, "is-plain-obj": { @@ -6965,7 +6910,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", @@ -7116,7 +7062,8 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "js-yaml": { "version": "3.13.1", @@ -7143,7 +7090,8 @@ "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true }, "json-schema-traverse": { "version": "0.4.1", @@ -7371,11 +7319,6 @@ "type-check": "~0.3.2" } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" - }, "lint-staged": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.2.0.tgz", @@ -8051,18 +7994,6 @@ "redent": "^2.0.0", "trim-newlines": "^2.0.0", "yargs-parser": "^10.0.0" - }, - "dependencies": { - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } } }, "merge-source-map": { @@ -8085,7 +8016,8 @@ "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true }, "merge2": { "version": "1.2.3", @@ -8345,7 +8277,8 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "node-fetch": { "version": "2.6.0", @@ -8396,6 +8329,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -8406,7 +8340,8 @@ "semver": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true } } }, @@ -9009,12 +8944,14 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "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==" + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true }, "path-to-regexp": { "version": "1.7.0", @@ -9353,6 +9290,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -9496,87 +9434,13 @@ } }, "read-pkg-up": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-6.0.0.tgz", - "integrity": "sha512-odtTvLl+EXo1eTsMnoUHRmg/XmXdTkwXVxy4VFE9Kp6cCq7b3l7QMdBndND3eAFzrbSAXC/WCUOQQ9rLjifKZw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, "requires": { - "find-up": "^4.0.0", - "read-pkg": "^5.1.1", - "type-fest": "^0.5.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "parse-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" - } - } - } + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" } }, "readable-stream": { @@ -9777,6 +9641,7 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, "requires": { "path-parse": "^1.0.6" } @@ -9894,6 +9759,7 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -10063,6 +9929,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -10070,12 +9937,14 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true }, "slash": { "version": "3.0.0", @@ -10264,6 +10133,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -10272,12 +10142,14 @@ "spdx-exceptions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -10286,7 +10158,8 @@ "spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true }, "split": { "version": "1.0.1", @@ -10713,7 +10586,8 @@ "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true }, "strip-indent": { "version": "2.0.0", @@ -11111,7 +10985,8 @@ "type-fest": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz", - "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==" + "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==", + "dev": true }, "type-is": { "version": "1.6.18", @@ -11381,6 +11256,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -11478,16 +11354,6 @@ } } }, - "webpack-plugin-ramdisk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/webpack-plugin-ramdisk/-/webpack-plugin-ramdisk-0.1.2.tgz", - "integrity": "sha512-qH76u/Z6WsqCANtcfMMeUrn1TjQcgFK5rKTIL4ipRm5P69ImgdQGjIFmiEwc2TICMIeM52I1F0Ww19akTeta/g==", - "requires": { - "@hapi/joi": "^15.1.0", - "chalk": "^2.4.1", - "execa": "^2.0.0" - } - }, "webpack-sources": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", @@ -11516,6 +11382,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { "isexe": "^2.0.0" }