From 46def2945ae7071af1a861727ef9cf7c3c8bf7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Tue, 19 May 2026 08:07:45 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20update=20dev=20workflow=20=E2=80=94=20?= =?UTF-8?q?fix=20publish=20script,=20remove=20deploy.sh,=20update=20CLAUDE?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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οΌ‰ --- CLAUDE.md | 33 +++++++++++++++++++++---------- package.json | 2 +- scripts/deploy.sh | 44 ----------------------------------------- scripts/publish-all.mjs | 24 ++++++++++------------ 4 files changed, 34 insertions(+), 69 deletions(-) delete mode 100755 scripts/deploy.sh diff --git a/CLAUDE.md b/CLAUDE.md index ac9cb78..d906db2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 diff --git a/package.json b/package.json index 4509f84..dd52be1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100755 index c15ea9b..0000000 --- a/scripts/deploy.sh +++ /dev/null @@ -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" diff --git a/scripts/publish-all.mjs b/scripts/publish-all.mjs index 784f6d9..28de67c 100644 --- a/scripts/publish-all.mjs +++ b/scripts/publish-all.mjs @@ -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");