Skip to content

Commit

Permalink
apply version requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 28, 2017
1 parent fe5f353 commit fc25d05
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": ["plugin:vue-libs/recommended"],
"rules": {
"indent": ["error", 2, { "MemberExpression": "off" }]
"indent": ["error", 2, { "MemberExpression": "off" }],
"vue-libs/no-async-functions": 2
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"debug": "^3.1.0",
"eslint": "^4.14.0",
"eslint-plugin-vue-libs": "^2.0.1",
"eslint-plugin-vue-libs": "^2.1.0",
"globby": "^7.1.1",
"husky": "^0.14.3",
"jest": "^22.0.4",
Expand Down
11 changes: 11 additions & 0 deletions packages/@vue/cli-service/bin/vue-cli-service
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/usr/bin/env node

const semver = require('semver')
const { error } = require('@vue/cli-shared-utils')

if (!semver.satisfies(process.version, '>=6.0.0')) {
error(
`You are using Node ${process.version}, ` +
`but vue-cli-service requires a minimum version of Node 6.0.0. `
)
process.exit(1)
}

const Service = require('../lib/Service')
const service = new Service()

Expand Down
1 change: 1 addition & 0 deletions packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"ora": "^1.3.0",
"portfinder": "^1.0.13",
"read-pkg-up": "^3.0.0",
"semver": "^5.4.1",
"string.prototype.padend": "^3.0.0",
"uglifyjs-webpack-plugin": "^1.1.4",
"url-loader": "^0.6.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/@vue/cli/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"vue-libs/no-async-functions": 0
}
}
14 changes: 13 additions & 1 deletion packages/@vue/cli/bin/vue-create
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#!/usr/bin/env node

require('../lib/create')
const semver = require('semver')
const { error } = require('@vue/cli-shared-utils')

if (!semver.satisfies(process.version, '>=7.7.0')) {
error(
`You are using Node ${process.version}, ` +
`but this version of vue-cli requires a minimum version of Node 7.7.0, ` +
`and Node 8+ is recommended.\n`
)
process.exit(1)
} else {
require('../lib/create')
}
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/Creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ module.exports = class Creator {
`~/.vuerc may be corrupted or have syntax errors. ` +
`You may need to delete it and re-run vue-cli in manual mode.\n` +
`(${e.message})`,
true
)
process.exit(1)
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/@vue/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"vue-create": "bin/vue-create",
"vue-init": "bin/vue-init"
},
"files": [
"bin",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2367,9 +2367,9 @@ eslint-plugin-html@^4.0.1:
dependencies:
htmlparser2 "^3.8.2"

eslint-plugin-vue-libs@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-vue-libs/-/eslint-plugin-vue-libs-2.0.1.tgz#d6306f5615127a3250118c3cefbd9603ecb278ae"
eslint-plugin-vue-libs@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-vue-libs/-/eslint-plugin-vue-libs-2.1.0.tgz#e7faf4ae11dad58553f63f907d6642e2d816dcef"
dependencies:
eslint-plugin-html "^4.0.1"

Expand Down

0 comments on commit fc25d05

Please sign in to comment.