chore(cli): add bun run link scripts + fix init template versions

- Add link/link:consume/link:unlink scripts to root package.json
- Document cross-repo bun link workflow in CLAUDE.md
- Fix hardcoded @uncaged/workflow-runtime "^0.1.0" → "*" in
  init workspace and init template scaffolds (actual version is 0.3.x)
This commit is contained in:
2026-05-12 11:03:12 +08:00
parent 2af39463de
commit 0fbbf37548
4 changed files with 23 additions and 3 deletions
+17
View File
@@ -245,6 +245,23 @@ bun run format # biome format --write
bun test # run tests bun test # run tests
``` ```
### Cross-repo Development (bun link)
For developing workflows in a separate repo (e.g. `xingyue-workflows`) against local monorepo packages:
```bash
# 1. Register all @uncaged/* packages (run once from monorepo root)
bun run link
# 2. Consume linked packages (run from the external workflow repo)
bun run link:consume
# 3. Restore original npm versions (undo link)
bun run link:unlink
```
The script is at `scripts/link-all.sh`. It links/unlinks all 16 `@uncaged/*` packages.
## Commit Convention ## Commit Convention
``` ```
+4 -1
View File
@@ -9,7 +9,10 @@
"check": "bunx tsc --build && biome check .", "check": "bunx tsc --build && biome check .",
"typecheck": "bunx tsc --build", "typecheck": "bunx tsc --build",
"format": "biome format --write .", "format": "biome format --write .",
"test": "bun run --filter '*' test" "test": "bun run --filter '*' test",
"link": "./scripts/link-all.sh",
"link:consume": "./scripts/link-all.sh --consume",
"link:unlink": "./scripts/link-all.sh --unlink"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.4.14", "@biomejs/biome": "^2.4.14",
@@ -6,7 +6,7 @@ export function templatePackageJson(templateName: string): string {
private: true, private: true,
type: "module", type: "module",
dependencies: { dependencies: {
"@uncaged/workflow-runtime": "^0.1.0", "@uncaged/workflow-runtime": "*",
zod: "^4.0.0", zod: "^4.0.0",
}, },
}, },
@@ -28,7 +28,7 @@ function workflowsPackageJson(): string {
private: true, private: true,
type: "module", type: "module",
dependencies: { dependencies: {
"@uncaged/workflow-runtime": "^0.1.0", "@uncaged/workflow-runtime": "*",
zod: "^4.0.0", zod: "^4.0.0",
}, },
}, },