Publishing Guide¶
This extension is distributed as an npm package. Users install it via their package manager and register it as a pi extension.
Pre-publish checklist¶
-
pnpm buildpasses with zero errors -
pnpm testpasses all tests -
pnpm versionset correctly inpackage.json -
CHANGELOG.mdupdated for the version - No
node_modules/ordist/accidentally tracked in git -
filesfield inpackage.jsonreviewed
Version bumping¶
This project follows Semantic Versioning:
| Change type | Version bump | Example |
|---|---|---|
| Bug fix | patch | 0.1.1 |
| New tool/command (non-breaking) | minor | 0.2.0 |
| Breaking change | major | 1.0.0 |
# patch (bug fix)
pnpm version patch
# minor (new feature)
pnpm version minor
# major (breaking change)
pnpm version major
This updates package.json, package-lock.json (if using npm), and creates a git tag.
Publish to npm¶
For scoped packages (@your-org/pi-vault-mind), the --access public flag is required for first publish.
Dry run¶
GitHub Release¶
After publishing:
- Push the version tag:
git push origin main --tags - Create a release on GitHub from the new tag
- Copy the relevant section from
CHANGELOG.mdinto the release notes
Installation by users¶
After publishing, users install via:
Then register in their project's package.json:
Or globally in pi config.
What gets published¶
The files field in package.json controls the npm tarball contents:
These are included at publish time:
dist/— compiled JavaScript outputskills/— Agent Skills standard SKILL.md and referencesCHANGELOG.md,README.md,LICENSE— package metadata
Do NOT publish:
node_modules/test/.git/.pi/- Raw
index.ts(if compiling todist/) test/(tests are compiled todist/test/)src/(compiled todist/src/)
Automated publishing (GitHub Actions)¶
To publish from CI, add an npm automation token as NPM_TOKEN to repository secrets, then create:
name: Publish
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with: { version: 9 }
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm test
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}