From 62b2fc2dc8dceeef5746cbd1a5da970e83f0cbf0 Mon Sep 17 00:00:00 2001 From: Kia Ishii Date: Sun, 26 Apr 2020 01:34:44 +0900 Subject: [PATCH 1/4] build: update the build system to the latest structure --- .gitignore | 19 +- build/build.main.js | 83 ------- build/configs.js | 92 -------- build/rollup.dev.config.js | 3 - build/rollup.logger.config.js | 11 - package.json | 28 ++- rollup.config.js | 57 +++++ rollup.logger.config.js | 5 + rollup.main.config.js | 10 + scripts/build-logger.js | 5 + scripts/build-main.js | 12 + scripts/build.js | 36 +++ {build => scripts}/release.sh | 0 test/unit/helpers.spec.js | 4 +- test/unit/hot-reload.spec.js | 4 +- test/unit/modules.spec.js | 2 +- test/unit/setup.js | 4 +- test/unit/store.spec.js | 6 +- types/test/tsconfig.json | 13 +- types/tsconfig.json | 9 +- yarn.lock | 427 +++++++++++++++++++++++----------- 21 files changed, 460 insertions(+), 370 deletions(-) delete mode 100644 build/build.main.js delete mode 100644 build/configs.js delete mode 100644 build/rollup.dev.config.js delete mode 100644 build/rollup.logger.config.js create mode 100644 rollup.config.js create mode 100644 rollup.logger.config.js create mode 100644 rollup.main.config.js create mode 100644 scripts/build-logger.js create mode 100644 scripts/build-main.js create mode 100644 scripts/build.js rename {build => scripts}/release.sh (100%) diff --git a/.gitignore b/.gitignore index 84174eb51..2383bf92d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,9 @@ -.DS_Store -node_modules -TODO.md -lib -docs/.vuepress/dist -examples/**/build.js -types/typings -types/test/*.js -explorations +/docs/.vuepress/dist +/examples/**/build.js +/node_modules +/test/e2e/reports +/test/e2e/screenshots +/types/typings +/types/test/*.js *.log -test/e2e/reports -test/e2e/screenshots +.DS_Store diff --git a/build/build.main.js b/build/build.main.js deleted file mode 100644 index 7f6e4e7ec..000000000 --- a/build/build.main.js +++ /dev/null @@ -1,83 +0,0 @@ -const fs = require('fs') -const path = require('path') -const zlib = require('zlib') -const terser = require('terser') -const rollup = require('rollup') -const configs = require('./configs') - -if (!fs.existsSync('dist')) { - fs.mkdirSync('dist') -} - -build(Object.keys(configs).map(key => configs[key])) - -function build (builds) { - let built = 0 - const total = builds.length - const next = () => { - buildEntry(builds[built]).then(() => { - built++ - if (built < total) { - next() - } - }).catch(logError) - } - - next() -} - -function buildEntry ({ input, output }) { - const { file, banner } = output - const isProd = /min\.js$/.test(file) - return rollup.rollup(input) - .then(bundle => bundle.generate(output)) - .then(({ output: [{ code }] }) => { - if (isProd) { - const minified = (banner ? banner + '\n' : '') + terser.minify(code, { - toplevel: true, - output: { - ascii_only: true - }, - compress: { - pure_funcs: ['makeMap'] - } - }).code - return write(file, minified, true) - } else { - return write(file, code) - } - }) -} - -function write (dest, code, zip) { - return new Promise((resolve, reject) => { - function report (extra) { - console.log(blue(path.relative(process.cwd(), dest)) + ' ' + getSize(code) + (extra || '')) - resolve() - } - - fs.writeFile(dest, code, err => { - if (err) return reject(err) - if (zip) { - zlib.gzip(code, (err, zipped) => { - if (err) return reject(err) - report(' (gzipped: ' + getSize(zipped) + ')') - }) - } else { - report() - } - }) - }) -} - -function getSize (code) { - return (code.length / 1024).toFixed(2) + 'kb' -} - -function logError (e) { - console.log(e) -} - -function blue (str) { - return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m' -} diff --git a/build/configs.js b/build/configs.js deleted file mode 100644 index 54c5f27df..000000000 --- a/build/configs.js +++ /dev/null @@ -1,92 +0,0 @@ -const path = require('path') -const buble = require('rollup-plugin-buble') -const replace = require('rollup-plugin-replace') -const version = process.env.VERSION || require('../package.json').version -const banner = -`/** - * vuex v${version} - * (c) ${new Date().getFullYear()} Evan You - * @license MIT - */` - -const resolve = _path => path.resolve(__dirname, '../', _path) - -const configs = { - umdDev: { - input: resolve('src/index.js'), - file: resolve('dist/vuex.js'), - format: 'umd', - env: 'development' - }, - umdProd: { - input: resolve('src/index.js'), - file: resolve('dist/vuex.min.js'), - format: 'umd', - env: 'production' - }, - commonjs: { - input: resolve('src/index.js'), - file: resolve('dist/vuex.common.js'), - format: 'cjs' - }, - esm: { - input: resolve('src/index.esm.js'), - file: resolve('dist/vuex.esm.js'), - format: 'es' - }, - 'esm-browser-dev': { - input: resolve('src/index.esm.js'), - file: resolve('dist/vuex.esm.browser.js'), - format: 'es', - env: 'development', - transpile: false - }, - 'esm-browser-prod': { - input: resolve('src/index.esm.js'), - file: resolve('dist/vuex.esm.browser.min.js'), - format: 'es', - env: 'production', - transpile: false - } -} - -function genConfig (opts) { - const config = { - input: { - input: opts.input, - plugins: [ - replace({ - __VERSION__: version - }) - ] - }, - output: { - banner, - file: opts.file, - format: opts.format, - name: 'Vuex' - } - } - - if (opts.env) { - config.input.plugins.unshift(replace({ - 'process.env.NODE_ENV': JSON.stringify(opts.env) - })) - } - - if (opts.transpile !== false) { - config.input.plugins.push(buble()) - } - - return config -} - -function mapValues (obj, fn) { - const res = {} - Object.keys(obj).forEach(key => { - res[key] = fn(obj[key], key) - }) - return res -} - -module.exports = mapValues(configs, genConfig) diff --git a/build/rollup.dev.config.js b/build/rollup.dev.config.js deleted file mode 100644 index f532cb17b..000000000 --- a/build/rollup.dev.config.js +++ /dev/null @@ -1,3 +0,0 @@ -const { input, output } = require('./configs').commonjs - -module.exports = Object.assign({}, input, { output }) diff --git a/build/rollup.logger.config.js b/build/rollup.logger.config.js deleted file mode 100644 index 597f79fc8..000000000 --- a/build/rollup.logger.config.js +++ /dev/null @@ -1,11 +0,0 @@ -const buble = require('rollup-plugin-buble') - -module.exports = { - input: 'src/plugins/logger.js', - output: { - file: 'dist/logger.js', - format: 'umd', - name: 'createVuexLogger', - }, - plugins: [buble()] -} diff --git a/package.json b/package.json index 42190d292..8ad7f83d1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "unpkg": "dist/vuex.js", "jsdelivr": "dist/vuex.js", "typings": "types/index.d.ts", + "sideEffects": false, "files": [ "dist", "types/index.d.ts", @@ -15,18 +16,17 @@ ], "scripts": { "dev": "node examples/server.js", - "dev:dist": "rollup -wm -c build/rollup.dev.config.js", "build": "npm run build:main && npm run build:logger", - "build:main": "node build/build.main.js", - "build:logger": "rollup -c build/rollup.logger.config.js", + "build:main": "node scripts/build-main.js", + "build:logger": "node scripts/build-logger.js", "lint": "eslint src test", "test": "npm run lint && npm run test:types && npm run test:unit && npm run test:ssr && npm run test:e2e", - "test:unit": "rollup -c build/rollup.dev.config.js && jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json", + "test:unit": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json", "test:e2e": "node test/e2e/runner.js", - "test:ssr": "rollup -c build/rollup.dev.config.js && cross-env VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json", + "test:ssr": "cross-env VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json", "test:types": "tsc -p types/test", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", - "release": "bash build/release.sh", + "release": "bash scripts/release.sh", "docs": "vuepress dev docs", "docs:build": "vuepress build docs" }, @@ -44,11 +44,18 @@ "vue": "^2.0.0" }, "devDependencies": { + "@rollup/plugin-buble": "^0.21.3", + "@rollup/plugin-commonjs": "^11.1.0", + "@rollup/plugin-node-resolve": "^7.1.3", + "@rollup/plugin-replace": "^2.3.2", + "@types/node": "^13.13.2", "babel-core": "^6.22.1", "babel-loader": "^7.1.2", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-polyfill": "^6.22.0", "babel-preset-env": "^1.5.1", + "brotli": "^1.3.2", + "chalk": "^4.0.0", "chromedriver": "^80.0.1", "conventional-changelog-cli": "^2.0.31", "cross-env": "^5.2.0", @@ -56,17 +63,16 @@ "css-loader": "^2.1.0", "eslint": "^6.8.0", "eslint-plugin-vue-libs": "^4.0.0", + "execa": "^4.0.0", "express": "^4.17.1", "jasmine": "2.8.0", "jasmine-core": "2.8.0", "nightwatch": "^1.3.1", "nightwatch-helpers": "^1.2.0", - "rollup": "^1.1.0", - "rollup-plugin-buble": "^0.19.6", - "rollup-plugin-replace": "^2.1.0", - "terser": "^3.17.0", + "rollup": "^2.7.2", + "rollup-plugin-terser": "^5.3.0", "todomvc-app-css": "^2.1.0", - "typescript": "^3.7.2", + "typescript": "^3.8.3", "vue": "^2.5.22", "vue-loader": "^15.2.1", "vue-template-compiler": "^2.5.22", diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 000000000..923f70281 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,57 @@ +import buble from '@rollup/plugin-buble' +import replace from '@rollup/plugin-replace' +import resolve from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' +import { terser } from 'rollup-plugin-terser' +import pkg from './package.json' + +const banner = `/*! + * vuex v${pkg.version} + * (c) ${new Date().getFullYear()} Evan You + * @license MIT + */` + +export function createEntries(configs) { + return configs.map((c) => createEntry(c)) +} + +function createEntry(config) { + const c = { + input: config.input, + plugins: [], + output: { + banner, + file: config.file, + format: config.format + }, + onwarn: (msg, warn) => { + if (!/Circular/.test(msg)) { + warn(msg) + } + } + } + + if (config.format === 'umd') { + c.output.name = c.output.name || 'Vuex' + } + + c.plugins.push(replace({ + __VERSION__: pkg.version, + 'process.env.NODE_ENV': (config.format === 'es' && !config.browser) || config.format === 'cjs' + ? `process.env.NODE_ENV` + : JSON.stringify(config.env) + })) + + if (config.transpile !== false) { + c.plugins.push(buble()) + } + + c.plugins.push(resolve()) + c.plugins.push(commonjs()) + + if (config.minify) { + c.plugins.push(terser({ module: config.format === 'es' })) + } + + return c +} diff --git a/rollup.logger.config.js b/rollup.logger.config.js new file mode 100644 index 000000000..91dfadded --- /dev/null +++ b/rollup.logger.config.js @@ -0,0 +1,5 @@ +import { createEntries } from './rollup.config' + +export default createEntries([ + { input: 'src/plugins/logger.js', file: 'dist/logger.js', name: 'createVuexLogger', format: 'umd', env: 'development' } +]) diff --git a/rollup.main.config.js b/rollup.main.config.js new file mode 100644 index 000000000..1c803ddf4 --- /dev/null +++ b/rollup.main.config.js @@ -0,0 +1,10 @@ +import { createEntries } from './rollup.config' + +export default createEntries([ + { input: 'src/index.esm.js', file: 'dist/vuex.esm.browser.js', format: 'es', browser: true, transpile: false, env: 'development' }, + { input: 'src/index.esm.js', file: 'dist/vuex.esm.browser.min.js', format: 'es', browser: true, transpile: false, env: 'production' }, + { input: 'src/index.esm.js', file: 'dist/vuex.esm.js', format: 'es', env: 'development' }, + { input: 'src/index.js', file: 'dist/vuex.js', format: 'umd', env: 'development' }, + { input: 'src/index.js', file: 'dist/vuex.min.js', format: 'umd', minify: true, env: 'production' }, + { input: 'src/index.js', file: 'dist/vuex.common.js', format: 'cjs', env: 'development' } +]) diff --git a/scripts/build-logger.js b/scripts/build-logger.js new file mode 100644 index 000000000..b5e9354e7 --- /dev/null +++ b/scripts/build-logger.js @@ -0,0 +1,5 @@ +const { run } = require('./build') + +const files = ['dist/logger.js'] + +run('rollup.logger.config.js', files) diff --git a/scripts/build-main.js b/scripts/build-main.js new file mode 100644 index 000000000..2cfdcb55d --- /dev/null +++ b/scripts/build-main.js @@ -0,0 +1,12 @@ +const { run } = require('./build') + +const files = [ + 'dist/vuex.esm.browser.js', + 'dist/vuex.esm.browser.min.js', + 'dist/vuex.esm.js', + 'dist/vuex.js', + 'dist/vuex.min.js', + 'dist/vuex.common.js' +] + +run('rollup.main.config.js', files) diff --git a/scripts/build.js b/scripts/build.js new file mode 100644 index 000000000..b77b162af --- /dev/null +++ b/scripts/build.js @@ -0,0 +1,36 @@ +const fs = require('fs-extra') +const chalk = require('chalk') +const execa = require('execa') +const { gzipSync } = require('zlib') +const { compress } = require('brotli') + +async function run(config, files) { + await build(config) + checkAllSizes(files) +} + +async function build(config) { + await execa('rollup', ['-c', config], { stdio: 'inherit' }) +} + +function checkAllSizes(files) { + console.log() + files.map((f) => checkSize(f)) + console.log() +} + +function checkSize(file) { + const f = fs.readFileSync(file) + const minSize = (f.length / 1024).toFixed(2) + 'kb' + const gzipped = gzipSync(f) + const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb' + const compressed = compress(f) + const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb' + console.log( + `${chalk.gray( + chalk.bold(file) + )} size:${minSize} / gzip:${gzippedSize} / brotli:${compressedSize}` + ) +} + +module.exports = { run } diff --git a/build/release.sh b/scripts/release.sh similarity index 100% rename from build/release.sh rename to scripts/release.sh diff --git a/test/unit/helpers.spec.js b/test/unit/helpers.spec.js index e3d5ee44c..e13d28604 100644 --- a/test/unit/helpers.spec.js +++ b/test/unit/helpers.spec.js @@ -1,5 +1,5 @@ -import Vue from 'vue/dist/vue.common.js' -import Vuex, { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from '../../dist/vuex.common.js' +import Vue from 'vue' +import Vuex, { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from '../../src/index.esm' describe('Helpers', () => { it('mapState (array)', () => { diff --git a/test/unit/hot-reload.spec.js b/test/unit/hot-reload.spec.js index e27526039..8601fa3a9 100644 --- a/test/unit/hot-reload.spec.js +++ b/test/unit/hot-reload.spec.js @@ -1,5 +1,5 @@ -import Vue from 'vue/dist/vue.common.js' -import Vuex from '../../dist/vuex.common.js' +import Vue from 'vue' +import Vuex from '../../src/index.esm' const TEST = 'TEST' const isSSR = process.env.VUE_ENV === 'server' diff --git a/test/unit/modules.spec.js b/test/unit/modules.spec.js index 0e09616a0..4c9fb7526 100644 --- a/test/unit/modules.spec.js +++ b/test/unit/modules.spec.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import Vuex from '../../dist/vuex.common.js' +import Vuex from '../../src/index.esm' const TEST = 'TEST' diff --git a/test/unit/setup.js b/test/unit/setup.js index e927f2cba..04323dfd0 100644 --- a/test/unit/setup.js +++ b/test/unit/setup.js @@ -1,5 +1,5 @@ import 'babel-polyfill' -import Vue from 'vue/dist/vue.common.js' -import Vuex from '../../dist/vuex.common.js' +import Vue from 'vue' +import Vuex from '../../src/index.esm' Vue.use(Vuex) diff --git a/test/unit/store.spec.js b/test/unit/store.spec.js index 561496e60..9effbdafa 100644 --- a/test/unit/store.spec.js +++ b/test/unit/store.spec.js @@ -1,5 +1,5 @@ -import Vue from 'vue/dist/vue.common.js' -import Vuex from '../../dist/vuex.common.js' +import Vue from 'vue' +import Vuex from '../../src/index.esm' const TEST = 'TEST' const isSSR = process.env.VUE_ENV === 'server' @@ -267,7 +267,7 @@ describe('Store', () => { it('asserts the call with the new operator', () => { expect(() => { Vuex.Store({}) - }).toThrowError(/store must be called with the new operator/) + }).toThrowError(/Cannot call a class as a function/) }) it('should accept state as function', () => { diff --git a/types/test/tsconfig.json b/types/test/tsconfig.json index 28f595aca..49af5ba4f 100644 --- a/types/test/tsconfig.json +++ b/types/test/tsconfig.json @@ -1,13 +1,14 @@ { "compilerOptions": { - "target": "es5", - "module": "es2015", + "target": "esnext", + "module": "esnext", "moduleResolution": "node", "lib": [ - "es5", - "dom", - "es2015.promise", - "es2015.core" + "esnext", + "dom" + ], + "types": [ + "node" ], "strict": true, "noEmit": true diff --git a/types/tsconfig.json b/types/tsconfig.json index 7010dd28a..ba66d580e 100644 --- a/types/tsconfig.json +++ b/types/tsconfig.json @@ -1,12 +1,11 @@ { "compilerOptions": { - "target": "es5", - "module": "es2015", + "target": "esnext", + "module": "esnext", "moduleResolution": "node", "lib": [ - "es5", - "dom", - "es2015.promise" + "esnext", + "dom" ], "strict": true, "noEmit": true diff --git a/yarn.lock b/yarn.lock index 5a8e27b56..4a23c9f09 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,7 +16,7 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== @@ -865,6 +865,56 @@ "@nodelib/fs.scandir" "2.1.3" fastq "^1.6.0" +"@rollup/plugin-buble@^0.21.3": + version "0.21.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-buble/-/plugin-buble-0.21.3.tgz#1649a915b1d051a4f430d40e7734a7f67a69b33e" + integrity sha512-Iv8cCuFPnMdqV4pcyU+OrfjOfagPArRQ1PyQjx5KgHk3dARedI+8PNTLSMpJts0lQJr8yF2pAU4GxpxCBJ9HYw== + dependencies: + "@rollup/pluginutils" "^3.0.8" + "@types/buble" "^0.19.2" + buble "^0.20.0" + +"@rollup/plugin-commonjs@^11.1.0": + version "11.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz#60636c7a722f54b41e419e1709df05c7234557ef" + integrity sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA== + dependencies: + "@rollup/pluginutils" "^3.0.8" + commondir "^1.0.1" + estree-walker "^1.0.1" + glob "^7.1.2" + is-reference "^1.1.2" + magic-string "^0.25.2" + resolve "^1.11.0" + +"@rollup/plugin-node-resolve@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz#80de384edfbd7bfc9101164910f86078151a3eca" + integrity sha512-RxtSL3XmdTAE2byxekYLnx+98kEUOrPHF/KRVjLH+DEIHy6kjIw7YINQzn+NXiH/NTrQLAwYs0GWB+csWygA9Q== + dependencies: + "@rollup/pluginutils" "^3.0.8" + "@types/resolve" "0.0.8" + builtin-modules "^3.1.0" + is-module "^1.0.0" + resolve "^1.14.2" + +"@rollup/plugin-replace@^2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.3.2.tgz#da4e0939047f793c2eb5eedfd6c271232d0a033f" + integrity sha512-KEEL7V2tMNOsbAoNMKg91l1sNXBDoiP31GFlqXVOuV5691VQKzKBh91+OKKOG4uQWYqcFskcjFyh1d5YnZd0Zw== + dependencies: + "@rollup/pluginutils" "^3.0.8" + magic-string "^0.25.5" + +"@rollup/pluginutils@^3.0.8": + version "3.0.9" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.0.9.tgz#aa6adca2c45e5a1b950103a999e3cddfe49fd775" + integrity sha512-TLZavlfPAZYI7v33wQh4mTP6zojne14yok3DNSLcjoG/Hirxfkonn6icP5rrNWRn8nZsirJBFFpijVOJzkUHDg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + micromatch "^4.0.2" + "@shellscape/koa-send@^4.1.0": version "4.1.3" resolved "https://registry.yarnpkg.com/@shellscape/koa-send/-/koa-send-4.1.3.tgz#1a7c8df21f63487e060b7bfd8ed82e1d3c4ae0b0" @@ -888,6 +938,13 @@ resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.0.7.tgz#0cd915785ec4190f08a3a6acc9b61fc38fb5f1a9" integrity sha512-8UT/J+xqCYfn3fKtOznAibsHpiuDshCb0fwgWxRazTT19Igp9ovoXMPhXyLD6m3CKQGTMHgqoxaFfMWaL40Rnw== +"@types/buble@^0.19.2": + version "0.19.2" + resolved "https://registry.yarnpkg.com/@types/buble/-/buble-0.19.2.tgz#a4289d20b175b3c206aaad80caabdabe3ecdfdd1" + integrity sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q== + dependencies: + magic-string "^0.25.0" + "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -922,6 +979,18 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== +"@types/node@^13.13.2": + version "13.13.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.2.tgz#160d82623610db590a64e8ca81784e11117e5a54" + integrity sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A== + +"@types/resolve@0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + dependencies: + "@types/node" "*" + "@vue/babel-preset-app@3.0.0-beta.11": version "3.0.0-beta.11" resolved "https://registry.yarnpkg.com/@vue/babel-preset-app/-/babel-preset-app-3.0.0-beta.11.tgz#c8b889aa73464050f9cd3f9dc621951d85c24508" @@ -1317,6 +1386,11 @@ acorn-dynamic-import@^3.0.0: dependencies: acorn "^5.0.0" +acorn-dynamic-import@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" + integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== + acorn-jsx@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" @@ -1332,7 +1406,7 @@ acorn@^5.0.0, acorn@^5.6.2: resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.2, acorn@^6.0.5: +acorn@^6.0.2: version "6.0.5" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.5.tgz#81730c0815f3f3b34d8efa95cb7430965f4d887a" integrity sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg== @@ -2385,6 +2459,11 @@ base64-js@^1.0.2: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== +base64-js@^1.1.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" + integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -2526,6 +2605,13 @@ brorand@^1.0.1: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= +brotli@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/brotli/-/brotli-1.3.2.tgz#525a9cad4fcba96475d7d388f6aecb13eed52f46" + integrity sha1-UlqcrU/LqWR119OI9q7LE+7VL0Y= + dependencies: + base64-js "^1.1.2" + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -2606,17 +2692,18 @@ browserslist@^3.0.0, browserslist@^3.2.6, browserslist@^3.2.8: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" -buble@^0.19.6: - version "0.19.6" - resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.6.tgz#915909b6bd5b11ee03b1c885ec914a8b974d34d3" - integrity sha512-9kViM6nJA1Q548Jrd06x0geh+BG2ru2+RMDkIHHgJY/8AcyCs34lTHwra9BX7YdPrZXd5aarkpr/SY8bmPgPdg== +buble@^0.20.0: + version "0.20.0" + resolved "https://registry.yarnpkg.com/buble/-/buble-0.20.0.tgz#a143979a8d968b7f76b57f38f2e7ce7cfe938d1f" + integrity sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw== dependencies: - chalk "^2.4.1" - magic-string "^0.25.1" - minimist "^1.2.0" - os-homedir "^1.0.1" - regexpu-core "^4.2.0" - vlq "^1.0.0" + acorn "^6.4.1" + acorn-dynamic-import "^4.0.0" + acorn-jsx "^5.2.0" + chalk "^2.4.2" + magic-string "^0.25.7" + minimist "^1.2.5" + regexpu-core "4.5.4" buffer-from@^1.0.0: version "1.1.1" @@ -2642,6 +2729,11 @@ builtin-modules@^1.0.0: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= +builtin-modules@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" + integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== + builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -2880,6 +2972,14 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" + integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -3167,11 +3267,6 @@ commander@^2.15.1: resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== -commander@^2.19.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== - commander@^2.20.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -3587,6 +3682,15 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.2.tgz#d0d7dcfa74e89115c7619f4f721a94e1fdb716d6" + integrity sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -4465,10 +4569,15 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= -estree-walker@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" - integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig== +estree-walker@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" + integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== esutils@^2.0.2: version "2.0.2" @@ -4524,6 +4633,21 @@ execa@^0.8.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.0.tgz#7f37d6ec17f09e6b8fc53288611695b6d12b9daf" + integrity sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -5020,6 +5144,11 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + ftp@~0.3.10: version "0.3.10" resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" @@ -5088,6 +5217,13 @@ get-stream@^3.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= +get-stream@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" + integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + dependencies: + pump "^3.0.0" + get-uri@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.4.tgz#d4937ab819e218d4cb5ae18e4f5962bef169cc6a" @@ -5613,6 +5749,11 @@ https-proxy-agent@^3.0.0: agent-base "^4.3.0" debug "^3.1.0" +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -6038,6 +6179,11 @@ is-interactive@^1.0.0: resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" @@ -6121,6 +6267,13 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= +is-reference@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.1.4.tgz#3f95849886ddb70256a3e6d062b1a68c13c51427" + integrity sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw== + dependencies: + "@types/estree" "0.0.39" + is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" @@ -6143,6 +6296,11 @@ is-stream@^1.0.0, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + is-svg@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" @@ -6261,6 +6419,14 @@ javascript-stringify@^1.6.0: resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" integrity sha1-FC0RHzpuPa6PSpr9d9RYVbWpzOM= +jest-worker@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" + integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== + dependencies: + merge-stream "^2.0.0" + supports-color "^6.1.0" + joi@^11.1.1: version "11.4.0" resolved "https://registry.yarnpkg.com/joi/-/joi-11.4.0.tgz#f674897537b625e9ac3d0b7e1604c828ad913ccb" @@ -6862,12 +7028,12 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -magic-string@^0.25.1: - version "0.25.1" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e" - integrity sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg== +magic-string@^0.25.0, magic-string@^0.25.2, magic-string@^0.25.5, magic-string@^0.25.7: + version "0.25.7" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" + integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== dependencies: - sourcemap-codec "^1.4.1" + sourcemap-codec "^1.4.4" make-dir@^1.0.0: version "1.3.0" @@ -7039,6 +7205,11 @@ merge-source-map@^1.1.0: dependencies: source-map "^0.6.1" +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + merge2@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" @@ -7226,14 +7397,6 @@ minipass@^2.2.1, minipass@^2.3.4: safe-buffer "^5.1.2" yallist "^3.0.0" -minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - minizlib@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" @@ -7241,13 +7404,6 @@ minizlib@^1.1.1: dependencies: minipass "^2.2.1" -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - mississippi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" @@ -7594,22 +7750,6 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" @@ -7708,6 +7848,13 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -7903,7 +8050,7 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= -os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= @@ -8152,6 +8299,11 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -9018,6 +9170,13 @@ regenerate-unicode-properties@^7.0.0: dependencies: regenerate "^1.4.0" +regenerate-unicode-properties@^8.0.2: + version "8.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" + integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== + dependencies: + regenerate "^1.4.0" + regenerate@^1.2.1, regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" @@ -9069,6 +9228,18 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +regexpu-core@4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" + integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.0.2" + regjsgen "^0.5.0" + regjsparser "^0.6.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.1.0" + regexpu-core@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" @@ -9087,7 +9258,7 @@ regexpu-core@^2.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" -regexpu-core@^4.1.3, regexpu-core@^4.1.4, regexpu-core@^4.2.0: +regexpu-core@^4.1.3, regexpu-core@^4.1.4: version "4.4.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.4.0.tgz#8d43e0d1266883969720345e70c275ee0aec0d32" integrity sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA== @@ -9281,7 +9452,7 @@ resolve@^1.10.0: dependencies: path-parse "^1.0.6" -resolve@^1.12.0: +resolve@^1.11.0, resolve@^1.12.0, resolve@^1.14.2: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -9350,39 +9521,30 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rollup-plugin-buble@^0.19.6: - version "0.19.6" - resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.19.6.tgz#55ee0995d8870d536f01f4277c3eef4276e8747e" - integrity sha512-El5Fut4/wEO17ZN/n9BZvqd7DXXB2WbJr/DKvr89LXChC/cHllE0XwiUDeAalrTkgr0WrnyLDTCQvEv+cGywWQ== - dependencies: - buble "^0.19.6" - rollup-pluginutils "^2.3.3" - -rollup-plugin-replace@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz#f9c07a4a89a2f8be912ee54b3f0f68d91e9ed0ae" - integrity sha512-SxrAIgpH/B5/W4SeULgreOemxcpEgKs2gcD42zXw50bhqGWmcnlXneVInQpAqzA/cIly4bJrOpeelmB9p4YXSQ== +rollup-plugin-terser@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz#9c0dd33d5771df9630cd027d6a2559187f65885e" + integrity sha512-XGMJihTIO3eIBsVGq7jiNYOdDMb3pVxuzY0uhOE/FM4x/u9nQgr3+McsjzqBn3QfHIpNSZmFnpoKAwHBEcsT7g== dependencies: - magic-string "^0.25.1" - minimatch "^3.0.2" - rollup-pluginutils "^2.0.1" + "@babel/code-frame" "^7.5.5" + jest-worker "^24.9.0" + rollup-pluginutils "^2.8.2" + serialize-javascript "^2.1.2" + terser "^4.6.2" -rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" - integrity sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA== +rollup-pluginutils@^2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" + integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: - estree-walker "^0.5.2" - micromatch "^2.3.11" + estree-walker "^0.6.1" -rollup@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.1.0.tgz#461a7534b55be48aa4a6e6810a1543a5769e75d1" - integrity sha512-NK03gkkOz0CchHBMGomcNqa6U3jLNzHuWK9SI0+1FV475JA6cQxVtjlDcQoKKDNIQ3IwYumIlgoKYDEWUyFBwQ== - dependencies: - "@types/estree" "0.0.39" - "@types/node" "*" - acorn "^6.0.5" +rollup@^2.7.2: + version "2.7.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.7.2.tgz#0f8ee6216d33e83c0750116312c2c92b94cc7f72" + integrity sha512-SdtTZVMMVSPe7SNv4exUyPXARe5v/p3TeeG3LRA5WabLPJt4Usi3wVrvVlyAUTG40JJmqS6zbIHt2vWTss2prw== + optionalDependencies: + fsevents "~2.1.2" run-async@^2.4.0: version "2.4.0" @@ -9588,11 +9750,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -9705,14 +9879,6 @@ source-map-support@^0.4.15: dependencies: source-map "^0.5.6" -source-map-support@~0.5.10: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@~0.5.12: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -9761,10 +9927,10 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -sourcemap-codec@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f" - integrity sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg== +sourcemap-codec@^1.4.4: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== spdx-correct@^3.0.0: version "3.1.0" @@ -10054,6 +10220,11 @@ strip-eof@^1.0.0: resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" @@ -10195,19 +10366,6 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -tar@^4.4.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - tcp-port-used@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tcp-port-used/-/tcp-port-used-1.0.1.tgz#46061078e2d38c73979a2c2c12b5a674e6689d70" @@ -10265,15 +10423,6 @@ terser-webpack-plugin@^1.4.3: webpack-sources "^1.4.0" worker-farm "^1.7.0" -terser@^3.17.0: - version "3.17.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-3.17.0.tgz#f88ffbeda0deb5637f9d24b0da66f4e15ab10cb2" - integrity sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ== - dependencies: - commander "^2.19.0" - source-map "~0.6.1" - source-map-support "~0.5.10" - terser@^3.8.1: version "3.14.1" resolved "https://registry.yarnpkg.com/terser/-/terser-3.14.1.tgz#cc4764014af570bc79c79742358bd46926018a32" @@ -10283,7 +10432,7 @@ terser@^3.8.1: source-map "~0.6.1" source-map-support "~0.5.6" -terser@^4.1.2: +terser@^4.1.2, terser@^4.6.2: version "4.6.12" resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.12.tgz#44b98aef8703fdb09a3491bf79b43faffc5b4fee" integrity sha512-fnIwuaKjFPANG6MAixC/k1TDtnl1YlPLUlLVIxxGZUn1gfUx2+l3/zGNB72wya+lgsb50QBi2tUV75RiODwnww== @@ -10550,10 +10699,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb" - integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ== +typescript@^3.8.3: + version "3.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" + integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" @@ -10594,6 +10743,11 @@ unicode-match-property-value-ecmascript@^1.0.2: resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" integrity sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ== +unicode-match-property-value-ecmascript@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" + integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== + unicode-property-aliases-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" @@ -10819,11 +10973,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vlq@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.0.tgz#8101be90843422954c2b13eb27f2f3122bdcc806" - integrity sha512-o3WmXySo+oI5thgqr7Qy8uBkT/v9Zr+sRyrh1lr8aWPUkgDWdWt4Nae2WKBrLsocgE8BuWWD0jLc+VW8LeU+2g== - vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" @@ -11233,6 +11382,13 @@ which@1.3.1, which@^1.2.9: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wide-align@1.1.3, wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -11479,11 +11635,6 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== -yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yargs-parser@13.1.1, yargs-parser@^13.1.1: version "13.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" From 87b9fb6913c1848346d0d7ffe004fdf7c0cd48c4 Mon Sep 17 00:00:00 2001 From: Kia Ishii Date: Sun, 26 Apr 2020 12:58:06 +0900 Subject: [PATCH 2/4] build: use __DEV__ global --- .eslintrc | 5 +++- examples/webpack.config.js | 10 ++++++-- rollup.config.js | 6 ++--- rollup.main.config.js | 12 +++++----- src/helpers.js | 12 +++++----- src/{index.esm.js => index.cjs.js} | 10 -------- src/index.js | 10 ++++++++ src/module/module-collection.js | 6 ++--- src/store.js | 38 +++++++++++++++--------------- test/unit/helpers.spec.js | 2 +- test/unit/hot-reload.spec.js | 2 +- test/unit/modules.spec.js | 2 +- test/unit/setup.js | 4 +++- test/unit/store.spec.js | 2 +- 14 files changed, 66 insertions(+), 55 deletions(-) rename src/{index.esm.js => index.cjs.js} (71%) diff --git a/.eslintrc b/.eslintrc index 59aa2339a..af0ad7581 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,5 +2,8 @@ "root": true, "extends": [ "plugin:vue-libs/recommended" - ] + ], + "globals": { + "__DEV__": true + } } diff --git a/examples/webpack.config.js b/examples/webpack.config.js index 0ca94fb22..71bef3ce9 100644 --- a/examples/webpack.config.js +++ b/examples/webpack.config.js @@ -33,7 +33,7 @@ module.exports = { resolve: { alias: { - vuex: path.resolve(__dirname, '../src/index.esm.js') + vuex: path.resolve(__dirname, '../src/index.js') } }, @@ -52,6 +52,12 @@ module.exports = { plugins: [ new VueLoaderPlugin(), new webpack.HotModuleReplacementPlugin(), - new webpack.NoEmitOnErrorsPlugin() + new webpack.NoEmitOnErrorsPlugin(), + new webpack.DefinePlugin({ + __DEV__: JSON.stringify(true), + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV), + } + }) ] } diff --git a/rollup.config.js b/rollup.config.js index 923f70281..bcdbb1187 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -37,9 +37,9 @@ function createEntry(config) { c.plugins.push(replace({ __VERSION__: pkg.version, - 'process.env.NODE_ENV': (config.format === 'es' && !config.browser) || config.format === 'cjs' - ? `process.env.NODE_ENV` - : JSON.stringify(config.env) + __DEV__: config.format === 'es' && !config.browser + ? `(process.env.NODE_ENV !== 'production')` + : config.env !== 'production' })) if (config.transpile !== false) { diff --git a/rollup.main.config.js b/rollup.main.config.js index 1c803ddf4..3715fcdfd 100644 --- a/rollup.main.config.js +++ b/rollup.main.config.js @@ -1,10 +1,10 @@ import { createEntries } from './rollup.config' export default createEntries([ - { input: 'src/index.esm.js', file: 'dist/vuex.esm.browser.js', format: 'es', browser: true, transpile: false, env: 'development' }, - { input: 'src/index.esm.js', file: 'dist/vuex.esm.browser.min.js', format: 'es', browser: true, transpile: false, env: 'production' }, - { input: 'src/index.esm.js', file: 'dist/vuex.esm.js', format: 'es', env: 'development' }, - { input: 'src/index.js', file: 'dist/vuex.js', format: 'umd', env: 'development' }, - { input: 'src/index.js', file: 'dist/vuex.min.js', format: 'umd', minify: true, env: 'production' }, - { input: 'src/index.js', file: 'dist/vuex.common.js', format: 'cjs', env: 'development' } + { input: 'src/index.js', file: 'dist/vuex.esm.browser.js', format: 'es', browser: true, transpile: false, env: 'development' }, + { input: 'src/index.js', file: 'dist/vuex.esm.browser.min.js', format: 'es', browser: true, transpile: false, env: 'production' }, + { input: 'src/index.js', file: 'dist/vuex.esm.js', format: 'es', env: 'development' }, + { input: 'src/index.cjs.js', file: 'dist/vuex.js', format: 'umd', env: 'development' }, + { input: 'src/index.cjs.js', file: 'dist/vuex.min.js', format: 'umd', minify: true, env: 'production' }, + { input: 'src/index.cjs.js', file: 'dist/vuex.common.js', format: 'cjs', env: 'development' } ]) diff --git a/src/helpers.js b/src/helpers.js index 722a9ce63..1d5446f82 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -8,7 +8,7 @@ import { isObject } from './util' */ export const mapState = normalizeNamespace((namespace, states) => { const res = {} - if (process.env.NODE_ENV !== 'production' && !isValidMap(states)) { + if (__DEV__ && !isValidMap(states)) { console.error('[vuex] mapState: mapper parameter must be either an Array or an Object') } normalizeMap(states).forEach(({ key, val }) => { @@ -41,7 +41,7 @@ export const mapState = normalizeNamespace((namespace, states) => { */ export const mapMutations = normalizeNamespace((namespace, mutations) => { const res = {} - if (process.env.NODE_ENV !== 'production' && !isValidMap(mutations)) { + if (__DEV__ && !isValidMap(mutations)) { console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object') } normalizeMap(mutations).forEach(({ key, val }) => { @@ -71,7 +71,7 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { */ export const mapGetters = normalizeNamespace((namespace, getters) => { const res = {} - if (process.env.NODE_ENV !== 'production' && !isValidMap(getters)) { + if (__DEV__ && !isValidMap(getters)) { console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object') } normalizeMap(getters).forEach(({ key, val }) => { @@ -81,7 +81,7 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) { return } - if (process.env.NODE_ENV !== 'production' && !(val in this.$store.getters)) { + if (__DEV__ && !(val in this.$store.getters)) { console.error(`[vuex] unknown getter: ${val}`) return } @@ -101,7 +101,7 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { */ export const mapActions = normalizeNamespace((namespace, actions) => { const res = {} - if (process.env.NODE_ENV !== 'production' && !isValidMap(actions)) { + if (__DEV__ && !isValidMap(actions)) { console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object') } normalizeMap(actions).forEach(({ key, val }) => { @@ -186,7 +186,7 @@ function normalizeNamespace (fn) { */ function getModuleByNamespace (store, helper, namespace) { const module = store._modulesNamespaceMap[namespace] - if (process.env.NODE_ENV !== 'production' && !module) { + if (__DEV__ && !module) { console.error(`[vuex] module namespace not found in ${helper}(): ${namespace}`) } return module diff --git a/src/index.esm.js b/src/index.cjs.js similarity index 71% rename from src/index.esm.js rename to src/index.cjs.js index e28e0cc3d..ea28ccc1c 100644 --- a/src/index.esm.js +++ b/src/index.cjs.js @@ -11,13 +11,3 @@ export default { mapActions, createNamespacedHelpers } - -export { - Store, - install, - mapState, - mapMutations, - mapGetters, - mapActions, - createNamespacedHelpers -} diff --git a/src/index.js b/src/index.js index ea28ccc1c..e28e0cc3d 100644 --- a/src/index.js +++ b/src/index.js @@ -11,3 +11,13 @@ export default { mapActions, createNamespacedHelpers } + +export { + Store, + install, + mapState, + mapMutations, + mapGetters, + mapActions, + createNamespacedHelpers +} diff --git a/src/module/module-collection.js b/src/module/module-collection.js index 6dfb8da5a..ee1a887ba 100644 --- a/src/module/module-collection.js +++ b/src/module/module-collection.js @@ -26,7 +26,7 @@ export default class ModuleCollection { } register (path, rawModule, runtime = true) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assertRawModule(path, rawModule) } @@ -63,7 +63,7 @@ export default class ModuleCollection { } function update (path, targetModule, newModule) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assertRawModule(path, newModule) } @@ -74,7 +74,7 @@ function update (path, targetModule, newModule) { if (newModule.modules) { for (const key in newModule.modules) { if (!targetModule.getChild(key)) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.warn( `[vuex] trying to add a new module '${key}' on hot reloading, ` + 'manual reload is needed' diff --git a/src/store.js b/src/store.js index 5a3cf8da9..fcfcb98fb 100644 --- a/src/store.js +++ b/src/store.js @@ -14,7 +14,7 @@ export class Store { install(window.Vue) } - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(Vue, `must call Vue.use(Vuex) before creating a store instance.`) assert(typeof Promise !== 'undefined', `vuex requires a Promise polyfill in this browser.`) assert(this instanceof Store, `store must be called with the new operator.`) @@ -75,7 +75,7 @@ export class Store { } set state (v) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(false, `use store.replaceState() to explicit replace store state.`) } } @@ -91,7 +91,7 @@ export class Store { const mutation = { type, payload } const entry = this._mutations[type] if (!entry) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.error(`[vuex] unknown mutation type: ${type}`) } return @@ -107,7 +107,7 @@ export class Store { .forEach(sub => sub(mutation, this.state)) if ( - process.env.NODE_ENV !== 'production' && + __DEV__ && options && options.silent ) { console.warn( @@ -127,7 +127,7 @@ export class Store { const action = { type, payload } const entry = this._actions[type] if (!entry) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.error(`[vuex] unknown action type: ${type}`) } return @@ -139,7 +139,7 @@ export class Store { .filter(sub => sub.before) .forEach(sub => sub.before(action, this.state)) } catch (e) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.warn(`[vuex] error in before action subscribers: `) console.error(e) } @@ -155,7 +155,7 @@ export class Store { .filter(sub => sub.after) .forEach(sub => sub.after(action, this.state)) } catch (e) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.warn(`[vuex] error in after action subscribers: `) console.error(e) } @@ -174,7 +174,7 @@ export class Store { } watch (getter, cb, options) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(typeof getter === 'function', `store.watch only accepts a function.`) } return this._watcherVM.$watch(() => getter(this.state, this.getters), cb, options) @@ -189,7 +189,7 @@ export class Store { registerModule (path, rawModule, options = {}) { if (typeof path === 'string') path = [path] - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(Array.isArray(path), `module path must be a string or an Array.`) assert(path.length > 0, 'cannot register the root module by using registerModule.') } @@ -203,7 +203,7 @@ export class Store { unregisterModule (path) { if (typeof path === 'string') path = [path] - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(Array.isArray(path), `module path must be a string or an Array.`) } @@ -218,7 +218,7 @@ export class Store { hasModule (path) { if (typeof path === 'string') path = [path] - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(Array.isArray(path), `module path must be a string or an Array.`) } @@ -320,7 +320,7 @@ function installModule (store, rootState, path, module, hot) { // register in namespace map if (module.namespaced) { - if (store._modulesNamespaceMap[namespace] && process.env.NODE_ENV !== 'production') { + if (store._modulesNamespaceMap[namespace] && __DEV__) { console.error(`[vuex] duplicate namespace ${namespace} for the namespaced module ${path.join('/')}`) } store._modulesNamespaceMap[namespace] = module @@ -331,7 +331,7 @@ function installModule (store, rootState, path, module, hot) { const parentState = getNestedState(rootState, path.slice(0, -1)) const moduleName = path[path.length - 1] store._withCommit(() => { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { if (moduleName in parentState) { console.warn( `[vuex] state field "${moduleName}" was overridden by a module with the same name at "${path.join('.')}"` @@ -380,7 +380,7 @@ function makeLocalContext (store, namespace, path) { if (!options || !options.root) { type = namespace + type - if (process.env.NODE_ENV !== 'production' && !store._actions[type]) { + if (__DEV__ && !store._actions[type]) { console.error(`[vuex] unknown local action type: ${args.type}, global type: ${type}`) return } @@ -396,7 +396,7 @@ function makeLocalContext (store, namespace, path) { if (!options || !options.root) { type = namespace + type - if (process.env.NODE_ENV !== 'production' && !store._mutations[type]) { + if (__DEV__ && !store._mutations[type]) { console.error(`[vuex] unknown local mutation type: ${args.type}, global type: ${type}`) return } @@ -481,7 +481,7 @@ function registerAction (store, type, handler, local) { function registerGetter (store, type, rawGetter, local) { if (store._wrappedGetters[type]) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.error(`[vuex] duplicate getter key: ${type}`) } return @@ -498,7 +498,7 @@ function registerGetter (store, type, rawGetter, local) { function enableStrictMode (store) { store._vm.$watch(function () { return this._data.$$state }, () => { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(store._committing, `do not mutate vuex store state outside mutation handlers.`) } }, { deep: true, sync: true }) @@ -515,7 +515,7 @@ function unifyObjectStyle (type, payload, options) { type = type.type } - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { assert(typeof type === 'string', `expects string as the type, but found ${typeof type}.`) } @@ -524,7 +524,7 @@ function unifyObjectStyle (type, payload, options) { export function install (_Vue) { if (Vue && _Vue === Vue) { - if (process.env.NODE_ENV !== 'production') { + if (__DEV__) { console.error( '[vuex] already installed. Vue.use(Vuex) should be called only once.' ) diff --git a/test/unit/helpers.spec.js b/test/unit/helpers.spec.js index e13d28604..b450c659c 100644 --- a/test/unit/helpers.spec.js +++ b/test/unit/helpers.spec.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import Vuex, { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from '../../src/index.esm' +import Vuex, { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from '../../src/index' describe('Helpers', () => { it('mapState (array)', () => { diff --git a/test/unit/hot-reload.spec.js b/test/unit/hot-reload.spec.js index 8601fa3a9..f78dc6bca 100644 --- a/test/unit/hot-reload.spec.js +++ b/test/unit/hot-reload.spec.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import Vuex from '../../src/index.esm' +import Vuex from '../../src/index' const TEST = 'TEST' const isSSR = process.env.VUE_ENV === 'server' diff --git a/test/unit/modules.spec.js b/test/unit/modules.spec.js index 4c9fb7526..7b606f912 100644 --- a/test/unit/modules.spec.js +++ b/test/unit/modules.spec.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import Vuex from '../../src/index.esm' +import Vuex from '../../src/index' const TEST = 'TEST' diff --git a/test/unit/setup.js b/test/unit/setup.js index 04323dfd0..bb63802de 100644 --- a/test/unit/setup.js +++ b/test/unit/setup.js @@ -1,5 +1,7 @@ import 'babel-polyfill' import Vue from 'vue' -import Vuex from '../../src/index.esm' +import Vuex from '../../src/index' Vue.use(Vuex) + +global.__DEV__ = true diff --git a/test/unit/store.spec.js b/test/unit/store.spec.js index 9effbdafa..85a28a423 100644 --- a/test/unit/store.spec.js +++ b/test/unit/store.spec.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import Vuex from '../../src/index.esm' +import Vuex from '../../src/index' const TEST = 'TEST' const isSSR = process.env.VUE_ENV === 'server' From b01bf68effcf3c85c1c4c8ecb1cd48215069a936 Mon Sep 17 00:00:00 2001 From: Kia Ishii Date: Mon, 27 Apr 2020 12:22:38 +0900 Subject: [PATCH 3/4] chore: ignore all `node_modules` folder --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2383bf92d..891f0ee12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ /docs/.vuepress/dist /examples/**/build.js -/node_modules /test/e2e/reports /test/e2e/screenshots /types/typings /types/test/*.js *.log .DS_Store +node_modules From d47b5ae8adea42f7f191d02705ed730345c7f6b5 Mon Sep 17 00:00:00 2001 From: Kia Ishii Date: Mon, 27 Apr 2020 12:49:28 +0900 Subject: [PATCH 4/4] build: tweek some bundle settings --- rollup.config.js | 2 +- rollup.main.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index bcdbb1187..2f093c26f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -37,7 +37,7 @@ function createEntry(config) { c.plugins.push(replace({ __VERSION__: pkg.version, - __DEV__: config.format === 'es' && !config.browser + __DEV__: config.format !== 'umd' && !config.browser ? `(process.env.NODE_ENV !== 'production')` : config.env !== 'production' })) diff --git a/rollup.main.config.js b/rollup.main.config.js index 3715fcdfd..e7282eb3f 100644 --- a/rollup.main.config.js +++ b/rollup.main.config.js @@ -2,7 +2,7 @@ import { createEntries } from './rollup.config' export default createEntries([ { input: 'src/index.js', file: 'dist/vuex.esm.browser.js', format: 'es', browser: true, transpile: false, env: 'development' }, - { input: 'src/index.js', file: 'dist/vuex.esm.browser.min.js', format: 'es', browser: true, transpile: false, env: 'production' }, + { input: 'src/index.js', file: 'dist/vuex.esm.browser.min.js', format: 'es', browser: true, transpile: false, minify: true, env: 'production' }, { input: 'src/index.js', file: 'dist/vuex.esm.js', format: 'es', env: 'development' }, { input: 'src/index.cjs.js', file: 'dist/vuex.js', format: 'umd', env: 'development' }, { input: 'src/index.cjs.js', file: 'dist/vuex.min.js', format: 'umd', minify: true, env: 'production' },