xonecas.io
70160
Ce

cel-tui / commit 6a47e37

docs(agents): add npm publishing guide

xonecas2026-04-04 6a47e37d2119381b78bbc9cd7e8588d1262537de parent a05e989

1 file changed

AGENTS.md+44−0
@@ -169,6 +169,50 @@ git checkout main
169169 - `.gitignore` does **not** exclude `docs/html/` or `docs/md/` (they're committed)
170170 - `.prettierignore` includes `docs/html` and `docs/md` (generated files fail format checks otherwise)
171171
172+## Publishing to npm
173+
174+Packages are published to the `@cel-tui` npm org (owner: `xonecas`). They ship TypeScript source directly — no build step.
175+
176+### Version bump
177+
178+All three packages share the same version. Bump all together:
179+
180+```bash
181+# In packages/types/package.json, packages/core/package.json, packages/components/package.json
182+# Update "version" to the new value
183+```
184+
185+Follow [semver](https://semver.org/): patch for fixes, minor for features, major for breaking changes. While `0.x`, minor = breaking is acceptable.
186+
187+### Publish order
188+
189+Must publish in dependency order — types first, then core, then components:
190+
191+```bash
192+cd packages/types && bun publish --access public
193+cd ../core && bun publish --access public
194+cd ../components && bun publish --access public
195+```
196+
197+If 2FA is enabled, add `--otp <code>` to each command.
198+
199+### Pre-publish checklist
200+
201+1. All tests pass: `bun test`
202+2. Types clean: `bun run typecheck`
203+3. Lint/format clean: `bun run check && bun run format`
204+4. Version bumped in all three `package.json` files
205+5. Changes committed and pushed
206+6. Dry run looks correct: `cd packages/core && bun publish --dry-run --access public`
207+
208+### How it works
209+
210+- `"files"` in each `package.json` whitelists what ships (source only, no tests)
211+- `"exports"` map provides proper module resolution for Bun and bundlers
212+- `workspace:*` dependencies are resolved to actual versions by `bun publish`
213+- `get-east-asian-width` is a real dependency of `@cel-tui/core` (installs for consumers)
214+- `typescript` is a peer dependency (consumers bring their own)
215+
172216 ## Destructive Actions
173217
174218 **Never use `git checkout` or `git restore` on files you have modified.** A single `git checkout <file>` will silently discard all uncommitted changes in that file — including unrelated work. If you need to revert a specific edit, use `edit` to undo just that change. If you must use git to undo something, `git stash` first so the work can be recovered.