feat: prepare package for npm publish (#227)

- Version 0.2.0 (was 1.0.0 -- too early for stable)
- Add files field: only ship dist/, .skills/, patches/
- Add engines: node >= 20
- Add repository, homepage, author metadata
- Add prepublishOnly: build + test gate
- Move patch-package from postinstall to prepare (don't run for end users)
- Add npm publish step to release workflow (requires NPM_TOKEN secret)
- Pre-releases publish with --tag next, stable with --tag latest
- Update release notes install instructions for npm

Closes #174 (once NPM_TOKEN is configured)

Written by Cameron ◯ Letta Code

"Shipping is a feature." -- Jez Humble
This commit is contained in:
Cameron
2026-02-09 09:52:48 -08:00
committed by GitHub
parent abf3307e3d
commit 999ee89cb0
2 changed files with 47 additions and 13 deletions

View File

@@ -69,10 +69,9 @@ jobs:
echo "## Install" >> notes.md
echo "" >> notes.md
echo '```bash' >> notes.md
echo "git clone https://github.com/letta-ai/lettabot.git" >> notes.md
echo "cd lettabot" >> notes.md
echo "git checkout ${CURRENT_TAG}" >> notes.md
echo "npm install && npm run build && npm link" >> notes.md
echo "npx lettabot onboard" >> notes.md
echo "# or" >> notes.md
echo "npm install -g lettabot" >> notes.md
echo '```' >> notes.md
# Add full changelog link
@@ -103,5 +102,21 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TODO: Ping letta-code agent to write a richer summary once
# letta-code-action supports release events / custom prompts
- name: Publish to npm
if: env.NPM_TOKEN != ''
run: |
CURRENT_TAG=${GITHUB_REF#refs/tags/}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# Set version from git tag (strip 'v' prefix)
VERSION=${CURRENT_TAG#v}
npm version "$VERSION" --no-git-tag-version --allow-same-version
# Determine npm tag (pre-releases get 'next', stable gets 'latest')
if echo "$CURRENT_TAG" | grep -qE '(alpha|beta|rc)'; then
npm publish --tag next --access public
else
npm publish --access public
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}