Merge pull request #368 from aminya/crypto-randomuuid

fix: add polyfil for crypto.randomuuid
This commit is contained in:
Amin Ya 2025-03-10 01:34:09 -07:00 committed by GitHub
commit 6eadc0b59c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 31 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -128,6 +128,7 @@
"patha": "^0.4.1",
"prettier": "3.5.3",
"prettier-config-atomic": "^4.0.0",
"randomuuid-polyfill": "^1.0.2",
"readme-md-generator": "^1.0.0",
"retry-as-promised": "^7.1.1",
"rollup": "^4.34.9",

View File

@ -214,6 +214,9 @@ importers:
prettier-config-atomic:
specifier: ^4.0.0
version: 4.0.0
randomuuid-polyfill:
specifier: ^1.0.2
version: 1.0.2
readme-md-generator:
specifier: ^1.0.0
version: 1.0.0(encoding@0.1.13)
@ -4667,6 +4670,9 @@ packages:
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
randomuuid-polyfill@1.0.2:
resolution: {integrity: sha512-UK9sGfaaMqWzMrCU74KGbOPh03Lk7l0ixA0Ms2k2ZqtKKq2NqlLd/f0wyj1bKaoBhvIveQ3XVPfkihCxRNKvJQ==}
react-is@16.13.1:
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
@ -10725,6 +10731,8 @@ snapshots:
queue-microtask@1.2.3: {}
randomuuid-polyfill@1.0.2: {}
react-is@16.13.1: {}
react-is@18.3.1: {}

View File

@ -1,4 +1,4 @@
import { warning } from "ci-log"
import { info } from "ci-log"
import { addPath } from "envosman"
import { installBrewPack } from "setup-brew"
import { rcOptions } from "../cli-options.ts"
@ -12,7 +12,7 @@ export async function trySetupLLVMBrew(version: string, _setupDir: string, _arch
try {
return await setupLLVMBrew(version, _setupDir, _arch)
} catch (err) {
warning(`Failed to install llvm via brew: ${err}`)
info(`Failed to install llvm via brew: ${err}`)
return undefined
}
}

View File

@ -0,0 +1,6 @@
// eslint-disable-next-line node/no-deprecated-api
export * from "crypto"
import * as crypto from "crypto"
export default crypto
export { randomUUID } from "randomuuid-polyfill"

3
src/utils/compat/crypto/type.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
declare module "randomuuid-polyfill" {
export function randomUUID(): string
}

View File

@ -33,6 +33,7 @@ const viteConfig = defineConfig({
"util/types": "util.types/index.js",
"timers/promises": "timers-browserify",
diagnostics_channel: "diagnostics_channel/index.js",
crypto: "./src/utils/compat/crypto/index.ts",
}
: {}),
},