You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update CLAUDE.md to reflect PR #26/#27 changes
- Client module graph: add types.ts, recipes.ts, expand panels and
components lists with all new files from the panel-router and
recipe-panels PRs
- server/utils.ts: add findOrCreateColumn and writeColumn to description
- TypeScript Configuration: add jest.config.cjs single-tsconfig note
explaining the ts-jest ConfigSet caching bug workaround
- Coverage section: fix stale sidebar-entry.ts description (old exported
functions no longer exist; file is now fully excluded from collection)
- Remove stale reference to sidebar-entry-testing-design.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
src/client/google.d.ts (compile-time type stub for google.script.run — uses declare global{} pattern)
@@ -116,10 +127,12 @@ Only `index.ts` should reference Google Apps Script UI services (SpreadsheetApp,
116
127
Two tsconfigs for two build environments:
117
128
118
129
-**`tsconfig.json`** — server build. Targets ES2019, no DOM lib, excludes `src/client/`.
119
-
-**`tsconfig.client.json`** — client build and client tests. Extends base, adds `"lib": ["ES2019", "DOM"]`, sets `rootDir: "."` (covers both `src/` and `__tests__/`). Includes precise file patterns: `src/client/**/*.ts`, `src/shared/**/*.ts`, and the three client-side test files.
130
+
-**`tsconfig.client.json`** — client build and client tests. Extends base, adds `"lib": ["ES2019", "DOM"]`, sets `rootDir: "."` (covers both `src/` and `__tests__/`). Includes precise file patterns: `src/client/**/*.ts`, `src/shared/**/*.ts`, and the client-side test files.
**Jest transform:**`jest.config.cjs` uses a single transform rule — `tsconfig.client.json` for all `.ts` files. This avoids a ts-jest static `_cachedConfigSets` bug where multiple transformer instances sharing one Jest worker (common on CI with few CPUs) would reuse the first-cached ConfigSet regardless of per-transform tsconfig options, causing client files to compile without DOM types. Server code compiles cleanly under `tsconfig.client.json` since it never references DOM globals.
135
+
123
136
**Note on types:**`tsconfig.client.json` uses `"types": ["google-apps-script", "jest"]` — do **not** add `"node"` here, as it causes `MimeType` collisions with the google-apps-script types. When a file needs Node.js types (e.g. `readFileSync`), use a triple-slash directive at the top of that file: `/// <reference types="node" />`.
124
137
125
138
### Testing
@@ -155,11 +168,11 @@ The `__tests__/helpers/` directory is excluded from test discovery via `testPath
155
168
156
169
**Coverage:** Run `npm run test:coverage` to collect coverage and enforce per-file thresholds. Coverage is opt-in — the pre-commit hook runs `jest --bail` without `--coverage`.
157
170
158
-
Two boundary files are excluded from high thresholds:
159
-
-`src/server/index.ts` — excluded from coverage collection entirely. The four tool orchestrators are deeply coupled to SpreadsheetApp UI globals and are not unit-tested.
160
-
-`src/client/sidebar-entry.ts` — included in collection with lower per-file thresholds. The four exported functions (`showAIPanel`, `hideAIPanel`, `dispatchTool`, `runAI`) are fully tested. `init()` and its inner `addEventListener` arrow functions run at module load time before `beforeEach`sets up the DOM, so they are never invoked.
171
+
Two files are excluded from coverage collection entirely:
172
+
-`src/server/index.ts` — the four tool orchestrators are deeply coupled to SpreadsheetApp UI globals and are not unit-tested.
173
+
-`src/client/sidebar-entry.ts` — contains only `init()`, which is called immediately at module load time (before `beforeEach`can set up the DOM) and has no exports to test in isolation.
161
174
162
-
See `docs/plans/2026-02-18-testing-coverage-design.md`and `docs/plans/2026-02-24-sidebar-entry-testing-design.md`for full rationale.
175
+
See `docs/plans/2026-02-18-testing-coverage-design.md` for full rationale.
163
176
164
177
**CI:**`.github/workflows/lint-typecheck-format-test.yml` runs on push to `main` and PRs targeting `main`: lint → typecheck → format check → test with coverage.
0 commit comments