Remove uuid dependency in favor of crypto.randomUUID()
The uuid package dropped its CommonJS entry point in v14, making it incompatible with Backstage's CJS build output and Jest test runner. Rather than working around the ESM-only issue, replace all usage with the built-in crypto.randomUUID() which has been available in Node.js since v16.7 and in all major browsers since March 2022. Signed-off-by: Fredrik Adelöw <freben@spotify.com> Made-with: Cursor
This commit is contained in:
@@ -77,7 +77,6 @@
|
||||
"pg-connection-string": "^2.3.0",
|
||||
"testcontainers": "^11.9.0",
|
||||
"text-extensions": "^2.4.0",
|
||||
"uuid": "^11.0.0",
|
||||
"yn": "^4.0.0",
|
||||
"zod": "^3.25.76 || ^4.0.0",
|
||||
"zod-to-json-schema": "^3.25.1"
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import Keyv, { type KeyvStoreAdapter } from 'keyv';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { randomUUID as uuid } from 'node:crypto';
|
||||
import { waitForReady } from '../util/waitForReady';
|
||||
import { Instance } from './types';
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
import { isDockerDisabledForTests } from '../util/isDockerDisabledForTests';
|
||||
import { startMemcachedContainer } from './memcache';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { randomUUID as uuid } from 'node:crypto';
|
||||
|
||||
const itIfDocker = isDockerDisabledForTests() ? it.skip : it;
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
import { isDockerDisabledForTests } from '../util/isDockerDisabledForTests';
|
||||
import { startRedisContainer } from './redis';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { randomUUID as uuid } from 'node:crypto';
|
||||
|
||||
const itIfDocker = isDockerDisabledForTests() ? it.skip : it;
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { isDockerDisabledForTests } from '../util/isDockerDisabledForTests';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { randomUUID as uuid } from 'node:crypto';
|
||||
import { startValkeyContainer } from './valkey';
|
||||
|
||||
const itIfDocker = isDockerDisabledForTests() ? it.skip : it;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { randomUUID as uuid } from 'node:crypto';
|
||||
import yn from 'yn';
|
||||
import { waitForReady } from '../util/waitForReady';
|
||||
import { Engine, LARGER_POOL_CONFIG, TestDatabaseProperties } from './types';
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import knexFactory, { Knex } from 'knex';
|
||||
import { parse as parsePgConnectionString } from 'pg-connection-string';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { randomUUID as uuid } from 'node:crypto';
|
||||
import { waitForReady } from '../util/waitForReady';
|
||||
import { Engine, LARGER_POOL_CONFIG, TestDatabaseProperties } from './types';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user