Skip to content

Commit 15feded

Browse files
authored
build(deps): upgrade workspace to TypeScript 6 (#5167)
1 parent 3872cae commit 15feded

131 files changed

Lines changed: 1487 additions & 547 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/klicker-data-model/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pnpm run build # 4. regenerate Prisma client + dependent packages
1818

1919
Then, if the change is API-visible: update Pothos types/resolvers (`klicker-graphql-api`) — the Pothos Prisma plugin picks up new fields, but object types expose them explicitly.
2020

21+
Run Prisma client generation only through `pnpm --filter @klicker-uzh/prisma generate` (or a build that calls it). The package script owns the TypeScript 6 generated-namespace patch; direct `prisma generate` bypasses it. The package's canonical `check` includes the patch invariant tests. If generation fails at the patch, run `pnpm --filter @klicker-uzh/prisma test:patch-namespace` and inspect the new generated declarations instead of weakening the exact-cardinality guard.
22+
2123
Provenance: steps 2 requires a database; on a machine without one running, write the schema change and STOP — hand the migration step to the user rather than faking a migration file.
2224

2325
## Rules that prevent real incidents

.agents/skills/klicker-testing-verification/SKILL.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Facts about the test landscape: [docs/testing.md](../../../docs/testing.md). Thi
1818

1919
Never run root `pnpm run test:run` blind — its turbo fan-out includes Cypress, which needs a running seeded stack.
2020

21-
Direct checks for `auth`, `chat`, `frontend-control`, `frontend-manage`, and `frontend-pwa` generate ignored Next route types first through each app's `check` script. Do not hand-edit or commit `next-env.d.ts`; keep it ignored and included by `tsconfig.json`. The three PWA apps use `tsconfig.check.json` to exclude `.next/dev/types` from raw `tsc`; otherwise stale dev and fresh production Pages Router validators duplicate global declarations.
21+
Direct checks for `auth`, `chat`, `frontend-control`, `frontend-manage`, and `frontend-pwa` generate ignored Next route types first through each app's `check` script. Do not hand-edit or commit `next-env.d.ts`; keep it ignored and included by `tsconfig.json`. The three PWA apps use `tsconfig.check.json` only for raw package checks so stale `.next/dev/types` cannot duplicate fresh Pages Router validators. Next builds use the canonical `tsconfig.json`; Next 16 filters development validators on its production typecheck path. Auth and Chat use their main config for both checks and builds.
2222

2323
For Next framework or bundler changes, verify both repository-supported paths. `pnpm run build:test` uses Turbopack in all five Next apps. `pnpm run build` uses Turbopack for auth/chat and Webpack for control/manage/PWA until their service-worker integration moves to Serwist. Confirm standalone server paths for all five apps and `sw.js`, Workbox, and custom worker outputs for the three PWA apps.
2424

@@ -36,12 +36,14 @@ CI runs Cypress (8-way split) and Playwright (8-way shard) on almost every code
3636

3737
Every item, in order; paste evidence (command + tail of output, screenshots) into the PR or task report:
3838

39-
1. `pnpm run check:all` — typecheck + format + lint + syncpack (same as pre-commit hook).
39+
1. `pnpm run check:all` — typecheck + format + lint + syncpack + AGENTS.md validation + Prisma-sync validation (same as pre-commit hook). The Prisma package check regenerates its client before typechecking, so it is safe from a clean checkout.
4040
2. `pnpm run build` — same as pre-push hook; also refreshes generated artifacts.
4141
3. Targeted tests per the routing table above — quote failures exactly; never delete/weaken a test to pass.
4242
4. **Codegen artifacts committed** if any `.graphql` op or schema changed (`git status` must be clean after `pnpm --filter @klicker-uzh/graphql generate`).
4343
5. **i18n pair check** if UI text changed: the key exists in BOTH `packages/i18n/messages/de.ts` and `en.ts`.
44-
6. **Browser evidence for UI changes** — open the changed pages with `npx agent-browser` (never bare `agent-browser`), log in with delegated/test credentials (AGENTS.md), capture before/after screenshots. "The logic looks correct" does not count.
44+
6. **Browser evidence for UI changes** — open the changed pages with `npx agent-browser@0.32.2` (never bare `agent-browser`), log in with delegated/test credentials (AGENTS.md), capture before/after screenshots. "The logic looks correct" does not count.
45+
46+
For TypeScript or other compiler/toolchain upgrades, root `check:all` includes the Cypress and Playwright compilers through their package `check` scripts. Also run `pnpm run build:test` and the Docs production build; those surfaces remain outside the root check. Use direct package `tsc --noEmit -p tsconfig.json` commands only to isolate a Cypress or Playwright failure. When a check config extends a declaration-emitting config, verify the resolved compiler options: `noEmit` does not disable declaration portability analysis, so the check may also need explicit `declaration: false` and `declarationMap: false`. Incremental checks must use a different `tsBuildInfoFile` from the emitting build.
4547

4648
## Reporting
4749

.syncpackrc.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ export default {
5555
packages: ['@klicker-uzh/office-addin'],
5656
isIgnored: true,
5757
},
58+
{
59+
// Office Add-in compiler/tooling is owned by a separate upgrade PR.
60+
label: 'Office Add-in TypeScript can differ from the workspace',
61+
dependencies: ['typescript'],
62+
packages: ['@klicker-uzh/office-addin'],
63+
isIgnored: true,
64+
},
5865
{
5966
// FIXME: update when consistent versions are possible (e.g., do other remark updates in apps)
6067
label: 'remark-math can be inconsistent between docs and apps',

apps/auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"tailwindcss": "~4.1.11",
4848
"tailwindcss-animate": "~1.0.7",
4949
"tw-animate-css": "~1.3.4",
50-
"typescript": "~5.6.3"
50+
"typescript": "~6.0.3"
5151
},
5252
"scripts": {
5353
"build": "next build --turbopack",

apps/auth/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"jsx": "react-jsx",
2222
"isolatedModules": true,
2323
// Path Mapping
24-
"baseUrl": ".",
2524
"paths": {
2625
"@/*": ["./src/*"]
2726
},

apps/backend-docker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"rollup": "~4.34.9",
6767
"source-map-support": "~0.5.21",
6868
"tsx": "~4.19.4",
69-
"typescript": "~5.6.3"
69+
"typescript": "~6.0.3"
7070
},
7171
"scripts": {
7272
"build": "cross-env NODE_ENV=production run-s --npm-path pnpm build:ts",
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": ["./src/**/*", "./scripts/**/*"],
4-
"exclude": ["./instrumented/**/*"]
4+
"exclude": ["./instrumented/**/*"],
5+
"compilerOptions": {
6+
"noEmit": true,
7+
"tsBuildInfoFile": "dist/tsconfig.check.tsbuildinfo"
8+
}
59
}

apps/backend-docker/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"include": ["./src/**/*", "./scripts/**/*", "./instrumented/**/*"],
33
"compilerOptions": {
4-
"baseUrl": ".",
54
/* Base Options: */
65
"esModuleInterop": true,
76
"skipLibCheck": true,
@@ -19,6 +18,7 @@
1918
"module": "NodeNext",
2019
"outDir": "dist",
2120
"sourceMap": true,
21+
"incremental": true,
2222
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
2323
/* If your code doesn't run in the DOM: */
2424
"lib": ["es2022"]

apps/chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"eslint": "~9.30.1",
6767
"eslint-config-next": "~16.2.10",
6868
"tailwindcss": "~4.1.11",
69-
"typescript": "~5.6.3",
69+
"typescript": "~6.0.3",
7070
"vitest": "~3.2.4"
7171
},
7272
"scripts": {

apps/chat/src/app/RuntimeProvider.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use client'
22

3+
import { useChatResponse } from '@/src/hooks/useChatResponse'
4+
import { useThreadManagement } from '@/src/hooks/useThreadManagement'
5+
import {
6+
useChatStore,
7+
type ExtendedThreadMessageLike,
8+
} from '@/src/stores/chatStore'
9+
import { useSettingsStore } from '@/src/stores/settingsStore'
310
import {
411
AssistantRuntimeProvider,
512
useExternalStoreRuntime,
613
type ThreadMessageLike,
714
} from '@assistant-ui/react'
815
import { useParams, useRouter, useSearchParams } from 'next/navigation'
916
import { useCallback, useEffect, useRef, useState } from 'react'
10-
import { useChatResponse } from 'src/hooks/useChatResponse'
11-
import { useThreadManagement } from 'src/hooks/useThreadManagement'
12-
import {
13-
useChatStore,
14-
type ExtendedThreadMessageLike,
15-
} from 'src/stores/chatStore'
16-
import { useSettingsStore } from 'src/stores/settingsStore'
1717
import { useChatUi } from '../components/chat-ui-context'
1818
import { imageAttachmentAdapter } from '../lib/attachments/imageAttachmentAdapter'
1919

0 commit comments

Comments
 (0)