Skip to content

Commit d7c8930

Browse files
committed
chore: merge branch 'dev' into docs [ci skip]
2 parents fbc25fc + c9aaa2f commit d7c8930

File tree

30 files changed

+973
-496
lines changed

30 files changed

+973
-496
lines changed

.circleci/config.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ jobs:
1818
- checkout
1919
- restore_cache:
2020
keys:
21-
- v1-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
22-
- v1-vue-cli-{{ .Branch }}-
23-
- v1-vue-cli
21+
- v2-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
2422
- run: yarn --network-timeout 600000
2523
- save_cache:
26-
key: v1-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
24+
key: v2-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
2725
paths:
2826
- node_modules/
2927
- ~/.cache
@@ -61,7 +59,8 @@ jobs:
6159
steps:
6260
- attach_workspace:
6361
at: ~/
64-
- run: yarn test -p unit-mocha,unit-jest,e2e-nightwatch,e2e-cypress
62+
- run: yarn test -p unit-mocha,unit-jest,e2e-cypress
63+
# e2e-nightwatch was left out due to some unknown issues with selenium and the CI image
6564
- run: yarn test tsPluginE2e
6665

6766
cli-ui:

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@
4646
"@vue/conventional-changelog": "^0.1.1",
4747
"babel-core": "7.0.0-bridge.0",
4848
"babel-eslint": "^10.0.1",
49-
"conventional-changelog": "^1.1.24",
50-
"debug": "^3.1.0",
49+
"conventional-changelog": "^3.0.5",
50+
"debug": "^4.1.0",
5151
"eslint": "^5.0.0",
52-
"eslint-plugin-graphql": "^2.1.1",
53-
"eslint-plugin-node": "^6.0.1",
52+
"eslint-plugin-graphql": "^3.0.1",
53+
"eslint-plugin-node": "^8.0.0",
5454
"eslint-plugin-vue": "^5.0.0",
55-
"eslint-plugin-vue-libs": "^2.1.0",
55+
"eslint-plugin-vue-libs": "^3.0.0",
5656
"execa": "^1.0.0",
5757
"globby": "^8.0.1",
5858
"http-server": "^0.11.1",
5959
"inquirer": "^6.0.0",
6060
"jest": "^23.1.0",
6161
"lerna": "^3.4.3",
62-
"lint-staged": "^7.2.2",
62+
"lint-staged": "^8.1.0",
6363
"memfs": "^2.8.0",
6464
"minimist": "^1.2.0",
6565
"puppeteer": "^1.0.0",
@@ -76,8 +76,8 @@
7676
"@babel/preset-env": "^7.0.0",
7777
"babel-core": "7.0.0-bridge.0",
7878
"ps-tree": "^1.1.1",
79-
"vue": "2.5.17",
80-
"vue-template-compiler": "2.5.17",
81-
"vue-server-renderer": "2.5.17"
79+
"vue": "2.5.21",
80+
"vue-template-compiler": "2.5.21",
81+
"vue-server-renderer": "2.5.21"
8282
}
8383
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('polyfill detection', () => {
1414
targets: { node: 'current' }
1515
}]]
1616
})
17-
// default includes
17+
// default i ncludes
1818
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
1919
// usage-based detection
2020
expect(code).not.toMatch(`import "core-js/modules/es6.map"`)
@@ -32,7 +32,7 @@ test('polyfill detection', () => {
3232
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
3333
expect(code).toMatch(`import "core-js/modules/es6.array.iterator"`)
3434
// usage-based detection
35-
expect(code).toMatch(`import "core-js/modules/es6.map"`)
35+
expect(code).toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
3636
})
3737

3838
test('modern mode always skips polyfills', () => {
@@ -49,7 +49,7 @@ test('modern mode always skips polyfills', () => {
4949
// default includes
5050
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
5151
// usage-based detection
52-
expect(code).not.toMatch(`import "core-js/modules/es6.map"`)
52+
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
5353

5454
;({ code } = babel.transformSync(`
5555
const a = new Map()
@@ -63,7 +63,7 @@ test('modern mode always skips polyfills', () => {
6363
// default includes
6464
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
6565
// usage-based detection
66-
expect(code).not.toMatch(`import "core-js/modules/es6.map"`)
66+
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
6767
delete process.env.VUE_CLI_MODERN_BUILD
6868
})
6969

@@ -92,7 +92,7 @@ test('async/await', () => {
9292
// should use regenerator runtime
9393
expect(code).toMatch(`import "regenerator-runtime/runtime"`)
9494
// should use required helper instead of inline
95-
expect(code).toMatch(/@babel.*runtime\/helpers\/.*asyncToGenerator/)
95+
expect(code).toMatch(/import _asyncToGenerator from ".*runtime-corejs2\/helpers\/esm\/asyncToGenerator\"/)
9696
})
9797

9898
test('jsx', () => {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ module.exports = (context, options = {}) => {
142142
// transform runtime, but only for helpers
143143
plugins.push([require('@babel/plugin-transform-runtime'), {
144144
regenerator: useBuiltIns !== 'usage',
145-
corejs: useBuiltIns !== false ? false : 2,
145+
// use @babel/runtime-corejs2 so that helpers that need polyfillable APIs will reference core-js instead.
146+
// if useBuiltIns is not set to 'usage', then it means users would take care of the polyfills on their own,
147+
// i.e., core-js 2 is no longer needed.
148+
corejs: (useBuiltIns === 'usage' && !process.env.VUE_CLI_MODERN_BUILD) ? 2 : false,
146149
helpers: useBuiltIns === 'usage',
147150
useESModules: !process.env.VUE_CLI_BABEL_TRANSPILE_MODULES,
148151
absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json'))

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
"@babel/plugin-transform-runtime": "^7.0.0",
2929
"@babel/preset-env": "^7.0.0",
3030
"@babel/runtime": "^7.0.0",
31+
"@babel/runtime-corejs2": "^7.2.0",
3132
"babel-helper-vue-jsx-merge-props": "^2.0.3",
3233
"babel-plugin-dynamic-import-node": "^2.2.0",
3334
"babel-plugin-transform-vue-jsx": "^4.0.1",
34-
"core-js": "^2.5.7"
35+
"core-js": "^2.6.0"
3536
}
3637
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@vue/cli-shared-utils": "^3.2.0",
26-
"cypress": "^3.1.2",
27-
"eslint-plugin-cypress": "^2.1.2"
26+
"cypress": "^3.1.3",
27+
"eslint-plugin-cypress": "^2.1.3"
2828
}
2929
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
},
2424
"dependencies": {
2525
"@vue/cli-shared-utils": "^3.2.0",
26-
"chromedriver": "^2.44.0",
27-
"deepmerge": "^2.2.1",
26+
"chromedriver": "^2.45.0",
27+
"deepmerge": "^3.0.0",
2828
"execa": "^1.0.0",
2929
"nightwatch": "^0.9.21",
3030
"selenium-server": "^3.141.59"

packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,22 @@ test('should not fix with --no-fix option', async () => {
120120
// files should not have been fixed
121121
expect(await read('src/main.js')).not.toMatch(';')
122122
})
123+
124+
// #3167
125+
test('should not throw when src folder is ignored by .eslintignore', async () => {
126+
const project = await create('eslint-ignore', {
127+
plugins: {
128+
'@vue/cli-plugin-babel': {},
129+
'@vue/cli-plugin-eslint': {
130+
config: 'airbnb',
131+
lintOn: 'commit'
132+
}
133+
}
134+
})
135+
136+
const { write, run } = project
137+
await write('.eslintignore', 'src\n')
138+
139+
// should not throw
140+
await run('vue-cli-service lint')
141+
})

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = (api, { config, lintOn = [] }, _, invoking) => {
5454
} else if (config === 'prettier') {
5555
eslintConfig.extends.push('@vue/prettier')
5656
Object.assign(pkg.devDependencies, {
57-
'@vue/eslint-config-prettier': '^4.0.0'
57+
'@vue/eslint-config-prettier': '^4.0.1'
5858
})
5959
// prettier & default config do not have any style rules
6060
// so no need to generate an editorconfig file
@@ -71,7 +71,7 @@ module.exports = (api, { config, lintOn = [] }, _, invoking) => {
7171

7272
if (lintOn.includes('commit')) {
7373
Object.assign(pkg.devDependencies, {
74-
'lint-staged': '^7.2.2'
74+
'lint-staged': '^8.1.0'
7575
})
7676
pkg.gitHooks = {
7777
'pre-commit': 'lint-staged'

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,27 @@ module.exports = function lint (args = {}, api) {
3131
cwd
3232
}, argsConfig)
3333

34+
const engine = new CLIEngine(config)
35+
36+
// .eslintrc.js files (ignored by default)
37+
const dotFiles = [
38+
'.*.js',
39+
'{src,tests}/**/.*.js'
40+
].filter(pattern => globby.sync(path.join(cwd, pattern)).length)
41+
3442
const defaultFilesToLint = [
3543
'src',
3644
'tests',
3745
// root config files
38-
'*.js',
39-
// .eslintrc files (ignored by default)
40-
'.*.js',
41-
'{src,tests}/**/.*.js'
42-
].filter(pattern => globby.sync(path.join(cwd, pattern)).length)
46+
'*.js'
47+
]
48+
.filter(pattern =>
49+
globby
50+
.sync(path.join(cwd, pattern))
51+
.some(p => !engine.isPathIgnored(p))
52+
)
53+
.concat(dotFiles)
4354

44-
const engine = new CLIEngine(config)
4555
const files = args._ && args._.length
4656
? args._
4757
: defaultFilesToLint

0 commit comments

Comments
 (0)