Skip to content

Commit aadfc02

Browse files
committed
Major application refactoring that includes upgrade to .NET 5.0, ClientApp file restructure, general code refactoring (client & server)
1 parent 036fc45 commit aadfc02

32 files changed

+4638
-3215
lines changed

GhostUI/ClientApp/.browserslistrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> 1%
22
last 2 versions
3-
not dead
3+
not dead

GhostUI/ClientApp/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
node: true
55
},
66
extends: [
7-
"plugin:vue/vue3-essential",
7+
"plugin:vue/essential",
88
"eslint:recommended",
99
"@vue/typescript/recommended",
1010
"@vue/prettier/@typescript-eslint"

GhostUI/ClientApp/package-lock.json

+4,449-3,051
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GhostUI/ClientApp/package.json

+34-33
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,46 @@
1111
"test:unit": "vue-cli-service test:unit"
1212
},
1313
"dependencies": {
14-
"@fortawesome/fontawesome-svg-core": "^1.2.32",
15-
"@fortawesome/free-brands-svg-icons": "^5.15.1",
16-
"@fortawesome/free-solid-svg-icons": "^5.15.1",
17-
"@fortawesome/vue-fontawesome": "^2.0.0",
18-
"@microsoft/signalr": "^3.1.9",
19-
"axios": "^0.20.0",
20-
"bulma": "^0.9.1",
21-
"core-js": "^3.6.5",
22-
"register-service-worker": "^1.7.1",
14+
"@fortawesome/fontawesome-svg-core": "^1.2.34",
15+
"@fortawesome/free-brands-svg-icons": "^5.15.2",
16+
"@fortawesome/free-solid-svg-icons": "^5.15.2",
17+
"@fortawesome/vue-fontawesome": "^2.0.2",
18+
"@microsoft/signalr": "^5.0.3",
19+
"axios": "^0.21.1",
20+
"bulma": "^0.9.2",
21+
"core-js": "^3.8.3",
22+
"register-service-worker": "^1.7.2",
2323
"vue": "^2.6.12",
2424
"vue-class-component": "^7.2.6",
25-
"vue-property-decorator": "^9.0.2",
26-
"vue-router": "^3.4.7",
25+
"vue-property-decorator": "^9.1.2",
26+
"vue-router": "^3.5.1",
2727
"vue-snotify": "^3.2.1",
28-
"vue-styled-components": "^1.5.1",
29-
"vuex": "^3.5.1"
28+
"vue-styled-components": "^1.6.0",
29+
"vuex": "^3.6.2"
3030
},
3131
"devDependencies": {
32-
"@testing-library/jest-dom": "^5.11.4",
33-
"@types/jest": "^26.0.15",
34-
"@typescript-eslint/eslint-plugin": "^4.5.0",
35-
"@typescript-eslint/parser": "^4.5.0",
36-
"@vue/cli-plugin-babel": "^4.5.8",
37-
"@vue/cli-plugin-e2e-nightwatch": "^4.5.8",
38-
"@vue/cli-plugin-eslint": "^4.5.8",
39-
"@vue/cli-plugin-pwa": "^4.5.8",
40-
"@vue/cli-plugin-typescript": "^4.5.8",
41-
"@vue/cli-plugin-unit-jest": "^4.5.8",
42-
"@vue/cli-service": "^4.5.8",
32+
"@testing-library/jest-dom": "^5.11.9",
33+
"@types/jest": "^26.0.20",
34+
"@typescript-eslint/eslint-plugin": "^4.15.1",
35+
"@typescript-eslint/parser": "^4.15.1",
36+
"@vue/cli-plugin-babel": "^4.5.11",
37+
"@vue/cli-plugin-e2e-nightwatch": "^4.5.11",
38+
"@vue/cli-plugin-eslint": "^4.5.11",
39+
"@vue/cli-plugin-pwa": "^4.5.11",
40+
"@vue/cli-plugin-typescript": "^4.5.11",
41+
"@vue/cli-plugin-unit-jest": "^4.5.11",
42+
"@vue/cli-service": "^4.5.11",
4343
"@vue/eslint-config-prettier": "^6.0.0",
44-
"@vue/test-utils": "1.1.0",
45-
"eslint": "^7.11.0",
46-
"eslint-plugin-prettier": "^3.1.4",
47-
"eslint-plugin-vue": "^7.1.0",
48-
"node-sass": "^4.14.1",
49-
"prettier": "^2.1.2",
50-
"sass-loader": "^10.0.3",
51-
"ts-jest": "^26.4.1",
52-
"typescript": "^4.0.3",
44+
"@vue/eslint-config-typescript": "^7.0.0",
45+
"@vue/test-utils": "1.1.3",
46+
"eslint": "^7.20.0",
47+
"eslint-plugin-prettier": "^3.3.1",
48+
"eslint-plugin-vue": "^7.6.0",
49+
"node-sass": "^5.0.0",
50+
"prettier": "^2.2.1",
51+
"sass-loader": "^10.1.1",
52+
"ts-jest": "^26.5.1",
53+
"typescript": "^4.1.5",
5354
"vue-svg-loader": "^0.16.0",
5455
"vue-template-compiler": "^2.6.12",
5556
"vuex-module-decorators": "^1.0.1"

GhostUI/ClientApp/public/index.html

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<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-
<title>GhostUI</title>
8-
</head>
9-
<body>
3+
<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+
<title>GhostUI</title>
8+
</head>
9+
<body>
1010
<noscript>
11-
<strong>We're sorry but this application doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
11+
<strong>We're sorry but this application doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
1212
</noscript>
1313
<div id="app"></div>
14+
<!-- built files will be auto injected -->
1415
</body>
1516
</html>
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "aspnet-core-vue-vuex-playground-template",
3-
"short_name": "aspnet-core-vue-template",
3+
"short_name": "VueNetCoreSpa",
44
"icons": [
55
{
6-
"src": "./img/icons/android-chrome-192x192.png",
6+
"src": "/img/icons/android-chrome-192x192.png",
77
"sizes": "192x192",
88
"type": "image/png"
99
},
1010
{
11-
"src": "./img/icons/android-chrome-512x512.png",
11+
"src": "/img/icons/android-chrome-512x512.png",
1212
"sizes": "512x512",
1313
"type": "image/png"
1414
}
1515
],
16-
"start_url": "/index.html",
16+
"start_url": ".",
1717
"display": "standalone",
18-
"background_color": "#000000",
18+
"background_color": "#ffffff",
1919
"theme_color": "#209cee"
2020
}

GhostUI/ClientApp/public/robots.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1+
# https://www.robotstxt.org/robotstxt.html
12
User-agent: *
2-
Disallow:

GhostUI/ClientApp/src/App.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div id="app">
33
<vue-snotify />
4-
<Navbar />
5-
<Settings />
4+
<navbar />
5+
<settings />
66
<transition mode="out-in" :name="$route.meta.transitionName">
77
<router-view />
88
</transition>
9-
<AppFooter />
9+
<app-footer />
1010
</div>
1111
</template>
1212

GhostUI/ClientApp/src/components/VDropdown.render.tsx

+16-8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default class VDropdown extends Vue {
5353

5454
public renderListOption(option: any, index: number): VNode {
5555
const optionLabel = this.getOptionLabelName(option);
56+
5657
return (
5758
<li key={index}>
5859
<a
@@ -83,14 +84,21 @@ export default class VDropdown extends Vue {
8384
}
8485

8586
public keyDownHandler(e: KeyboardEvent): void {
86-
if (e.keyCode === 38 || e.keyCode === 40) { // up and down keys
87-
this.toggleDropdownMenu();
88-
e.preventDefault();
89-
} else if (e.keyCode === 27) { // Esc key
90-
this.$refs.dropdownButton.focus();
91-
this.hideDropdownMenu();
92-
} else if (e.keyCode === 9) { // Tab key
93-
this.hideDropdownMenu();
87+
switch (e.key) {
88+
case 'ArrowUp':
89+
case 'ArrowDown':
90+
this.toggleDropdownMenu();
91+
e.preventDefault();
92+
break;
93+
case 'Escape':
94+
this.$refs.dropdownButton.focus();
95+
this.hideDropdownMenu();
96+
break;
97+
case 'Tab':
98+
this.hideDropdownMenu();
99+
break;
100+
default:
101+
break;
94102
}
95103
}
96104
}

GhostUI/ClientApp/src/main.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import Vue from 'vue';
2-
import App from '@/App.vue';
32
import '@/registerServiceWorker';
43
import '@/assets/style/scss/main.scss';
4+
import '@/config/fa.config';
5+
import App from '@/App.vue';
56
import store from '@/store';
67
import router from '@/router';
78
import Snotify from 'vue-snotify';
89
import { vClickOutside } from '@/plugins';
910
import { SignalRApi } from '@/api/signalR.service';
1011
import { snotifyDefaults } from '@/config/vue-snotify.config';
1112
import AxiosGlobalConfig from '@/config/axios.config';
12-
import '@/config/fa.config';
13-
14-
// Execute global Axios configurations (e.g. request interceptors)
15-
AxiosGlobalConfig.setup();
1613

1714
// Install custom plugins/third-party packages
18-
Vue.use(vClickOutside)
19-
.use(Snotify, snotifyDefaults);
15+
Vue.use(vClickOutside);
16+
Vue.use(Snotify, snotifyDefaults);
2017

21-
// In the mounted callback configure Signalr - wrap in this.$nextTick callback to ensure all children mount as well
18+
// In the mounted callback configure Signalr/Axios - wrap in this.$nextTick callback to ensure all children mount as well
2219
new Vue({
2320
router,
2421
store,
2522
render: (h) => h(App),
2623
mounted() {
27-
this.$nextTick(() => SignalRApi.startConnection());
24+
this.$nextTick(() => {
25+
AxiosGlobalConfig.setup();
26+
SignalRApi.startConnection();
27+
});
2828
}
2929
}).$mount('#app');

GhostUI/ClientApp/src/store/modules/auth/types.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
SUCCESS = 'success'
66
};
77

8-
export type IAuthUser = {
9-
readonly token?: string;
10-
readonly userName?: string;
11-
readonly status?: AuthStatusEnum;
12-
};
8+
export type IAuthUser = Readonly<{
9+
token?: string;
10+
userName?: string;
11+
status?: AuthStatusEnum;
12+
}>;
1313

1414
export type ICredentials = {
1515
userName?: string;

GhostUI/ClientApp/src/store/modules/form/types.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export type IDropdownOption = {
2-
readonly value: number;
3-
readonly label: string;
4-
};
1+
export type IDropdownOption = Readonly<{
2+
value: number;
3+
label: string;
4+
}>;
55

66
export type IFormState = {
77
count: number;

GhostUI/ClientApp/src/store/modules/weather-forecasts/types.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
export type IWeatherForecast = {
2-
readonly id: number;
3-
readonly summary: string;
4-
readonly temperatureC: number;
5-
readonly temperatureF: number;
6-
readonly dateFormatted: string;
7-
};
1+
export type IWeatherForecast = Readonly<{
2+
id: number;
3+
summary: string;
4+
temperatureC: number;
5+
temperatureF: number;
6+
dateFormatted: string;
7+
}>;
88

99
export type IWeatherForecastsState = {
1010
startDateIndex: number;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Vue from 'vue'
2+
import { SnotifyService } from 'vue-snotify/SnotifyService'
3+
4+
declare module 'vue/types/vue' {
5+
interface Vue {
6+
$snotify: SnotifyService
7+
}
8+
}

GhostUI/ClientApp/src/types/tsx-shims.d.ts renamed to GhostUI/ClientApp/src/types/shims-tsx.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ declare global {
88
$props: {};
99
}
1010
interface IntrinsicElements {
11-
[elemName: string]: any;
11+
[elem: string]: any;
1212
}
1313
}
1414
}

GhostUI/ClientApp/src/types/vue-snotify-shims.d.ts

-7
This file was deleted.

GhostUI/ClientApp/src/views/Login/Login.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { UserNameInput, PasswordInput, RememberMeInput } from "./child-component
4444
}
4545
})
4646
export default class Login extends Vue {
47-
public invalidInputs: boolean = false;
47+
public invalidInputs = false;
4848
public authStatus: AuthStatusEnum = AuthStatusEnum.NONE;
4949
5050
get isLoginInputValid(): boolean {

GhostUI/ClientApp/src/views/Login/child-components/PasswordInput.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<input
55
placeholder="Password"
66
v-model.trim="password"
7+
autocomplete="password"
78
:type="!showPassword ? 'password' : 'text'"
89
:class="['input is-medium', { 'is-danger': isPasswordInvalid }]"
910
/>
@@ -27,7 +28,7 @@ import { AuthModule } from "../../../store/modules/auth";
2728
2829
@Component
2930
export default class PasswordInput extends Vue {
30-
public showPassword: boolean = false;
31+
public showPassword = false;
3132
3233
@Prop() public readonly isInputInvalid: boolean;
3334

GhostUI/ClientApp/tsconfig.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
"target": "esnext",
44
"module": "esnext",
55
"jsx": "preserve",
6-
"strict": false,
7-
"noImplicitAny": false,
8-
"noImplicitThis": true,
6+
"strict": true,
7+
"allowJs": true,
8+
"noImplicitAny": false,
99
"importHelpers": true,
1010
"moduleResolution": "node",
11+
"resolveJsonModule": true,
1112
"experimentalDecorators": true,
1213
"esModuleInterop": true,
14+
"strictPropertyInitialization": false,
1315
"allowSyntheticDefaultImports": true,
1416
"sourceMap": true,
1517
"baseUrl": ".",
@@ -25,8 +27,7 @@
2527
"lib": [
2628
"esnext",
2729
"dom",
28-
"dom.iterable",
29-
"scripthost"
30+
"dom.iterable"
3031
]
3132
},
3233
"include": [

0 commit comments

Comments
 (0)