Skip to content

Commit 4f2c718

Browse files
author
Guillaume Chau
committed
chore: merge dev
2 parents 7482244 + 5bab29a commit 4f2c718

File tree

43 files changed

+308
-103
lines changed

Some content is hidden

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

43 files changed

+308
-103
lines changed

CHANGELOG.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
<a name="3.0.0-beta.11"></a>
2+
# [3.0.0-beta.11](https://github.com/vuejs/vue-cli/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2018-05-21)
3+
4+
5+
### Bug Fixes
6+
7+
* css sourceMap in production ([#1270](https://github.com/vuejs/vue-cli/issues/1270)) ([2d09a4c](https://github.com/vuejs/vue-cli/commit/2d09a4c))
8+
* **css:** css-loader importLoaders should account for vue-loader's injected ([853662c](https://github.com/vuejs/vue-cli/commit/853662c)), closes [#1267](https://github.com/vuejs/vue-cli/issues/1267)
9+
* fix babel.config.js compat in vue-jest ([48d7e00](https://github.com/vuejs/vue-cli/commit/48d7e00))
10+
* fix transpileDependencies by always using babel.config.js ([1279b3e](https://github.com/vuejs/vue-cli/commit/1279b3e))
11+
* **eslint:** ensure all config values are contained in config file ([83f5f4f](https://github.com/vuejs/vue-cli/commit/83f5f4f)), closes [#1006](https://github.com/vuejs/vue-cli/issues/1006) [#1313](https://github.com/vuejs/vue-cli/issues/1313)
12+
* fix ts/tsx rule separation ([41a56f1](https://github.com/vuejs/vue-cli/commit/41a56f1)), closes [#1315](https://github.com/vuejs/vue-cli/issues/1315)
13+
* handle failed git commit ([a1ccde8](https://github.com/vuejs/vue-cli/commit/a1ccde8)), closes [#1306](https://github.com/vuejs/vue-cli/issues/1306)
14+
* rename test-utils `shallow` to `shallowMount` ([#1269](https://github.com/vuejs/vue-cli/issues/1269)) ([5c54df7](https://github.com/vuejs/vue-cli/commit/5c54df7))
15+
* stringifyJS should be used in all call sites ([07ac887](https://github.com/vuejs/vue-cli/commit/07ac887))
16+
* typo in vue-loader compilerOptions ([#1263](https://github.com/vuejs/vue-cli/issues/1263)) ([b2b277a](https://github.com/vuejs/vue-cli/commit/b2b277a))
17+
18+
19+
### Features
20+
21+
* **build:** add 'watch' option ([#1332](https://github.com/vuejs/vue-cli/issues/1332)) ([6ea17c9](https://github.com/vuejs/vue-cli/commit/6ea17c9))
22+
* **cli-service:** add assetsDir option to specify assets root directory ([#1322](https://github.com/vuejs/vue-cli/issues/1322)) ([9638d90](https://github.com/vuejs/vue-cli/commit/9638d90)), closes [#1311](https://github.com/vuejs/vue-cli/issues/1311)
23+
* **eslint:** add --max-warnings and --max-errors for cli-plugin-eslint ([#1289](https://github.com/vuejs/vue-cli/issues/1289)) ([ab877a2](https://github.com/vuejs/vue-cli/commit/ab877a2)), closes [#1268](https://github.com/vuejs/vue-cli/issues/1268)
24+
* **eslint:** enable caching ([ff0f97b](https://github.com/vuejs/vue-cli/commit/ff0f97b))
25+
* **eslint:** pass cli arguments to linter ([#1258](https://github.com/vuejs/vue-cli/issues/1258)) ([9ac2642](https://github.com/vuejs/vue-cli/commit/9ac2642)), closes [#1255](https://github.com/vuejs/vue-cli/issues/1255)
26+
* **inspect:** add --rule and --plugin options for inspect command ([82349ba](https://github.com/vuejs/vue-cli/commit/82349ba))
27+
* **inspect:** add --rules and --plugins options for inspect command ([fd1c0d5](https://github.com/vuejs/vue-cli/commit/fd1c0d5))
28+
* support `<style lang="postcss">` ([#1259](https://github.com/vuejs/vue-cli/issues/1259)) ([1037b9c](https://github.com/vuejs/vue-cli/commit/1037b9c))
29+
* **inspect:** improve `vue inspect` output with webpack-chain hints ([f6bfb63](https://github.com/vuejs/vue-cli/commit/f6bfb63)), closes [#881](https://github.com/vuejs/vue-cli/issues/881)
30+
* allow disabling serve progress via devServer.progress ([da38747](https://github.com/vuejs/vue-cli/commit/da38747)), closes [#1284](https://github.com/vuejs/vue-cli/issues/1284)
31+
* allow router/vuex to be late added via `vue add` ([2a195f0](https://github.com/vuejs/vue-cli/commit/2a195f0)), closes [#1202](https://github.com/vuejs/vue-cli/issues/1202) [#1204](https://github.com/vuejs/vue-cli/issues/1204)
32+
* ask for whether to use taobao registry when getting versions ([#1273](https://github.com/vuejs/vue-cli/issues/1273)) ([8fbbd35](https://github.com/vuejs/vue-cli/commit/8fbbd35))
33+
* GeneratorAPI: addImports & addRootOptions ([8b32f4a](https://github.com/vuejs/vue-cli/commit/8b32f4a))
34+
* make it possible to opt-out of Babel ([d75ea99](https://github.com/vuejs/vue-cli/commit/d75ea99)), closes [#1199](https://github.com/vuejs/vue-cli/issues/1199)
35+
* support webp ([763cf7a](https://github.com/vuejs/vue-cli/commit/763cf7a)), closes [#1321](https://github.com/vuejs/vue-cli/issues/1321)
36+
* temporarily fix source map by patching babel ([453597a](https://github.com/vuejs/vue-cli/commit/453597a))
37+
38+
39+
140
<a name="3.0.0-beta.10"></a>
241
# [3.0.0-beta.10](https://github.com/vuejs/vue-cli/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2018-05-11)
342

@@ -54,7 +93,7 @@ modifications must be webpcak 4 compatible. Drop support
5493
for webpack plugins that do not work with v4 or above.
5594
* dll option has been removed.
5695
* the "vueLoader" option has been removed. To modify vue-loader
57-
options, use chainWebpack then `config.module.rule('vue').use('vue-loader').tap()`.
96+
options, use chainWebpack then `config.module.rule(vue).use(vue-loader).tap()`.
5897
vue-loader has been upgraded to v15 and expects different options from v14.
5998
* To include a dependency for Babel transpilation, tapping
6099
babel-loader and adding .include() will no longer work. Use the new

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"lerna": "2.5.1",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
5-
"version": "3.0.0-beta.10"
5+
"version": "3.0.0-beta.11"
66
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/babel-preset-app",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "babel-preset-app for vue-cli",
55
"main": "index.js",
66
"publishConfig": {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-init",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "init addon for vue-cli",
55
"main": "index.js",
66
"publishConfig": {

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

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-babel",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "babel plugin for vue-cli",
55
"main": "index.js",
66
"repository": {
@@ -20,7 +20,7 @@
2020
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/cli-plugin-babel#readme",
2121
"dependencies": {
2222
"@babel/core": "7.0.0-beta.47",
23-
"@vue/babel-preset-app": "^3.0.0-beta.10",
23+
"@vue/babel-preset-app": "^3.0.0-beta.11",
2424
"babel-loader": "^8.0.0-0"
2525
},
2626
"publishConfig": {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-e2e-cypress",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "e2e-cypress plugin for vue-cli",
55
"main": "index.js",
66
"repository": {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-e2e-nightwatch",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "e2e-nightwatch plugin for vue-cli",
55
"main": "index.js",
66
"repository": {

packages/@vue/cli-plugin-eslint/generator.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ module.exports = (api, { config, lintOn = [] }) => {
1616
if (config === 'airbnb') {
1717
eslintConfig.extends.push('@vue/airbnb')
1818
Object.assign(pkg.devDependencies, {
19-
'@vue/eslint-config-airbnb': '^3.0.0-beta.10'
19+
'@vue/eslint-config-airbnb': '^3.0.0-beta.11'
2020
})
2121
} else if (config === 'standard') {
2222
eslintConfig.extends.push('@vue/standard')
2323
Object.assign(pkg.devDependencies, {
24-
'@vue/eslint-config-standard': '^3.0.0-beta.10'
24+
'@vue/eslint-config-standard': '^3.0.0-beta.11'
2525
})
2626
} else if (config === 'prettier') {
2727
eslintConfig.extends.push('@vue/prettier')
2828
Object.assign(pkg.devDependencies, {
29-
'@vue/eslint-config-prettier': '^3.0.0-beta.10'
29+
'@vue/eslint-config-prettier': '^3.0.0-beta.11'
3030
})
3131
} else {
3232
// default
@@ -37,7 +37,7 @@ module.exports = (api, { config, lintOn = [] }) => {
3737
if (api.hasPlugin('typescript')) {
3838
eslintConfig.extends.push('@vue/typescript')
3939
Object.assign(pkg.devDependencies, {
40-
'@vue/eslint-config-typescript': '^3.0.0-beta.10'
40+
'@vue/eslint-config-typescript': '^3.0.0-beta.11'
4141
})
4242
}
4343

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-eslint",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "eslint plugin for vue-cli",
55
"main": "index.js",
66
"repository": {
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
const generateWithPlugin = require('@vue/cli-test-utils/generateWithPlugin')
22

33
test('inject import statement for service worker', async () => {
4-
const mockMain = (
5-
`import Vue from 'vue'\n` +
6-
`import Bar from './Bar.vue'`
7-
)
84
const { files } = await generateWithPlugin([
95
{
10-
id: 'files',
11-
apply: api => {
12-
api.render(files => {
13-
files['src/main.js'] = mockMain
14-
})
15-
},
6+
id: 'core',
7+
apply: require('@vue/cli-service/generator'),
168
options: {}
179
},
1810
{
@@ -22,5 +14,27 @@ test('inject import statement for service worker', async () => {
2214
}
2315
])
2416

25-
expect(files['src/main.js']).toMatch(`${mockMain}\nimport './registerServiceWorker'`)
17+
expect(files['src/main.js']).toMatch(`import './registerServiceWorker'`)
18+
})
19+
20+
test('inject import statement for service worker (with TS)', async () => {
21+
const { files } = await generateWithPlugin([
22+
{
23+
id: 'core',
24+
apply: require('@vue/cli-service/generator'),
25+
options: {}
26+
},
27+
{
28+
id: 'typescript',
29+
apply: require('@vue/cli-plugin-typescript/generator'),
30+
options: {}
31+
},
32+
{
33+
id: 'pwa',
34+
apply: require('../generator'),
35+
options: {}
36+
}
37+
])
38+
39+
expect(files['src/main.ts']).toMatch(`import './registerServiceWorker'`)
2640
})

packages/@vue/cli-plugin-pwa/generator/index.js

+1-16
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ module.exports = api => {
44
'register-service-worker': '^1.0.0'
55
}
66
})
7-
7+
api.injectImports(`src/main.js`, `import './registerServiceWorker'`)
88
api.render('./template')
9-
10-
api.postProcessFiles(files => {
11-
const isTS = 'src/main.ts' in files
12-
const file = isTS
13-
? 'src/main.ts'
14-
: 'src/main.js'
15-
const main = files[file]
16-
if (main) {
17-
// inject import for registerServiceWorker script into main.js
18-
const lines = main.split(/\r?\n/g).reverse()
19-
const lastImportIndex = lines.findIndex(line => line.match(/^import/))
20-
lines[lastImportIndex] += `\nimport './registerServiceWorker'`
21-
files[file] = lines.reverse().join('\n')
22-
}
23-
})
249
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-pwa",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "pwa plugin for vue-cli",
55
"main": "index.js",
66
"repository": {

packages/@vue/cli-plugin-typescript/generator/template/src/views/Home.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
extend: '@vue/cli-service/generator/template/src/views/Home.vue'
2+
extend: '@vue/cli-service/generator/router/template/src/views/Home.vue'
33
replace:
44
- !!js/regexp /Welcome to Your Vue\.js App/
55
- !!js/regexp /<script>[^]*?<\/script>/

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-typescript",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "typescript plugin for vue-cli",
55
"main": "index.js",
66
"repository": {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-unit-jest",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "unit-jest plugin for vue-cli",
55
"main": "index.js",
66
"repository": {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-plugin-unit-mocha",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "mocha unit testing plugin for vue-cli",
55
"main": "index.js",
66
"repository": {

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/cli-service-global",
3-
"version": "3.0.0-beta.10",
3+
"version": "3.0.0-beta.11",
44
"description": "vue-cli-service global addon for vue-cli",
55
"main": "index.js",
66
"publishConfig": {
@@ -21,10 +21,10 @@
2121
},
2222
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/cli-build#readme",
2323
"dependencies": {
24-
"@vue/babel-preset-app": "^3.0.0-beta.10",
25-
"@vue/cli-plugin-babel": "^3.0.0-beta.10",
26-
"@vue/cli-plugin-eslint": "^3.0.0-beta.10",
27-
"@vue/cli-service": "^3.0.0-beta.10",
24+
"@vue/babel-preset-app": "^3.0.0-beta.11",
25+
"@vue/cli-plugin-babel": "^3.0.0-beta.11",
26+
"@vue/cli-plugin-eslint": "^3.0.0-beta.11",
27+
"@vue/cli-service": "^3.0.0-beta.11",
2828
"chalk": "^2.4.1",
2929
"eslint-plugin-vue": "^4.5.0",
3030
"resolve": "^1.7.1",

packages/@vue/cli-service/__tests__/Service.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test('loading plugins from package.json', () => {
3838
mockPkg({
3939
devDependencies: {
4040
'bar': '^1.0.0',
41-
'@vue/cli-plugin-babel': '^3.0.0-beta.10',
41+
'@vue/cli-plugin-babel': '^3.0.0-beta.11',
4242
'vue-cli-plugin-foo': '^1.0.0'
4343
}
4444
})

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

+2-10
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ module.exports = (api, options) => {
2525
})
2626

2727
if (options.router) {
28-
api.extendPackage({
29-
dependencies: {
30-
'vue-router': '^3.0.1'
31-
}
32-
})
28+
require('./router')(api, options)
3329
}
3430

3531
if (options.vuex) {
36-
api.extendPackage({
37-
dependencies: {
38-
vuex: '^3.0.1'
39-
}
40-
})
32+
require('./vuex')(api, options)
4133
}
4234

4335
if (options.cssPreprocessor) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = (api, options) => {
2+
api.injectImports(`src/main.js`, `import router from './router'`)
3+
api.injectRootOptions(`src/main.js`, `router`)
4+
api.extendPackage({
5+
dependencies: {
6+
'vue-router': '^3.0.1'
7+
}
8+
})
9+
api.render('./template')
10+
11+
if (options.invoking) {
12+
api.postProcessFiles(files => {
13+
const appFile = files[`src/App.vue`]
14+
if (appFile) {
15+
files[`src/App.vue`] = appFile.replace(/^<template>[^]+<\/script>/, `
16+
<template>
17+
<div id="app">
18+
<div id="nav">
19+
<router-link to="/">Home</router-link> |
20+
<router-link to="/about">About</router-link>
21+
</div>
22+
<router-view/>
23+
</div>
24+
</template>
25+
`.trim())
26+
console.log(files[`src/App.vue`])
27+
}
28+
})
29+
}
30+
}

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

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<%_ if (rootOptions.router) { _%>
21
import Vue from 'vue'
32
import Router from 'vue-router'
43
import Home from './views/Home.vue'
@@ -20,4 +19,3 @@ export default new Router({
2019
}
2120
]
2221
})
23-
<%_ } _%>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
<%_ if (rootOptions.router) { _%>
21
<template>
32
<div class="about">
43
<h1>This is an about page</h1>
54
</div>
65
</template>
7-
<%_ } _%>

packages/@vue/cli-service/generator/template/src/views/Home.vue renamed to packages/@vue/cli-service/generator/router/template/src/views/Home.vue

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<%_ if (rootOptions.router) { _%>
21
<template>
32
<div class="home">
43
<img src="../assets/logo.png">
@@ -17,4 +16,3 @@ export default {
1716
}
1817
}
1918
</script>
20-
<%_ } _%>
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
import Vue from 'vue'
22
import App from './App.vue'
3-
<%_ if (rootOptions.router) { _%>
4-
import router from './router'
5-
<%_ } _%>
6-
<%_ if (rootOptions.vuex) { _%>
7-
import store from './store'
8-
<%_ } _%>
93

104
Vue.config.productionTip = false
115

126
new Vue({
13-
<%_ if (rootOptions.router) { _%>
14-
router,
15-
<%_ } _%>
16-
<%_ if (rootOptions.vuex) { _%>
17-
store,
18-
<%_ } _%>
197
render: h => h(App)
208
}).$mount('#app')

0 commit comments

Comments
 (0)