Skip to content

Set up npm release: publish-on-tag workflow + package hardening - #20

Merged
saucam merged 1 commit into
mainfrom
chore/release-npm
Jun 23, 2026
Merged

Set up npm release: publish-on-tag workflow + package hardening#20
saucam merged 1 commit into
mainfrom
chore/release-npm

Conversation

@saucam

@saucam saucam commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

First half of release setup (npm). The Rust crates + binary releases for codeoid-ui are a separate PR.

What this adds

  • .github/workflows/release.yml — on a vX.Y.Z tag: build web UI → run tests → assert tag == package.json version → npm publish --provenance → GitHub Release.
  • package.json hardening for publishing:
    • binsrc/cli.ts (codeoid is Bun-native; bun runs TS directly, and the bundled dist/cli.js broke the web/dist path resolution — so we ship source).
    • files allowlist: src (minus tests) + prebuilt web/dist (minus sourcemaps) + docs/LICENSE/etc.
    • engines.bun, repository/homepage/bugs/keywords, prepublishOnly builds the web UI.
  • web/.npmignore — neutralizes the nested web/.gitignore so web/dist actually ships (validated: it was being silently stripped).
  • CHANGELOG.md (0.1.0) + RELEASING.md runbook.

To cut the release (after merge)

  1. Add an NPM_TOKEN repo secret (npm automation token with publish rights).
  2. git tag v0.1.0 && git push origin v0.1.0 → installs as bun install -g codeoid.

Validated with npm pack --dry-run: 10.5 MB unpacked, ships src + web/dist, no tests/maps. Docs-and-config only; the daemon/web checks still run.

🤖 Generated with Claude Code

- package.json hardened for publishing:
  - bin -> src/cli.ts. codeoid is Bun-native (bun runs TS directly); the
    bundled dist/cli.js broke the web/dist path resolution, so we ship source.
  - files allowlist: src (minus tests) + prebuilt web/dist (minus sourcemaps)
    + README/LICENSE/CONTRIBUTING/SECURITY + docs/architecture.png.
  - engines.bun, repository/homepage/bugs/keywords, prepublishOnly builds web.
- web/.npmignore so the nested web/.gitignore doesn't strip web/dist from the
  published tarball.
- .github/workflows/release.yml: on a v* tag, build the web UI, run tests,
  verify the tag matches package.json, npm publish --provenance, GitHub Release.
- CHANGELOG.md (0.1.0) + RELEASING.md runbook (add NPM_TOKEN, push a tag).

Validated with `npm pack --dry-run`: 10.5 MB unpacked, ships src + web/dist,
no test files or sourcemaps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@saucam
saucam merged commit 7928023 into main Jun 23, 2026
2 checks passed
@saucam
saucam deleted the chore/release-npm branch June 23, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant