From cecaecee104176e418535a9cdbaf7d5b518391fe Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 3 Mar 2019 17:44:44 +0800 Subject: [PATCH 01/20] test: refine test api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - feat: Add getFragment、context、usePlugin - fix: cannot debug test cases at a child process --- .../@vuepress/test-utils/createJestRunner.js | 12 - .../fixtures/docs/.vuepress/theme/Layout.vue | 3 + .../test-utils/fixtures/docs/README.md | 1 + packages/@vuepress/test-utils/index.js | 13 + packages/@vuepress/test-utils/lib/context.js | 22 + .../test-utils/{ => lib}/createJestConfig.js | 2 +- .../test-utils/lib/createJestRunner.js | 46 + .../@vuepress/test-utils/lib/getFragment.js | 15 + .../test-utils/{jest => lib}/jest.config.js | 3 - packages/@vuepress/test-utils/lib/plugin.js | 21 + packages/@vuepress/test-utils/package.json | 16 +- scripts/jest.config.js | 2 +- scripts/test.js | 2 +- yarn.lock | 1232 ++++++++--------- 14 files changed, 689 insertions(+), 701 deletions(-) delete mode 100644 packages/@vuepress/test-utils/createJestRunner.js create mode 100644 packages/@vuepress/test-utils/fixtures/docs/.vuepress/theme/Layout.vue create mode 100644 packages/@vuepress/test-utils/fixtures/docs/README.md create mode 100644 packages/@vuepress/test-utils/index.js create mode 100644 packages/@vuepress/test-utils/lib/context.js rename packages/@vuepress/test-utils/{ => lib}/createJestConfig.js (67%) create mode 100644 packages/@vuepress/test-utils/lib/createJestRunner.js create mode 100644 packages/@vuepress/test-utils/lib/getFragment.js rename packages/@vuepress/test-utils/{jest => lib}/jest.config.js (81%) create mode 100644 packages/@vuepress/test-utils/lib/plugin.js diff --git a/packages/@vuepress/test-utils/createJestRunner.js b/packages/@vuepress/test-utils/createJestRunner.js deleted file mode 100644 index ae3b1600b1..0000000000 --- a/packages/@vuepress/test-utils/createJestRunner.js +++ /dev/null @@ -1,12 +0,0 @@ -const execa = require('execa') -const rawArgs = process.argv.slice(2) - -module.exports = function createJestRunner (jestArgs) { - return async function () { - const args = [...jestArgs, ...rawArgs] - console.log(`running jest with args: ${args.join(' ')}`) - await execa('jest', args, { - stdio: 'inherit' - }) - } -} diff --git a/packages/@vuepress/test-utils/fixtures/docs/.vuepress/theme/Layout.vue b/packages/@vuepress/test-utils/fixtures/docs/.vuepress/theme/Layout.vue new file mode 100644 index 0000000000..9bca3a6a4a --- /dev/null +++ b/packages/@vuepress/test-utils/fixtures/docs/.vuepress/theme/Layout.vue @@ -0,0 +1,3 @@ + diff --git a/packages/@vuepress/test-utils/fixtures/docs/README.md b/packages/@vuepress/test-utils/fixtures/docs/README.md new file mode 100644 index 0000000000..95f541a31a --- /dev/null +++ b/packages/@vuepress/test-utils/fixtures/docs/README.md @@ -0,0 +1 @@ +# App diff --git a/packages/@vuepress/test-utils/index.js b/packages/@vuepress/test-utils/index.js new file mode 100644 index 0000000000..edc89a2a57 --- /dev/null +++ b/packages/@vuepress/test-utils/index.js @@ -0,0 +1,13 @@ +const context = require('./lib/context') +const getFragment = require('./lib/getFragment') +const usePlugin = require('./lib/plugin') +const createJestRunner = require('./lib/createJestRunner') +const createJestConfig = require('./lib/createJestConfig') + +module.exports = { + context, + getFragment, + usePlugin, + createJestRunner, + createJestConfig +} diff --git a/packages/@vuepress/test-utils/lib/context.js b/packages/@vuepress/test-utils/lib/context.js new file mode 100644 index 0000000000..0bf46ea043 --- /dev/null +++ b/packages/@vuepress/test-utils/lib/context.js @@ -0,0 +1,22 @@ +const { path: { join }} = require('@vuepress/shared-utils') +const prepare = require('@vuepress/core/lib/prepare') + +const DEFAULT_DOCS_DIR = join(__dirname, '../fixtures/docs') + +async function createContext (docsDir = DEFAULT_DOCS_DIR, isProd = false) { + return prepare(docsDir, {}, isProd) +} + +let context + +async function getContextSingleton (docsDir = DEFAULT_DOCS_DIR, isProd = false) { + if (!context) { + context = await prepare(docsDir, {}, isProd) + } + return context +} + +module.exports = { + createContext, + getContextSingleton +} diff --git a/packages/@vuepress/test-utils/createJestConfig.js b/packages/@vuepress/test-utils/lib/createJestConfig.js similarity index 67% rename from packages/@vuepress/test-utils/createJestConfig.js rename to packages/@vuepress/test-utils/lib/createJestConfig.js index dc9349efc1..729f97670a 100644 --- a/packages/@vuepress/test-utils/createJestConfig.js +++ b/packages/@vuepress/test-utils/lib/createJestConfig.js @@ -1,4 +1,4 @@ -const defaultJestConfig = require('./jest/jest.config') +const defaultJestConfig = require('./jest.config') module.exports = function createJestConfig (override) { return Object.assign({}, defaultJestConfig, override) diff --git a/packages/@vuepress/test-utils/lib/createJestRunner.js b/packages/@vuepress/test-utils/lib/createJestRunner.js new file mode 100644 index 0000000000..dab442ef03 --- /dev/null +++ b/packages/@vuepress/test-utils/lib/createJestRunner.js @@ -0,0 +1,46 @@ +const execa = require('execa') +const rawArgs = process.argv.slice(2) + +const usedPorts = [] + +module.exports = function createJestRunner (jestArgs) { + return async function () { + let args = [...jestArgs, ...rawArgs] + const execArgv = getChildProcesExecArgv() + args = [...execArgv, 'node_modules/.bin/jest', '--runInBand', ...args] + console.log(`running node with args: ${args.join(' ')}`) + await execa('node', [...execArgv, 'node_modules/.bin/jest', ...args], { + stdio: 'inherit' + }) + } +} + +function getChildProcesExecArgv () { + const execArgv = process.execArgv.slice(0) + const inspectArgvIndex = execArgv.findIndex(argv => + argv.includes('--inspect-brk'), + ) + + if (inspectArgvIndex > -1) { + const inspectArgv = execArgv[inspectArgvIndex] + execArgv.splice( + inspectArgvIndex, + 1, + inspectArgv.replace(/--inspect-brk=(.*)/, (match, s1) => { + let port + try { + port = parseInt(s1) + 1 + } catch (e) { + port = 9230 // node default inspect port plus 1. + } + if (usedPorts.includes(port)) { + port++ + } + usedPorts.push(port) + return `--inspect-brk=${port}` + }) + ) + } + + return execArgv +} diff --git a/packages/@vuepress/test-utils/lib/getFragment.js b/packages/@vuepress/test-utils/lib/getFragment.js new file mode 100644 index 0000000000..8b49b420c9 --- /dev/null +++ b/packages/@vuepress/test-utils/lib/getFragment.js @@ -0,0 +1,15 @@ +const LRU = require('lru-cache') +const { fs, path } = require('@vuepress/shared-utils') + +const cache = new LRU({ max: 1000 }) + +module.exports = async function getFragment (dirname, name) { + let content = cache.get(name) + if (content) { + return content + } + const target = path.resolve(dirname, `fragments/${name}.md`) + content = await fs.readFile(target, 'utf-8') + cache.set(name, content) + return content +} diff --git a/packages/@vuepress/test-utils/jest/jest.config.js b/packages/@vuepress/test-utils/lib/jest.config.js similarity index 81% rename from packages/@vuepress/test-utils/jest/jest.config.js rename to packages/@vuepress/test-utils/lib/jest.config.js index 2a313c269d..c2cc4ea279 100644 --- a/packages/@vuepress/test-utils/jest/jest.config.js +++ b/packages/@vuepress/test-utils/lib/jest.config.js @@ -1,6 +1,3 @@ -// https://github.com/facebook/jest/tree/master/packages/babel-jest -// TODO remove 'babel-core@^7.0.0-0' when babel-jest can work with '@babel/core' - const path = require('path') module.exports = { diff --git a/packages/@vuepress/test-utils/lib/plugin.js b/packages/@vuepress/test-utils/lib/plugin.js new file mode 100644 index 0000000000..83c8a44561 --- /dev/null +++ b/packages/@vuepress/test-utils/lib/plugin.js @@ -0,0 +1,21 @@ +const { getContextSingleton } = require('./context') + +class PluginTestAPI { + constructor (context) { + this.context = context + } + + get markdown () { + return this.context.markdown + } + + extendMarkdown () { + this.context.pluginAPI.options.extendMarkdown.syncApply(this.context.markdown) + } +} + +module.exports = async function (plugin, options, context) { + const contexnt = context || (await getContextSingleton()) + contexnt.use(plugin, options) + return new PluginTestAPI(context) +} diff --git a/packages/@vuepress/test-utils/package.json b/packages/@vuepress/test-utils/package.json index 5e522b5134..6990e17587 100644 --- a/packages/@vuepress/test-utils/package.json +++ b/packages/@vuepress/test-utils/package.json @@ -2,6 +2,7 @@ "name": "@vuepress/test-utils", "version": "1.0.0-alpha.42", "description": "test-utils for vuepress", + "main": "index.js", "publishConfig": { "access": "public" }, @@ -19,17 +20,16 @@ "dependencies": { "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", - "@types/jest": "^23.3.10", - "@vue/test-utils": "^1.0.0-beta.16", - "@vuepress/core": "^1.0.0-alpha.42", - "@vuepress/shared-utils": "^1.0.0-alpha.42", - "babel-core": "^7.0.0-0", - "babel-jest": "^23.4.0", + "@types/jest": "^24.0.9", + "@vue/test-utils": "^1.0.0-beta.29", + "@vuepress/core": "1.0.0-alpha.42", + "@vuepress/shared-utils": "1.0.0-alpha.42", + "babel-jest": "^24.1.0", + "jest": "^24.1.0", "execa": "^0.10.0", - "jest": "^23.4.0", "jest-serializer-vue": "^1.0.0", "ts-jest": "^23.10.5", - "vue-jest": "^2.6.0" + "vue-jest": "^3.0.3" }, "author": "ULIVZ ", "license": "MIT", diff --git a/scripts/jest.config.js b/scripts/jest.config.js index 6c9f3d226c..601dd798f9 100644 --- a/scripts/jest.config.js +++ b/scripts/jest.config.js @@ -1,5 +1,5 @@ const path = require('upath') -const createJestConfig = require('@vuepress/test-utils/createJestConfig') +const { createJestConfig } = require('@vuepress/test-utils') module.exports = createJestConfig({ rootDir: path.resolve(__dirname, '..'), diff --git a/scripts/test.js b/scripts/test.js index 489d67d4f6..c3b18e6063 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -1,5 +1,5 @@ const minimist = require('minimist') -const createJestRunner = require('@vuepress/test-utils/createJestRunner') +const { createJestRunner } = require('@vuepress/test-utils') const rawArgs = process.argv.slice(2) const args = minimist(rawArgs) diff --git a/yarn.lock b/yarn.lock index 2bcf92a03f..9ecdb424fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,12 +14,6 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/code-frame@^7.0.0-beta.35": - version "7.0.0-beta.54" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.54.tgz#0024f96fdf7028a21d68e273afd4e953214a1ead" - dependencies: - "@babel/highlight" "7.0.0-beta.54" - "@babel/core@^7.0.0": version "7.1.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.2.tgz#f8d2a9ceb6832887329a7b60f9d035791400ba4e" @@ -39,6 +33,25 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/core@^7.1.0": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.3.4.tgz#921a5a13746c21e32445bf0798680e9d11a6530b" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.3.4" + "@babel/helpers" "^7.2.0" + "@babel/parser" "^7.3.4" + "@babel/template" "^7.2.2" + "@babel/traverse" "^7.3.4" + "@babel/types" "^7.3.4" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/generator@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" @@ -49,6 +62,16 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.0.0", "@babel/generator@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.3.4.tgz#9aa48c1989257877a9d971296e5b73bfe72e446e" + dependencies: + "@babel/types" "^7.3.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + "@babel/generator@^7.1.2", "@babel/generator@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.1.3.tgz#2103ec9c42d9bdad9190a6ad5ff2d456fd7b8673" @@ -223,6 +246,14 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.1.2" +"@babel/helpers@^7.2.0": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.3.1.tgz#949eec9ea4b45d3210feb7dc1c22db664c9e44b9" + dependencies: + "@babel/template" "^7.1.2" + "@babel/traverse" "^7.1.5" + "@babel/types" "^7.3.0" + "@babel/highlight@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" @@ -231,14 +262,6 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/highlight@7.0.0-beta.54": - version "7.0.0-beta.54" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.54.tgz#155d507358329b8e7068970017c3fd74a9b08584" - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -247,6 +270,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" + "@babel/parser@^7.1.2", "@babel/parser@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.3.tgz#2c92469bac2b7fbff810b67fca07bd138b48af77" @@ -614,6 +641,14 @@ babylon "7.0.0-beta.44" lodash "^4.2.0" +"@babel/template@^7.0.0", "@babel/template@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.2.2" + "@babel/types" "^7.2.2" + "@babel/template@^7.1.0", "@babel/template@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.2.tgz#090484a574fef5a2d2d7726a674eceda5c5b5644" @@ -637,6 +672,20 @@ invariant "^2.2.0" lodash "^4.2.0" +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.3.4.tgz#1330aab72234f8dea091b08c4f8b9d05c7119e06" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.3.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.3.4" + "@babel/types" "^7.3.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + "@babel/traverse@^7.1.0": version "7.1.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.4.tgz#f4f83b93d649b4b2c91121a9087fa2fa949ec2b4" @@ -667,6 +716,14 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@babel/types@^7.2.2", "@babel/types@^7.3.0", "@babel/types@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.3.4.tgz#bf482eaeaffb367a28abbf9357a94963235d90ed" + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + "@lerna/add@^3.6.0": version "3.6.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.6.0.tgz#eea53efff0b3237774ddac6eaa84957140e89238" @@ -1228,9 +1285,15 @@ version "1.0.0" resolved "https://registry.yarnpkg.com/@types/hash-sum/-/hash-sum-1.0.0.tgz#838f4e8627887d42b162d05f3d96ca636c2bc504" -"@types/jest@^23.3.10": - version "23.3.10" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.10.tgz#4897974cc317bf99d4fe6af1efa15957fa9c94de" +"@types/jest-diff@*": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" + +"@types/jest@^24.0.9": + version "24.0.9" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.9.tgz#74ce9cf337f25e189aa18f76ab3d65e8669b55f2" + dependencies: + "@types/jest-diff" "*" "@types/lru-cache@^4.1.1": version "4.1.1" @@ -1286,10 +1349,11 @@ source-map "^0.5.6" vue-template-es2015-compiler "^1.6.0" -"@vue/test-utils@^1.0.0-beta.16": - version "1.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.21.tgz#fe1ee11ce16072da7ef29420df4aa5c11f4560ff" +"@vue/test-utils@^1.0.0-beta.29": + version "1.0.0-beta.29" + resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.29.tgz#c942cf25e891cf081b6a03332b4ae1ef430726f0" dependencies: + dom-event-types "^1.0.0" lodash "^4.17.4" "@webassemblyjs/ast@1.5.13": @@ -1606,6 +1670,10 @@ ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" +ansi-regex@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1658,17 +1726,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" -arr-flatten@^1.0.1, arr-flatten@^1.1.0: +arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" @@ -1710,10 +1772,6 @@ array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -1768,11 +1826,11 @@ async@^1.4.0, async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@^2.1.4: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" +async@^2.5.0, async@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" dependencies: - lodash "^4.17.10" + lodash "^4.17.11" asynckit@^0.4.0: version "0.4.0" @@ -1826,34 +1884,6 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@^6.0.0, babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-core@^7.0.0-0: - version "7.0.0-bridge.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" - babel-eslint@^8.2.3: version "8.2.3" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf" @@ -1865,36 +1895,18 @@ babel-eslint@^8.2.3: eslint-scope "~3.7.1" eslint-visitor-keys "^1.0.0" -babel-generator@^6.18.0, babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - babel-helper-vue-jsx-merge-props@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6" -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-jest@^23.4.0, babel-jest@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.4.2.tgz#f276de67798a5d68f2d6e87ff518c2f6e1609877" +babel-jest@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.1.0.tgz#441e23ef75ded3bd547e300ac3194cef87b55190" dependencies: - babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^23.2.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.1.0" + chalk "^2.4.2" + slash "^2.0.0" babel-loader@^8.0.4: version "8.0.4" @@ -1917,22 +1929,17 @@ babel-plugin-dynamic-import-node@^2.2.0: dependencies: object.assign "^4.1.0" -babel-plugin-istanbul@^4.1.6: - version "4.1.6" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" +babel-plugin-istanbul@^5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz#7981590f1956d75d67630ba46f0c22493588c893" dependencies: - babel-plugin-syntax-object-rest-spread "^6.13.0" - find-up "^2.1.0" - istanbul-lib-instrument "^1.10.1" - test-exclude "^4.2.1" - -babel-plugin-jest-hoist@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" + find-up "^3.0.0" + istanbul-lib-instrument "^3.0.0" + test-exclude "^5.0.0" -babel-plugin-syntax-object-rest-spread@^6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" +babel-plugin-jest-hoist@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" babel-plugin-transform-es2015-modules-commonjs@^6.26.0: version "6.26.2" @@ -1956,24 +1963,12 @@ babel-plugin-transform-vue-jsx@^4.0.1: dependencies: esutils "^2.0.2" -babel-preset-jest@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" +babel-preset-jest@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz#83bc564fdcd4903641af65ec63f2f5de6b04132e" dependencies: - babel-plugin-jest-hoist "^23.2.0" - babel-plugin-syntax-object-rest-spread "^6.13.0" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.1.0" babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" @@ -1982,7 +1977,7 @@ babel-runtime@^6.22.0, babel-runtime@^6.26.0: core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: +babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: @@ -1992,7 +1987,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: +babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: @@ -2006,7 +2001,7 @@ babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.24.1, babel-types@^6.26.0: +babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: @@ -2130,14 +2125,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" @@ -2380,9 +2367,9 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" camel-case@3.0.x: version "3.0.0" @@ -2478,6 +2465,14 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4 escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -2523,6 +2518,10 @@ ci-info@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -2703,6 +2702,10 @@ commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" +commander@~2.17.1: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + common-tags@^1.4.0: version "1.8.0" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" @@ -2718,9 +2721,9 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" -compare-versions@^3.1.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.0.tgz#af93ea705a96943f622ab309578b9b90586f39c3" +compare-versions@^3.2.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" component-emitter@^1.2.1: version "1.2.1" @@ -3034,7 +3037,7 @@ conventional-recommended-bump@^4.0.4: meow "^4.0.0" q "^1.5.1" -convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.1: +convert-source-map@^1.1.0, convert-source-map@^1.4.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" @@ -3074,7 +3077,7 @@ copy-webpack-plugin@^4.5.1: p-limit "^1.0.0" serialize-javascript "^1.4.0" -core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7: +core-js@^2.4.0, core-js@^2.5.7: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -3328,7 +3331,7 @@ debug@*, debug@3.1.0, debug@=3.1.0, debug@^3.1.0: dependencies: ms "2.0.0" -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -3340,7 +3343,7 @@ debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.1.0: +debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" dependencies: @@ -3357,7 +3360,7 @@ decamelize-keys@^1.0.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: +decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -3490,12 +3493,6 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - dependencies: - repeating "^2.0.0" - detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -3523,9 +3520,9 @@ diacritics@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/diacritics/-/diacritics-1.3.0.tgz#3efa87323ebb863e6696cebb0082d48ff3d6f7a1" -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" +diff-sequences@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.0.0.tgz#cdf8e27ed20d8b8d3caccb4e0c0d8fe31a173013" diffie-hellman@^5.0.0: version "5.0.3" @@ -3580,6 +3577,10 @@ dom-converter@~0.1: dependencies: utila "~0.3" +dom-event-types@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dom-event-types/-/dom-event-types-1.0.0.tgz#5830a0a29e1bf837fe50a70cd80a597232813cae" + dom-serializer@0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" @@ -3984,18 +3985,6 @@ execa@^0.10.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" @@ -4040,12 +4029,6 @@ exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -4058,22 +4041,15 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - -expect@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-23.5.0.tgz#18999a0eef8f8acf99023fde766d9c323c2562ed" +expect@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.1.0.tgz#88e73301c4c785cde5f16da130ab407bdaf8c0f2" dependencies: ansi-styles "^3.2.0" - jest-diff "^23.5.0" - jest-get-type "^22.1.0" - jest-matcher-utils "^23.5.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" + jest-get-type "^24.0.0" + jest-matcher-utils "^24.0.0" + jest-message-util "^24.0.0" + jest-regex-util "^24.0.0" express@^4.16.2: version "4.16.4" @@ -4143,12 +4119,6 @@ external-editor@^3.0.0: iconv-lite "^0.4.24" tmp "^0.0.33" -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -4256,27 +4226,13 @@ file-loader@^1.1.11: loader-utils "^1.0.2" schema-utils "^0.4.5" -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fileset@^2.0.2: +fileset@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" dependencies: glob "^7.0.3" minimatch "^3.0.3" -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -4372,16 +4328,10 @@ follow-redirects@^1.0.0: dependencies: debug "=3.1.0" -for-in@^1.0.1, for-in@^1.0.2: +for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -4617,19 +4567,6 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -4743,6 +4680,10 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +graceful-fs@^4.1.15: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + gray-matter@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.1.tgz#375263c194f0d9755578c277e41b1c1dfdf22c7d" @@ -4760,7 +4701,7 @@ handle-thing@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" -handlebars@^4.0.2, handlebars@^4.0.3: +handlebars@^4.0.2: version "4.0.11" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" dependencies: @@ -4770,6 +4711,16 @@ handlebars@^4.0.2, handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" +handlebars@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a" + dependencies: + async "^2.5.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -4877,13 +4828,6 @@ hogan.js@^3.0.2: mkdirp "0.3.0" nopt "1.0.10" -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -5184,10 +5128,6 @@ invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -5254,6 +5194,12 @@ is-ci@^1.0.10, is-ci@^1.1.0: dependencies: ci-info "^1.0.0" +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + dependencies: + ci-info "^2.0.0" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -5290,16 +5236,6 @@ is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -5310,10 +5246,6 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -5334,15 +5266,9 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-generator-fn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" +is-generator-fn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" is-glob@^3.1.0: version "3.1.0" @@ -5356,22 +5282,12 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" dependencies: kind-of "^3.0.2" -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - is-number@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-5.0.0.tgz#c393bc471e65de1a10a6abcb20efeb12d2b88166" @@ -5412,14 +5328,6 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -5518,301 +5426,314 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-api@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" - dependencies: - async "^2.1.4" - compare-versions "^3.1.0" - fileset "^2.0.2" - istanbul-lib-coverage "^1.2.0" - istanbul-lib-hook "^1.2.0" - istanbul-lib-instrument "^1.10.1" - istanbul-lib-report "^1.1.4" - istanbul-lib-source-maps "^1.2.4" - istanbul-reports "^1.3.0" - js-yaml "^3.7.0" - mkdirp "^0.5.1" +istanbul-api@^2.0.8: + version "2.1.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-2.1.1.tgz#194b773f6d9cbc99a9258446848b0f988951c4d0" + dependencies: + async "^2.6.1" + compare-versions "^3.2.1" + fileset "^2.0.3" + istanbul-lib-coverage "^2.0.3" + istanbul-lib-hook "^2.0.3" + istanbul-lib-instrument "^3.1.0" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.2" + istanbul-reports "^2.1.1" + js-yaml "^3.12.0" + make-dir "^1.3.0" + minimatch "^3.0.4" once "^1.4.0" -istanbul-lib-coverage@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#0b891e5ad42312c2b9488554f603795f9a2211ba" -istanbul-lib-hook@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" +istanbul-lib-hook@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz#e0e581e461c611be5d0e5ef31c5f0109759916fb" dependencies: append-transform "^1.0.0" -istanbul-lib-instrument@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" +istanbul-lib-instrument@^3.0.0, istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz#a2b5484a7d445f1f311e93190813fa56dfb62971" dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.18.0" - istanbul-lib-coverage "^1.2.0" - semver "^5.3.0" + "@babel/generator" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/template" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + istanbul-lib-coverage "^2.0.3" + semver "^5.5.0" -istanbul-lib-report@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" +istanbul-lib-report@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz#bfd324ee0c04f59119cb4f07dab157d09f24d7e4" dependencies: - istanbul-lib-coverage "^1.2.0" - mkdirp "^0.5.1" - path-parse "^1.0.5" - supports-color "^3.1.2" + istanbul-lib-coverage "^2.0.3" + make-dir "^1.3.0" + supports-color "^6.0.0" -istanbul-lib-source-maps@^1.2.4: - version "1.2.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" +istanbul-lib-source-maps@^3.0.1, istanbul-lib-source-maps@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz#f1e817229a9146e8424a28e5d69ba220fda34156" dependencies: - debug "^3.1.0" - istanbul-lib-coverage "^1.2.0" - mkdirp "^0.5.1" - rimraf "^2.6.1" - source-map "^0.5.3" + debug "^4.1.1" + istanbul-lib-coverage "^2.0.3" + make-dir "^1.3.0" + rimraf "^2.6.2" + source-map "^0.6.1" -istanbul-reports@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" +istanbul-reports@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.1.1.tgz#72ef16b4ecb9a4a7bd0e2001e00f95d1eec8afa9" dependencies: - handlebars "^4.0.3" + handlebars "^4.1.0" javascript-stringify@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" -jest-changed-files@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" +jest-changed-files@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.0.0.tgz#c02c09a8cc9ca93f513166bc773741bd39898ff7" dependencies: + execa "^1.0.0" throat "^4.0.0" -jest-cli@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.5.0.tgz#d316b8e34a38a610a1efc4f0403d8ef8a55e4492" +jest-cli@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.1.0.tgz#f7cc98995f36e7210cce3cbb12974cbf60940843" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.2" - graceful-fs "^4.1.11" - import-local "^1.0.0" - is-ci "^1.0.10" - istanbul-api "^1.3.1" - istanbul-lib-coverage "^1.2.0" - istanbul-lib-instrument "^1.10.1" - istanbul-lib-source-maps "^1.2.4" - jest-changed-files "^23.4.2" - jest-config "^23.5.0" - jest-environment-jsdom "^23.4.0" - jest-get-type "^22.1.0" - jest-haste-map "^23.5.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - jest-resolve-dependencies "^23.5.0" - jest-runner "^23.5.0" - jest-runtime "^23.5.0" - jest-snapshot "^23.5.0" - jest-util "^23.4.0" - jest-validate "^23.5.0" - jest-watcher "^23.4.0" - jest-worker "^23.2.0" - micromatch "^2.3.11" + graceful-fs "^4.1.15" + import-local "^2.0.0" + is-ci "^2.0.0" + istanbul-api "^2.0.8" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-source-maps "^3.0.1" + jest-changed-files "^24.0.0" + jest-config "^24.1.0" + jest-environment-jsdom "^24.0.0" + jest-get-type "^24.0.0" + jest-haste-map "^24.0.0" + jest-message-util "^24.0.0" + jest-regex-util "^24.0.0" + jest-resolve-dependencies "^24.1.0" + jest-runner "^24.1.0" + jest-runtime "^24.1.0" + jest-snapshot "^24.1.0" + jest-util "^24.0.0" + jest-validate "^24.0.0" + jest-watcher "^24.0.0" + jest-worker "^24.0.0" + micromatch "^3.1.10" node-notifier "^5.2.1" - prompts "^0.1.9" + p-each-series "^1.0.0" + pirates "^4.0.0" + prompts "^2.0.1" realpath-native "^1.0.0" rimraf "^2.5.4" - slash "^1.0.0" + slash "^2.0.0" string-length "^2.0.0" - strip-ansi "^4.0.0" + strip-ansi "^5.0.0" which "^1.2.12" - yargs "^11.0.0" + yargs "^12.0.2" -jest-config@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.5.0.tgz#3770fba03f7507ee15f3b8867c742e48f31a9773" +jest-config@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.1.0.tgz#6ea6881cfdd299bc86cc144ee36d937c97c3850c" dependencies: - babel-core "^6.0.0" - babel-jest "^23.4.2" + "@babel/core" "^7.1.0" + babel-jest "^24.1.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^23.4.0" - jest-environment-node "^23.4.0" - jest-get-type "^22.1.0" - jest-jasmine2 "^23.5.0" - jest-regex-util "^23.3.0" - jest-resolve "^23.5.0" - jest-util "^23.4.0" - jest-validate "^23.5.0" - micromatch "^2.3.11" - pretty-format "^23.5.0" - -jest-diff@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.5.0.tgz#250651a433dd0050290a07642946cc9baaf06fba" + jest-environment-jsdom "^24.0.0" + jest-environment-node "^24.0.0" + jest-get-type "^24.0.0" + jest-jasmine2 "^24.1.0" + jest-regex-util "^24.0.0" + jest-resolve "^24.1.0" + jest-util "^24.0.0" + jest-validate "^24.0.0" + micromatch "^3.1.10" + pretty-format "^24.0.0" + realpath-native "^1.0.2" + +jest-diff@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.0.0.tgz#a3e5f573dbac482f7d9513ac9cfa21644d3d6b34" dependencies: chalk "^2.0.1" - diff "^3.2.0" - jest-get-type "^22.1.0" - pretty-format "^23.5.0" + diff-sequences "^24.0.0" + jest-get-type "^24.0.0" + pretty-format "^24.0.0" -jest-docblock@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" +jest-docblock@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.0.0.tgz#54d77a188743e37f62181a91a01eb9222289f94e" dependencies: detect-newline "^2.1.0" -jest-each@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.5.0.tgz#77f7e2afe6132a80954b920006e78239862b10ba" +jest-each@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.0.0.tgz#10987a06b21c7ffbfb7706c89d24c52ed864be55" dependencies: chalk "^2.0.1" - pretty-format "^23.5.0" + jest-get-type "^24.0.0" + jest-util "^24.0.0" + pretty-format "^24.0.0" -jest-environment-jsdom@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" +jest-environment-jsdom@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0.tgz#5affa0654d6e44cd798003daa1a8701dbd6e4d11" dependencies: - jest-mock "^23.2.0" - jest-util "^23.4.0" + jest-mock "^24.0.0" + jest-util "^24.0.0" jsdom "^11.5.1" -jest-environment-node@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" +jest-environment-node@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.0.0.tgz#330948980656ed8773ce2e04eb597ed91e3c7190" dependencies: - jest-mock "^23.2.0" - jest-util "^23.4.0" + jest-mock "^24.0.0" + jest-util "^24.0.0" jest-get-type@^22.1.0: version "22.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" -jest-haste-map@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.5.0.tgz#d4ca618188bd38caa6cb20349ce6610e194a8065" +jest-get-type@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0.tgz#36e72930b78e33da59a4f63d44d332188278940b" + +jest-haste-map@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0.tgz#e9ef51b2c9257384b4d6beb83bd48c65b37b5e6e" dependencies: fb-watchman "^2.0.0" - graceful-fs "^4.1.11" + graceful-fs "^4.1.15" invariant "^2.2.4" - jest-docblock "^23.2.0" - jest-serializer "^23.0.1" - jest-worker "^23.2.0" - micromatch "^2.3.11" - sane "^2.0.0" + jest-serializer "^24.0.0" + jest-util "^24.0.0" + jest-worker "^24.0.0" + micromatch "^3.1.10" + sane "^3.0.0" -jest-jasmine2@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.5.0.tgz#05fe7f1788e650eeb5a03929e6461ea2e9f3db53" +jest-jasmine2@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.1.0.tgz#8377324b967037c440f0a549ee0bbd9912055db6" dependencies: - babel-traverse "^6.0.0" + "@babel/traverse" "^7.1.0" chalk "^2.0.1" co "^4.6.0" - expect "^23.5.0" - is-generator-fn "^1.0.0" - jest-diff "^23.5.0" - jest-each "^23.5.0" - jest-matcher-utils "^23.5.0" - jest-message-util "^23.4.0" - jest-snapshot "^23.5.0" - jest-util "^23.4.0" - pretty-format "^23.5.0" - -jest-leak-detector@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.5.0.tgz#14ac2a785bd625160a2ea968fd5d98b7dcea3e64" - dependencies: - pretty-format "^23.5.0" - -jest-matcher-utils@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.5.0.tgz#0e2ea67744cab78c9ab15011c4d888bdd3e49e2a" + expect "^24.1.0" + is-generator-fn "^2.0.0" + jest-each "^24.0.0" + jest-matcher-utils "^24.0.0" + jest-message-util "^24.0.0" + jest-snapshot "^24.1.0" + jest-util "^24.0.0" + pretty-format "^24.0.0" + throat "^4.0.0" + +jest-leak-detector@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.0.0.tgz#78280119fd05ee98317daee62cddb3aa537a31c6" + dependencies: + pretty-format "^24.0.0" + +jest-matcher-utils@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.0.0.tgz#fc9c41cfc49b2c3ec14e576f53d519c37729d579" dependencies: chalk "^2.0.1" - jest-get-type "^22.1.0" - pretty-format "^23.5.0" + jest-diff "^24.0.0" + jest-get-type "^24.0.0" + pretty-format "^24.0.0" -jest-message-util@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" +jest-message-util@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.0.0.tgz#a07a141433b2c992dbaec68d4cbfe470ba289619" dependencies: - "@babel/code-frame" "^7.0.0-beta.35" + "@babel/code-frame" "^7.0.0" chalk "^2.0.1" - micromatch "^2.3.11" - slash "^1.0.0" + micromatch "^3.1.10" + slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" +jest-mock@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.0.0.tgz#9a4b53e01d66a0e780f7d857462d063e024c617d" -jest-regex-util@^23.3.0: - version "23.3.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" +jest-regex-util@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.0.0.tgz#4feee8ec4a358f5bee0a654e94eb26163cb9089a" -jest-resolve-dependencies@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.5.0.tgz#10c4d135beb9d2256de1fedc7094916c3ad74af7" +jest-resolve-dependencies@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.1.0.tgz#78f738a2ec59ff4d00751d9da56f176e3f589f6c" dependencies: - jest-regex-util "^23.3.0" - jest-snapshot "^23.5.0" + jest-regex-util "^24.0.0" + jest-snapshot "^24.1.0" -jest-resolve@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.5.0.tgz#3b8e7f67e84598f0caf63d1530bd8534a189d0e6" +jest-resolve@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.1.0.tgz#42ff0169b0ea47bfdbd0c52a0067ca7d022c7688" dependencies: browser-resolve "^1.11.3" chalk "^2.0.1" realpath-native "^1.0.0" -jest-runner@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.5.0.tgz#570f7a044da91648b5bb9b6baacdd511076c71d7" +jest-runner@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.1.0.tgz#3686a2bb89ce62800da23d7fdc3da2c32792943b" dependencies: + chalk "^2.4.2" exit "^0.1.2" - graceful-fs "^4.1.11" - jest-config "^23.5.0" - jest-docblock "^23.2.0" - jest-haste-map "^23.5.0" - jest-jasmine2 "^23.5.0" - jest-leak-detector "^23.5.0" - jest-message-util "^23.4.0" - jest-runtime "^23.5.0" - jest-util "^23.4.0" - jest-worker "^23.2.0" + graceful-fs "^4.1.15" + jest-config "^24.1.0" + jest-docblock "^24.0.0" + jest-haste-map "^24.0.0" + jest-jasmine2 "^24.1.0" + jest-leak-detector "^24.0.0" + jest-message-util "^24.0.0" + jest-runtime "^24.1.0" + jest-util "^24.0.0" + jest-worker "^24.0.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.5.0.tgz#eb503525a196dc32f2f9974e3482d26bdf7b63ce" +jest-runtime@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.1.0.tgz#7c157a2e776609e8cf552f956a5a19ec9c985214" dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^4.1.6" + "@babel/core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" chalk "^2.0.1" convert-source-map "^1.4.0" exit "^0.1.2" fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.11" - jest-config "^23.5.0" - jest-haste-map "^23.5.0" - jest-message-util "^23.4.0" - jest-regex-util "^23.3.0" - jest-resolve "^23.5.0" - jest-snapshot "^23.5.0" - jest-util "^23.4.0" - jest-validate "^23.5.0" - micromatch "^2.3.11" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.1.0" + jest-haste-map "^24.0.0" + jest-message-util "^24.0.0" + jest-regex-util "^24.0.0" + jest-resolve "^24.1.0" + jest-snapshot "^24.1.0" + jest-util "^24.0.0" + jest-validate "^24.0.0" + micromatch "^3.1.10" realpath-native "^1.0.0" - slash "^1.0.0" - strip-bom "3.0.0" - write-file-atomic "^2.1.0" - yargs "^11.0.0" + slash "^2.0.0" + strip-bom "^3.0.0" + write-file-atomic "2.4.1" + yargs "^12.0.2" jest-serializer-vue@^1.0.0: version "1.0.0" @@ -5820,36 +5741,36 @@ jest-serializer-vue@^1.0.0: dependencies: pretty "2.0.0" -jest-serializer@^23.0.1: - version "23.0.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" +jest-serializer@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0.tgz#522c44a332cdd194d8c0531eb06a1ee5afb4256b" -jest-snapshot@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.5.0.tgz#cc368ebd8513e1175e2a7277f37a801b7358ae79" +jest-snapshot@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.1.0.tgz#85e22f810357aa5994ab61f236617dc2205f2f5b" dependencies: - babel-types "^6.0.0" + "@babel/types" "^7.0.0" chalk "^2.0.1" - jest-diff "^23.5.0" - jest-matcher-utils "^23.5.0" - jest-message-util "^23.4.0" - jest-resolve "^23.5.0" + jest-diff "^24.0.0" + jest-matcher-utils "^24.0.0" + jest-message-util "^24.0.0" + jest-resolve "^24.1.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^23.5.0" + pretty-format "^24.0.0" semver "^5.5.0" -jest-util@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" +jest-util@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.0.0.tgz#fd38fcafd6dedbd0af2944d7a227c0d91b68f7d6" dependencies: - callsites "^2.0.0" + callsites "^3.0.0" chalk "^2.0.1" - graceful-fs "^4.1.11" - is-ci "^1.0.10" - jest-message-util "^23.4.0" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + jest-message-util "^24.0.0" mkdirp "^0.5.1" - slash "^1.0.0" + slash "^2.0.0" source-map "^0.6.0" jest-validate@^23.0.0: @@ -5861,35 +5782,38 @@ jest-validate@^23.0.0: leven "^2.1.0" pretty-format "^23.0.1" -jest-validate@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.5.0.tgz#f5df8f761cf43155e1b2e21d6e9de8a2852d0231" +jest-validate@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.0.0.tgz#aa8571a46983a6538328fef20406b4a496b6c020" dependencies: + camelcase "^5.0.0" chalk "^2.0.1" - jest-get-type "^22.1.0" + jest-get-type "^24.0.0" leven "^2.1.0" - pretty-format "^23.5.0" + pretty-format "^24.0.0" -jest-watcher@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" +jest-watcher@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.0.0.tgz#20d44244d10b0b7312410aefd256c1c1eef68890" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" + jest-util "^24.0.0" string-length "^2.0.0" -jest-worker@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" +jest-worker@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.0.0.tgz#3d3483b077bf04f412f47654a27bba7e947f8b6d" dependencies: merge-stream "^1.0.1" + supports-color "^6.1.0" -jest@^23.4.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-23.5.0.tgz#80de353d156ea5ea4a7332f7962ac79135fbc62e" +jest@^24.1.0: + version "24.1.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.1.0.tgz#b1e1135caefcf2397950ecf7f90e395fde866fd2" dependencies: - import-local "^1.0.0" - jest-cli "^23.5.0" + import-local "^2.0.0" + jest-cli "^24.1.0" joi@^11.1.1: version "11.4.0" @@ -5924,13 +5848,20 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-yaml@^3.11.0, js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1: +js-yaml@^3.11.0, js-yaml@^3.9.0, js-yaml@^3.9.1: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.12.0: + version "3.12.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.2.tgz#ef1d067c5a9d9cb65bd72f285b5d8105c77f14fc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + js-yaml@~3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" @@ -5973,10 +5904,6 @@ jsdom@^11.5.1: ws "^5.2.0" xml-name-validator "^3.0.0" -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - jsesc@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" @@ -6013,7 +5940,7 @@ json3@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" -json5@2.x: +json5@2.x, json5@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" dependencies: @@ -6066,9 +5993,9 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" -kleur@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.1.tgz#7cc64b0d188d0dcbc98bdcdfdda2cc10619ddce8" +kleur@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.2.tgz#83c7ec858a41098b613d5998a7b653962b504f68" last-call-webpack-plugin@^3.0.0: version "3.0.0" @@ -6081,12 +6008,6 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - lcid@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" @@ -6416,6 +6337,10 @@ lodash@4.x, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lod version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" @@ -6502,7 +6427,7 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -make-dir@^1.0.0: +make-dir@^1.0.0, make-dir@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" dependencies: @@ -6594,10 +6519,6 @@ math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - md5.js@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" @@ -6617,12 +6538,6 @@ medium-zoom@^0.4.0: version "0.4.0" resolved "http://registry.npmjs.org/medium-zoom/-/medium-zoom-0.4.0.tgz#8e13c9b754903c0c903220611af0d3cd373a4222" -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - dependencies: - mimic-fn "^1.0.0" - mem@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/mem/-/mem-4.0.0.tgz#6437690d9471678f6cc83659c00cbafcd6b0cdaf" @@ -6695,24 +6610,6 @@ methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" -micromatch@^2.3.11: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8, micromatch@^3.1.9: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -7067,6 +6964,10 @@ node-libs-browser@^2.0.0: util "^0.10.3" vm-browserify "0.0.4" +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + node-notifier@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" @@ -7129,7 +7030,7 @@ normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" -normalize-path@^2.0.1, normalize-path@^2.1.1: +normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -7316,13 +7217,6 @@ object.getownpropertydescriptors@^2.0.3: define-properties "^1.1.2" es-abstract "^1.5.1" -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -7413,14 +7307,6 @@ os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - os-locale@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.0.1.tgz#3b014fbf01d87f60a1e5348d80fe870dc82c4620" @@ -7429,7 +7315,7 @@ os-locale@^3.0.0: lcid "^2.0.0" mem "^4.0.0" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -7444,6 +7330,12 @@ p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + dependencies: + p-reduce "^1.0.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -7572,15 +7464,6 @@ parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -7624,7 +7507,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -7690,6 +7573,12 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pirates@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + dependencies: + node-modules-regexp "^1.0.0" + pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -8021,10 +7910,6 @@ prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - prettier@^1.13.7: version "1.13.7" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" @@ -8047,11 +7932,11 @@ pretty-format@^23.0.1: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -pretty-format@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.5.0.tgz#0f9601ad9da70fe690a269cd3efca732c210687c" +pretty-format@^24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.0.0.tgz#cb6599fd73ac088e37ed682f61291e4678f48591" dependencies: - ansi-regex "^3.0.0" + ansi-regex "^4.0.0" ansi-styles "^3.2.0" pretty-time@^1.0.0: @@ -8075,7 +7960,7 @@ prismjs@^1.13.0: optionalDependencies: clipboard "^2.0.0" -private@^0.1.6, private@^0.1.8: +private@^0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -8106,12 +7991,12 @@ promise-retry@^1.1.1: err-code "^1.0.0" retry "^0.10.0" -prompts@^0.1.9: - version "0.1.13" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.13.tgz#7fad7ee1c6cafe49834ca0b2a6a471262de57620" +prompts@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.3.tgz#c5ccb324010b2e8f74752aadceeb57134c1d2522" dependencies: - kleur "^2.0.1" - sisteransi "^0.1.1" + kleur "^3.0.2" + sisteransi "^1.0.0" promzard@^0.3.0: version "0.3.0" @@ -8223,14 +8108,6 @@ quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" -randomatic@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" @@ -8313,6 +8190,13 @@ read-pkg-up@^3.0.0: find-up "^2.0.0" read-pkg "^3.0.0" +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -8388,6 +8272,12 @@ realpath-native@^1.0.0: dependencies: util.promisify "^1.0.0" +realpath-native@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + dependencies: + util.promisify "^1.0.0" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -8446,12 +8336,6 @@ regenerator-transform@^0.13.3: dependencies: private "^0.1.6" -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -8725,13 +8609,14 @@ safe-regex@^1.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" -sane@^2.0.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" +sane@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-3.1.0.tgz#995193b7dc1445ef1fe41ddfca2faf9f111854c6" dependencies: anymatch "^2.0.0" capture-exit "^1.2.0" exec-sh "^0.2.0" + execa "^1.0.0" fb-watchman "^2.0.0" micromatch "^3.1.4" minimist "^1.1.1" @@ -8906,14 +8791,18 @@ 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" -sisteransi@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -9017,12 +8906,6 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.1: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - dependencies: - source-map "^0.5.6" - source-map-support@^0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" @@ -9044,7 +8927,7 @@ source-map@0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: +source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -9281,20 +9164,26 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" + dependencies: + ansi-regex "^4.0.0" + strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" -strip-bom@3.0.0, strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" dependencies: is-utf8 "^0.2.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -9345,7 +9234,7 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.2, supports-color@^3.2.3: +supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -9363,6 +9252,12 @@ supports-color@^5.3.0, supports-color@^5.4.0: dependencies: has-flag "^3.0.0" +supports-color@^6.0.0, supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + dependencies: + has-flag "^3.0.0" + svgo@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" @@ -9463,14 +9358,13 @@ tempfile@^1.1.1: os-tmpdir "^1.0.0" uuid "^2.0.1" -test-exclude@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" +test-exclude@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" dependencies: arrify "^1.0.1" - micromatch "^3.1.8" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" require-main-filename "^1.0.1" text-extensions@^1.0.0: @@ -9696,6 +9590,13 @@ uglify-js@^2.6: optionalDependencies: uglify-to-browserify "~1.0.0" +uglify-js@^3.1.4: + version "3.4.9" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" @@ -9934,9 +9835,9 @@ vue-hot-reload-api@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.0.tgz#97976142405d13d8efae154749e88c4e358cf926" -vue-jest@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/vue-jest/-/vue-jest-2.6.0.tgz#23dc99a4dce0bb59fea3946e1317b234968cf12a" +vue-jest@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/vue-jest/-/vue-jest-3.0.3.tgz#80f664712f2678b1d8bb3af0f2c0bef5efa8de31" dependencies: babel-plugin-transform-es2015-modules-commonjs "^6.26.0" chalk "^2.1.0" @@ -10389,7 +10290,15 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" dependencies: @@ -10439,10 +10348,6 @@ xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - "y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" @@ -10468,12 +10373,6 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - dependencies: - camelcase "^4.1.0" - yargs@12.0.2: version "12.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc" @@ -10491,24 +10390,7 @@ yargs@12.0.2: y18n "^3.2.1 || ^4.0.0" yargs-parser "^10.1.0" -yargs@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^9.0.2" - -yargs@^12.0.1: +yargs@^12.0.1, yargs@^12.0.2: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" dependencies: From 0fa43475958afeecf756c73960049abfeea61a1e Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 3 Mar 2019 18:01:37 +0800 Subject: [PATCH 02/20] chore: don't know why I need it... --- packages/@vuepress/shared-utils/src/parseFrontmatter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@vuepress/shared-utils/src/parseFrontmatter.ts b/packages/@vuepress/shared-utils/src/parseFrontmatter.ts index 10f98b28f8..4d520f5f73 100644 --- a/packages/@vuepress/shared-utils/src/parseFrontmatter.ts +++ b/packages/@vuepress/shared-utils/src/parseFrontmatter.ts @@ -1,7 +1,7 @@ -export = function parseFrontmatter (content: string) { - const matter = require('gray-matter') - const toml = require('toml') +const matter = require('gray-matter') +const toml = require('toml') +export = function parseFrontmatter (content: string) { return matter(content, { excerpt_separator: '', engines: { From a77287166e73f46dfa43f57aea9dd3fe3fe9ebb3 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 3 Mar 2019 18:24:32 +0800 Subject: [PATCH 03/20] refactor($core): simplify prepare api --- packages/@vuepress/core/lib/build.js | 16 +++++++------- packages/@vuepress/core/lib/dev.js | 17 ++++++++------- .../@vuepress/core/lib/prepare/AppContext.js | 21 ++++++++++--------- .../@vuepress/core/lib/prepare/CacheLoader.js | 6 +++--- packages/@vuepress/core/lib/prepare/index.js | 4 ++-- .../@vuepress/core/lib/prepare/loadTheme.js | 4 ++-- .../core/lib/webpack/createBaseConfig.js | 2 +- 7 files changed, 36 insertions(+), 34 deletions(-) diff --git a/packages/@vuepress/core/lib/build.js b/packages/@vuepress/core/lib/build.js index 23e49bbc96..a48ae5f3f2 100644 --- a/packages/@vuepress/core/lib/build.js +++ b/packages/@vuepress/core/lib/build.js @@ -1,6 +1,6 @@ 'use strict' -module.exports = async function build (sourceDir, cliOptions = {}) { +module.exports = async function build (sourceDir, options = {}) { process.env.NODE_ENV = 'production' const webpack = require('webpack') @@ -15,7 +15,7 @@ module.exports = async function build (sourceDir, cliOptions = {}) { const { normalizeHeadTag, applyUserWebpackConfig } = require('./util/index') logger.wait('Extracting site metadata...') - const ctx = await prepare(sourceDir, cliOptions, true /* isProd */) + const ctx = await prepare(sourceDir, { ...options, isProd: true }) const { outDir, cwd } = ctx if (cwd === outDir) { @@ -25,8 +25,8 @@ module.exports = async function build (sourceDir, cliOptions = {}) { await fs.emptyDir(outDir) logger.debug('Dist directory: ' + chalk.gray(outDir)) - let clientConfig = createClientConfig(ctx, cliOptions).toConfig() - let serverConfig = createServerConfig(ctx, cliOptions).toConfig() + let clientConfig = createClientConfig(ctx, options).toConfig() + let serverConfig = createServerConfig(ctx, options).toConfig() // apply user config... const userConfig = ctx.siteConfig.configureWebpack @@ -47,10 +47,10 @@ module.exports = async function build (sourceDir, cliOptions = {}) { // find and remove empty style chunk caused by // https://github.com/webpack-contrib/mini-css-extract-plugin/issues/85 // TODO remove when it's fixed - if (!clientConfig.devtool && (!clientConfig.plugins || - !clientConfig.plugins.some(p => - p instanceof webpack.SourceMapDevToolPlugin || - p instanceof webpack.EvalSourceMapDevToolPlugin + if (!clientConfig.devtool && (!clientConfig.plugins + || !clientConfig.plugins.some(p => + p instanceof webpack.SourceMapDevToolPlugin + || p instanceof webpack.EvalSourceMapDevToolPlugin ))) { await workaroundEmptyStyleChunk() } diff --git a/packages/@vuepress/core/lib/dev.js b/packages/@vuepress/core/lib/dev.js index c0b728c0e9..12bbcff9a7 100644 --- a/packages/@vuepress/core/lib/dev.js +++ b/packages/@vuepress/core/lib/dev.js @@ -1,7 +1,7 @@ 'use strict' -module.exports = async (sourceDir, cliOptions = {}, ctx) => { - const { server, host, port } = await prepareServer(sourceDir, cliOptions, ctx) +module.exports = async (sourceDir, options = {}, ctx) => { + const { server, host, port } = await prepareServer(sourceDir, options, ctx) server.listen(port, host, err => { if (err) { console.log(err) @@ -11,7 +11,7 @@ module.exports = async (sourceDir, cliOptions = {}, ctx) => { module.exports.prepare = prepareServer -async function prepareServer (sourceDir, cliOptions = {}, context) { +async function prepareServer (sourceDir, options = {}, context) { const WebpackDevServer = require('webpack-dev-server') const { path } = require('@vuepress/shared-utils') const webpack = require('webpack') @@ -25,13 +25,14 @@ async function prepareServer (sourceDir, cliOptions = {}, context) { const { applyUserWebpackConfig } = require('./util/index') const { frontmatterEmitter } = require('@vuepress/markdown-loader') - const ctx = context || await prepare(sourceDir, cliOptions, false /* isProd */) + options = { ...options, isProd: false } + const ctx = context || await prepare(sourceDir, options) // setup watchers to update options and dynamically generated files const update = (reason) => { console.log(`Reload due to ${reason}`) ctx.pluginAPI.options.updated.syncApply() - prepare(sourceDir, cliOptions, false /* isProd */).catch(err => { + prepare(sourceDir, options).catch(err => { console.error(logger.error(chalk.red(err.stack), false)) }) } @@ -97,8 +98,8 @@ async function prepareServer (sourceDir, cliOptions = {}, context) { tags: ctx.siteConfig.head || [] }]) - const port = await resolvePort(cliOptions.port || ctx.siteConfig.port) - const { host, displayHost } = await resolveHost(cliOptions.host || ctx.siteConfig.host) + const port = await resolvePort(options.port || ctx.siteConfig.port) + const { host, displayHost } = await resolveHost(options.host || ctx.siteConfig.host) // debug in a running dev process. process.stdin @@ -137,7 +138,7 @@ async function prepareServer (sourceDir, cliOptions = {}, context) { headers: { 'access-control-allow-origin': '*' }, - open: cliOptions.open, + open: options.open, publicPath: ctx.base, watchOptions: { ignored: [ diff --git a/packages/@vuepress/core/lib/prepare/AppContext.js b/packages/@vuepress/core/lib/prepare/AppContext.js index e7d71bb51a..9c23daec57 100755 --- a/packages/@vuepress/core/lib/prepare/AppContext.js +++ b/packages/@vuepress/core/lib/prepare/AppContext.js @@ -42,13 +42,13 @@ module.exports = class AppContext { * }} options */ - constructor (sourceDir, cliOptions = {}, isProd) { + constructor (sourceDir, options = {}) { logger.debug('sourceDir', sourceDir) this.sourceDir = sourceDir - this.cliOptions = cliOptions - this.isProd = isProd + this.options = options + this.isProd = this.options.isProd - const { tempPath, writeTemp } = createTemp(cliOptions.temp) + const { tempPath, writeTemp } = createTemp(options.temp) this.tempPath = tempPath this.writeTemp = writeTemp @@ -63,10 +63,11 @@ module.exports = class AppContext { */ resolveConfigAndInitialize () { - this.siteConfig = loadConfig(this.vuepressDir) - if (isFunction(this.siteConfig)) { - this.siteConfig = this.siteConfig(this) + let siteConfig = loadConfig(this.vuepressDir) + if (isFunction(siteConfig)) { + siteConfig = siteConfig(this) } + this.siteConfig = siteConfig // TODO custom cwd. this.cwd = process.cwd() @@ -74,7 +75,7 @@ module.exports = class AppContext { this.base = this.siteConfig.base || '/' this.themeConfig = this.siteConfig.themeConfig || {} - const rawOutDir = this.cliOptions.dest || this.siteConfig.dest + const rawOutDir = this.options.dest || this.siteConfig.dest this.outDir = rawOutDir ? require('path').resolve(this.cwd, rawOutDir) : require('path').resolve(this.sourceDir, '.vuepress/dist') @@ -176,7 +177,7 @@ module.exports = class AppContext { */ applyUserPlugins () { - this.pluginAPI.useByPluginsConfig(this.cliOptions.plugins) + this.pluginAPI.useByPluginsConfig(this.options.plugins) if (this.themeAPI.existsParentTheme) { this.pluginAPI.use(this.themeAPI.parentTheme.entry) } @@ -215,7 +216,7 @@ module.exports = class AppContext { */ resolveCacheLoaderOptions () { - Object.assign(this, (getCacheLoaderOptions(this.siteConfig, this.cliOptions, this.cwd, this.isProd))) + Object.assign(this, (getCacheLoaderOptions(this.siteConfig, this.options, this.cwd, this.isProd))) } /** diff --git a/packages/@vuepress/core/lib/prepare/CacheLoader.js b/packages/@vuepress/core/lib/prepare/CacheLoader.js index 7d10291463..77f8d6d723 100644 --- a/packages/@vuepress/core/lib/prepare/CacheLoader.js +++ b/packages/@vuepress/core/lib/prepare/CacheLoader.js @@ -12,12 +12,12 @@ const { /** * Get cache directory and cache identifier via config. * @param {object} siteConfig - * @param {object} cliOptions + * @param {object} options */ -exports.getCacheLoaderOptions = function (siteConfig, cliOptions, cwd, isProd) { +exports.getCacheLoaderOptions = function (siteConfig, options, cwd, isProd) { const defaultCacheDirectory = path.resolve(__dirname, '../../node_modules/.cache/vuepress') - let cache = cliOptions.cache || siteConfig.cache || defaultCacheDirectory + let cache = options.cache || siteConfig.cache || defaultCacheDirectory if (isBoolean(cache)) { if (cache === true) { diff --git a/packages/@vuepress/core/lib/prepare/index.js b/packages/@vuepress/core/lib/prepare/index.js index 7771f65f00..4a177c7b26 100644 --- a/packages/@vuepress/core/lib/prepare/index.js +++ b/packages/@vuepress/core/lib/prepare/index.js @@ -11,9 +11,9 @@ const { logger } = require('@vuepress/shared-utils') * Expose prepare. */ -module.exports = async function prepare (sourceDir, cliOptions, isProd) { +module.exports = async function prepare (sourceDir, options) { logger.wait('Extracting site metadata...') - const appContext = AppContext.getInstance(sourceDir, cliOptions, isProd) + const appContext = AppContext.getInstance(sourceDir, options) await appContext.process() return appContext } diff --git a/packages/@vuepress/core/lib/prepare/loadTheme.js b/packages/@vuepress/core/lib/prepare/loadTheme.js index 4092238adc..53e42df613 100755 --- a/packages/@vuepress/core/lib/prepare/loadTheme.js +++ b/packages/@vuepress/core/lib/prepare/loadTheme.js @@ -73,9 +73,9 @@ function normalizeThemePath (resolved) { } function resolveTheme (ctx, resolver, ignoreLocal, theme) { - const { siteConfig, cliOptions, sourceDir, vuepressDir, pluginAPI } = ctx + const { siteConfig, options, sourceDir, vuepressDir, pluginAPI } = ctx const localThemePath = resolve(vuepressDir, 'theme') - theme = theme || siteConfig.theme || cliOptions.theme + theme = theme || siteConfig.theme || options.theme let path let name diff --git a/packages/@vuepress/core/lib/webpack/createBaseConfig.js b/packages/@vuepress/core/lib/webpack/createBaseConfig.js index bf79b2072f..caea43b21b 100644 --- a/packages/@vuepress/core/lib/webpack/createBaseConfig.js +++ b/packages/@vuepress/core/lib/webpack/createBaseConfig.js @@ -19,7 +19,7 @@ module.exports = function createBaseConfig ({ tempPath, cacheDirectory, cacheIdentifier, - cliOptions: { + options: { cache }, pluginAPI From a734ef50c0114feb5430050f5e4bc9e0a51264d6 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 3 Mar 2019 18:46:03 +0800 Subject: [PATCH 04/20] refactor: continue to simplify prepare api --- packages/@vuepress/core/lib/build.js | 2 +- packages/@vuepress/core/lib/dev.js | 14 ++++++------- .../@vuepress/core/lib/prepare/AppContext.js | 20 +++++++++++-------- .../lib/prepare/docs.fallback.js/README.md | 3 +++ packages/@vuepress/core/lib/prepare/index.js | 4 ++-- packages/vuepress/lib/handleUnknownCommand.js | 2 +- 6 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md diff --git a/packages/@vuepress/core/lib/build.js b/packages/@vuepress/core/lib/build.js index a48ae5f3f2..fa89ec6049 100644 --- a/packages/@vuepress/core/lib/build.js +++ b/packages/@vuepress/core/lib/build.js @@ -15,7 +15,7 @@ module.exports = async function build (sourceDir, options = {}) { const { normalizeHeadTag, applyUserWebpackConfig } = require('./util/index') logger.wait('Extracting site metadata...') - const ctx = await prepare(sourceDir, { ...options, isProd: true }) + const ctx = await prepare({ sourceDir, isProd: true, ...options }) const { outDir, cwd } = ctx if (cwd === outDir) { diff --git a/packages/@vuepress/core/lib/dev.js b/packages/@vuepress/core/lib/dev.js index 12bbcff9a7..dc8f4db24e 100644 --- a/packages/@vuepress/core/lib/dev.js +++ b/packages/@vuepress/core/lib/dev.js @@ -25,21 +25,21 @@ async function prepareServer (sourceDir, options = {}, context) { const { applyUserWebpackConfig } = require('./util/index') const { frontmatterEmitter } = require('@vuepress/markdown-loader') - options = { ...options, isProd: false } - const ctx = context || await prepare(sourceDir, options) + options = { sourceDir, isProd: false, ...options } + const ctx = context || await prepare(options) // setup watchers to update options and dynamically generated files const update = (reason) => { console.log(`Reload due to ${reason}`) ctx.pluginAPI.options.updated.syncApply() - prepare(sourceDir, options).catch(err => { + prepare(ctx.sourceDir, options).catch(err => { console.error(logger.error(chalk.red(err.stack), false)) }) } // Curry update handler by update type const spawnUpdate = updateType => file => { - const target = path.join(sourceDir, file) + const target = path.join(ctx.sourceDir, file) // Bust cache. delete require.cache[target] update(`${chalk.red(updateType)} ${chalk.cyan(file)}`) @@ -50,7 +50,7 @@ async function prepareServer (sourceDir, options = {}, context) { '**/*.md', '.vuepress/components/**/*.vue' ], { - cwd: sourceDir, + cwd: ctx.sourceDir, ignored: ['.vuepress/**/*.md', 'node_modules'], ignoreInitial: true }) @@ -73,7 +73,7 @@ async function prepareServer (sourceDir, options = {}, context) { // watch config file const configWatcher = chokidar.watch(watchFiles, { - cwd: sourceDir, + cwd: ctx.sourceDir, ignoreInitial: true }) configWatcher.on('change', spawnUpdate('change')) @@ -127,7 +127,7 @@ async function prepareServer (sourceDir, options = {}, context) { config = applyUserWebpackConfig(userConfig, config, false /* isServer */) } - const contentBase = path.resolve(sourceDir, '.vuepress/public') + const contentBase = path.resolve(ctx.sourceDir, '.vuepress/public') const serverConfig = Object.assign({ disableHostCheck: true, diff --git a/packages/@vuepress/core/lib/prepare/AppContext.js b/packages/@vuepress/core/lib/prepare/AppContext.js index 9c23daec57..28a4686180 100755 --- a/packages/@vuepress/core/lib/prepare/AppContext.js +++ b/packages/@vuepress/core/lib/prepare/AppContext.js @@ -42,17 +42,17 @@ module.exports = class AppContext { * }} options */ - constructor (sourceDir, options = {}) { - logger.debug('sourceDir', sourceDir) - this.sourceDir = sourceDir + constructor (options = {}) { this.options = options + this.sourceDir = this.options.sourceDir || path.join(__dirname, 'docs.fallback') this.isProd = this.options.isProd + logger.debug('sourceDir', this.sourceDir) const { tempPath, writeTemp } = createTemp(options.temp) this.tempPath = tempPath this.writeTemp = writeTemp - this.vuepressDir = path.resolve(sourceDir, '.vuepress') + this.vuepressDir = path.resolve(this.sourceDir, '.vuepress') } /** @@ -63,11 +63,15 @@ module.exports = class AppContext { */ resolveConfigAndInitialize () { - let siteConfig = loadConfig(this.vuepressDir) - if (isFunction(siteConfig)) { - siteConfig = siteConfig(this) + if (this.options.siteConfig) { + this.siteConfig = this.options.siteConfig + } else { + let siteConfig = loadConfig(this.vuepressDir) + if (isFunction(siteConfig)) { + siteConfig = siteConfig(this) + } + this.siteConfig = siteConfig } - this.siteConfig = siteConfig // TODO custom cwd. this.cwd = process.cwd() diff --git a/packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md b/packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md new file mode 100644 index 0000000000..b9be8c25e3 --- /dev/null +++ b/packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md @@ -0,0 +1,3 @@ +# VuePress + +> Prompts: You are running VuePress without setting sourceDir! diff --git a/packages/@vuepress/core/lib/prepare/index.js b/packages/@vuepress/core/lib/prepare/index.js index 4a177c7b26..681a9eb278 100644 --- a/packages/@vuepress/core/lib/prepare/index.js +++ b/packages/@vuepress/core/lib/prepare/index.js @@ -11,9 +11,9 @@ const { logger } = require('@vuepress/shared-utils') * Expose prepare. */ -module.exports = async function prepare (sourceDir, options) { +module.exports = async function prepare (options) { logger.wait('Extracting site metadata...') - const appContext = AppContext.getInstance(sourceDir, options) + const appContext = AppContext.getInstance(options) await appContext.process() return appContext } diff --git a/packages/vuepress/lib/handleUnknownCommand.js b/packages/vuepress/lib/handleUnknownCommand.js index 937f70dd99..6c1330e2cf 100644 --- a/packages/vuepress/lib/handleUnknownCommand.js +++ b/packages/vuepress/lib/handleUnknownCommand.js @@ -38,7 +38,7 @@ module.exports = async function (cli, options) { logger.setOptions({ logLevel: 1 }) if (sourceDir) { - context = await prepare(sourceDir, options) + context = await prepare({ sourceDir, ...options }) context.pluginAPI.options.extendCli.apply(cli, context) } From 27f9f908aba89962174a2a032be8cfa036edc682 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 3 Mar 2019 18:53:03 +0800 Subject: [PATCH 05/20] chore: fix typo in dir name --- packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md | 3 --- packages/@vuepress/core/lib/prepare/docs.fallback/README.md | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md create mode 100644 packages/@vuepress/core/lib/prepare/docs.fallback/README.md diff --git a/packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md b/packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md deleted file mode 100644 index b9be8c25e3..0000000000 --- a/packages/@vuepress/core/lib/prepare/docs.fallback.js/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# VuePress - -> Prompts: You are running VuePress without setting sourceDir! diff --git a/packages/@vuepress/core/lib/prepare/docs.fallback/README.md b/packages/@vuepress/core/lib/prepare/docs.fallback/README.md new file mode 100644 index 0000000000..65c49006fd --- /dev/null +++ b/packages/@vuepress/core/lib/prepare/docs.fallback/README.md @@ -0,0 +1,3 @@ +# VuePress + +> `Prompts`: You are running VuePress without setting sourceDir! From a28d700d0e8d233f469d1b29a8ffa7eb195640a7 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Mon, 4 Mar 2019 01:11:23 +0800 Subject: [PATCH 06/20] feat($core): refine node.js api --- packages/@vuepress/core/lib/build.js | 197 ------------- .../@vuepress/core/lib/{app => client}/app.js | 0 .../core/lib/{app => client}/clientEntry.js | 0 .../{app => client}/components/ClientOnly.js | 0 .../lib/{app => client}/components/Content.js | 0 .../components/ContentSlotsDistributor.js | 0 .../components/GlobalLayout.vue | 0 .../{app => client}/components/HeaderList.vue | 0 .../{app => client}/components/NotFound.vue | 0 .../components/OutboundLink.vue | 0 .../lib/{app => client}/components/TOC.vue | 0 .../core/lib/{app => client}/dataMixin.js | 0 .../core/lib/{app => client}/index.dev.html | 0 .../core/lib/{app => client}/index.ssr.html | 0 .../lib/{app => client}/plugins/Store.d.ts | 0 .../core/lib/{app => client}/plugins/Store.js | 0 .../lib/{app => client}/plugins/VuePress.d.ts | 0 .../lib/{app => client}/plugins/VuePress.js | 0 .../core/lib/{app => client}/redirect.js | 0 .../{app => client}/root-mixins/updateMeta.js | 0 .../core/lib/{app => client}/serverEntry.js | 0 .../lib/{app => client}/style/config.styl | 0 .../core/lib/{app => client}/util.js | 0 packages/@vuepress/core/lib/dev.js | 208 ------------- packages/@vuepress/core/lib/index.js | 25 +- .../{prepare/AppContext.js => node/App.js} | 138 ++++----- .../core/lib/{prepare => node}/CacheLoader.js | 0 .../{prepare => node}/ClientComputedMixin.js | 0 .../core/lib/{prepare => node}/Page.js | 2 +- .../@vuepress/core/lib/node/build/index.js | 273 ++++++++++++++++++ .../lib/{prepare => node}/createMarkdown.js | 4 +- .../@vuepress/core/lib/node/createTemp.js | 42 +++ packages/@vuepress/core/lib/node/dev/index.js | 273 ++++++++++++++++++ .../{prepare => node}/docs.fallback/README.md | 0 .../internal-plugins/dataBlock/index.js | 0 .../internal-plugins/dataBlock/loader.js | 0 .../{ => node}/internal-plugins/enhanceApp.js | 0 .../frontmatterBlock/index.js | 0 .../frontmatterBlock/loader.js | 2 +- .../internal-plugins/layoutComponents.js | 0 .../internal-plugins/pageComponents.js | 0 .../internal-plugins/palette/index.js | 2 +- .../{ => node}/internal-plugins/rootMixins.js | 3 +- .../lib/{ => node}/internal-plugins/routes.js | 0 .../{ => node}/internal-plugins/siteData.js | 0 .../internal-plugins/style/client.js | 0 .../internal-plugins/style/index.js | 0 .../internal-plugins/transformModule.js | 2 +- .../core/lib/{prepare => node}/loadConfig.js | 0 .../core/lib/{prepare => node}/loadTheme.js | 3 +- .../plugin-api/abstract/AsyncOption.js | 0 .../{ => node}/plugin-api/abstract/Option.js | 0 .../lib/{ => node}/plugin-api/constants.js | 0 .../core/lib/{ => node}/plugin-api/index.js | 44 +++ .../plugin-api/override/AliasOption.js | 0 .../override/ClientDynamicModulesOption.js | 0 .../plugin-api/override/DefineOption.js | 0 .../override/EnhanceAppFilesOption.js | 0 .../override/GlobalUIComponentsOption.js | 0 .../plugin-api/override/instantiateOption.js | 0 .../core/lib/{ => node}/plugin-api/util.js | 0 .../{ => node}/theme-api/Layout.fallback.vue | 0 .../core/lib/{ => node}/theme-api/index.js | 2 +- .../core/lib/{ => node}/util/index.js | 0 .../lib/{ => node}/webpack/ClientPlugin.js | 0 .../lib/{ => node}/webpack/DevLogPlugin.js | 0 .../core/lib/{ => node}/webpack/HeadPlugin.js | 0 .../{ => node}/webpack/createBaseConfig.js | 48 +-- .../{ => node}/webpack/createClientConfig.js | 6 +- .../{ => node}/webpack/createServerConfig.js | 4 +- .../core/lib/{ => node}/webpack/noopModule.js | 0 packages/@vuepress/core/lib/prepare/index.js | 19 -- packages/vuepress/lib/handleUnknownCommand.js | 18 +- packages/vuepress/lib/registerCoreCommands.js | 6 +- 74 files changed, 784 insertions(+), 537 deletions(-) delete mode 100644 packages/@vuepress/core/lib/build.js rename packages/@vuepress/core/lib/{app => client}/app.js (100%) rename packages/@vuepress/core/lib/{app => client}/clientEntry.js (100%) rename packages/@vuepress/core/lib/{app => client}/components/ClientOnly.js (100%) rename packages/@vuepress/core/lib/{app => client}/components/Content.js (100%) rename packages/@vuepress/core/lib/{app => client}/components/ContentSlotsDistributor.js (100%) rename packages/@vuepress/core/lib/{app => client}/components/GlobalLayout.vue (100%) rename packages/@vuepress/core/lib/{app => client}/components/HeaderList.vue (100%) rename packages/@vuepress/core/lib/{app => client}/components/NotFound.vue (100%) rename packages/@vuepress/core/lib/{app => client}/components/OutboundLink.vue (100%) rename packages/@vuepress/core/lib/{app => client}/components/TOC.vue (100%) rename packages/@vuepress/core/lib/{app => client}/dataMixin.js (100%) rename packages/@vuepress/core/lib/{app => client}/index.dev.html (100%) rename packages/@vuepress/core/lib/{app => client}/index.ssr.html (100%) rename packages/@vuepress/core/lib/{app => client}/plugins/Store.d.ts (100%) rename packages/@vuepress/core/lib/{app => client}/plugins/Store.js (100%) rename packages/@vuepress/core/lib/{app => client}/plugins/VuePress.d.ts (100%) rename packages/@vuepress/core/lib/{app => client}/plugins/VuePress.js (100%) rename packages/@vuepress/core/lib/{app => client}/redirect.js (100%) rename packages/@vuepress/core/lib/{app => client}/root-mixins/updateMeta.js (100%) rename packages/@vuepress/core/lib/{app => client}/serverEntry.js (100%) rename packages/@vuepress/core/lib/{app => client}/style/config.styl (100%) rename packages/@vuepress/core/lib/{app => client}/util.js (100%) delete mode 100644 packages/@vuepress/core/lib/dev.js rename packages/@vuepress/core/lib/{prepare/AppContext.js => node/App.js} (79%) rename packages/@vuepress/core/lib/{prepare => node}/CacheLoader.js (100%) rename packages/@vuepress/core/lib/{prepare => node}/ClientComputedMixin.js (100%) rename packages/@vuepress/core/lib/{prepare => node}/Page.js (99%) create mode 100644 packages/@vuepress/core/lib/node/build/index.js rename packages/@vuepress/core/lib/{prepare => node}/createMarkdown.js (83%) create mode 100644 packages/@vuepress/core/lib/node/createTemp.js create mode 100644 packages/@vuepress/core/lib/node/dev/index.js rename packages/@vuepress/core/lib/{prepare => node}/docs.fallback/README.md (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/dataBlock/index.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/dataBlock/loader.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/enhanceApp.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/frontmatterBlock/index.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/frontmatterBlock/loader.js (94%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/layoutComponents.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/pageComponents.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/palette/index.js (95%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/rootMixins.js (81%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/routes.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/siteData.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/style/client.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/style/index.js (100%) rename packages/@vuepress/core/lib/{ => node}/internal-plugins/transformModule.js (90%) rename packages/@vuepress/core/lib/{prepare => node}/loadConfig.js (100%) rename packages/@vuepress/core/lib/{prepare => node}/loadTheme.js (98%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/abstract/AsyncOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/abstract/Option.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/constants.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/index.js (88%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/override/AliasOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/override/ClientDynamicModulesOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/override/DefineOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/override/EnhanceAppFilesOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/override/GlobalUIComponentsOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/override/instantiateOption.js (100%) rename packages/@vuepress/core/lib/{ => node}/plugin-api/util.js (100%) rename packages/@vuepress/core/lib/{ => node}/theme-api/Layout.fallback.vue (100%) rename packages/@vuepress/core/lib/{ => node}/theme-api/index.js (98%) rename packages/@vuepress/core/lib/{ => node}/util/index.js (100%) rename packages/@vuepress/core/lib/{ => node}/webpack/ClientPlugin.js (100%) rename packages/@vuepress/core/lib/{ => node}/webpack/DevLogPlugin.js (100%) rename packages/@vuepress/core/lib/{ => node}/webpack/HeadPlugin.js (100%) rename packages/@vuepress/core/lib/{ => node}/webpack/createBaseConfig.js (90%) rename packages/@vuepress/core/lib/{ => node}/webpack/createClientConfig.js (90%) rename packages/@vuepress/core/lib/{ => node}/webpack/createServerConfig.js (90%) rename packages/@vuepress/core/lib/{ => node}/webpack/noopModule.js (100%) delete mode 100644 packages/@vuepress/core/lib/prepare/index.js diff --git a/packages/@vuepress/core/lib/build.js b/packages/@vuepress/core/lib/build.js deleted file mode 100644 index fa89ec6049..0000000000 --- a/packages/@vuepress/core/lib/build.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict' - -module.exports = async function build (sourceDir, options = {}) { - process.env.NODE_ENV = 'production' - - const webpack = require('webpack') - const readline = require('readline') - const escape = require('escape-html') - - const { chalk, fs, path, logger, env, performance } = require('@vuepress/shared-utils') - const prepare = require('./prepare/index') - const createClientConfig = require('./webpack/createClientConfig') - const createServerConfig = require('./webpack/createServerConfig') - const { createBundleRenderer } = require('vue-server-renderer') - const { normalizeHeadTag, applyUserWebpackConfig } = require('./util/index') - - logger.wait('Extracting site metadata...') - const ctx = await prepare({ sourceDir, isProd: true, ...options }) - - const { outDir, cwd } = ctx - if (cwd === outDir) { - return console.error(logger.error(chalk.red('Unexpected option: outDir cannot be set to the current working directory.\n'), false)) - } - - await fs.emptyDir(outDir) - logger.debug('Dist directory: ' + chalk.gray(outDir)) - - let clientConfig = createClientConfig(ctx, options).toConfig() - let serverConfig = createServerConfig(ctx, options).toConfig() - - // apply user config... - const userConfig = ctx.siteConfig.configureWebpack - if (userConfig) { - clientConfig = applyUserWebpackConfig(userConfig, clientConfig, false) - serverConfig = applyUserWebpackConfig(userConfig, serverConfig, true) - } - - // compile! - const stats = await compile([clientConfig, serverConfig]) - - const serverBundle = require(path.resolve(outDir, 'manifest/server.json')) - const clientManifest = require(path.resolve(outDir, 'manifest/client.json')) - - // remove manifests after loading them. - await fs.remove(path.resolve(outDir, 'manifest')) - - // find and remove empty style chunk caused by - // https://github.com/webpack-contrib/mini-css-extract-plugin/issues/85 - // TODO remove when it's fixed - if (!clientConfig.devtool && (!clientConfig.plugins - || !clientConfig.plugins.some(p => - p instanceof webpack.SourceMapDevToolPlugin - || p instanceof webpack.EvalSourceMapDevToolPlugin - ))) { - await workaroundEmptyStyleChunk() - } - - // create server renderer using built manifests - const renderer = createBundleRenderer(serverBundle, { - clientManifest, - runInNewContext: false, - inject: false, - shouldPrefetch: ctx.siteConfig.shouldPrefetch || (() => true), - template: await fs.readFile(ctx.ssrTemplate, 'utf-8') - }) - - // pre-render head tags from user config - const userHeadTags = (ctx.siteConfig.head || []) - .map(renderHeadTag) - .join('\n ') - - // if the user does not have a custom 404.md, generate the theme's default - if (!ctx.pages.some(p => p.path === '/404.html')) { - ctx.addPage({ path: '/404.html' }) - } - - // render pages - logger.wait('Rendering static HTML...') - - const pagePaths = [] - for (const page of ctx.pages) { - pagePaths.push(await renderPage(page)) - } - - readline.clearLine(process.stdout, 0) - readline.cursorTo(process.stdout, 0) - - await ctx.pluginAPI.options.generated.apply(pagePaths) - - // DONE. - const relativeDir = path.relative(cwd, outDir) - logger.success(`Generated static files in ${chalk.cyan(relativeDir)}.`) - const { duration } = performance.stop() - logger.developer(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress build')}.`) - console.log() - - // --- helpers --- - - function compile (config) { - return new Promise((resolve, reject) => { - webpack(config, (err, stats) => { - if (err) { - return reject(err) - } - if (stats.hasErrors()) { - stats.toJson().errors.forEach(err => { - console.error(err) - }) - reject(new Error(`Failed to compile with errors.`)) - return - } - if (env.isDebug && stats.hasWarnings()) { - stats.toJson().warnings.forEach(warning => { - console.warn(warning) - }) - } - resolve(stats.toJson({ modules: false })) - }) - }) - } - - function renderHeadTag (tag) { - const { tagName, attributes, innerHTML, closeTag } = normalizeHeadTag(tag) - return `<${tagName}${renderAttrs(attributes)}>${innerHTML}${closeTag ? `` : ``}` - } - - function renderAttrs (attrs = {}) { - const keys = Object.keys(attrs) - if (keys.length) { - return ' ' + keys.map(name => `${name}="${escape(attrs[name])}"`).join(' ') - } else { - return '' - } - } - - async function renderPage (page) { - const pagePath = page.path - readline.clearLine(process.stdout, 0) - readline.cursorTo(process.stdout, 0) - process.stdout.write(`Rendering page: ${pagePath}`) - - // #565 Avoid duplicate description meta at SSR. - const meta = (page.frontmatter && page.frontmatter.meta || []).filter(item => item.name !== 'description') - const pageMeta = renderPageMeta(meta) - - const context = { - url: pagePath, - userHeadTags, - pageMeta, - title: 'VuePress', - lang: 'en', - description: '' - } - - let html - try { - html = await renderer.renderToString(context) - } catch (e) { - console.error(logger.error(chalk.red(`Error rendering ${pagePath}:`), false)) - throw e - } - const filename = decodeURIComponent(pagePath.replace(/\/$/, '/index.html').replace(/^\//, '')) - const filePath = path.resolve(outDir, filename) - await fs.ensureDir(path.dirname(filePath)) - await fs.writeFile(filePath, html) - return filePath - } - - function renderPageMeta (meta) { - if (!meta) return '' - return meta.map(m => { - let res = ` { - res += ` ${key}="${escape(m[key])}"` - }) - return res + `>` - }).join('') - } - - async function workaroundEmptyStyleChunk () { - const styleChunk = stats.children[0].assets.find(a => { - return /styles\.\w{8}\.js$/.test(a.name) - }) - if (!styleChunk) return - const styleChunkPath = path.resolve(outDir, styleChunk.name) - const styleChunkContent = await fs.readFile(styleChunkPath, 'utf-8') - await fs.remove(styleChunkPath) - // prepend it to app.js. - // this is necessary for the webpack runtime to work properly. - const appChunk = stats.children[0].assets.find(a => { - return /app\.\w{8}\.js$/.test(a.name) - }) - const appChunkPath = path.resolve(outDir, appChunk.name) - const appChunkContent = await fs.readFile(appChunkPath, 'utf-8') - await fs.writeFile(appChunkPath, styleChunkContent + appChunkContent) - } -} diff --git a/packages/@vuepress/core/lib/app/app.js b/packages/@vuepress/core/lib/client/app.js similarity index 100% rename from packages/@vuepress/core/lib/app/app.js rename to packages/@vuepress/core/lib/client/app.js diff --git a/packages/@vuepress/core/lib/app/clientEntry.js b/packages/@vuepress/core/lib/client/clientEntry.js similarity index 100% rename from packages/@vuepress/core/lib/app/clientEntry.js rename to packages/@vuepress/core/lib/client/clientEntry.js diff --git a/packages/@vuepress/core/lib/app/components/ClientOnly.js b/packages/@vuepress/core/lib/client/components/ClientOnly.js similarity index 100% rename from packages/@vuepress/core/lib/app/components/ClientOnly.js rename to packages/@vuepress/core/lib/client/components/ClientOnly.js diff --git a/packages/@vuepress/core/lib/app/components/Content.js b/packages/@vuepress/core/lib/client/components/Content.js similarity index 100% rename from packages/@vuepress/core/lib/app/components/Content.js rename to packages/@vuepress/core/lib/client/components/Content.js diff --git a/packages/@vuepress/core/lib/app/components/ContentSlotsDistributor.js b/packages/@vuepress/core/lib/client/components/ContentSlotsDistributor.js similarity index 100% rename from packages/@vuepress/core/lib/app/components/ContentSlotsDistributor.js rename to packages/@vuepress/core/lib/client/components/ContentSlotsDistributor.js diff --git a/packages/@vuepress/core/lib/app/components/GlobalLayout.vue b/packages/@vuepress/core/lib/client/components/GlobalLayout.vue similarity index 100% rename from packages/@vuepress/core/lib/app/components/GlobalLayout.vue rename to packages/@vuepress/core/lib/client/components/GlobalLayout.vue diff --git a/packages/@vuepress/core/lib/app/components/HeaderList.vue b/packages/@vuepress/core/lib/client/components/HeaderList.vue similarity index 100% rename from packages/@vuepress/core/lib/app/components/HeaderList.vue rename to packages/@vuepress/core/lib/client/components/HeaderList.vue diff --git a/packages/@vuepress/core/lib/app/components/NotFound.vue b/packages/@vuepress/core/lib/client/components/NotFound.vue similarity index 100% rename from packages/@vuepress/core/lib/app/components/NotFound.vue rename to packages/@vuepress/core/lib/client/components/NotFound.vue diff --git a/packages/@vuepress/core/lib/app/components/OutboundLink.vue b/packages/@vuepress/core/lib/client/components/OutboundLink.vue similarity index 100% rename from packages/@vuepress/core/lib/app/components/OutboundLink.vue rename to packages/@vuepress/core/lib/client/components/OutboundLink.vue diff --git a/packages/@vuepress/core/lib/app/components/TOC.vue b/packages/@vuepress/core/lib/client/components/TOC.vue similarity index 100% rename from packages/@vuepress/core/lib/app/components/TOC.vue rename to packages/@vuepress/core/lib/client/components/TOC.vue diff --git a/packages/@vuepress/core/lib/app/dataMixin.js b/packages/@vuepress/core/lib/client/dataMixin.js similarity index 100% rename from packages/@vuepress/core/lib/app/dataMixin.js rename to packages/@vuepress/core/lib/client/dataMixin.js diff --git a/packages/@vuepress/core/lib/app/index.dev.html b/packages/@vuepress/core/lib/client/index.dev.html similarity index 100% rename from packages/@vuepress/core/lib/app/index.dev.html rename to packages/@vuepress/core/lib/client/index.dev.html diff --git a/packages/@vuepress/core/lib/app/index.ssr.html b/packages/@vuepress/core/lib/client/index.ssr.html similarity index 100% rename from packages/@vuepress/core/lib/app/index.ssr.html rename to packages/@vuepress/core/lib/client/index.ssr.html diff --git a/packages/@vuepress/core/lib/app/plugins/Store.d.ts b/packages/@vuepress/core/lib/client/plugins/Store.d.ts similarity index 100% rename from packages/@vuepress/core/lib/app/plugins/Store.d.ts rename to packages/@vuepress/core/lib/client/plugins/Store.d.ts diff --git a/packages/@vuepress/core/lib/app/plugins/Store.js b/packages/@vuepress/core/lib/client/plugins/Store.js similarity index 100% rename from packages/@vuepress/core/lib/app/plugins/Store.js rename to packages/@vuepress/core/lib/client/plugins/Store.js diff --git a/packages/@vuepress/core/lib/app/plugins/VuePress.d.ts b/packages/@vuepress/core/lib/client/plugins/VuePress.d.ts similarity index 100% rename from packages/@vuepress/core/lib/app/plugins/VuePress.d.ts rename to packages/@vuepress/core/lib/client/plugins/VuePress.d.ts diff --git a/packages/@vuepress/core/lib/app/plugins/VuePress.js b/packages/@vuepress/core/lib/client/plugins/VuePress.js similarity index 100% rename from packages/@vuepress/core/lib/app/plugins/VuePress.js rename to packages/@vuepress/core/lib/client/plugins/VuePress.js diff --git a/packages/@vuepress/core/lib/app/redirect.js b/packages/@vuepress/core/lib/client/redirect.js similarity index 100% rename from packages/@vuepress/core/lib/app/redirect.js rename to packages/@vuepress/core/lib/client/redirect.js diff --git a/packages/@vuepress/core/lib/app/root-mixins/updateMeta.js b/packages/@vuepress/core/lib/client/root-mixins/updateMeta.js similarity index 100% rename from packages/@vuepress/core/lib/app/root-mixins/updateMeta.js rename to packages/@vuepress/core/lib/client/root-mixins/updateMeta.js diff --git a/packages/@vuepress/core/lib/app/serverEntry.js b/packages/@vuepress/core/lib/client/serverEntry.js similarity index 100% rename from packages/@vuepress/core/lib/app/serverEntry.js rename to packages/@vuepress/core/lib/client/serverEntry.js diff --git a/packages/@vuepress/core/lib/app/style/config.styl b/packages/@vuepress/core/lib/client/style/config.styl similarity index 100% rename from packages/@vuepress/core/lib/app/style/config.styl rename to packages/@vuepress/core/lib/client/style/config.styl diff --git a/packages/@vuepress/core/lib/app/util.js b/packages/@vuepress/core/lib/client/util.js similarity index 100% rename from packages/@vuepress/core/lib/app/util.js rename to packages/@vuepress/core/lib/client/util.js diff --git a/packages/@vuepress/core/lib/dev.js b/packages/@vuepress/core/lib/dev.js deleted file mode 100644 index dc8f4db24e..0000000000 --- a/packages/@vuepress/core/lib/dev.js +++ /dev/null @@ -1,208 +0,0 @@ -'use strict' - -module.exports = async (sourceDir, options = {}, ctx) => { - const { server, host, port } = await prepareServer(sourceDir, options, ctx) - server.listen(port, host, err => { - if (err) { - console.log(err) - } - }) -} - -module.exports.prepare = prepareServer - -async function prepareServer (sourceDir, options = {}, context) { - const WebpackDevServer = require('webpack-dev-server') - const { path } = require('@vuepress/shared-utils') - const webpack = require('webpack') - const chokidar = require('chokidar') - - const prepare = require('./prepare/index') - const { chalk, fs, logger } = require('@vuepress/shared-utils') - const HeadPlugin = require('./webpack/HeadPlugin') - const DevLogPlugin = require('./webpack/DevLogPlugin') - const createClientConfig = require('./webpack/createClientConfig') - const { applyUserWebpackConfig } = require('./util/index') - const { frontmatterEmitter } = require('@vuepress/markdown-loader') - - options = { sourceDir, isProd: false, ...options } - const ctx = context || await prepare(options) - - // setup watchers to update options and dynamically generated files - const update = (reason) => { - console.log(`Reload due to ${reason}`) - ctx.pluginAPI.options.updated.syncApply() - prepare(ctx.sourceDir, options).catch(err => { - console.error(logger.error(chalk.red(err.stack), false)) - }) - } - - // Curry update handler by update type - const spawnUpdate = updateType => file => { - const target = path.join(ctx.sourceDir, file) - // Bust cache. - delete require.cache[target] - update(`${chalk.red(updateType)} ${chalk.cyan(file)}`) - } - - // watch add/remove of files - const pagesWatcher = chokidar.watch([ - '**/*.md', - '.vuepress/components/**/*.vue' - ], { - cwd: ctx.sourceDir, - ignored: ['.vuepress/**/*.md', 'node_modules'], - ignoreInitial: true - }) - pagesWatcher.on('add', spawnUpdate('add')) - pagesWatcher.on('unlink', spawnUpdate('unlink')) - pagesWatcher.on('addDir', spawnUpdate('addDir')) - pagesWatcher.on('unlinkDir', spawnUpdate('unlinkDir')) - - const watchFiles = [ - '.vuepress/config.js', - '.vuepress/config.yml', - '.vuepress/config.toml' - ].concat( - ( - ctx.siteConfig.extraWatchFiles || [] - ).map(file => normalizeWatchFilePath(file, ctx.sourceDir)) - ) - - logger.debug('watchFiles', watchFiles) - - // watch config file - const configWatcher = chokidar.watch(watchFiles, { - cwd: ctx.sourceDir, - ignoreInitial: true - }) - configWatcher.on('change', spawnUpdate('change')) - - // also listen for frontmatter changes from markdown files - frontmatterEmitter.on('update', () => update('frontmatter or headers change')) - - // resolve webpack config - let config = createClientConfig(ctx) - - config - .plugin('html') - // using a fork of html-webpack-plugin to avoid it requiring webpack - // internals from an incompatible version. - .use(require('vuepress-html-webpack-plugin'), [{ - template: ctx.devTemplate - }]) - - config - .plugin('site-data') - .use(HeadPlugin, [{ - tags: ctx.siteConfig.head || [] - }]) - - const port = await resolvePort(options.port || ctx.siteConfig.port) - const { host, displayHost } = await resolveHost(options.host || ctx.siteConfig.host) - - // debug in a running dev process. - process.stdin - && process.stdin.on('data', chunk => { - const parsed = chunk.toString('utf-8').trim() - if (parsed === '*') { - console.log(Object.keys(ctx)) - } - if (ctx[parsed]) { - console.log(ctx[parsed]) - } - }) - - config - .plugin('vuepress-log') - .use(DevLogPlugin, [{ - port, - displayHost, - publicPath: ctx.base - }]) - - config = config.toConfig() - const userConfig = ctx.siteConfig.configureWebpack - if (userConfig) { - config = applyUserWebpackConfig(userConfig, config, false /* isServer */) - } - - const contentBase = path.resolve(ctx.sourceDir, '.vuepress/public') - - const serverConfig = Object.assign({ - disableHostCheck: true, - compress: true, - clientLogLevel: 'error', - hot: true, - quiet: true, - headers: { - 'access-control-allow-origin': '*' - }, - open: options.open, - publicPath: ctx.base, - watchOptions: { - ignored: [ - /node_modules/, - `!${ctx.tempPath}/**` - ] - }, - historyApiFallback: { - disableDotRule: true, - rewrites: [ - { from: /./, to: path.posix.join(ctx.base, 'index.html') } - ] - }, - overlay: false, - host, - contentBase, - before (app, server) { - if (fs.existsSync(contentBase)) { - app.use(ctx.base, require('express').static(contentBase)) - } - - ctx.pluginAPI.options.beforeDevServer.syncApply(app, server) - }, - after (app, server) { - ctx.pluginAPI.options.afterDevServer.syncApply(app, server) - } - }, ctx.siteConfig.devServer || {}) - - WebpackDevServer.addDevServerEntrypoints(config, serverConfig) - - const compiler = webpack(config) - const server = new WebpackDevServer(compiler, serverConfig) - - return { - server, - host, - port, - ctx - } -} - -function resolveHost (host) { - const defaultHost = 'localhost' - host = host || defaultHost - const displayHost = host === defaultHost - ? 'localhost' - : host - return { - displayHost, - host - } -} - -async function resolvePort (port) { - const portfinder = require('portfinder') - portfinder.basePort = parseInt(port) || 8080 - port = await portfinder.getPortPromise() - return port -} - -function normalizeWatchFilePath (filepath, baseDir) { - const { isAbsolute, relative } = require('path') - if (isAbsolute(filepath)) { - return relative(baseDir, filepath) - } - return filepath -} diff --git a/packages/@vuepress/core/lib/index.js b/packages/@vuepress/core/lib/index.js index 43a6d0124b..9051524575 100644 --- a/packages/@vuepress/core/lib/index.js +++ b/packages/@vuepress/core/lib/index.js @@ -1,5 +1,26 @@ 'use strict' -exports.dev = require('./dev') -exports.build = require('./build') +const App = require('./node/App') +const { logger } = require('@vuepress/shared-utils') + +function createApp (options) { + logger.wait('Extracting site metadata...') + return new App(options) +} + +async function dev (options) { + const app = createApp(options) + await app.process() + await app.dev() +} + +async function build (options) { + const app = createApp(options) + await app.process() + await app.build() +} + +exports.createApp = createApp +exports.dev = dev +exports.build = build exports.eject = require('./eject') diff --git a/packages/@vuepress/core/lib/prepare/AppContext.js b/packages/@vuepress/core/lib/node/App.js similarity index 79% rename from packages/@vuepress/core/lib/prepare/AppContext.js rename to packages/@vuepress/core/lib/node/App.js index 28a4686180..906316f2ef 100755 --- a/packages/@vuepress/core/lib/prepare/AppContext.js +++ b/packages/@vuepress/core/lib/node/App.js @@ -16,18 +16,21 @@ const { const Page = require('./Page') const ClientComputedMixin = require('./ClientComputedMixin') -const PluginAPI = require('../plugin-api/index') +const PluginAPI = require('./plugin-api') +const DevProcess = require('./dev') +const BuildProcess = require('./build') +const createTemp = require('./createTemp') /** - * Expose AppContext. + * Expose VuePressApp. */ -module.exports = class AppContext { +module.exports = class App { static getInstance (...args) { - if (!AppContext._instance) { - AppContext._instance = new AppContext(...args) + if (!App._instance) { + App._instance = new App(...args) } - return AppContext._instance + return App._instance } /** @@ -35,7 +38,6 @@ module.exports = class AppContext { * * @param {string} sourceDir * @param {{ - * isProd: boolean, * plugins: pluginsConfig, * theme: themeNameConfig * temp: string @@ -45,7 +47,6 @@ module.exports = class AppContext { constructor (options = {}) { this.options = options this.sourceDir = this.options.sourceDir || path.join(__dirname, 'docs.fallback') - this.isProd = this.options.isProd logger.debug('sourceDir', this.sourceDir) const { tempPath, writeTemp } = createTemp(options.temp) @@ -53,6 +54,7 @@ module.exports = class AppContext { this.writeTemp = writeTemp this.vuepressDir = path.resolve(this.sourceDir, '.vuepress') + this.libDir = path.join(__dirname, '../') } /** @@ -97,7 +99,6 @@ module.exports = class AppContext { async process () { this.resolveConfigAndInitialize() - this.resolveCacheLoaderOptions() this.normalizeHeadTagUrls() this.themeAPI = loadTheme(this) this.resolveTemplates() @@ -110,18 +111,18 @@ module.exports = class AppContext { this.markdown = createMarkdown(this) await this.resolvePages() - await this.pluginAPI.options.additionalPages.apply(this) + + await this.pluginAPI.applyAsyncOption('additionalPages', this) await Promise.all( - this.pluginAPI.options.additionalPages.appliedValues.map(async (options) => { + this.pluginAPI.getOption('additionalPages').appliedValues.map(async (options) => { await this.addPage(options) }) ) - - await this.pluginAPI.options.ready.apply() + await this.pluginAPI.applyAsyncOption('ready') await Promise.all([ - this.pluginAPI.options.clientDynamicModules.apply(this), - this.pluginAPI.options.enhanceAppFiles.apply(this), - this.pluginAPI.options.globalUIComponents.apply(this) + this.pluginAPI.applyAsyncOption('clientDynamicModules', this), + this.pluginAPI.applyAsyncOption('enhanceAppFiles', this), + this.pluginAPI.applyAsyncOption('globalUIComponents', this) ]) } @@ -143,17 +144,17 @@ module.exports = class AppContext { this.pluginAPI // internl core plugins - .use(require('../internal-plugins/siteData')) - .use(require('../internal-plugins/routes')) - .use(require('../internal-plugins/rootMixins')) - .use(require('../internal-plugins/enhanceApp')) - .use(require('../internal-plugins/palette')) - .use(require('../internal-plugins/style')) - .use(require('../internal-plugins/layoutComponents')) - .use(require('../internal-plugins/pageComponents')) - .use(require('../internal-plugins/transformModule')) - .use(require('../internal-plugins/dataBlock')) - .use(require('../internal-plugins/frontmatterBlock')) + .use(require('./internal-plugins/siteData')) + .use(require('./internal-plugins/routes')) + .use(require('./internal-plugins/rootMixins')) + .use(require('./internal-plugins/enhanceApp')) + .use(require('./internal-plugins/palette')) + .use(require('./internal-plugins/style')) + .use(require('./internal-plugins/layoutComponents')) + .use(require('./internal-plugins/pageComponents')) + .use(require('./internal-plugins/transformModule')) + .use(require('./internal-plugins/dataBlock')) + .use(require('./internal-plugins/frontmatterBlock')) .use('@vuepress/container', { type: 'slot', before: info => `