diff --git a/CHANGELOG.md b/CHANGELOG.md index 015b1fd605..a98f19dbea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ file is the human-readable summary of what changed and why. ## Unreleased +### Install + +- **Installing downloads about half as much** — the published platform packages + carried a redundant copy of themselves: a second, nested copy of the same + tarball, packed in by accident whenever a release was retried. Removing it + takes each platform package from ~112MB back to ~55MB. + ### Desktop / Web UI - **Adding a folder to a sandbox no longer freezes the app** — mounting a new diff --git a/DIVERGENCES.md b/DIVERGENCES.md index f6e50021d8..da3628e41b 100644 --- a/DIVERGENCES.md +++ b/DIVERGENCES.md @@ -107,7 +107,7 @@ from the squash message first, or use a plain merge. | `packages/tui/src/clipboard.ts`, `packages/tui/src/component/prompt/index.tsx` | `read()`'s `win32`/WSL branch reads the text clipboard with `powershell.exe … [Console]::Out.Write([string](Get-Clipboard -Raw))` (UTF-8 `OutputEncoding`) right after the existing image probe, instead of falling through to `clipboardy`. | `clipboardy`'s Windows backend is the only one with no PATH-resolved fallback — it spawns `../fallbacks/windows/clipboard_x86_64.exe`, resolved from `import.meta.url`. Inside our compiled single-file binary that resolves under the bunfs root (`B:/~BUN/root/`) and the `.exe` is not embedded (verified: `codev-code-windows-x64@1.18.4-6` ships only `bin/codev.exe`), so every text read failed with ENOENT and was swallowed by the `.catch`. `clipboard.read()` returning `undefined` silently broke ctrl+v in the main prompt (`prompt.paste`), in dialog prompts (`dialog.prompt.paste`, see the row above), and in the empty-bracketed-paste fallback. Copy was unaffected (`copyCommand` already shells out to PowerShell), as was image paste. `Console.Out.Write` bypasses PowerShell's formatting pipeline so no trailing newline is appended. Paired with a `packages/tui/src/component/prompt/index.tsx` change: the `prompt.paste` command now toasts when the clipboard read yields nothing, instead of returning silently — that silence is why a completely dead paste path went unreported for so long. | Keep the PowerShell text read as long as we ship a compiled binary. If upstream drops `clipboardy` or vendors the Windows helper next to the executable, prefer theirs and drop this row. | | `packages/tui/src/terminal-win32.ts`, `packages/opencode/src/cli/cmd/debug/index.ts` | terminal-win32.ts: added a `win32ConsoleMode()` export returning the console input mode read through the guard's own kernel32 handle (undefined under the same conditions that stop `win32InstallCtrlCGuard` installing). debug/index.ts: registered the fork-only `ConsoleCommand` (`codev debug console`, `packages/opencode/src/cli/cmd/debug/console.ts`). | Windows users whose console keeps ENABLE_PROCESSED_INPUT set get ctrl+c as a console break rather than a keypress, which strands the cmd.exe shims in a hub launch chain at "Terminate batch job (Y/N)?" and looks like a frozen terminal. `codev debug console` reads the mode, installs the real guard, re-reads to prove the bit actually clears, then unhooks and re-reads — so an affected machine reports itself instead of needing a maintainer to bisect it. `codevhub doctor` relays the JSON form as its `console-ctrl-c` check. | Keep the `win32ConsoleMode` export and the one-line command registration; take upstream's surrounding changes. Both collapse to nothing if upstream ever ships its own console diagnostic. | | `packages/opencode/script/build.ts` | Platform packages' `package.json` name `codev-code-` (dist dir names unchanged — the bun compile target derives from them); compiled binary emitted as `bin/codev` (was `bin/opencode`; smoke-test path follows) | npm publishing under the fork's names; the binary inside platform packages carries the fork's name (postinstall.mjs copies it into the `codev` bin shim). The `Script.release` upload block stays upstream-shaped and unused — the fork's `.github/workflows/release.yml` packages and uploads GitHub-release artifacts itself. | Keep our `name:` line and `bin/codev` paths; take upstream's surrounding changes. | -| `packages/opencode/script/publish.ts` | `PUBLISH_NAME = "codev-code"` const; published-name→dir map; main pkg name + bin `codev` → `./bin/codev.exe` (postinstall stub file renamed from `${pkg.name}.exe`, matching the renamed platform binary); embedded README; no `repository` field in the generated package.json (npm renders it as the Repository link and derives a `#readme` Homepage from it — both kept off the npm page); env-guarded exit before the Docker/AUR/Homebrew section; `npm publish` retried up to 5 times with linear backoff, treating a version that turns up on the registry after a failed attempt as published; the dist manifest scan skips the generated main package directory | npm-only publishing under the fork's names (unscoped, public on npmjs); the installed command is `codev`; upstream's other channels target anomalyco infra; the npm page should not link the fork's GitHub repo. Releases run from a laptop rather than CI, where the 13 concurrent 40-60MB uploads regularly time one package out (`npm error FETCH_ERROR`) and abort the release mid-way; resuming such a release must not make the main package depend on itself. | Keep our names, description, bin mapping, omitted `repository`, retry loop + early exit; take upstream's npm-section changes above the exit. If upstream adds its own publish retry, drop ours for theirs. | +| `packages/opencode/script/publish.ts` | `PUBLISH_NAME = "codev-code"` const; published-name→dir map; main pkg name + bin `codev` → `./bin/codev.exe` (postinstall stub file renamed from `${pkg.name}.exe`, matching the renamed platform binary); embedded README; no `repository` field in the generated package.json (npm renders it as the Repository link and derives a `#readme` Homepage from it — both kept off the npm page); env-guarded exit before the Docker/AUR/Homebrew section; `npm publish` retried up to 5 times with linear backoff, treating a version that turns up on the registry after a failed attempt as published; stale `*.tgz` deleted before `bun pm pack`; the dist manifest scan skips the generated main package directory | npm-only publishing under the fork's names (unscoped, public on npmjs); the installed command is `codev`; upstream's other channels target anomalyco infra; the npm page should not link the fork's GitHub repo. Releases run from a laptop rather than CI, where the 13 concurrent 40-60MB uploads regularly time one package out (`npm error FETCH_ERROR`) and abort the release mid-way; resuming such a release must not make the main package depend on itself. `bun pm pack` writes the tarball into the directory it packs, so the retry path it enables would otherwise bundle the previous run's tarball into the next one, doubling every package (~55MB → ~112MB) and making the timeouts far worse. | Keep our names, description, bin mapping, omitted `repository`, retry loop + early exit; take upstream's npm-section changes above the exit. If upstream adds its own publish retry, drop ours for theirs. | | `packages/opencode/bin/opencode` | `base` prefix `opencode-` → `codev-code-` | Runtime platform-binary lookup must match the published names. | Keep our prefix. | | `packages/opencode/script/postinstall.mjs` | `base` prefix `opencode-` → `codev-code-`; source/target binary names `opencode`/`opencode.exe` → `codev`/`codev.exe` (matches build.ts's `bin/codev` and publish.ts's `bin/codev.exe` stub); temp-dir prefix and failure message rebranded | Install-time platform-binary fetch must match the published package and binary names. | Keep our prefix and binary names. | | `packages/tui/src/logo.ts` | Pixel glyphs "open"+"code" → "co"+"dev"; added a `brand` export (`navy` `#19224c` / `red` `#ee0033`, the landing page's `--color-brand-navy`/`--color-brand-red`), a `wordmarkHalves` export (each row's "co" and "dev" halves with the shadow marks substituted to glyphs, so each half can take its own brand color), the composed `wordmark` (plain lines, built from `wordmarkHalves`) and `ansiWordmark` (bold, no shadow: "co" in the terminal's default foreground, "dev" in brand red truecolor) exports for CLI banners; added a `badge` export (the "c" of the wordmark — `logo.left` rows 1-3 sliced to the first glyph, with the `_` shadow-fill marks stripped to spaces so it renders as a flat outline) for the `--mini` splashes | Branded wordmark art; `ansiWordmark` feeds the CLI help banner and session epilogue. | Keep our glyphs + exports; take upstream's surrounding changes. | diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts index 15f262bc1d..48f073e94c 100755 --- a/packages/opencode/script/publish.ts +++ b/packages/opencode/script/publish.ts @@ -30,6 +30,9 @@ async function publish(dir: string, name: string, version: string) { console.log(`already published ${name}@${version}`) return } + // `bun pm pack` writes into dir, so a tarball left by an earlier run (a + // `release --skip-build` retry) would pack into this one and double its size. + for (const stale of new Bun.Glob("*.tgz").scanSync({ cwd: dir })) await Bun.file(`${dir}/${stale}`).delete() await $`bun pm pack`.cwd(dir) for (let attempt = 1; attempt <= ATTEMPTS; attempt++) { if ((await $`npm publish *.tgz --access public --tag ${Script.channel}`.cwd(dir).nothrow()).exitCode === 0) return