Skip to content

Commit d674c1c

Browse files
committed
upgrade dependencies
1 parent a39803f commit d674c1c

11 files changed

Lines changed: 3396 additions & 5700 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"dockerfile": "../Dockerfile"
1010
},
1111
// Features to add to the dev container. More info: https://containers.dev/features.
12-
// "features": {},
12+
"features": {
13+
"ghcr.io/devcontainers/features/git:1": {}
14+
},
1315
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1416
"forwardPorts": [3000],
1517
// // Uncomment the next line to run commands after the container is created.
@@ -22,5 +24,6 @@
2224
],
2325
// make the workspace folder the same inside and outside of the container
2426
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
25-
"workspaceFolder": "${localWorkspaceFolder}"
27+
"workspaceFolder": "${localWorkspaceFolder}",
28+
"overrideCommand": true
2629
}

package-lock.json

Lines changed: 3351 additions & 5642 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,42 @@
1616
"dependencies": {
1717
"@emotion/react": "^11.14.0",
1818
"@emotion/styled": "^11.14.0",
19-
"@eslint/compat": "^1.3.0",
20-
"@h5web/lib": "^14.0.1",
21-
"@jsonforms/core": "~3.6.0",
22-
"@jsonforms/material-renderers": "~3.6.0",
23-
"@jsonforms/react": "~3.6.0",
24-
"@mui/icons-material": "^5.17.1",
25-
"@mui/material": "^5.17.1",
26-
"@mui/system": "^5.15.9",
27-
"@mui/x-data-grid": "^5.17.4",
28-
"@mui/x-date-pickers": "^7.29.4",
19+
"@h5web/lib": "^17.0.0",
20+
"@jsonforms/core": "~3.8.0",
21+
"@jsonforms/material-renderers": "~3.8.0",
22+
"@jsonforms/react": "~3.8.0",
23+
"@mui/icons-material": "^7.0.0",
24+
"@mui/material": "^7.0.0",
25+
"@mui/x-data-grid": "^8.0.0",
26+
"@mui/x-date-pickers": "^8.0.0",
2927
"@react-three/fiber": "^8.16.2",
30-
"mathjs": "^12.1.0",
28+
"mathjs": "^15.0.0",
3129
"react": "18.3.1",
3230
"react-color": "^2.19.3",
3331
"react-dom": "18.3.1",
34-
"react-error-boundary": "^5.0.0",
35-
"three": "^0.158.0",
36-
"zustand": "^4.4.6"
32+
"react-error-boundary": "^6.0.0",
33+
"three": "~0.182.0",
34+
"zustand": "^5.0.0"
3735
},
3836
"devDependencies": {
39-
"@eslint/css": "^0.9.0",
40-
"@eslint/js": "^9.29.0",
37+
"@eslint/js": "^10.0.1",
38+
"@types/react": "^18.0.0",
4139
"@types/react-color": "^3.0.10",
42-
"@types/react-dom": "^19.1.6",
43-
"@types/three": "^0.155.1",
40+
"@types/react-dom": "^18.3.1",
41+
"@types/three": "~0.182.0",
4442
"@typescript-eslint/eslint-plugin": "^8.34.1",
4543
"@typescript-eslint/parser": "^8.34.1",
46-
"@vitejs/plugin-react-swc": "^3.4.1",
47-
"eslint": "^9.29.0",
44+
"@vitejs/plugin-react": "^6.0.2",
45+
"eslint": "^10.5.0",
4846
"eslint-config-prettier": "^10.1.5",
49-
"eslint-plugin-react": "^7.37.5",
50-
"eslint-plugin-react-hooks": "^5.2.0",
51-
"eslint-plugin-react-refresh": "^0.4.3",
52-
"globals": "^16.2.0",
47+
"eslint-plugin-react-hooks": "^7.1.1",
48+
"eslint-plugin-react-refresh": "^0.5.3",
49+
"globals": "^17.6.0",
50+
"jiti": "^2.7.0",
5351
"prettier": "^3.5.3",
54-
"typescript": "^5.8.3",
52+
"typescript": "^6.0.0",
5553
"typescript-eslint": "^8.34.0",
56-
"vite": "^6.3.5",
57-
"vitest": "^3.0.5"
54+
"vite": "^8.0.16",
55+
"vitest": "^4.1.9"
5856
}
5957
}

src/calculations/unitVector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export class UnitVector {
3131
*/
3232
multiply(other: UnitVector | Vector3 | Vector2): UnitVector {
3333
const newx = multiply(this.x, other.x);
34-
if (typeof newx === "number" || !("units" in newx)) {
34+
if (typeof newx !== "object" || newx === null || !("units" in newx)) {
3535
throw TypeError("Units of unit vector may be incorrect");
3636
}
3737
this.x = newx;
3838

3939
const newy = multiply(this.y, other.y);
40-
if (typeof newy === "number" || !("units" in newy)) {
40+
if (typeof newy !== "object" || newy === null || !("units" in newy)) {
4141
throw TypeError("");
4242
}
4343
this.y = newy;

src/dialogs/beamline/appConfigTable.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ export default function AppConfigTable(): React.JSX.Element {
121121
rows={displayArray}
122122
getRowId={(row: AppConfigTableRow) => row.name}
123123
columns={columns}
124-
components={{ Toolbar: GridToolbar }}
125-
rowsPerPageOptions={[5, 10, 20, 100]}
124+
slots={{ toolbar: GridToolbar }}
125+
pageSizeOptions={[5, 10, 20, 100]}
126126
sx={{ border: 0 }}
127-
disableSelectionOnClick
128127
/>
129128
);
130129
}

src/dialogs/detector/detectorTable.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ export default function DetectorTable() {
109109
rows={displayArray}
110110
getRowId={(row: DetectorTableRow) => row.name}
111111
columns={columns}
112-
components={{ Toolbar: GridToolbar }}
113-
rowsPerPageOptions={[5, 10, 20, 100]}
112+
slots={{ toolbar: GridToolbar }}
113+
pageSizeOptions={[5, 10, 20, 100]}
114114
sx={{ border: 0 }}
115-
disableSelectionOnClick
116115
/>
117116
);
118117
}

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "./index.css";
55
import { ErrorBoundary } from "react-error-boundary";
66
import AppErrorFallBack from "./utils/errorComponents.tsx";
77

8-
function logError(error: Error, info: React.ErrorInfo) {
8+
function logError(error: unknown, info: React.ErrorInfo) {
99
console.error("[ErrorBoundary] Uncaught error:", error);
1010
console.error("[ErrorBoundary] Component stack:", info.componentStack);
1111
}

src/plot/centrePlot.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from "@h5web/lib";
1010
import { Card, CardContent, Stack } from "@mui/material";
1111
import Box from "@mui/material/Box";
12-
import { Unit, createUnit, unit } from "mathjs";
12+
import { type Unit, createUnit, unit } from "mathjs";
1313
import { Vector3 } from "three";
1414
import { computeQrange } from "../calculations/qrange";
1515
import { getPointForQ } from "../calculations/qvalue";
@@ -430,18 +430,6 @@ export default function CentrePlot(): React.JSX.Element {
430430
}
431431

432432
function updatePixelUnits(detector: AppDetector): void {
433-
/* eslint-disable */
434-
// @ts-ignore
435-
if (Unit.UNITS.xpixel) {
436-
// @ts-ignore
437-
delete Unit.UNITS.xpixel;
438-
}
439-
// @ts-ignore
440-
if (Unit.UNITS.ypixel) {
441-
// @ts-ignore
442-
delete Unit.UNITS.ypixel;
443-
}
444-
createUnit("xpixel", detector.pixelSize.width.toString());
445-
createUnit("ypixel", detector.pixelSize.height.toString());
446-
/* eslint-enable */
433+
createUnit("xpixel", detector.pixelSize.width.toString(), { override: true });
434+
createUnit("ypixel", detector.pixelSize.height.toString(), { override: true });
447435
}

src/plot/plotter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function getScaleFactor(
292292
2 * Math.PI,
293293
mathjs.multiply(cameraLength, wavelength.to(LengthUnits.metre)),
294294
);
295-
if (typeof scaleFactor === "number" || !("units" in scaleFactor)) {
295+
if (typeof scaleFactor !== "object" || scaleFactor === null || !("units" in scaleFactor)) {
296296
throw new TypeError("scaleFactor should be a Unit not a number");
297297
}
298298
return scaleFactor;

src/results/scatteringQuantities.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ export enum ScatteringOptions {
99

1010
export const convertFromQToS = (quantity: Unit): Unit => {
1111
const result = multiply(quantity, 2 * Math.PI);
12-
if (typeof result == "number" || !("units" in result)) {
12+
if (typeof result !== "object" || result === null || !("units" in result)) {
1313
throw TypeError("name this error later ");
1414
}
1515
return result;
1616
};
1717

1818
export const convertFromSToQ = (quantity: Unit): Unit => {
1919
const result = divide(quantity, 2 * Math.PI);
20-
if (typeof result == "number" || !("units" in result)) {
20+
if (typeof result !== "object" || result === null || !("units" in result)) {
2121
throw TypeError("name this error later ");
2222
}
2323
return result;
2424
};
2525

2626
export const convertFromQtoD = (quantity: Unit): Unit => {
2727
const result = divide(2 * Math.PI, quantity);
28-
if (typeof result == "number" || !("units" in result)) {
28+
if (typeof result !== "object" || result === null || !("units" in result)) {
2929
throw TypeError("name this error later ");
3030
}
3131
return result;

0 commit comments

Comments
 (0)