From 68246e20b1f287478404605077e5accec50a40e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Tue, 19 May 2026 07:22:15 +0000 Subject: [PATCH] fix: remove workflow-util dependency on workflow-protocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- packages/uwf-protocol/package.json | 3 +- packages/uwf-protocol/pnpm-lock.yaml | 68 ++++++++++++++++++++++++++++ packages/workflow-util/package.json | 4 +- packages/workflow-util/src/base32.ts | 3 +- packages/workflow-util/src/index.ts | 2 +- packages/workflow-util/src/result.ts | 9 ++++ packages/workflow-util/src/types.ts | 2 +- packages/workflow-util/tsconfig.json | 2 +- 8 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 packages/uwf-protocol/pnpm-lock.yaml create mode 100644 packages/workflow-util/src/result.ts diff --git a/packages/uwf-protocol/package.json b/packages/uwf-protocol/package.json index b1bc617..6539789 100644 --- a/packages/uwf-protocol/package.json +++ b/packages/uwf-protocol/package.json @@ -15,7 +15,8 @@ } }, "dependencies": { -"@uncaged/json-cas-fs": "^0.3.0" + "@uncaged/json-cas": "^0.3.0", + "@uncaged/json-cas-fs": "^0.3.0" }, "devDependencies": { "typescript": "^5.8.3" diff --git a/packages/uwf-protocol/pnpm-lock.yaml b/packages/uwf-protocol/pnpm-lock.yaml new file mode 100644 index 0000000..5da3df5 --- /dev/null +++ b/packages/uwf-protocol/pnpm-lock.yaml @@ -0,0 +1,68 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@uncaged/json-cas': + specifier: ^0.3.0 + version: 0.3.0 + +packages: + + '@uncaged/json-cas@0.3.0': + resolution: {integrity: sha512-LR8Uow7cBdvH+6y9mh9Fd7zDs8fWhfhpVZVsexfdK1KKnGaR7WvukuhBj6r0FbOZ78j7jhjeEfzsUXR2cHELwQ==} + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + cborg@4.5.8: + resolution: {integrity: sha512-6/viltD51JklRhq4L7jC3zgy6gryuG5xfZ3kzpE+PravtyeQLeQmCYLREhQH7pWENg5pY4Yu/XCd6a7dKScVlw==} + hasBin: true + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-uri@3.1.2: + resolution: {integrity: sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + xxhash-wasm@1.1.0: + resolution: {integrity: sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==} + +snapshots: + + '@uncaged/json-cas@0.3.0': + dependencies: + ajv: 8.20.0 + cborg: 4.5.8 + xxhash-wasm: 1.1.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.2 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + cborg@4.5.8: {} + + fast-deep-equal@3.1.3: {} + + fast-uri@3.1.2: {} + + json-schema-traverse@1.0.0: {} + + require-from-string@2.0.2: {} + + xxhash-wasm@1.1.0: {} diff --git a/packages/workflow-util/package.json b/packages/workflow-util/package.json index d9dd63f..a74148a 100644 --- a/packages/workflow-util/package.json +++ b/packages/workflow-util/package.json @@ -14,9 +14,7 @@ "import": "./dist/index.js" } }, - "dependencies": { - "@uncaged/workflow-protocol": "workspace:^" - }, + "dependencies": {}, "devDependencies": { "typescript": "^5.8.3" }, diff --git a/packages/workflow-util/src/base32.ts b/packages/workflow-util/src/base32.ts index a8b0c80..330fa14 100644 --- a/packages/workflow-util/src/base32.ts +++ b/packages/workflow-util/src/base32.ts @@ -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"; diff --git a/packages/workflow-util/src/index.ts b/packages/workflow-util/src/index.ts index 6a762ea..939e825 100644 --- a/packages/workflow-util/src/index.ts +++ b/packages/workflow-util/src/index.ts @@ -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 { diff --git a/packages/workflow-util/src/result.ts b/packages/workflow-util/src/result.ts new file mode 100644 index 0000000..6f92f67 --- /dev/null +++ b/packages/workflow-util/src/result.ts @@ -0,0 +1,9 @@ +import type { Result } from "./types.js"; + +export function ok(value: T): Result { + return { ok: true, value }; +} + +export function err(error: E): Result { + return { ok: false, error }; +} diff --git a/packages/workflow-util/src/types.ts b/packages/workflow-util/src/types.ts index 6233bff..e55327e 100644 --- a/packages/workflow-util/src/types.ts +++ b/packages/workflow-util/src/types.ts @@ -1,4 +1,4 @@ -export type { Result } from "@uncaged/workflow-protocol"; +export type Result = { ok: true; value: T } | { ok: false; error: E }; export type LoggerSink = { kind: "stderr" } | { kind: "file"; path: string }; diff --git a/packages/workflow-util/tsconfig.json b/packages/workflow-util/tsconfig.json index 0424b27..fa25113 100644 --- a/packages/workflow-util/tsconfig.json +++ b/packages/workflow-util/tsconfig.json @@ -5,5 +5,5 @@ "outDir": "dist" }, "include": ["src"], - "references": [{ "path": "../workflow-protocol" }] + "references": [] }