Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #1490

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Master #1490

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/webpack.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

691 changes: 691 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

> This template is Vue 2.0 compatible. For Vue 1.x use this command: `vue init webpack#1.0 my-project`


# Vue-cli 3 is here, so this template is now considered deprecated.

This template was the main template for vue-cli verison 2.*.

Now that we have released a [stable version of vue-cli 3](https://cli.vuejs.org), which incorporates all features that this template offers (and much more), we think that this template doesn't have any significant use for the future, so we won't put much resource in developing it further.

We will try and fix major issues should they arise, but not much more.

Feel free to fork this template if you want to keep it alive.

## Documentation

- [For this template](http://vuejs-templates.github.io/webpack): common questions specific to this template are answered and each part is described in greater detail
Expand Down
2 changes: 1 addition & 1 deletion docs/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const path = require('path')

module.exports = {
dev: {
/ Paths
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
Expand Down
8 changes: 4 additions & 4 deletions docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ So, the environment variables are:

As we can see, `test.env` inherits the `dev.env` and the `dev.env` inherits the `prod.env`.

### Usage
### Usage

It is simple to use the environment variables in your code. For example:
It is simple to use the environment variables in your code. For example:

```js
Vue.config.productionTip = process.env.NODE_ENV === 'production'
```js
Vue.config.productionTip = process.env.NODE_ENV === 'production'
```
3 changes: 2 additions & 1 deletion docs/linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ You can run the following command to let eslint fix any errors it finds (if it c
npm run lint -- --fix
```

*(The `--` in the middle is necessary to ensure the `--fix` option is passdd to `eslint`, not to `npm`. It can be omitted whne using yarn)*
*(The `--` in the middle is necessary to ensure the `--fix` option is passed to `eslint`, not to `npm`. It can be omitted when using yarn)*


8 changes: 4 additions & 4 deletions docs/pre-processors.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pre-Processors

This boilerplate has pre-configured CSS extraction for most popular CSS pre-processors including LESS, SASS, Stylus, and PostCSS. To use a pre-processor, all you need to do is install the appropriate webpack loader for it. For example, to use SASS:
This boilerplate has pre-configured CSS extraction for most popular CSS pre-processors including LESS, Sass, Stylus, and PostCSS. To use a pre-processor, all you need to do is install the appropriate webpack loader for it. For example, to use Sass:

``` bash
npm install sass-loader node-sass --save-dev
Expand All @@ -14,11 +14,11 @@ Once installed, you can use the pre-processors inside your `*.vue` components us

``` html
<style lang="scss">
/* write SASS! */
/* write Sass! */
</style>
```

### A note on SASS syntax
### A note on Sass syntax

- `lang="scss"` corresponds to the CSS-superset syntax (with curly braces and semicolons).
- `lang="sass"` corresponds to the indentation-based syntax.
Expand All @@ -27,7 +27,7 @@ Once installed, you can use the pre-processors inside your `*.vue` components us

Styles in `*.vue` files and style files (`*.css`, `*.scss` etc) are piped through PostCSS by default, so you don't need to use a specific loader for it.

You can simply add PostCSS plugins you want to use to the `.postcssrc.js`file in your project's root directory:
You can simply add PostCSS plugins you want to use to the `.postcssrc.js` file in your project's root directory:

``` js
// https://github.com/michael-ciniawsky/postcss-load-config
Expand Down
4 changes: 2 additions & 2 deletions docs/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
│ │ ├── eslintrc # config file for eslint with extra settings only for unit tests
│ │ ├── index.js # test build entry file
│ │ ├── jest.conf.js # Config file when using Jest for unit tests
│ │ ── karma.conf.js # test runner config file when using Karma for unit tests
│ │ ── setup.js # file that runs before Jest runs your unit tests
│ │ ── karma.conf.js # test runner config file when using Karma for unit tests
│ │ ── setup.js # file that runs before Jest runs your unit tests
│ └── e2e/ # e2e tests
│ │   ├── specs/ # test spec files
│ │   ├── custom-assertions/ # custom assertions for e2e tests
Expand Down
121 changes: 1 addition & 120 deletions meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,126 +50,7 @@ module.exports = {
when: 'isNotTest',
type: 'string',
message: 'Author',
},
build: {
when: 'isNotTest',
type: 'list',
message: 'Vue build',
choices: [
{
name: 'Runtime + Compiler: recommended for most users',
value: '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',
value: 'runtime',
short: 'runtime',
},
],
},
router: {
when: 'isNotTest',
type: 'confirm',
message: 'Install vue-router?',
},
lint: {
when: 'isNotTest',
type: 'confirm',
message: 'Use ESLint to lint your code?',
},
lintConfig: {
when: 'isNotTest && lint',
type: 'list',
message: 'Pick an ESLint preset',
choices: [
{
name: 'Standard (https://github.com/standard/standard)',
value: 'standard',
short: 'Standard',
},
{
name: 'Airbnb (https://github.com/airbnb/javascript)',
value: 'airbnb',
short: 'Airbnb',
},
{
name: 'none (configure it yourself)',
value: 'none',
short: 'none',
},
],
},
unit: {
when: 'isNotTest',
type: 'confirm',
message: 'Set up unit tests',
},
runner: {
when: 'isNotTest && unit',
type: 'list',
message: 'Pick a test runner',
choices: [
{
name: 'Jest',
value: 'jest',
short: 'jest',
},
{
name: 'Karma and Mocha',
value: 'karma',
short: 'karma',
},
{
name: 'none (configure it yourself)',
value: 'noTest',
short: 'noTest',
},
],
},
e2e: {
when: 'isNotTest',
type: 'confirm',
message: 'Setup e2e tests with Nightwatch?',
},
autoInstall: {
when: 'isNotTest',
type: 'list',
message:
'Should we run `npm install` for you after the project has been created? (recommended)',
choices: [
{
name: 'Yes, use NPM',
value: 'npm',
short: 'npm',
},
{
name: 'Yes, use Yarn',
value: 'yarn',
short: 'yarn',
},
{
name: 'No, I will handle that myself',
value: false,
short: 'no',
},
],
},
},
filters: {
'.eslintrc.js': 'lint',
'.eslintignore': 'lint',
'config/test.env.js': 'unit || e2e',
'build/webpack.test.conf.js': "unit && runner === 'karma'",
'test/unit/**/*': 'unit',
'test/unit/index.js': "unit && runner === 'karma'",
'test/unit/jest.conf.js': "unit && runner === 'jest'",
'test/unit/karma.conf.js': "unit && runner === 'karma'",
'test/unit/specs/index.js': "unit && runner === 'karma'",
'test/unit/setup.js': "unit && runner === 'jest'",
'test/e2e/**/*': 'e2e',
'src/router/**/*': 'router',
}
},
complete: function(data, { chalk }) {
const green = chalk.green
Expand Down
6 changes: 3 additions & 3 deletions scenarios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ With the code from `index.js`, we insert those answers into the metalsmith metad

## The scenarios

We currently have 3 scenrios set up:
We currently have 3 scenarios set up:

1. 'minimal': it basically answers "no" to ever choice, so no router, no elint, no tests
1. 'minimal': it basically answers "no" to ever choice, so no router, no eslint, no tests
2. 'full': It answers "yes" to every choice. With router, with linting (standard), with full tests (jest & e2e)
3. 'full-airbnb-karma': like 'full', but using airbnb eslint config instead od standard and karma instead of jest for unnit tests.
3. 'full-airbnb-karma': like 'full', but using airbnb eslint config instead of standard and karma instead of jest for unit tests.

Other permutations might be worth testing to secure against edge cases, but this gives us a decent level of security over common combinations.

Expand Down
9 changes: 1 addition & 8 deletions template/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]{{#if_or unit e2e}},
"env": {
"test": {
"presets": ["env", "stage-2"]{{#if_eq runner "karma"}},
"plugins": ["transform-vue-jsx", "istanbul"]{{/if_eq}}{{#if_eq runner "jest"}},
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]{{/if_eq}}
}
}{{/if_or}}
"plugins": ["transform-vue-jsx", "transform-runtime"]
}
3 changes: 0 additions & 3 deletions template/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
/config/
/dist/
/*.js
{{#unit}}
/test/unit/coverage/
{{/unit}}
45 changes: 0 additions & 45 deletions template/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,21 @@ module.exports = {
env: {
browser: true,
},
{{#if_eq lintConfig "standard"}}
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
{{/if_eq}}
{{#if_eq lintConfig "airbnb"}}
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
extends: ['plugin:vue/essential', 'airbnb-base'],
{{/if_eq}}
{{#if_eq lintConfig "none"}}
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
extends: ['plugin:vue/essential'],
{{/if_eq}}
// required to lint *.vue files
plugins: [
'vue'
],
{{#if_eq lintConfig "airbnb"}}
// check if imports actually resolve
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js'
}
}
},
{{/if_eq}}
// add your custom rules here
rules: {
{{#if_eq lintConfig "standard"}}
// allow async-await
'generator-star-spacing': 'off',
{{/if_eq}}
{{#if_eq lintConfig "airbnb"}}
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
js: 'never',
vue: 'never'
}],
// disallow reassignment of function parameters
// disallow parameter object manipulation except for specific exclusions
'no-param-reassign': ['error', {
props: true,
ignorePropertyModificationsFor: [
'state', // for vuex state
'acc', // for reduce accumulators
'e' // for e.returnvalue
]
}],
// allow optionalDependencies
'import/no-extraneous-dependencies': ['error', {
optionalDependencies: ['test/unit/index.js']
}],
{{/if_eq}}
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
Expand Down
7 changes: 0 additions & 7 deletions template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
{{#unit}}
/test/unit/coverage/
{{/unit}}
{{#e2e}}
/test/e2e/reports/
selenium-debug.log
{{/e2e}}

# Editor directories and files
.idea
Expand Down
Loading