diff --git a/.github/workflows/publish-codev.yml b/.github/workflows/publish-codev.yml index 243f8a5923..141269d661 100644 --- a/.github/workflows/publish-codev.yml +++ b/.github/workflows/publish-codev.yml @@ -1,7 +1,8 @@ name: publish-codev -# Publishes @quickbeard/codev-code (+ platform binary packages) to the private -# npm registry. Manual-only: versioning is explicit, no auto-bumps. +# Publishes codev-code (+ platform binary packages) to npm. Unscoped npm +# packages are always PUBLIC. Manual-only: versioning is explicit, no +# auto-bumps. # # Required repo secrets: # CODEV_NPM_TOKEN auth token (npm automation token for npmjs, or the @@ -46,12 +47,12 @@ jobs: exit 1 fi REGISTRY="${REGISTRY:-https://registry.npmjs.org}" - # Route the @quickbeard scope to the private registry and attach the - # auth token to that host (npmrc's //host/path:_authToken form). + # Point npm at the registry and attach the auth token to that host + # (npmrc's //host/path:_authToken form). hostpath="${REGISTRY#*://}" hostpath="${hostpath%/}" { - echo "@quickbeard:registry=${REGISTRY%/}/" + echo "registry=${REGISTRY%/}/" echo "//${hostpath}/:_authToken=${TOKEN}" } >> ~/.npmrc diff --git a/DIVERGENCES.md b/DIVERGENCES.md index d5fcec8268..d3e92d1206 100644 --- a/DIVERGENCES.md +++ b/DIVERGENCES.md @@ -15,10 +15,10 @@ future `packages/codev-*`) never conflict and are not tracked here. | `packages/opencode/src/index.ts` | `scriptName("opencode")` → `"codev"`; `show()` prefix check `"opencode "` → `"codev "` | Help/usage text shows the real user-facing command (the `codev` hub forwards unknown commands to this binary). The `show()` check must always match the scriptName. | Keep our two strings; take upstream's surrounding changes. | | `packages/opencode/package.json` | bin key `opencode` → `codev-code` (shim path `./bin/opencode` unchanged) | Installed binary is named `codev-code`. | Keep our bin key; take upstream's other fields. | | `bun.lock` | Mirrors the bin key rename above | Lockfile records workspace bin mappings. | Regenerate with `bun install`; never hand-merge. | -| `packages/opencode/script/build.ts` | Platform packages' `package.json` name scoped to `@quickbeard/codev-code-` (dist dir names unchanged — the bun compile target derives from them) | Private-registry publishing. | Keep our `name:` line; take upstream's surrounding changes. | -| `packages/opencode/script/publish.ts` | `PUBLISH_NAME = "@quickbeard/codev-code"` const; scoped-name→dir map; main pkg name + bin key; `process.exit(0)` before the Docker/AUR/Homebrew section | npm-only publishing to the private registry; upstream's other channels target anomalyco infra. | Keep our names + early exit; take upstream's npm-section changes above the exit. | -| `packages/opencode/bin/opencode` | `base` prefix `opencode-` → `@quickbeard/codev-code-` | Runtime platform-binary lookup must match the published names. | Keep our prefix. | -| `packages/opencode/script/postinstall.mjs` | `base` prefix `opencode-` → `@quickbeard/codev-code-` | Install-time platform-binary fetch must match the published names. | Keep our prefix. | +| `packages/opencode/script/build.ts` | Platform packages' `package.json` name `codev-code-` (dist dir names unchanged — the bun compile target derives from them) | npm publishing under the fork's names. | Keep our `name:` line; take upstream's surrounding changes. | +| `packages/opencode/script/publish.ts` | `PUBLISH_NAME = "codev-code"` const; published-name→dir map; main pkg name + bin key; env-guarded exit before the Docker/AUR/Homebrew section | npm-only publishing under the fork's names (unscoped, public on npmjs); upstream's other channels target anomalyco infra. | Keep our names + early exit; take upstream's npm-section changes above the exit. | +| `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-` | Install-time platform-binary fetch must match the published names. | Keep our prefix. | | `README.md` | Replaced with fork README | Fork identity, sync + divergence policy. | Keep ours entirely. | | `README.*.md` (21 translations) | Deleted | Upstream marketing translations, irrelevant to the fork. | Keep deleted (`git rm` the upstream side of modify/delete conflicts). | | `screenshot-uk.png` | Deleted | Orphaned README-translation asset; referenced by nothing. | Keep deleted. | @@ -30,10 +30,11 @@ future `packages/codev-*`) never conflict and are not tracked here. `OPENCODE_DISABLE_AUTOUPDATE=1`, so the notify/auto path is off in normal use — but a direct `codev-code upgrade` would still install stock opencode. Patch or disable the upgrade command before distributing outside the team. -- **Publishing**: npm packages go to the private registry via `.github/workflows/publish-codev.yml` - (manual dispatch; requires `CODEV_NPM_REGISTRY` + `CODEV_NPM_TOKEN` secrets and an explicit - version). Docker/AUR/Homebrew/GitHub-release channels are upstream-only and disabled. - The binary inside platform packages is still named `opencode` (cosmetic, keeps diffs small). +- **Publishing**: npm packages publish as `codev-code` / `codev-code-` — unscoped, + therefore PUBLIC on npmjs (like `codev-ai`) — via `.github/workflows/publish-codev.yml` + (manual dispatch; requires the `CODEV_NPM_TOKEN` secret and an explicit version; registry + defaults to npmjs). Docker/AUR/Homebrew/GitHub-release channels are upstream-only and + disabled. The binary inside platform packages is still named `opencode` (cosmetic). - **UI branding**: TUI logo (`UI.logo()`), desktop/web app names and assets — all still upstream-branded. Cosmetic; not worth the merge-conflict surface until the product ships beyond the team. diff --git a/packages/opencode/bin/opencode b/packages/opencode/bin/opencode index 1311a41e01..e4c0214e3e 100755 --- a/packages/opencode/bin/opencode +++ b/packages/opencode/bin/opencode @@ -70,10 +70,9 @@ let arch = archMap[os.arch()] if (!arch) { arch = os.arch() } -// Fork: platform binary packages are published under the private @quickbeard -// scope (see script/publish.ts). The scope becomes a directory segment in the -// node_modules lookups below. -const base = "@quickbeard/codev-code-" + platform + "-" + arch +// Fork: platform binary packages are published as codev-code- +// (see script/publish.ts). +const base = "codev-code-" + platform + "-" + arch const binary = platform === "windows" ? "opencode.exe" : "opencode" function supportsAvx2() { diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index ec53886b5c..8dd53ca604 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -215,10 +215,10 @@ for (const item of targets) { await Bun.file(`dist/${name}/package.json`).write( JSON.stringify( { - // Published under the private @quickbeard scope. The dist DIRECTORY - // keeps the pkg.name-derived name — the bun compile target string is - // derived from it above (name.replace(pkg.name, "bun")). - name: name.replace(pkg.name, "@quickbeard/codev-code"), + // Published as codev-code-. The dist DIRECTORY keeps the + // pkg.name-derived name — the bun compile target string is derived + // from it above (name.replace(pkg.name, "bun")). + name: name.replace(pkg.name, "codev-code"), version: Script.version, preferUnplugged: true, os: [item.os], diff --git a/packages/opencode/script/postinstall.mjs b/packages/opencode/script/postinstall.mjs index fb0f459a8f..d04b21499a 100644 --- a/packages/opencode/script/postinstall.mjs +++ b/packages/opencode/script/postinstall.mjs @@ -24,9 +24,9 @@ const archMap = { const platform = platformMap[os.platform()] ?? os.platform() const arch = archMap[os.arch()] ?? os.arch() -// Fork: platform binary packages live under the private @quickbeard scope +// Fork: platform binary packages are published as codev-code- // (must match bin/opencode and script/publish.ts). -const base = `@quickbeard/codev-code-${platform}-${arch}` +const base = `codev-code-${platform}-${arch}` const sourceBinary = platform === "windows" ? "opencode.exe" : "opencode" const targetBinary = path.join(__dirname, "bin", "opencode.exe") diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts index d27321dcb0..50d2399296 100755 --- a/packages/opencode/script/publish.ts +++ b/packages/opencode/script/publish.ts @@ -7,12 +7,11 @@ import { fileURLToPath } from "url" const dir = fileURLToPath(new URL("..", import.meta.url)) process.chdir(dir) -// Fork: published names live under the private @quickbeard scope so a single -// npmrc scope mapping (`@quickbeard:registry=`) routes install AND the -// platform-binary optionalDependencies to the private registry. dist/ -// directory names stay pkg.name-derived (build.ts derives the bun compile -// target from them); only package.json `name` fields are scoped. -const PUBLISH_NAME = "@quickbeard/codev-code" +// Fork: published as the unscoped, PUBLIC npm package `codev-code` (like +// `codev-ai` for the hub — npmjs cannot make unscoped packages private). +// dist/ directory names stay pkg.name-derived (build.ts derives the bun +// compile target from them); only package.json `name` fields differ. +const PUBLISH_NAME = "codev-code" async function published(name: string, version: string) { return (await $`npm view ${name}@${version} version`.nothrow()).exitCode === 0 @@ -27,9 +26,7 @@ async function publish(dir: string, name: string, version: string) { return } await $`bun pm pack`.cwd(dir) - // restricted: the fork is commercial — scoped packages must never land - // public on npmjs. (Self-hosted registries ignore the flag.) - await $`npm publish *.tgz --access restricted --tag ${Script.channel}`.cwd(dir) + await $`npm publish *.tgz --access public --tag ${Script.channel}`.cwd(dir) } const binaries: Record = {}