build: move release scripts and harden publish

publish.sh and test_npm_package.sh now live in scripts/ and cd to the
repo root, so they run from any directory. publish.sh polls npm until
the released version resolves: the first release ended inside the
registry's processing window, when a fresh install still gets the
0.0.0-stage placeholder. It also reopens an empty Unreleased section
after the rename and refuses an empty one before the version bump, so
a refused release leaves the tree clean.

test_npm_package.sh switches pi between the symlink checkout and
npm:pi-nous-portal. Only one may be installed: pi identifies npm
packages by name and local ones by path, so both register the provider
twice.
This commit is contained in:
AlexKucera committed 2026-11-25 16:51:36 +01:00
1 parent 21ec8029c5
commit b71363efb9
8 files changed
+146 -8

No files matched your search

+4 -2
View File
@@ -66,11 +66,13 @@ npm run check # tsc --noEmit + node --test
Typechecking needs a local pi install. The `paths` in `tsconfig.json` point `@earendil-works/pi-ai` and `pi-coding-agent` at the type declarations under `~/.pi/agent/install/releases/<version>/`, so update those three paths when pi is upgraded. The extension itself runs on any pi with the native provider interface. Only `tsc` is pinned.
`./scripts/test_npm_package.sh` switches pi between this checkout and the published package, so you can try a release without hunting for the symlink. Run it with `dev` or `npm` to pick a side.
## Releasing
```bash
./publish.sh # release the version in package.json
./publish.sh patch # bump first; minor and major work too
./scripts/publish.sh # release the version in package.json
./scripts/publish.sh patch # bump first; minor and major work too
```
The script runs the checks, shows the tarball contents, moves the `Unreleased` section of the changelog under the new version, commits, tags, publishes to npm, and pushes. npm asks for your 2FA code during the publish. npm then takes a few minutes to serve the new version, and the script waits until it resolves. You need `npm login` with publish rights to the package first.