chore: update dev workflow — fix publish script, remove deploy.sh, update CLAUDE.md

- scripts/publish-all.mjs: update to 6 active packages only
- scripts/deploy.sh: removed (dashboard/gateway in legacy)
- package.json: release script uses publish-all.mjs directly
- CLAUDE.md: add complete dev workflow section (setup, build, check, test, publish)

小橘 🍊(NEKO Team)
This commit is contained in:
2026-05-19 08:07:45 +00:00
parent 4e89508246
commit 46def2945a
4 changed files with 34 additions and 69 deletions
+23 -10
View File
@@ -225,32 +225,45 @@ Test files (`__tests__/**`) are exempt.
| **Biome** | Lint + format (replaces ESLint + Prettier) |
| **vitest** | Test runner (`cli-workflow` uses vitest; other packages use `bun test`) |
### Commands
### Development Workflow
```bash
bun run check # tsc --build + biome check + lint-log-tags
bun run format # biome format --write
bun test # run tests across all packages
# ── Setup ──
bun install # install all workspace dependencies
# ── Daily development ──
bun run build # tsc --build (all packages, dependency order)
bun run check # tsc --build + biome check + lint-log-tags
bun run format # biome format --write
bun test # run tests across all packages
# ── Before committing ──
bun run check # must pass — typecheck + lint + log tag validation
bun test # must pass — all package tests
```
### Version Management & Publishing
### Publishing
All public `@uncaged/*` packages are published to **npmjs.org** via `@changesets/cli` with **fixed mode** (all packages share the same version number).
All public `@uncaged/*` packages are published to **npmjs.org** with **fixed mode** (all packages share the same version number).
```bash
# 1. After making changes, add a changeset describing the change
# 1. Add a changeset describing the change
bun changeset
# 2. Before release, bump all package versions + generate CHANGELOGs
# 2. Bump all package versions + generate CHANGELOGs
bun version
# 3. Build, test, and publish to npmjs
# 3. Build, test, and publish (runs scripts/publish-all.mjs)
bun release
# Or publish manually with a tag:
node scripts/publish-all.mjs --tag alpha
node scripts/publish-all.mjs --dry-run # preview without publishing
```
- `workspace:^` dependencies resolve to `^x.y.z` on publish
- Publish order defined in `scripts/publish-all.mjs` (dependency order)
- Changesets config: `.changeset/config.json` (fixed mode, public access)
- Each package has auto-generated `CHANGELOG.md`
### End-to-end: Author → Register → Run
+1 -1
View File
@@ -12,7 +12,7 @@
"test": "bun run --filter '*' test",
"changeset": "bunx changeset",
"version": "bunx changeset version",
"release": "bun run build && bun test && npx changeset publish --no-git-tag"
"release": "bun run build && bun test && node scripts/publish-all.mjs"
},
"devDependencies": {
"@biomejs/biome": "^2.4.14",
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
# deploy.sh — Build & deploy dashboard + gateway to Cloudflare
#
# Usage:
# ./scripts/deploy.sh # deploy both
# ./scripts/deploy.sh dashboard # dashboard only
# ./scripts/deploy.sh gateway # gateway only
#
# Env (via `cfg` or export):
# CLOUDFLARE_API_TOKEN — Cloudflare API token
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$REPO_ROOT"
CLOUDFLARE_API_TOKEN="${CLOUDFLARE_API_TOKEN:?CLOUDFLARE_API_TOKEN is required}"
export CLOUDFLARE_API_TOKEN
TARGET="${1:-all}"
deploy_dashboard() {
echo "🌐 Building dashboard..."
(cd packages/workflow-dashboard && npm run build)
echo "🚀 Deploying dashboard to Cloudflare Pages..."
(cd packages/workflow-gateway && npx wrangler pages deploy \
../workflow-dashboard/dist \
--project-name workflow-dashboard)
echo " ✅ Dashboard → workflow.shazhou.work"
}
deploy_gateway() {
echo "🚀 Deploying gateway Worker..."
(cd packages/workflow-gateway && npx wrangler deploy)
echo " ✅ Gateway → workflow-gateway.shazhou.workers.dev"
}
case "$TARGET" in
dashboard) deploy_dashboard ;;
gateway) deploy_gateway ;;
all) deploy_dashboard; deploy_gateway ;;
*) echo "Usage: deploy.sh [dashboard|gateway|all]"; exit 1 ;;
esac
echo "✅ Deploy complete"
+10 -14
View File
@@ -18,19 +18,9 @@ const dryRun = args.includes("--dry-run");
const publishOrder = [
"workflow-protocol",
"workflow-util",
"workflow-runtime",
"workflow-cas",
"workflow-reactor",
"workflow-register",
"workflow-execute",
"workflow-util-agent",
"workflow-agent-cursor",
"workflow-moderator",
"workflow-agent-kit",
"workflow-agent-hermes",
"workflow-agent-llm",
"workflow-agent-react",
"workflow-template-develop",
"workflow-template-solve-issue",
"workflow-gateway",
"cli-workflow",
];
@@ -71,14 +61,18 @@ for (const name of publishOrder) {
const tagFlag = tag ? `--tag ${tag}` : "";
const cmd = `npm publish --access public ${tagFlag}`;
console.log(`📦 ${name}...`);
if (dryRun) {
console.log(` (dry-run) ${cmd}`);
continue;
}
try {
const out = execSync(cmd, { cwd: pkgDir, stdio: "pipe" }).toString().trim();
const _lastLine = out.split("\n").pop();
} catch (_err) {
console.log(` ✅ published`);
} catch (err) {
console.error(` ❌ failed: ${err.message}`);
failed = true;
break;
}
@@ -92,3 +86,5 @@ for (const [pkgPath, raw] of originals) {
if (failed) {
process.exit(1);
}
console.log(dryRun ? "\n✅ Dry run complete" : "\n✅ All packages published");