fix: remove workflow-util dependency on workflow-protocol

Inline Result type and ok/err helpers into workflow-util to break
dependency on the now-archived workflow-protocol package.

Also add explicit @uncaged/json-cas dep to uwf-protocol (was only
available as transitive dep via json-cas-fs).

小橘 🍊(NEKO Team)
This commit is contained in:
2026-05-19 07:22:15 +00:00
parent d63d58ccb5
commit 68246e20b1
8 changed files with 85 additions and 8 deletions
+1 -3
View File
@@ -14,9 +14,7 @@
"import": "./dist/index.js"
}
},
"dependencies": {
"@uncaged/workflow-protocol": "workspace:^"
},
"dependencies": {},
"devDependencies": {
"typescript": "^5.8.3"
},
+2 -1
View File
@@ -1,4 +1,5 @@
import { err, ok, type Result } from "@uncaged/workflow-protocol";
import { err, ok } from "./result.js";
import type { Result } from "./types.js";
/** Crockford Base32 alphabet (no I, L, O, U) — exactly 32 symbols. */
export const CROCKFORD_BASE32_ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
+1 -1
View File
@@ -1,4 +1,4 @@
export { err, ok } from "@uncaged/workflow-protocol";
export { err, ok } from "./result.js";
export { encodeUint64AsCrockford } from "./base32.js";
export { env } from "./env.js";
export {
+9
View File
@@ -0,0 +1,9 @@
import type { Result } from "./types.js";
export function ok<T>(value: T): Result<T, never> {
return { ok: true, value };
}
export function err<E>(error: E): Result<never, E> {
return { ok: false, error };
}
+1 -1
View File
@@ -1,4 +1,4 @@
export type { Result } from "@uncaged/workflow-protocol";
export type Result<T, E = Error> = { ok: true; value: T } | { ok: false; error: E };
export type LoggerSink = { kind: "stderr" } | { kind: "file"; path: string };
+1 -1
View File
@@ -5,5 +5,5 @@
"outDir": "dist"
},
"include": ["src"],
"references": [{ "path": "../workflow-protocol" }]
"references": []
}