Skip to content

Commit 8b99fe0

Browse files
la14-1spawn-qa-bot
andauthored
refactor: remove dead code (parseJsonRaw, stale re-exports) (#2246)
- Remove parseJsonRaw from packages/shared — exported but never imported - Remove dead re-exports from agent-setup.ts (AgentConfig type, generateEnvConfig) that no consumer imports (all callers use the original modules directly) Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
1 parent 4ac19a3 commit 8b99fe0

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

packages/cli/src/shared/agent-setup.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ export async function wrapSshCall(op: Promise<void>): Promise<Result<void>> {
3232
}
3333
}
3434

35-
// Re-export so cloud modules can re-export from here
36-
export type { AgentConfig };
37-
38-
export { generateEnvConfig } from "./agents";
39-
4035
// ─── CloudRunner interface ──────────────────────────────────────────────────
4136

4237
export interface CloudRunner {

packages/shared/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { parseJsonObj, parseJsonRaw, parseJsonWith } from "./parse";
1+
export { parseJsonObj, parseJsonWith } from "./parse";
22
export { Err, Ok, type Result } from "./result";
33
export { hasMessage, hasStatus, isNumber, isString, toObjectArray, toRecord } from "./type-guards";

packages/shared/src/parse.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ export function parseJsonWith<T extends v.BaseSchema<unknown, unknown, v.BaseIss
1717
}
1818
}
1919

20-
/**
21-
* Escape hatch: parse JSON to `unknown` without schema validation.
22-
* Use for dynamic response formats where a fixed schema isn't practical
23-
* (e.g., cloud APIs with 5+ response shapes).
24-
*/
25-
export function parseJsonRaw(text: string): unknown {
26-
try {
27-
return JSON.parse(text);
28-
} catch {
29-
return null;
30-
}
31-
}
32-
3320
/**
3421
* Parse a JSON string and return it as a Record<string, unknown> or null.
3522
* Rejects non-object results (arrays, primitives).

0 commit comments

Comments
 (0)