From 416fce5586c92840bb9b55ead68c8909cabc23b8 Mon Sep 17 00:00:00 2001 From: uonr Date: Sat, 21 Dec 2024 14:00:29 +0900 Subject: [PATCH] fix: versions (#679) --- apps/legacy/package.json | 3 +-- apps/legacy/src/utils/id.ts | 11 +++++++--- package-lock.json | 42 ++++++------------------------------ packages/common/package.json | 2 +- packages/utils/package.json | 3 +-- 5 files changed, 18 insertions(+), 43 deletions(-) diff --git a/apps/legacy/package.json b/apps/legacy/package.json index 3c57ca04d..cf78f240a 100644 --- a/apps/legacy/package.json +++ b/apps/legacy/package.json @@ -24,7 +24,7 @@ "reselect": "^5.1.1", "sanitize.css": "^13.0.0", "swr": "^2.2.5", - "uuid": "^10.0.0" + "uuid": "^11.0.3" }, "scripts": { "dev": "webpack-dev-server --color --output-public-path / --progress", @@ -50,7 +50,6 @@ "@types/react-redux": "^7.1.33", "@types/react-router-dom": "^5.3.3", "@types/react-transition-group": "^4.4.10", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.1.0", "@typescript-eslint/parser": "^7.1.0", "babel-loader": "^9.1.3", diff --git a/apps/legacy/src/utils/id.ts b/apps/legacy/src/utils/id.ts index 909a253fc..b9bcac7e2 100644 --- a/apps/legacy/src/utils/id.ts +++ b/apps/legacy/src/utils/id.ts @@ -1,11 +1,16 @@ import { v1 as uuidV1 } from 'uuid'; -const getNodeId = (): number[] => { +const getNodeId = (): Uint8Array => { const key = 'client-node-id'; const serializedId = localStorage.getItem(key); if (serializedId) { try { - return JSON.parse(serializedId) as number[]; + const parsed = JSON.parse(serializedId); + if (Array.isArray(parsed) && parsed.length === 6 && parsed.every((x) => typeof x === 'number')) { + return new Uint8Array(parsed); + } else { + throw new Error('Invalid node ID'); + } } catch (e) { localStorage.removeItem(key); return getNodeId(); @@ -15,7 +20,7 @@ const getNodeId = (): number[] => { window.crypto.getRandomValues(bytes); const nodeId = Array.from(bytes); localStorage.setItem(key, JSON.stringify(nodeId)); - return nodeId; + return bytes; } }; diff --git a/package-lock.json b/package-lock.json index b8dc64def..8a1352263 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "reselect": "^5.1.1", "sanitize.css": "^13.0.0", "swr": "^2.2.5", - "uuid": "^10.0.0" + "uuid": "^11.0.3" }, "devDependencies": { "@babel/core": "^7.23.7", @@ -67,7 +67,6 @@ "@types/react-redux": "^7.1.33", "@types/react-router-dom": "^5.3.3", "@types/react-transition-group": "^4.4.10", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.1.0", "@typescript-eslint/parser": "^7.1.0", "babel-loader": "^9.1.3", @@ -155,19 +154,6 @@ "webpack": "^5.89.0" } }, - "apps/site/node_modules/uuid": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.3.tgz", - "integrity": "sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/esm/bin/uuid" - } - }, "apps/spa": { "version": "0.0.0", "dependencies": { @@ -221,19 +207,6 @@ "webpack-bundle-analyzer": "^4.10.1" } }, - "apps/spa/node_modules/uuid": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.3.tgz", - "integrity": "sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/esm/bin/uuid" - } - }, "node_modules/@adobe/css-tools": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.1.tgz", @@ -25320,16 +25293,16 @@ } }, "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.3.tgz", + "integrity": "sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/v8-compile-cache-lib": { @@ -26328,7 +26301,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.51.0", - "react-intl": "^6.6.2", + "react-intl": "^7.0.4", "swr": "^2.2.5" } }, @@ -26462,13 +26435,12 @@ "license": "GPL-3.0", "dependencies": { "react": "^18.2.0", - "uuid": "^10.0.0" + "uuid": "^11.0.3" }, "devDependencies": { "@boluo/eslint-config": "*", "@boluo/typescript-config": "*", "@types/react": "^18.2.46", - "@types/uuid": "^10.0.0", "eslint": "^8.56.0", "typescript": "^5.3.3" } diff --git a/packages/common/package.json b/packages/common/package.json index 408870a27..a83a34431 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -16,7 +16,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.51.0", - "react-intl": "^6.6.2", + "react-intl": "^7.0.4", "swr": "^2.2.5" }, "devDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 6274fe01b..ed9ac980b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -13,12 +13,11 @@ "license": "GPL-3.0", "dependencies": { "react": "^18.2.0", - "uuid": "^10.0.0" + "uuid": "^11.0.3" }, "sideEffects": false, "devDependencies": { "@types/react": "^18.2.46", - "@types/uuid": "^10.0.0", "eslint": "^8.56.0", "@boluo/eslint-config": "*", "@boluo/typescript-config": "*",