chore(openwrk): add npm publish skill and bump

This commit is contained in:
Benjamin Shafii
2026-02-01 14:06:05 -08:00
parent 258eac232b
commit 5636ee2a32
6 changed files with 84 additions and 1 deletions

View File

@@ -0,0 +1 @@
NPM_TOKEN=

View File

@@ -0,0 +1 @@
.env

View File

@@ -0,0 +1,54 @@
---
name: openwrk-npm-publish
description: |
Publish the openwrk npm package with clean git hygiene.
Triggers when user mentions:
- "openwrk npm publish"
- "publish openwrk"
- "bump openwrk"
---
## Quick usage (already configured)
1. Ensure you are on the default branch and the tree is clean.
2. Bump the version in `packages/headless/package.json`.
3. Commit the bump.
4. Publish the package.
```bash
pnpm --filter openwrk publish --access public
```
5. Verify the published version.
```bash
npm view openwrk version
```
---
## Scripted publish
```bash
./.opencode/skills/openwrk-npm-publish/scripts/publish-openwrk.sh
```
---
## First-time setup (if not configured)
Authenticate with npm before publishing.
```bash
npm login
```
Alternatively, export an npm token in your environment (see `.env.example`).
---
## Notes
- `pnpm publish` requires a clean git tree.
- This publish flow is separate from app release tags.

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(git rev-parse --show-toplevel)"
cd "$root"
if [ -n "$(git status --porcelain)" ]; then
echo "Working tree is dirty. Commit or stash before publish."
exit 1
fi
version=$(node -p "require('./packages/headless/package.json').version")
echo "Publishing openwrk@$version"
pnpm --filter openwrk publish --access public