Compare commits

..

4 Commits

Author SHA1 Message Date
xingyue ca644dabaa chore: bump all packages to 0.4.0, fix exports for publish
- All @uncaged/* packages → 0.4.0
- Internal deps: workspace:* → workspace:^ (resolves to ^0.4.0 on publish)
- Fix exports: add 'bun' condition for local dev (src), 'import' for consumers (dist)
- Remove stale 'main: src/index.ts' from 6 packages
- Fix publish.sh topo sort to match workspace:^ prefix

星月 <xingyue@shazhou.work>
2026-05-13 20:46:00 +08:00
xiaomo 9d9c00df98 Merge pull request 'chore: remove link-all.sh' (#240) from chore/remove-link-all into main 2026-05-13 10:16:22 +00:00
xiaoju a1c5dc3e92 chore: remove link-all.sh
Local symlink workflow replaced by Gitea npm registry publish flow.

Signed-off-by: 小橘 <xiaoju@shazhou.work>
2026-05-13 09:56:07 +00:00
xiaoju c85980f604 Merge pull request 'chore: merge publish-all.sh into publish.sh' (#238) from chore/merge-publish-scripts into main 2026-05-13 09:52:43 +00:00
20 changed files with 79 additions and 151 deletions
-31
View File
@@ -229,37 +229,6 @@ const mod = await import(bundlePath);
Test files (`__tests__/**`) are exempt.
## Package Build & Distribution
每个包用 `tsc` 编译出 `.js` + `.d.ts``dist/`,**发布 `dist`,不发 `src`,不 bundle**。
### 规则
-`tsc --build` 编译,保留目录结构(tree-shaking 友好)
-`package.json``exports` 指向 `dist/`(编译产物),不指向 `src/`
- ✅ 消费端不受 tsconfig 差异影响
- ❌ 不要用 rollup/esbuild 打成单文件
-`exports` 中不要出现 `./src/`
### package.json exports 格式
```json
{
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
}
}
```
多入口同理,所有路径指向 `dist/`
### 例外
- `workflow-gateway`(Cloudflare Workers)和 `workflow-dashboard`(私有 app)不发 npm,exports 可指向 `src/`
## Toolchain
| Tool | Purpose |
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/cli-workflow",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"src",
"dist",
@@ -11,13 +11,13 @@
"uncaged-workflow": "src/cli.ts"
},
"dependencies": {
"@uncaged/workflow-gateway": "workspace:*",
"@uncaged/workflow-protocol": "workspace:*",
"@uncaged/workflow-util": "workspace:*",
"@uncaged/workflow-cas": "workspace:*",
"@uncaged/workflow-execute": "workspace:*",
"@uncaged/workflow-register": "workspace:*",
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-gateway": "workspace:^",
"@uncaged/workflow-protocol": "workspace:^",
"@uncaged/workflow-util": "workspace:^",
"@uncaged/workflow-cas": "workspace:^",
"@uncaged/workflow-execute": "workspace:^",
"@uncaged/workflow-register": "workspace:^",
"@uncaged/workflow-runtime": "workspace:^",
"hono": "^4.12.18",
"yaml": "^2.8.4"
},
+7 -7
View File
@@ -1,26 +1,26 @@
{
"name": "@uncaged/workflow-agent-cursor",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
],
"type": "module",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*",
"@uncaged/workflow-reactor": "workspace:*",
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-util": "workspace:*",
"@uncaged/workflow-util-agent": "workspace:*",
"@uncaged/workflow-protocol": "workspace:^",
"@uncaged/workflow-reactor": "workspace:^",
"@uncaged/workflow-runtime": "workspace:^",
"@uncaged/workflow-util": "workspace:^",
"@uncaged/workflow-util-agent": "workspace:^",
"zod": "^4.0.0"
},
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
+4 -4
View File
@@ -1,22 +1,22 @@
{
"name": "@uncaged/workflow-agent-hermes",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
],
"type": "module",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-util-agent": "workspace:*"
"@uncaged/workflow-runtime": "workspace:^",
"@uncaged/workflow-util-agent": "workspace:^"
},
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
+4 -4
View File
@@ -1,25 +1,25 @@
{
"name": "@uncaged/workflow-agent-llm",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
],
"type": "module",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-util-agent": "workspace:*"
"@uncaged/workflow-runtime": "workspace:^",
"@uncaged/workflow-util-agent": "workspace:^"
},
"devDependencies": {
"zod": "^4.0.0"
},
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
+6 -4
View File
@@ -1,13 +1,15 @@
{
"name": "@uncaged/workflow-agent-react",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
],
"type": "module",
"types": "src/index.ts",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
@@ -16,9 +18,9 @@
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*",
"@uncaged/workflow-reactor": "workspace:*",
"@uncaged/workflow-util-agent": "workspace:*"
"@uncaged/workflow-protocol": "workspace:^",
"@uncaged/workflow-reactor": "workspace:^",
"@uncaged/workflow-util-agent": "workspace:^"
},
"devDependencies": {
"zod": "^4.0.0"
+4 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-cas",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -11,13 +11,14 @@
},
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*",
"@uncaged/workflow-util": "workspace:*",
"@uncaged/workflow-protocol": "workspace:^",
"@uncaged/workflow-util": "workspace:^",
"xxhashjs": "^0.2.2",
"yaml": "^2.7.1"
},
+8 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-execute",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,6 +8,7 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
@@ -16,12 +17,12 @@
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*",
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-util": "workspace:*",
"@uncaged/workflow-cas": "workspace:*",
"@uncaged/workflow-reactor": "workspace:*",
"@uncaged/workflow-register": "workspace:*",
"@uncaged/workflow-protocol": "workspace:^",
"@uncaged/workflow-runtime": "workspace:^",
"@uncaged/workflow-util": "workspace:^",
"@uncaged/workflow-cas": "workspace:^",
"@uncaged/workflow-reactor": "workspace:^",
"@uncaged/workflow-register": "workspace:^",
"yaml": "^2.7.1"
},
"peerDependencies": {
@@ -1,11 +1,6 @@
import { fileURLToPath } from "node:url";
/**
* Absolute path to the worker script for spawning bundle worker processes.
*
* Uses `.js` extension so it resolves correctly whether running from
* src/ (bun handles .js → .ts) or dist/ (compiled .js exists).
*/
/** Absolute path to `worker-host.ts` for spawning bundle worker processes. */
export function getWorkerHostScriptPath(): string {
return fileURLToPath(new URL("./worker.js", import.meta.url));
return fileURLToPath(new URL("./worker.ts", import.meta.url));
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-gateway",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
+3 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-protocol",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,10 +8,12 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./moderator-table.js": {
"bun": "./src/moderator-table.ts",
"types": "./dist/moderator-table.d.ts",
"import": "./dist/moderator-table.js"
}
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-reactor",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,12 +8,13 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*"
"@uncaged/workflow-protocol": "workspace:^"
},
"peerDependencies": {
"zod": "^4.0.0"
+4 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-register",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,13 +8,14 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*",
"@uncaged/workflow-util": "workspace:*"
"@uncaged/workflow-protocol": "workspace:^",
"@uncaged/workflow-util": "workspace:^"
},
"peerDependencies": {
"acorn": "^8.0.0",
+4 -4
View File
@@ -1,19 +1,18 @@
{
"name": "@uncaged/workflow-runtime",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
],
"type": "module",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-cas": "workspace:*",
"@uncaged/workflow-protocol": "workspace:*"
"@uncaged/workflow-cas": "workspace:^",
"@uncaged/workflow-protocol": "workspace:^"
},
"peerDependencies": {
"zod": "^4.0.0"
@@ -23,6 +22,7 @@
},
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-template-develop",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,6 +8,7 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
@@ -16,11 +17,11 @@
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-register": "workspace:*",
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-register": "workspace:^",
"@uncaged/workflow-runtime": "workspace:^",
"zod": "^4.0.0"
},
"devDependencies": {
"@uncaged/workflow-protocol": "workspace:*"
"@uncaged/workflow-protocol": "workspace:^"
}
}
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-template-solve-issue",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,6 +8,7 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
@@ -16,13 +17,13 @@
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-register": "workspace:*",
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-register": "workspace:^",
"@uncaged/workflow-runtime": "workspace:^",
"zod": "^4.0.0"
},
"devDependencies": {
"@uncaged/workflow-cas": "workspace:*",
"@uncaged/workflow-execute": "workspace:*",
"@uncaged/workflow-protocol": "workspace:*"
"@uncaged/workflow-cas": "workspace:^",
"@uncaged/workflow-execute": "workspace:^",
"@uncaged/workflow-protocol": "workspace:^"
}
}
+5 -3
View File
@@ -1,13 +1,15 @@
{
"name": "@uncaged/workflow-util-agent",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
],
"type": "module",
"types": "src/index.ts",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
@@ -16,8 +18,8 @@
"test": "bun test"
},
"dependencies": {
"@uncaged/workflow-runtime": "workspace:*",
"@uncaged/workflow-cas": "workspace:*",
"@uncaged/workflow-runtime": "workspace:^",
"@uncaged/workflow-cas": "workspace:^",
"zod": "^4.0.0"
}
}
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@uncaged/workflow-util",
"version": "0.3.24",
"version": "0.4.0",
"files": [
"dist",
"package.json"
@@ -8,12 +8,13 @@
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:*"
"@uncaged/workflow-protocol": "workspace:^"
},
"devDependencies": {
"typescript": "^5.8.3"
-49
View File
@@ -1,49 +0,0 @@
#!/usr/bin/env bash
# Link / unlink all @uncaged/* packages from the workflow monorepo.
#
# Usage:
# ./scripts/link-all.sh # Register all packages (run from monorepo root)
# ./scripts/link-all.sh --consume # Link all packages into CWD's project
# ./scripts/link-all.sh --unlink # Unregister all packages and restore CWD's deps
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MONOREPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Iterate package dirs, calling callback(dir, name) for each
each_pkg() {
local cb="$1"
for dir in "$MONOREPO_ROOT"/packages/*/; do
[[ -f "$dir/package.json" ]] || continue
local name
name=$(grep -m1 '"name"' "$dir/package.json" | sed 's/.*: *"\(.*\)".*/\1/')
"$cb" "$dir" "$name"
done
}
do_register() { printf " register %s\n" "$2"; (cd "$1" && bun link 2>&1) > /dev/null; }
do_consume() { printf " link %s\n" "$2"; (bun link "$2" 2>&1) > /dev/null; }
do_unlink() { printf " unlink %s\n" "$2"; (cd "$1" && bun unlink 2>&1) > /dev/null || true; }
case "${1:-}" in
--consume)
each_pkg do_consume
echo "✅ All @uncaged/* packages linked into $(pwd)"
echo " ⚠️ Do NOT run 'bun install' after this — it will overwrite the links"
echo " To restore: $0 --unlink"
;;
--unlink)
each_pkg do_unlink
if [[ -f "package.json" ]]; then
echo " reinstalling deps..."
bun install 2>&1 > /dev/null || true
fi
echo "✅ All @uncaged/* packages unlinked, deps restored"
;;
*)
each_pkg do_register
echo "✅ All @uncaged/* packages registered"
echo " cd <project> && $0 --consume"
;;
esac
+1 -1
View File
@@ -86,7 +86,7 @@ for name, dirname in name_to_dir.items():
local_deps = set()
for section in ('dependencies', 'devDependencies', 'peerDependencies'):
for dep, ver in data.get(section, {}).items():
if dep.startswith('@uncaged/') and dep in name_to_dir and ver == 'workspace:*':
if dep.startswith('@uncaged/') and dep in name_to_dir and ver.startswith('workspace:'):
local_deps.add(dep)
deps_graph[name] = local_deps