From c33603d5d7f834c5a62c60aedde8781aaf51de3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20L=C3=B3pez?= Date: Thu, 1 Nov 2018 15:11:27 +0100 Subject: [PATCH 0001/1549] docs(deployment): add `bash` highlighting to code blocks (#2841) --- docs/guide/deployment.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index eda245f380..243722fecb 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -143,13 +143,13 @@ Create a new Firebase project on your [Firebase console](https://console.firebas Make sure you have installed [firebase-tools](https://github.com/firebase/firebase-tools) globally: -``` +```bash npm install -g firebase-tools ``` From the root of your project, initialize `firebase` using the command: -``` +```bash firebase init ``` @@ -190,7 +190,7 @@ Run `npm run build` to build your project. To deploy your project on Firebase Hosting, run the command: -``` +```bash firebase deploy --only hosting ``` @@ -202,7 +202,11 @@ Please refer to the [Firebase Documentation](https://firebase.google.com/docs/ho ### Now -1. Install the Now CLI globally: `npm install -g now` +1. Install the Now CLI globally: + +```bash +npm install -g now +``` 2. Add a `now.json` file to your project root: @@ -256,7 +260,7 @@ To deploy with [Surge](http://surge.sh/) the steps are very straightforward. First you would need to build your project by running `npm run build`. And if you haven't installed Surge's command line tool, you can simply do so by running the command: -``` +```bash npm install --global surge ``` From 45753bb2f69d9c7427c53ae60659dc7bd9b02dee Mon Sep 17 00:00:00 2001 From: Raphael DDL Oliveira Date: Thu, 1 Nov 2018 11:14:12 -0300 Subject: [PATCH 0002/1549] docs: update config pages README.md (#2798) [ci skip] Updates readme to reflect changes done by #2544 (commit 4cabf5e8c798287825908fb193d61fcc1e8d62af ). Not sure if properly worded but with that changes, fares an explanation that any other properties will also get passed along to `html-webpack-plugin`, not only listed properties. --- docs/config/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/README.md b/docs/config/README.md index d5066f4dba..b8af776324 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -101,7 +101,7 @@ module.exports = { Build the app in multi-page mode. Each "page" should have a corresponding JavaScript entry file. The value should be an object where the key is the name of the entry, and the value is either: - - An object that specifies its `entry`, `template`, `filename`, `title` and `chunks` (all optional except `entry`); + - An object that specifies its `entry`, `template`, `filename`, `title` and `chunks` (all optional except `entry`). Any other properties added beside those will also be passed directly to `html-webpack-plugin`, allowing user to customize said plugin; - Or a string specifying its `entry`. ``` js From 305c4bf2c52d081e34543ff5944a22eeedfdf8f9 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Tue, 6 Nov 2018 11:18:53 +0100 Subject: [PATCH 0003/1549] fix: remove last route restore --- packages/@vue/cli-ui/src/main.js | 12 +----------- packages/@vue/cli-ui/src/router.js | 21 +++------------------ 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/packages/@vue/cli-ui/src/main.js b/packages/@vue/cli-ui/src/main.js index 4127c12f16..d9114a815e 100644 --- a/packages/@vue/cli-ui/src/main.js +++ b/packages/@vue/cli-ui/src/main.js @@ -25,14 +25,4 @@ const app = new Vue({ ...App }) -async function start () { - app.$mount('#app') - - // Restore last route - const lastRoute = localStorage.getItem('vue-cli-ui.lastRoute') - if (lastRoute) { - router.push(lastRoute) - } -} - -start() +app.$mount('#app') diff --git a/packages/@vue/cli-ui/src/router.js b/packages/@vue/cli-ui/src/router.js index 4ebc7673e5..b01878c794 100644 --- a/packages/@vue/cli-ui/src/router.js +++ b/packages/@vue/cli-ui/src/router.js @@ -33,8 +33,7 @@ const router = new Router({ path: '/', component: ProjectHome, meta: { - needProject: true, - restore: true + needProject: true }, children: [ { @@ -93,18 +92,12 @@ const router = new Router({ { path: '/project/select', name: 'project-select', - component: ProjectSelect, - meta: { - restore: true - } + component: ProjectSelect }, { path: '/project/create', name: 'project-create', - component: ProjectCreate, - meta: { - restore: true - } + component: ProjectCreate }, { path: '/file-diff', @@ -150,12 +143,4 @@ router.beforeEach(async (to, from, next) => { next() }) -router.afterEach((to, from) => { - if (to.matched.some(m => m.meta.restore)) { - localStorage.setItem('vue-cli-ui.lastRoute', to.fullPath) - } else { - localStorage.removeItem('vue-cli-ui.lastRoute') - } -}) - export default router From 11e59f808f66f96df458a17a33521f58d15473de Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Tue, 6 Nov 2018 11:27:50 +0100 Subject: [PATCH 0004/1549] fix: refresh page & switching between views doesn't lose selected item Logic wasn't working as intended in RestoreRoute mixin --- packages/@vue/cli-ui/src/mixins/RestoreRoute.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/@vue/cli-ui/src/mixins/RestoreRoute.js b/packages/@vue/cli-ui/src/mixins/RestoreRoute.js index 177b85c935..4b38e0f49d 100644 --- a/packages/@vue/cli-ui/src/mixins/RestoreRoute.js +++ b/packages/@vue/cli-ui/src/mixins/RestoreRoute.js @@ -28,8 +28,7 @@ export default function ({ beforeRouteEnter (to, from, next) { if (lastRoute) { - if (!to.query) { - console.log('lastRoute', lastRoute) + if (!to.params || !Object.keys(to.params).length) { const { name, params, query } = lastRoute next({ name, params, query }) return @@ -45,15 +44,14 @@ export default function ({ }, mounted () { - this.$nextTick(() => { + setTimeout(() => { this.$_restoreRouteReady = true - }) + }, 100) }, methods: { replaceBaseRoute () { if (baseRoute && !isSameRoute(this.$route, baseRoute, false)) { - console.log('replaceBaseRoute') this.$router.replace(baseRoute) } } From e25c0e84baf6676483add437b181a001d1c35f02 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 6 Nov 2018 19:23:34 +0800 Subject: [PATCH 0005/1549] chore: update cache-loader version Now that the critical bug has been fixed, it's better to keep updated. --- packages/@vue/cli-service/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/package.json b/packages/@vue/cli-service/package.json index 68fe1223f7..d19d40e718 100644 --- a/packages/@vue/cli-service/package.json +++ b/packages/@vue/cli-service/package.json @@ -30,7 +30,7 @@ "acorn-walk": "^6.1.0", "address": "^1.0.3", "autoprefixer": "^8.6.5", - "cache-loader": "1.2.2", + "cache-loader": "^1.2.5", "case-sensitive-paths-webpack-plugin": "^2.1.2", "chalk": "^2.4.1", "clipboardy": "^1.2.3", From 73923de54d2fd0b4b1be5c319799bf689cb1734d Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 6 Nov 2018 19:26:19 +0800 Subject: [PATCH 0006/1549] fix: relax webpack version requirement To avoid introducing two different instances of webpack when @cypress/webpack-preprocessor 3.0.0/3.0.1 is also installed, which breaks HMR. Fixes #2873 Fixes #2892 --- packages/@vue/cli-service/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/package.json b/packages/@vue/cli-service/package.json index d19d40e718..8c4c01967a 100644 --- a/packages/@vue/cli-service/package.json +++ b/packages/@vue/cli-service/package.json @@ -65,7 +65,7 @@ "thread-loader": "^1.2.0", "url-loader": "^1.1.2", "vue-loader": "^15.4.2", - "webpack": "^4.23.1", + "webpack": "^4.18.1", "webpack-bundle-analyzer": "^3.0.3", "webpack-chain": "^4.11.0", "webpack-dev-server": "^3.1.10", From 0d581ad66bad713595c00dbc2e189b37cdddde77 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 6 Nov 2018 19:37:59 +0800 Subject: [PATCH 0007/1549] chore: @vue/cli-service v3.1.1 --- packages/@vue/cli-service/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/package.json b/packages/@vue/cli-service/package.json index 8c4c01967a..fe331f15f0 100644 --- a/packages/@vue/cli-service/package.json +++ b/packages/@vue/cli-service/package.json @@ -1,6 +1,6 @@ { "name": "@vue/cli-service", - "version": "3.1.2", + "version": "3.1.3", "description": "local service for vue-cli projects", "main": "lib/Service.js", "bin": { From 68bc0d86ae08a4cd4ed7aa7bef2f5bd4b9f51e62 Mon Sep 17 00:00:00 2001 From: remote-star Date: Tue, 6 Nov 2018 19:41:28 +0800 Subject: [PATCH 0008/1549] docs(zh): correct the wrong file name. (#2902) [ci skip] --- docs/zh/dev-guide/plugin-dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/dev-guide/plugin-dev.md b/docs/zh/dev-guide/plugin-dev.md index 651990db48..6a422c39d9 100644 --- a/docs/zh/dev-guide/plugin-dev.md +++ b/docs/zh/dev-guide/plugin-dev.md @@ -300,7 +300,7 @@ module.exports = api => { #### 第三方插件的对话 -第三方插件通常会在一个项目创建完毕后被手动安装,且用户将会通过调用 `vue invoke` 来初始化这个插件。如果这个插件在其根目录包含一个 `prompt.js`,那么它将会用在该插件被初始化调用的时候。这个文件应该导出一个用于 Inquirer.js 的[问题](https://github.com/SBoudrias/Inquirer.js#question)的数组。这些被解析的答案对象会作为选项被传递给插件的 generator。 +第三方插件通常会在一个项目创建完毕后被手动安装,且用户将会通过调用 `vue invoke` 来初始化这个插件。如果这个插件在其根目录包含一个 `prompts.js`,那么它将会用在该插件被初始化调用的时候。这个文件应该导出一个用于 Inquirer.js 的[问题](https://github.com/SBoudrias/Inquirer.js#question)的数组。这些被解析的答案对象会作为选项被传递给插件的 generator。 或者,用户可以通过在命令行传递选项来跳过对话直接初始化插件,比如: From 662b1d38b98b1ed7c1f2066846e6589d9832b006 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 6 Nov 2018 19:49:52 +0800 Subject: [PATCH 0009/1549] test: fix eslint test in CI environment --- .../cli-plugin-eslint/__tests__/eslintPlugin.spec.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js b/packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js index 9291c026c3..ace70cf408 100644 --- a/packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js +++ b/packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js @@ -72,15 +72,17 @@ test('should work', async () => { let isFirstMsg = true server.stdout.on('data', data => { data = data.toString() - if (data.match(/Compiled with \d warning/)) { + if (isFirstMsg) { // should fail on start - expect(isFirstMsg).toBe(true) + expect(data).toMatch(/Compiled with \d warning/) isFirstMsg = false + // fix it write('src/App.vue', app) } else if (data.match(/Compiled successfully/)) { - // should compile on 2nd update - expect(isFirstMsg).toBe(false) + // should compile on the subsequent update + // (note: in CI environment this may not be the exact 2nd update, + // so we use data.match as a termination condition rather than a test case) server.stdin.write('close') done() } From 91a4b2e28e97753c0a02acb523612f4330160053 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Tue, 6 Nov 2018 23:33:21 +0100 Subject: [PATCH 0010/1549] feat(plugin): quick local plugin refresh --- .../cli-ui/apollo-server/connectors/plugins.js | 18 +++++++++++++----- .../@vue/cli-ui/apollo-server/schema/plugin.js | 4 ++-- packages/@vue/cli-ui/locales/en.json | 2 +- .../components/plugin/ProjectPluginItem.vue | 7 ++++--- .../cli-ui/src/graphql/plugin/pluginUpdate.gql | 4 ++-- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/packages/@vue/cli-ui/apollo-server/connectors/plugins.js b/packages/@vue/cli-ui/apollo-server/connectors/plugins.js index 46b2660fee..eac6973525 100644 --- a/packages/@vue/cli-ui/apollo-server/connectors/plugins.js +++ b/packages/@vue/cli-ui/apollo-server/connectors/plugins.js @@ -467,7 +467,7 @@ async function initPrompts (id, context) { await prompts.start() } -function update (id, context) { +function update ({ id, full }, context) { return progress.wrap('plugin-update', context, async setProgress => { setProgress({ status: 'plugin-update', @@ -478,7 +478,7 @@ function update (id, context) { const { current, wanted, localPath } = await dependencies.getVersion(plugin, context) if (localPath) { - await updateLocalPackage({ cwd: cwd.get(), id, localPath }, context) + await updateLocalPackage({ cwd: cwd.get(), id, localPath, full }, context) } else { await updatePackage(cwd.get(), getCommand(cwd.get()), null, id) } @@ -502,11 +502,19 @@ function update (id, context) { }) } -async function updateLocalPackage ({ id, cwd, localPath }, context) { +async function updateLocalPackage ({ id, cwd, localPath, full = true }, context) { const from = path.resolve(cwd, localPath) const to = path.resolve(cwd, 'node_modules', ...id.split('/')) - await fs.remove(to) - await fs.copy(from, to) + let filterRegEx + if (full) { + await fs.remove(to) + filterRegEx = /\.git/ + } else { + filterRegEx = /(\.git|node_modules)/ + } + await fs.copy(from, to, { + filter: (file) => !file.match(filterRegEx) + }) } async function updateAll (context) { diff --git a/packages/@vue/cli-ui/apollo-server/schema/plugin.js b/packages/@vue/cli-ui/apollo-server/schema/plugin.js index 08bdd6a7c3..7a007742a2 100644 --- a/packages/@vue/cli-ui/apollo-server/schema/plugin.js +++ b/packages/@vue/cli-ui/apollo-server/schema/plugin.js @@ -19,7 +19,7 @@ extend type Mutation { pluginUninstall (id: ID!): PluginInstallation pluginInvoke (id: ID!): PluginInstallation pluginFinishInstall: PluginInstallation - pluginUpdate (id: ID!): Plugin + pluginUpdate (id: ID!, full: Boolean = true): Plugin pluginActionCall (id: ID!, params: JSON): PluginActionResult pluginsUpdate: [Plugin] pluginResetApi: Boolean @@ -87,7 +87,7 @@ exports.resolvers = { pluginUninstall: (root, { id }, context) => plugins.uninstall(id, context), pluginInvoke: (root, { id }, context) => plugins.runInvoke(id, context), pluginFinishInstall: (root, args, context) => plugins.finishInstall(context), - pluginUpdate: (root, { id }, context) => plugins.update(id, context), + pluginUpdate: (root, { id, full }, context) => plugins.update({ id, full }, context), pluginActionCall: (root, args, context) => plugins.callAction(args, context), pluginsUpdate: (root, args, context) => plugins.updateAll(context), pluginResetApi: (root, args, context) => plugins.resetPluginApi({ file: cwd.get() }, context) diff --git a/packages/@vue/cli-ui/locales/en.json b/packages/@vue/cli-ui/locales/en.json index c74edd3036..e50ca202d9 100644 --- a/packages/@vue/cli-ui/locales/en.json +++ b/packages/@vue/cli-ui/locales/en.json @@ -116,7 +116,7 @@ "installed": "Installed", "actions": { "update": "Update {target}", - "refresh": "Force Refresh {target}" + "refresh": "Force Refresh {target}
Press [Shift] for Quick Refresh (node_modules won't be updated)" }, "local": "Local" }, diff --git a/packages/@vue/cli-ui/src/components/plugin/ProjectPluginItem.vue b/packages/@vue/cli-ui/src/components/plugin/ProjectPluginItem.vue index fa9975210a..13c42a0223 100644 --- a/packages/@vue/cli-ui/src/components/plugin/ProjectPluginItem.vue +++ b/packages/@vue/cli-ui/src/components/plugin/ProjectPluginItem.vue @@ -71,7 +71,7 @@ class="icon-button" v-tooltip="$t('org.vue.components.project-plugin-item.actions.refresh', { target: plugin.id })" :loading-left="updating" - @click="updatePlugin()" + @click="e => updatePlugin(!e.shiftKey)" /> Date: Tue, 6 Nov 2018 23:55:07 +0100 Subject: [PATCH 0011/1549] feat(status bar): last log animation --- .../cli-ui/src/components/app/StatusBar.vue | 41 ++++++++++++++++--- .../@vue/cli-ui/src/style/transitions.styl | 14 +++++++ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/packages/@vue/cli-ui/src/components/app/StatusBar.vue b/packages/@vue/cli-ui/src/components/app/StatusBar.vue index 6ae39b4de6..fb6d5bcff6 100644 --- a/packages/@vue/cli-ui/src/components/app/StatusBar.vue +++ b/packages/@vue/cli-ui/src/components/app/StatusBar.vue @@ -40,11 +40,25 @@ @click="onConsoleClick()" > - -
{{ $t('org.vue.components.status-bar.log.empty') }}
+ + +
+ {{ $t('org.vue.components.status-bar.log.empty') }} +
+