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

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 safe again on Linux/macOS — it previously broke
529
+ // the Pi SDK loader (oven-sh/bun#6893, #11732) but the loader
530
+ // now uses static imports of a bundled Pi so resolution happens
531
+ // at build time. Bytecode caching => faster startup.
532
+ //
533
+ // On Windows, --bytecode + --compile triggers a Bun internal
534
+ // panic ("Internal assertion failure: total_insertions ... !=
535
+ // output_files.items.len ..."). Tracked in oven-sh/bun#23490
536
+ // and elsewhere; intermittently reintroduced across Bun
537
+ // releases. Skip --bytecode on Windows to keep the build green.
538
+ const useBytecode = !target.startsWith('bun-windows');
539
+ const buildArgs = [
540
+ 'build',
541
+ '--compile',
542
+ '--minify',
543
+ ...(useBytecode ? ['--bytecode'] : []),
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.13",
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 safe again on Linux/macOS — it previously broke
529
+ // the Pi SDK loader (oven-sh/bun#6893, #11732) but the loader
530
+ // now uses static imports of a bundled Pi so resolution happens
531
+ // at build time. Bytecode caching => faster startup.
532
+ //
533
+ // On Windows, --bytecode + --compile triggers a Bun internal
534
+ // panic ("Internal assertion failure: total_insertions ... !=
535
+ // output_files.items.len ..."). Tracked in oven-sh/bun#23490
536
+ // and elsewhere; intermittently reintroduced across Bun
537
+ // releases. Skip --bytecode on Windows to keep the build green.
538
+ const useBytecode = !target.startsWith('bun-windows');
539
+ const buildArgs = [
540
+ 'build',
541
+ '--compile',
542
+ '--minify',
543
+ ...(useBytecode ? ['--bytecode'] : []),
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);