Skip to content

Commit b2d6dbd

Browse files
committed
chore: merge branch 'dev' into docs
2 parents 8db6237 + 097be7c commit b2d6dbd

File tree

54 files changed

+1713
-965
lines changed

Some content is hidden

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

54 files changed

+1713
-965
lines changed

CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
1+
# [3.5.0](https://github.com/vuejs/vue-cli/compare/v3.4.1...v3.5.0) (2019-03-08)
2+
3+
## babel-preset-app
4+
5+
#### Bug Fixes
6+
7+
* use an environment variable to determine the entry files to inject default polyfills ([#3565](https://github.com/vuejs/vue-cli/issues/3565)) ([93f57ac](https://github.com/vuejs/vue-cli/commit/93f57ac)), closes [#2983](https://github.com/vuejs/vue-cli/issues/2983)
8+
#### Features
9+
10+
* add `entryFiles` option, allowing explicit polyfill injection to specified files ([#3470](https://github.com/vuejs/vue-cli/issues/3470)) ([7df0c58](https://github.com/vuejs/vue-cli/commit/7df0c58))
11+
12+
## cli
13+
14+
#### Bug Fixes
15+
16+
* add missing package keys to the sort array (issue [#3509](https://github.com/vuejs/vue-cli/issues/3509)) ([#3510](https://github.com/vuejs/vue-cli/issues/3510)) ([6e9ba9b](https://github.com/vuejs/vue-cli/commit/6e9ba9b))
17+
18+
## cli-plugin-babel
19+
20+
#### Features
21+
22+
* add .mjs files as transpileable files ([#3485](https://github.com/vuejs/vue-cli/issues/3485)) ([8562d3e](https://github.com/vuejs/vue-cli/commit/8562d3e))
23+
24+
## cli-plugin-e2e-nightwatch
25+
26+
#### Bug Fixes
27+
28+
* setting env by `-e` in e2e tests ([#3583](https://github.com/vuejs/vue-cli/issues/3583)) ([9aff29d](https://github.com/vuejs/vue-cli/commit/9aff29d))
29+
30+
## cli-plugin-typescript
31+
32+
#### Features
33+
34+
* loosen the restriction of typescript version ([#3542](https://github.com/vuejs/vue-cli/issues/3542)) ([873ad84](https://github.com/vuejs/vue-cli/commit/873ad84))
35+
36+
## cli-plugin-unit-jest
37+
38+
#### Bug Fixes
39+
40+
* lock `[@vue](https://github.com/vue)/test-utils` version as it's still in beta and may introduce breaking changes ([266090d](https://github.com/vuejs/vue-cli/commit/266090d))
41+
42+
## cli-service
43+
44+
#### Bug Fixes
45+
46+
* fix modern mode in monorepo by resolving in the package scope ([14b2c6e](https://github.com/vuejs/vue-cli/commit/14b2c6e)), closes [/github.com/vuejs/vue-cli/pull/3477#issuecomment-466926461](https://github.com//github.com/vuejs/vue-cli/pull/3477/issues/issuecomment-466926461)
47+
* **cli-service:** inspect --rules (close [#3334](https://github.com/vuejs/vue-cli/issues/3334)) ([#3378](https://github.com/vuejs/vue-cli/issues/3378)) ([6f93bfe](https://github.com/vuejs/vue-cli/commit/6f93bfe))
48+
* proxy should warn when array is passed. ([#3525](https://github.com/vuejs/vue-cli/issues/3525)) ([bb4f349](https://github.com/vuejs/vue-cli/commit/bb4f349)), closes [#3524](https://github.com/vuejs/vue-cli/issues/3524)
49+
#### Features
50+
51+
* allow vue.config.js to return a function ([#3499](https://github.com/vuejs/vue-cli/issues/3499)) ([f5b174f](https://github.com/vuejs/vue-cli/commit/f5b174f)), closes [#3213](https://github.com/vuejs/vue-cli/issues/3213)
52+
* support environment variable expansion ([#3534](https://github.com/vuejs/vue-cli/issues/3534)) ([bd57f15](https://github.com/vuejs/vue-cli/commit/bd57f15))
53+
54+
## cli-service-global
55+
56+
#### Features
57+
58+
* warn if run instant prototyping in a project directory ([#3508](https://github.com/vuejs/vue-cli/issues/3508)) ([2de215e](https://github.com/vuejs/vue-cli/commit/2de215e)), closes [#2473](https://github.com/vuejs/vue-cli/issues/2473)
59+
60+
## docs
61+
62+
#### Bug Fixes
63+
64+
* **cli-service:** catch exception if "copy to clipboard" fails (issue [#3476](https://github.com/vuejs/vue-cli/issues/3476)) ([#3503](https://github.com/vuejs/vue-cli/issues/3503)) ([fec38f5](https://github.com/vuejs/vue-cli/commit/fec38f5))
65+
66+
67+
168
# [3.4.1](https://github.com/vuejs/vue-cli/compare/v3.4.0...v3.4.1) (2019-02-20)
269

370
## cli-plugin-babel

docs/guide/cli-service.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ Options:
5252
--https use https (default: false)
5353
```
5454

55+
::: tip --copy
56+
Copying to clipboard might not work on a few platforms.
57+
If copying was successful, `(copied to clipboard)` is displayed next to the local dev server URL.
58+
:::
59+
5560
The `vue-cli-service serve` command starts a dev server (based on [webpack-dev-server](https://github.com/webpack/webpack-dev-server)) that comes with Hot-Module-Replacement (HMR) working out of the box.
5661

5762
In addition to the command line flags, you can also configure the dev server using the [devServer](../config/#devserver) field in `vue.config.js`.

docs/guide/css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = {
121121
sass: {
122122
// @/ is an alias to src/
123123
// so this assumes you have a file named `src/variables.scss`
124-
data: `@import "@/variables.scss";`
124+
data: `@import "~@/variables.scss";`
125125
},
126126
// pass Less.js Options to less-loader
127127
less:{

docs/guide/mode-and-env.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ FOO=bar
4646
VUE_APP_SECRET=secret
4747
```
4848

49-
For more detailed env parsing rules, please refer to [the documentation of `dotenv`](https://github.com/motdotla/dotenv#rules).
49+
For more detailed env parsing rules, please refer to [the documentation of `dotenv`](https://github.com/motdotla/dotenv#rules). We also use [dotenv-expand](https://github.com/motdotla/dotenv-expand) for variable expansion (available in Vue CLI 3.5+).
5050

5151
Loaded variables will become available to all `vue-cli-service` commands, plugins and dependencies.
5252

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"npmClient": "yarn",
33
"useWorkspaces": false,
4-
"version": "3.4.1",
4+
"version": "3.5.0",
55
"packages": [
66
"packages/@vue/babel-preset-app",
77
"packages/@vue/cli*"

package.json

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"pretest": "yarn clean",
1111
"lint": "eslint --fix packages/**/*.js packages/**/bin/*",
1212
"check-links": "node scripts/checkLinks.js",
13-
"clean": "rimraf packages/test/*",
13+
"clean": "rimraf packages/test/* packages/**/temp/*",
1414
"sync": "node scripts/syncDeps.js",
1515
"boot": "node scripts/bootstrap.js",
1616
"release": "yarn --pure-lockfile && yarn clean && node scripts/release.js",
@@ -46,38 +46,41 @@
4646
"@vue/conventional-changelog": "^0.1.1",
4747
"babel-core": "7.0.0-bridge.0",
4848
"babel-eslint": "^10.0.1",
49-
"conventional-changelog": "^3.0.5",
49+
"conventional-changelog": "^3.0.6",
5050
"debug": "^4.1.0",
51-
"eslint": "^5.0.0",
52-
"eslint-plugin-graphql": "^3.0.1",
51+
"eslint": "^5.14.1",
52+
"eslint-plugin-graphql": "^3.0.3",
5353
"eslint-plugin-node": "^8.0.0",
54-
"eslint-plugin-vue": "^5.0.0",
54+
"eslint-plugin-vue": "^5.2.2",
5555
"eslint-plugin-vue-libs": "^3.0.0",
5656
"execa": "^1.0.0",
5757
"globby": "^9.0.0",
58+
"graphql": "^14.0.2",
5859
"http-server": "^0.11.1",
5960
"inquirer": "^6.0.0",
6061
"jest": "^23.1.0",
61-
"lerna": "^3.4.3",
62-
"lint-staged": "^8.1.0",
63-
"memfs": "^2.8.0",
62+
"lerna": "^3.13.0",
63+
"lint-staged": "^8.1.4",
64+
"memfs": "^2.15.2",
6465
"minimist": "^1.2.0",
65-
"puppeteer": "^1.0.0",
6666
"request": "^2.83.0",
67-
"request-promise-native": "^1.0.5",
67+
"request-promise-native": "^1.0.7",
6868
"rimraf": "^2.6.2",
6969
"semver": "^5.5.0",
70-
"vuepress": "^0.14.1",
70+
"typescript": "^3.3.3333",
71+
"vuepress": "^0.14.9",
7172
"vuepress-theme-vue": "^1.1.0",
73+
"webpack": ">=4 < 4.29",
7274
"yorkie": "^2.0.0"
7375
},
7476
"resolutions": {
7577
"@babel/core": "^7.0.0",
7678
"@babel/preset-env": "^7.0.0",
7779
"babel-core": "7.0.0-bridge.0",
7880
"ps-tree": "^1.1.1",
79-
"vue": "^2.5.22",
80-
"vue-template-compiler": "^2.5.22",
81-
"vue-server-renderer": "^2.5.22"
81+
"puppeteer": "1.11.0",
82+
"vue": "^2.6.7",
83+
"vue-template-compiler": "^2.6.7",
84+
"vue-server-renderer": "^2.6.7"
8285
}
8386
}

packages/@vue/babel-preset-app/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This is the default Babel preset used in all Vue CLI projects. **Note: this pres
1818

1919
### Stage 3 or Below
2020

21-
Only the following stage 3 or below features are supported (object reset spread is supported as part of `preset-env`):
21+
Only the following stage 3 or below features are supported (object rest spread is supported as part of `preset-env`):
2222

2323
- [Dynamic Import Syntax](https://github.com/tc39/proposal-dynamic-import)
2424
- [Proposal Class Properties](https://babeljs.io/docs/en/next/babel-plugin-proposal-class-properties.html)
@@ -97,3 +97,9 @@ Set to `false` to disable JSX support.
9797
- Default: `false`.
9898

9999
Setting this to `true` will generate code that is more performant but less spec-compliant.
100+
101+
### entryFiles
102+
103+
- Default: `[]`
104+
105+
Multi page repo use `entryFiles` to ensure inject polyfills to all entry file.

packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1+
const path = require('path')
12
const babel = require('@babel/core')
23
const preset = require('../index')
34
const defaultOptions = {
45
babelrc: false,
5-
presets: [preset]
6+
presets: [preset],
7+
filename: 'test-entry-file.js'
68
}
79

10+
beforeEach(() => {
11+
process.env.VUE_CLI_ENTRY_FILES = JSON.stringify([path.join(process.cwd(), 'test-entry-file.js')])
12+
})
13+
814
test('polyfill detection', () => {
915
let { code } = babel.transformSync(`
1016
const a = new Map()
1117
`.trim(), {
1218
babelrc: false,
1319
presets: [[preset, {
1420
targets: { node: 'current' }
15-
}]]
21+
}]],
22+
filename: 'test-entry-file.js'
1623
})
17-
// default i ncludes
24+
// default includes
1825
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
1926
// usage-based detection
2027
expect(code).not.toMatch(`import "core-js/modules/es6.map"`)
@@ -25,7 +32,8 @@ test('polyfill detection', () => {
2532
babelrc: false,
2633
presets: [[preset, {
2734
targets: { ie: 9 }
28-
}]]
35+
}]],
36+
filename: 'test-entry-file.js'
2937
}))
3038
// default includes
3139
expect(code).toMatch(`import "core-js/modules/es6.promise"`)
@@ -44,7 +52,8 @@ test('modern mode always skips polyfills', () => {
4452
presets: [[preset, {
4553
targets: { ie: 9 },
4654
useBuiltIns: 'usage'
47-
}]]
55+
}]],
56+
filename: 'test-entry-file.js'
4857
})
4958
// default includes
5059
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
@@ -58,7 +67,8 @@ test('modern mode always skips polyfills', () => {
5867
presets: [[preset, {
5968
targets: { ie: 9 },
6069
useBuiltIns: 'entry'
61-
}]]
70+
}]],
71+
filename: 'test-entry-file.js'
6272
}))
6373
// default includes
6474
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
@@ -133,7 +143,8 @@ test('disable absoluteRuntime', () => {
133143
babelrc: false,
134144
presets: [[preset, {
135145
absoluteRuntime: false
136-
}]]
146+
}]],
147+
filename: 'test-entry-file.js'
137148
})
138149

139150
expect(code).toMatch('import _toConsumableArray from "@babel/runtime-corejs2/helpers/esm/toConsumableArray"')

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function getPolyfills (targets, includes, { ignoreBrowserslistConfig, configPath
3030
module.exports = (context, options = {}) => {
3131
const presets = []
3232
const plugins = []
33+
const defaultEntryFiles = JSON.parse(process.env.VUE_CLI_ENTRY_FILES || '[]')
3334

3435
// JSX
3536
if (options.jsx !== false) {
@@ -52,6 +53,8 @@ module.exports = (context, options = {}) => {
5253
forceAllTransforms,
5354
decoratorsBeforeExport,
5455
decoratorsLegacy,
56+
// entry file list
57+
entryFiles = defaultEntryFiles,
5558

5659
// Undocumented option of @babel/plugin-transform-runtime.
5760
// When enabled, an absolute path is used when importing a runtime helper atfer tranforming.
@@ -103,7 +106,7 @@ module.exports = (context, options = {}) => {
103106
ignoreBrowserslistConfig,
104107
configPath
105108
})
106-
plugins.push([require('./polyfillsPlugin'), { polyfills }])
109+
plugins.push([require('./polyfillsPlugin'), { polyfills, entryFiles }])
107110
} else {
108111
polyfills = []
109112
}

packages/@vue/babel-preset-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/babel-preset-app",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"description": "babel-preset-app for vue-cli",
55
"main": "index.js",
66
"publishConfig": {

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// add polyfill imports to the first file encountered.
2-
module.exports = ({ types }) => {
3-
let entryFile
2+
module.exports = ({ types }, { entryFiles = [] }) => {
43
return {
54
name: 'vue-cli-inject-polyfills',
65
visitor: {
76
Program (path, state) {
8-
if (!entryFile) {
9-
entryFile = state.filename
10-
} else if (state.filename !== entryFile) {
7+
if (!entryFiles.includes(state.filename)) {
118
return
129
}
1310

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-init",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"description": "init addon for vue-cli",
55
"main": "index.js",
66
"publishConfig": {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-overlay",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"description": "error overlay & dev server middleware for vue-cli",
55
"main": "dist/client.js",
66
"files": [

packages/@vue/cli-plugin-babel/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = (api, options) => {
2525

2626
const jsRule = webpackConfig.module
2727
.rule('js')
28-
.test(/\.jsx?$/)
28+
.test(/\.m?jsx?$/)
2929
.exclude
3030
.add(filepath => {
3131
// always transpile js in vue files

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-babel",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"description": "babel plugin for vue-cli",
55
"main": "index.js",
66
"repository": {
@@ -21,8 +21,8 @@
2121
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
2222
"dependencies": {
2323
"@babel/core": "^7.0.0",
24-
"@vue/babel-preset-app": "^3.4.1",
25-
"@vue/cli-shared-utils": "^3.4.1",
24+
"@vue/babel-preset-app": "^3.5.0",
25+
"@vue/cli-shared-utils": "^3.5.0",
2626
"babel-loader": "^8.0.5",
2727
"webpack": ">=4 < 4.29"
2828
},

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-e2e-cypress",
3-
"version": "3.4.1",
3+
"version": "3.5.0",
44
"description": "e2e-cypress plugin for vue-cli",
55
"main": "index.js",
66
"repository": {
@@ -23,8 +23,8 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26-
"@vue/cli-shared-utils": "^3.4.1",
26+
"@vue/cli-shared-utils": "^3.5.0",
2727
"cypress": "^3.1.5",
28-
"eslint-plugin-cypress": "^2.2.0"
28+
"eslint-plugin-cypress": "^2.2.1"
2929
}
3030
}

packages/@vue/cli-plugin-e2e-nightwatch/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = (api, options) => {
3737
rawArgs.push('--config', require.resolve('./nightwatch.config.js'))
3838
}
3939

40-
if (rawArgs.indexOf('--env') === -1) {
40+
if (rawArgs.indexOf('--env') === -1 && rawArgs.indexOf('-e') === -1) {
4141
rawArgs.push('--env', 'chrome')
4242
}
4343

0 commit comments

Comments
 (0)