Skip to content

Commit

Permalink
chore: merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Feb 27, 2020
2 parents c39eb72 + da84840 commit a6c35cd
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 31 deletions.
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
@@ -1,3 +1,5 @@
# Contributing to Vue CLI

## Workflow

The Git workflow used in this project is largely inspired by [Gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
Expand Down Expand Up @@ -66,4 +68,4 @@ Note that `jest --onlyChanged` isn't always accurate because some tests spawn ch

### Plugin Development

See [dedicated section in docs](https://github.com/vuejs/vue-cli/blob/dev/docs/dev-guide/plugin-dev.md).
See [dedicated section in docs](https://cli.vuejs.org/dev-guide/plugin-dev.html).
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# vue-cli [![Build Status](https://circleci.com/gh/vuejs/vue-cli/tree/dev.svg?style=shield)](https://circleci.com/gh/vuejs/vue-cli/tree/dev) [![Windows Build status](https://ci.appveyor.com/api/projects/status/rkpafdpdwie9lqx0/branch/dev?svg=true)](https://ci.appveyor.com/project/yyx990803/vue-cli/branch/dev) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
# Vue CLI [![Build Status](https://circleci.com/gh/vuejs/vue-cli/tree/dev.svg?style=shield)](https://circleci.com/gh/vuejs/vue-cli/tree/dev) [![Windows Build status](https://ci.appveyor.com/api/projects/status/rkpafdpdwie9lqx0/branch/dev?svg=true)](https://ci.appveyor.com/project/yyx990803/vue-cli/branch/dev) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)


> Vue CLI is the Standard Tooling for Vue.js Development.
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/guide/deployment.md
Expand Up @@ -281,7 +281,7 @@ now

你的站点会开始部署,你将获得一个形如 [https://vue.now-examples.now.sh/](https://vue.now-examples.now.sh/) 的链接。

开箱即用地,请求会被自动改写到 `index.html` (除了自定义的静态文件) 并带有合适的缓存请求头。你可以[改写](https://zeit.co/docs/v2/advanced/routes/)这些规则。
开箱即用地,请求会被自动改写到 `index.html` (除了自定义的静态文件) 并带有合适的缓存请求头。

### Stdlib

Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service-global/lib/globalConfigPlugin.js
Expand Up @@ -115,7 +115,7 @@ module.exports = function createConfigPlugin (context, entry, asLib) {
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': `process.env.NODE_ENV === 'production' ? 'error' : 'off'`
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
}))
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/__tests__/Creator.spec.js
Expand Up @@ -5,7 +5,7 @@ const { defaults } = require('../lib/options')
const assertPromptModule = require('@vue/cli-test-utils/assertPromptModule')

test('default', async () => {
const epxectedPrompts = [
const expectedPrompts = [
{
message: 'pick a preset',
choices: [
Expand All @@ -20,7 +20,7 @@ test('default', async () => {
choose: 0
}
]
await assertPromptModule([], epxectedPrompts, defaults.presets.default)
await assertPromptModule([], expectedPrompts, defaults.presets.default)
})

test('manual + PromptModuleAPI', async () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/@vue/cli/__tests__/Generator.spec.js
Expand Up @@ -457,6 +457,9 @@ test('api: extendPackage + { prune: true }', async () => {

await generator.generate()

// should not warn about the null versions
expect(logs.warn.length).toBe(0)

const pkg = JSON.parse(fs.readFileSync('/package.json', 'utf-8'))
expect(pkg).toEqual({
version: '0.0.0',
Expand Down
15 changes: 10 additions & 5 deletions packages/@vue/cli/bin/vue.js
Expand Up @@ -5,10 +5,7 @@

const { chalk, semver } = require('@vue/cli-shared-utils')
const requiredVersion = require('../package.json').engines.node
const didYouMean = require('didyoumean')

// Setting edit distance to 60% of the input string's length
didYouMean.threshold = 0.6
const leven = require('leven')

function checkNodeVersion (wanted, id) {
if (!semver.satisfies(process.version, wanted)) {
Expand Down Expand Up @@ -261,7 +258,15 @@ if (!process.argv.slice(2).length) {
function suggestCommands (unknownCommand) {
const availableCommands = program.commands.map(cmd => cmd._name)

const suggestion = didYouMean(unknownCommand, availableCommands)
let suggestion

availableCommands.forEach(cmd => {
const isBestMatch = leven(cmd, unknownCommand) < leven(suggestion || '', unknownCommand)
if (leven(cmd, unknownCommand) < 3 && isBestMatch) {
suggestion = cmd
}
})

if (suggestion) {
console.log(` ` + chalk.red(`Did you mean ${chalk.yellow(suggestion)}?`))
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/promptModules/__tests__/e2e.spec.js
Expand Up @@ -13,7 +13,7 @@ test('cypress', async () => {
check: [0]
},
{
message: 'Pick a E2E testing solution',
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch'],
choose: 0
}
Expand Down Expand Up @@ -41,7 +41,7 @@ test('nightwatch', async () => {
check: [0]
},
{
message: 'Pick a E2E testing solution',
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch'],
choose: 1
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/promptModules/e2e.js
Expand Up @@ -14,7 +14,7 @@ module.exports = cli => {
name: 'e2e',
when: answers => answers.features.includes('e2e'),
type: 'list',
message: 'Pick a E2E testing solution:',
message: 'Pick an E2E testing solution:',
choices: [
{
name: 'Cypress (Chrome only)',
Expand Down
1 change: 1 addition & 0 deletions packages/@vue/cli/lib/util/mergeDeps.js
Expand Up @@ -42,6 +42,7 @@ module.exports = function mergeDeps (

if (prune && injectingRange == null) {
delete result[depName]
continue
}

if (!isValidRange(injectingRange)) {
Expand Down
3 changes: 2 additions & 1 deletion packages/@vue/cli/package.json
Expand Up @@ -33,7 +33,6 @@
"commander": "^2.20.0",
"debug": "^4.1.0",
"deepmerge": "^4.2.2",
"didyoumean": "^1.2.1",
"download-git-repo": "^1.0.2",
"ejs": "^2.7.1",
"envinfo": "^7.5.0",
Expand All @@ -45,6 +44,7 @@
"javascript-stringify": "^1.6.0",
"js-yaml": "^3.13.1",
"jscodeshift": "^0.7.0",
"leven": "^3.1.0",
"lodash.clonedeep": "^4.5.0",
"lru-cache": "^5.1.1",
"minimist": "^1.2.0",
Expand All @@ -53,6 +53,7 @@
"shortid": "^2.2.15",
"slash": "^3.0.0",
"validate-npm-package-name": "^3.0.0",
"vue": "^2.6.11",
"vue-jscodeshift-adapter": "^2.0.2",
"yaml-front-matter": "^3.4.1"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.js
Expand Up @@ -95,7 +95,7 @@ const release = async () => {
}
}

let distTag = 'latest'
let distTag = cliOptions['dist-tag'] || 'latest'
if (bump === 'prerelease' || semver.prerelease(version)) {
distTag = 'next'
}
Expand Down
17 changes: 2 additions & 15 deletions yarn.lock
Expand Up @@ -2529,7 +2529,7 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/mocha@^5.2.4", "@types/mocha@^5.2.6":
"@types/mocha@^5.2.6":
version "5.2.7"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea"
integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==
Expand Down Expand Up @@ -2798,14 +2798,6 @@
resolved "https://registry.yarnpkg.com/@vue/preload-webpack-plugin/-/preload-webpack-plugin-1.1.1.tgz#18723530d304f443021da2292d6ec9502826104a"
integrity sha512-8VCoJeeH8tCkzhkpfOkt+abALQkS11OIHhte5MBzYaKMTqK0A3ZAKEUVAffsOklhEv7t0yrQt696Opnu9oAx+w==

"@vue/test-utils@1.0.0-beta.29":
version "1.0.0-beta.29"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.29.tgz#c942cf25e891cf081b6a03332b4ae1ef430726f0"
integrity sha512-yX4sxEIHh4M9yAbLA/ikpEnGKMNBCnoX98xE1RwxfhQVcn0MaXNSj1Qmac+ZydTj6VBSEVukchBogXBTwc+9iA==
dependencies:
dom-event-types "^1.0.0"
lodash "^4.17.4"

"@vue/test-utils@1.0.0-beta.31":
version "1.0.0-beta.31"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.31.tgz#580d6e45f07452e497d69807d80986e713949b73"
Expand Down Expand Up @@ -5161,7 +5153,7 @@ chrome-trace-event@^1.0.2:
dependencies:
tslib "^1.9.0"

chromedriver@80, chromedriver@^80.0.0:
chromedriver@^80.0.0:
version "80.0.0"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-80.0.0.tgz#f9e2af4c2117e7e07dc4558cf9496a70ad6c3ddc"
integrity sha512-W4tIbaOve7HeGFLnbbZMV4AUlnBaapL+H41fvDFKOXCmUvgPhxVN9y/c3EgmsOcokLQkqxpOC/txEujms1eT0w==
Expand Down Expand Up @@ -6778,11 +6770,6 @@ dicer@0.3.0:
dependencies:
streamsearch "0.1.2"

didyoumean@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.1.tgz#e92edfdada6537d484d73c0172fd1eba0c4976ff"
integrity sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=

diff-sequences@^24.9.0:
version "24.9.0"
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5"
Expand Down

0 comments on commit a6c35cd

Please sign in to comment.