Browse Source

Add choices for lint and test (solve #14) (#15)

* make eslint and unit testing optional.

* exclude test path from eslint when testing was not selected by the user.

* add file filters to meta.json.

* add completed message
pull/19/head
Thorsten Lünborg 9 years ago
committed by GitHub
parent
commit
f6517e7400
  1. 18
      meta.json
  2. 16
      template/package.json

18
meta.json

@ -1,5 +1,5 @@
{
"schema": {
"prompts": {
"name": {
"type": "string",
"required": true,
@ -34,6 +34,20 @@
"short": "standalone"
}
]
},
"lint": {
"type": "confirm",
"message": "Use ESLint to lint your code?"
},
"unit": {
"type": "confirm",
"message": "Setup unit tests with Karma + Mocha?"
}
}
},
"filters": {
".eslintrc.js": "lint",
"test/unit/**/*": "unit",
"test/e2e/**/*": "e2e"
},
"completeMessage": "To get started:\n\n cd {{destDirName}}\n npm install\n npm run dev"
}

16
template/package.json

@ -9,9 +9,13 @@
"watchify": "watchify -vd -p browserify-hmr -e src/main.js -o dist/build.js",
"serve": "http-server -c 1 -a localhost",
"dev": "npm-run-all --parallel watchify serve",
"build": "cross-env NODE_ENV=production browserify -g envify -p [ vueify/plugins/extract-css -o dist/build.css ] -e src/main.js | uglifyjs -c warnings=false -m > dist/build.js",
"lint": "eslint --ext .js,.vue src test/unit",
"test": "karma start karma.conf.js"
{{#lint}}
"lint": "eslint --ext .js,.vue src{{#unit}} test/unit{{/unit}}",
{{/lint}}
{{#unit}}
"test": "karma start karma.conf.js",
{{/unit}}
"build": "cross-env NODE_ENV=production browserify -g envify -p [ vueify/plugins/extract-css -o dist/build.css ] -e src/main.js | uglifyjs -c warnings=false -m > dist/build.js"
},
"browserify": {
"transform": [
@ -43,20 +47,26 @@
"browserify-hmr": "^0.3.1",
"cross-env": "^2.0.0",
"envify": "^3.4.1",
{{#lint}}
"eslint": "^3.3.0",
"eslint-config-standard": "^5.3.5",
"eslint-plugin-html": "^1.5.2",
"eslint-plugin-promise": "^2.0.1",
"eslint-plugin-standard": "^2.0.0",
{{/lint}}
"http-server": "^0.9.0",
{{#unit}}
"jasmine-core": "^2.4.1",
"karma": "^1.2.0",
"karma-browserify": "^5.1.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-spec-reporter": "0.0.26",
{{/unit}}
"npm-run-all": "^2.3.0",
{{#unit}}
"phantomjs-prebuilt": "^2.1.3",
{{/unit}}
"proxyquireify": "^3.0.1",
"uglify-js": "^2.5.0",
"vueify": "^9.0.0",

Loading…
Cancel
Save