Publishing
Narrarium is prepared to publish as four public npm packages.
Final package names
narrariumnarrarium-mcp-servercreate-narrarium-booknarrarium-astro-reader
Initial public version
0.1.0
Keep the four packages aligned on the same initial release unless there is a strong reason to split versions later.
Release order
narrariumnarrarium-astro-readernarrarium-mcp-servercreate-narrarium-book
The starter and reader depend on the published package names, so publish the lower-level packages first.
Dry run checks
From the workspace root:
npm run release:check
This runs:
- workspace build
- TypeScript validation
- automated package tests
npm pack --dry-runfor every public package
GitHub Actions setup
The repository includes:
.github/workflows/ci.yml.github/workflows/publish-npm.yml
To enable npm publishing from GitHub:
- Add the repository secret
NPM_TOKEN - Make sure
NPM_TOKENis an npm Automation token for the account that will publish these package names - Merge version bumps to
main - Optionally use either fallback trigger when needed:
- create a GitHub Release tagged
v0.1.0,v0.1.1, and so on - run the
Publish npm packagesworkflow manually
- create a GitHub Release tagged
On pushes to main, the publish workflow checks npm first and only publishes workspace packages whose local version is not already present in the registry.
When unpublished versions are detected, it runs the full release checks and then publishes packages in dependency order.
On GitHub Release events it also verifies that the release tag matches the workspace version.
If GitHub Actions fails with EOTP, npm is rejecting the token for write operations with 2FA enabled. In that case either:
- replace
NPM_TOKENwith an npm Automation token - or configure npm Trusted Publishing for this GitHub repository instead of token-based publish auth
If GitHub Actions fails with E404 while publishing narrarium or the other unscoped packages, npm is usually telling you that the package name is not available to the authenticated account or the registry request is wrong. In that case:
- make sure the package names are still free or already owned by the publishing account
- make sure the token belongs to the npm account you expect by checking
npm whoami - make sure the workflow is publishing to the public npm registry
Publish example
Publish in release order from the workspace root:
npm publish -w narrarium --access public
npm publish -w narrarium-astro-reader --access public
npm publish -w narrarium-mcp-server --access public
npm publish -w create-narrarium-book --access public
You can also use the root helper script locally:
npm run publish:all
Notes
- The default production flow is now: bump versions, merge to
main, let GitHub Actions publish the packages that are not already on npm. narrarium-reader-initsupports published installs and can also be driven locally from the workspace.create-narrarium-book --with-readerkeeps using a local file dependency when run from this monorepo so the generated reader works immediately during development.