Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
fix(Benchmark): use node:crypto IFO uuid package
Jake Turnera42b6b85f6c8
diff --git a/admin/app/controllers/benchmark_controller.ts b/admin/app/controllers/benchmark_controller.tsindex d2ac00c9..19c5b940 100644--- a/admin/app/controllers/benchmark_controller.ts+++ b/admin/app/controllers/benchmark_controller.ts@@ -3,8 +3,8 @@ import type { HttpContext } from '@adonisjs/core/http'import { BenchmarkService } from '#services/benchmark_service'import { runBenchmarkValidator, submitBenchmarkValidator } from '#validators/benchmark'import { RunBenchmarkJob } from '#jobs/run_benchmark_job'-import { v4 as uuidv4 } from 'uuid'import type { BenchmarkType } from '../../types/benchmark.js'+import { randomUUID } from 'node:crypto'@inject()export default class BenchmarkController {@@ -60,7 +60,7 @@ export default class BenchmarkController {}// Generate benchmark ID and dispatch job (async)- const benchmarkId = uuidv4()+ const benchmarkId = randomUUID()const { job, created } = await RunBenchmarkJob.dispatch({benchmark_id: benchmarkId,benchmark_type: benchmarkType,@@ -89,7 +89,7 @@ export default class BenchmarkController {})}- const benchmarkId = uuidv4()+ const benchmarkId = randomUUID()await RunBenchmarkJob.dispatch({benchmark_id: benchmarkId,benchmark_type: 'system',@@ -115,7 +115,7 @@ export default class BenchmarkController {})}- const benchmarkId = uuidv4()+ const benchmarkId = randomUUID()await RunBenchmarkJob.dispatch({benchmark_id: benchmarkId,benchmark_type: 'ai',diff --git a/admin/app/services/benchmark_service.ts b/admin/app/services/benchmark_service.tsindex f14e7fed..1be1fb8c 100644--- a/admin/app/services/benchmark_service.ts+++ b/admin/app/services/benchmark_service.ts@@ -3,7 +3,6 @@ import logger from '@adonisjs/core/services/logger'import transmit from '@adonisjs/transmit/services/main'import Docker from 'dockerode'import si from 'systeminformation'-import { v4 as uuidv4 } from 'uuid'import axios from 'axios'import { DateTime } from 'luxon'import BenchmarkResult from '#models/benchmark_result'@@ -24,6 +23,7 @@ import type {RepositorySubmitResponse,RepositoryStats,} from '../../types/benchmark.js'+import { randomUUID } from 'node:crypto'// Re-export default weights for use in serviceconst SCORE_WEIGHTS = {@@ -255,7 +255,7 @@ export class BenchmarkService {throw new Error('A benchmark is already running')}- this.currentBenchmarkId = uuidv4()+ this.currentBenchmarkId = randomUUID()this._updateStatus('starting', 'Starting benchmark...')try {diff --git a/admin/package-lock.json b/admin/package-lock.jsonindex 4e078669..b8b6e234 100644--- a/admin/package-lock.json+++ b/admin/package-lock.json@@ -55,7 +55,6 @@"tar": "^7.5.6","url-join": "^5.0.0","usehooks-ts": "^3.1.1",- "uuid": "^13.0.0","yaml": "^2.8.0"},"devDependencies": {@@ -73,7 +72,6 @@"@types/node": "^22.15.18","@types/react": "^19.1.8","@types/react-dom": "^19.1.6",- "@types/uuid": "^10.0.0","eslint": "^9.26.0","hot-hook": "^0.4.0","prettier": "^3.5.3",@@ -4306,13 +4304,6 @@"@types/geojson": "*"}},- "node_modules/@types/uuid": {- "version": "10.0.0",- "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",- "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",- "dev": true,- "license": "MIT"- },"node_modules/@types/validator": {"version": "13.15.2","resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.2.tgz",@@ -12003,19 +11994,6 @@"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==","license": "MIT"},- "node_modules/uuid": {- "version": "13.0.0",- "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz",- "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==",- "funding": [- "https://github.com/sponsors/broofa",- "https://github.com/sponsors/ctavan"- ],- "license": "MIT",- "bin": {- "uuid": "dist-node/bin/uuid"- }- },"node_modules/v8-compile-cache-lib": {"version": "3.0.1","resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",diff --git a/admin/package.json b/admin/package.jsonindex 98097318..b09fe6b2 100644--- a/admin/package.json+++ b/admin/package.json@@ -50,7 +50,6 @@"@types/node": "^22.15.18","@types/react": "^19.1.8","@types/react-dom": "^19.1.6",- "@types/uuid": "^10.0.0","eslint": "^9.26.0","hot-hook": "^0.4.0","prettier": "^3.5.3",@@ -105,7 +104,6 @@"tar": "^7.5.6","url-join": "^5.0.0","usehooks-ts": "^3.1.1",- "uuid": "^13.0.0","yaml": "^2.8.0"},"hotHook": {