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:
@@ -14,9 +14,7 @@
|
||||
"import": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@uncaged/workflow-protocol": "workspace:^"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
|
||||
@@ -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,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 {
|
||||
|
||||
@@ -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,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 };
|
||||
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [{ "path": "../workflow-protocol" }]
|
||||
"references": []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user