Skip to content

Commit 9c05707

Browse files
authored
fix: restore tsconfig for typecheck, fix wrap() type (#19)
## Summary - Restore `module` and `moduleResolution` in tsconfig.json — tshy overrides these during build, but `tsc --noEmit` needs them for typecheck - Fix `wrap()` generic from `(...args: unknown[]) => unknown` to `(...args: any[]) => any` so typed functions can be wrapped without casting ## Test plan - [ ] `pnpm -F agentcrumbs typecheck` passes - [ ] `pnpm -F agentcrumbs build` passes - [ ] CI typecheck passes
2 parents 839404f + 0a89655 commit 9c05707

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/agentcrumbs/src/trail.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ function createTrailFunction(
215215
}
216216
};
217217

218-
fn.wrap = <T extends (...args: unknown[]) => unknown>(
218+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
219+
fn.wrap = <T extends (...args: any[]) => any>(
219220
name: string,
220221
wrappedFn: T
221222
): T => {

packages/agentcrumbs/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export type TrailFunction = {
4949
name: string,
5050
fn: (ctx: ScopeContext) => T | Promise<T>
5151
) => T | Promise<T>;
52-
wrap: <T extends (...args: unknown[]) => unknown>(name: string, fn: T) => T;
52+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
53+
wrap: <T extends (...args: any[]) => any>(name: string, fn: T) => T;
5354
time: (label: string) => void;
5455
timeEnd: (label: string, data?: unknown) => void;
5556
snapshot: (label: string, obj: unknown) => void;

packages/agentcrumbs/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"compilerOptions": {
33
"target": "ES2022",
4+
"module": "Node16",
5+
"moduleResolution": "Node16",
46
"strict": true,
57
"declaration": true,
68
"declarationMap": true,
79
"sourceMap": true,
810
"esModuleInterop": true,
911
"skipLibCheck": true,
1012
"forceConsistentCasingInFileNames": true
11-
},
12-
"exclude": ["src/__tests__/**/*"]
13+
}
1314
}

0 commit comments

Comments
 (0)