Skip to content

Commit e818fd4

Browse files
committed
1 - add prettier 2 - upgrade packages
1 parent 274957c commit e818fd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2154
-1183
lines changed

.eslintrc.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,22 @@ module.exports = {
44
node: true,
55
},
66
extends: [
7-
"plugin:vue/vue3-essential",
8-
"eslint:recommended",
9-
"@vue/typescript/recommended",
10-
"@vue/prettier",
11-
"@vue/prettier/@typescript-eslint",
7+
'plugin:vue/vue3-essential',
8+
'eslint:recommended',
9+
'@vue/typescript/recommended',
10+
'@vue/prettier',
11+
'@vue/prettier/@typescript-eslint',
1212
],
1313
parserOptions: {
1414
ecmaVersion: 2020,
1515
},
1616
rules: {
17-
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
18-
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
17+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
18+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1919
},
2020
overrides: [
2121
{
22-
files: [
23-
"**/__tests__/*.{j,t}s?(x)",
24-
"**/tests/unit/**/*.spec.{j,t}s?(x)",
25-
],
22+
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
2623
env: {
2724
jest: true,
2825
},

.prettierrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
arrowParens: 'always',
3+
semi: true,
4+
useTabs: false,
5+
bracketSpacing: true,
6+
singleQuote: true,
7+
jsxBracketSameLine: false,
8+
printWidth: 140,
9+
};

README.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# vue3-boilerplate
22

3-
### Vue 3, Vue Router 4, Vuex 4, Vue Class Component 8, Typescript 4, Jest, Sass, ESLint, Prettier - Boilerplate
3+
### Vue 3, Vue Router 4, Vuex 4, Vue Class Component 8, Typescript 4, Jest, Sass, ESLint, Prettier - Boilerplate 2021
4+
5+
####vue 3 boilerplate
6+
####vue3 boilerplate
7+
####vue 3 skeleton
8+
####vue3 skeleton
9+
####vue 3 starter
10+
####vue3 starter
11+
12+
####vue 3 webpack boilerplate
13+
####vue3 webpack boilerplate
14+
####vue 3 webpack skeleton
15+
####vue3 webpack skeleton
16+
####vue 3 webpack starter
17+
####vue3 webpack starter
18+
19+
####vue3 enterprise boilerplate
20+
####vue 3 enterprise boilerplate
21+
####vue3 enterprise skeleton
22+
####vue 3 enterprise skeleton
23+
####vue3 enterprise starter
24+
####vue 3 enterprise starter
425

526
## Project setup
627
```
@@ -32,3 +53,33 @@ yarn test:e2e
3253
yarn lint
3354
yarn lint:fix
3455
```
56+
57+
### Run your prettier
58+
```
59+
yarn prettier
60+
```
61+
62+
### Run your format = prettier + lint:fix
63+
```
64+
yarn format
65+
```
66+
67+
### Run your cz
68+
```
69+
yarn cz
70+
```
71+
72+
### Run your commit
73+
```
74+
yarn commit
75+
```
76+
77+
### Run your version
78+
```
79+
yarn version
80+
```
81+
82+
### Run your ncu (npm-check-updates)
83+
```
84+
yarn ncu
85+
```

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ["@vue/cli-plugin-babel/preset"],
2+
presets: ['@vue/cli-plugin-babel/preset'],
33
};

jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel",
2+
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
33
transform: {
4-
"^.+\\.vue$": "vue-jest",
4+
'^.+\\.vue$': 'vue-jest',
55
},
66
};

package.json

+42-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
{
22
"name": "vue3-boilerplate",
3-
"description": "Vue 3, Vue Router 4, Vuex 4, Vue Class Component 8, Typescript 4, Jest, Sass, ESLint, Prettier - Boilerplate",
3+
"description": "Vue 3, Vue Router 4, Vuex 4, Vue Class Component 8, Typescript 4, Jest, Sass, ESLint, Prettier - Boilerplate 2021",
44
"version": "1.0.2",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/idimetrix/vue3-boilerplate.git"
88
},
9-
"keywords": [],
9+
"keywords": [
10+
"vue 3 boilerplate",
11+
"vue3 boilerplate",
12+
"vue 3 skeleton",
13+
"vue3 skeleton",
14+
"vue 3 starter",
15+
"vue3 starter",
16+
"vue 3 webpack boilerplate",
17+
"vue3 webpack boilerplate",
18+
"vue 3 webpack skeleton",
19+
"vue3 webpack skeleton",
20+
"vue 3 webpack starter",
21+
"vue3 webpack starter",
22+
"vue3 enterprise boilerplate",
23+
"vue 3 enterprise boilerplate",
24+
"vue3 enterprise skeleton",
25+
"vue 3 enterprise skeleton",
26+
"vue3 enterprise starter",
27+
"vue 3 enterprise starter"
28+
],
1029
"files": [
1130
"**/*"
1231
],
@@ -26,11 +45,17 @@
2645
"test:unit": "vue-cli-service test:unit",
2746
"test:e2e": "vue-cli-service test:e2e",
2847
"lint": "vue-cli-service lint",
29-
"lint:fix": "vue-cli-service lint --fix"
48+
"lint:fix": "vue-cli-service lint --fix",
49+
"prettier": "prettier --write '(src|tests|public)/**/*.{js,jsx,ts,tsx,vue,htm,html,json,xml,css,scss,sass}' '*.{js,jsx,ts,tsx,vue,htm,html,json,xml,css,scss,sass}'",
50+
"format": "yarn prettier && yarn lint:fix",
51+
"cz": "git cz",
52+
"commit": "git add -A && (git diff-index --quiet HEAD || git commit -m 'deploy' --no-verify) && git push origin HEAD",
53+
"version": "standard-version",
54+
"ncu": "ncu -u --timeout 100000 && yarn install && yarn format"
3055
},
3156
"dependencies": {
3257
"aos": "^3.0.0-beta.6",
33-
"core-js": "^3.8.1",
58+
"core-js": "^3.9.1",
3459
"flex.box": "^3.4.4",
3560
"logvis": "^1.0.6",
3661
"register-service-worker": "^1.7.2",
@@ -43,9 +68,9 @@
4368
},
4469
"devDependencies": {
4570
"@types/aos": "^3.0.3",
46-
"@types/jest": "^26.0.19",
47-
"@typescript-eslint/eslint-plugin": "^4.10.1-alpha.0",
48-
"@typescript-eslint/parser": "^4.10.1-alpha.0",
71+
"@types/jest": "^26.0.20",
72+
"@typescript-eslint/eslint-plugin": "^4.17.0",
73+
"@typescript-eslint/parser": "^4.17.0",
4974
"@vue/cli-plugin-babel": "~5.0.0-alpha.0",
5075
"@vue/cli-plugin-e2e-cypress": "~5.0.0-alpha.0",
5176
"@vue/cli-plugin-eslint": "~5.0.0-alpha.0",
@@ -55,20 +80,23 @@
5580
"@vue/cli-plugin-unit-jest": "~5.0.0-alpha.0",
5681
"@vue/cli-plugin-vuex": "~5.0.0-alpha.0",
5782
"@vue/cli-service": "~5.0.0-alpha.0",
58-
"@vue/compiler-sfc": "^3.0.4",
83+
"@vue/compiler-sfc": "^3.0.7",
5984
"@vue/eslint-config-prettier": "^6.0.0",
6085
"@vue/eslint-config-typescript": "^7.0.0",
6186
"@vue/test-utils": "^2.0.0-beta.7",
6287
"babel-plugin-transform-decorators": "^7.0.0-beta.3",
63-
"eslint": "^7.15.0",
64-
"eslint-plugin-prettier": "^3.3.0",
65-
"eslint-plugin-vue": "^7.3.0",
88+
"commitizen": "^4.2.3",
89+
"eslint": "^7.21.0",
90+
"eslint-plugin-prettier": "^3.3.1",
91+
"eslint-plugin-vue": "^7.7.0",
92+
"git-cz": "^4.7.6",
6693
"local-web-server": "^4.2.1",
6794
"node-sass": "^5.0.0",
6895
"prettier": "^2.2.1",
69-
"sass-loader": "^10.1.0",
70-
"source-map-explorer": "^2.5.1",
71-
"typescript": "~4.1.3",
96+
"sass-loader": "^11.0.1",
97+
"source-map-explorer": "^2.5.2",
98+
"standard-version": "^9.1.1",
99+
"typescript": "~4.2.3",
72100
"vue-jest": "^5.0.0-alpha.7"
73101
}
74102
}

public/index.html

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<!DOCTYPE html>
22
<html lang="en" class="--night">
33
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
88
<title><%= htmlWebpackPlugin.options.title %></title>
99
</head>
1010
<body>
1111
<noscript>
12-
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
12+
<strong
13+
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to
14+
continue.</strong
15+
>
1316
</noscript>
1417
<div id="app"></div>
1518
<!-- built files will be auto injected -->

src/App.vue

+7-11
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,33 @@
55
</template>
66

77
<script lang="ts">
8-
import { Options, Vue } from "vue-class-component";
9-
import { Component } from "vue";
8+
import { Options, Vue } from 'vue-class-component';
9+
import { Component } from 'vue';
1010
11-
import AOS from "aos";
11+
import AOS from 'aos';
1212
1313
type IComponents = {
1414
[key: string]: Component;
1515
};
1616
17-
const rc: { keys(): string[]; <T>(id: string): T } = require.context(
18-
"./layouts",
19-
false,
20-
/.*\.vue$/
21-
);
17+
const rc: { keys(): string[]; <T>(id: string): T } = require.context('./layouts', false, /.*\.vue$/);
2218
2319
const layouts: IComponents = rc.keys().reduce<IComponents>(
2420
(components: IComponents, file: string): IComponents => ({
2521
...components,
26-
[file.replace(/(^.\/)|(\.vue$)/g, "")]: rc<IComponents>(file)?.default,
22+
[file.replace(/(^.\/)|(\.vue$)/g, '')]: rc<IComponents>(file)?.default,
2723
}),
2824
{}
2925
);
3026
3127
@Options({
32-
name: "App",
28+
name: 'App',
3329
})
3430
export default class extends Vue {
3531
// --- computed
3632
3733
get layout(): Component {
38-
return layouts[this.$route?.meta?.layout || "default"];
34+
return layouts[this.$route?.meta?.layout || 'default'];
3935
}
4036
4137
// --- hooks

src/components/Button/Button.vue

+10-21
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,28 @@
55
</template>
66

77
<script lang="ts">
8-
import { Options, Vue } from "vue-class-component";
8+
import { Options, Vue } from 'vue-class-component';
99
10-
import log from "@/log";
10+
import log from '@/log';
1111
1212
@Options({
1313
props: {
1414
type: {
1515
type: String,
16-
default: "",
16+
default: '',
1717
},
1818
size: {
1919
type: String,
20-
default: "",
20+
default: '',
2121
},
2222
},
23-
name: "Button",
23+
name: 'Button',
2424
})
2525
export default class Button extends Vue {
2626
// --- props
2727
28-
public type!:
29-
| ""
30-
| "primary"
31-
| "success"
32-
| "warning"
33-
| "danger"
34-
| "info"
35-
| "text";
36-
public size!: "" | "xs" | "sm" | "md" | "lg" | "xl";
28+
public type!: '' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
29+
public size!: '' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3730
3831
// --- computed
3932
@@ -42,11 +35,11 @@ export default class Button extends Vue {
4235
}
4336
4437
get classSize(): string {
45-
return [this.class, this.size].filter(Boolean).join("--");
38+
return [this.class, this.size].filter(Boolean).join('--');
4639
}
4740
4841
get classType(): string {
49-
return [this.class, this.type].filter(Boolean).join("--");
42+
return [this.class, this.type].filter(Boolean).join('--');
5043
}
5144
5245
get classes(): string[] {
@@ -101,11 +94,7 @@ export default class Button extends Vue {
10194
this.$log(`deactivated`);
10295
}
10396
104-
public errorCaptured?(
105-
err: Error,
106-
vm: Vue,
107-
info: string
108-
): boolean | undefined {
97+
public errorCaptured?(err: Error, vm: Vue, info: string): boolean | undefined {
10998
log.error(`errorCaptured`, { err, vm, info });
11099
111100
return true;

src/components/Button/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as Button } from "./Button.vue";
1+
export { default as Button } from './Button.vue';

src/components/Example/Example.vue

+5-9
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
</template>
66

77
<script lang="ts">
8-
import { Options, Vue } from "vue-class-component";
8+
import { Options, Vue } from 'vue-class-component';
99
10-
import log from "@/log";
10+
import log from '@/log';
1111
1212
@Options({
1313
props: {
1414
type: {
1515
type: String,
16-
default: "",
16+
default: '',
1717
},
1818
},
19-
name: "Example",
19+
name: 'Example',
2020
})
2121
export default class Button extends Vue {
2222
// --- props
@@ -71,11 +71,7 @@ export default class Button extends Vue {
7171
this.$log(`deactivated`);
7272
}
7373
74-
public errorCaptured?(
75-
err: Error,
76-
vm: Vue,
77-
info: string
78-
): boolean | undefined {
74+
public errorCaptured?(err: Error, vm: Vue, info: string): boolean | undefined {
7975
log.error(`errorCaptured`, { err, vm, info });
8076
8177
return true;

0 commit comments

Comments
 (0)