Skip to content

Commit 9891b50

Browse files
author
QRaimbault
committed
✨ Improving starter structure
1 parent 3c085e0 commit 9891b50

File tree

19 files changed

+936
-1828
lines changed

19 files changed

+936
-1828
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = {
22
plugins: ["vue"],
3-
extends: ["plugin:vue/essential", "prettier"]
3+
extends: ["plugin:vue/essential", "prettier"],
4+
rules: {
5+
"object-shorthand": "error"
6+
}
47
};

.gitignore

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,118 @@
1+
# Project specific
12
dist/
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
*.pid.lock
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# nyc test coverage
24+
.nyc_output
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# Bower dependency directory (https://bower.io/)
30+
bower_components
31+
32+
# node-waf configuration
33+
.lock-wscript
34+
35+
# Compiled binary addons (https://nodejs.org/api/addons.html)
36+
build/Release
37+
38+
# Dependency directories
239
node_modules/
3-
yarn-error.log
40+
jspm_packages/
41+
42+
# TypeScript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
# parcel-bundler cache (https://parceljs.org/)
64+
.cache
65+
66+
# next.js build output
67+
.next
68+
69+
# nuxt.js build output
70+
.nuxt
71+
72+
# vuepress build output
73+
.vuepress/dist
74+
75+
# Serverless directories
76+
.serverless
77+
78+
# VSCode
79+
.vscode
80+
81+
# Windows thumbnail cache files
82+
Thumbs.db
83+
ehthumbs.db
84+
ehthumbs_vista.db
85+
86+
# Dump file
87+
*.stackdump
88+
89+
# Folder config file
90+
[Dd]esktop.ini
91+
92+
# Recycle Bin used on file shares
93+
$RECYCLE.BIN/
94+
95+
# Windows Installer files
96+
*.cab
97+
*.msi
98+
*.msix
99+
*.msm
100+
*.msp
101+
102+
# Windows shortcuts
103+
*.lnk
104+
105+
# Linux
106+
*~
107+
108+
# temporary files which can be created if a process still has a handle open of a deleted file
109+
.fuse_hidden*
110+
111+
# KDE directory preferences
112+
.directory
113+
114+
# Linux trash folder which might appear on any partition or disk
115+
.Trash-*
116+
117+
# .nfs files are created when an open file is removed but is still being accessed
118+
.nfs*

.sass-lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
options:
2-
formatter: stylish
2+
formatter: prettier
33
files:
44
include: '**/*.s+(a|c)ss'
55
rules:
@@ -9,7 +9,7 @@ rules:
99
placeholder-in-extend: 1
1010

1111
# Mixins
12-
mixins-before-declarations: 1
12+
mixins-before-declarations: 0
1313

1414
# Line Spacing
1515
one-declaration-per-line: 1
@@ -36,7 +36,7 @@ rules:
3636
no-qualifying-elements: 1
3737
no-trailing-whitespace: 1
3838
no-trailing-zero: 1
39-
no-transition-all: 1
39+
no-transition-all: 0
4040
no-universal-selectors: 0
4141
no-url-domains: 1
4242
no-url-protocols: 1
@@ -73,7 +73,7 @@ rules:
7373
leading-zero: 1
7474
max-line-length: 0
7575
max-file-line-count: 0
76-
nesting-depth: 1
76+
nesting-depth: 0
7777
property-sort-order: 1
7878
pseudo-element: 1
7979
quotes: 1

jsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"include": ["./src/**/*"],
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"paths": {
6+
"@API": ["src/helpers/API.js"],
7+
"@Config": ["src/config.js"],
8+
"Components/*": ["src/components/*"],
9+
"Views/*": ["src/views/*"],
10+
"ViewStyles/*": ["src/scss/views/*"],
11+
"ComponentStyles/*": ["src/scss/components/*"],
12+
"DataStore": ["src/datastore/*"]
13+
}
14+
}
15+
}

package.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
{
2-
"name": "vue-webpack-4",
2+
"name": "starter-vue-vuex-scss",
33
"version": "1.0.0",
44
"main": "index.js",
55
"license": "MIT",
6-
"author": "David Venin",
6+
"author": "Quentin Raimbault",
77
"scripts": {
8-
"start": "npm run serve:dev",
8+
"start": "cross-env NODE_ENV=development node bin/dev-server.js",
99
"build": "cross-env NODE_ENV=production webpack",
10-
"serve:dev": "cross-env NODE_ENV=development node bin/dev-server.js",
11-
"serve:production": "cross-env NODE_ENV=production node bin/spa-server.js"
10+
"serve": "cross-env NODE_ENV=production node bin/spa-server.js"
1211
},
1312
"devDependencies": {
1413
"@babel/core": "^7.0.0-beta.46",
1514
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.46",
1615
"@babel/preset-env": "^7.0.0-beta.46",
1716
"babel-loader": "^8.0.0-beta",
18-
"cross-env": "^5.1.4",
17+
"copy-webpack-plugin": "^4.5.2",
18+
"cross-env": "^5.2.0",
1919
"css-loader": "^0.28.11",
20+
"eslint": "^4",
2021
"eslint-config-prettier": "^2.9.0",
2122
"eslint-plugin-vue": "^4.5.0",
2223
"express": "^4.16.3",
24+
"file-loader": "^1.1.11",
2325
"html-webpack-plugin": "^3.2.0",
2426
"mini-css-extract-plugin": "^0.4.0",
2527
"node-sass": "^4.9.0",
2628
"opn": "^5.3.0",
27-
"optimize-css-assets-webpack-plugin": "^4.0.1",
29+
"optimize-css-assets-webpack-plugin": "^4.0.3",
30+
"resolve-url-loader": "^2.3.0",
2831
"sass-lint": "^1.12.1",
2932
"sass-loader": "^7.0.3",
3033
"style-loader": "^0.21.0",
3134
"sugarss": "^1.0.1",
3235
"uglifyjs-webpack-plugin": "^1.2.5",
36+
"url-loader": "^1.0.1",
3337
"vue-loader": "^15.0.0-beta",
34-
"webpack": "^4.7.0",
35-
"webpack-cli": "^2.1.3",
36-
"webpack-serve": "^0.3.2"
38+
"vue-template-compiler": "^2.5.16",
39+
"webpack": "^4.14.0",
40+
"webpack-cli": "^3.0.8",
41+
"webpack-serve": "^1.0.4"
3742
},
3843
"dependencies": {
3944
"axios": "^0.18.0",
4045
"vue": "^2.5.16",
4146
"vue-router": "^3.0.1",
42-
"vue-template-compiler": "^2.5.16"
47+
"vue-cookie": "^1.1.4",
48+
"vuex": "^3.0.1"
4349
}
4450
}

src/components/App/App.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
</template>
1616

1717
<script>
18-
export default {
19-
name: 'App',
20-
data () {
21-
return {
22-
title: 'Welcome to my starter !'
23-
}
24-
}
18+
export default {
19+
name: "App",
20+
data() {
21+
return {
22+
title: "Welcome to my starter !"
23+
};
2524
}
25+
};
2626
</script>

src/components/Index/Articles.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,4 @@ export default {
1919
}
2020
}
2121
};
22-
</script>
23-
24-
<style>
25-
</style>
22+
</script>

src/config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Used for the routes title
2+
export const SiteName = "Default Site Name";
3+
export const TitleSeparator = " - ";
4+
5+
// Axios configuration
6+
export const APIConfig = {
7+
baseURL: "",
8+
withCredentials: true,
9+
crossDomain: true,
10+
contentType: false,
11+
responseType: "json",
12+
headers: {
13+
Accept: "application/json",
14+
"Content-Type": "application/json"
15+
}
16+
};

src/helpers/API.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import axios from "axios";
2+
3+
import { APIConfig } from "@Config";
4+
5+
const api = axios.create(APIConfig);
6+
7+
export default api;

src/main.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
import Vue from 'vue';
2-
import router from './router';
3-
import App from './components/App/App.vue';
1+
import Vue from "vue";
2+
import Vuex from "vuex";
3+
import VueCookie from "vue-cookie";
44

5-
Vue.config.productionTip = false
5+
import router from "./router";
6+
import App from "@Component/App/App.vue";
7+
import VuexStoreConfig from "./vuex/store";
8+
9+
Vue.config.productionTip = false;
10+
11+
Vue.use(Vuex);
12+
Vue.use(VueCookie);
13+
14+
const store = new Vuex.Store(VuexStoreConfig);
615

716
new Vue({
817
render: h => h(App),
918
router,
10-
}).$mount('#app');
19+
store
20+
}).$mount("#app");

0 commit comments

Comments
 (0)