Skip to content

Commit 00955c1

Browse files
Merge pull request #2 from aroskanalen/feature/1541-update-node-migrate-CRA-to-vite
1541 update node migrate cra to vite
2 parents f64b131 + 4c91ea8 commit 00955c1

22 files changed

+3700
-12356
lines changed

vite-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#243](https://github.com/aroskanalen/display-admin-client/pull/2)
8+
- Migrate from CRA to Vite
9+
- Upgrade node from 14 -> 20
10+
711
- [#242](https://github.com/os2display/display-admin-client/pull/243)
812
- Add entry in example config for midttrafik api key
913
- Clean up multi select component a bit, replace reduce with Map logic
1014
- Make the station selector call new api
1115
- Add config to context in app.jsx
1216

13-
1417
## [2.0.2] - 2024-04-25
1518

1619
- [#242](https://github.com/os2display/display-admin-client/pull/242)

config-overrides.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

docker-compose.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
3030

3131
node:
32-
image: node:14
32+
image: node:20
3333
command: yarn start
3434
networks:
3535
- app
@@ -38,12 +38,6 @@ services:
3838
- NODE_ENV=development
3939
volumes:
4040
- .:/app:delegated
41-
healthcheck:
42-
test: [ "CMD", "curl", "-f", "http://node:3000/tags" ]
43-
interval: 5s
44-
timeout: 10s
45-
retries: 3
46-
start_period: 60s
4741

4842
cypress:
4943
image: cypress/included:9.5.4

index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<!--
9+
manifest.json provides metadata used when your web app is installed on a
10+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="/manifest.json" />
13+
<title>OS2Display admin</title>
14+
</head>
15+
<body class="bg-light">
16+
<noscript>You need to enable JavaScript to run this app.</noscript>
17+
<div id="root"></div>
18+
<script type="module" src="/src/index.jsx"></script>
19+
</body>
20+
</html>

package.json

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,19 @@
1111
"@hello-pangea/dnd": "^16.0.0",
1212
"@paciolan/remote-component": "^2.11.0",
1313
"@reduxjs/toolkit": "^1.6.1",
14-
"@testing-library/jest-dom": "^5.11.4",
15-
"@testing-library/react": "^11.1.0",
16-
"@testing-library/user-event": "^12.1.10",
14+
"@vitejs/plugin-react": "^4.3.0",
1715
"bootstrap": "^5.0.2",
1816
"dayjs": "^1.10.7",
1917
"dompurify": "^2.3.3",
20-
"eslint-plugin-jsdoc": "^35.4.3",
2118
"focus-trap-react": "^10.2.1",
2219
"i18next": "^21.6.14",
23-
"lodash.find": "^4.2.0",
2420
"lodash.get": "^4.4.2",
2521
"lodash.set": "^4.3.2",
2622
"lodash.uniqwith": "^4.5.0",
27-
"os2display-grid-generator": "^1.0.8",
23+
"os2display-grid-generator": "^1.0.10",
2824
"prop-types": "^15.7.2",
2925
"query-string": "^7.1.1",
3026
"react": "^18.2.0",
31-
"react-app-rewired": "^2.1.8",
3227
"react-bootstrap": "^1.6.1",
3328
"react-color-palette": "^6.1.0",
3429
"react-dayjs": "^0.3.2",
@@ -47,7 +42,8 @@
4742
"react-toastify": "^8.1.0",
4843
"rrule": "^2.7.2",
4944
"typescript": "^4.4.2",
50-
"ulid": "^2.3.0"
45+
"ulid": "^2.3.0",
46+
"vite": "^5.2.11"
5147
},
5248
"scripts": {
5349
"lint:js": "eslint --ext .js --ext .jsx ./src",
@@ -56,10 +52,9 @@
5652
"lint:scss:fix": "stylelint --fix \"./src/**/*.scss\"",
5753
"check-coding-standards": "yarn lint:js && yarn lint:scss",
5854
"apply-coding-standards": "yarn lint:js:fix && yarn lint:scss:fix",
59-
"start": "react-app-rewired start",
60-
"build": "react-app-rewired build",
61-
"test": "react-app-rewired test",
62-
"eject": "react-scripts eject"
55+
"start": "vite --host 0.0.0.0",
56+
"build": "vite build",
57+
"preview": "vite preview"
6358
},
6459
"eslintConfig": {
6560
"extends": [
@@ -80,6 +75,8 @@
8075
]
8176
},
8277
"devDependencies": {
78+
"eslint": "7.32.0",
79+
"eslint-plugin-jsdoc": "^35.4.3",
8380
"babel-eslint": "^10.1.0",
8481
"eslint-config-airbnb": "^18.2.1",
8582
"eslint-config-prettier": "8.3.0",
@@ -92,8 +89,7 @@
9289
"eslint-plugin-react-hooks": "^4.2.0",
9390
"prettier": "2.3.2",
9491
"prettier-plugin-jsdoc": "^0.3.24",
95-
"react-scripts": "4.0.3",
96-
"sass": "^1.35.2",
92+
"sass": "^1.77.2",
9793
"stylelint": "^13.13.1",
9894
"stylelint-config-prettier": "^8.0.2",
9995
"stylelint-config-recommended-scss": "^4.3.0",

public/index.html

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/app.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ import AuthHandler from "./auth-handler";
3636
import LoadingComponent from "./components/util/loading-component/loading-component";
3737
import ModalProvider from "./context/modal-context/modal-provider";
3838
import UsersList from "./components/users/users-list";
39-
import "react-toastify/dist/ReactToastify.css";
40-
import "./app.scss";
4139
import ActivationCodeList from "./components/activation-code/activation-code-list";
4240
import ActivationCodeCreate from "./components/activation-code/activation-code-create";
4341
import ActivationCodeActivate from "./components/activation-code/activation-code-activate";
4442
import ConfigLoader from "./config-loader";
43+
import "react-toastify/dist/ReactToastify.css";
44+
import "./app.scss";
4545

4646
/**
4747
* App component.

src/app.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "~bootstrap/scss/bootstrap";
1+
@import "bootstrap/scss/bootstrap";
22

33
html {
44
height: -webkit-fill-available;

src/components/media/media-list.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "~bootstrap/scss/bootstrap/";
1+
@import "../../../node_modules/bootstrap/scss/bootstrap/";
22

33
.media-item {
44
img {

0 commit comments

Comments
 (0)