diff --git a/src/main.mjs b/src/main.mjs index d0b58fa..d64e5a9 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -260,6 +260,7 @@ function version() { webcontainer: () => globalThis.process?.versions?.webcontainer, 'quickjs-ng': () => globalThis.navigator?.userAgent?.split?.('/')[1], hermes: () => globalThis.HermesInternal?.getRuntimeProperties?.()?.['OSS Release Version'], + bare: () => globalThis.Bare?.version, })[runtime()]?.() || null; } @@ -278,7 +279,7 @@ function runtime() { if (globalThis.window && globalThis.navigator && (new Error().stack).includes('runtime@')) return 'webkit'; if (globalThis.os && globalThis.std) return 'quickjs'; - if (globalThis.Bun) return 'bun'; if (globalThis.Deno) return 'deno'; if (globalThis.HermesInternal) return 'hermes'; + if (globalThis.Bun) return 'bun'; if (globalThis.Deno) return 'deno'; if (globalThis.HermesInternal) return 'hermes'; if (globalThis.Bare) return 'bare' if (globalThis.window && globalThis.navigator) return 'browser'; if (globalThis.process) return 'node'; else return null; } @@ -286,6 +287,7 @@ async function arch() { if (runtime() === 'webcontainer') return 'js + wasm'; try { let n; if (n = Deno?.build?.target) return n; } catch { } try { const os = await import('node:os'); return `${os.arch()}-${os.platform()}`; } catch { } + try { if (globalThis.Bare) return `${Bare.arch}-${Bare.platform}`; } catch { } if (globalThis.process?.arch && globalThis.process?.platform) { return `${globalThis.process.arch}-${globalThis.process.platform}`;