Skip to content

Commit d567f9c

Browse files
committed
Format entire project
1 parent a83a781 commit d567f9c

52 files changed

Lines changed: 1681 additions & 1638 deletions

Some content is hidden

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

generator/index.js

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2,87 +2,87 @@ const helpers = require('./tools/helpers');
22
const fs = require('fs');
33

44
module.exports = (api, options) => {
5+
api.extendPackage({
6+
dependencies: {
7+
'axios': '^0.19.2',
8+
'dayjs': '^1.8.19',
9+
'vuex': '^3.1.2',
10+
'vuex-persistedstate': '^2.5.4',
11+
'lodash.clonedeep': '^4.5.0',
12+
'css-vars-ponyfill': '^2.1.2',
13+
'qs': '^6.9.4',
14+
'vue-router': '3.3.4',
15+
},
16+
});
17+
if (options.plugins.includes('fontawesomepro')) {
518
api.extendPackage({
6-
dependencies: {
7-
'axios': '^0.19.2',
8-
'dayjs': '^1.8.19',
9-
'vuex': '^3.1.2',
10-
'vuex-persistedstate': '^2.5.4',
11-
'lodash.clonedeep': '^4.5.0',
12-
'css-vars-ponyfill': '^2.1.2',
13-
'qs': '^6.9.4',
14-
'vue-router': '3.3.4',
15-
},
19+
dependencies: {
20+
'@fortawesome/fontawesome-pro': '^5.8.1',
21+
},
1622
});
17-
if (options.plugins.includes('fontawesomepro')) {
18-
api.extendPackage({
19-
dependencies: {
20-
'@fortawesome/fontawesome-pro': '^5.8.1',
21-
},
22-
});
23-
} else {
24-
api.extendPackage({
25-
dependencies: {
26-
'@fortawesome/fontawesome-free': '^5.14.0',
27-
},
28-
});
29-
}
30-
31-
if (options.useCrud) {
32-
api.extendPackage({
33-
dependencies: {
34-
'@kingscode/vuetify-resource': '^2.0.3',
35-
},
36-
});
37-
api.render('./templates/Crud', options);
38-
}
23+
} else {
24+
api.extendPackage({
25+
dependencies: {
26+
'@fortawesome/fontawesome-free': '^5.14.0',
27+
},
28+
});
29+
}
3930

40-
if (options.useGithubDeployemnts) {
41-
api.render('./templates/Deployment', options);
42-
}
31+
if (options.useCrud) {
32+
api.extendPackage({
33+
dependencies: {
34+
'@kingscode/vuetify-resource': '^2.0.3',
35+
},
36+
});
37+
api.render('./templates/Crud', options);
38+
}
4339

44-
if (options.addRobotsFile) {
45-
api.render('./templates/Robots', options);
46-
}
40+
if (options.useGithubDeployments) {
41+
api.render('./templates/Deployment', options);
42+
}
4743

48-
api.render('./templates/Default', options);
44+
if (options.addRobotsFile) {
45+
api.render('./templates/Robots', options);
46+
}
4947

50-
if (options.useAuthorisation) {
51-
api.render('./templates/Authorisation', options);
52-
}
48+
api.render('./templates/Default', options);
5349

54-
if (options.plugins.includes('sentry')) {
55-
api.extendPackage({
56-
dependencies: {
57-
'@sentry/browser': '^5.8.0',
58-
'@sentry/integrations': '^5.8.0',
59-
},
60-
});
61-
api.render('./templates/Plugins/sentry', options);
62-
}
50+
if (options.useAuthorisation) {
51+
api.render('./templates/Authorisation', options);
52+
}
6353

64-
if (options.plugins.includes('analytics')) {
65-
api.extendPackage({
66-
dependencies: {
67-
'vue-analytics': '^5.17.4',
68-
},
69-
});
70-
api.render('./templates/Plugins/analytics', options);
71-
}
54+
if (options.plugins.includes('sentry')) {
55+
api.extendPackage({
56+
dependencies: {
57+
'@sentry/browser': '^5.8.0',
58+
'@sentry/integrations': '^5.8.0',
59+
},
60+
});
61+
api.render('./templates/Plugins/sentry', options);
62+
}
7263

73-
api.onCreateComplete(() => {
74-
if (fs.existsSync('src/store.js')) {
75-
fs.unlinkSync(api.resolve('src/store.js'));
76-
}
77-
if (fs.existsSync('src/assets/logo.svg')) {
78-
fs.unlinkSync(api.resolve('src/assets/logo.svg'));
79-
}
80-
if (fs.existsSync('src/components/HelloWorld.vue')) {
81-
fs.unlinkSync(api.resolve('src/components/HelloWorld.vue'));
82-
}
83-
if (fs.existsSync('src/main.js')) {
84-
fs.unlinkSync(api.resolve('src/main.js'));
85-
}
86-
fs.renameSync(api.resolve('src/newmain.js'), api.resolve('src/main.js'));
64+
if (options.plugins.includes('analytics')) {
65+
api.extendPackage({
66+
dependencies: {
67+
'vue-analytics': '^5.17.4',
68+
},
8769
});
70+
api.render('./templates/Plugins/analytics', options);
71+
}
72+
73+
api.onCreateComplete(() => {
74+
if (fs.existsSync('src/store.js')) {
75+
fs.unlinkSync(api.resolve('src/store.js'));
76+
}
77+
if (fs.existsSync('src/assets/logo.svg')) {
78+
fs.unlinkSync(api.resolve('src/assets/logo.svg'));
79+
}
80+
if (fs.existsSync('src/components/HelloWorld.vue')) {
81+
fs.unlinkSync(api.resolve('src/components/HelloWorld.vue'));
82+
}
83+
if (fs.existsSync('src/main.js')) {
84+
fs.unlinkSync(api.resolve('src/main.js'));
85+
}
86+
fs.renameSync(api.resolve('src/newmain.js'), api.resolve('src/main.js'));
87+
});
8888
};
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {post} from '../../implementation/app';
1+
import { post } from '../../implementation/app';
22

33
export default function (email, password) {
4-
return post('auth/login', {
5-
email: email,
6-
password: password,
7-
});
4+
return post('auth/login', {
5+
email: email,
6+
password: password,
7+
});
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {post} from '../../implementation/app';
1+
import { post } from '../../implementation/app';
22

33
export default function () {
4-
return post('auth/logout');
4+
return post('auth/logout');
55
}
66

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import {post} from '../../implementation/app';
1+
import { post } from '../../implementation/app';
22

33
function passwordForgotten(email) {
4-
return post('password/forgotten', {
5-
email: email,
6-
});
4+
return post('password/forgotten', {
5+
email: email,
6+
});
77
}
88

99
function passwordReset(token, email, password, passwordConfirmation) {
10-
return post('password/reset', {
11-
token: token,
12-
email: email,
13-
password: password,
14-
password_confirmation: passwordConfirmation
15-
});
10+
return post('password/reset', {
11+
token: token,
12+
email: email,
13+
password: password,
14+
password_confirmation: passwordConfirmation,
15+
});
1616
}
1717

1818
export {
19-
passwordForgotten,
20-
passwordReset,
19+
passwordForgotten,
20+
passwordReset,
2121
};
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
import {post} from '../../implementation/app';
1+
import { post } from '../../implementation/app';
22

33
function register(email, name) {
4-
return post('registration', {
5-
email, name,
6-
});
4+
return post('registration', {
5+
email,
6+
name,
7+
});
78
}
89

910
function verify(token, email, password, passwordConfirmation) {
10-
return post('registration/verify', {
11-
token: token,
12-
email: email,
13-
password: password,
14-
password_confirmation: passwordConfirmation,
15-
});
11+
return post('registration/verify', {
12+
token: token,
13+
email: email,
14+
password: password,
15+
password_confirmation: passwordConfirmation,
16+
});
1617
}
1718

1819
export {
19-
register,
20-
verify,
20+
register,
21+
verify,
2122
};
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {post} from '../../implementation/app';
1+
import { post } from '../../implementation/app';
22

33
export default function (email) {
4-
return post('password/forgotten', {
5-
email: email,
6-
});
4+
return post('password/forgotten', {
5+
email: email,
6+
});
77
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {post} from '../../implementation/app';
1+
import { post } from '../../implementation/app';
22

33
export default async function (email, token, password, passwordConfirmation) {
4-
return post('registration', {
5-
email: email,
6-
token: token,
7-
password: password,
8-
password_confirmation: passwordConfirmation,
9-
});
4+
return post('registration', {
5+
email: email,
6+
token: token,
7+
password: password,
8+
password_confirmation: passwordConfirmation,
9+
});
1010
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
import axios, {getPaginated} from '../implementation/app';
1+
import axios, { getPaginated } from '../implementation/app';
22

33
function index(page, perPage, search, sortBy, descending, params) {
4-
return getPaginated('user', page, perPage, search, sortBy, descending, params);
4+
return getPaginated('user', page, perPage, search, sortBy, descending, params);
55
}
66

77
/**
88
* @param id {number}
99
*/
1010
function show(id) {
11-
return axios.get(`user/${id}`);
11+
return axios.get(`user/${id}`);
1212
}
1313

1414
/**
1515
* @param user {User}
1616
*/
1717
function create(user) {
18-
return axios.post('user', user);
18+
return axios.post('user', user);
1919
}
2020

2121
/**
2222
* @param user {User}
2323
*/
2424
function update(user) {
25-
return axios.put(`user/${user.id}`, user);
25+
return axios.put(`user/${user.id}`, user);
2626
}
2727

2828
/**
2929
* @param userId {number}
3030
*/
3131
function destroy(userId) {
32-
return axios.delete(`user/${userId}`);
32+
return axios.delete(`user/${userId}`);
3333
}
3434

3535
export {
36-
index,
37-
show,
38-
create,
39-
update,
40-
destroy,
36+
index,
37+
show,
38+
create,
39+
update,
40+
destroy,
4141
};

0 commit comments

Comments
 (0)