Skip to content

Commit 1c112b6

Browse files
committed
Merge remote-tracking branch 'refs/remotes/vuejs-templates/develop'
# Conflicts: # template/src/main.js # template/test/e2e/custom-assertions/elementCount.js
2 parents 3bd1b93 + d8fb864 commit 1c112b6

35 files changed

+3011
-269
lines changed

.circleci/config.yml

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
version: 2
2+
vm_settings: &vm_settings
3+
docker:
4+
- image: circleci/node:6.12.3-browsers
5+
6+
jobs:
7+
install_template_deps:
8+
<<: *vm_settings
9+
working_directory: ~/project/webpack-template
10+
steps:
11+
- checkout
12+
- restore_cache:
13+
key: template-cache-{{ checksum "package.json" }}
14+
- run:
15+
name: Install npm dependencies
16+
command: npm install
17+
- save_cache:
18+
key: template-cache-{{ checksum "package.json" }}
19+
paths:
20+
- node_modules
21+
- run:
22+
name: Rollout minimal scenario
23+
command: VUE_TEMPL_TEST=minimal node_modules/.bin/vue init . test-minimal
24+
- run:
25+
name: Rollout full scenario
26+
command: VUE_TEMPL_TEST=full node_modules/.bin/vue init . test-full
27+
- run:
28+
name: Rollout full-karma-airbnb scenario
29+
command: VUE_TEMPL_TEST=full-karma-airbnb node_modules/.bin/vue init . test-full-karma-airbnb
30+
- persist_to_workspace:
31+
root: ~/project/webpack-template
32+
paths:
33+
- node_modules
34+
- test-*
35+
36+
scenario_minimal:
37+
<<: *vm_settings
38+
environment:
39+
- VUE_TEMPL_TEST: minimal
40+
working_directory: ~/project/webpack-template/test-minimal
41+
steps:
42+
- attach_workspace:
43+
at: '~/project/webpack-template'
44+
- restore_cache:
45+
key: template-cache-minimal-{{ checksum "package.json" }}
46+
- run:
47+
name: Install npm dependencies
48+
command: npm install
49+
- save_cache:
50+
key: template-cache-minimal-{{ checksum "package.json" }}
51+
paths:
52+
- node_modules
53+
- run:
54+
name: Test build
55+
command: npm run build
56+
57+
scenario_full:
58+
<<: *vm_settings
59+
working_directory: ~/project/webpack-template/test-full
60+
environment:
61+
- VUE_TEMPL_TEST: full
62+
steps:
63+
- attach_workspace:
64+
at: '~/project/webpack-template'
65+
- restore_cache:
66+
key: template-cache-full-{{ checksum "package.json" }}
67+
- run:
68+
name: Install npm dependencies
69+
command: npm install
70+
- save_cache:
71+
key: template-cache-full-{{ checksum "package.json" }}
72+
paths:
73+
- node_modules
74+
- run:
75+
name: Run Lint
76+
command: npm run lint -- --fix
77+
- run:
78+
name: Run Unit tests
79+
command: npm run unit
80+
when: always
81+
- run:
82+
name: Run e2e tests
83+
command: npm run e2e
84+
when: always
85+
- run:
86+
name: Test build
87+
command: npm run build
88+
when: always
89+
90+
scenario_full-karma-airbnb:
91+
<<: *vm_settings
92+
working_directory: ~/project/webpack-template/test-full-karma-airbnb
93+
environment:
94+
- VUE_TEMPL_TEST: full-karma-airbnb
95+
steps:
96+
- attach_workspace:
97+
at: '~/project/webpack-template'
98+
- restore_cache:
99+
key: template-cache-full-karma-airbnb-{{ checksum "package.json" }}
100+
- run:
101+
name: Install npm dependencies
102+
command: npm install
103+
- save_cache:
104+
key: template-cache-full-karma-airbnb-{{ checksum "package.json" }}
105+
paths:
106+
- node_modules
107+
- run:
108+
name: Run Lint
109+
command: npm run lint -- --fix
110+
- run:
111+
name: Run Unit tests
112+
command: npm run unit
113+
when: always
114+
- run:
115+
name: Run e2e tests
116+
command: npm run e2e
117+
when: always
118+
- run:
119+
name: Test build
120+
command: npm run build
121+
when: always
122+
123+
124+
workflows:
125+
version: 2
126+
build_and_test:
127+
jobs:
128+
- install_template_deps
129+
- scenario_minimal:
130+
requires:
131+
- install_template_deps
132+
- scenario_full:
133+
requires:
134+
- install_template_deps
135+
- scenario_full-karma-airbnb:
136+
requires:
137+
- install_template_deps

circle.yml

-13
This file was deleted.

docs/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- [Project Structure](structure.md)
44
- [Build Commands](commands.md)
5+
- [Babel Configuration](babel.md)
56
- [Linter Configuration](linter.md)
67
- [Pre-Processors](pre-processors.md)
78
- [Handling Static Assets](static.md)

docs/babel.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Babel Configuration
2+
3+
This boilerplate uses [`babel-preset-env`](https://www.npmjs.com/package/babel-preset-env) for configuring babel. You can read more about it here - http://2ality.com/2017/02/babel-preset-env.html.
4+
5+
> A Babel preset that compiles ES2015+ down to ES5 by automatically determining the Babel plugins and polyfills you need based on your targeted browser or runtime environments.
6+
7+
It uses [`browserslist`](https://github.com/ai/browserslist) to parse this information, so we can use any [valid query format supported by `browserslist`](https://github.com/ai/browserslist#queries).
8+
9+
However there is a caveat. `browserslist` recommends defining the target in a common place like `package.json` or in a `.browserslistrc` config file. This allows tools like [`autoprefixer`](https://github.com/postcss/autoprefixer) and [`eslint-plugin-compat`](https://github.com/amilajack/eslint-plugin-compat) to share the config. For this template, `browserslist` is configured in the `package.json`:
10+
11+
```json
12+
{
13+
"...": "...",
14+
"browserslist": [
15+
"> 1%",
16+
"last 2 versions",
17+
"not ie <= 8"
18+
]
19+
}
20+
```
21+
22+
But the latest stable release of `babel-preset-env`, `v1.6.1` does not support loading the config from `package.json`. So the target environment is repeated in `.babelrc`. If you wish to change your target environment, please be sure to update both `package.json` and `.babelrc`. Note that this has been fixed in the beta version([`@babel/[email protected]`](https://github.com/babel/babel/tree/master/packages/babel-preset-env)) and the template will be updated once it is out of beta.

docs/linter.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
This boilerplate uses [ESLint](https://eslint.org/) as the linter, and uses the [Standard](https://github.com/feross/standard/blob/master/RULES.md) preset with some small customizations.
44

5+
## eslint-plugin-vue
6+
7+
We always add [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) as well, which comes with a whole bunch of helpful rules to write consistent Vue components - it can also lint templates!
8+
9+
You can find an overview of all the available rules on [github](https://github.com/vuejs/eslint-plugin-vue#gear-configs). We chose to add the `essential` configs, but we recommend to switch to the bigger `strongly-recommended` or `recommended` rulesets once you are familiar with them.
10+
11+
## Customizing
12+
513
If you are not happy with the default linting rules, you have several options:
614

715
1. Overwrite individual rules in `.eslintrc.js`. For example, you can add the following rule to enforce semicolons instead of omitting them:
@@ -23,5 +31,5 @@ You can run the following command to let eslint fix any errors it finds (if it c
2331
npm run lint -- --fix
2432
```
2533

26-
*(The `--` in the middle is necessary to ensure the `--fix` option is passdd to `eslint`, not to `npm`)*
34+
*(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)*
2735

docs/structure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
├── .babelrc # babel config
3232
├── .editorconfig # indentation, spaces/tabs and similar settings for your editor
3333
├── .eslintrc.js # eslint config
34-
├── .eslintignore.js # eslint ignore rules
34+
├── .eslintignore # eslint ignore rules
3535
├── .gitignore # sensible defaults for gitignore
3636
├── .postcssrc.js # postcss config
3737
├── index.html # index.html template

0 commit comments

Comments
 (0)