Skip to content

Commit

Permalink
chore: merge branch 'dev' into docs [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Dec 29, 2018
2 parents fbc25fc + c9aaa2f commit d7c8930
Show file tree
Hide file tree
Showing 30 changed files with 973 additions and 496 deletions.
9 changes: 4 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v1-vue-cli-{{ .Branch }}-
- v1-vue-cli
- v2-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: yarn --network-timeout 600000
- save_cache:
key: v1-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
key: v2-vue-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
- ~/.cache
Expand Down Expand Up @@ -61,7 +59,8 @@ jobs:
steps:
- attach_workspace:
at: ~/
- run: yarn test -p unit-mocha,unit-jest,e2e-nightwatch,e2e-cypress
- run: yarn test -p unit-mocha,unit-jest,e2e-cypress
# e2e-nightwatch was left out due to some unknown issues with selenium and the CI image
- run: yarn test tsPluginE2e

cli-ui:
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@
"@vue/conventional-changelog": "^0.1.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"conventional-changelog": "^1.1.24",
"debug": "^3.1.0",
"conventional-changelog": "^3.0.5",
"debug": "^4.1.0",
"eslint": "^5.0.0",
"eslint-plugin-graphql": "^2.1.1",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-graphql": "^3.0.1",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-vue": "^5.0.0",
"eslint-plugin-vue-libs": "^2.1.0",
"eslint-plugin-vue-libs": "^3.0.0",
"execa": "^1.0.0",
"globby": "^8.0.1",
"http-server": "^0.11.1",
"inquirer": "^6.0.0",
"jest": "^23.1.0",
"lerna": "^3.4.3",
"lint-staged": "^7.2.2",
"lint-staged": "^8.1.0",
"memfs": "^2.8.0",
"minimist": "^1.2.0",
"puppeteer": "^1.0.0",
Expand All @@ -76,8 +76,8 @@
"@babel/preset-env": "^7.0.0",
"babel-core": "7.0.0-bridge.0",
"ps-tree": "^1.1.1",
"vue": "2.5.17",
"vue-template-compiler": "2.5.17",
"vue-server-renderer": "2.5.17"
"vue": "2.5.21",
"vue-template-compiler": "2.5.21",
"vue-server-renderer": "2.5.21"
}
}
10 changes: 5 additions & 5 deletions packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test('polyfill detection', () => {
targets: { node: 'current' }
}]]
})
// default includes
// default i ncludes
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
// usage-based detection
expect(code).not.toMatch(`import "core-js/modules/es6.map"`)
Expand All @@ -32,7 +32,7 @@ test('polyfill detection', () => {
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
expect(code).toMatch(`import "core-js/modules/es6.array.iterator"`)
// usage-based detection
expect(code).toMatch(`import "core-js/modules/es6.map"`)
expect(code).toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
})

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

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

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

test('jsx', () => {
Expand Down
5 changes: 4 additions & 1 deletion packages/@vue/babel-preset-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ module.exports = (context, options = {}) => {
// transform runtime, but only for helpers
plugins.push([require('@babel/plugin-transform-runtime'), {
regenerator: useBuiltIns !== 'usage',
corejs: useBuiltIns !== false ? false : 2,
// use @babel/runtime-corejs2 so that helpers that need polyfillable APIs will reference core-js instead.
// if useBuiltIns is not set to 'usage', then it means users would take care of the polyfills on their own,
// i.e., core-js 2 is no longer needed.
corejs: (useBuiltIns === 'usage' && !process.env.VUE_CLI_MODERN_BUILD) ? 2 : false,
helpers: useBuiltIns === 'usage',
useESModules: !process.env.VUE_CLI_BABEL_TRANSPILE_MODULES,
absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json'))
Expand Down
3 changes: 2 additions & 1 deletion packages/@vue/babel-preset-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"@babel/runtime-corejs2": "^7.2.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-plugin-dynamic-import-node": "^2.2.0",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"core-js": "^2.5.7"
"core-js": "^2.6.0"
}
}
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-e2e-cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@vue/cli-shared-utils": "^3.2.0",
"cypress": "^3.1.2",
"eslint-plugin-cypress": "^2.1.2"
"cypress": "^3.1.3",
"eslint-plugin-cypress": "^2.1.3"
}
}
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-e2e-nightwatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"dependencies": {
"@vue/cli-shared-utils": "^3.2.0",
"chromedriver": "^2.44.0",
"deepmerge": "^2.2.1",
"chromedriver": "^2.45.0",
"deepmerge": "^3.0.0",
"execa": "^1.0.0",
"nightwatch": "^0.9.21",
"selenium-server": "^3.141.59"
Expand Down
19 changes: 19 additions & 0 deletions packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,22 @@ test('should not fix with --no-fix option', async () => {
// files should not have been fixed
expect(await read('src/main.js')).not.toMatch(';')
})

// #3167
test('should not throw when src folder is ignored by .eslintignore', async () => {
const project = await create('eslint-ignore', {
plugins: {
'@vue/cli-plugin-babel': {},
'@vue/cli-plugin-eslint': {
config: 'airbnb',
lintOn: 'commit'
}
}
})

const { write, run } = project
await write('.eslintignore', 'src\n')

// should not throw
await run('vue-cli-service lint')
})
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-eslint/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = (api, { config, lintOn = [] }, _, invoking) => {
} else if (config === 'prettier') {
eslintConfig.extends.push('@vue/prettier')
Object.assign(pkg.devDependencies, {
'@vue/eslint-config-prettier': '^4.0.0'
'@vue/eslint-config-prettier': '^4.0.1'
})
// prettier & default config do not have any style rules
// so no need to generate an editorconfig file
Expand All @@ -71,7 +71,7 @@ module.exports = (api, { config, lintOn = [] }, _, invoking) => {

if (lintOn.includes('commit')) {
Object.assign(pkg.devDependencies, {
'lint-staged': '^7.2.2'
'lint-staged': '^8.1.0'
})
pkg.gitHooks = {
'pre-commit': 'lint-staged'
Expand Down
22 changes: 16 additions & 6 deletions packages/@vue/cli-plugin-eslint/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,27 @@ module.exports = function lint (args = {}, api) {
cwd
}, argsConfig)

const engine = new CLIEngine(config)

// .eslintrc.js files (ignored by default)
const dotFiles = [
'.*.js',
'{src,tests}/**/.*.js'
].filter(pattern => globby.sync(path.join(cwd, pattern)).length)

const defaultFilesToLint = [
'src',
'tests',
// root config files
'*.js',
// .eslintrc files (ignored by default)
'.*.js',
'{src,tests}/**/.*.js'
].filter(pattern => globby.sync(path.join(cwd, pattern)).length)
'*.js'
]
.filter(pattern =>
globby
.sync(path.join(cwd, pattern))
.some(p => !engine.isPathIgnored(p))
)
.concat(dotFiles)

const engine = new CLIEngine(config)
const files = args._ && args._.length
? args._
: defaultFilesToLint
Expand Down
18 changes: 10 additions & 8 deletions packages/@vue/cli-plugin-typescript/__tests__/tsPluginE2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ if (!process.env.APPVEYOR) {
})
}

test('nightwatch', async () => {
const project = await create('ts-e2e-nightwatch', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cli-plugin-e2e-nightwatch': {}
}
if (!process.env.CIRCLECI) {
test('nightwatch', async () => {
const project = await create('ts-e2e-nightwatch', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cli-plugin-e2e-nightwatch': {}
}
})
await project.run(`vue-cli-service test:e2e`)
})
await project.run(`vue-cli-service test:e2e`)
})
}
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-typescript/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = (api, {
if (lintOn.includes('commit')) {
api.extendPackage({
devDependencies: {
'lint-staged': '^7.2.2'
'lint-staged': '^8.1.0'
},
gitHooks: {
'pre-commit': 'lint-staged'
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = (api, options) => {

if (!api.hasPlugin('eslint')) {
api.registerCommand('lint', {
descriptions: 'lint source files with TSLint',
description: 'lint source files with TSLint',
usage: 'vue-cli-service lint [options] [...files]',
options: {
'--format [formatter]': 'specify formatter (default: codeFrame)',
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@types/webpack-env": "^1.13.6",
"@vue/cli-shared-utils": "^3.2.0",
"fork-ts-checker-webpack-plugin": "^0.5.0",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"globby": "^8.0.1",
"ts-loader": "^5.3.1",
"tslint": "^5.11.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/@vue/cli-plugin-unit-jest/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ const applyTS = module.exports.applyTS = (api, invoking) => {
})
if (api.hasPlugin('babel')) {
api.extendPackage({
jest: {
global: {
'ts-jest': {
// we need babel to transpile JSX
babelConfig: true
}
}
},
devDependencies: {
// this is for now necessary to force ts-jest and vue-jest to use babel 7
'babel-core': '7.0.0-bridge.0'
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-unit-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"jest": "^23.6.0",
"jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^1.0.0",
"vue-jest": "^3.0.1"
"vue-jest": "^3.0.2"
},
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.20",
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-unit-mocha/setup.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require('jsdom-global')(undefined, { pretendToBeVisual: true })
require('jsdom-global')(undefined, { pretendToBeVisual: true, url: 'http://localhost' })
4 changes: 2 additions & 2 deletions packages/@vue/cli-service-global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"babel-eslint": "^10.0.1",
"chalk": "^2.4.1",
"resolve": "^1.8.1",
"vue": "^2.5.17",
"vue-template-compiler": "^2.5.17"
"vue": "^2.5.21",
"vue-template-compiler": "^2.5.21"
}
}
4 changes: 2 additions & 2 deletions packages/@vue/cli-service/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module.exports = (api, options) => {
'build': 'vue-cli-service build'
},
dependencies: {
'vue': '^2.5.17'
'vue': '^2.5.21'
},
devDependencies: {
'vue-template-compiler': '^2.5.17'
'vue-template-compiler': '^2.5.21'
},
'postcss': {
'plugins': {
Expand Down
12 changes: 6 additions & 6 deletions packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"lodash.defaultsdeep": "^4.6.0",
"lodash.mapvalues": "^4.6.0",
"lodash.transform": "^4.6.0",
"mini-css-extract-plugin": "^0.4.5",
"mini-css-extract-plugin": "^0.5.0",
"minimist": "^1.2.0",
"ora": "^3.0.0",
"portfinder": "^1.0.19",
"portfinder": "^1.0.20",
"postcss-loader": "^3.0.0",
"read-pkg": "^4.0.1",
"semver": "^5.6.0",
Expand All @@ -65,20 +65,20 @@
"thread-loader": "^1.2.0",
"url-loader": "^1.1.2",
"vue-loader": "^15.4.2",
"webpack": "^4.26.1",
"webpack": "4",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-chain": "^4.11.0",
"webpack-dev-server": "^3.1.10",
"webpack-merge": "^4.1.4",
"webpack-merge": "^4.1.5",
"yorkie": "^2.0.0"
},
"peerDependencies": {
"vue-template-compiler": "^2.0.0"
},
"devDependencies": {
"vue": "^2.5.17",
"vue": "^2.5.21",
"vue-router": "^3.0.1",
"vue-template-compiler": "^2.5.17",
"vue-template-compiler": "^2.5.21",
"vuex": "^3.0.1"
},
"publishConfig": {
Expand Down
6 changes: 3 additions & 3 deletions packages/@vue/cli-shared-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"dependencies": {
"chalk": "^2.4.1",
"execa": "^1.0.0",
"joi": "^13.0.0",
"joi": "^14.3.0",
"launch-editor": "^2.2.1",
"lru-cache": "^4.1.3",
"lru-cache": "^5.1.1",
"node-ipc": "^9.1.1",
"opn": "^5.3.0",
"ora": "^2.1.0",
"ora": "^3.0.0",
"request": "^2.87.0",
"request-promise-native": "^1.0.5",
"semver": "^5.5.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/@vue/cli-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
},
"dependencies": {
"execa": "^1.0.0",
"json-server": "^0.12.2",
"fs-extra": "^7.0.1",
"json-server": "^0.14.0",
"puppeteer": "^1.0.0",
"strip-ansi": "^3.0.0"
"strip-ansi": "^5.0.0"
}
}
Loading

0 comments on commit d7c8930

Please sign in to comment.