Skip to content

Commit

Permalink
chore: updated dev dependencies and raised node version
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi committed Jan 25, 2024
1 parent 2302b1f commit b6c018f
Show file tree
Hide file tree
Showing 112 changed files with 22,627 additions and 13,732 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
else
echo ENV_NAME="prod" >> $GITHUB_ENV
fi
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Load .env file
Expand All @@ -38,7 +38,7 @@ jobs:
mode: ${{ env.ENV_NAME }}
- run: npm ci
- name: Run linters
uses: wearerequired/lint-action@v1
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.github_token }}
eslint: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dockerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
else
echo ENV_NAME="prod" >> $GITHUB_ENV
fi
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18
cache: 'npm'
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
mode: ${{ env.ENV_NAME }}
- run: npm ci
- name: Run linters
uses: wearerequired/lint-action@v1
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.github_token }}
eslint: true
Expand Down
32 changes: 9 additions & 23 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
const defaultConfig = require('@biotope/quality-gate/config/.stylelintrc');

module.exports = {
...defaultConfig,
extends: [
// TODO: From the admin app. Probably a good idea to enable.
// 'stylelint-config-idiomatic-order',

// The config from quality-gate isn't compatible with stylelint@^14,
// therefore merge it with working alternatives.
'stylelint-config-standard-scss',
'stylelint-config-prettier'
],
plugins: ['stylelint-scss', 'stylelint-no-unsupported-browser-features'],
extends: ['stylelint-config-standard', 'stylelint-config-standard-scss'],
rules: {
...defaultConfig.rules,
'selector-max-id': 0,
'scss/dollar-variable-colon-space-after': 'always-single-line',
'scss/dollar-variable-colon-space-before': 'never',
'plugin/no-unsupported-browser-features': [
true,
{
Expand All @@ -35,18 +27,13 @@ module.exports = {
'outline',
'css3-cursors',
'css-resize',
'intrinsic-width'
'intrinsic-width',
'css-nesting',
'css-when-else',
'css-selection'
]
}
],

// From admin app
'max-empty-lines': [
2,
{
ignore: ['comments']
}
],
'rule-empty-line-before': [
'always-multi-line',
{
Expand All @@ -56,7 +43,6 @@ module.exports = {

// Defaults are not good
'alpha-value-notation': 'number',
'number-leading-zero': 'always',
'color-function-notation': 'legacy',
'value-keyword-case': null, // Requires e.g. "robotoslab" instead of "RobotoSlab"
'scss/operator-no-unspaced': null, // Has false positives
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=14.21.1
ARG NODE_VERSION=18.16.1
ARG PORT=80

FROM node:$NODE_VERSION as proxyBuild
Expand Down Expand Up @@ -41,6 +41,6 @@ COPY build /app/build
ENV NODE_ENV=production
ENV PORT=$PORT

RUN npm install --ignore-scripts
RUN npm ci --ignore-scripts

CMD ["npm", "run", "start"]
5 changes: 4 additions & 1 deletion config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ function getClientEnvironment(publicUrl) {
// and `sockPort` options in webpack-dev-server.
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
// Whether or not react-refresh is enabled.
// It is defined here so it is available in the webpackHotDevClient.
FAST_REFRESH: process.env.FAST_REFRESH !== 'false'
}
);
// Stringify all values so we can feed into webpack DefinePlugin
Expand Down
29 changes: 0 additions & 29 deletions config/jest/babelTransform.js

This file was deleted.

14 changes: 0 additions & 14 deletions config/jest/cssTransform.js

This file was deleted.

40 changes: 0 additions & 40 deletions config/jest/fileTransform.js

This file was deleted.

8 changes: 5 additions & 3 deletions config/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ function getModules() {
// TypeScript project and set up the config
// based on tsconfig.json
if (hasTsConfig) {
const ts = require(resolve.sync('typescript', {
basedir: paths.appNodeModules
}));
const ts = require(
resolve.sync('typescript', {
basedir: paths.appNodeModules
})
);
config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
// Otherwise we'll check if there is jsconfig.json
// for non TS projects.
Expand Down
2 changes: 1 addition & 1 deletion config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
appJsConfig: resolveApp('jsconfig.json'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
proxySetup: resolveApp('proxy/routes/index.js'),
appNodeModules: resolveApp('node_modules'),
appWebpackCache: resolveApp('node_modules/.cache'),
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ module.exports = function (webpackEnv) {
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/')
: isEnvDevelopment &&
((info) =>
((info) =>
path
.resolve(info.absoluteResourcePath)
.replace(/\\/g, '/'))
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/tokens.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Keycloak Tokens', () => {
});
});

it.skip('should keep refreshing access token before it expires', () => {
it('should keep refreshing access token before it expires', () => {
cy.clock();
cy.login();
cy.wait('@askerSessions');
Expand All @@ -67,7 +67,7 @@ describe('Keycloak Tokens', () => {
}
});

it.skip('should refresh the access token if its expired when loading the app', () => {
it('should refresh the access token if its expired when loading the app', () => {
cy.willReturn('consultingType', { statusCode: 404 });

cy.clock();
Expand All @@ -93,10 +93,10 @@ describe('Keycloak Tokens', () => {
});

it.skip('should logout if refresh token is already expired when loading the app', () => {
cy.clock();
cy.login();
cy.wait('@askerSessions');
cy.wait('@usersData');
cy.clock();

cy.clock().then((clock) => {
clock.restore();
Expand All @@ -112,10 +112,10 @@ describe('Keycloak Tokens', () => {

//TODO: inspect this test, as there seems to be a race condition
it.skip('should logout if refresh token is expired while the app is loaded', () => {
cy.clock();
cy.login();
cy.wait('@askerSessions');
cy.wait('@usersData');
cy.clock();

waitForTokenProcessing();

Expand All @@ -126,7 +126,7 @@ describe('Keycloak Tokens', () => {
cy.get('.loginForm').should('exist');
});

it.skip('should not logout if refresh token is expired but access token is still valid', () => {
it('should not logout if refresh token is expired but access token is still valid', () => {
cy.clock();
cy.login({
auth: { expires_in: 1800, refresh_expires_in: 600 }
Expand All @@ -142,7 +142,7 @@ describe('Keycloak Tokens', () => {
cy.get('.loginForm').should('not.exist');
});

it.skip('should not logout if refresh token is expired but access token is still valid when the app loads', () => {
it('should not logout if refresh token is expired but access token is still valid when the app loads', () => {
const refreshExpiresIn = 600;

cy.clock();
Expand Down
28 changes: 19 additions & 9 deletions cypress/support/commands/mockApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import {
let overrides = {};

const defaultReturns = {
attachmentUpload: {
'attachmentUpload': {
statusCode: 201
},
userData: {
'userData': {
emailToggles: [
{
name: 'DAILY_ENQUIRY',
Expand All @@ -49,22 +49,23 @@ const defaultReturns = {
}
]
},
consultingTypes: [],
settings: {},
releases: {
'consultingTypes': [],
'settings': {},
'releases': {
statusCode: 404
},
releases_markup: {
'releases_markup': {
statusCode: 404
},
sessionRooms: {
'sessionRooms': {
statusCode: 200,
body: {
sessions: []
}
},
agencyConsultants: [],
agencyConsultantsLanguages: ['de']
'frontend.settings': {},
'agencyConsultants': [],
'agencyConsultantsLanguages': ['de']
};

Cypress.Commands.add('willReturn', (name: string, data: any) => {
Expand Down Expand Up @@ -224,6 +225,15 @@ Cypress.Commands.add('mockApi', () => {
})
);

cy.intercept('GET', endpoints.frontend.settings, (req) =>
req.reply(
JSON.stringify({
...defaultReturns['frontend.settings'],
...(overrides['frontend.settings'] || {})
})
)
);

cy.intercept(
'GET',
`${endpoints.rc.settings.public}*`,
Expand Down
2 changes: 0 additions & 2 deletions cypress/support/commands/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,3 @@ Cypress.Commands.add('emitVideoCallRequest', () => {
});
});
});

Cypress.Commands.add('startWebServer', () => {});
Loading

0 comments on commit b6c018f

Please sign in to comment.