Skip to content

Commit 811c449

Browse files
authored
Merge pull request #579 from OpenConext/feature/259-create-react-app-is-deprecated-welcome-vite
Feature/259 create react app is deprecated welcome vite
2 parents 85d9366 + ab7423d commit 811c449

47 files changed

Lines changed: 2621 additions & 9084 deletions

Some content is hidden

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

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,40 @@ Note: for MariaDB `COLLATE utf8mb4_0900_ai_ci` might not work and can be left ou
4242
This project uses Spring Boot and Maven. To run locally, type:
4343

4444
```bash
45-
(cd server && mvn spring-boot:run)
45+
cd server
46+
mvn spring-boot:run
4647
```
4748

48-
Install frontend dependencies
49+
Install client frontend dependencies
4950

5051
```bash
5152
cd client
5253
nvm use
5354
yarn install
5455
```
5556

56-
Run frontend
57+
Install welcome frontend dependencies
58+
```bash
59+
cd welcome
60+
nvm use
61+
yarn install
62+
```
63+
64+
Run the client frontend <http://localhost:3000>
65+
66+
```bash
67+
cd client
68+
yarn start
69+
```
70+
Run the welcome frontend <http://localhost:4000>
71+
```bash
72+
cd welcome
73+
yarn start
74+
```
5775

76+
Run the server backend
5877
```bash
59-
(cd client && yarn start)
78+
mvn spring-boot:run -Dspring-boot.run.profiles=dev -Dmaven.test.skip=true
6079
```
6180

6281
### [Mail](#mail)

client/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ rm -Rf target/*
44
rm -Rf dist/*
55
source $NVM_DIR/nvm.sh
66
nvm use
7-
yarn install --force && CI=true yarn test && yarn build
7+
yarn install --force && CI=true yarn test && yarn lint && yarn build

welcome/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.8.0
1+
v24.11.0

welcome/assembly.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</formats>
88
<fileSets>
99
<fileSet>
10-
<directory>build</directory>
10+
<directory>dist</directory>
1111
<outputDirectory>.</outputDirectory>
1212
<includes>
1313
<include>**/*.*</include>

welcome/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
rm -Rf public/bundle*
33
rm -Rf target/*
4+
rm -Rf dist/*
45
source $NVM_DIR/nvm.sh
56
nvm use
6-
yarn install --force && CI=true yarn test && yarn build
7+
yarn install --force && CI=true yarn test && yarn lint && yarn build

welcome/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM ghcr.io/openconext/openconext-basecontainers/apache2:latest
2-
ADD ./build/ /var/www/
2+
ADD ./dist/ /var/www/
33
RUN rm -rf /etc/apache2/sites-enabled/*.conf
44
COPY ./docker/appconf.conf /etc/apache2/sites-enabled/
55

welcome/eslint.config.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import pluginReact from "eslint-plugin-react";
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import { defineConfig } from "eslint/config";
6+
7+
export default defineConfig([
8+
{
9+
files: ["**/*.{js,mjs,cjs,jsx}"],
10+
plugins: {
11+
js ,
12+
'react-hooks': reactHooks
13+
},
14+
extends: ["js/recommended"],
15+
languageOptions: { globals: globals.browser }
16+
},
17+
pluginReact.configs.flat.recommended, // React config first
18+
reactHooks.configs.flat.recommended,
19+
{
20+
rules: {
21+
"react/prop-types": "off",
22+
"react/no-children-prop": "off",
23+
'react-hooks/exhaustive-deps': 'warn',
24+
"react/react-in-jsx-scope" : "off",
25+
"react-hooks/set-state-in-effect": "warn",
26+
"react-hooks/immutability":"off"
27+
},
28+
},
29+
30+
]);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
5+
<link rel="icon" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
88
<meta
@@ -12,7 +12,7 @@
1212
<title>SURFconext Invite</title>
1313
</head>
1414
<body class="sds--color-palette--blue">
15-
<noscript>You need to enable JavaScript to run this app.</noscript>
1615
<div id="app"></div>
16+
<script type="module" src="/src/main.jsx"></script>
1717
</body>
1818
</html>

welcome/package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"name": "welcome",
33
"version": "0.1.0",
44
"private": true,
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vite build",
8+
"lint": "eslint .",
9+
"preview": "vite preview",
10+
"test": "vitest"
11+
},
512
"dependencies": {
613
"@surfnet/sds": "^0.0.150",
714
"dompurify": "^3.2.6",
@@ -24,22 +31,22 @@
2431
"@testing-library/jest-dom": "^6.7.0",
2532
"@testing-library/react": "^16.3.0",
2633
"@testing-library/user-event": "^14.6.1",
34+
"@vitejs/plugin-react": "^5.1.0",
35+
"eslint": "^9.39.1",
36+
"eslint-plugin-react": "^7.37.5",
37+
"eslint-plugin-react-hooks": "^7.0.1",
38+
"globals": "^16.5.0",
2739
"http-proxy-middleware": "^3.0.5",
28-
"react-scripts": "5.0.1",
29-
"sass": "^1.90.0"
40+
"sass": "^1.90.0",
41+
"vite": "^7.2.2",
42+
"vite-plugin-svgr": "^4.5.0",
43+
"vitest": "^4.0.8"
3044
},
3145
"resolutions": {
3246
"nth-check": "^2.1.1",
3347
"tough-cookie": "^5.1.2",
3448
"word-wrap": "^1.2.5"
3549
},
36-
"scripts": {
37-
"start": "react-scripts start",
38-
"build": "react-scripts build",
39-
"test": "react-scripts test",
40-
"eject": "react-scripts eject"
41-
},
42-
"proxy": "http://127.0.0.1:8888/",
4350
"eslintConfig": {
4451
"extends": [
4552
"react-app",
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import { describe, it, expect } from 'vitest';
22
import en from "../../locale/en";
33
import nl from "../../locale/nl";
44

@@ -10,22 +10,23 @@ expect.extend({
1010
};
1111
},
1212
});
13-
14-
test("All translations exists in all bundles", () => {
15-
const contains = (translation, translationToVerify, keyCollection, parents) => {
16-
Object.keys(translation).forEach(key => {
17-
expect(translationToVerify).toContainKey(key);
18-
const value = translation[key];
19-
keyCollection.push(parents+key);
20-
if (typeof value === "object") {
21-
contains(value, translationToVerify[key], keyCollection, parents+key+".")
22-
}
23-
});
24-
};
25-
const keyCollectionEN = [];
26-
contains(en, nl, keyCollectionEN, '');
27-
const keyCollectionNL = [];
28-
contains(nl, en, keyCollectionNL, '');
29-
const positionalMismatches = keyCollectionEN.filter((item, index) => keyCollectionNL[index] !== item);
30-
expect(positionalMismatches).toEqual([])
13+
describe('En', () => {
14+
it("All translations exists in all bundles", () => {
15+
const contains = (translation, translationToVerify, keyCollection, parents) => {
16+
Object.keys(translation).forEach(key => {
17+
expect(translationToVerify).toContainKey(key);
18+
const value = translation[key];
19+
keyCollection.push(parents+key);
20+
if (typeof value === "object") {
21+
contains(value, translationToVerify[key], keyCollection, parents+key+".")
22+
}
23+
});
24+
};
25+
const keyCollectionEN = [];
26+
contains(en, nl, keyCollectionEN, '');
27+
const keyCollectionNL = [];
28+
contains(nl, en, keyCollectionNL, '');
29+
const positionalMismatches = keyCollectionEN.filter((item, index) => keyCollectionNL[index] !== item);
30+
expect(positionalMismatches).toEqual([])
31+
});
3132
});

0 commit comments

Comments
 (0)