Skip to content

Commit

Permalink
Merge pull request #1236 from ral-facilities/remove-uuid-package-#1235
Browse files Browse the repository at this point in the history
Remove uuid package that is no longer used #1235
  • Loading branch information
joelvdavies authored Jan 9, 2025
2 parents a87d28d + 13d8d36 commit 637ac22
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@types/node": "^22.0.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^10.0.0",
"@uppy/aws-s3": "^4.1.0",
"@uppy/core": "^4.2.2",
"@uppy/dashboard": "^4.1.0",
Expand Down Expand Up @@ -45,7 +44,6 @@
"react-router-dom": "^6.23.1",
"single-spa-react": "6.0.2",
"typescript": "^5.4.5",
"uuid": "^11.0.0",
"vite": "^5.2.12",
"vite-plugin-css-injected-by-js": "^3.5.2",
"zod": "^3.23.8"
Expand Down
28 changes: 0 additions & 28 deletions src/testUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,34 +178,6 @@ export const getItemsBySystemId = (systemId: string): Item[] => {
return ItemsJSON.filter((item) => item.system_id === systemId);
};

/* This counter and the function below it are used for forcing UUID's to be deterministic */
let globalUUIDCounter = 0;
const generateUUIDBytes = (): Uint8Array => {
const byteArray = new Uint8Array(16);
for (let i = 0; i < byteArray.length; i++) {
byteArray[i] = (globalUUIDCounter + i) % 256; // Ensuring the value stays within byte range
}
globalUUIDCounter++;
return byteArray;
};

/* Mock uuid's generated for snapshot tests to ensure they are deterministic rather than random */
export const mockUUIDv4 = () => {
globalUUIDCounter = 0;
vi.mock('uuid', async () => {
const uuid = await vi.importActual('uuid');
return {
...uuid,
v4: vi.fn(() =>
// @ts-expect-error Unknown as don't want to import here
uuid.v4({
random: generateUUIDBytes(),
})
),
};
});
};

export const CREATED_MODIFIED_TIME_VALUES = {
created_time: '2024-01-01T12:00:00.000+00:00',
modified_time: '2024-01-02T13:10:10.000+00:00',
Expand Down
18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1823,13 +1823,6 @@ __metadata:
languageName: node
linkType: hard

"@types/uuid@npm:^10.0.0":
version: 10.0.0
resolution: "@types/uuid@npm:10.0.0"
checksum: 10c0/9a1404bf287164481cb9b97f6bb638f78f955be57c40c6513b7655160beb29df6f84c915aaf4089a1559c216557dc4d2f79b48d978742d3ae10b937420ddac60
languageName: node
linkType: hard

"@types/yauzl@npm:^2.9.1":
version: 2.10.3
resolution: "@types/yauzl@npm:2.10.3"
Expand Down Expand Up @@ -5193,7 +5186,6 @@ __metadata:
"@types/react": "npm:^18.3.3"
"@types/react-dom": "npm:^18.3.0"
"@types/react-router-dom": "npm:5.3.3"
"@types/uuid": "npm:^10.0.0"
"@uppy/aws-s3": "npm:^4.1.0"
"@uppy/core": "npm:^4.2.2"
"@uppy/dashboard": "npm:^4.1.0"
Expand Down Expand Up @@ -5241,7 +5233,6 @@ __metadata:
start-server-and-test: "npm:2.0.9"
typescript: "npm:^5.4.5"
typescript-eslint: "npm:8.19.0"
uuid: "npm:^11.0.0"
vite: "npm:^5.2.12"
vite-plugin-css-injected-by-js: "npm:^3.5.2"
vitest: "npm:2.1.8"
Expand Down Expand Up @@ -8628,15 +8619,6 @@ __metadata:
languageName: node
linkType: hard

"uuid@npm:^11.0.0":
version: 11.0.3
resolution: "uuid@npm:11.0.3"
bin:
uuid: dist/esm/bin/uuid
checksum: 10c0/cee762fc76d949a2ff9205770334699e0043d52bb766472593a25f150077c9deed821230251ea3d6ab3943a5ea137d2826678797f1d5f6754c7ce5ce27e9f7a6
languageName: node
linkType: hard

"uuid@npm:^8.3.2":
version: 8.3.2
resolution: "uuid@npm:8.3.2"
Expand Down

0 comments on commit 637ac22

Please sign in to comment.