Publishing to JSR
@buntime/shared is the only package in the Buntime monorepo published on jsr.io — consumed by external plugins via bunx jsr add. Publishing is exclusively done via GitHub Actions with OIDC. Never run manually from the CLI.
For details on the package contents (exports, helpers, errors, logger), see @buntime/shared. For the general project release flow (chart, runtime, CLI), see Release flow.
Why JSR instead of npm
Section titled “Why JSR instead of npm”The other monorepo packages (@buntime/keyval, @buntime/plugin-*) are private and consumed via workspace:* only within the mono. External plugins that run on the runtime need the types and utilities from @buntime/shared (PluginImpl, PluginContext, logger, errors, string/size/duration helpers). JSR was chosen for:
- Native TypeScript support (no build step)
- OIDC authentication via GitHub Actions (no long-lived tokens)
- Resolution via
bunx jsr add @buntime/shared
- Update
packages/shared/jsr.jsonandpackages/shared/package.json(versions in sync) - Update the package release notes if there are API changes
- Commit and push to
main - Trigger the
JSR Publishworkflow viaworkflow_dispatch - In each external consumer plugin:
bunx jsr add @buntime/shared
Trigger
Section titled “Trigger”# Version read from jsr.jsongh workflow run jsr-publish.yml
# Explicit override (to force a specific version)gh workflow run jsr-publish.yml -f version=1.0.3After triggering, monitor via gh run watch or in the Actions → JSR Publish tab.
Files involved
Section titled “Files involved”| File | Role |
|---|---|
packages/shared/jsr.json | JSR metadata: name, version, exports, exclude |
packages/shared/package.json | npm metadata: version (must match jsr.json) |
.github/workflows/jsr-publish.yml | OIDC workflow, workflow_dispatch trigger |
Version sync
Section titled “Version sync”Always update both in the same commit. There is no hook validating this — forgetting causes an inconsistent publish (workspace consumers see one version, JSR consumers see another).
Adding a new export
Section titled “Adding a new export”When adding a new module to @buntime/shared:
- Add it to
package.jsonin theexportsfield (for workspace consumers) - Add it to
jsr.jsonin theexportsfield (for JSR consumers) - Remove it from
jsr.json:excludeif it was previously excluded - Bump
versionin both files - Commit, push, and trigger
gh workflow run jsr-publish.yml
Typical entry example:
{ "name": "@buntime/shared", "version": "1.0.4", "exports": { "./logger": "./src/logger/index.ts", "./types": "./src/types/index.ts", "./utils/string": "./src/utils/string.ts" }, "exclude": ["**/*.test.ts"]}{ "name": "@buntime/shared", "version": "1.0.4", "exports": { "./logger": "./src/logger/index.ts", "./types": "./src/types/index.ts", "./utils/string": "./src/utils/string.ts" }}Updating consumers
Section titled “Updating consumers”In each external plugin:
cd /path/to/external-pluginbunx jsr add @buntime/shared@^1.0.4JSR creates/updates the entry in package.json and downloads the package.
Cross-refs
Section titled “Cross-refs”- Contents of
@buntime/shared(logger, types, errors, utils):@buntime/shared - The general project release flow: Release flow