-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.node.json
More file actions
134 lines (134 loc) · 6.77 KB
/
Copy pathtsconfig.node.json
File metadata and controls
134 lines (134 loc) · 6.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
"compilerOptions": {
"composite": true,
// See tsconfig.web.json for the full rationale. electron-vite
// builds the main + preload bundles; tsc is type-check-only but
// `composite: true` forces emit. This redirects the unwanted
// emit to a gitignored scratch dir so it doesn't land next to
// the `.ts` sources.
"outDir": "./.tsc-out/node",
"module": "ESNext",
"moduleResolution": "Bundler",
"target": "ES2022",
"lib": ["ES2022"],
"skipLibCheck": true,
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"isolatedModules": true,
"types": ["node"],
// baseUrl + paths give us absolute imports (`@shared/types/transcript`
// instead of `../../../shared/types/transcript`). Deep relative paths
// were the #1 source of move-breakage during the refactor — they
// encode each file's relation to its target, so any move on either
// side invalidates them. Absolute paths only break when the TARGET
// moves, cutting the rewrite cost of future refactors in half.
//
// Vite needs a parallel `resolve.alias` config — see
// electron.vite.config.ts. TSC and Vite agree on the alias map; if
// they diverge, tsc will green-light something the runtime can't
// actually load.
"baseUrl": ".",
"paths": {
"claude-code-headless": ["./packages/claude-code-headless/src/index.ts"],
"claude-code-headless/*": ["./packages/claude-code-headless/src/*"],
"codex-headless": ["./packages/codex-headless/src/index.ts"],
"codex-headless/*": ["./packages/codex-headless/src/*"],
"opencode-headless": ["./packages/opencode-headless/src/index.ts"],
"opencode-headless/*": ["./packages/opencode-headless/src/*"],
"agent-transcript-parser": ["./packages/agent-transcript-parser/src/index.ts"],
"agent-transcript-parser/*": ["./packages/agent-transcript-parser/src/*"],
"agent-voice-dictation": ["./packages/agent-voice-dictation/src/index.ts"],
"agent-voice-dictation/*": ["./packages/agent-voice-dictation/src/*/index.ts"],
"workflow-mcp": ["./packages/workflow-mcp/src/index.ts"],
"workflow-mcp/state": ["./packages/workflow-mcp/src/state.ts"],
"workflow-mcp/worker": ["./packages/workflow-mcp/src/worker.ts"],
"@main/*": ["./src/main/*"],
"@preload/*": ["./src/preload/*"],
"@renderer/*": ["./src/renderer/src/*"],
"@shared/*": ["./src/shared/*"],
"@providers/*": ["./src/providers/*"],
"@mcp/*": ["./src/mcp/*"]
}
},
"include": [
"electron.vite.config.ts",
"src/main/**/*",
"src/preload/**/*",
"src/core/**/*",
"src/shared/**/*",
"src/providers/**/*",
"src/mcp/**/*",
"packages/agent-transcript-parser/src/**/*",
// Pull only the Node-safe dictation package surfaces into the app
// typecheck. The package root also exports browser recording helpers, and
// those need the package-local DOM-enabled tsconfig instead of this
// Node-only project.
"packages/agent-voice-dictation/src/composer/**/*",
"packages/agent-voice-dictation/src/openrouter/**/*",
"packages/agent-voice-dictation/src/speech/**/*",
"packages/claude-code-headless/src/**/*",
"packages/codex-headless/src/**/*",
"packages/opencode-headless/src/**/*",
"packages/workflow-mcp/src/**/*"
],
"exclude": [
// Provider renderer halves live under the node project's
// `src/providers/**/*` include (so the *.ts runtime files type-
// check), but the *.tsx row + modal components inside them are
// renderer-only. Without this exclude, tsc walks into
// `providers/<kind>/renderer/**/*.tsx` and emits ~530
// "Cannot use JSX unless the '--jsx' flag is provided" errors,
// plus cascade "`window.api` doesn't exist" noise as it drags
// in renderer imports transitively.
//
// These files ARE type-checked by the web project, which has
// `src/providers/*/renderer/**/*` in its include and `jsx:
// react-jsx` in its compiler options. Excluding them here keeps
// the node project strictly node-typed and eliminates the
// single biggest source of pre-existing tsc noise in this
// codebase.
"src/providers/*/renderer/**/*",
// registry.renderer.ts lives at providers/ root (not under
// providers/<kind>/renderer/), so the glob above doesn't catch
// it. It imports TileLeaf from @renderer/workspace/tile-tree/,
// which transitively pulls the entire renderer subtree into
// the node program. Explicit exclude stops that walk at the
// file.
"src/providers/registry.renderer.ts",
// Capability-only renderer registry imports provider row/condition TSX
// modules. It is consumed by renderer feed code, not by main, so keep it
// out of the node project for the same reason as registry.renderer.ts.
"src/providers/registry.renderer.capabilities.ts",
// ...and its colocated spawn-tool test (moved here from features/feed in
// #493 PR-2), which imports the registry and would otherwise re-trigger
// the same renderer-subtree walk this block exists to stop. The web
// project + vitest cover it.
"src/providers/registry.renderer.capabilities.spawnTool.test.ts",
// Shape-catalog registry + coverage gate (Phase 3/4, PR #555): both live
// at providers/ root but import the provider shapes.ts files under
// providers/<kind>/renderer/ and the renderer evidence modules — the
// exact renderer-subtree walk this block stops. Web project + vitest
// cover them, same as the capabilities registry above.
"src/providers/registry.renderShapes.ts",
"src/providers/shapes.coverage.test.ts",
// The import-boundary test (Phase 1, PR #555) is fs-scanning node code
// with no renderer imports, but it lives at providers/ root next to
// these — listed here as documentation that it deliberately STAYS in
// the node project (vitest unit project runs it in node env).
// conditions-core ships ONE renderer-only file: ConditionOutlet.tsx (a JSX
// component). The rest of conditions-core (contract.ts/view.ts/dispatch.ts)
// is node-safe and SHOULD be type-checked by this project. Excluding just
// the .tsx mirrors the `src/providers/*/renderer/**/*` rule above — the web
// project (jsx: react-jsx) type-checks the component; the node project stays
// JSX-free. Without this, tsc emits "Cannot use JSX unless the '--jsx' flag
// is provided" on this one file.
"src/shared/conditions-core/ConditionOutlet.tsx",
// agent-voice-dictation is its own package with its own tsconfig; its test
// files must not be walked by our node project (they'd emit ~420 JSX
// errors on files that aren't ours to type-check).
"packages/agent-voice-dictation/src/**/*.test.ts"
]
}