Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit cc0a6c1

Browse files
authored
Update dependencies (#817)
* feat(core) update dependencies * feat(core) update husky * feat(core): test * feat(core): clean code * feat(core): update husky, remove env, improve release info * feat(core): clean dependencies * feat(core): update lerna * feat(core): update CLI dependencies, drop support for IE * feat(core): clean code
1 parent a899234 commit cc0a6c1

File tree

13 files changed

+12390
-14615
lines changed

13 files changed

+12390
-14615
lines changed

.browserslistrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> 1%
22
last 2 versions
3-
not ie <= 8
3+
not ie <= 11

.eslintrc.js

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ module.exports = {
1111
jest: true,
1212
'cypress/globals': true,
1313
},
14-
parserOptions: {
15-
parser: 'babel-eslint',
16-
},
1714
extends: [
1815
'airbnb-base',
1916
'plugin:vue/strongly-recommended',

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ config/*
4747
# exception to the rule
4848
!config/.copyright
4949
modules.config.js
50-
.huskyrc
50+
.husky

.husky.dist/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky.dist/pre-commit

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint
5+
npm test

.huskyrc.dist

-5
This file was deleted.

modules/@ergonode/authentication/src/components/Layout/Login.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<template>
66
<main class="login">
77
<section class="login__body">
8-
<GitInformation />
8+
<GitReleaseInformation v-if="isReleaseInformation" />
99
<FluidBlob />
1010
<div class="login-body__form">
1111
<slot name="form" />
@@ -53,7 +53,6 @@ import {
5353
LOGIN_STATE,
5454
} from '@Authentication/defaults/login-state';
5555
import IconLogoName from '@Core/components/Icons/Logo/IconLogoName';
56-
import GitInformation from '@Core/components/ReleaseInfo/GitInformation';
5756
import {
5857
SIZE,
5958
} from '@Core/defaults/theme';
@@ -70,10 +69,10 @@ export default {
7069
components: {
7170
LinkButton,
7271
Footer,
73-
GitInformation,
7472
IconLogoName,
7573
FluidBlob,
7674
Select,
75+
GitReleaseInformation: () => import('@Core/components/GitReleaseInformation/GitReleaseInformation'),
7776
},
7877
data() {
7978
return {
@@ -90,6 +89,9 @@ export default {
9089
languageOptions() {
9190
return Object.values(TRANSLATIONS);
9291
},
92+
isReleaseInformation() {
93+
return this.$config.SHOW_RELEASE_INFO;
94+
},
9395
},
9496
methods: {
9597
onHelpClicked() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright © Ergonode Sp. z o.o. All rights reserved.
3+
* See LICENSE for license details.
4+
*/
5+
<template>
6+
<span
7+
class="git-release-information"
8+
v-text="showReleaseInfo" />
9+
</template>
10+
<script>
11+
import {
12+
DEFAULT_DATA_HOUR_FORMAT,
13+
} from '@Core/defaults/date';
14+
import {
15+
format as formatDate,
16+
} from 'date-fns';
17+
import getRepoInfo from 'git-repo-info';
18+
19+
export default {
20+
name: 'GitReleaseInformation',
21+
async fetch() {
22+
this.repoInfo = await getRepoInfo();
23+
},
24+
data() {
25+
return {
26+
repoInfo: {
27+
abbreviatedSha: '',
28+
committerDate: '',
29+
},
30+
};
31+
},
32+
computed: {
33+
showReleaseInfo() {
34+
if (!(this.repoInfo.abbreviatedSha && this.repoInfo.committerDate)) {
35+
return '';
36+
}
37+
38+
return `Commit hash: ${this.repoInfo.abbreviatedSha}
39+
Date: ${formatDate(new Date(this.repoInfo.committerDate), DEFAULT_DATA_HOUR_FORMAT)}
40+
Release: v${this.$config.VUE_APP_VERSION}`;
41+
},
42+
},
43+
};
44+
</script>
45+
<style lang="scss" scoped>
46+
.git-release-information {
47+
position: absolute;
48+
top: 0;
49+
right: 0;
50+
padding: 10px;
51+
white-space: pre-wrap;
52+
color: $GREY_DARK;
53+
font: $FONT_MEDIUM_12_16;
54+
text-align: right;
55+
}
56+
</style>

modules/@ergonode/core/src/components/ReleaseInfo/GitInformation.vue

-46
This file was deleted.

modules/@ergonode/core/src/plugins/axios.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const removeCancelToken = (token) => {
8282

8383
export default function ({
8484
$axios,
85+
$config,
8586
app,
8687
store,
8788
error,
@@ -123,7 +124,7 @@ export default function ({
123124
language,
124125
} = store.state.authentication.user;
125126

126-
configLocal.baseURL = `${process.env.baseURL}${language}/`;
127+
configLocal.baseURL = `${$config.axios.browserBaseURL}${language}/`;
127128
}
128129

129130
if (!config.url.includes('token/refresh')) {
@@ -230,6 +231,7 @@ export default function ({
230231
key: 'isLogged',
231232
value: false,
232233
});
234+
233235
redirect('/');
234236
})
235237
.finally(() => { isRefreshing = false; }));

nuxt.config.js

+12-16
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See LICENSE for license details.
55
*/
66

7-
import dotenv from 'dotenv';
8-
import getRepoInfo from 'git-repo-info';
97
import {
108
join,
119
} from 'path';
@@ -18,12 +16,7 @@ import {
1816
version,
1917
} from './package';
2018

21-
dotenv.config({
22-
path: '.env',
23-
});
24-
2519
const IS_DEV = process.env.NODE_ENV !== 'production';
26-
const BASE_URL = process.env.API_BASE_URL || 'http://localhost:8000';
2720
const PARALLEL = process.env.PARALLEL || false;
2821

2922
module.exports = {
@@ -149,7 +142,7 @@ module.exports = {
149142
],
150143
},
151144
axios: {
152-
baseURL: BASE_URL || 'http://localhost:8000',
145+
baseURL: 'http://localhost:8080',
153146
},
154147
build: {
155148
babel: {
@@ -159,11 +152,6 @@ module.exports = {
159152
cssSourceMap: true,
160153
optimizeCSS: true,
161154
loaders: {
162-
css: {
163-
modules: {
164-
compileType: 'icss',
165-
},
166-
},
167155
vue: {
168156
compilerOptions: {
169157
modules: [
@@ -221,12 +209,20 @@ module.exports = {
221209
performance: true,
222210
},
223211
},
224-
env: {
225-
baseURL: BASE_URL,
212+
213+
publicRuntimeConfig: {
214+
axios: {
215+
browserBaseURL: process.env.API_BASE_URL,
216+
},
226217
NUXT_ENV: process.env.NUXT_ENV || process.env.NODE_ENV || 'development',
227218
VUE_APP_VERSION: version,
228-
VUE_APP_GIT_INFO: getRepoInfo(),
229219
SHOW_RELEASE_INFO: process.env.SHOW_RELEASE_INFO || false,
230220
LEAVE_TEST_TAG_ATTRS: process.env.LEAVE_TEST_TAG_ATTRS || true,
231221
},
222+
223+
privateRuntimeConfig: {
224+
axios: {
225+
baseURL: process.env.API_BASE_URL,
226+
},
227+
},
232228
};

0 commit comments

Comments
 (0)