Skip to content

Commit 282a4be

Browse files
committed
Merge branch 'dev' into patch-1
2 parents 9f564da + 21256f5 commit 282a4be

File tree

306 files changed

+6186
-1730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+6186
-1730
lines changed

docs/dev-guide/ui-api.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ vue ui -D
6464

6565
You can add a project configuration with the `api.describeConfig` method.
6666

67-
First you need to pass some informations:
67+
First you need to pass some information:
6868

6969
```js
7070
api.describeConfig({
@@ -430,7 +430,7 @@ api.describeTask({
430430
if (answers.mode) args.push('--mode', answers.mode)
431431
args.push('--dashboard')
432432
},
433-
// Immediatly after running the task
433+
// Immediately after running the task
434434
onRun: async ({ args, child, cwd }) => {
435435
// child: node child process
436436
// cwd: process working directory
@@ -1252,7 +1252,7 @@ You can also open a page instead when the user activates the suggestion with `ac
12521252
```js
12531253
api.addSuggestion({
12541254
id: 'com.my-name.my-suggestion',
1255-
type: 'action', // Required
1255+
type: 'action', // Required
12561256
label: 'Add vue-router',
12571257
// Open a new tab
12581258
actionLink: 'https://vuejs.org/'
@@ -1288,6 +1288,58 @@ In this example we only display the vue-router suggestion in the plugins view an
12881288

12891289
Note: `addSuggestion` and `removeSuggestion` can be namespaced with `api.namespace()`.
12901290

1291+
## Widgets
1292+
1293+
You can register a widget for the project dashboard in your plugin ui file:
1294+
1295+
```js
1296+
registerWidget({
1297+
// Unique ID
1298+
id: 'org.vue.widgets.news',
1299+
// Basic infos
1300+
title: 'org.vue.widgets.news.title',
1301+
description: 'org.vue.widgets.news.description',
1302+
icon: 'rss_feed',
1303+
// Main component used to render the widget
1304+
component: 'org.vue.widgets.components.news',
1305+
// (Optional) Secondary component for widget 'fullscreen' view
1306+
detailsComponent: 'org.vue.widgets.components.news',
1307+
// Size
1308+
minWidth: 2,
1309+
minHeight: 1,
1310+
maxWidth: 6,
1311+
maxHeight: 6,
1312+
defaultWidth: 2,
1313+
defaultHeight: 3,
1314+
// (Optional) Limit the maximum number of this widget on the dashboard
1315+
maxCount: 1,
1316+
// (Optional) Add a 'fullscreen' button in widget header
1317+
openDetailsButton: true,
1318+
// (Optional) Default configuration for the widget
1319+
defaultConfig: () => ({
1320+
url: 'https://vuenews.fireside.fm/rss'
1321+
}),
1322+
// (Optional) Require user to configure widget when added
1323+
// You shouldn't use `defaultConfig` with this
1324+
needsUserConfig: true,
1325+
// (Optional) Display prompts to configure the widget
1326+
onConfigOpen: async ({ context }) => {
1327+
return {
1328+
prompts: [
1329+
{
1330+
name: 'url',
1331+
type: 'input',
1332+
message: 'org.vue.widgets.news.prompts.url',
1333+
validate: input => !!input // Required
1334+
}
1335+
]
1336+
}
1337+
}
1338+
})
1339+
```
1340+
1341+
Note: `registerWidget` can be namespaced with `api.namespace()`.
1342+
12911343
## Other methods
12921344

12931345
### hasPlugin
@@ -1324,6 +1376,21 @@ Get currently open project.
13241376
api.getProject()
13251377
```
13261378

1379+
### requestRoute
1380+
1381+
Switch the user on a specific route in the web client.
1382+
1383+
```js
1384+
api.requestRoute({
1385+
name: 'foo',
1386+
params: {
1387+
id: 'bar'
1388+
}
1389+
})
1390+
1391+
api.requestRoute('/foobar')
1392+
```
1393+
13271394
## Public static files
13281395

13291396
You may need to expose some static files over the cli-ui builtin HTTP server (typically if you want to specify an icon to a custom view).

docs/ru/guide/plugins-and-presets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ vue create --preset bitbucket:username/repo --clone my-project
209209
vue create --preset ./my-preset my-project
210210

211211
# или напрямую использовать json-файл в cwd:
212-
vue create --preset my-preset.json
212+
vue create --preset my-preset.json my-project
213213
```

docs/zh/config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Vue CLI 使用了 Babel 7 中的新配置格式 `babel.config.js`。和 `.babelr
384384

385385
## ESLint
386386

387-
ESLint 可以通过 `.eslintrc``pacakge.json` 中的 `eslintConfig` 字段来配置。
387+
ESLint 可以通过 `.eslintrc``package.json` 中的 `eslintConfig` 字段来配置。
388388

389389
更多细节可查阅 [@vue/cli-plugin-eslint](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint)
390390

docs/zh/guide/plugins-and-presets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ vue create --preset bitbucket:username/repo --clone my-project
209209
vue create --preset ./my-preset my-project
210210

211211
# 或者,直接使用当前工作目录下的 json 文件:
212-
vue create --preset my-preset.json
212+
vue create --preset my-preset.json my-project
213213
```

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@
7272
"resolutions": {
7373
"@babel/core": "^7.0.0",
7474
"@babel/preset-env": "^7.0.0",
75-
"fs-monkey": "0.3.1",
7675
"babel-core": "7.0.0-bridge.0",
7776
"vue": "2.5.17",
78-
"vue-loader": "15.3.0",
7977
"vue-template-compiler": "2.5.17",
8078
"vue-server-renderer": "2.5.17"
8179
}

packages/@vue/babel-preset-app/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const path = require('path')
2+
13
const defaultPolyfills = [
24
// promise polyfill alone doesn't work in IE,
35
// needs this as well. see: #1642
@@ -138,7 +140,8 @@ module.exports = (context, options = {}) => {
138140
regenerator: useBuiltIns !== 'usage',
139141
corejs: useBuiltIns !== false ? false : 2,
140142
helpers: useBuiltIns === 'usage',
141-
useESModules: !process.env.VUE_CLI_BABEL_TRANSPILE_MODULES
143+
useESModules: !process.env.VUE_CLI_BABEL_TRANSPILE_MODULES,
144+
absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json'))
142145
}])
143146

144147
return {

packages/@vue/cli-plugin-e2e-nightwatch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@vue/cli-shared-utils": "^3.0.5",
26-
"chromedriver": "^2.42.1",
26+
"chromedriver": "^2.43.1",
2727
"deepmerge": "^2.2.1",
2828
"execa": "^1.0.0",
2929
"nightwatch": "^0.9.21",

packages/@vue/cli-plugin-pwa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@vue/cli-shared-utils": "^3.0.5",
26-
"workbox-webpack-plugin": "^3.6.2"
26+
"workbox-webpack-plugin": "^3.6.3"
2727
},
2828
"devDependencies": {
2929
"register-service-worker": "^1.0.0"

packages/@vue/cli-plugin-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"dependencies": {
2525
"@types/webpack-env": "^1.13.6",
2626
"@vue/cli-shared-utils": "^3.0.5",
27-
"fork-ts-checker-webpack-plugin": "^0.4.10",
27+
"fork-ts-checker-webpack-plugin": "^0.4.13",
2828
"globby": "^8.0.1",
2929
"ts-loader": "^5.2.2",
3030
"tslint": "^5.11.0"

packages/@vue/cli-plugin-unit-jest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"jest": "^23.6.0",
2929
"jest-serializer-vue": "^2.0.2",
3030
"jest-transform-stub": "^1.0.0",
31-
"vue-jest": "^2.6.0"
31+
"vue-jest": "^3.0.0"
3232
},
3333
"devDependencies": {
3434
"@vue/test-utils": "^1.0.0-beta.20",

packages/@vue/cli-service/generator/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = (api, options) => {
2-
api.render('./template')
2+
api.render('./template', {
3+
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript')
4+
})
35

46
api.extendPackage({
57
scripts: {

packages/@vue/cli-service/generator/router/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = (api, options = {}) => {
77
}
88
})
99
api.render('./template', {
10-
historyMode: options.routerHistoryMode
10+
historyMode: options.routerHistoryMode,
11+
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript')
1112
})
1213

1314
if (api.invoking) {

packages/@vue/cli-service/generator/router/template/src/router.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ export default new Router({
2121
// route level code-splitting
2222
// this generates a separate chunk (about.[hash].js) for this route
2323
// which is lazy-loaded when the route is visited.
24+
<%_ if (doesCompile) { _%>
2425
component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
26+
<%_ } else { _%>
27+
component: function () {
28+
return import(/* webpackChunkName: "about" */ './views/About.vue')
29+
}
30+
<%_ } _%>
2531
}
2632
]
2733
})

packages/@vue/cli-service/generator/template/src/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ import App from './App.vue'
44
Vue.config.productionTip = false
55

66
new Vue({
7-
render: h => h(App)
7+
<%_ if (doesCompile) { _%>
8+
render: h => h(App),
9+
<%_ } else { _%>
10+
render: function (h) { return h(App) },
11+
<%_ } _%>
812
}).$mount('#app')

packages/@vue/cli-service/lib/commands/serve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function checkInContainer () {
297297
const fs = require('fs')
298298
if (fs.existsSync(`/proc/1/cgroup`)) {
299299
const content = fs.readFileSync(`/proc/1/cgroup`, 'utf-8')
300-
return /:\/(lxc|docker)\//.test(content)
300+
return /:\/(lxc|docker|kubepods)\//.test(content)
301301
}
302302
}
303303

packages/@vue/cli-service/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"chalk": "^2.4.1",
3535
"clipboardy": "^1.2.3",
3636
"cliui": "^4.1.0",
37-
"copy-webpack-plugin": "^4.5.3",
37+
"copy-webpack-plugin": "^4.5.4",
3838
"css-loader": "^1.0.0",
39-
"cssnano": "^4.1.4",
39+
"cssnano": "^4.1.7",
4040
"debug": "^4.1.0",
4141
"escape-string-regexp": "^1.0.5",
4242
"file-loader": "^2.0.0",
@@ -52,7 +52,7 @@
5252
"mini-css-extract-plugin": "^0.4.4",
5353
"minimist": "^1.2.0",
5454
"ora": "^3.0.0",
55-
"portfinder": "^1.0.17",
55+
"portfinder": "^1.0.19",
5656
"postcss-loader": "^3.0.0",
5757
"read-pkg": "^4.0.1",
5858
"semver": "^5.6.0",
@@ -64,10 +64,10 @@
6464
"thread-loader": "^1.2.0",
6565
"url-loader": "^1.1.2",
6666
"vue-loader": "^15.4.2",
67-
"webpack": "^4.20.2",
67+
"webpack": "^4.23.1",
6868
"webpack-bundle-analyzer": "^3.0.3",
6969
"webpack-chain": "^4.11.0",
70-
"webpack-dev-server": "^3.1.9",
70+
"webpack-dev-server": "^3.1.10",
7171
"webpack-merge": "^4.1.4",
7272
"yorkie": "^2.0.0"
7373
},

packages/@vue/cli-ui-addon-webpack/src/components/AssetList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="asset-list list-block">
2+
<div class="asset-list card list-block">
33
<div class="content">
44
<div class="title">
55
{{ $t('org.vue.vue-webpack.dashboard.asset-list.title') }}

packages/@vue/cli-ui-addon-webpack/src/components/BuildProgress.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="build-progress"
3+
class="build-progress card"
44
:class="{
55
[`mode-${mode}`]: true
66
}"

packages/@vue/cli-ui-addon-webpack/src/components/BuildStatus.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="build-status">
2+
<div class="build-status card">
33
<div class="content">
44
<div class="info-block status">
55
<div class="label">

packages/@vue/cli-ui-addon-webpack/src/components/ModuleList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="module-list list-block">
2+
<div class="module-list card list-block">
33
<div class="content">
44
<div class="title">
55
{{ $t('org.vue.vue-webpack.dashboard.module-list.title') }}

packages/@vue/cli-ui-addon-webpack/src/components/SpeedStats.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="speed-stats">
2+
<div class="speed-stats card">
33
<div class="content">
44
<div class="title">
55
{{ $t('org.vue.vue-webpack.dashboard.speed-stats.title') }}

packages/@vue/cli-ui-addon-webpack/src/components/WebpackAnalyzer.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="vue-webpack-analyzer">
3-
<div class="pane-toolbar">
3+
<div class="pane-toolbar card">
44
<VueIcon icon="donut_large"/>
55
<div class="title">{{ $t('org.vue.vue-webpack.analyzer.title') }}</div>
66

@@ -84,7 +84,7 @@
8484
</template>
8585

8686
<div v-if="describedModule" class="described-module">
87-
<div class="wrapper">
87+
<div class="wrapper card">
8888
<div class="path" v-html="modulePath"/>
8989
<div
9090
class="stats size"
@@ -345,10 +345,6 @@ export default {
345345
.pane-toolbar,
346346
.described-module .wrapper
347347
padding $padding-item
348-
background $vue-ui-color-light-neutral
349-
border-radius $br
350-
.vue-ui-dark-mode &
351-
background $vue-ui-color-dark
352348
353349
.content
354350
display flex

packages/@vue/cli-ui-addon-webpack/src/components/WebpackDashboard.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="vue-webpack-dashboard">
3-
<div class="pane-toolbar">
3+
<div class="pane-toolbar card">
44
<VueIcon icon="dashboard"/>
55
<div class="title">{{ $t('org.vue.vue-webpack.dashboard.title') }}</div>
66

@@ -40,7 +40,7 @@
4040
/>
4141
</div>
4242

43-
<div class="content vue-ui-grid default-gap">
43+
<div class="content vue-ui-grid">
4444
<BuildStatus />
4545
<BuildProgress />
4646
<SpeedStats class="span-2"/>
@@ -90,6 +90,7 @@ export default {
9090
.vue-webpack-dashboard
9191
.content
9292
grid-template-columns 9fr 4fr
93+
grid-gap $padding-item
9394
9495
>>>
9596
.title
@@ -124,13 +125,8 @@ export default {
124125
opacity .75
125126
font-size 16px
126127
127-
.pane-toolbar,
128-
.content >>> > div
128+
/deep/ .card
129129
padding $padding-item
130-
background $vue-ui-color-light-neutral
131-
border-radius $br
132-
.vue-ui-dark-mode &
133-
background $vue-ui-color-dark
134130
135131
.pane-toolbar
136132
margin-bottom $padding-item
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8

0 commit comments

Comments
 (0)