Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  correct wording for #1155
  bump version to 1.2.7
  remove eventsource-polyfill (#1169)
  Remove useless code when lint is not chosen (#1165)
  Set spawn opt shell as true to avoid ENOENT (#1170)
  restore gitignore
  [WIP] Accurate CompleteMsg when not using autoInstall (fix #1157) (#1158)
  close #1155
  • Loading branch information
LinusBorg committed Dec 14, 2017
2 parents b2fd0de + 2d99f8c commit f93e45b
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 83 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ node_modules
.DS_Store
docs/_book
test/
node_modules
.DS_Store
docs/_book
test/
101 changes: 52 additions & 49 deletions meta.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
const path = require('path');
const fs = require('fs');
const path = require('path')
const fs = require('fs')
const {
sortDependencies,
installDependencies,
runLintFix,
printMessage
printMessage,
} = require('./utils')

module.exports = {
helpers: {
if_or: function (v1, v2, options) {
if_or: function(v1, v2, options) {
if (v1 || v2) {
return options.fn(this);
return options.fn(this)
}

return options.inverse(this);
}
return options.inverse(this)
},
},
prompts: {
name: {
type: 'string',
required: true,
message: 'Project name'
message: 'Project name',
},
description: {
type: 'string',
required: false,
message: 'Project description',
default: 'A Vue.js project'
default: 'A Vue.js project',
},
author: {
type: 'string',
message: 'Author'
message: 'Author',
},
build: {
type: 'list',
Expand All @@ -40,22 +40,23 @@ module.exports = {
{
name: 'Runtime + Compiler: recommended for most users',
value: 'standalone',
short: 'standalone'
short: 'standalone',
},
{
name: 'Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files - render functions are required elsewhere',
name:
'Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files - render functions are required elsewhere',
value: 'runtime',
short: 'runtime'
}
]
short: 'runtime',
},
],
},
router: {
type: 'confirm',
message: 'Install vue-router?'
message: 'Install vue-router?',
},
lint: {
type: 'confirm',
message: 'Use ESLint to lint your code?'
message: 'Use ESLint to lint your code?',
},
lintConfig: {
when: 'lint',
Expand All @@ -65,23 +66,23 @@ module.exports = {
{
name: 'Standard (https://github.com/standard/standard)',
value: 'standard',
short: 'Standard'
short: 'Standard',
},
{
name: 'Airbnb (https://github.com/airbnb/javascript)',
value: 'airbnb',
short: 'Airbnb'
short: 'Airbnb',
},
{
name: 'none (configure it yourself)',
value: 'none',
short: 'none'
}
]
short: 'none',
},
],
},
unit: {
type: 'confirm',
message: 'Set up unit tests'
message: 'Set up unit tests',
},
runner: {
when: 'unit',
Expand All @@ -91,45 +92,46 @@ module.exports = {
{
name: 'Jest',
value: 'jest',
short: 'jest'
short: 'jest',
},
{
name: 'Karma and Mocha',
value: 'karma',
short: 'karma'
short: 'karma',
},
{
name: 'none (configure it yourself)',
value: 'noTest',
short: 'noTest'
}
]
short: 'noTest',
},
],
},
e2e: {
type: 'confirm',
message: 'Setup e2e tests with Nightwatch?'
message: 'Setup e2e tests with Nightwatch?',
},
autoInstall: {
type: 'list',
message: 'Should we run `npm install` for you after the project has been created? (recommended)',
message:
'Should we run `npm install` for you after the project has been created? (recommended)',
choices: [
{
name: 'Yes, use NPM',
value: 'npm',
short: 'npm'
short: 'npm',
},
{
name: 'Yes, use Yarn',
value: 'yarn',
short: 'yarn'
short: 'yarn',
},
{
name: 'No, I will handle that myself',
value: false,
short: 'no'
}
]
}
short: 'no',
},
],
},
},
filters: {
'.eslintrc.js': 'lint',
Expand All @@ -143,27 +145,28 @@ module.exports = {
'test/unit/specs/index.js': "unit && runner === 'karma'",
'test/unit/setup.js': "unit && runner === 'jest'",
'test/e2e/**/*': 'e2e',
'src/router/**/*': 'router'
'src/router/**/*': 'router',
},
'complete': function (data, { chalk }) {

complete: function(data, { chalk }) {
const green = chalk.green

sortDependencies(data, green)

const cwd = path.join(process.cwd(), data.inPlace ? '' : data.destDirName)

if (data.autoInstall) {
installDependencies(cwd, data.autoInstall, green)
.then(() => {
return runLintFix(cwd, data, green)
})
.then(() => {
printMessage(data, green)
})
.then(() => {
return runLintFix(cwd, data, green)
})
.then(() => {
printMessage(data, green)
})
.catch(e => {
console.log(chalk.red('Error:'), e)
})
} else {
printMessage(data, chalk)
}

}
};
},
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-cli-template-webpack",
"version": "1.2.6",
"version": "1.2.7",
"license": "MIT",
"description": "A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction.",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion template/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build
chunks: false,
chunkModules: false
}) + '\n\n')
Expand Down
4 changes: 2 additions & 2 deletions template/build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function resolve (dir) {
return path.join(__dirname, '..', dir)
}

const createLintingRule = () => ({
{{#lint}}const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
Expand All @@ -17,7 +17,7 @@ const createLintingRule = () => ({
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})
}){{/lint}}

module.exports = {
context: path.resolve(__dirname, '../'),
Expand Down
5 changes: 3 additions & 2 deletions template/config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
// Template version: 1.2.6
// Template version: 1.2.7
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')
Expand All @@ -20,13 +20,14 @@ module.exports = {
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

// Use Eslint Loader?
{{#lint}}// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
{{/lint}}

/**
* Source Maps
Expand Down
1 change: 0 additions & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eventsource-polyfill": "^0.9.6",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
Expand Down
Loading

0 comments on commit f93e45b

Please sign in to comment.