@naarang/ccc 3.3.0-beta.11 → 3.3.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -525,17 +525,30 @@ for (const { name, target, outfile, ptyLib, ngrokLib, ngrokPkg } of selectedTarg
525
525
 
526
526
  // Build the binary (bun-pty and ngrok are now bundled via the generated loaders).
527
527
  //
528
- // Note: deliberately NOT using --bytecode. Bytecode compilation
529
- // freezes module resolution at build time, which breaks dynamic
530
- // `import()` of absolute file:// URLs that have their own
531
- // transitive deps (see oven-sh/bun#6893, #11732). The Pi SDK
532
- // loader does exactly this — imports the user's globally-
533
- // installed pi-coding-agent which then needs to resolve
534
- // `typebox` from its own node_modules. With --bytecode, that
535
- // resolution falls back to the binary's snapshot and fails. The
536
- // runtime startup cost of dropping --bytecode is small (~50-100ms);
537
- // worth it for the resolver flexibility.
538
- await $`bun build --compile --minify --target=${target} --define BUILD_VERSION='"${VERSION}"' src/index.ts --outfile ${outfilePath}`;
528
+ // --bytecode is disabled across all targets — Bun 1.3.13 has
529
+ // multiple regressions when combined with --compile:
530
+ // - Windows panics: "Internal assertion failure:
531
+ // total_insertions != output_files.items.len"
532
+ // (oven-sh/bun#23490)
533
+ // - Linux ARM64 binary loads but throws on first import:
534
+ // "TypeError: Expected CommonJS module to have a function
535
+ // wrapper" bytecode mangles CJS-shaped deps (some of
536
+ // pi-coding-agent's transitive deps are CJS).
537
+ // The startup speedup isn't worth shipping a broken binary on
538
+ // any platform. Re-enable per-target when Bun's bytecode +
539
+ // CJS interop stabilizes.
540
+ const buildArgs = [
541
+ 'build',
542
+ '--compile',
543
+ '--minify',
544
+ `--target=${target}`,
545
+ '--define',
546
+ `BUILD_VERSION="${VERSION}"`,
547
+ 'src/index.ts',
548
+ '--outfile',
549
+ outfilePath,
550
+ ];
551
+ await $`bun ${buildArgs}`;
539
552
  console.log(` ✓ Built ${outfile}`);
540
553
  } catch (error) {
541
554
  console.error(` ✗ Failed to build ${name}:`, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naarang/ccc",
3
- "version": "3.3.0-beta.11",
3
+ "version": "3.3.0-beta.14",
4
4
  "description": "Code Chat Connect - Control Claude Code from your mobile device",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -525,17 +525,30 @@ for (const { name, target, outfile, ptyLib, ngrokLib, ngrokPkg } of selectedTarg
525
525
 
526
526
  // Build the binary (bun-pty and ngrok are now bundled via the generated loaders).
527
527
  //
528
- // Note: deliberately NOT using --bytecode. Bytecode compilation
529
- // freezes module resolution at build time, which breaks dynamic
530
- // `import()` of absolute file:// URLs that have their own
531
- // transitive deps (see oven-sh/bun#6893, #11732). The Pi SDK
532
- // loader does exactly this — imports the user's globally-
533
- // installed pi-coding-agent which then needs to resolve
534
- // `typebox` from its own node_modules. With --bytecode, that
535
- // resolution falls back to the binary's snapshot and fails. The
536
- // runtime startup cost of dropping --bytecode is small (~50-100ms);
537
- // worth it for the resolver flexibility.
538
- await $`bun build --compile --minify --target=${target} --define BUILD_VERSION='"${VERSION}"' src/index.ts --outfile ${outfilePath}`;
528
+ // --bytecode is disabled across all targets — Bun 1.3.13 has
529
+ // multiple regressions when combined with --compile:
530
+ // - Windows panics: "Internal assertion failure:
531
+ // total_insertions != output_files.items.len"
532
+ // (oven-sh/bun#23490)
533
+ // - Linux ARM64 binary loads but throws on first import:
534
+ // "TypeError: Expected CommonJS module to have a function
535
+ // wrapper" bytecode mangles CJS-shaped deps (some of
536
+ // pi-coding-agent's transitive deps are CJS).
537
+ // The startup speedup isn't worth shipping a broken binary on
538
+ // any platform. Re-enable per-target when Bun's bytecode +
539
+ // CJS interop stabilizes.
540
+ const buildArgs = [
541
+ 'build',
542
+ '--compile',
543
+ '--minify',
544
+ `--target=${target}`,
545
+ '--define',
546
+ `BUILD_VERSION="${VERSION}"`,
547
+ 'src/index.ts',
548
+ '--outfile',
549
+ outfilePath,
550
+ ];
551
+ await $`bun ${buildArgs}`;
539
552
  console.log(` ✓ Built ${outfile}`);
540
553
  } catch (error) {
541
554
  console.error(` ✗ Failed to build ${name}:`, error);