Skip to content

Commit dec9e34

Browse files
committed
Replace CRA with Vite
1 parent 9448e4e commit dec9e34

Some content is hidden

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

53 files changed

+3488
-10283
lines changed

.github/workflows/ui.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
32
# yamllint disable rule:line-length
43

54
name: UI
65

7-
"on":
6+
on:
87
pull_request: null
98
push: null
109

@@ -130,8 +129,6 @@ jobs:
130129

131130
- name: Build UI
132131
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui build"
133-
env:
134-
DISABLE_ESLINT_PLUGIN: true
135132

136133
- name: Start MXCuBE-Web server
137134
run: |

docs/source/dev/environment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ _The output should look something like the following:_
162162
The front end development server, webpack development server,
163163
listens for changes on the filesystem and builds (re-builds) the UI when a change is made.
164164
This makes it very easy and fast to see how a change affects the UI and makes debugging much easier.
165-
The development server listens on port **3000**
165+
The development server listens on port **5173**
166166

167167
```
168168
# The front-end needs the backend to run,
@@ -175,7 +175,7 @@ mxcubeweb-server -r $(pwd)/mxcubeweb/test/HardwareObjectsMockup.xml/ --static-fo
175175
pnpm --prefix ui run start
176176
```
177177

178-
The above will automatically open a browser with the URL: <http://localhost:3000>
178+
The above will automatically open a browser with the URL: <http://localhost:5173>
179179

180180
#### 9.3. Running the end to end (e2e) tests
181181

test/HardwareObjectsMockup.xml/mxcube-web/server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ server:
99

1010
ALLOWED_CORS_ORIGINS:
1111
- "http://localhost:8081"
12-
- "http://localhost:3000"
12+
- "http://localhost:5173"
1313
- "ws://localhost:8000"
1414

1515
mxcube:
File renamed without changes.

ui/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/cypress/debug/
77

88
# production
9-
/build/
9+
/dist/
1010

1111
# environment
1212
/.env.local

ui/cypress.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { defineConfig } = require('cypress');
1+
import { defineConfig } from 'cypress';
22

3-
module.exports = defineConfig({
3+
export default defineConfig({
44
e2e: {
55
baseUrl: 'http://127.0.0.1:8081',
66
supportFile: 'cypress/support.js',

ui/public/index.html renamed to ui/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/mxcube_logo20.png" />
65
<meta name="viewport" content="width=device-width, initial-scale=1" />
76
<meta name="theme-color" content="#000000" />
7+
8+
<title>MXCuBE</title>
89
<meta
910
name="description"
10-
content=" MXCuBE Web : Macromolecular Xtallography Customized Beamline Environment
11-
Is latest version of the data acquisition software started in 2005 at ESRF."
11+
content="MXCuBE-Web, the Macromolecular Xtallography Customized Beamline Environment, is a data acquisition software started in 2005 at the ESRF."
1212
/>
13-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/mxcube_logo20.png" />
14-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
15-
<title>MXCuBE</title>
13+
14+
<link rel="icon" href="/mxcube_logo20.png" />
15+
<link rel="apple-touch-icon" href="/mxcube_logo20.png" />
16+
<link rel="manifest" href="/manifest.json" />
1617
</head>
1718
<body>
1819
<noscript>You need to enable JavaScript to run this app.</noscript>
1920
<div id="root"></div>
21+
<script type="module" src="/src/index.jsx"></script>
2022
</body>
2123
</html>

ui/less-watcher.config.json

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

ui/package.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"name": "ui",
33
"version": "0.1.0",
44
"private": true,
5+
"type": "module",
56
"engines": {
67
"node": "18.x || 20.x",
78
"pnpm": "9.x"
89
},
910
"scripts": {
10-
"start": "GENERATE_SOURCEMAP=false react-scripts start",
11-
"build": "react-scripts build",
12-
"test": "react-scripts test",
11+
"start": "vite",
12+
"build": "vite build",
13+
"preview": "vite preview",
1314
"format": "pnpm prettier --write",
1415
"fix": "pnpm eslint --fix",
1516
"prettier": "prettier . --cache --check",
@@ -50,7 +51,6 @@
5051
"react-zoom-pan-pinch": "3.3.0",
5152
"redux": "4.1.2",
5253
"redux-form": "^8.3.8",
53-
"redux-logger": "^3.0.6",
5454
"redux-thunk": "^2.4.1",
5555
"slick-carousel": "^1.8.1",
5656
"socket.io-client": "^4.6.1",
@@ -61,21 +61,19 @@
6161
"@testing-library/jest-dom": "^5.16.2",
6262
"@testing-library/react": "^12.1.2",
6363
"@testing-library/user-event": "^13.5.0",
64-
"babel-preset-react-app": "10.0.1",
64+
"@vitejs/plugin-react-swc": "3.7.0",
6565
"cypress": "13.12.0",
6666
"eslint": "8.42.0",
6767
"eslint-config-galex": "4.5.2",
6868
"eslint-plugin-import": "2.27.5",
6969
"eslint-plugin-jest": "27.2.1",
7070
"eslint-plugin-jsx-a11y": "6.7.1",
7171
"eslint-plugin-react": "7.32.2",
72-
"http-proxy-middleware": "^2.0.2",
7372
"prettier": "3.0.0",
7473
"prop-types": "15.8.1",
75-
"react-scripts": "5.0.0",
76-
"wait-on": "7.0.1",
77-
"webpack": "^5.69.1",
78-
"webpack-dev-server": "^4.8.0"
74+
"vite": "5.4.0",
75+
"vite-plugin-eslint": "1.8.1",
76+
"wait-on": "7.0.1"
7977
},
8078
"browserslist": {
8179
"production": [
@@ -93,8 +91,7 @@
9391
"peerDependencyRules": {
9492
"allowedVersions": {
9593
"@phenomnomnominal/tsquery>typescript": "5.x",
96-
"eslint-plugin-etc>typescript": "5.x",
97-
"react-scripts>typescript": "5.x"
94+
"eslint-plugin-etc>typescript": "5.x"
9895
}
9996
}
10097
}

0 commit comments

Comments
 (0)