diff --git a/.eslintrc.js b/.eslintrc.js index 095ce2a5..29e7717f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,4 @@ module.exports = { root: true, - extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'], + extends: ["@webpack-contrib/eslint-config-webpack", "prettier"], }; diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 4f14003f..00000000 --- a/.prettierrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { singleQuote: true }; diff --git a/README.md b/README.md index 81d995eb..e388ef82 100644 --- a/README.md +++ b/README.md @@ -30,14 +30,14 @@ Then add the plugin to your `webpack` config. For example: **webpack.config.js** ```js -const CopyPlugin = require('copy-webpack-plugin'); +const CopyPlugin = require("copy-webpack-plugin"); module.exports = { plugins: [ new CopyPlugin({ patterns: [ - { from: 'source', to: 'dest' }, - { from: 'other', to: 'public' }, + { from: "source", to: "dest" }, + { from: "other", to: "public" }, ], }), ], @@ -57,14 +57,14 @@ The plugin's signature: **webpack.config.js** ```js -const CopyPlugin = require('copy-webpack-plugin'); +const CopyPlugin = require("copy-webpack-plugin"); module.exports = { plugins: [ new CopyPlugin({ patterns: [ - { from: 'source', to: 'dest' }, - { from: 'other', to: 'public' }, + { from: "source", to: "dest" }, + { from: "other", to: "public" }, ], options: { concurrency: 100, @@ -111,18 +111,18 @@ module.exports = { plugins: [ new CopyPlugin({ patterns: [ - 'relative/path/to/file.ext', - 'relative/path/to/dir', - path.resolve(__dirname, 'src', 'file.ext'), - path.resolve(__dirname, 'src', 'dir'), - '**/*', + "relative/path/to/file.ext", + "relative/path/to/dir", + path.resolve(__dirname, "src", "file.ext"), + path.resolve(__dirname, "src", "dir"), + "**/*", { - from: '**/*', + from: "**/*", }, // If absolute path is a `glob` we replace backslashes with forward slashes, because only forward slashes can be used in the `glob` path.posix.join( - path.resolve(__dirname, 'src').replace(/\\/g, '/'), - '*.txt' + path.resolve(__dirname, "src").replace(/\\/g, "/"), + "*.txt" ), ], }), @@ -140,7 +140,7 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, 'file.txt'), + from: path.resolve(__dirname, "file.txt"), }, ], }), @@ -159,8 +159,8 @@ module.exports = { { // If absolute path is a `glob` we replace backslashes with forward slashes, because only forward slashes can be used in the `glob` from: path.posix.join( - path.resolve(__dirname, 'fixtures').replace(/\\/g, '/'), - '*.txt' + path.resolve(__dirname, "fixtures").replace(/\\/g, "/"), + "*.txt" ), }, ], @@ -191,16 +191,16 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: '**/*', - to: 'relative/path/to/dest/', + from: "**/*", + to: "relative/path/to/dest/", }, { - from: '**/*', - to: '/absolute/path/to/dest/', + from: "**/*", + to: "/absolute/path/to/dest/", }, { - from: '**/*', - to: '[path][name].[contenthash].[ext]', + from: "**/*", + to: "[path][name].[contenthash].[ext]", }, ], }), @@ -227,9 +227,9 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.txt', - to: 'dest/', - context: 'app/', + from: "src/*.txt", + to: "dest/", + context: "app/", }, ], }), @@ -267,11 +267,11 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'public/**/*', + from: "public/**/*", globOptions: { dot: true, gitignore: true, - ignore: ['**/file.*', '**/ignored-directory/**'], + ignore: ["**/file.*", "**/ignored-directory/**"], }, }, ], @@ -290,19 +290,19 @@ Default: `undefined` **webpack.config.js** ```js -const fs = require('fs').promise; +const fs = require("fs").promise; module.exports = { plugins: [ new CopyPlugin({ patterns: [ { - from: 'public/**/*', + from: "public/**/*", filter: async (resourcePath) => { const data = await fs.promises.readFile(resourcePath); const content = data.toString(); - if (content === 'my-custom-content') { + if (content === "my-custom-content") { return false; } @@ -341,9 +341,9 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'path/to/file.txt', - to: 'directory/with/extension.ext', - toType: 'dir', + from: "path/to/file.txt", + to: "directory/with/extension.ext", + toType: "dir", }, ], }), @@ -361,9 +361,9 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'path/to/file.txt', - to: 'file/without/extension', - toType: 'file', + from: "path/to/file.txt", + to: "file/without/extension", + toType: "file", }, ], }), @@ -381,9 +381,9 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/', - to: 'dest/[name].[hash].[ext]', - toType: 'template', + from: "src/", + to: "dest/[name].[hash].[ext]", + toType: "template", }, ], }), @@ -406,8 +406,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/**/*', - to: 'dest/', + from: "src/**/*", + to: "dest/", force: true, }, ], @@ -433,8 +433,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/**/*', - to: 'dest/', + from: "src/**/*", + to: "dest/", flatten: true, }, ], @@ -458,8 +458,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", // The `content` argument is a [`Buffer`](https://nodejs.org/api/buffer.html) object, it could be converted to a `String` to be processed using `content.toString()` // The `absoluteFrom` argument is a `String`, it is absolute path from where the file is being copied transform(content, absoluteFrom) { @@ -480,8 +480,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transform(content, path) { return Promise.resolve(optimize(content)); }, @@ -512,8 +512,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transform(content, path) { return optimize(content); }, @@ -537,13 +537,13 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transform(content, path) { return optimize(content); }, // Should be absolute - cacheTransform: path.resolve(__dirname, 'cache-directory'), + cacheTransform: path.resolve(__dirname, "cache-directory"), }, ], }), @@ -563,17 +563,17 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transform(content, path) { return optimize(content); }, cacheTransform: { - directory: path.resolve(__dirname, 'cache-directory'), + directory: path.resolve(__dirname, "cache-directory"), keys: { // May be useful for invalidating cache based on external values // For example, you can invalid cache based on `process.version` - { node: process.version } - key: 'value', + key: "value", }, }, }, @@ -595,13 +595,13 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transform(content, path) { return optimize(content); }, cacheTransform: { - directory: path.resolve(__dirname, 'cache-directory'), + directory: path.resolve(__dirname, "cache-directory"), keys: (defaultCacheKeys, absoluteFrom) => { const keys = getCustomCacheInvalidationKeysSync(); @@ -628,13 +628,13 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transform(content, path) { return optimize(content); }, cacheTransform: { - directory: path.resolve(__dirname, 'cache-directory'), + directory: path.resolve(__dirname, "cache-directory"), keys: async (defaultCacheKeys, absoluteFrom) => { const keys = await getCustomCacheInvalidationKeysAsync(); @@ -670,10 +670,10 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transformPath(targetPath, absolutePath) { - return 'newPath'; + return "newPath"; }, }, ], @@ -690,10 +690,10 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/*.png', - to: 'dest/', + from: "src/*.png", + to: "dest/", transformPath(targetPath, absolutePath) { - return Promise.resolve('newPath'); + return Promise.resolve("newPath"); }, }, ], @@ -715,7 +715,7 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, 'missing-file.txt'), + from: path.resolve(__dirname, "missing-file.txt"), noErrorOnMissing: true, }, ], @@ -770,7 +770,7 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'src/directory-nested/**/*', + from: "src/directory-nested/**/*", }, ], }), @@ -795,8 +795,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: '**/*', - context: path.resolve(__dirname, 'src', 'directory-nested'), + from: "**/*", + context: path.resolve(__dirname, "src", "directory-nested"), }, ], }), @@ -821,7 +821,7 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, 'src', 'directory-nested'), + from: path.resolve(__dirname, "src", "directory-nested"), }, ], }), @@ -846,8 +846,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: '**/*', - context: path.resolve(__dirname, 'src', 'directory-nested'), + from: "**/*", + context: path.resolve(__dirname, "src", "directory-nested"), }, ], }), @@ -872,9 +872,9 @@ module.exports = { { from: path.resolve( __dirname, - 'src', - 'directory-nested', - 'nested-file.txt' + "src", + "directory-nested", + "nested-file.txt" ), }, ], @@ -899,8 +899,8 @@ module.exports = { new CopyPlugin({ patterns: [ { - from: 'nested-file.txt', - context: path.resolve(__dirname, 'src', 'directory-nested'), + from: "nested-file.txt", + context: path.resolve(__dirname, "src", "directory-nested"), }, ], }), @@ -925,15 +925,15 @@ module.exports = { patterns: [ { from: path.posix.join( - path.resolve(__dirname, 'src').replace(/\\/g, '/'), - '**/*' + path.resolve(__dirname, "src").replace(/\\/g, "/"), + "**/*" ), globOptions: { ignore: [ // Ignore all `txt` files - '**/*.txt', + "**/*.txt", // Ignore all files in all subdirectories - '**/subdir/**', + "**/subdir/**", ], }, }, diff --git a/babel.config.js b/babel.config.js index 190c3380..65000d45 100644 --- a/babel.config.js +++ b/babel.config.js @@ -7,10 +7,10 @@ module.exports = (api) => { return { presets: [ [ - '@babel/preset-env', + "@babel/preset-env", { targets: { - node: '10.13.0', + node: "10.13.0", }, }, ], diff --git a/commitlint.config.js b/commitlint.config.js index 84dcb122..69b4242c 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,3 +1,3 @@ module.exports = { - extends: ['@commitlint/config-conventional'], + extends: ["@commitlint/config-conventional"], }; diff --git a/globalSetup.js b/globalSetup.js index d053c8b1..4476735f 100644 --- a/globalSetup.js +++ b/globalSetup.js @@ -1,17 +1,17 @@ -const path = require('path'); -const fs = require('fs'); +const path = require("path"); +const fs = require("fs"); // eslint-disable-next-line import/no-extraneous-dependencies -const mkdirp = require('mkdirp'); +const mkdirp = require("mkdirp"); -const removeIllegalCharacterForWindows = require('./test/helpers/removeIllegalCharacterForWindows'); +const removeIllegalCharacterForWindows = require("./test/helpers/removeIllegalCharacterForWindows"); -const baseDir = path.resolve(__dirname, 'test/fixtures'); +const baseDir = path.resolve(__dirname, "test/fixtures"); const specialFiles = { - '[special$directory]/nested/nestedfile.txt': '', - '[special$directory]/(special-*file).txt': 'special', - '[special$directory]/directoryfile.txt': 'new', + "[special$directory]/nested/nestedfile.txt": "", + "[special$directory]/(special-*file).txt": "special", + "[special$directory]/directoryfile.txt": "new", }; module.exports = () => { diff --git a/husky.config.js b/husky.config.js index 4c2ec3ae..6cf9b3fc 100644 --- a/husky.config.js +++ b/husky.config.js @@ -1,6 +1,6 @@ module.exports = { hooks: { - 'pre-commit': 'lint-staged', - 'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS', + "pre-commit": "lint-staged", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", }, }; diff --git a/jest.config.js b/jest.config.js index 079a3cb6..397e0d29 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,4 @@ module.exports = { - testEnvironment: 'node', - globalSetup: '/globalSetup.js', + testEnvironment: "node", + globalSetup: "/globalSetup.js", }; diff --git a/lint-staged.config.js b/lint-staged.config.js index c417cb1b..dc1bf519 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,4 +1,4 @@ module.exports = { - '*.js': ['prettier --write', 'eslint --fix'], - '*.{json,md,yml,css,ts}': ['prettier --write'], + "*.js": ["eslint --fix", "prettier --write"], + "*.{json,md,yml,css,ts}": ["prettier --write"], }; diff --git a/package-lock.json b/package-lock.json index a7f4c0e1..9c9f5766 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,9 +62,9 @@ } }, "@babel/compat-data": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz", - "integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz", + "integrity": "sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg==", "dev": true }, "@babel/core": { @@ -121,12 +121,12 @@ } }, "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -159,14 +159,14 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz", - "integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", + "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", "dev": true, "requires": { - "@babel/compat-data": "^7.12.1", + "@babel/compat-data": "^7.12.5", "@babel/helper-validator-option": "^7.12.1", - "browserslist": "^4.12.0", + "browserslist": "^4.14.5", "semver": "^5.5.0" }, "dependencies": { @@ -261,12 +261,12 @@ } }, "@babel/helper-module-imports": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", - "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "dev": true, "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.5" } }, "@babel/helper-module-transforms": { @@ -322,15 +322,15 @@ } }, "@babel/helper-replace-supers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz", - "integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.12.1", "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/helper-simple-access": { @@ -385,14 +385,14 @@ } }, "@babel/helpers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz", - "integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", "dev": true, "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/highlight": { @@ -407,9 +407,9 @@ } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -484,9 +484,9 @@ } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz", - "integrity": "sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.5.tgz", + "integrity": "sha512-UiAnkKuOrCyjZ3sYNHlRlfuZJbBHknMQ9VMwVeX97Ofwx7RpD6gS2HfqTCh8KNUQgcOm8IKt103oR4KIjh7Q8g==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -1081,9 +1081,9 @@ } }, "@babel/runtime": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz", - "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -1101,17 +1101,17 @@ } }, "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -1135,9 +1135,9 @@ } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1598,16 +1598,16 @@ "dev": true }, "@jest/console": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.1.tgz", - "integrity": "sha512-cjqcXepwC5M+VeIhwT6Xpi/tT4AiNzlIx8SMJ9IihduHnsSrnWNvTBfKIpmqOOCNOPqtbBx6w2JqfoLOJguo8g==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", + "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^26.6.1", - "jest-util": "^26.6.1", + "jest-message-util": "^26.6.2", + "jest-util": "^26.6.2", "slash": "^3.0.0" }, "dependencies": { @@ -1663,34 +1663,34 @@ } }, "@jest/core": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.1.tgz", - "integrity": "sha512-p4F0pgK3rKnoS9olXXXOkbus1Bsu6fd8pcvLMPsUy4CVXZ8WSeiwQ1lK5hwkCIqJ+amZOYPd778sbPha/S8Srw==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", + "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", "dev": true, "requires": { - "@jest/console": "^26.6.1", - "@jest/reporters": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/reporters": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.1", - "jest-config": "^26.6.1", - "jest-haste-map": "^26.6.1", - "jest-message-util": "^26.6.1", + "jest-changed-files": "^26.6.2", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.1", - "jest-resolve-dependencies": "^26.6.1", - "jest-runner": "^26.6.1", - "jest-runtime": "^26.6.1", - "jest-snapshot": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", - "jest-watcher": "^26.6.1", + "jest-resolve": "^26.6.2", + "jest-resolve-dependencies": "^26.6.3", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "jest-watcher": "^26.6.2", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", "rimraf": "^3.0.0", @@ -1750,53 +1750,53 @@ } }, "@jest/environment": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.1.tgz", - "integrity": "sha512-GNvHwkOFJtNgSwdzH9flUPzF9AYAZhUg124CBoQcwcZCM9s5TLz8Y3fMtiaWt4ffbigoetjGk5PU2Dd8nLrSEw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", + "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", "dev": true, "requires": { - "@jest/fake-timers": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.6.1" + "jest-mock": "^26.6.2" } }, "@jest/fake-timers": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.1.tgz", - "integrity": "sha512-T/SkMLgOquenw/nIisBRD6XAYpFir0kNuclYLkse5BpzeDUukyBr+K31xgAo9M0hgjU9ORlekAYPSzc0DKfmKg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", + "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@sinonjs/fake-timers": "^6.0.1", "@types/node": "*", - "jest-message-util": "^26.6.1", - "jest-mock": "^26.6.1", - "jest-util": "^26.6.1" + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" } }, "@jest/globals": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.1.tgz", - "integrity": "sha512-acxXsSguuLV/CeMYmBseefw6apO7NuXqpE+v5r3yD9ye2PY7h1nS20vY7Obk2w6S7eJO4OIAJeDnoGcLC/McEQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", + "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", "dev": true, "requires": { - "@jest/environment": "^26.6.1", - "@jest/types": "^26.6.1", - "expect": "^26.6.1" + "@jest/environment": "^26.6.2", + "@jest/types": "^26.6.2", + "expect": "^26.6.2" } }, "@jest/reporters": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.1.tgz", - "integrity": "sha512-J6OlXVFY3q1SXWJhjme5i7qT/BAZSikdOK2t8Ht5OS32BDo6KfG5CzIzzIFnAVd82/WWbc9Hb7SJ/jwSvVH9YA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", + "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", @@ -1807,16 +1807,16 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.1", - "jest-resolve": "^26.6.1", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-haste-map": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", "terminal-link": "^2.0.0", - "v8-to-istanbul": "^6.0.1" + "v8-to-istanbul": "^7.0.0" }, "dependencies": { "ansi-styles": { @@ -1871,9 +1871,9 @@ } }, "@jest/source-map": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.5.0.tgz", - "integrity": "sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", + "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", "dev": true, "requires": { "callsites": "^3.0.0", @@ -1882,46 +1882,46 @@ } }, "@jest/test-result": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.1.tgz", - "integrity": "sha512-wqAgIerIN2gSdT2A8WeA5+AFh9XQBqYGf8etK143yng3qYd0mF0ie2W5PVmgnjw4VDU6ammI9NdXrKgNhreawg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", + "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", "dev": true, "requires": { - "@jest/console": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/types": "^26.6.2", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.1.tgz", - "integrity": "sha512-0csqA/XApZiNeTIPYh6koIDCACSoR6hi29T61tKJMtCZdEC+tF3PoNt7MS0oK/zKC6daBgCbqXxia5ztr/NyCQ==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", + "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", "dev": true, "requires": { - "@jest/test-result": "^26.6.1", + "@jest/test-result": "^26.6.2", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.1", - "jest-runner": "^26.6.1", - "jest-runtime": "^26.6.1" + "jest-haste-map": "^26.6.2", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3" } }, "@jest/transform": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.1.tgz", - "integrity": "sha512-oNFAqVtqRxZRx6vXL3I4bPKUK0BIlEeaalkwxyQGGI8oXDQBtYQBpiMe5F7qPs4QdvvFYB42gPGIMMcxXaBBxQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", + "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "babel-plugin-istanbul": "^6.0.0", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.1", + "jest-haste-map": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.1", + "jest-util": "^26.6.2", "micromatch": "^4.0.2", "pirates": "^4.0.1", "slash": "^3.0.0", @@ -1981,9 +1981,9 @@ } }, "@jest/types": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.1.tgz", - "integrity": "sha512-ywHavIKNpAVrStiRY5wiyehvcktpijpItvGiK72RAn5ctqmzvPk8OvKnvHeBqa1XdQr959CTWAJMqxI8BTibyg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", @@ -2223,9 +2223,9 @@ } }, "@types/babel__core": { - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.10.tgz", - "integrity": "sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw==", + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", + "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -2245,9 +2245,9 @@ } }, "@types/babel__template": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.3.tgz", - "integrity": "sha512-uCoznIPDmnickEi6D0v11SBpW0OuVqHJCa7syXqQHy5uktSCreIlt0iglsCnmvz8yCb38hGcWeseA8cWJSwv5Q==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz", + "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -2350,15 +2350,15 @@ "dev": true }, "@types/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", + "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", "dev": true }, "@types/node": { - "version": "14.14.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.5.tgz", - "integrity": "sha512-H5Wn24s/ZOukBmDn03nnGTp18A60ny9AmCwnEcgJiTgSGsCO7k+NWP7zjCCbhlcnVCoI+co52dUAt9GMhOSULw==", + "version": "14.14.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", + "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", "dev": true }, "@types/normalize-package-data": { @@ -2932,27 +2932,6 @@ "define-properties": "^1.1.3", "es-abstract": "^1.17.0", "is-string": "^1.0.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "array-union": { @@ -2974,27 +2953,6 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "arrify": { @@ -3062,9 +3020,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "babel-code-frame": { @@ -3127,16 +3085,16 @@ } }, "babel-jest": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.1.tgz", - "integrity": "sha512-duMWEOKrSBYRVTTNpL2SipNIWnZOjP77auOBMPQ3zXAdnDbyZQWU8r/RxNWpUf9N6cgPFecQYelYLytTVXVDtA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", + "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", "dev": true, "requires": { - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/babel__core": "^7.1.7", "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.5.0", + "babel-preset-jest": "^26.6.2", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "slash": "^3.0.0" @@ -3216,9 +3174,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz", - "integrity": "sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", + "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", "dev": true, "requires": { "@babel/template": "^7.3.3", @@ -3228,9 +3186,9 @@ } }, "babel-preset-current-node-syntax": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", - "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz", + "integrity": "sha512-mGkvkpocWJes1CmMKtgGUwCeeq0pOhALyymozzDWYomHTbDLwueDYG6p4TK1YOeYHCzBzYPsWkgTto10JubI1Q==", "dev": true, "requires": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -3243,17 +3201,18 @@ "@babel/plugin-syntax-numeric-separator": "^7.8.3", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" } }, "babel-preset-jest": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz", - "integrity": "sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", + "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^26.5.0", - "babel-preset-current-node-syntax": "^0.1.3" + "babel-plugin-jest-hoist": "^26.6.2", + "babel-preset-current-node-syntax": "^1.0.0" } }, "balanced-match": { @@ -3371,15 +3330,16 @@ "dev": true }, "browserslist": { - "version": "4.14.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", - "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", + "version": "4.14.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", + "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001135", - "electron-to-chromium": "^1.3.571", - "escalade": "^3.1.0", - "node-releases": "^1.1.61" + "caniuse-lite": "^1.0.30001157", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.591", + "escalade": "^3.1.1", + "node-releases": "^1.1.66" } }, "bser": { @@ -3438,6 +3398,16 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3462,9 +3432,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001151", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001151.tgz", - "integrity": "sha512-Zh3sHqskX6mHNrqUerh+fkf0N72cMxrmflzje/JyVImfpknscMnkeJrlFGJcqTmaa0iszdYptGpWMJCRQDkBVw==", + "version": "1.0.30001157", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001157.tgz", + "integrity": "sha512-gOerH9Wz2IRZ2ZPdMfBvyOi3cjaz4O4dgNwPGzx8EhqAs4+2IL/O+fJsbt+znSigujoZG8bVcIAUM/I/E5K3MA==", "dev": true }, "capture-exit": { @@ -3579,9 +3549,9 @@ "dev": true }, "cjs-module-lexer": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.4.3.tgz", - "integrity": "sha512-5RLK0Qfs0PNDpEyBXIr3bIT1Muw3ojSlvpw6dAmkUcO0+uTrsBn7GuEIgx40u+OzbCBLDta7nvmud85P4EmTsQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", + "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", "dev": true }, "class-utils": { @@ -3722,6 +3692,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3829,9 +3805,9 @@ } }, "conventional-changelog-angular": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", - "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", + "integrity": "sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -3839,18 +3815,18 @@ } }, "conventional-changelog-atom": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.7.tgz", - "integrity": "sha512-7dOREZwzB+tCEMjRTDfen0OHwd7vPUdmU0llTy1eloZgtOP4iSLVzYIQqfmdRZEty+3w5Jz+AbhfTJKoKw1JeQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz", + "integrity": "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-codemirror": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.7.tgz", - "integrity": "sha512-Oralk1kiagn3Gb5cR5BffenWjVu59t/viE6UMD/mQa1hISMPkMYhJIqX+CMeA1zXgVBO+YHQhhokEj99GP5xcg==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz", + "integrity": "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==", "dev": true, "requires": { "q": "^1.5.1" @@ -3863,9 +3839,9 @@ "dev": true }, "conventional-changelog-conventionalcommits": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz", - "integrity": "sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz", + "integrity": "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -3874,26 +3850,26 @@ } }, "conventional-changelog-core": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.0.tgz", - "integrity": "sha512-8+xMvN6JvdDtPbGBqA7oRNyZD4od1h/SIzrWqHcKZjitbVXrFpozEeyn4iI4af1UwdrabQpiZMaV07fPUTGd4w==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.1.tgz", + "integrity": "sha512-8cH8/DEoD3e5Q6aeogdR5oaaKs0+mG6+f+Om0ZYt3PNv7Zo0sQhu4bMDRsqAF+UTekTAtP1W/C41jH/fkm8Jtw==", "dev": true, "requires": { "add-stream": "^1.0.0", - "conventional-changelog-writer": "^4.0.17", - "conventional-commits-parser": "^3.1.0", + "conventional-changelog-writer": "^4.0.18", + "conventional-commits-parser": "^3.2.0", "dateformat": "^3.0.0", "get-pkg-repo": "^1.0.0", "git-raw-commits": "2.0.0", "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^4.1.0", + "git-semver-tags": "^4.1.1", "lodash": "^4.17.15", - "normalize-package-data": "^2.3.5", + "normalize-package-data": "^3.0.0", "q": "^1.5.1", "read-pkg": "^3.0.0", "read-pkg-up": "^3.0.0", "shelljs": "^0.8.3", - "through2": "^3.0.0" + "through2": "^4.0.0" }, "dependencies": { "camelcase": { @@ -3956,6 +3932,12 @@ } } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -4005,6 +3987,20 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + } } }, "minimist-options": { @@ -4087,6 +4083,20 @@ "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", "path-type": "^3.0.0" + }, + "dependencies": { + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + } } }, "read-pkg-up": { @@ -4109,6 +4119,12 @@ "strip-indent": "^2.0.0" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "strip-indent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", @@ -4124,45 +4140,45 @@ } }, "conventional-changelog-ember": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.8.tgz", - "integrity": "sha512-JEMEcUAMg4Q9yxD341OgWlESQ4gLqMWMXIWWUqoQU8yvTJlKnrvcui3wk9JvnZQyONwM2g1MKRZuAjKxr8hAXA==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz", + "integrity": "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-eslint": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.8.tgz", - "integrity": "sha512-5rTRltgWG7TpU1PqgKHMA/2ivjhrB+E+S7OCTvj0zM/QGg4vmnVH67Vq/EzvSNYtejhWC+OwzvDrLk3tqPry8A==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz", + "integrity": "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-express": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.5.tgz", - "integrity": "sha512-pW2hsjKG+xNx/Qjof8wYlAX/P61hT5gQ/2rZ2NsTpG+PgV7Rc8RCfITvC/zN9K8fj0QmV6dWmUefCteD9baEAw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz", + "integrity": "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-jquery": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.10.tgz", - "integrity": "sha512-QCW6wF8QgPkq2ruPaxc83jZxoWQxLkt/pNxIDn/oYjMiVgrtqNdd7lWe3vsl0hw5ENHNf/ejXuzDHk6suKsRpg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz", + "integrity": "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-jshint": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.8.tgz", - "integrity": "sha512-hB/iI0IiZwnZ+seYI+qEQ4b+EMQSEC8jGIvhO2Vpz1E5p8FgLz75OX8oB1xJWl+s4xBMB6f8zJr0tC/BL7YOjw==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz", + "integrity": "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -4176,27 +4192,27 @@ "dev": true }, "conventional-changelog-writer": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", - "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", + "version": "4.0.18", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.18.tgz", + "integrity": "sha512-mAQDCKyB9HsE8Ko5cCM1Jn1AWxXPYV0v8dFPabZRkvsiWUul2YyAqbIaoMKF88Zf2ffnOPSvKhboLf3fnjo5/A==", "dev": true, "requires": { "compare-func": "^2.0.0", - "conventional-commits-filter": "^2.0.6", + "conventional-commits-filter": "^2.0.7", "dateformat": "^3.0.0", "handlebars": "^4.7.6", "json-stringify-safe": "^5.0.1", "lodash": "^4.17.15", - "meow": "^7.0.0", + "meow": "^8.0.0", "semver": "^6.0.0", "split": "^1.0.0", - "through2": "^3.0.0" + "through2": "^4.0.0" } }, "conventional-commits-filter": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", - "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", "dev": true, "requires": { "lodash.ismatch": "^4.4.0", @@ -4204,17 +4220,17 @@ } }, "conventional-commits-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", - "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz", + "integrity": "sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ==", "dev": true, "requires": { "JSONStream": "^1.0.4", "is-text-path": "^1.0.1", "lodash": "^4.17.15", - "meow": "^7.0.0", + "meow": "^8.0.0", "split2": "^2.0.0", - "through2": "^3.0.0", + "through2": "^4.0.0", "trim-off-newlines": "^1.0.0" } }, @@ -4301,6 +4317,12 @@ } } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -4335,6 +4357,198 @@ "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", "dev": true }, + "meow": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, + "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" + } + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "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" + } + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "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 + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "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==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "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==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + } + } + }, "minimist-options": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", @@ -4345,6 +4559,18 @@ "is-plain-obj": "^1.1.0" } }, + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -4437,6 +4663,12 @@ "strip-indent": "^2.0.0" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "strip-indent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", @@ -4458,6 +4690,30 @@ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", "dev": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } } } }, @@ -4485,18 +4741,18 @@ "dev": true }, "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.7.0.tgz", + "integrity": "sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA==", "dev": true }, "core-js-compat": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", - "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.7.0.tgz", + "integrity": "sha512-V8yBI3+ZLDVomoWICO6kq/CD28Y4r1M7CWeO4AGpMdMfseu8bkSubBmUPySMGKRTS+su4XQ07zUkAsiu9FCWTg==", "dev": true, "requires": { - "browserslist": "^4.8.5", + "browserslist": "^4.14.6", "semver": "7.0.0" }, "dependencies": { @@ -4841,6 +5097,12 @@ "slash": "^3.0.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "meow": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", @@ -4860,6 +5122,18 @@ "yargs-parser": "^18.1.3" } }, + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", @@ -4868,6 +5142,28 @@ "requires": { "aggregate-error": "^3.0.0" } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -4890,9 +5186,9 @@ "dev": true }, "diff-sequences": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.5.0.tgz", - "integrity": "sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", "dev": true }, "dir-glob": { @@ -5046,9 +5342,9 @@ } }, "electron-to-chromium": { - "version": "1.3.584", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.584.tgz", - "integrity": "sha512-NB3DzrTzJFhWkUp+nl2KtUtoFzrfGXTir2S+BU4tXGyXH9vlluPuFpE3pTKeH7+PY460tHLjKzh6K2+TWwW+Ww==", + "version": "1.3.595", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.595.tgz", + "integrity": "sha512-JpaBIhdBkF9FLG7x06ONfe0f5bxPrxRcq0X+Sc8vsCt+OPWIzxOD+qM71NEHLGbDfN9Q6hbtHRv4/dnvcOxo6g==", "dev": true }, "emittery": { @@ -5106,9 +5402,9 @@ } }, "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -5116,7 +5412,6 @@ "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", @@ -5209,9 +5504,9 @@ } }, "eslint": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.12.1.tgz", - "integrity": "sha512-HlMTEdr/LicJfN08LB3nM1rRYliDXOmfoO4vj39xN6BLpFzF00hbwBoqHk8UcJ2M/3nlARZWy/mslvGEuZFvsg==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.13.0.tgz", + "integrity": "sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -5530,6 +5825,12 @@ "locate-path": "^2.0.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -5540,6 +5841,18 @@ "path-exists": "^3.0.0" } }, + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -5605,6 +5918,12 @@ "find-up": "^2.0.0", "read-pkg": "^2.0.0" } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -5781,16 +6100,16 @@ } }, "expect": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.1.tgz", - "integrity": "sha512-BRfxIBHagghMmr1D2MRY0Qv5d3Nc8HCqgbDwNXw/9izmM5eBb42a2YjLKSbsqle76ozGkAEPELQX4IdNHAKRNA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "ansi-styles": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.1", - "jest-message-util": "^26.6.1", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", "jest-regex-util": "^26.0.0" }, "dependencies": { @@ -6182,6 +6501,17 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-own-enumerable-property-symbols": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", @@ -6239,6 +6569,12 @@ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", @@ -6285,6 +6621,18 @@ "trim-newlines": "^1.0.0" } }, + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -6351,6 +6699,12 @@ "strip-indent": "^1.0.1" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", @@ -6440,16 +6794,16 @@ } }, "git-raw-commits": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.7.tgz", - "integrity": "sha512-SkwrTqrDxw8y0G1uGJ9Zw13F7qu3LF8V4BifyDeiJCxSnjRGZD9SaoMiMqUvvXMXh6S3sOQ1DsBN7L2fMUZW/g==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.8.tgz", + "integrity": "sha512-6Gk7tQHGMLEL1bSnrMJTCVt2AQl4EmCcJDtzs/JJacCb2+TNEyHM67Gp7Ri9faF7OcGpjGGRjHLvs/AG7QKZ2Q==", "dev": true, "requires": { "dargs": "^7.0.0", "lodash.template": "^4.0.2", - "meow": "^7.0.0", + "meow": "^8.0.0", "split2": "^2.0.0", - "through2": "^3.0.0" + "through2": "^4.0.0" } }, "git-remote-origin-url": { @@ -6471,12 +6825,12 @@ } }, "git-semver-tags": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.0.tgz", - "integrity": "sha512-TcxAGeo03HdErzKzi4fDD+xEL7gi8r2Y5YSxH6N2XYdVSV5UkBwfrt7Gqo1b+uSHCjy/sa9Y6BBBxxFLxfbhTg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "requires": { - "meow": "^7.0.0", + "meow": "^8.0.0", "semver": "^6.0.0" } }, @@ -6702,10 +7056,13 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", + "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } }, "html-encoding-sniffer": { "version": "2.0.1", @@ -6823,9 +7180,9 @@ "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -6955,9 +7312,9 @@ } }, "is-core-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.0.0.tgz", - "integrity": "sha512-jq1AH6C8MuteOoBPwkxHafmByhL9j5q4OaPGdbuD+ZtQJVzH+i6E3BJDQcBA09k57i2Hh2yQbEG8yObZ0jdlWw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", + "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", "dev": true, "requires": { "has": "^1.0.3" @@ -7290,14 +7647,14 @@ } }, "jest": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.1.tgz", - "integrity": "sha512-f+ahfqw3Ffy+9vA7sWFGpTmhtKEMsNAZiWBVXDkrpIO73zIz22iimjirnV78kh/eWlylmvLh/0WxHN6fZraZdA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", + "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", "dev": true, "requires": { - "@jest/core": "^26.6.1", + "@jest/core": "^26.6.3", "import-local": "^3.0.2", - "jest-cli": "^26.6.1" + "jest-cli": "^26.6.3" }, "dependencies": { "ansi-styles": { @@ -7341,22 +7698,22 @@ "dev": true }, "jest-cli": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.1.tgz", - "integrity": "sha512-aPLoEjlwFrCWhiPpW5NUxQA1X1kWsAnQcQ0SO/fHsCvczL3W75iVAcH9kP6NN+BNqZcHNEvkhxT5cDmBfEAh+w==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", + "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", "dev": true, "requires": { - "@jest/core": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/core": "^26.6.3", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", + "jest-config": "^26.6.3", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "prompts": "^2.0.1", "yargs": "^15.4.1" } @@ -7373,12 +7730,12 @@ } }, "jest-changed-files": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.1.tgz", - "integrity": "sha512-NhSdZ5F6b/rIN5V46x1l31vrmukD/bJUXgYAY8VtP1SknYdJwjYDRxuLt7Z8QryIdqCjMIn2C0Cd98EZ4umo8Q==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", + "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "execa": "^4.0.0", "throat": "^5.0.0" }, @@ -7468,29 +7825,29 @@ } }, "jest-config": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.1.tgz", - "integrity": "sha512-mtJzIynIwW1d1nMlKCNCQiSgWaqFn8cH/fOSNY97xG7Y9tBCZbCSuW2GTX0RPmceSJGO7l27JgwC18LEg0Vg+g==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", + "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.1", - "@jest/types": "^26.6.1", - "babel-jest": "^26.6.1", + "@jest/test-sequencer": "^26.6.3", + "@jest/types": "^26.6.2", + "babel-jest": "^26.6.3", "chalk": "^4.0.0", "deepmerge": "^4.2.2", "glob": "^7.1.1", "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.1", - "jest-environment-node": "^26.6.1", + "jest-environment-jsdom": "^26.6.2", + "jest-environment-node": "^26.6.2", "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.1", + "jest-jasmine2": "^26.6.3", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "micromatch": "^4.0.2", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7545,15 +7902,15 @@ } }, "jest-diff": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.1.tgz", - "integrity": "sha512-BBNy/zin2m4kG5In126O8chOBxLLS/XMTuuM2+YhgyHk87ewPzKTuTJcqj3lOWOi03NNgrl+DkMeV/exdvG9gg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^26.5.0", + "diff-sequences": "^26.6.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7617,16 +7974,16 @@ } }, "jest-each": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.1.tgz", - "integrity": "sha512-gSn8eB3buchuq45SU7pLB7qmCGax1ZSxfaWuEFblCyNMtyokYaKFh9dRhYPujK6xYL57dLIPhLKatjmB5XWzGA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", + "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-util": "^26.6.1", - "pretty-format": "^26.6.1" + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7681,32 +8038,32 @@ } }, "jest-environment-jsdom": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.1.tgz", - "integrity": "sha512-A17RiXuHYNVlkM+3QNcQ6n5EZyAc6eld8ra9TW26luounGWpku4tj03uqRgHJCI1d4uHr5rJiuCH5JFRtdmrcA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", + "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", "dev": true, "requires": { - "@jest/environment": "^26.6.1", - "@jest/fake-timers": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.6.1", - "jest-util": "^26.6.1", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2", "jsdom": "^16.4.0" } }, "jest-environment-node": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.1.tgz", - "integrity": "sha512-YffaCp6h0j1kbcf1NVZ7umC6CPgD67YS+G1BeornfuSkx5s3xdhuwG0DCxSiHPXyT81FfJzA1L7nXvhq50OWIg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", + "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", "dev": true, "requires": { - "@jest/environment": "^26.6.1", - "@jest/fake-timers": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.6.1", - "jest-util": "^26.6.1" + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" } }, "jest-get-type": { @@ -7716,12 +8073,12 @@ "dev": true }, "jest-haste-map": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.1.tgz", - "integrity": "sha512-9kPafkv0nX6ta1PrshnkiyhhoQoFWncrU/uUBt3/AP1r78WSCU5iLceYRTwDvJl67H3RrXqSlSVDDa/AsUB7OQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", + "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/graceful-fs": "^4.1.2", "@types/node": "*", "anymatch": "^3.0.3", @@ -7729,9 +8086,9 @@ "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.5.0", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-serializer": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "micromatch": "^4.0.2", "sane": "^4.0.3", "walker": "^1.0.7" @@ -7748,37 +8105,37 @@ } }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.1.tgz", + "integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==", "dev": true, "optional": true } } }, "jest-jasmine2": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.1.tgz", - "integrity": "sha512-2uYdT32o/ZzSxYAPduAgokO8OlAL1YdG/9oxcEY138EDNpIK5XRRJDaGzTZdIBWSxk0aR8XxN44FvfXtHB+Fiw==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", + "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.1", - "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/environment": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.6.1", + "expect": "^26.6.2", "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.1", - "jest-matcher-utils": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-runtime": "^26.6.1", - "jest-snapshot": "^26.6.1", - "jest-util": "^26.6.1", - "pretty-format": "^26.6.1", + "jest-each": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2", "throat": "^5.0.0" }, "dependencies": { @@ -7834,25 +8191,25 @@ } }, "jest-leak-detector": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.1.tgz", - "integrity": "sha512-j9ZOtJSJKlHjrs4aIxWjiQUjyrffPdiAQn2Iw0916w7qZE5Lk0T2KhIH6E9vfhzP6sw0Q0jtnLLb4vQ71o1HlA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", + "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", "dev": true, "requires": { "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" } }, "jest-matcher-utils": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.1.tgz", - "integrity": "sha512-9iu3zrsYlUnl8pByhREF9rr5eYoiEb1F7ymNKg6lJr/0qD37LWS5FSW/JcoDl8UdMX2+zAzabDs7sTO+QFKjCg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.6.1", + "jest-diff": "^26.6.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7907,17 +8264,18 @@ } }, "jest-message-util": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.1.tgz", - "integrity": "sha512-cqM4HnqncIebBNdTKrBoWR/4ufHTll0pK/FWwX0YasK+TlBQEMqw3IEdynuuOTjDPFO3ONlFn37280X48beByw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", "slash": "^3.0.0", "stack-utils": "^2.0.2" }, @@ -7974,12 +8332,12 @@ } }, "jest-mock": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.1.tgz", - "integrity": "sha512-my0lPTBu1awY8iVG62sB2sx9qf8zxNDVX+5aFgoB8Vbqjb6LqIOsfyFA8P1z6H2IsqMbvOX9oCJnK67Y3yUIMA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", + "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*" } }, @@ -7996,16 +8354,16 @@ "dev": true }, "jest-resolve": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.1.tgz", - "integrity": "sha512-hiHfQH6rrcpAmw9xCQ0vD66SDuU+7ZulOuKwc4jpbmFFsz0bQG/Ib92K+9/489u5rVw0btr/ZhiHqBpmkbCvuQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", + "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.1", + "jest-util": "^26.6.2", "read-pkg-up": "^7.0.1", "resolve": "^1.18.1", "slash": "^3.0.0" @@ -8063,40 +8421,40 @@ } }, "jest-resolve-dependencies": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.1.tgz", - "integrity": "sha512-MN6lufbZJ3RBfTnJesZtHu3hUCBqPdHRe2+FhIt0yiqJ3fMgzWRqMRQyN/d/QwOE7KXwAG2ekZutbPhuD7s51A==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", + "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.1" + "jest-snapshot": "^26.6.2" } }, "jest-runner": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.1.tgz", - "integrity": "sha512-DmpNGdgsbl5s0FGkmsInmqnmqCtliCSnjWA2TFAJS1m1mL5atwfPsf+uoZ8uYQ2X0uDj4NM+nPcDnUpbNTRMBA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", + "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", "dev": true, "requires": { - "@jest/console": "^26.6.1", - "@jest/environment": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.7.1", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.6.1", + "jest-config": "^26.6.3", "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.1", - "jest-leak-detector": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-resolve": "^26.6.1", - "jest-runtime": "^26.6.1", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-haste-map": "^26.6.2", + "jest-leak-detector": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "source-map-support": "^0.5.6", "throat": "^5.0.0" }, @@ -8153,35 +8511,35 @@ } }, "jest-runtime": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.1.tgz", - "integrity": "sha512-7uOCNeezXDWgjEyzYbRN2ViY7xNZzusNVGAMmU0UHRUNXuY4j4GBHKGMqPo/cBPZA9bSYp+lwK2DRRBU5Dv6YQ==", - "dev": true, - "requires": { - "@jest/console": "^26.6.1", - "@jest/environment": "^26.6.1", - "@jest/fake-timers": "^26.6.1", - "@jest/globals": "^26.6.1", - "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.6.1", - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", + "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/globals": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/yargs": "^15.0.0", "chalk": "^4.0.0", - "cjs-module-lexer": "^0.4.2", + "cjs-module-lexer": "^0.6.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.6.1", - "jest-haste-map": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-mock": "^26.6.1", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.1", - "jest-snapshot": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", + "jest-resolve": "^26.6.2", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.4.1" @@ -8245,9 +8603,9 @@ } }, "jest-serializer": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.5.0.tgz", - "integrity": "sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", + "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", "dev": true, "requires": { "@types/node": "*", @@ -8255,26 +8613,26 @@ } }, "jest-snapshot": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.1.tgz", - "integrity": "sha512-JA7bZp7HRTIJYAi85pJ/OZ2eur2dqmwIToA5/6d7Mn90isGEfeF9FvuhDLLEczgKP1ihreBzrJ6Vr7zteP5JNA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", + "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/babel__traverse": "^7.0.4", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.6.1", + "expect": "^26.6.2", "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.1", + "jest-diff": "^26.6.2", "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.1", - "jest-matcher-utils": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-resolve": "^26.6.1", + "jest-haste-map": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", "natural-compare": "^1.4.0", - "pretty-format": "^26.6.1", + "pretty-format": "^26.6.2", "semver": "^7.3.2" }, "dependencies": { @@ -8336,12 +8694,12 @@ } }, "jest-util": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.1.tgz", - "integrity": "sha512-xCLZUqVoqhquyPLuDXmH7ogceGctbW8SMyQVjD9o+1+NPWI7t0vO08udcFLVPLgKWcvc+zotaUv/RuaR6l8HIA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -8401,17 +8759,17 @@ } }, "jest-validate": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.1.tgz", - "integrity": "sha512-BEFpGbylKocnNPZULcnk+TGaz1oFZQH/wcaXlaXABbu0zBwkOGczuWgdLucUouuQqn7VadHZZeTvo8VSFDLMOA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", + "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "camelcase": "^6.0.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -8424,9 +8782,9 @@ } }, "camelcase": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", - "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, "chalk": { @@ -8472,17 +8830,17 @@ } }, "jest-watcher": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.1.tgz", - "integrity": "sha512-0LBIPPncNi9CaLKK15bnxyd2E8OMl4kJg0PTiNOI+MXztXw1zVdtX/x9Pr6pXaQYps+eS/ts43O4+HByZ7yJSw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", + "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", "dev": true, "requires": { - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^26.6.1", + "jest-util": "^26.6.2", "string-length": "^4.0.1" }, "dependencies": { @@ -8538,9 +8896,9 @@ } }, "jest-worker": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.1.tgz", - "integrity": "sha512-R5IE3qSGz+QynJx8y+ICEkdI2OJ3RJjRQVEyCcFAd3yVhQSEtquziPO29Mlzgn07LOVE8u8jhJ1FqcwegiXWOw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", "dev": true, "requires": { "@types/node": "*", @@ -8688,13 +9046,21 @@ } }, "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "requires": { "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } } }, "jsonparse": { @@ -8750,20 +9116,20 @@ "dev": true }, "lint-staged": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.0.tgz", - "integrity": "sha512-gjC9+HGkBubOF+Yyoj9pd52Qfm/kYB+dRX1UOgWjHKvSDYl+VHkZXlBMlqSZa2cH3Kp5/uNL480sV6e2dTgXSg==", + "version": "10.5.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.1.tgz", + "integrity": "sha512-fTkTGFtwFIJJzn/PbUO3RXyEBHIhbfYBE7+rJyLcOXabViaO/h6OslgeK6zpeUtzkDrzkgyAYDTLAwx6JzDTHw==", "dev": true, "requires": { "chalk": "^4.1.0", "cli-truncate": "^2.1.0", - "commander": "^6.0.0", + "commander": "^6.2.0", "cosmiconfig": "^7.0.0", - "debug": "^4.1.1", + "debug": "^4.2.0", "dedent": "^0.7.0", "enquirer": "^2.3.6", - "execa": "^4.0.3", - "listr2": "^2.6.0", + "execa": "^4.1.0", + "listr2": "^3.2.2", "log-symbols": "^4.0.0", "micromatch": "^4.0.2", "normalize-path": "^3.0.0", @@ -8933,9 +9299,9 @@ "dev": true }, "listr2": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz", - "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.2.2.tgz", + "integrity": "sha512-AajqcZEUikF2ioph6PfH3dIuxJclhr3i3kHgTOP0xeXdWQohrvJAAmqVcV43/GI987HFY/vzT73jYXoa4esDHg==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -8944,7 +9310,7 @@ "indent-string": "^4.0.0", "log-update": "^4.0.0", "p-map": "^4.0.0", - "rxjs": "^6.6.2", + "rxjs": "^6.6.3", "through": "^2.3.8" }, "dependencies": { @@ -9282,9 +9648,9 @@ "dev": true }, "meow": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", - "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.0.0.tgz", + "integrity": "sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg==", "dev": true, "requires": { "@types/minimist": "^1.2.0", @@ -9292,12 +9658,12 @@ "decamelize-keys": "^1.1.0", "hard-rejection": "^2.1.0", "minimist-options": "4.1.0", - "normalize-package-data": "^2.5.0", + "normalize-package-data": "^3.0.0", "read-pkg-up": "^7.0.1", "redent": "^3.0.0", "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" } }, "merge-stream": { @@ -9644,27 +10010,27 @@ } }, "node-releases": { - "version": "1.1.64", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz", - "integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==", + "version": "1.1.66", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.66.tgz", + "integrity": "sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg==", "dev": true }, "normalize-package-data": { - "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==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz", + "integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", + "hosted-git-info": "^3.0.6", + "resolve": "^1.17.0", + "semver": "^7.3.2", "validate-npm-package-license": "^3.0.1" }, "dependencies": { "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -9691,6 +10057,12 @@ "string.prototype.padend": "^3.0.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -9703,6 +10075,18 @@ "strip-bom": "^3.0.0" } }, + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -9738,6 +10122,12 @@ "normalize-package-data": "^2.3.2", "path-type": "^3.0.0" } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -9833,13 +10223,13 @@ } }, "object.assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", - "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, "requires": { + "call-bind": "^1.0.0", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.0", "has-symbols": "^1.0.1", "object-keys": "^1.1.1" } @@ -9863,27 +10253,6 @@ "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "once": { @@ -10165,12 +10534,12 @@ "dev": true }, "pretty-format": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.1.tgz", - "integrity": "sha512-MeqqsP5PYcRBbGMvwzsyBdmAJ4EFX7pWFyl7x4+dMVg5pE0ZDdBIvEH2ergvIO+Gvwv1wh64YuOY9y5LuyY/GA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^17.0.1" @@ -10329,6 +10698,30 @@ "type-fest": "^0.6.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "normalize-package-data": { + "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", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "type-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", @@ -10533,9 +10926,9 @@ } }, "regenerate": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", - "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, "regenerate-unicode-properties": { @@ -10742,12 +11135,12 @@ "dev": true }, "resolve": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", - "integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", "dev": true, "requires": { - "is-core-module": "^2.0.0", + "is-core-module": "^2.1.0", "path-parse": "^1.0.6" } }, @@ -11435,6 +11828,17 @@ "yargs": "^15.3.1" }, "dependencies": { + "conventional-changelog-conventionalcommits": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz", + "integrity": "sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "lodash": "^4.17.15", + "q": "^1.5.1" + } + }, "detect-indent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", @@ -11511,12 +11915,22 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", + "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" }, "dependencies": { "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -11524,6 +11938,7 @@ "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", @@ -11534,16 +11949,6 @@ } } }, - "string.prototype.trimend": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", - "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - } - }, "string.prototype.trimstart": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz", @@ -11552,6 +11957,28 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "string_decoder": { @@ -11733,9 +12160,9 @@ } }, "tapable": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz", - "integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz", + "integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==", "dev": true }, "tar": { @@ -11836,13 +12263,25 @@ "dev": true }, "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" + "readable-stream": "3" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "tmpl": { @@ -11989,9 +12428,9 @@ "dev": true }, "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true }, "typedarray": { @@ -12010,9 +12449,9 @@ } }, "uglify-js": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.4.tgz", - "integrity": "sha512-FyYnoxVL1D6+jDGQpbK5jW6y/2JlVfRfEeQ67BPCUg5wfCjaKOpr2XeceE4QL+MkhxliLtf5EbrMDZgzpt2CNw==", + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz", + "integrity": "sha512-btvv/baMqe7HxP7zJSF7Uc16h1mSfuuSplT0/qdjxseesDU+yYzH33eHBH+eMdeRXwujXspaCTooWHQVVBh09w==", "dev": true, "optional": true }, @@ -12168,15 +12607,15 @@ "optional": true }, "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, "v8-to-istanbul": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz", - "integrity": "sha512-PzM1WlqquhBvsV+Gco6WSFeg1AGdD53ccMRkFeyHRE/KRZaVacPOmQYP3EeVgDBtKD2BJ8kgynBQ5OtKiHCH+w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz", + "integrity": "sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.1", @@ -12257,9 +12696,9 @@ "dev": true }, "webpack": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.3.2.tgz", - "integrity": "sha512-DXsfHoI6lQAR3KnQh7+FsRfs9fs+TEvzXCA35UbKv4kVuzslg7QCMAcpFRZNDMjdtm9N/PoO54XEzGN9TeacQg==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz", + "integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -12458,9 +12897,9 @@ } }, "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==", "dev": true }, "xml-name-validator": { @@ -12515,17 +12954,25 @@ "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" + }, + "dependencies": { + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true } } } diff --git a/package.json b/package.json index 7250863d..f1b91783 100644 --- a/package.json +++ b/package.json @@ -61,25 +61,25 @@ "@commitlint/config-conventional": "^11.0.0", "@webpack-contrib/defaults": "^6.3.0", "@webpack-contrib/eslint-config-webpack": "^3.0.0", - "babel-jest": "^26.6.1", + "babel-jest": "^26.6.3", "chokidar": "^3.4.3", "cross-env": "^7.0.2", "del": "^6.0.0", "del-cli": "^3.0.1", - "eslint": "^7.12.1", + "eslint": "^7.13.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.22.1", "file-loader": "^6.1.1", "husky": "^4.3.0", "is-gzip": "^2.0.0", - "jest": "^26.6.1", - "lint-staged": "^10.4.2", + "jest": "^26.6.3", + "lint-staged": "^10.5.1", "memfs": "^3.2.0", "mkdirp": "^1.0.4", "npm-run-all": "^4.1.5", "prettier": "^2.1.2", "standard-version": "^9.0.0", - "webpack": "^5.3.2" + "webpack": "^5.4.0" }, "keywords": [ "webpack", diff --git a/src/cjs.js b/src/cjs.js index baa7dacb..54bc4edf 100644 --- a/src/cjs.js +++ b/src/cjs.js @@ -1,3 +1,3 @@ -const plugin = require('./index'); +const plugin = require("./index"); module.exports = plugin.default; diff --git a/src/index.js b/src/index.js index eff15b40..488d53c5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,36 +1,36 @@ -import path from 'path'; -import os from 'os'; -import crypto from 'crypto'; - -import webpack from 'webpack'; -import { validate } from 'schema-utils'; -import pLimit from 'p-limit'; -import globby from 'globby'; -import findCacheDir from 'find-cache-dir'; -import serialize from 'serialize-javascript'; -import cacache from 'cacache'; -import loaderUtils from 'loader-utils'; -import normalizePath from 'normalize-path'; -import globParent from 'glob-parent'; -import fastGlob from 'fast-glob'; - -import { version } from '../package.json'; - -import schema from './options.json'; -import { readFile, stat } from './utils/promisify'; +import path from "path"; +import os from "os"; +import crypto from "crypto"; + +import webpack from "webpack"; +import { validate } from "schema-utils"; +import pLimit from "p-limit"; +import globby from "globby"; +import findCacheDir from "find-cache-dir"; +import serialize from "serialize-javascript"; +import cacache from "cacache"; +import loaderUtils from "loader-utils"; +import normalizePath from "normalize-path"; +import globParent from "glob-parent"; +import fastGlob from "fast-glob"; + +import { version } from "../package.json"; + +import schema from "./options.json"; +import { readFile, stat } from "./utils/promisify"; // webpack 5 exposes the sources property to ensure the right version of webpack-sources is used const { RawSource } = // eslint-disable-next-line global-require - webpack.sources || require('webpack-sources'); + webpack.sources || require("webpack-sources"); const template = /(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])|(\[\d+\])/; class CopyPlugin { constructor(options = {}) { validate(schema, options, { - name: 'Copy Plugin', - baseDataPath: 'options', + name: "Copy Plugin", + baseDataPath: "options", }); this.patterns = options.patterns; @@ -96,18 +96,18 @@ class CopyPlugin { index ) { const pattern = - typeof inputPattern === 'string' + typeof inputPattern === "string" ? { from: inputPattern } : { ...inputPattern }; pattern.fromOrigin = pattern.from; pattern.from = path.normalize(pattern.from); pattern.to = path.normalize( - typeof pattern.to !== 'undefined' ? pattern.to : '' + typeof pattern.to !== "undefined" ? pattern.to : "" ); pattern.compilerContext = compiler.context; pattern.context = path.normalize( - typeof pattern.context !== 'undefined' + typeof pattern.context !== "undefined" ? !path.isAbsolute(pattern.context) ? path.join(pattern.compilerContext, pattern.context) : pattern.context @@ -119,20 +119,20 @@ class CopyPlugin { ); const isToDirectory = - path.extname(pattern.to) === '' || pattern.to.slice(-1) === path.sep; + path.extname(pattern.to) === "" || pattern.to.slice(-1) === path.sep; switch (true) { // if toType already exists case !!pattern.toType: break; case template.test(pattern.to): - pattern.toType = 'template'; + pattern.toType = "template"; break; case isToDirectory: - pattern.toType = 'dir'; + pattern.toType = "dir"; break; default: - pattern.toType = 'file'; + pattern.toType = "file"; } if (path.isAbsolute(pattern.from)) { @@ -155,10 +155,10 @@ class CopyPlugin { if (stats) { if (stats.isDirectory()) { - pattern.fromType = 'dir'; + pattern.fromType = "dir"; logger.debug(`determined '${pattern.absoluteFrom}' is a directory`); } else if (stats.isFile()) { - pattern.fromType = 'file'; + pattern.fromType = "file"; logger.debug(`determined '${pattern.absoluteFrom}' is a file`); } else { logger.debug(`determined '${pattern.absoluteFrom}' is a glob`); @@ -185,7 +185,7 @@ class CopyPlugin { } switch (pattern.fromType) { - case 'dir': + case "dir": compilation.contextDependencies.add(pattern.absoluteFrom); logger.debug(`added '${pattern.absoluteFrom}' as a context dependency`); @@ -196,16 +196,16 @@ class CopyPlugin { fastGlob.escapePath( normalizePath(path.resolve(pattern.absoluteFrom)) ), - '**/*' + "**/*" ); - pattern.absoluteFrom = path.join(pattern.absoluteFrom, '**/*'); + pattern.absoluteFrom = path.join(pattern.absoluteFrom, "**/*"); - if (typeof pattern.globOptions.dot === 'undefined') { + if (typeof pattern.globOptions.dot === "undefined") { pattern.globOptions.dot = true; } /* eslint-enable no-param-reassign */ break; - case 'file': + case "file": compilation.fileDependencies.add(pattern.absoluteFrom); logger.debug(`added '${pattern.absoluteFrom}' as a file dependency`); @@ -216,7 +216,7 @@ class CopyPlugin { normalizePath(path.resolve(pattern.absoluteFrom)) ); - if (typeof pattern.globOptions.dot === 'undefined') { + if (typeof pattern.globOptions.dot === "undefined") { pattern.globOptions.dot = true; } /* eslint-enable no-param-reassign */ @@ -231,7 +231,7 @@ class CopyPlugin { logger.debug(`added '${contextDependencies}' as a context dependency`); /* eslint-disable no-param-reassign */ - pattern.fromType = 'glob'; + pattern.fromType = "glob"; pattern.glob = path.isAbsolute(pattern.fromOrigin) ? pattern.fromOrigin : path.posix.join( @@ -321,7 +321,7 @@ class CopyPlugin { ? path.basename(absoluteFilename) : path.relative(pattern.context, absoluteFilename); let filename = - pattern.toType === 'dir' + pattern.toType === "dir" ? path.join(pattern.to, relativeFrom) : pattern.to; @@ -352,7 +352,7 @@ class CopyPlugin { }; // If this came from a glob, add it to the file dependencies - if (pattern.fromType === 'glob') { + if (pattern.fromType === "glob") { compilation.fileDependencies.add(absoluteFilename); logger.debug(`added '${absoluteFilename}' as a file dependency`); @@ -477,13 +477,13 @@ class CopyPlugin { sourceFilename, transform: pattern.transform, contentHash: crypto - .createHash('md4') + .createHash("md4") .update(buffer) - .digest('hex'), + .digest("hex"), index, }; const cacheKeys = `transform|${serialize( - typeof pattern.cacheTransform.keys === 'function' + typeof pattern.cacheTransform.keys === "function" ? await pattern.cacheTransform.keys( defaultCacheKeys, absoluteFilename @@ -509,9 +509,9 @@ class CopyPlugin { } else { cacheDirectory = pattern.cacheTransform.directory ? pattern.cacheTransform.directory - : typeof pattern.cacheTransform === 'string' + : typeof pattern.cacheTransform === "string" ? pattern.cacheTransform - : findCacheDir({ name: 'copy-webpack-plugin' }) || + : findCacheDir({ name: "copy-webpack-plugin" }) || os.tmpdir(); let cached; @@ -568,7 +568,7 @@ class CopyPlugin { } } - if (pattern.toType === 'template') { + if (pattern.toType === "template") { logger.log( `interpolating template '${filename}' for '${sourceFilename}'...` ); @@ -577,7 +577,7 @@ class CopyPlugin { // ie. [name].[ext] or [name][ext] both become [name] if (!path.extname(absoluteFilename)) { // eslint-disable-next-line no-param-reassign - result.filename = result.filename.replace(/\.?\[ext]/g, ''); + result.filename = result.filename.replace(/\.?\[ext]/g, ""); } // eslint-disable-next-line no-param-reassign @@ -647,16 +647,16 @@ class CopyPlugin { const limit = pLimit(this.options.concurrency || 100); compiler.hooks.thisCompilation.tap(pluginName, (compilation) => { - const logger = compilation.getLogger('copy-webpack-plugin'); + const logger = compilation.getLogger("copy-webpack-plugin"); const cache = compilation.getCache - ? compilation.getCache('CopyWebpackPlugin') + ? compilation.getCache("CopyWebpackPlugin") : // eslint-disable-next-line no-undefined undefined; compilation.hooks.additionalAssets.tapAsync( - 'copy-webpack-plugin', + "copy-webpack-plugin", async (callback) => { - logger.log('starting to add additional assets...'); + logger.log("starting to add additional assets..."); let assets; @@ -699,7 +699,7 @@ class CopyPlugin { // For old version webpack 4 /* istanbul ignore if */ - if (typeof compilation.emitAsset !== 'function') { + if (typeof compilation.emitAsset !== "function") { // eslint-disable-next-line no-param-reassign compilation.assets[filename] = source; @@ -753,7 +753,7 @@ class CopyPlugin { ); }); - logger.log('finished to adding additional assets'); + logger.log("finished to adding additional assets"); callback(); } @@ -762,10 +762,10 @@ class CopyPlugin { if (compilation.hooks.statsPrinter) { compilation.hooks.statsPrinter.tap(pluginName, (stats) => { stats.hooks.print - .for('asset.info.copied') - .tap('copy-webpack-plugin', (copied, { green, formatFlag }) => + .for("asset.info.copied") + .tap("copy-webpack-plugin", (copied, { green, formatFlag }) => // eslint-disable-next-line no-undefined - copied ? green(formatFlag('copied')) : undefined + copied ? green(formatFlag("copied")) : undefined ); }); } diff --git a/test/CopyPlugin.test.js b/test/CopyPlugin.test.js index 5c8c99a2..aed34555 100644 --- a/test/CopyPlugin.test.js +++ b/test/CopyPlugin.test.js @@ -1,25 +1,25 @@ -import path from 'path'; +import path from "path"; -import webpack from 'webpack'; -import del from 'del'; -import { createFsFromVolume, Volume } from 'memfs'; +import webpack from "webpack"; +import del from "del"; +import { createFsFromVolume, Volume } from "memfs"; -import CopyPlugin from '../src'; +import CopyPlugin from "../src"; -import { run, runEmit, runChange } from './helpers/run'; +import { run, runEmit, runChange } from "./helpers/run"; -import { readAssets, getCompiler, compile } from './helpers'; +import { readAssets, getCompiler, compile } from "./helpers"; -const FIXTURES_DIR = path.join(__dirname, 'fixtures'); +const FIXTURES_DIR = path.join(__dirname, "fixtures"); -describe('CopyPlugin', () => { - describe('basic', () => { - it('should copy a file', (done) => { +describe("CopyPlugin", () => { + describe("basic", () => { + it("should copy a file", (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", }, ], }) @@ -27,17 +27,17 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy files', (done) => { + it("should copy files", (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", }, ], }) @@ -45,18 +45,18 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy files to new directory', (done) => { + it("should copy files to new directory", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/.dottedfile', - 'newdirectory/directoryfile.txt', - 'newdirectory/nested/deep-nested/deepnested.txt', - 'newdirectory/nested/nestedfile.txt', + "newdirectory/.dottedfile", + "newdirectory/directoryfile.txt", + "newdirectory/nested/deep-nested/deepnested.txt", + "newdirectory/nested/nestedfile.txt", ], patterns: [ { - from: 'directory', - to: 'newdirectory', + from: "directory", + to: "newdirectory", }, ], }) @@ -64,17 +64,17 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy files to new directory with context', (done) => { + it("should copy files to new directory with context", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/deep-nested/deepnested.txt', - 'newdirectory/nestedfile.txt', + "newdirectory/deep-nested/deepnested.txt", + "newdirectory/nestedfile.txt", ], patterns: [ { - from: 'nested', - context: 'directory', - to: 'newdirectory', + from: "nested", + context: "directory", + to: "newdirectory", }, ], }) @@ -82,16 +82,16 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy files using glob', (done) => { + it("should copy files using glob", (done) => { runEmit({ expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ], patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", }, ], }) @@ -99,17 +99,17 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy files using glob to new directory', (done) => { + it("should copy files using glob to new directory", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/directory/directoryfile.txt', - 'newdirectory/directory/nested/deep-nested/deepnested.txt', - 'newdirectory/directory/nested/nestedfile.txt', + "newdirectory/directory/directoryfile.txt", + "newdirectory/directory/nested/deep-nested/deepnested.txt", + "newdirectory/directory/nested/nestedfile.txt", ], patterns: [ { - from: 'directory/**/*', - to: 'newdirectory', + from: "directory/**/*", + to: "newdirectory", }, ], }) @@ -117,17 +117,17 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy files using glob to new directory with context', (done) => { + it("should copy files using glob to new directory with context", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/nested/deep-nested/deepnested.txt', - 'newdirectory/nested/nestedfile.txt', + "newdirectory/nested/deep-nested/deepnested.txt", + "newdirectory/nested/nestedfile.txt", ], patterns: [ { - from: 'nested/**/*', - context: 'directory', - to: 'newdirectory', + from: "nested/**/*", + context: "directory", + to: "newdirectory", }, ], }) @@ -135,13 +135,13 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy a file to a new file', (done) => { + it("should copy a file to a new file", (done) => { runEmit({ - expectedAssetKeys: ['newfile.txt'], + expectedAssetKeys: ["newfile.txt"], patterns: [ { - from: 'file.txt', - to: 'newfile.txt', + from: "file.txt", + to: "newfile.txt", }, ], }) @@ -149,14 +149,14 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should copy a file to a new file with context', (done) => { + it("should copy a file to a new file with context", (done) => { runEmit({ - expectedAssetKeys: ['newfile.txt'], + expectedAssetKeys: ["newfile.txt"], patterns: [ { - from: 'directoryfile.txt', - context: 'directory', - to: 'newfile.txt', + from: "directoryfile.txt", + context: "directory", + to: "newfile.txt", }, ], }) @@ -164,17 +164,17 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should multiple files to a new file', (done) => { + it("should multiple files to a new file", (done) => { runEmit({ - expectedAssetKeys: ['newfile.txt', 'newbinextension.bin'], + expectedAssetKeys: ["newfile.txt", "newbinextension.bin"], patterns: [ { - from: 'file.txt', - to: 'newfile.txt', + from: "file.txt", + to: "newfile.txt", }, { - from: 'binextension.bin', - to: 'newbinextension.bin', + from: "binextension.bin", + to: "newbinextension.bin", }, ], }) @@ -184,15 +184,15 @@ describe('CopyPlugin', () => { it('should copy multiple files with same "from"', (done) => { runEmit({ - expectedAssetKeys: ['first/file.txt', 'second/file.txt'], + expectedAssetKeys: ["first/file.txt", "second/file.txt"], patterns: [ { - from: 'file.txt', - to: 'first/file.txt', + from: "file.txt", + to: "first/file.txt", }, { - from: 'file.txt', - to: 'second/file.txt', + from: "file.txt", + to: "second/file.txt", }, ], }) @@ -200,27 +200,27 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should works with multiple patterns as String', (done) => { + it("should works with multiple patterns as String", (done) => { runEmit({ - expectedAssetKeys: ['binextension.bin', 'file.txt', 'noextension'], - patterns: ['binextension.bin', 'file.txt', 'noextension'], + expectedAssetKeys: ["binextension.bin", "file.txt", "noextension"], + patterns: ["binextension.bin", "file.txt", "noextension"], }) .then(done) .catch(done); }); - it('should works with multiple patterns as Object', (done) => { + it("should works with multiple patterns as Object", (done) => { runEmit({ - expectedAssetKeys: ['binextension.bin', 'file.txt', 'noextension'], + expectedAssetKeys: ["binextension.bin", "file.txt", "noextension"], patterns: [ { - from: 'binextension.bin', + from: "binextension.bin", }, { - from: 'file.txt', + from: "file.txt", }, { - from: 'noextension', + from: "noextension", }, ], }) @@ -230,10 +230,10 @@ describe('CopyPlugin', () => { it('should work with linux path segment separation path when "from" is glob', (done) => { runEmit({ - expectedAssetKeys: ['directory/nested/nestedfile.txt'], + expectedAssetKeys: ["directory/nested/nestedfile.txt"], patterns: [ { - from: 'directory/nested/*', + from: "directory/nested/*", }, ], }) @@ -241,20 +241,20 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should exclude path with linux path segment separators', (done) => { + it("should exclude path with linux path segment separators", (done) => { runEmit({ expectedAssetKeys: [ - '[(){}[]!+@escaped-test^$]/hello.txt', - '[special$directory]/(special-*file).txt', - '[special$directory]/directoryfile.txt', - '[special$directory]/nested/nestedfile.txt', - 'dir (86)/file.txt', - 'dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt', - 'dir (86)/nesteddir/nestedfile.txt', + "[(){}[]!+@escaped-test^$]/hello.txt", + "[special$directory]/(special-*file).txt", + "[special$directory]/directoryfile.txt", + "[special$directory]/nested/nestedfile.txt", + "dir (86)/file.txt", + "dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt", + "dir (86)/nesteddir/nestedfile.txt", ], patterns: [ { - from: '!(directory)/**/*.txt', + from: "!(directory)/**/*.txt", }, ], }) @@ -266,19 +266,19 @@ describe('CopyPlugin', () => { expect.assertions(5); const expectedAssetKeys = [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ]; run({ preCopy: { additionalAssets: [ - { name: 'foo-bar.txt', data: 'Content', info: { custom: true } }, + { name: "foo-bar.txt", data: "Content", info: { custom: true } }, { - name: 'nested/nestedfile.txt', - data: 'Content', + name: "nested/nestedfile.txt", + data: "Content", info: { custom: true }, }, ], @@ -286,7 +286,7 @@ describe('CopyPlugin', () => { expectedAssetKeys, patterns: [ { - from: 'directory', + from: "directory", force: true, }, ], @@ -297,7 +297,7 @@ describe('CopyPlugin', () => { expect(info.copied).toBe(true); - if (name === 'nested/nestedfile.txt') { + if (name === "nested/nestedfile.txt") { expect(info.custom).toBe(true); } } @@ -310,18 +310,18 @@ describe('CopyPlugin', () => { expect.assertions(5); const expectedAssetKeys = [ - 'directoryfile.5d7817ed5bc246756d73d6a4c8e94c33.txt', - '.dottedfile.5e294e270db6734a42f014f0dd18d9ac', - 'nested/nestedfile.31d6cfe0d16ae931b73c59d7e0c089c0.txt', - 'nested/deep-nested/deepnested.31d6cfe0d16ae931b73c59d7e0c089c0.txt', + "directoryfile.5d7817ed5bc246756d73d6a4c8e94c33.txt", + ".dottedfile.5e294e270db6734a42f014f0dd18d9ac", + "nested/nestedfile.31d6cfe0d16ae931b73c59d7e0c089c0.txt", + "nested/deep-nested/deepnested.31d6cfe0d16ae931b73c59d7e0c089c0.txt", ]; run({ preCopy: { additionalAssets: [ { - name: 'directoryfile.5d7817ed5bc246756d73d6a4c8e94c33.txt', - data: 'Content', + name: "directoryfile.5d7817ed5bc246756d73d6a4c8e94c33.txt", + data: "Content", info: { custom: true }, }, ], @@ -329,8 +329,8 @@ describe('CopyPlugin', () => { expectedAssetKeys, patterns: [ { - from: 'directory', - to: '[path][name].[contenthash].[ext]', + from: "directory", + to: "[path][name].[contenthash].[ext]", force: true, }, ], @@ -341,7 +341,7 @@ describe('CopyPlugin', () => { expect(info.immutable).toBe(true); - if (name === 'directoryfile.5d7817ed5bc246756d73d6a4c8e94c33.txt') { + if (name === "directoryfile.5d7817ed5bc246756d73d6a4c8e94c33.txt") { expect(info.immutable).toBe(true); } } @@ -351,15 +351,15 @@ describe('CopyPlugin', () => { }); it('should copy files and print "copied" in the string representation ', (done) => { - const isWebpack4 = webpack.version[0] === '4'; + const isWebpack4 = webpack.version[0] === "4"; expect.assertions(isWebpack4 ? 0 : 1); const expectedAssetKeys = [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ]; run({ @@ -367,7 +367,7 @@ describe('CopyPlugin', () => { expectedAssetKeys, patterns: [ { - from: 'directory', + from: "directory", }, ], }) @@ -382,14 +382,14 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should work with multi compiler mode', async () => { + it("should work with multi compiler mode", async () => { const compiler = webpack([ { - mode: 'development', - context: path.resolve(__dirname, './fixtures'), - entry: path.resolve(__dirname, './helpers/enter.js'), + mode: "development", + context: path.resolve(__dirname, "./fixtures"), + entry: path.resolve(__dirname, "./helpers/enter.js"), output: { - path: path.resolve(__dirname, './outputs/multi-compiler/dist/a'), + path: path.resolve(__dirname, "./outputs/multi-compiler/dist/a"), }, stats: { source: true, @@ -398,17 +398,17 @@ describe('CopyPlugin', () => { new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/directory'), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }), ], }, { - mode: 'development', - entry: path.resolve(__dirname, './helpers/enter.js'), + mode: "development", + entry: path.resolve(__dirname, "./helpers/enter.js"), output: { - path: path.resolve(__dirname, './outputs/multi-compiler/dist/b'), + path: path.resolve(__dirname, "./outputs/multi-compiler/dist/b"), }, stats: { source: true, @@ -417,8 +417,8 @@ describe('CopyPlugin', () => { new CopyPlugin({ patterns: [ { - context: path.resolve(__dirname, './fixtures'), - from: path.resolve(__dirname, './fixtures/directory'), + context: path.resolve(__dirname, "./fixtures"), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }), @@ -438,23 +438,23 @@ describe('CopyPlugin', () => { const { stats } = await compile(compiler); stats.stats.forEach((item, index) => { - expect(item.compilation.errors).toMatchSnapshot('errors'); - expect(item.compilation.warnings).toMatchSnapshot('warnings'); + expect(item.compilation.errors).toMatchSnapshot("errors"); + expect(item.compilation.warnings).toMatchSnapshot("warnings"); expect(readAssets(compiler.compilers[index], item)).toMatchSnapshot( - 'assets' + "assets" ); }); }); }); - describe('watch mode', () => { + describe("watch mode", () => { it('should add the file to the watch list when "from" is a file', (done) => { - const expectedAssetKeys = ['file.txt']; + const expectedAssetKeys = ["file.txt"]; run({ patterns: [ { - from: 'file.txt', + from: "file.txt", }, ], }) @@ -471,14 +471,14 @@ describe('CopyPlugin', () => { run({ patterns: [ { - from: 'directory', + from: "directory", }, ], }) .then(({ stats }) => { const { contextDependencies } = stats.compilation; const isIncludeDependency = contextDependencies.has( - path.join(FIXTURES_DIR, 'directory') + path.join(FIXTURES_DIR, "directory") ); expect(isIncludeDependency).toBe(true); @@ -491,14 +491,14 @@ describe('CopyPlugin', () => { run({ patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", }, ], }) .then(({ stats }) => { const { contextDependencies } = stats.compilation; const isIncludeDependency = contextDependencies.has( - path.join(FIXTURES_DIR, 'directory') + path.join(FIXTURES_DIR, "directory") ); expect(isIncludeDependency).toBe(true); @@ -507,13 +507,13 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should not add the directory to the watch list when glob is a file', (done) => { - const expectedAssetKeys = ['directoryfile.txt']; + it("should not add the directory to the watch list when glob is a file", (done) => { + const expectedAssetKeys = ["directoryfile.txt"]; run({ patterns: [ { - from: 'directory/directoryfile.txt', + from: "directory/directoryfile.txt", }, ], }) @@ -526,19 +526,19 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should include files that have changed when `from` is a file', (done) => { + it("should include files that have changed when `from` is a file", (done) => { runChange({ - expectedAssetKeys: ['tempfile1.txt', 'tempfile2.txt'], - newFileLoc1: path.join(FIXTURES_DIR, 'watch', '_t5', 'tempfile1.txt'), - newFileLoc2: path.join(FIXTURES_DIR, 'watch', '_t5', 'tempfile2.txt'), + expectedAssetKeys: ["tempfile1.txt", "tempfile2.txt"], + newFileLoc1: path.join(FIXTURES_DIR, "watch", "_t5", "tempfile1.txt"), + newFileLoc2: path.join(FIXTURES_DIR, "watch", "_t5", "tempfile2.txt"), patterns: [ { - from: 'tempfile1.txt', - context: 'watch/_t5', + from: "tempfile1.txt", + context: "watch/_t5", }, { - from: 'tempfile2.txt', - context: 'watch/_t5', + from: "tempfile2.txt", + context: "watch/_t5", }, ], }) @@ -546,26 +546,26 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should include all files when `from` is a directory', (done) => { + it("should include all files when `from` is a directory", (done) => { runChange({ - expectedAssetKeys: ['.gitkeep', 'tempfile1.txt', 'tempfile2.txt'], + expectedAssetKeys: [".gitkeep", "tempfile1.txt", "tempfile2.txt"], newFileLoc1: path.join( FIXTURES_DIR, - 'watch', - '_t4', - 'directory', - 'tempfile1.txt' + "watch", + "_t4", + "directory", + "tempfile1.txt" ), newFileLoc2: path.join( FIXTURES_DIR, - 'watch', - '_t4', - 'directory', - 'tempfile2.txt' + "watch", + "_t4", + "directory", + "tempfile2.txt" ), patterns: [ { - from: 'watch/_t4/directory', + from: "watch/_t4/directory", }, ], }) @@ -573,31 +573,31 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should include all files when `from` is a glob', (done) => { + it("should include all files when `from` is a glob", (done) => { runChange({ expectedAssetKeys: [ - '_t3/dest1/tempfile1.txt', - '_t3/dest1/tempfile2.txt', + "_t3/dest1/tempfile1.txt", + "_t3/dest1/tempfile2.txt", ], newFileLoc1: path.join( FIXTURES_DIR, - 'watch', - '_t3', - 'directory', - 'tempfile1.txt' + "watch", + "_t3", + "directory", + "tempfile1.txt" ), newFileLoc2: path.join( FIXTURES_DIR, - 'watch', - '_t3', - 'directory', - 'tempfile2.txt' + "watch", + "_t3", + "directory", + "tempfile2.txt" ), patterns: [ { - context: 'watch/_t3/directory', - from: '**/*.txt', - to: '_t3/dest1', + context: "watch/_t3/directory", + from: "**/*.txt", + to: "_t3/dest1", }, ], }) @@ -605,38 +605,38 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should include all files when multiple patterns used', (done) => { + it("should include all files when multiple patterns used", (done) => { runChange({ expectedAssetKeys: [ - '_t2/dest1/tempfile1.txt', - '_t2/dest1/tempfile2.txt', - '_t2/dest2/tempfile1.txt', - '_t2/dest2/tempfile2.txt', + "_t2/dest1/tempfile1.txt", + "_t2/dest1/tempfile2.txt", + "_t2/dest2/tempfile1.txt", + "_t2/dest2/tempfile2.txt", ], newFileLoc1: path.join( FIXTURES_DIR, - 'watch', - '_t2', - 'directory', - 'tempfile1.txt' + "watch", + "_t2", + "directory", + "tempfile1.txt" ), newFileLoc2: path.join( FIXTURES_DIR, - 'watch', - '_t2', - 'directory', - 'tempfile2.txt' + "watch", + "_t2", + "directory", + "tempfile2.txt" ), patterns: [ { - context: 'watch/_t2/directory', - from: '**/*.txt', - to: '_t2/dest1', + context: "watch/_t2/directory", + from: "**/*.txt", + to: "_t2/dest1", }, { - context: 'watch/_t2/directory', - from: '**/*.txt', - to: '_t2/dest2', + context: "watch/_t2/directory", + from: "**/*.txt", + to: "_t2/dest2", }, ], }) @@ -644,31 +644,31 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should include all files when multiple patterns with difference contexts', (done) => { + it("should include all files when multiple patterns with difference contexts", (done) => { runChange({ expectedAssetKeys: [ - '_t1/dest1/tempfile1.txt', - '_t1/dest2/directory/tempfile1.txt', - '_t1/dest2/tempfile2.txt', + "_t1/dest1/tempfile1.txt", + "_t1/dest2/directory/tempfile1.txt", + "_t1/dest2/tempfile2.txt", ], newFileLoc1: path.join( FIXTURES_DIR, - 'watch', - '_t1', - 'directory', - 'tempfile1.txt' + "watch", + "_t1", + "directory", + "tempfile1.txt" ), - newFileLoc2: path.join(FIXTURES_DIR, 'watch', '_t1', 'tempfile2.txt'), + newFileLoc2: path.join(FIXTURES_DIR, "watch", "_t1", "tempfile2.txt"), patterns: [ { - context: 'watch/_t1/directory', - from: '**/*.txt', - to: '_t1/dest1', + context: "watch/_t1/directory", + from: "**/*.txt", + to: "_t1/dest1", }, { - context: 'watch/_t1', - from: '**/*.txt', - to: '_t1/dest2', + context: "watch/_t1", + from: "**/*.txt", + to: "_t1/dest2", }, ], }) @@ -676,15 +676,15 @@ describe('CopyPlugin', () => { .catch(done); }); - it('should run once on child compilation', (done) => { - const expectedAssetKeys = ['file.txt']; - const spy = jest.spyOn(CopyPlugin, 'apply'); + it("should run once on child compilation", (done) => { + const expectedAssetKeys = ["file.txt"]; + const spy = jest.spyOn(CopyPlugin, "apply"); run({ withChildCompilation: true, patterns: [ { - from: 'file.txt', + from: "file.txt", }, ], }) @@ -701,25 +701,25 @@ describe('CopyPlugin', () => { }); }); - describe('cache', () => { + describe("cache", () => { it('should work with the "memory" cache', async () => { const compiler = getCompiler({ cache: { - type: 'memory', + type: "memory", }, }); new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/directory'), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }).apply(compiler); const { stats } = await compile(compiler); - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(stats.compilation.assets).filter( (assetName) => stats.compilation.assets[assetName].emitted @@ -729,14 +729,14 @@ describe('CopyPlugin', () => { expect(stats.compilation.emittedAssets.size).toBe(5); } - expect(readAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(stats.compilation.errors).toMatchSnapshot('errors'); - expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(readAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(stats.compilation.errors).toMatchSnapshot("errors"); + expect(stats.compilation.warnings).toMatchSnapshot("warnings"); await new Promise(async (resolve) => { const { stats: newStats } = await compile(compiler); - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(newStats.compilation.assets).filter( (assetName) => newStats.compilation.assets[assetName].emitted @@ -746,22 +746,22 @@ describe('CopyPlugin', () => { expect(newStats.compilation.emittedAssets.size).toBe(0); } - expect(readAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(newStats.compilation.errors).toMatchSnapshot('errors'); - expect(newStats.compilation.warnings).toMatchSnapshot('warnings'); + expect(readAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(newStats.compilation.errors).toMatchSnapshot("errors"); + expect(newStats.compilation.warnings).toMatchSnapshot("warnings"); resolve(); }); }); it('should work with the "filesystem" cache', async () => { - const cacheDirectory = path.resolve(__dirname, './outputs/.cache/simple'); + const cacheDirectory = path.resolve(__dirname, "./outputs/.cache/simple"); await del(cacheDirectory); const compiler = getCompiler({ cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory, }, }); @@ -769,14 +769,14 @@ describe('CopyPlugin', () => { new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/directory'), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }).apply(compiler); const { stats } = await compile(compiler); - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(stats.compilation.assets).filter( (assetName) => stats.compilation.assets[assetName].emitted @@ -786,14 +786,14 @@ describe('CopyPlugin', () => { expect(stats.compilation.emittedAssets.size).toBe(5); } - expect(readAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(stats.compilation.errors).toMatchSnapshot('errors'); - expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(readAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(stats.compilation.errors).toMatchSnapshot("errors"); + expect(stats.compilation.warnings).toMatchSnapshot("warnings"); await new Promise(async (resolve) => { const { stats: newStats } = await compile(compiler); - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(newStats.compilation.assets).filter( (assetName) => newStats.compilation.assets[assetName].emitted @@ -803,9 +803,9 @@ describe('CopyPlugin', () => { expect(newStats.compilation.emittedAssets.size).toBe(0); } - expect(readAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(newStats.compilation.errors).toMatchSnapshot('errors'); - expect(newStats.compilation.warnings).toMatchSnapshot('warnings'); + expect(readAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(newStats.compilation.errors).toMatchSnapshot("errors"); + expect(newStats.compilation.warnings).toMatchSnapshot("warnings"); resolve(); }); @@ -814,59 +814,59 @@ describe('CopyPlugin', () => { it('should work with the "filesystem" cache and multi compiler mode', async () => { const cacheDirectoryA = path.resolve( __dirname, - './outputs/.cache/multi-compiler/a' + "./outputs/.cache/multi-compiler/a" ); const cacheDirectoryB = path.resolve( __dirname, - './outputs/.cache/multi-compiler/b' + "./outputs/.cache/multi-compiler/b" ); await del([cacheDirectoryA, cacheDirectoryB]); const compiler = webpack([ { - mode: 'development', - context: path.resolve(__dirname, './fixtures'), - entry: path.resolve(__dirname, './helpers/enter.js'), + mode: "development", + context: path.resolve(__dirname, "./fixtures"), + entry: path.resolve(__dirname, "./helpers/enter.js"), output: { - path: path.resolve(__dirname, './outputs/multi-compiler/dist/a'), + path: path.resolve(__dirname, "./outputs/multi-compiler/dist/a"), }, stats: { source: true, }, cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory: cacheDirectoryA, }, plugins: [ new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/directory'), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }), ], }, { - mode: 'development', - entry: path.resolve(__dirname, './helpers/enter.js'), + mode: "development", + entry: path.resolve(__dirname, "./helpers/enter.js"), output: { - path: path.resolve(__dirname, './outputs/multi-compiler/dist/b'), + path: path.resolve(__dirname, "./outputs/multi-compiler/dist/b"), }, stats: { source: true, }, cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory: cacheDirectoryB, }, plugins: [ new CopyPlugin({ patterns: [ { - context: path.resolve(__dirname, './fixtures'), - from: path.resolve(__dirname, './fixtures/directory'), + context: path.resolve(__dirname, "./fixtures"), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }), @@ -886,7 +886,7 @@ describe('CopyPlugin', () => { const { stats } = await compile(compiler); stats.stats.forEach((item, index) => { - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(item.compilation.assets).filter( (assetName) => item.compilation.assets[assetName].emitted @@ -896,10 +896,10 @@ describe('CopyPlugin', () => { expect(item.compilation.emittedAssets.size).toBe(5); } - expect(item.compilation.errors).toMatchSnapshot('errors'); - expect(item.compilation.warnings).toMatchSnapshot('warnings'); + expect(item.compilation.errors).toMatchSnapshot("errors"); + expect(item.compilation.warnings).toMatchSnapshot("warnings"); expect(readAssets(compiler.compilers[index], item)).toMatchSnapshot( - 'assets' + "assets" ); }); @@ -907,7 +907,7 @@ describe('CopyPlugin', () => { const { stats: newStats } = await compile(compiler); newStats.stats.forEach((item, index) => { - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(item.compilation.assets).filter( (assetName) => item.compilation.assets[assetName].emitted @@ -917,10 +917,10 @@ describe('CopyPlugin', () => { expect(item.compilation.emittedAssets.size).toBe(0); } - expect(item.compilation.errors).toMatchSnapshot('errors'); - expect(item.compilation.warnings).toMatchSnapshot('warnings'); + expect(item.compilation.errors).toMatchSnapshot("errors"); + expect(item.compilation.warnings).toMatchSnapshot("warnings"); expect(readAssets(compiler.compilers[index], item)).toMatchSnapshot( - 'assets' + "assets" ); }); @@ -929,22 +929,22 @@ describe('CopyPlugin', () => { }); it('should work with the "transform" option', async () => { - const cacheDirectory = path.resolve(__dirname, './outputs/.cache/simple'); + const cacheDirectory = path.resolve(__dirname, "./outputs/.cache/simple"); await del([ cacheDirectory, - path.resolve(__dirname, '../node_modules/.cache/copy-webpack-plugin'), + path.resolve(__dirname, "../node_modules/.cache/copy-webpack-plugin"), ]); const compiler = getCompiler({ cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory, }, }); const getMyVar = () => { - return 'baz'; + return "baz"; }; new CopyPlugin({ @@ -952,16 +952,16 @@ describe('CopyPlugin', () => { { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new0.txt', + to: "new0.txt", }, { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new1.txt', + to: "new1.txt", transform: (content) => { return `${content.toString()}added1`; }, @@ -970,9 +970,9 @@ describe('CopyPlugin', () => { { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new1-2.txt', + to: "new1-2.txt", transform: (content) => { return `${content.toString()}added1`; }, @@ -981,9 +981,9 @@ describe('CopyPlugin', () => { { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new2.txt', + to: "new2.txt", transform: (content) => { return `${content.toString()}added2`; }, @@ -992,9 +992,9 @@ describe('CopyPlugin', () => { { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new3.txt', + to: "new3.txt", transform: (content) => { return `${content.toString()}added3`; }, @@ -1003,30 +1003,30 @@ describe('CopyPlugin', () => { { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new4.txt', + to: "new4.txt", transform: (content) => { return `${content.toString()}${getMyVar()}`; }, cacheTransform: { keys: { - foo: 'bar', + foo: "bar", }, }, }, { from: path.resolve( __dirname, - './fixtures/directory/directoryfile.txt' + "./fixtures/directory/directoryfile.txt" ), - to: 'new5.txt', + to: "new5.txt", transform: (content) => { return `${content.toString()}${getMyVar()}`; }, cacheTransform: { keys: { - foo: 'baz', + foo: "baz", }, }, }, @@ -1035,7 +1035,7 @@ describe('CopyPlugin', () => { const { stats } = await compile(compiler); - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(stats.compilation.assets).filter( (assetName) => stats.compilation.assets[assetName].emitted @@ -1045,14 +1045,14 @@ describe('CopyPlugin', () => { expect(stats.compilation.emittedAssets.size).toBe(8); } - expect(readAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(stats.compilation.errors).toMatchSnapshot('errors'); - expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(readAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(stats.compilation.errors).toMatchSnapshot("errors"); + expect(stats.compilation.warnings).toMatchSnapshot("warnings"); await new Promise(async (resolve) => { const { stats: newStats } = await compile(compiler); - if (webpack.version[0] === '4') { + if (webpack.version[0] === "4") { expect( Object.keys(newStats.compilation.assets).filter( (assetName) => newStats.compilation.assets[assetName].emitted @@ -1062,34 +1062,34 @@ describe('CopyPlugin', () => { expect(newStats.compilation.emittedAssets.size).toBe(1); } - expect(readAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(newStats.compilation.errors).toMatchSnapshot('errors'); - expect(newStats.compilation.warnings).toMatchSnapshot('warnings'); + expect(readAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(newStats.compilation.errors).toMatchSnapshot("errors"); + expect(newStats.compilation.warnings).toMatchSnapshot("warnings"); resolve(); }); }); }); - describe('stats', () => { - it('should work have assets info', async () => { + describe("stats", () => { + it("should work have assets info", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './helpers/enter-with-asset-modules.js'), + entry: path.resolve(__dirname, "./helpers/enter-with-asset-modules.js"), }); new CopyPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/directory'), + from: path.resolve(__dirname, "./fixtures/directory"), }, ], }).apply(compiler); const { stats } = await compile(compiler); - expect(stats.compilation.warnings).toMatchSnapshot('warnings'); - expect(stats.compilation.errors).toMatchSnapshot('errors'); - expect(readAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(stats.compilation.warnings).toMatchSnapshot("warnings"); + expect(stats.compilation.errors).toMatchSnapshot("errors"); + expect(readAssets(compiler, stats)).toMatchSnapshot("assets"); const assetsInfo = []; @@ -1116,44 +1116,44 @@ describe('CopyPlugin', () => { return 0; }) - ).toMatchSnapshot('assets info'); + ).toMatchSnapshot("assets info"); }); }); - describe('logging', () => { + describe("logging", () => { it('should logging when "from" is a file', (done) => { - const expectedAssetKeys = ['file.txt']; + const expectedAssetKeys = ["file.txt"]; run({ patterns: [ { - from: 'file.txt', + from: "file.txt", }, ], }) .then(({ compiler, stats }) => { - const root = path.resolve(__dirname).replace(/\\/g, '/'); + const root = path.resolve(__dirname).replace(/\\/g, "/"); const logs = stats.compilation.logging - .get('copy-webpack-plugin') + .get("copy-webpack-plugin") .map((entry) => - entry.args[0].replace(/\\/g, '/').split(root).join('.') + entry.args[0].replace(/\\/g, "/").split(root).join(".") ) // TODO remove after drop webpack@4 .filter( (item) => - !item.startsWith('created snapshot') && - !item.startsWith('creating snapshot') && - !item.startsWith('getting cache') && - !item.startsWith('missed cache') && - !item.startsWith('stored cache') && - !item.startsWith('storing cache') + !item.startsWith("created snapshot") && + !item.startsWith("creating snapshot") && + !item.startsWith("getting cache") && + !item.startsWith("missed cache") && + !item.startsWith("stored cache") && + !item.startsWith("storing cache") ) .sort(); expect( Array.from(Object.keys(readAssets(compiler, stats))).sort() ).toEqual(expectedAssetKeys); - expect({ logs }).toMatchSnapshot('logs'); + expect({ logs }).toMatchSnapshot("logs"); }) .then(done) .catch(done); @@ -1161,42 +1161,42 @@ describe('CopyPlugin', () => { it('should logging when "from" is a directory', (done) => { const expectedAssetKeys = [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ]; run({ patterns: [ { - from: 'directory', + from: "directory", }, ], }) .then(({ compiler, stats }) => { - const root = path.resolve(__dirname).replace(/\\/g, '/'); + const root = path.resolve(__dirname).replace(/\\/g, "/"); const logs = stats.compilation.logging - .get('copy-webpack-plugin') + .get("copy-webpack-plugin") .map((entry) => - entry.args[0].replace(/\\/g, '/').split(root).join('.') + entry.args[0].replace(/\\/g, "/").split(root).join(".") ) // TODO remove after drop webpack@4 .filter( (item) => - !item.startsWith('created snapshot') && - !item.startsWith('creating snapshot') && - !item.startsWith('getting cache') && - !item.startsWith('missed cache') && - !item.startsWith('stored cache') && - !item.startsWith('storing cache') + !item.startsWith("created snapshot") && + !item.startsWith("creating snapshot") && + !item.startsWith("getting cache") && + !item.startsWith("missed cache") && + !item.startsWith("stored cache") && + !item.startsWith("storing cache") ) .sort(); expect( Array.from(Object.keys(readAssets(compiler, stats))).sort() ).toEqual(expectedAssetKeys); - expect({ logs }).toMatchSnapshot('logs'); + expect({ logs }).toMatchSnapshot("logs"); }) .then(done) .catch(done); @@ -1204,15 +1204,15 @@ describe('CopyPlugin', () => { it('should logging when "from" is a glob', (done) => { const expectedAssetKeys = [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ]; run({ patterns: [ { - from: 'directory/**', + from: "directory/**", globOptions: { onlyFiles: false, }, @@ -1220,28 +1220,28 @@ describe('CopyPlugin', () => { ], }) .then(({ compiler, stats }) => { - const root = path.resolve(__dirname).replace(/\\/g, '/'); + const root = path.resolve(__dirname).replace(/\\/g, "/"); const logs = stats.compilation.logging - .get('copy-webpack-plugin') + .get("copy-webpack-plugin") .map((entry) => - entry.args[0].replace(/\\/g, '/').split(root).join('.') + entry.args[0].replace(/\\/g, "/").split(root).join(".") ) // TODO remove after drop webpack@4 .filter( (item) => - !item.startsWith('created snapshot') && - !item.startsWith('creating snapshot') && - !item.startsWith('getting cache') && - !item.startsWith('missed cache') && - !item.startsWith('stored cache') && - !item.startsWith('storing cache') + !item.startsWith("created snapshot") && + !item.startsWith("creating snapshot") && + !item.startsWith("getting cache") && + !item.startsWith("missed cache") && + !item.startsWith("stored cache") && + !item.startsWith("storing cache") ) .sort(); expect( Array.from(Object.keys(readAssets(compiler, stats))).sort() ).toEqual(expectedAssetKeys); - expect({ logs }).toMatchSnapshot('logs'); + expect({ logs }).toMatchSnapshot("logs"); }) .then(done) .catch(done); diff --git a/test/cacheTransform-option.test.js b/test/cacheTransform-option.test.js index 9f9b0db5..0d79df75 100644 --- a/test/cacheTransform-option.test.js +++ b/test/cacheTransform-option.test.js @@ -1,23 +1,23 @@ -import fs from 'fs'; -import path from 'path'; -import zlib from 'zlib'; +import fs from "fs"; +import path from "path"; +import zlib from "zlib"; -import webpack from 'webpack'; -import cacache from 'cacache'; -import findCacheDir from 'find-cache-dir'; -import isGzip from 'is-gzip'; +import webpack from "webpack"; +import cacache from "cacache"; +import findCacheDir from "find-cache-dir"; +import isGzip from "is-gzip"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; -const FIXTURES_DIR = path.join(__dirname, 'fixtures'); +const FIXTURES_DIR = path.join(__dirname, "fixtures"); -if (webpack.version[0] === '4') { - describe('cache option', () => { - const defaultCacheDir = findCacheDir({ name: 'copy-webpack-plugin' }); - const cacheDir1 = findCacheDir({ name: 'copy-webpack-plugin-1' }); - const cacheDir2 = findCacheDir({ name: 'copy-webpack-plugin-2' }); - const cacheDir3 = findCacheDir({ name: 'copy-webpack-plugin-3' }); - const cacheDir4 = findCacheDir({ name: 'copy-webpack-plugin-4' }); +if (webpack.version[0] === "4") { + describe("cache option", () => { + const defaultCacheDir = findCacheDir({ name: "copy-webpack-plugin" }); + const cacheDir1 = findCacheDir({ name: "copy-webpack-plugin-1" }); + const cacheDir2 = findCacheDir({ name: "copy-webpack-plugin-2" }); + const cacheDir3 = findCacheDir({ name: "copy-webpack-plugin-3" }); + const cacheDir4 = findCacheDir({ name: "copy-webpack-plugin-4" }); beforeEach(() => [ cacache.rm.all(defaultCacheDir), @@ -28,13 +28,13 @@ if (webpack.version[0] === '4') { ]); it('should cache when "from" is a file', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -60,19 +60,19 @@ if (webpack.version[0] === '4') { }); it('should cache files when "from" is a directory', (done) => { - const from = 'directory'; + const from = "directory"; runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], expectedAssetContent: { - '.dottedfile': 'dottedfile contents\nchanged!', - 'directoryfile.txt': 'newchanged!', - 'nested/nestedfile.txt': 'changed!', + ".dottedfile": "dottedfile contents\nchanged!", + "directoryfile.txt": "newchanged!", + "nested/nestedfile.txt": "changed!", }, patterns: [ { @@ -98,12 +98,12 @@ if (webpack.version[0] === '4') { }); it('should cache when "from" is a glob', (done) => { - const from = 'directory/*.txt'; + const from = "directory/*.txt"; runEmit({ - expectedAssetKeys: ['directory/directoryfile.txt'], + expectedAssetKeys: ["directory/directoryfile.txt"], expectedAssetContent: { - 'directory/directoryfile.txt': 'newchanged!', + "directory/directoryfile.txt": "newchanged!", }, patterns: [ { @@ -128,14 +128,14 @@ if (webpack.version[0] === '4') { .catch(done); }); - it('should cache file with custom cache directory', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + it("should cache file with custom cache directory", (done) => { + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -161,13 +161,13 @@ if (webpack.version[0] === '4') { }); it('should cache file with custom cache directory when "cacheTransform" is an object', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -195,20 +195,20 @@ if (webpack.version[0] === '4') { }); it('should cache file with custom object cache keys when "cacheTransform" is an object', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { from, cacheTransform: { keys: { - key: 'foobar', + key: "foobar", }, }, transform: (content) => { @@ -228,11 +228,11 @@ if (webpack.version[0] === '4') { cacheKeys.forEach((cacheKey) => { // eslint-disable-next-line no-new-func const cacheEntry = new Function( - `'use strict'\nreturn (${cacheKey.replace('transform|', '')});` + `'use strict'\nreturn (${cacheKey.replace("transform|", "")});` )(); // expect(cacheEntry.pattern.from).toBe(from); - expect(cacheEntry.key).toBe('foobar'); + expect(cacheEntry.key).toBe("foobar"); }); }) ) @@ -241,13 +241,13 @@ if (webpack.version[0] === '4') { }); it('should cache file with custom function cache keys when "cacheTransform" is an object', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -258,7 +258,7 @@ if (webpack.version[0] === '4') { return { ...defaultCacheKeys, - key: 'foobar', + key: "foobar", }; }, }, @@ -279,11 +279,11 @@ if (webpack.version[0] === '4') { cacheKeys.forEach((cacheKey) => { // eslint-disable-next-line no-new-func const cacheEntry = new Function( - `'use strict'\nreturn (${cacheKey.replace('transform|', '')});` + `'use strict'\nreturn (${cacheKey.replace("transform|", "")});` )(); // expect(cacheEntry.pattern.from).toBe(from); - expect(cacheEntry.key).toBe('foobar'); + expect(cacheEntry.key).toBe("foobar"); }); }) ) @@ -292,13 +292,13 @@ if (webpack.version[0] === '4') { }); it('should cache file with custom async function cache keys when "cacheTransform" is an object', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -309,7 +309,7 @@ if (webpack.version[0] === '4') { return { ...defaultCacheKeys, - key: 'foobar', + key: "foobar", }; }, }, @@ -330,11 +330,11 @@ if (webpack.version[0] === '4') { cacheKeys.forEach((cacheKey) => { // eslint-disable-next-line no-new-func const cacheEntry = new Function( - `'use strict'\nreturn (${cacheKey.replace('transform|', '')});` + `'use strict'\nreturn (${cacheKey.replace("transform|", "")});` )(); // expect(cacheEntry.pattern.from).toBe(from); - expect(cacheEntry.key).toBe('foobar'); + expect(cacheEntry.key).toBe("foobar"); }); }) ) @@ -343,13 +343,13 @@ if (webpack.version[0] === '4') { }); it('should cache file with custom object cache keys and custom cache directory when "cacheTransform" is an object', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -357,7 +357,7 @@ if (webpack.version[0] === '4') { cacheTransform: { directory: cacheDir3, keys: { - key: 'foobar', + key: "foobar", }, }, transform(content) { @@ -375,7 +375,7 @@ if (webpack.version[0] === '4') { expect(cacheKeys).toHaveLength(1); cacheKeys.forEach((cacheKey) => { - expect(cacheKey).toContain('foobar'); + expect(cacheKey).toContain("foobar"); }); }) ) @@ -384,13 +384,13 @@ if (webpack.version[0] === '4') { }); it('should cache file with custom function cache keys and custom cache directory when "cacheTransform" is an object', (done) => { - const newContent = 'newchanged!'; - const from = 'file.txt'; + const newContent = "newchanged!"; + const from = "file.txt"; runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': newContent, + "file.txt": newContent, }, patterns: [ { @@ -402,7 +402,7 @@ if (webpack.version[0] === '4') { return { ...defaultCacheKeys, - key: 'foobar', + key: "foobar", }; }, }, @@ -421,7 +421,7 @@ if (webpack.version[0] === '4') { expect(cacheKeys).toHaveLength(1); cacheKeys.forEach((cacheKey) => { - expect(cacheKey).toContain('foobar'); + expect(cacheKey).toContain("foobar"); }); }) ) @@ -429,18 +429,18 @@ if (webpack.version[0] === '4') { .catch(done); }); - it('should cache binary file', (done) => { - const from = 'file.txt.gz'; + it("should cache binary file", (done) => { + const from = "file.txt.gz"; const content = fs.readFileSync(path.join(FIXTURES_DIR, from)); - const expectedNewContent = zlib.gzipSync('newchanged!'); + const expectedNewContent = zlib.gzipSync("newchanged!"); expect(isGzip(content)).toBe(true); expect(isGzip(expectedNewContent)).toBe(true); runEmit({ - expectedAssetKeys: ['file.txt.gz'], + expectedAssetKeys: ["file.txt.gz"], expectedAssetContent: { - 'file.txt.gz': expectedNewContent, + "file.txt.gz": expectedNewContent, }, patterns: [ { @@ -487,8 +487,8 @@ if (webpack.version[0] === '4') { }); }); } else { - describe('cache option', () => { - it('skip', () => { + describe("cache option", () => { + it("skip", () => { expect(true).toBe(true); }); }); diff --git a/test/cjs.test.js b/test/cjs.test.js index 8aba6ba8..dc8321a3 100644 --- a/test/cjs.test.js +++ b/test/cjs.test.js @@ -1,8 +1,8 @@ -import src from '../src'; -import cjs from '../src/cjs'; +import src from "../src"; +import cjs from "../src/cjs"; -describe('cjs', () => { - it('should exported', () => { +describe("cjs", () => { + it("should exported", () => { expect(cjs).toEqual(src); }); }); diff --git a/test/context-option.test.js b/test/context-option.test.js index 10de8e0c..a3c9607e 100644 --- a/test/context-option.test.js +++ b/test/context-option.test.js @@ -1,17 +1,17 @@ -import path from 'path'; +import path from "path"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; -const FIXTURES_DIR = path.join(__dirname, 'fixtures'); +const FIXTURES_DIR = path.join(__dirname, "fixtures"); -describe('context option', () => { +describe("context option", () => { it('should work when "from" is a file and "context" is a relative path', (done) => { runEmit({ - expectedAssetKeys: ['directoryfile.txt'], + expectedAssetKeys: ["directoryfile.txt"], patterns: [ { - from: 'directoryfile.txt', - context: 'directory', + from: "directoryfile.txt", + context: "directory", }, ], }) @@ -21,11 +21,11 @@ describe('context option', () => { it('should work when "from" is a directory and "context" is a relative path', (done) => { runEmit({ - expectedAssetKeys: ['deep-nested/deepnested.txt', 'nestedfile.txt'], + expectedAssetKeys: ["deep-nested/deepnested.txt", "nestedfile.txt"], patterns: [ { - from: 'nested', - context: 'directory', + from: "nested", + context: "directory", }, ], }) @@ -36,13 +36,13 @@ describe('context option', () => { it('should work when "from" is a glob and "context" is a relative path', (done) => { runEmit({ expectedAssetKeys: [ - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'nested/**/*', - context: 'directory', + from: "nested/**/*", + context: "directory", }, ], }) @@ -52,11 +52,11 @@ describe('context option', () => { it('should work when "from" is a file and "context" is an absolute path', (done) => { runEmit({ - expectedAssetKeys: ['directoryfile.txt'], + expectedAssetKeys: ["directoryfile.txt"], patterns: [ { - from: 'directoryfile.txt', - context: path.join(FIXTURES_DIR, 'directory'), + from: "directoryfile.txt", + context: path.join(FIXTURES_DIR, "directory"), }, ], }) @@ -66,11 +66,11 @@ describe('context option', () => { it('should work when "from" is a directory and "context" is an absolute path', (done) => { runEmit({ - expectedAssetKeys: ['deep-nested/deepnested.txt', 'nestedfile.txt'], + expectedAssetKeys: ["deep-nested/deepnested.txt", "nestedfile.txt"], patterns: [ { - from: 'nested', - context: path.join(FIXTURES_DIR, 'directory'), + from: "nested", + context: path.join(FIXTURES_DIR, "directory"), }, ], }) @@ -81,13 +81,13 @@ describe('context option', () => { it('should work when "from" is a glob and "context" is an absolute path', (done) => { runEmit({ expectedAssetKeys: [ - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'nested/**/*', - context: path.join(FIXTURES_DIR, 'directory'), + from: "nested/**/*", + context: path.join(FIXTURES_DIR, "directory"), }, ], }) @@ -97,11 +97,11 @@ describe('context option', () => { it('should work when "from" is a file and "context" with special characters', (done) => { runEmit({ - expectedAssetKeys: ['directoryfile.txt'], + expectedAssetKeys: ["directoryfile.txt"], patterns: [ { - from: 'directoryfile.txt', - context: '[special$directory]', + from: "directoryfile.txt", + context: "[special$directory]", }, ], }) @@ -112,15 +112,15 @@ describe('context option', () => { it('should work when "from" is a directory and "context" with special characters', (done) => { runEmit({ expectedAssetKeys: [ - 'directoryfile.txt', - '(special-*file).txt', - 'nested/nestedfile.txt', + "directoryfile.txt", + "(special-*file).txt", + "nested/nestedfile.txt", ], patterns: [ { // Todo strange behavour when you use `FIXTURES_DIR`, need investigate for next major release - from: '.', - context: '[special$directory]', + from: ".", + context: "[special$directory]", }, ], }) @@ -131,14 +131,14 @@ describe('context option', () => { it('should work when "from" is a glob and "context" with special characters', (done) => { runEmit({ expectedAssetKeys: [ - 'directoryfile.txt', - '(special-*file).txt', - 'nested/nestedfile.txt', + "directoryfile.txt", + "(special-*file).txt", + "nested/nestedfile.txt", ], patterns: [ { - from: '**/*', - context: '[special$directory]', + from: "**/*", + context: "[special$directory]", }, ], }) @@ -148,11 +148,11 @@ describe('context option', () => { it('should work when "from" is a glob and "context" with special characters #2', (done) => { runEmit({ - expectedAssetKeys: ['(special-*file).txt'], + expectedAssetKeys: ["(special-*file).txt"], patterns: [ { - from: '\\(special-*file\\).txt', - context: '[special$directory]', + from: "\\(special-*file\\).txt", + context: "[special$directory]", }, ], }) @@ -162,12 +162,12 @@ describe('context option', () => { it('should work when "from" is a file and "to" is a directory', (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/directoryfile.txt'], + expectedAssetKeys: ["newdirectory/directoryfile.txt"], patterns: [ { - context: 'directory', - from: 'directoryfile.txt', - to: 'newdirectory', + context: "directory", + from: "directoryfile.txt", + to: "newdirectory", }, ], }) @@ -178,14 +178,14 @@ describe('context option', () => { it('should work when "from" is a directory and "to" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/deep-nested/deepnested.txt', - 'newdirectory/nestedfile.txt', + "newdirectory/deep-nested/deepnested.txt", + "newdirectory/nestedfile.txt", ], patterns: [ { - context: 'directory', - from: 'nested', - to: 'newdirectory', + context: "directory", + from: "nested", + to: "newdirectory", }, ], }) @@ -196,15 +196,15 @@ describe('context option', () => { it('should work when "from" is a glob and "to" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - 'nested/directoryfile.txt', - 'nested/nested/deep-nested/deepnested.txt', - 'nested/nested/nestedfile.txt', + "nested/directoryfile.txt", + "nested/nested/deep-nested/deepnested.txt", + "nested/nested/nestedfile.txt", ], patterns: [ { - context: 'directory', - from: '**/*', - to: 'nested', + context: "directory", + from: "**/*", + to: "nested", }, ], }) diff --git a/test/filter-option.test.js b/test/filter-option.test.js index 1f43b8d4..5ee13aee 100644 --- a/test/filter-option.test.js +++ b/test/filter-option.test.js @@ -1,18 +1,18 @@ -import fs from 'fs'; +import fs from "fs"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; describe('"filter" option', () => { - it('should work, copy files and filter some of them', (done) => { + it("should work, copy files and filter some of them", (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", filter: (resourcePath) => { if (/directoryfile\.txt$/.test(resourcePath)) { return false; @@ -27,21 +27,21 @@ describe('"filter" option', () => { .catch(done); }); - it('should work, copy files and filter some of them using async function', (done) => { + it("should work, copy files and filter some of them using async function", (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", filter: async (resourcePath) => { const data = await fs.promises.readFile(resourcePath); const content = data.toString(); - if (content === 'new') { + if (content === "new") { return false; } diff --git a/test/flatten-option.test.js b/test/flatten-option.test.js index ef83f46c..f9a02ef5 100644 --- a/test/flatten-option.test.js +++ b/test/flatten-option.test.js @@ -1,13 +1,13 @@ -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; -describe('flatten option', () => { +describe("flatten option", () => { it('should flatten a directory\'s files to a root directory when "from" is a file', (done) => { runEmit({ - expectedAssetKeys: ['directoryfile.txt'], + expectedAssetKeys: ["directoryfile.txt"], patterns: [ { flatten: true, - from: 'directory/directoryfile.txt', + from: "directory/directoryfile.txt", }, ], }) @@ -17,12 +17,12 @@ describe('flatten option', () => { it('should flatten a directory\'s files to a new directory when "from" is a file', (done) => { runEmit({ - expectedAssetKeys: ['nested/directoryfile.txt'], + expectedAssetKeys: ["nested/directoryfile.txt"], patterns: [ { flatten: true, - from: 'directory/directoryfile.txt', - to: 'nested', + from: "directory/directoryfile.txt", + to: "nested", }, ], }) @@ -33,15 +33,15 @@ describe('flatten option', () => { it('should flatten a directory\'s files to a root directory when "from" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'deepnested.txt', - 'directoryfile.txt', - 'nestedfile.txt', + ".dottedfile", + "deepnested.txt", + "directoryfile.txt", + "nestedfile.txt", ], patterns: [ { flatten: true, - from: 'directory', + from: "directory", }, ], }) @@ -52,16 +52,16 @@ describe('flatten option', () => { it('should flatten a directory\'s files to new directory when "from" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/.dottedfile', - 'newdirectory/deepnested.txt', - 'newdirectory/directoryfile.txt', - 'newdirectory/nestedfile.txt', + "newdirectory/.dottedfile", + "newdirectory/deepnested.txt", + "newdirectory/directoryfile.txt", + "newdirectory/nestedfile.txt", ], patterns: [ { flatten: true, - from: 'directory', - to: 'newdirectory', + from: "directory", + to: "newdirectory", }, ], }) @@ -72,14 +72,14 @@ describe('flatten option', () => { it('should flatten a directory\'s files to a root directory when "from" is a glob', (done) => { runEmit({ expectedAssetKeys: [ - 'deepnested.txt', - 'directoryfile.txt', - 'nestedfile.txt', + "deepnested.txt", + "directoryfile.txt", + "nestedfile.txt", ], patterns: [ { flatten: true, - from: 'directory/**/*', + from: "directory/**/*", }, ], }) @@ -90,15 +90,15 @@ describe('flatten option', () => { it('should flatten a directory\'s files to a new directory when "from" is a glob', (done) => { runEmit({ expectedAssetKeys: [ - 'nested/deepnested.txt', - 'nested/directoryfile.txt', - 'nested/nestedfile.txt', + "nested/deepnested.txt", + "nested/directoryfile.txt", + "nested/nestedfile.txt", ], patterns: [ { flatten: true, - from: 'directory/**/*', - to: 'nested', + from: "directory/**/*", + to: "nested", }, ], }) @@ -109,15 +109,15 @@ describe('flatten option', () => { it('should flatten files in a relative context to a root directory when "from" is a glob', (done) => { runEmit({ expectedAssetKeys: [ - 'deepnested.txt', - 'directoryfile.txt', - 'nestedfile.txt', + "deepnested.txt", + "directoryfile.txt", + "nestedfile.txt", ], patterns: [ { - context: 'directory', + context: "directory", flatten: true, - from: '**/*', + from: "**/*", }, ], }) @@ -128,16 +128,16 @@ describe('flatten option', () => { it('should flatten files in a relative context to a non-root directory when "from" is a glob', (done) => { runEmit({ expectedAssetKeys: [ - 'nested/deepnested.txt', - 'nested/directoryfile.txt', - 'nested/nestedfile.txt', + "nested/deepnested.txt", + "nested/directoryfile.txt", + "nested/nestedfile.txt", ], patterns: [ { - context: 'directory', + context: "directory", flatten: true, - from: '**/*', - to: 'nested', + from: "**/*", + to: "nested", }, ], }) diff --git a/test/force-option.test.js b/test/force-option.test.js index 87c0687f..09713a2b 100644 --- a/test/force-option.test.js +++ b/test/force-option.test.js @@ -1,17 +1,17 @@ -import { runForce } from './helpers/run'; +import { runForce } from "./helpers/run"; -describe('force option', () => { - describe('is not specified', () => { +describe("force option", () => { + describe("is not specified", () => { it('should not overwrite a file already in the compilation by default when "from" is a file', (done) => { runForce({ - additionalAssets: [{ name: 'file.txt', data: 'existing' }], - expectedAssetKeys: ['file.txt'], + additionalAssets: [{ name: "file.txt", data: "existing" }], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': 'existing', + "file.txt": "existing", }, patterns: [ { - from: 'file.txt', + from: "file.txt", }, ], }) @@ -22,26 +22,26 @@ describe('force option', () => { it('should not overwrite files already in the compilation when "from" is a directory', (done) => { runForce({ additionalAssets: [ - { name: '.dottedfile', data: 'existing' }, - { name: 'directoryfile.txt', data: 'existing' }, - { name: 'nested/deep-nested/deepnested.txt', data: 'existing' }, - { name: 'nested/nestedfile.txt', data: 'existing' }, + { name: ".dottedfile", data: "existing" }, + { name: "directoryfile.txt", data: "existing" }, + { name: "nested/deep-nested/deepnested.txt", data: "existing" }, + { name: "nested/nestedfile.txt", data: "existing" }, ], expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], expectedAssetContent: { - '.dottedfile': 'existing', - 'nested/deep-nested/deepnested.txt': 'existing', - 'nested/nestedfile.txt': 'existing', - 'directoryfile.txt': 'existing', + ".dottedfile": "existing", + "nested/deep-nested/deepnested.txt": "existing", + "nested/nestedfile.txt": "existing", + "directoryfile.txt": "existing", }, patterns: [ { - from: 'directory', + from: "directory", }, ], }) @@ -52,26 +52,26 @@ describe('force option', () => { it('should not overwrite files already in the compilation when "from" is a glob', (done) => { runForce({ additionalAssets: [ - { name: 'directory/directoryfile.txt', data: 'existing' }, + { name: "directory/directoryfile.txt", data: "existing" }, { - name: 'directory/nested/deep-nested/deepnested.txt', - data: 'existing', + name: "directory/nested/deep-nested/deepnested.txt", + data: "existing", }, - { name: 'directory/nested/nestedfile.txt', data: 'existing' }, + { name: "directory/nested/nestedfile.txt", data: "existing" }, ], expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ], expectedAssetContent: { - 'directory/nested/deep-nested/deepnested.txt': 'existing', - 'directory/nested/nestedfile.txt': 'existing', - 'directory/directoryfile.txt': 'existing', + "directory/nested/deep-nested/deepnested.txt": "existing", + "directory/nested/nestedfile.txt": "existing", + "directory/directoryfile.txt": "existing", }, patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", }, ], }) @@ -83,15 +83,15 @@ describe('force option', () => { describe('is "false" (Boolean)', () => { it('should not overwrite a file already in the compilation by default when "from" is a file', (done) => { runForce({ - additionalAssets: [{ name: 'file.txt', data: 'existing' }], - expectedAssetKeys: ['file.txt'], + additionalAssets: [{ name: "file.txt", data: "existing" }], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': 'existing', + "file.txt": "existing", }, patterns: [ { force: false, - from: 'file.txt', + from: "file.txt", }, ], }) @@ -102,27 +102,27 @@ describe('force option', () => { it('should not overwrite files already in the compilation when "from" is a directory', (done) => { runForce({ additionalAssets: [ - { name: '.dottedfile', data: 'existing' }, - { name: 'directoryfile.txt', data: 'existing' }, - { name: 'nested/deep-nested/deepnested.txt', data: 'existing' }, - { name: 'nested/nestedfile.txt', data: 'existing' }, + { name: ".dottedfile", data: "existing" }, + { name: "directoryfile.txt", data: "existing" }, + { name: "nested/deep-nested/deepnested.txt", data: "existing" }, + { name: "nested/nestedfile.txt", data: "existing" }, ], expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], expectedAssetContent: { - '.dottedfile': 'existing', - 'nested/deep-nested/deepnested.txt': 'existing', - 'nested/nestedfile.txt': 'existing', - 'directoryfile.txt': 'existing', + ".dottedfile": "existing", + "nested/deep-nested/deepnested.txt": "existing", + "nested/nestedfile.txt": "existing", + "directoryfile.txt": "existing", }, patterns: [ { force: false, - from: 'directory', + from: "directory", }, ], }) @@ -133,27 +133,27 @@ describe('force option', () => { it('should not overwrite files already in the compilation when "from" is a glob', (done) => { runForce({ additionalAssets: [ - { name: 'directory/directoryfile.txt', data: 'existing' }, + { name: "directory/directoryfile.txt", data: "existing" }, { - name: 'directory/nested/deep-nested/deepnested.txt', - data: 'existing', + name: "directory/nested/deep-nested/deepnested.txt", + data: "existing", }, - { name: 'directory/nested/nestedfile.txt', data: 'existing' }, + { name: "directory/nested/nestedfile.txt", data: "existing" }, ], expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ], expectedAssetContent: { - 'directory/nested/deep-nested/deepnested.txt': 'existing', - 'directory/nested/nestedfile.txt': 'existing', - 'directory/directoryfile.txt': 'existing', + "directory/nested/deep-nested/deepnested.txt": "existing", + "directory/nested/nestedfile.txt": "existing", + "directory/directoryfile.txt": "existing", }, patterns: [ { force: false, - from: 'directory/**/*', + from: "directory/**/*", }, ], }) @@ -165,15 +165,15 @@ describe('force option', () => { describe('is "true" (Boolean)', () => { it('should force overwrite a file already in the compilation when "from" is a file', (done) => { runForce({ - additionalAssets: [{ name: 'file.txt', data: 'existing' }], - expectedAssetKeys: ['file.txt'], + additionalAssets: [{ name: "file.txt", data: "existing" }], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': 'new', + "file.txt": "new", }, patterns: [ { force: true, - from: 'file.txt', + from: "file.txt", }, ], }) @@ -184,27 +184,27 @@ describe('force option', () => { it('should force overwrite files already in the compilation when "from" is a directory', (done) => { runForce({ additionalAssets: [ - { name: '.dottedfile', data: 'existing' }, - { name: 'directoryfile.txt', data: 'existing' }, - { name: 'nested/deep-nested/deepnested.txt', data: 'existing' }, - { name: 'nested/nestedfile.txt', data: 'existing' }, + { name: ".dottedfile", data: "existing" }, + { name: "directoryfile.txt", data: "existing" }, + { name: "nested/deep-nested/deepnested.txt", data: "existing" }, + { name: "nested/nestedfile.txt", data: "existing" }, ], expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], expectedAssetContent: { - '.dottedfile': 'dottedfile contents\n', - 'nested/deep-nested/deepnested.txt': '', - 'nested/nestedfile.txt': '', - 'directoryfile.txt': 'new', + ".dottedfile": "dottedfile contents\n", + "nested/deep-nested/deepnested.txt": "", + "nested/nestedfile.txt": "", + "directoryfile.txt": "new", }, patterns: [ { force: true, - from: 'directory', + from: "directory", }, ], }) @@ -215,27 +215,27 @@ describe('force option', () => { it('should force overwrite files already in the compilation when "from" is a glob', (done) => { runForce({ additionalAssets: [ - { name: 'directory/directoryfile.txt', data: 'existing' }, + { name: "directory/directoryfile.txt", data: "existing" }, { - name: 'directory/nested/deep-nested/deepnested.txt', - data: 'existing', + name: "directory/nested/deep-nested/deepnested.txt", + data: "existing", }, - { name: 'directory/nested/nestedfile.txt', data: 'existing' }, + { name: "directory/nested/nestedfile.txt", data: "existing" }, ], expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ], expectedAssetContent: { - 'directory/nested/deep-nested/deepnested.txt': '', - 'directory/nested/nestedfile.txt': '', - 'directory/directoryfile.txt': 'new', + "directory/nested/deep-nested/deepnested.txt": "", + "directory/nested/nestedfile.txt": "", + "directory/directoryfile.txt": "new", }, patterns: [ { force: true, - from: 'directory/**/*', + from: "directory/**/*", }, ], }) diff --git a/test/from-option.test.js b/test/from-option.test.js index e3eec351..757be79b 100644 --- a/test/from-option.test.js +++ b/test/from-option.test.js @@ -1,19 +1,19 @@ -import path from 'path'; +import path from "path"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; const FIXTURES_DIR_NORMALIZED = path - .join(__dirname, 'fixtures') - .replace(/\\/g, '/'); + .join(__dirname, "fixtures") + .replace(/\\/g, "/"); -describe('from option', () => { - describe('is a file', () => { - it('should move a file', (done) => { +describe("from option", () => { + describe("is a file", () => { + it("should move a file", (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", }, ], }) @@ -23,10 +23,10 @@ describe('from option', () => { it('should move a file when "from" an absolute path', (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: path.posix.join(FIXTURES_DIR_NORMALIZED, 'file.txt'), + from: path.posix.join(FIXTURES_DIR_NORMALIZED, "file.txt"), }, ], }) @@ -34,12 +34,12 @@ describe('from option', () => { .catch(done); }); - it('should move a file from nesting directory', (done) => { + it("should move a file from nesting directory", (done) => { runEmit({ - expectedAssetKeys: ['directoryfile.txt'], + expectedAssetKeys: ["directoryfile.txt"], patterns: [ { - from: 'directory/directoryfile.txt', + from: "directory/directoryfile.txt", }, ], }) @@ -49,12 +49,12 @@ describe('from option', () => { it('should move a file from nesting directory when "from" an absolute path', (done) => { runEmit({ - expectedAssetKeys: ['directoryfile.txt'], + expectedAssetKeys: ["directoryfile.txt"], patterns: [ { from: path.posix.join( FIXTURES_DIR_NORMALIZED, - 'directory/directoryfile.txt' + "directory/directoryfile.txt" ), }, ], @@ -63,21 +63,21 @@ describe('from option', () => { .catch(done); }); - it('should move a file (symbolic link)', (done) => { + it("should move a file (symbolic link)", (done) => { runEmit({ symlink: true, expectedErrors: - process.platform === 'win32' + process.platform === "win32" ? [ new Error( `unable to locate '${FIXTURES_DIR_NORMALIZED}/symlink/file-ln.txt' glob` ), ] : [], - expectedAssetKeys: process.platform === 'win32' ? [] : ['file-ln.txt'], + expectedAssetKeys: process.platform === "win32" ? [] : ["file-ln.txt"], patterns: [ { - from: 'symlink/file-ln.txt', + from: "symlink/file-ln.txt", }, ], }) @@ -85,7 +85,7 @@ describe('from option', () => { .catch(done); }); - it('should throw an error on the missing file', (done) => { + it("should throw an error on the missing file", (done) => { runEmit({ expectedAssetKeys: [], expectedErrors: [ @@ -95,7 +95,7 @@ describe('from option', () => { ], patterns: [ { - from: 'nonexistent.txt', + from: "nonexistent.txt", }, ], }) @@ -104,18 +104,18 @@ describe('from option', () => { }); }); - describe('is a directory', () => { - it('should move files', (done) => { + describe("is a directory", () => { + it("should move files", (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", }, ], }) @@ -126,26 +126,26 @@ describe('from option', () => { it('should move files when "from" is current directory', (done) => { runEmit({ expectedAssetKeys: [ - '.file.txt', - '[(){}[]!+@escaped-test^$]/hello.txt', - '[special$directory]/(special-*file).txt', - '[special$directory]/directoryfile.txt', - '[special$directory]/nested/nestedfile.txt', - 'binextension.bin', - 'dir (86)/file.txt', - 'dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt', - 'dir (86)/nesteddir/nestedfile.txt', - 'directory/.dottedfile', - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', - 'file.txt', - 'file.txt.gz', - 'noextension', + ".file.txt", + "[(){}[]!+@escaped-test^$]/hello.txt", + "[special$directory]/(special-*file).txt", + "[special$directory]/directoryfile.txt", + "[special$directory]/nested/nestedfile.txt", + "binextension.bin", + "dir (86)/file.txt", + "dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt", + "dir (86)/nesteddir/nestedfile.txt", + "directory/.dottedfile", + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", + "file.txt", + "file.txt.gz", + "noextension", ], patterns: [ { - from: '.', + from: ".", }, ], }) @@ -156,26 +156,26 @@ describe('from option', () => { it('should move files when "from" is relative path to context', (done) => { runEmit({ expectedAssetKeys: [ - '.file.txt', - '[(){}[]!+@escaped-test^$]/hello.txt', - '[special$directory]/(special-*file).txt', - '[special$directory]/directoryfile.txt', - '[special$directory]/nested/nestedfile.txt', - 'binextension.bin', - 'dir (86)/file.txt', - 'dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt', - 'dir (86)/nesteddir/nestedfile.txt', - 'directory/.dottedfile', - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', - 'file.txt', - 'file.txt.gz', - 'noextension', + ".file.txt", + "[(){}[]!+@escaped-test^$]/hello.txt", + "[special$directory]/(special-*file).txt", + "[special$directory]/directoryfile.txt", + "[special$directory]/nested/nestedfile.txt", + "binextension.bin", + "dir (86)/file.txt", + "dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt", + "dir (86)/nesteddir/nestedfile.txt", + "directory/.dottedfile", + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", + "file.txt", + "file.txt.gz", + "noextension", ], patterns: [ { - from: '../fixtures', + from: "../fixtures", }, ], }) @@ -183,17 +183,17 @@ describe('from option', () => { .catch(done); }); - it('should move files with a forward slash', (done) => { + it("should move files with a forward slash", (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory/', + from: "directory/", }, ], }) @@ -201,12 +201,12 @@ describe('from option', () => { .catch(done); }); - it('should move files from symbolic link', (done) => { + it("should move files from symbolic link", (done) => { runEmit({ // Windows doesn't support symbolic link symlink: true, expectedErrors: - process.platform === 'win32' + process.platform === "win32" ? [ new Error( `unable to locate '${FIXTURES_DIR_NORMALIZED}/symlink/directory-ln/**/*' glob` @@ -214,12 +214,12 @@ describe('from option', () => { ] : [], expectedAssetKeys: - process.platform === 'win32' + process.platform === "win32" ? [] - : ['file.txt', 'nested-directory/file-in-nested-directory.txt'], + : ["file.txt", "nested-directory/file-in-nested-directory.txt"], patterns: [ { - from: 'symlink/directory-ln', + from: "symlink/directory-ln", }, ], }) @@ -230,14 +230,14 @@ describe('from option', () => { it("should move files when 'from' is a absolute path", (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: path.posix.join(FIXTURES_DIR_NORMALIZED, 'directory'), + from: path.posix.join(FIXTURES_DIR_NORMALIZED, "directory"), }, ], }) @@ -248,14 +248,14 @@ describe('from option', () => { it("should move files when 'from' with special characters", (done) => { runEmit({ expectedAssetKeys: [ - 'directoryfile.txt', - '(special-*file).txt', - 'nested/nestedfile.txt', + "directoryfile.txt", + "(special-*file).txt", + "nested/nestedfile.txt", ], patterns: [ { from: - path.sep === '/' ? '[special$directory]' : '[special$directory]', + path.sep === "/" ? "[special$directory]" : "[special$directory]", }, ], }) @@ -263,12 +263,12 @@ describe('from option', () => { .catch(done); }); - it('should move files from nested directory', (done) => { + it("should move files from nested directory", (done) => { runEmit({ - expectedAssetKeys: ['deep-nested/deepnested.txt', 'nestedfile.txt'], + expectedAssetKeys: ["deep-nested/deepnested.txt", "nestedfile.txt"], patterns: [ { - from: 'directory/nested', + from: "directory/nested", }, ], }) @@ -276,12 +276,12 @@ describe('from option', () => { .catch(done); }); - it('should move files from nested directory with an absolute path', (done) => { + it("should move files from nested directory with an absolute path", (done) => { runEmit({ - expectedAssetKeys: ['deep-nested/deepnested.txt', 'nestedfile.txt'], + expectedAssetKeys: ["deep-nested/deepnested.txt", "nestedfile.txt"], patterns: [ { - from: path.posix.join(FIXTURES_DIR_NORMALIZED, 'directory/nested'), + from: path.posix.join(FIXTURES_DIR_NORMALIZED, "directory/nested"), }, ], }) @@ -289,7 +289,7 @@ describe('from option', () => { .catch(done); }); - it('should throw an error on the missing directory', (done) => { + it("should throw an error on the missing directory", (done) => { runEmit({ expectedAssetKeys: [], expectedErrors: [ @@ -299,7 +299,7 @@ describe('from option', () => { ], patterns: [ { - from: 'nonexistent', + from: "nonexistent", }, ], }) @@ -308,13 +308,13 @@ describe('from option', () => { }); }); - describe('is a glob', () => { - it('should move files', (done) => { + describe("is a glob", () => { + it("should move files", (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: '*.txt', + from: "*.txt", }, ], }) @@ -322,12 +322,12 @@ describe('from option', () => { .catch(done); }); - it('should move files when a glob contains absolute path', (done) => { + it("should move files when a glob contains absolute path", (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: path.posix.join(FIXTURES_DIR_NORMALIZED, '*.txt'), + from: path.posix.join(FIXTURES_DIR_NORMALIZED, "*.txt"), }, ], }) @@ -335,27 +335,27 @@ describe('from option', () => { .catch(done); }); - it('should move files using globstar', (done) => { + it("should move files using globstar", (done) => { runEmit({ expectedAssetKeys: [ - '[(){}[]!+@escaped-test^$]/hello.txt', - 'binextension.bin', - 'dir (86)/file.txt', - 'dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt', - 'dir (86)/nesteddir/nestedfile.txt', - 'file.txt', - 'file.txt.gz', - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', - '[special$directory]/directoryfile.txt', - '[special$directory]/(special-*file).txt', - '[special$directory]/nested/nestedfile.txt', - 'noextension', + "[(){}[]!+@escaped-test^$]/hello.txt", + "binextension.bin", + "dir (86)/file.txt", + "dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt", + "dir (86)/nesteddir/nestedfile.txt", + "file.txt", + "file.txt.gz", + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", + "[special$directory]/directoryfile.txt", + "[special$directory]/(special-*file).txt", + "[special$directory]/nested/nestedfile.txt", + "noextension", ], patterns: [ { - from: '**/*', + from: "**/*", }, ], }) @@ -363,24 +363,24 @@ describe('from option', () => { .catch(done); }); - it('should move files using globstar and contains an absolute path', (done) => { + it("should move files using globstar and contains an absolute path", (done) => { runEmit({ expectedAssetKeys: [ - '[(){}[]!+@escaped-test^$]/hello.txt', - 'file.txt', - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', - '[special$directory]/directoryfile.txt', - '[special$directory]/(special-*file).txt', - '[special$directory]/nested/nestedfile.txt', - 'dir (86)/file.txt', - 'dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt', - 'dir (86)/nesteddir/nestedfile.txt', + "[(){}[]!+@escaped-test^$]/hello.txt", + "file.txt", + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", + "[special$directory]/directoryfile.txt", + "[special$directory]/(special-*file).txt", + "[special$directory]/nested/nestedfile.txt", + "dir (86)/file.txt", + "dir (86)/nesteddir/deepnesteddir/deepnesteddir.txt", + "dir (86)/nesteddir/nestedfile.txt", ], patterns: [ { - from: path.posix.join(FIXTURES_DIR_NORMALIZED, '**/*.txt'), + from: path.posix.join(FIXTURES_DIR_NORMALIZED, "**/*.txt"), }, ], }) @@ -388,28 +388,28 @@ describe('from option', () => { .catch(done); }); - it('should move files in nested directory using globstar', (done) => { + it("should move files in nested directory using globstar", (done) => { runEmit({ expectedAssetKeys: [ - 'nested/[(){}[]!+@escaped-test^$]/hello-31d6cf.txt', - 'nested/binextension-31d6cf.bin', - 'nested/dir (86)/file-31d6cf.txt', - 'nested/dir (86)/nesteddir/deepnesteddir/deepnesteddir-31d6cf.txt', - 'nested/dir (86)/nesteddir/nestedfile-31d6cf.txt', - 'nested/file-5d7817.txt', - 'nested/file.txt-f18c8d.gz', - 'nested/directory/directoryfile-5d7817.txt', - 'nested/directory/nested/deep-nested/deepnested-31d6cf.txt', - 'nested/directory/nested/nestedfile-31d6cf.txt', - 'nested/[special$directory]/(special-*file)-517cf2.txt', - 'nested/[special$directory]/directoryfile-5d7817.txt', - 'nested/[special$directory]/nested/nestedfile-31d6cf.txt', - 'nested/noextension-31d6cf', + "nested/[(){}[]!+@escaped-test^$]/hello-31d6cf.txt", + "nested/binextension-31d6cf.bin", + "nested/dir (86)/file-31d6cf.txt", + "nested/dir (86)/nesteddir/deepnesteddir/deepnesteddir-31d6cf.txt", + "nested/dir (86)/nesteddir/nestedfile-31d6cf.txt", + "nested/file-5d7817.txt", + "nested/file.txt-f18c8d.gz", + "nested/directory/directoryfile-5d7817.txt", + "nested/directory/nested/deep-nested/deepnested-31d6cf.txt", + "nested/directory/nested/nestedfile-31d6cf.txt", + "nested/[special$directory]/(special-*file)-517cf2.txt", + "nested/[special$directory]/directoryfile-5d7817.txt", + "nested/[special$directory]/nested/nestedfile-31d6cf.txt", + "nested/noextension-31d6cf", ], patterns: [ { - from: '**/*', - to: 'nested/[path][name]-[hash:6].[ext]', + from: "**/*", + to: "nested/[path][name]-[hash:6].[ext]", }, ], }) @@ -417,12 +417,12 @@ describe('from option', () => { .catch(done); }); - it('should move files from nested directory', (done) => { + it("should move files from nested directory", (done) => { runEmit({ - expectedAssetKeys: ['directory/directoryfile.txt'], + expectedAssetKeys: ["directory/directoryfile.txt"], patterns: [ { - from: 'directory/directory*.txt', + from: "directory/directory*.txt", }, ], }) @@ -430,16 +430,16 @@ describe('from option', () => { .catch(done); }); - it('should move files from nested directory #2', (done) => { + it("should move files from nested directory #2", (done) => { runEmit({ expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ], patterns: [ { - from: 'directory/**/*.txt', + from: "directory/**/*.txt", }, ], }) @@ -447,18 +447,18 @@ describe('from option', () => { .catch(done); }); - it('should move files using bracketed glob', (done) => { + it("should move files using bracketed glob", (done) => { runEmit({ expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', - 'file.txt', - 'noextension', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", + "file.txt", + "noextension", ], patterns: [ { - from: '{file.txt,noextension,directory/**/*}', + from: "{file.txt,noextension,directory/**/*}", }, ], }) @@ -466,12 +466,12 @@ describe('from option', () => { .catch(done); }); - it('should move files (symbolic link)', (done) => { + it("should move files (symbolic link)", (done) => { runEmit({ // Windows doesn't support symbolic link symlink: true, expectedErrors: - process.platform === 'win32' + process.platform === "win32" ? [ new Error( `unable to locate '${FIXTURES_DIR_NORMALIZED}/symlink/**/*.txt' glob` @@ -479,19 +479,19 @@ describe('from option', () => { ] : [], expectedAssetKeys: - process.platform === 'win32' + process.platform === "win32" ? [] : [ - 'symlink/directory-ln/file.txt', - 'symlink/directory-ln/nested-directory/file-in-nested-directory.txt', - 'symlink/directory/file.txt', - 'symlink/directory/nested-directory/file-in-nested-directory.txt', - 'symlink/file-ln.txt', - 'symlink/file.txt', + "symlink/directory-ln/file.txt", + "symlink/directory-ln/nested-directory/file-in-nested-directory.txt", + "symlink/directory/file.txt", + "symlink/directory/nested-directory/file-in-nested-directory.txt", + "symlink/file-ln.txt", + "symlink/file.txt", ], patterns: [ { - from: 'symlink/**/*.txt', + from: "symlink/**/*.txt", }, ], }) @@ -499,7 +499,7 @@ describe('from option', () => { .catch(done); }); - it('should throw an error on the missing glob', (done) => { + it("should throw an error on the missing glob", (done) => { runEmit({ expectedAssetKeys: [], expectedErrors: [ @@ -509,7 +509,7 @@ describe('from option', () => { ], patterns: [ { - from: 'nonexistent/**/*', + from: "nonexistent/**/*", }, ], }) diff --git a/test/globOptions-option.test.js b/test/globOptions-option.test.js index c32052e5..abbf05cd 100644 --- a/test/globOptions-option.test.js +++ b/test/globOptions-option.test.js @@ -1,19 +1,19 @@ -import path from 'path'; +import path from "path"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; const FIXTURES_DIR_NORMALIZED = path - .join(__dirname, 'fixtures') - .replace(/\\/g, '/'); + .join(__dirname, "fixtures") + .replace(/\\/g, "/"); -describe('globOptions option', () => { +describe("globOptions option", () => { // Expected behavior from `globby`/`fast-glob` it('should move files exclude dot files when "from" is a directory', (done) => { runEmit({ - expectedAssetKeys: ['.file.txt'], + expectedAssetKeys: [".file.txt"], patterns: [ { - from: '.file.txt', + from: ".file.txt", globOptions: { dot: false, }, @@ -27,13 +27,13 @@ describe('globOptions option', () => { it('should move files exclude dot files when "from" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { dot: false, }, @@ -46,10 +46,10 @@ describe('globOptions option', () => { it('should move files exclude dot files when "from" is a glob', (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: '*.txt', + from: "*.txt", globOptions: { dot: false, }, @@ -60,12 +60,12 @@ describe('globOptions option', () => { .catch(done); }); - it('should move files include dot files', (done) => { + it("should move files include dot files", (done) => { runEmit({ - expectedAssetKeys: ['.file.txt', 'file.txt'], + expectedAssetKeys: [".file.txt", "file.txt"], patterns: [ { - from: '*.txt', + from: "*.txt", globOptions: { dot: true, }, @@ -85,9 +85,9 @@ describe('globOptions option', () => { ], patterns: [ { - from: 'file.txt', + from: "file.txt", globOptions: { - ignore: ['**/file.*'], + ignore: ["**/file.*"], }, }, ], @@ -99,15 +99,15 @@ describe('globOptions option', () => { it('should files when "from" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - ignore: ['**/nestedfile.*'], + ignore: ["**/nestedfile.*"], }, }, ], @@ -118,12 +118,12 @@ describe('globOptions option', () => { it('should files in nested directory when "from" is a directory', (done) => { runEmit({ - expectedAssetKeys: ['.dottedfile', 'directoryfile.txt'], + expectedAssetKeys: [".dottedfile", "directoryfile.txt"], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - ignore: ['**/nested/**'], + ignore: ["**/nested/**"], }, }, ], @@ -132,17 +132,17 @@ describe('globOptions option', () => { .catch(done); }); - it('should files when from is a glob', (done) => { + it("should files when from is a glob", (done) => { runEmit({ expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", ], patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", globOptions: { - ignore: ['**/nestedfile.*'], + ignore: ["**/nestedfile.*"], }, }, ], @@ -151,14 +151,14 @@ describe('globOptions option', () => { .catch(done); }); - it('should files in nested directory when from is a glob', (done) => { + it("should files in nested directory when from is a glob", (done) => { runEmit({ - expectedAssetKeys: ['directory/directoryfile.txt'], + expectedAssetKeys: ["directory/directoryfile.txt"], patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", globOptions: { - ignore: ['**/nested/**'], + ignore: ["**/nested/**"], }, }, ], @@ -167,14 +167,14 @@ describe('globOptions option', () => { .catch(done); }); - it('should ignore files with a certain extension', (done) => { + it("should ignore files with a certain extension", (done) => { runEmit({ - expectedAssetKeys: ['.dottedfile'], + expectedAssetKeys: [".dottedfile"], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - ignore: ['**/*.txt'], + ignore: ["**/*.txt"], }, }, ], @@ -183,14 +183,14 @@ describe('globOptions option', () => { .catch(done); }); - it('should ignore files with multiple ignore patterns', (done) => { + it("should ignore files with multiple ignore patterns", (done) => { runEmit({ - expectedAssetKeys: ['directory/nested/nestedfile.txt'], + expectedAssetKeys: ["directory/nested/nestedfile.txt"], patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", globOptions: { - ignore: ['**/directoryfile.*', '**/deep-nested/**'], + ignore: ["**/directoryfile.*", "**/deep-nested/**"], }, }, ], @@ -199,16 +199,16 @@ describe('globOptions option', () => { .catch(done); }); - it('should ignore files with flatten true', (done) => { + it("should ignore files with flatten true", (done) => { runEmit({ - expectedAssetKeys: ['img/.dottedfile', 'img/nestedfile.txt'], + expectedAssetKeys: ["img/.dottedfile", "img/nestedfile.txt"], patterns: [ { - from: 'directory/', - to: 'img/', + from: "directory/", + to: "img/", flatten: true, globOptions: { - ignore: ['**/directoryfile.*', '**/deep-nested/**'], + ignore: ["**/directoryfile.*", "**/deep-nested/**"], }, }, ], @@ -217,14 +217,14 @@ describe('globOptions option', () => { .catch(done); }); - it('should ignore files except those with dots', (done) => { + it("should ignore files except those with dots", (done) => { runEmit({ - expectedAssetKeys: ['.dottedfile'], + expectedAssetKeys: [".dottedfile"], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - ignore: ['!(**/.*)'], + ignore: ["!(**/.*)"], }, }, ], @@ -233,18 +233,18 @@ describe('globOptions option', () => { .catch(done); }); - it('should ignore files that start with a dot', (done) => { + it("should ignore files that start with a dot", (done) => { runEmit({ expectedAssetKeys: [ - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - ignore: ['**/.*'], + ignore: ["**/.*"], }, }, ], @@ -253,7 +253,7 @@ describe('globOptions option', () => { .catch(done); }); - it('should ignores all files even if they start with a dot', (done) => { + it("should ignores all files even if they start with a dot", (done) => { runEmit({ expectedErrors: [ new Error( @@ -262,9 +262,9 @@ describe('globOptions option', () => { ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - ignore: ['**/*'], + ignore: ["**/*"], }, }, ], @@ -282,9 +282,9 @@ describe('globOptions option', () => { ], patterns: [ { - from: 'file.txt', + from: "file.txt", globOptions: { - ignore: ['**/file.*'], + ignore: ["**/file.*"], }, }, ], @@ -296,16 +296,16 @@ describe('globOptions option', () => { it('should ignore the "cwd" option', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { - cwd: path.resolve(__dirname, 'fixtures/nested'), + cwd: path.resolve(__dirname, "fixtures/nested"), }, }, ], @@ -317,13 +317,13 @@ describe('globOptions option', () => { it('should work with the "deep" option', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { deep: 2, }, @@ -337,14 +337,14 @@ describe('globOptions option', () => { it('should work with the "markDirectories" option', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { markDirectories: true, }, @@ -358,14 +358,14 @@ describe('globOptions option', () => { it('should work with the "objectMode" option', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { objectMode: true, }, @@ -381,7 +381,7 @@ describe('globOptions option', () => { expectedAssetKeys: [], patterns: [ { - from: 'directory', + from: "directory", globOptions: { onlyDirectories: true, }, @@ -395,14 +395,14 @@ describe('globOptions option', () => { it('should work with the "onlyFiles" option', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", globOptions: { onlyFiles: true, }, diff --git a/test/helpers/ChildCompiler.js b/test/helpers/ChildCompiler.js index ead77102..b96c9681 100644 --- a/test/helpers/ChildCompiler.js +++ b/test/helpers/ChildCompiler.js @@ -1,13 +1,13 @@ export default class ChildCompiler { // eslint-disable-next-line class-methods-use-this apply(compiler) { - compiler.hooks.make.tapAsync('Child Compiler', (compilation, callback) => { + compiler.hooks.make.tapAsync("Child Compiler", (compilation, callback) => { const outputOptions = { - filename: 'output.js', + filename: "output.js", publicPath: compilation.outputOptions.publicPath, }; const childCompiler = compilation.createChildCompiler( - 'ChildCompiler', + "ChildCompiler", outputOptions ); childCompiler.runAsChild((error, entries, childCompilation) => { @@ -19,7 +19,7 @@ export default class ChildCompiler { if (assets.length > 0) { callback( - new Error('Copy plugin should not be ran in child compilations') + new Error("Copy plugin should not be ran in child compilations") ); return; diff --git a/test/helpers/PreCopyPlugin.js b/test/helpers/PreCopyPlugin.js index 769de005..545fca43 100644 --- a/test/helpers/PreCopyPlugin.js +++ b/test/helpers/PreCopyPlugin.js @@ -1,8 +1,8 @@ -import webpack from 'webpack'; +import webpack from "webpack"; const { RawSource } = // eslint-disable-next-line global-require - webpack.sources || require('webpack-sources'); + webpack.sources || require("webpack-sources"); class PreCopyPlugin { constructor(options = {}) { @@ -10,11 +10,11 @@ class PreCopyPlugin { } apply(compiler) { - const plugin = { name: 'PreCopyPlugin' }; + const plugin = { name: "PreCopyPlugin" }; compiler.hooks.thisCompilation.tap(plugin, (compilation) => { compilation.hooks.additionalAssets.tapAsync( - 'pre-copy-webpack-plugin', + "pre-copy-webpack-plugin", (callback) => { this.options.additionalAssets.forEach(({ name, data, info }) => { const source = new RawSource(data); diff --git a/test/helpers/enter-with-asset-modules.js b/test/helpers/enter-with-asset-modules.js index a2bb5b30..19753d57 100644 --- a/test/helpers/enter-with-asset-modules.js +++ b/test/helpers/enter-with-asset-modules.js @@ -1,3 +1,3 @@ -import txtURL from '../fixtures/directory/nested/deep-nested/deepnested.txt'; +import txtURL from "../fixtures/directory/nested/deep-nested/deepnested.txt"; export default txtURL; diff --git a/test/helpers/getCompiler.js b/test/helpers/getCompiler.js index fdccde90..57146771 100644 --- a/test/helpers/getCompiler.js +++ b/test/helpers/getCompiler.js @@ -1,31 +1,31 @@ -import path from 'path'; +import path from "path"; -import webpack from 'webpack'; -import { createFsFromVolume, Volume } from 'memfs'; +import webpack from "webpack"; +import { createFsFromVolume, Volume } from "memfs"; export default (config = {}) => { const fullConfig = { - mode: 'development', - context: path.resolve(__dirname, '../fixtures'), - entry: path.resolve(__dirname, '../helpers/enter.js'), + mode: "development", + context: path.resolve(__dirname, "../fixtures"), + entry: path.resolve(__dirname, "../helpers/enter.js"), output: { - path: path.resolve(__dirname, '../build'), + path: path.resolve(__dirname, "../build"), }, module: { rules: [ - webpack.version[0] === '5' + webpack.version[0] === "5" ? { test: /\.txt/, - type: 'asset/resource', + type: "asset/resource", generator: { - filename: 'asset-modules/[name][ext]', + filename: "asset-modules/[name][ext]", }, } : { test: /\.txt/, - loader: 'file-loader', + loader: "file-loader", options: { - name: 'asset-modules/[name].[ext]', + name: "asset-modules/[name].[ext]", }, }, ], diff --git a/test/helpers/index.js b/test/helpers/index.js index 5f7dc302..2d1945b6 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -1,6 +1,6 @@ -import compile from './compile'; -import getCompiler from './getCompiler'; -import readAsset from './readAsset'; -import readAssets from './readAssets'; +import compile from "./compile"; +import getCompiler from "./getCompiler"; +import readAsset from "./readAsset"; +import readAssets from "./readAssets"; export { compile, getCompiler, readAsset, readAssets }; diff --git a/test/helpers/readAsset.js b/test/helpers/readAsset.js index 40da2c9b..6ccd14f9 100644 --- a/test/helpers/readAsset.js +++ b/test/helpers/readAsset.js @@ -1,13 +1,13 @@ -import path from 'path'; +import path from "path"; export default (asset, compiler, stats) => { const usedFs = compiler.outputFileSystem; const outputPath = stats.compilation.outputOptions.path; - let data = ''; + let data = ""; let targetFile = asset; - const queryStringIdx = targetFile.indexOf('?'); + const queryStringIdx = targetFile.indexOf("?"); if (queryStringIdx >= 0) { targetFile = targetFile.substr(0, queryStringIdx); diff --git a/test/helpers/readAssets.js b/test/helpers/readAssets.js index 1db44b3b..86f4acb0 100644 --- a/test/helpers/readAssets.js +++ b/test/helpers/readAssets.js @@ -1,10 +1,10 @@ -import readAsset from './readAsset'; +import readAsset from "./readAsset"; export default function readAssets(compiler, stats) { const assets = {}; Object.keys(stats.compilation.assets) - .filter((a) => a !== 'main.js') + .filter((a) => a !== "main.js") .forEach((asset) => { assets[asset] = readAsset(asset, compiler, stats); }); diff --git a/test/helpers/removeIllegalCharacterForWindows.js b/test/helpers/removeIllegalCharacterForWindows.js index 4945134c..87023d98 100644 --- a/test/helpers/removeIllegalCharacterForWindows.js +++ b/test/helpers/removeIllegalCharacterForWindows.js @@ -1,2 +1,2 @@ module.exports = (string) => - process.platform !== 'win32' ? string : string.replace(/[*?"<>|]/g, ''); + process.platform !== "win32" ? string : string.replace(/[*?"<>|]/g, ""); diff --git a/test/helpers/run.js b/test/helpers/run.js index 107c9bcf..f9dffb2c 100644 --- a/test/helpers/run.js +++ b/test/helpers/run.js @@ -1,25 +1,25 @@ // Ideally we pass in patterns and confirm the resulting assets -import fs from 'fs'; -import path from 'path'; +import fs from "fs"; +import path from "path"; -import CopyPlugin from '../../src'; +import CopyPlugin from "../../src"; -import ChildCompilerPlugin from './ChildCompiler'; -import PreCopyPlugin from './PreCopyPlugin'; +import ChildCompilerPlugin from "./ChildCompiler"; +import PreCopyPlugin from "./PreCopyPlugin"; -import removeIllegalCharacterForWindows from './removeIllegalCharacterForWindows'; +import removeIllegalCharacterForWindows from "./removeIllegalCharacterForWindows"; -import { compile, getCompiler, readAssets } from './'; +import { compile, getCompiler, readAssets } from "./"; /* eslint-disable no-param-reassign */ -const isWin = process.platform === 'win32'; +const isWin = process.platform === "win32"; const ignore = [ - '**/symlink/**/*', - '**/file-ln.txt', - '**/directory-ln', - '**/watch/**/*', + "**/symlink/**/*", + "**/file-ln.txt", + "**/directory-ln", + "**/watch/**/*", ]; function run(opts) { @@ -31,7 +31,7 @@ function run(opts) { pattern.context = removeIllegalCharacterForWindows(pattern.context); } - if (typeof pattern !== 'string') { + if (typeof pattern !== "string") { if (!opts.symlink || isWin) { pattern.globOptions = pattern.globOptions || {}; pattern.globOptions.ignore = [ @@ -74,7 +74,7 @@ function run(opts) { throw compilation.warnings[0]; } - const enryPoint = path.resolve(__dirname, 'enter.js'); + const enryPoint = path.resolve(__dirname, "enter.js"); if (compilation.fileDependencies.has(enryPoint)) { compilation.fileDependencies.delete(enryPoint); @@ -95,14 +95,14 @@ function runEmit(opts) { if (opts.expectedAssetKeys && opts.expectedAssetKeys.length > 0) { expect( Object.keys(compilation.assets) - .filter((a) => a !== 'main.js') + .filter((a) => a !== "main.js") .sort() ).toEqual( opts.expectedAssetKeys.sort().map(removeIllegalCharacterForWindows) ); } else { // eslint-disable-next-line no-param-reassign - delete compilation.assets['main.js']; + delete compilation.assets["main.js"]; expect(compilation.assets).toEqual({}); } @@ -150,8 +150,8 @@ function runChange(opts) { ); // Create two test files - fs.writeFileSync(opts.newFileLoc1, 'file1contents'); - fs.writeFileSync(opts.newFileLoc2, 'file2contents'); + fs.writeFileSync(opts.newFileLoc1, "file1contents"); + fs.writeFileSync(opts.newFileLoc2, "file2contents"); const arrayOfStats = []; @@ -165,7 +165,7 @@ function runChange(opts) { await delay(500); - fs.appendFileSync(opts.newFileLoc1, 'extra'); + fs.appendFileSync(opts.newFileLoc1, "extra"); await delay(500); diff --git a/test/noErrorOnMissing.test.js b/test/noErrorOnMissing.test.js index 7f325bd4..8e1cf3fd 100644 --- a/test/noErrorOnMissing.test.js +++ b/test/noErrorOnMissing.test.js @@ -1,13 +1,13 @@ -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; -describe('noErrorOnMissing option', () => { - describe('is a file', () => { - it('should work', (done) => { +describe("noErrorOnMissing option", () => { + describe("is a file", () => { + it("should work", (done) => { runEmit({ expectedAssetKeys: [], patterns: [ { - from: 'unknown.unknown', + from: "unknown.unknown", noErrorOnMissing: true, }, ], @@ -17,13 +17,13 @@ describe('noErrorOnMissing option', () => { }); }); - describe('is a directory', () => { - it('should work', (done) => { + describe("is a directory", () => { + it("should work", (done) => { runEmit({ expectedAssetKeys: [], patterns: [ { - from: 'unknown', + from: "unknown", noErrorOnMissing: true, }, ], @@ -33,13 +33,13 @@ describe('noErrorOnMissing option', () => { }); }); - describe('is a glob', () => { - it('should work', (done) => { + describe("is a glob", () => { + it("should work", (done) => { runEmit({ expectedAssetKeys: [], patterns: [ { - from: '*.unknown', + from: "*.unknown", noErrorOnMissing: true, }, ], diff --git a/test/to-option.test.js b/test/to-option.test.js index 52df880d..a00272e0 100644 --- a/test/to-option.test.js +++ b/test/to-option.test.js @@ -1,20 +1,20 @@ -import path from 'path'; +import path from "path"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; -const BUILD_DIR = path.join(__dirname, 'build'); -const TEMP_DIR = path.join(__dirname, 'tempdir'); -const FIXTURES_DIR = path.join(__dirname, 'fixtures'); +const BUILD_DIR = path.join(__dirname, "build"); +const TEMP_DIR = path.join(__dirname, "tempdir"); +const FIXTURES_DIR = path.join(__dirname, "fixtures"); -describe('to option', () => { - describe('is a file', () => { - it('should move a file to a new file', (done) => { +describe("to option", () => { + describe("is a file", () => { + it("should move a file to a new file", (done) => { runEmit({ - expectedAssetKeys: ['newfile.txt'], + expectedAssetKeys: ["newfile.txt"], patterns: [ { - from: 'file.txt', - to: 'newfile.txt', + from: "file.txt", + to: "newfile.txt", }, ], }) @@ -24,11 +24,11 @@ describe('to option', () => { it('should move a file to a new file when "to" is absolute path', (done) => { runEmit({ - expectedAssetKeys: ['../tempdir/newfile.txt'], + expectedAssetKeys: ["../tempdir/newfile.txt"], patterns: [ { - from: 'file.txt', - to: path.join(TEMP_DIR, 'newfile.txt'), + from: "file.txt", + to: path.join(TEMP_DIR, "newfile.txt"), }, ], }) @@ -36,13 +36,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file to a new file inside nested directory', (done) => { + it("should move a file to a new file inside nested directory", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/newfile.txt'], + expectedAssetKeys: ["newdirectory/newfile.txt"], patterns: [ { - from: 'file.txt', - to: 'newdirectory/newfile.txt', + from: "file.txt", + to: "newdirectory/newfile.txt", }, ], }) @@ -52,11 +52,11 @@ describe('to option', () => { it('should move a file to a new file inside nested directory when "to" an absolute path', (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/newfile.txt'], + expectedAssetKeys: ["newdirectory/newfile.txt"], patterns: [ { - from: 'file.txt', - to: path.join(BUILD_DIR, 'newdirectory/newfile.txt'), + from: "file.txt", + to: path.join(BUILD_DIR, "newdirectory/newfile.txt"), }, ], }) @@ -64,13 +64,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file to a new file inside other directory what out of context', (done) => { + it("should move a file to a new file inside other directory what out of context", (done) => { runEmit({ - expectedAssetKeys: ['../tempdir/newdirectory/newfile.txt'], + expectedAssetKeys: ["../tempdir/newdirectory/newfile.txt"], patterns: [ { - from: 'file.txt', - to: path.join(TEMP_DIR, 'newdirectory/newfile.txt'), + from: "file.txt", + to: path.join(TEMP_DIR, "newdirectory/newfile.txt"), }, ], }) @@ -78,13 +78,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file using invalid template syntax', (done) => { + it("should move a file using invalid template syntax", (done) => { runEmit({ - expectedAssetKeys: ['directory/[md5::base64:20].txt'], + expectedAssetKeys: ["directory/[md5::base64:20].txt"], patterns: [ { - from: 'directory/directoryfile.txt', - to: 'directory/[md5::base64:20].txt', + from: "directory/directoryfile.txt", + to: "directory/[md5::base64:20].txt", }, ], }) @@ -93,14 +93,14 @@ describe('to option', () => { }); }); - describe('is a directory', () => { - it('should move a file to a new directory', (done) => { + describe("is a directory", () => { + it("should move a file to a new directory", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/file.txt'], + expectedAssetKeys: ["newdirectory/file.txt"], patterns: [ { - from: 'file.txt', - to: 'newdirectory', + from: "file.txt", + to: "newdirectory", }, ], }) @@ -108,12 +108,12 @@ describe('to option', () => { .catch(done); }); - it('should move a file to a new directory out of context', (done) => { + it("should move a file to a new directory out of context", (done) => { runEmit({ - expectedAssetKeys: ['../tempdir/file.txt'], + expectedAssetKeys: ["../tempdir/file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", to: TEMP_DIR, }, ], @@ -122,13 +122,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file to a new directory with a forward slash', (done) => { + it("should move a file to a new directory with a forward slash", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/file.txt'], + expectedAssetKeys: ["newdirectory/file.txt"], patterns: [ { - from: 'file.txt', - to: 'newdirectory/', + from: "file.txt", + to: "newdirectory/", }, ], }) @@ -136,12 +136,12 @@ describe('to option', () => { .catch(done); }); - it('should move a file to a new directory with an extension and path separator at end', (done) => { + it("should move a file to a new directory with an extension and path separator at end", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory.ext/file.txt'], + expectedAssetKeys: ["newdirectory.ext/file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", to: `newdirectory.ext${path.sep}`, }, ], @@ -152,10 +152,10 @@ describe('to option', () => { it('should move a file to a new directory when "to" is absolute path', (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", to: BUILD_DIR, }, ], @@ -166,10 +166,10 @@ describe('to option', () => { it('should move a file to a new directory when "to" is absolute path with a forward slash', (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", to: `${BUILD_DIR}/`, }, ], @@ -178,13 +178,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file to a new directory from nested directory', (done) => { + it("should move a file to a new directory from nested directory", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/directoryfile.txt'], + expectedAssetKeys: ["newdirectory/directoryfile.txt"], patterns: [ { - from: 'directory/directoryfile.txt', - to: 'newdirectory', + from: "directory/directoryfile.txt", + to: "newdirectory", }, ], }) @@ -194,11 +194,11 @@ describe('to option', () => { it('should move a file to a new directory from nested directory when "from" is absolute path', (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/directoryfile.txt'], + expectedAssetKeys: ["newdirectory/directoryfile.txt"], patterns: [ { - from: path.join(FIXTURES_DIR, 'directory', 'directoryfile.txt'), - to: 'newdirectory', + from: path.join(FIXTURES_DIR, "directory", "directoryfile.txt"), + to: "newdirectory", }, ], }) @@ -208,11 +208,11 @@ describe('to option', () => { it('should move a file to a new directory from nested directory when "from" is absolute path with a forward slash', (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/directoryfile.txt'], + expectedAssetKeys: ["newdirectory/directoryfile.txt"], patterns: [ { - from: path.join(FIXTURES_DIR, 'directory', 'directoryfile.txt'), - to: 'newdirectory/', + from: path.join(FIXTURES_DIR, "directory", "directoryfile.txt"), + to: "newdirectory/", }, ], }) @@ -220,18 +220,18 @@ describe('to option', () => { .catch(done); }); - it('should move files to a new directory', (done) => { + it("should move files to a new directory", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/.dottedfile', - 'newdirectory/directoryfile.txt', - 'newdirectory/nested/deep-nested/deepnested.txt', - 'newdirectory/nested/nestedfile.txt', + "newdirectory/.dottedfile", + "newdirectory/directoryfile.txt", + "newdirectory/nested/deep-nested/deepnested.txt", + "newdirectory/nested/nestedfile.txt", ], patterns: [ { - from: 'directory', - to: 'newdirectory', + from: "directory", + to: "newdirectory", }, ], }) @@ -239,16 +239,16 @@ describe('to option', () => { .catch(done); }); - it('should move files to a new nested directory', (done) => { + it("should move files to a new nested directory", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/deep-nested/deepnested.txt', - 'newdirectory/nestedfile.txt', + "newdirectory/deep-nested/deepnested.txt", + "newdirectory/nestedfile.txt", ], patterns: [ { - from: path.join(FIXTURES_DIR, 'directory', 'nested'), - to: 'newdirectory', + from: path.join(FIXTURES_DIR, "directory", "nested"), + to: "newdirectory", }, ], }) @@ -256,17 +256,17 @@ describe('to option', () => { .catch(done); }); - it('should move files to a new directory out of context', (done) => { + it("should move files to a new directory out of context", (done) => { runEmit({ expectedAssetKeys: [ - '../tempdir/.dottedfile', - '../tempdir/directoryfile.txt', - '../tempdir/nested/deep-nested/deepnested.txt', - '../tempdir/nested/nestedfile.txt', + "../tempdir/.dottedfile", + "../tempdir/directoryfile.txt", + "../tempdir/nested/deep-nested/deepnested.txt", + "../tempdir/nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", to: TEMP_DIR, }, ], @@ -278,14 +278,14 @@ describe('to option', () => { it('should move files to a new directory when "to" is absolute path', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", to: BUILD_DIR, }, ], @@ -297,14 +297,14 @@ describe('to option', () => { it('should move files to a new directory when "to" is absolute path with a forward slash', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", to: `${BUILD_DIR}/`, }, ], @@ -313,16 +313,16 @@ describe('to option', () => { .catch(done); }); - it('should move files to a new directory from nested directory', (done) => { + it("should move files to a new directory from nested directory", (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/deep-nested/deepnested.txt', - 'newdirectory/nestedfile.txt', + "newdirectory/deep-nested/deepnested.txt", + "newdirectory/nestedfile.txt", ], patterns: [ { - from: 'directory/nested', - to: 'newdirectory', + from: "directory/nested", + to: "newdirectory", }, ], }) @@ -332,11 +332,11 @@ describe('to option', () => { it('should move a file to a new directory when "to" is empty', (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], patterns: [ { - from: 'file.txt', - to: '', + from: "file.txt", + to: "", }, ], }) @@ -345,14 +345,14 @@ describe('to option', () => { }); }); - describe('is a template', () => { + describe("is a template", () => { it('should move a file using "contenthash"', (done) => { runEmit({ - expectedAssetKeys: ['directory/5d7817.txt'], + expectedAssetKeys: ["directory/5d7817.txt"], patterns: [ { - from: 'directory/directoryfile.txt', - to: 'directory/[contenthash:6].txt', + from: "directory/directoryfile.txt", + to: "directory/[contenthash:6].txt", }, ], }) @@ -360,13 +360,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file using custom `contenthash` digest', (done) => { + it("should move a file using custom `contenthash` digest", (done) => { runEmit({ - expectedAssetKeys: ['directory/c2a6.txt'], + expectedAssetKeys: ["directory/c2a6.txt"], patterns: [ { - from: 'directory/directoryfile.txt', - to: 'directory/[sha1:contenthash:hex:4].txt', + from: "directory/directoryfile.txt", + to: "directory/[sha1:contenthash:hex:4].txt", }, ], }) @@ -376,11 +376,11 @@ describe('to option', () => { it('should move a file using "name" and "ext"', (done) => { runEmit({ - expectedAssetKeys: ['binextension.bin'], + expectedAssetKeys: ["binextension.bin"], patterns: [ { - from: 'binextension.bin', - to: '[name].[ext]', + from: "binextension.bin", + to: "[name].[ext]", }, ], }) @@ -390,11 +390,11 @@ describe('to option', () => { it('should move a file using "name", "contenthash" and "ext"', (done) => { runEmit({ - expectedAssetKeys: ['file-5d7817.txt'], + expectedAssetKeys: ["file-5d7817.txt"], patterns: [ { - from: 'file.txt', - to: '[name]-[contenthash:6].[ext]', + from: "file.txt", + to: "[name]-[contenthash:6].[ext]", }, ], }) @@ -402,13 +402,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file from nested directory', (done) => { + it("should move a file from nested directory", (done) => { runEmit({ - expectedAssetKeys: ['directoryfile-5d7817.txt'], + expectedAssetKeys: ["directoryfile-5d7817.txt"], patterns: [ { - from: 'directory/directoryfile.txt', - to: '[name]-[hash:6].[ext]', + from: "directory/directoryfile.txt", + to: "[name]-[hash:6].[ext]", }, ], }) @@ -416,13 +416,13 @@ describe('to option', () => { .catch(done); }); - it('should move a file from nested directory to new directory', (done) => { + it("should move a file from nested directory to new directory", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory/directoryfile-5d7817.txt'], + expectedAssetKeys: ["newdirectory/directoryfile-5d7817.txt"], patterns: [ { - from: 'directory/directoryfile.txt', - to: 'newdirectory/[name]-[hash:6].[ext]', + from: "directory/directoryfile.txt", + to: "newdirectory/[name]-[hash:6].[ext]", }, ], }) @@ -432,11 +432,11 @@ describe('to option', () => { it('should move a file without an extension using "name", "ext"', (done) => { runEmit({ - expectedAssetKeys: ['noextension.31d6cf.newext'], + expectedAssetKeys: ["noextension.31d6cf.newext"], patterns: [ { - from: 'noextension', - to: '[name][ext].[contenthash:6].newext', + from: "noextension", + to: "[name][ext].[contenthash:6].newext", }, ], }) @@ -447,15 +447,15 @@ describe('to option', () => { it('should move files using "path", "name", "contenthash" and "ext"', (done) => { runEmit({ expectedAssetKeys: [ - 'newdirectory/.dottedfile-5e294e', - 'newdirectory/directoryfile-5d7817.txt', - 'newdirectory/nested/deep-nested/deepnested-31d6cf.txt', - 'newdirectory/nested/nestedfile-31d6cf.txt', + "newdirectory/.dottedfile-5e294e", + "newdirectory/directoryfile-5d7817.txt", + "newdirectory/nested/deep-nested/deepnested-31d6cf.txt", + "newdirectory/nested/nestedfile-31d6cf.txt", ], patterns: [ { - from: 'directory', - to: 'newdirectory/[path][name]-[contenthash:6].[ext]', + from: "directory", + to: "newdirectory/[path][name]-[contenthash:6].[ext]", }, ], }) @@ -465,12 +465,12 @@ describe('to option', () => { it('should move a file to "compiler.options.output" by default', (done) => { runEmit({ - compilation: { output: { path: '/path/to' } }, - expectedAssetKeys: ['newfile.txt'], + compilation: { output: { path: "/path/to" } }, + expectedAssetKeys: ["newfile.txt"], patterns: [ { - from: 'file.txt', - to: 'newfile.txt', + from: "file.txt", + to: "newfile.txt", }, ], }) diff --git a/test/toType-option.test.js b/test/toType-option.test.js index a3d567d0..42c2556e 100644 --- a/test/toType-option.test.js +++ b/test/toType-option.test.js @@ -1,20 +1,20 @@ -import path from 'path'; +import path from "path"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; const FIXTURES_DIR_NORMALIZED = path - .join(__dirname, 'fixtures') - .replace(/\\/g, '/'); + .join(__dirname, "fixtures") + .replace(/\\/g, "/"); -describe('toType option', () => { - it('should move a file to a new file', (done) => { +describe("toType option", () => { + it("should move a file to a new file", (done) => { runEmit({ - expectedAssetKeys: ['new-file.txt'], + expectedAssetKeys: ["new-file.txt"], patterns: [ { - from: 'file.txt', - to: 'new-file.txt', - toType: 'file', + from: "file.txt", + to: "new-file.txt", + toType: "file", }, ], }) @@ -22,14 +22,14 @@ describe('toType option', () => { .catch(done); }); - it('should move a file to a new directory', (done) => { + it("should move a file to a new directory", (done) => { runEmit({ - expectedAssetKeys: ['new-file.txt/file.txt'], + expectedAssetKeys: ["new-file.txt/file.txt"], patterns: [ { - from: 'file.txt', - to: 'new-file.txt', - toType: 'dir', + from: "file.txt", + to: "new-file.txt", + toType: "dir", }, ], }) @@ -37,17 +37,17 @@ describe('toType option', () => { .catch(done); }); - it('should move a file to a new directory', (done) => { + it("should move a file to a new directory", (done) => { runEmit({ expectedAssetKeys: [ - 'directory/directorynew-directoryfile.txt.5d7817ed5bc246756d73d6a4c8e94c33.5d7817ed5bc246756d73d6a4c8e94c33.22af645d.22af645d.txt', + "directory/directorynew-directoryfile.txt.5d7817ed5bc246756d73d6a4c8e94c33.5d7817ed5bc246756d73d6a4c8e94c33.22af645d.22af645d.txt", ], patterns: [ { - from: 'directory/directoryfile.*', + from: "directory/directoryfile.*", to: - '[path][folder]new-[name].[ext].[hash].[contenthash].[md5:contenthash:hex:8].[md5:hash:hex:8].txt', - toType: 'template', + "[path][folder]new-[name].[ext].[hash].[contenthash].[md5:contenthash:hex:8].[md5:hash:hex:8].txt", + toType: "template", }, ], }) @@ -55,14 +55,14 @@ describe('toType option', () => { .catch(done); }); - it('should move a file to a new file with no extension', (done) => { + it("should move a file to a new file with no extension", (done) => { runEmit({ - expectedAssetKeys: ['newname'], + expectedAssetKeys: ["newname"], patterns: [ { - from: 'file.txt', - to: 'newname', - toType: 'file', + from: "file.txt", + to: "newname", + toType: "file", }, ], }) @@ -70,14 +70,14 @@ describe('toType option', () => { .catch(done); }); - it('should move a file to a new directory with an extension', (done) => { + it("should move a file to a new directory with an extension", (done) => { runEmit({ - expectedAssetKeys: ['newdirectory.ext/file.txt'], + expectedAssetKeys: ["newdirectory.ext/file.txt"], patterns: [ { - from: 'file.txt', - to: 'newdirectory.ext', - toType: 'dir', + from: "file.txt", + to: "newdirectory.ext", + toType: "dir", }, ], }) @@ -85,7 +85,7 @@ describe('toType option', () => { .catch(done); }); - it('should warn when file not found and stats is undefined', (done) => { + it("should warn when file not found and stats is undefined", (done) => { runEmit({ expectedAssetKeys: [], expectedErrors: [ @@ -95,9 +95,9 @@ describe('toType option', () => { ], patterns: [ { - from: 'nonexistent.txt', - to: '.', - toType: 'dir', + from: "nonexistent.txt", + to: ".", + toType: "dir", }, ], }) diff --git a/test/transform-option.test.js b/test/transform-option.test.js index f1f9882a..a86625b6 100644 --- a/test/transform-option.test.js +++ b/test/transform-option.test.js @@ -1,20 +1,20 @@ -import path from 'path'; -import zlib from 'zlib'; +import path from "path"; +import zlib from "zlib"; -import { run, runEmit } from './helpers/run'; +import { run, runEmit } from "./helpers/run"; -const FIXTURES_DIR = path.join(__dirname, 'fixtures'); +const FIXTURES_DIR = path.join(__dirname, "fixtures"); -describe('transform option', () => { +describe("transform option", () => { it('should transform file when "from" is a file', (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': 'newchanged', + "file.txt": "newchanged", }, patterns: [ { - from: 'file.txt', + from: "file.txt", transform(content, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -30,20 +30,20 @@ describe('transform option', () => { it('should transform target path of every when "from" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - '.dottedfile', - 'directoryfile.txt', - 'nested/deep-nested/deepnested.txt', - 'nested/nestedfile.txt', + ".dottedfile", + "directoryfile.txt", + "nested/deep-nested/deepnested.txt", + "nested/nestedfile.txt", ], expectedAssetContent: { - '.dottedfile': 'dottedfile contents\nchanged', - 'directoryfile.txt': 'newchanged', - 'nested/deep-nested/deepnested.txt': 'changed', - 'nested/nestedfile.txt': 'changed', + ".dottedfile": "dottedfile contents\nchanged", + "directoryfile.txt": "newchanged", + "nested/deep-nested/deepnested.txt": "changed", + "nested/nestedfile.txt": "changed", }, patterns: [ { - from: 'directory', + from: "directory", transform(content, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -59,18 +59,18 @@ describe('transform option', () => { it('should transform target path of every file when "from" is a glob', (done) => { runEmit({ expectedAssetKeys: [ - 'directory/directoryfile.txt', - 'directory/nested/deep-nested/deepnested.txt', - 'directory/nested/nestedfile.txt', + "directory/directoryfile.txt", + "directory/nested/deep-nested/deepnested.txt", + "directory/nested/nestedfile.txt", ], expectedAssetContent: { - 'directory/directoryfile.txt': 'newchanged', - 'directory/nested/deep-nested/deepnested.txt': 'changed', - 'directory/nested/nestedfile.txt': 'changed', + "directory/directoryfile.txt": "newchanged", + "directory/nested/deep-nested/deepnested.txt": "changed", + "directory/nested/nestedfile.txt": "changed", }, patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", transform(content, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -83,15 +83,15 @@ describe('transform option', () => { .catch(done); }); - it('should transform file when function return Promise', (done) => { + it("should transform file when function return Promise", (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': 'newchanged!', + "file.txt": "newchanged!", }, patterns: [ { - from: 'file.txt', + from: "file.txt", transform(content) { return new Promise((resolve) => { resolve(`${content}changed!`); @@ -104,15 +104,15 @@ describe('transform option', () => { .catch(done); }); - it('should transform target path when async function used', (done) => { + it("should transform target path when async function used", (done) => { runEmit({ - expectedAssetKeys: ['file.txt'], + expectedAssetKeys: ["file.txt"], expectedAssetContent: { - 'file.txt': 'newchanged!', + "file.txt": "newchanged!", }, patterns: [ { - from: 'file.txt', + from: "file.txt", async transform(content) { const newPath = await new Promise((resolve) => { resolve(`${content}changed!`); @@ -127,16 +127,16 @@ describe('transform option', () => { .catch(done); }); - it('should warn when function throw error', (done) => { + it("should warn when function throw error", (done) => { runEmit({ expectedAssetKeys: [], - expectedErrors: [new Error('a failure happened')], + expectedErrors: [new Error("a failure happened")], patterns: [ { - from: 'file.txt', + from: "file.txt", transform() { // eslint-disable-next-line no-throw-literal - throw new Error('a failure happened'); + throw new Error("a failure happened"); }, }, ], @@ -145,16 +145,16 @@ describe('transform option', () => { .catch(done); }); - it('should warn when Promise was rejected', (done) => { + it("should warn when Promise was rejected", (done) => { runEmit({ expectedAssetKeys: [], - expectedErrors: [new Error('a failure happened')], + expectedErrors: [new Error("a failure happened")], patterns: [ { - from: 'file.txt', + from: "file.txt", transform() { return new Promise((resolve, reject) => { - return reject(new Error('a failure happened')); + return reject(new Error("a failure happened")); }); }, }, @@ -164,16 +164,16 @@ describe('transform option', () => { .catch(done); }); - it('should warn when async function throw error', (done) => { + it("should warn when async function throw error", (done) => { runEmit({ expectedAssetKeys: [], - expectedErrors: [new Error('a failure happened')], + expectedErrors: [new Error("a failure happened")], patterns: [ { - from: 'file.txt', + from: "file.txt", async transform() { await new Promise((resolve, reject) => { - reject(new Error('a failure happened')); + reject(new Error("a failure happened")); }); }, }, @@ -183,23 +183,23 @@ describe('transform option', () => { .catch(done); }); - it('should be a different size for the source file and the converted file', (done) => { + it("should be a different size for the source file and the converted file", (done) => { run({ patterns: [ { - from: 'file.txt', + from: "file.txt", }, { - from: 'file.txt', - to: 'file.txt.gz', + from: "file.txt", + to: "file.txt.gz", transform: (content) => zlib.gzipSync(content), }, ], }) .then(({ compilation }) => { expect( - compilation.assets['file.txt'].size() !== - compilation.assets['file.txt.gz'].size() + compilation.assets["file.txt"].size() !== + compilation.assets["file.txt.gz"].size() ).toBe(true); }) .then(done) @@ -208,22 +208,22 @@ describe('transform option', () => { it('should transform file when "from" is a file', (done) => { runEmit({ - expectedAssetKeys: ['subdir/test.txt'], + expectedAssetKeys: ["subdir/test.txt"], expectedAssetContent: { - 'subdir/test.txt': 'newchanged', + "subdir/test.txt": "newchanged", }, patterns: [ { - from: 'file.txt', + from: "file.txt", transform(content, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); return `${content}changed`; }, transformPath(targetPath, absoluteFrom) { - expect(absoluteFrom).toBe(path.join(FIXTURES_DIR, 'file.txt')); + expect(absoluteFrom).toBe(path.join(FIXTURES_DIR, "file.txt")); - return targetPath.replace('file.txt', 'subdir/test.txt'); + return targetPath.replace("file.txt", "subdir/test.txt"); }, }, ], diff --git a/test/transformPath-option.test.js b/test/transformPath-option.test.js index 9d6e9c44..b7424d7f 100644 --- a/test/transformPath-option.test.js +++ b/test/transformPath-option.test.js @@ -1,20 +1,20 @@ -import path from 'path'; +import path from "path"; -import { runEmit } from './helpers/run'; +import { runEmit } from "./helpers/run"; -const FIXTURES_DIR = path.join(__dirname, 'fixtures'); +const FIXTURES_DIR = path.join(__dirname, "fixtures"); -describe('transformPath option', () => { +describe("transformPath option", () => { it('should transform target path when "from" is a file', (done) => { runEmit({ - expectedAssetKeys: ['subdir/test.txt'], + expectedAssetKeys: ["subdir/test.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", transformPath(targetPath, absoluteFrom) { - expect(absoluteFrom).toBe(path.join(FIXTURES_DIR, 'file.txt')); + expect(absoluteFrom).toBe(path.join(FIXTURES_DIR, "file.txt")); - return targetPath.replace('file.txt', 'subdir/test.txt'); + return targetPath.replace("file.txt", "subdir/test.txt"); }, }, ], @@ -26,17 +26,17 @@ describe('transformPath option', () => { it('should transform target path of every when "from" is a directory', (done) => { runEmit({ expectedAssetKeys: [ - '/some/path/.dottedfile', - '/some/path/deepnested.txt', - '/some/path/directoryfile.txt', - '/some/path/nestedfile.txt', + "/some/path/.dottedfile", + "/some/path/deepnested.txt", + "/some/path/directoryfile.txt", + "/some/path/nestedfile.txt", ], patterns: [ { - from: 'directory', + from: "directory", transformPath(targetPath, absoluteFrom) { expect( - absoluteFrom.includes(path.join(FIXTURES_DIR, 'directory')) + absoluteFrom.includes(path.join(FIXTURES_DIR, "directory")) ).toBe(true); return `/some/path/${path.basename(targetPath)}`; @@ -51,13 +51,13 @@ describe('transformPath option', () => { it('should transform target path of every file when "from" is a glob', (done) => { runEmit({ expectedAssetKeys: [ - '/some/path/deepnested.txt.tst', - '/some/path/directoryfile.txt.tst', - '/some/path/nestedfile.txt.tst', + "/some/path/deepnested.txt.tst", + "/some/path/directoryfile.txt.tst", + "/some/path/nestedfile.txt.tst", ], patterns: [ { - from: 'directory/**/*', + from: "directory/**/*", transformPath(targetPath, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -70,12 +70,12 @@ describe('transformPath option', () => { .catch(done); }); - it('should transform target path when function return Promise', (done) => { + it("should transform target path when function return Promise", (done) => { runEmit({ - expectedAssetKeys: ['/some/path/file.txt'], + expectedAssetKeys: ["/some/path/file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", transformPath(targetPath, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -90,12 +90,12 @@ describe('transformPath option', () => { .catch(done); }); - it('should transform target path when async function used', (done) => { + it("should transform target path when async function used", (done) => { runEmit({ - expectedAssetKeys: ['/some/path/file.txt'], + expectedAssetKeys: ["/some/path/file.txt"], patterns: [ { - from: 'file.txt', + from: "file.txt", async transformPath(targetPath, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -112,15 +112,15 @@ describe('transformPath option', () => { .catch(done); }); - it('should warn when function throw error', (done) => { + it("should warn when function throw error", (done) => { runEmit({ expectedAssetKeys: [], - expectedErrors: [new Error('a failure happened')], + expectedErrors: [new Error("a failure happened")], patterns: [ { - from: 'file.txt', + from: "file.txt", transformPath() { - throw new Error('a failure happened'); + throw new Error("a failure happened"); }, }, ], @@ -129,16 +129,16 @@ describe('transformPath option', () => { .catch(done); }); - it('should warn when Promise was rejected', (done) => { + it("should warn when Promise was rejected", (done) => { runEmit({ expectedAssetKeys: [], - expectedErrors: [new Error('a failure happened')], + expectedErrors: [new Error("a failure happened")], patterns: [ { - from: 'file.txt', + from: "file.txt", transformPath() { return new Promise((resolve, reject) => { - return reject(new Error('a failure happened')); + return reject(new Error("a failure happened")); }); }, }, @@ -148,16 +148,16 @@ describe('transformPath option', () => { .catch(done); }); - it('should warn when async function throw error', (done) => { + it("should warn when async function throw error", (done) => { runEmit({ expectedAssetKeys: [], - expectedErrors: [new Error('a failure happened')], + expectedErrors: [new Error("a failure happened")], patterns: [ { - from: 'file.txt', + from: "file.txt", async transformPath() { await new Promise((resolve, reject) => { - reject(new Error('a failure happened')); + reject(new Error("a failure happened")); }); }, }, @@ -167,17 +167,17 @@ describe('transformPath option', () => { .catch(done); }); - it('should transform target path of every file in glob after applying template', (done) => { + it("should transform target path of every file in glob after applying template", (done) => { runEmit({ expectedAssetKeys: [ - 'transformed/directory/directoryfile-5d7817.txt', - 'transformed/directory/nested/deep-nested/deepnested-31d6cf.txt', - 'transformed/directory/nested/nestedfile-31d6cf.txt', + "transformed/directory/directoryfile-5d7817.txt", + "transformed/directory/nested/deep-nested/deepnested-31d6cf.txt", + "transformed/directory/nested/nestedfile-31d6cf.txt", ], patterns: [ { - from: 'directory/**/*', - to: 'nested/[path][name]-[hash:6].[ext]', + from: "directory/**/*", + to: "nested/[path][name]-[hash:6].[ext]", transformPath(targetPath, absoluteFrom) { expect(absoluteFrom.includes(FIXTURES_DIR)).toBe(true); @@ -193,13 +193,13 @@ describe('transformPath option', () => { .catch(done); }); - it('should move files', (done) => { + it("should move files", (done) => { runEmit({ - expectedAssetKeys: ['txt'], + expectedAssetKeys: ["txt"], patterns: [ { - from: 'directory/nested/deep-nested', - to: '[1]', + from: "directory/nested/deep-nested", + to: "[1]", transformPath(targetPath, absolutePath) { const mathes = absolutePath.match(/\.([^.]*)$/); const [, res] = mathes; @@ -214,13 +214,13 @@ describe('transformPath option', () => { .catch(done); }); - it('should move files to a non-root directory with [1]', (done) => { + it("should move files to a non-root directory with [1]", (done) => { runEmit({ - expectedAssetKeys: ['nested/txt'], + expectedAssetKeys: ["nested/txt"], patterns: [ { - from: 'directory/nested/deep-nested', - to: 'nested/[1]', + from: "directory/nested/deep-nested", + to: "nested/[1]", transformPath(targetPath, absolutePath) { const mathes = absolutePath.match(/\.([^.]*)$/); const [, res] = mathes; @@ -235,17 +235,17 @@ describe('transformPath option', () => { .catch(done); }); - it('should move files', (done) => { + it("should move files", (done) => { runEmit({ expectedAssetKeys: [ - 'deep-nested-deepnested.txt', - 'directoryfile.txt', - 'nested-nestedfile.txt', + "deep-nested-deepnested.txt", + "directoryfile.txt", + "nested-nestedfile.txt", ], patterns: [ { - from: '**/*', - context: 'directory', + from: "**/*", + context: "directory", transformPath(targetPath) { const pathSegments = path.parse(targetPath); const result = []; @@ -262,7 +262,7 @@ describe('transformPath option', () => { result.push(pathSegments.base); } - return result.join('-'); + return result.join("-"); }, }, ], diff --git a/test/validate-options.test.js b/test/validate-options.test.js index 13f2e345..a2c38817 100644 --- a/test/validate-options.test.js +++ b/test/validate-options.test.js @@ -1,46 +1,46 @@ -import os from 'os'; +import os from "os"; -import findCacheDir from 'find-cache-dir'; +import findCacheDir from "find-cache-dir"; -import CopyPlugin from '../src/index'; +import CopyPlugin from "../src/index"; -describe('validate options', () => { +describe("validate options", () => { const tests = { patterns: { success: [ - ['test.txt'], - ['test.txt', 'test-other.txt'], + ["test.txt"], + ["test.txt", "test-other.txt"], [ - 'test.txt', + "test.txt", { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", }, ], [ { - from: 'test.txt', + from: "test.txt", }, ], [ { - from: 'test.txt', - to: 'dir', + from: "test.txt", + to: "dir", }, ], [ { - from: 'test.txt', - context: 'context', + from: "test.txt", + context: "context", }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', - toType: 'file', + from: "test.txt", + to: "dir", + context: "context", + toType: "file", force: true, flatten: true, transform: () => {}, @@ -51,9 +51,9 @@ describe('validate options', () => { ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", globOptions: { dot: false, }, @@ -61,80 +61,80 @@ describe('validate options', () => { ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: - findCacheDir({ name: 'copy-webpack-plugin-a' }) || os.tmpdir(), + findCacheDir({ name: "copy-webpack-plugin-a" }) || os.tmpdir(), }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: { keys: { - foo: 'bar', + foo: "bar", }, }, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: { keys: () => ({ - foo: 'bar', + foo: "bar", }), }, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: { keys: async () => ({ - foo: 'bar', + foo: "bar", }), }, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: { directory: - findCacheDir({ name: 'copy-webpack-plugin-b' }) || os.tmpdir(), + findCacheDir({ name: "copy-webpack-plugin-b" }) || os.tmpdir(), keys: { - foo: 'bar', + foo: "bar", }, }, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: { directory: - findCacheDir({ name: 'copy-webpack-plugin-c' }) || os.tmpdir(), + findCacheDir({ name: "copy-webpack-plugin-c" }) || os.tmpdir(), keys: () => ({ - foo: 'bar', + foo: "bar", }), }, }, ], [ { - from: 'test.txt', + from: "test.txt", filter: () => true, }, ], @@ -143,120 +143,120 @@ describe('validate options', () => { // eslint-disable-next-line no-undefined undefined, true, - 'true', - '', + "true", + "", {}, [], - [''], + [""], [{}], [ { - from: '', - to: 'dir', - context: 'context', + from: "", + to: "dir", + context: "context", }, ], [ { from: true, - to: 'dir', - context: 'context', + to: "dir", + context: "context", }, ], [ { - from: 'test.txt', + from: "test.txt", to: true, - context: 'context', + context: "context", }, ], [ { - from: 'test.txt', - to: 'dir', + from: "test.txt", + to: "dir", context: true, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', - toType: 'foo', + from: "test.txt", + to: "dir", + context: "context", + toType: "foo", }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', - force: 'true', + from: "test.txt", + to: "dir", + context: "context", + force: "true", }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', - flatten: 'true', + from: "test.txt", + to: "dir", + context: "context", + flatten: "true", }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: () => {}, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", cacheTransform: { - foo: 'bar', + foo: "bar", }, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", transform: true, }, ], [ { - from: 'test.txt', - to: 'dir', - context: 'context', + from: "test.txt", + to: "dir", + context: "context", transformPath: true, }, ], [ { from: { - glob: '**/*', + glob: "**/*", dot: false, }, - to: 'dir', - context: 'context', + to: "dir", + context: "context", }, ], [ { - from: '', - to: 'dir', - context: 'context', - noErrorOnMissing: 'true', + from: "", + to: "dir", + context: "context", + noErrorOnMissing: "true", }, ], [ { - from: 'test.txt', - filter: 'test', + from: "test.txt", + filter: "test", }, ], ], @@ -267,14 +267,14 @@ describe('validate options', () => { }, unknown: { success: [], - failure: [1, true, false, 'test', /test/, [], {}, { foo: 'bar' }], + failure: [1, true, false, "test", /test/, [], {}, { foo: "bar" }], }, }; function stringifyValue(value) { if ( Array.isArray(value) || - (value && typeof value === 'object' && value.constructor === Object) + (value && typeof value === "object" && value.constructor === Object) ) { return JSON.stringify(value); } @@ -284,27 +284,27 @@ describe('validate options', () => { async function createTestCase(key, value, type) { it(`should ${ - type === 'success' ? 'successfully validate' : 'throw an error on' + type === "success" ? "successfully validate" : "throw an error on" } the "${key}" option with "${stringifyValue(value)}" value`, async () => { let error; try { // eslint-disable-next-line no-new new CopyPlugin( - key === 'options' - ? { patterns: [{ from: 'file.txt' }], [key]: value } + key === "options" + ? { patterns: [{ from: "file.txt" }], [key]: value } : { [key]: value } ); } catch (errorFromPlugin) { - if (errorFromPlugin.name !== 'ValidationError') { + if (errorFromPlugin.name !== "ValidationError") { throw errorFromPlugin; } error = errorFromPlugin; } finally { - if (type === 'success') { + if (type === "success") { expect(error).toBeUndefined(); - } else if (type === 'failure') { + } else if (type === "failure") { expect(() => { throw error; }).toThrowErrorMatchingSnapshot();