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 }}

View File

@@ -1,6 +1,6 @@
{
"name": "lettabot",
"version": "1.0.0",
"version": "0.2.0",
"type": "module",
"main": "dist/main.js",
"bin": {
@@ -14,7 +14,8 @@
"setup": "tsx src/setup.ts",
"dev": "tsx src/main.ts",
"build": "tsc",
"postinstall": "npx patch-package",
"prepare": "npx patch-package || true",
"prepublishOnly": "npm run build && npm run test:run",
"start": "node dist/main.js",
"test": "vitest",
"test:run": "vitest run",
@@ -31,15 +32,33 @@
"skills:find": "npx skills find"
},
"keywords": [
"telegram",
"bot",
"letta",
"ai",
"agent"
"agent",
"chatbot",
"telegram",
"slack",
"whatsapp",
"signal",
"discord",
"multi-agent"
],
"author": "",
"author": "Letta <team@letta.com>",
"license": "Apache-2.0",
"description": "Multi-channel AI assistant with persistent memory - Telegram, Slack, WhatsApp",
"description": "Multi-channel AI assistant with persistent memory - Telegram, Slack, WhatsApp, Signal, Discord",
"repository": {
"type": "git",
"url": "https://github.com/letta-ai/lettabot.git"
},
"homepage": "https://github.com/letta-ai/lettabot",
"engines": {
"node": ">=20"
},
"files": [
"dist/",
".skills/",
"patches/"
],
"dependencies": {
"@clack/prompts": "^0.11.0",
"@hapi/boom": "^10.0.1",