From 00dd06f52f65794d84508fee381fe903829245ee Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Sat, 6 Jun 2026 01:59:09 +0000 Subject: [PATCH] fix(workspace): tighten shared package compatibility edges Add the missing core dependency on @bundle/compress, provide the zstd Deno type shim, narrow the decompress cast for TypeScript, and stop runtime detection from indexing process through an unsafe global lookup. These are small support fixes, but they answer concrete friction introduced while wiring the shared execution path across packages. Keeping them separate makes it clear that this commit is about smoothing dependency and typing boundaries rather than changing bundle behavior. --- compress/decompress.ts | 2 +- compress/deno/zstd/zstd.deno.d.ts | 2 ++ core/package.json | 1 + utils/resolve-conditions.ts | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 compress/deno/zstd/zstd.deno.d.ts diff --git a/compress/decompress.ts b/compress/decompress.ts index f1c9b6a..a8261a4 100644 --- a/compress/decompress.ts +++ b/compress/decompress.ts @@ -76,7 +76,7 @@ export async function decompress(inputs: Uint8Array[] | string[] = [], opts: Com // Compress all binary contents according to the compression map const compressedContent = await Promise.all( - contents.map((content) => compressionMap(content)) + contents.map((content) => compressionMap(content as Uint8Array)) ); // Convert sizes to human readable formats, e.g. 10000 bytes to 10MB diff --git a/compress/deno/zstd/zstd.deno.d.ts b/compress/deno/zstd/zstd.deno.d.ts new file mode 100644 index 0000000..2057d74 --- /dev/null +++ b/compress/deno/zstd/zstd.deno.d.ts @@ -0,0 +1,2 @@ +declare const Module: any; +export default Module; diff --git a/core/package.json b/core/package.json index 33b06b7..4f682db 100644 --- a/core/package.json +++ b/core/package.json @@ -35,6 +35,7 @@ "./plugins/tar": "./plugins/tar.ts" }, "dependencies": { + "@bundle/compress": "workspace:*", "@bundle/utils": "workspace:*", "@logtape/logtape": "npm:@jsr/logtape__logtape@^2", "@std/tar": "npm:@jsr/std__tar@^0", diff --git a/utils/resolve-conditions.ts b/utils/resolve-conditions.ts index 5b4e1dd..ade4265 100644 --- a/utils/resolve-conditions.ts +++ b/utils/resolve-conditions.ts @@ -199,8 +199,9 @@ export function detectRuntime(): ResolveRuntime | null { } // Check for Node.js with Electron - if (typeof globalThis?.process !== "undefined" && globalThis?.process?.versions) { - if (globalThis?.process?.versions?.electron) { + const processLike = (globalThis as unknown as { process?: any }).process; + if (typeof processLike !== "undefined" && processLike?.versions) { + if (processLike?.versions?.electron) { // Check if we're in main or renderer if (typeof window !== "undefined") { return "electron-renderer"; -- 2.51.2