diff --git a/AGENTS.md b/AGENTS.md index bad5345..b3fd1d5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -364,6 +364,7 @@ For a normal code change run the relevant focused tests plus: - `npm test` - `npm run build:api` - `npm run build:web` +- `npm run typecheck:scripts` - `npx tsc --noEmit -p tsconfig.next.json` Use a concise imperative commit message for each completed, verified work package. diff --git a/docs/current-architecture.md b/docs/current-architecture.md index a8d4be5..6c1bff3 100644 --- a/docs/current-architecture.md +++ b/docs/current-architecture.md @@ -252,6 +252,8 @@ Kopieren in ein Projekt erzeugt ein eigenständiges Projektgerät. - `npm run db:migrate` wendet Drizzle-Migrationen an. - `npm run db:verify:circuit-schema` prüft erforderliche und entfernte Spalten. - `npm run db:backup` erzeugt ein konsistentes und verifiziertes Online-Backup. +- `npm run typecheck:scripts` prüft alle TypeScript-Wartungs- und + Upgrade-Skripte mit ihren Anwendungspfaden, ohne Code zu erzeugen. - Angewendete Migrationen werden niemals nachträglich verändert. - `db:migrate:legacy-consumers` ist Upgrade-Werkzeug, kein Anwendungspfad. Der fachliche Migrationsdienst kennt nur schmale Reader-/Store-Ports unter diff --git a/docs/development-workflow.md b/docs/development-workflow.md index 5728a14..175891c 100644 --- a/docs/development-workflow.md +++ b/docs/development-workflow.md @@ -70,6 +70,7 @@ Beispiel `Preserve circuit blocks during filtering`. npm test npm run build:api npm run build:web +npm run typecheck:scripts npx tsc --noEmit -p tsconfig.next.json git diff --check ``` diff --git a/docs/spec/07-implementation-phases-todo.md b/docs/spec/07-implementation-phases-todo.md index 96fea8d..6bce04b 100644 --- a/docs/spec/07-implementation-phases-todo.md +++ b/docs/spec/07-implementation-phases-todo.md @@ -303,6 +303,8 @@ Acceptance criteria: ## Phase 11: Persistence and Transaction Foundation +Status: Complete. + Goal: Prepare the current SQLite implementation for persistent history and a later PostgreSQL adapter without changing user-facing behavior. @@ -358,6 +360,8 @@ Implemented foundation: - all general application repositories require an explicit database context; server composition owns their runtime instances and controllers contain no direct global SQLite access +- TypeScript maintenance and upgrade scripts have a dedicated no-emit + typecheck, including all referenced application modules - the legacy consumer UI and application read/write endpoints are removed after verified data cutover - retained legacy rows are accessible only through explicit database upgrade tooling - project devices no longer persist duplicate legacy power, phase, cosPhi or remark fields diff --git a/package.json b/package.json index 9b0851f..8583e15 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build": "npm run build:api", "build:api": "tsc -p tsconfig.json", "build:web": "next build", + "typecheck:scripts": "tsc --noEmit -p tsconfig.scripts.json", "start": "node dist/server/index.js", "test": "tsx --test tests/project-device-schema.test.ts tests/project-device-schema-migration.test.ts tests/project-device-placement.service.test.ts tests/project-device-sync.service.test.ts tests/legacy-consumer-migration-planner.test.ts tests/legacy-consumer-migration.service.test.ts tests/legacy-consumer-migration.repository.test.ts tests/circuit-numbering.service.test.ts tests/circuit-power-calculation.test.ts tests/circuit-tree.controller.test.ts tests/circuit-editor-history.test.ts tests/circuit-grid-insertion.test.ts tests/circuit-grid-safety.test.ts tests/circuit-grid-model.test.ts tests/circuit-structure-command.test.ts tests/circuit-device-row-move-command.test.ts tests/circuit-section-reorder-command.test.ts tests/circuit-section-renumber-command.test.ts tests/circuit-grid-projection.test.ts tests/distribution-board-structure-project-command.repository.test.ts tests/project-location-structure-project-command.repository.test.ts tests/project-device-project-command.repository.test.ts tests/project-device-structure-project-command.repository.test.ts tests/project-device-row-sync-project-command.repository.test.ts tests/circuit-section-reorder-project-command.repository.test.ts tests/circuit-section-renumber-project-command.repository.test.ts tests/project-command.model.test.ts tests/project-revision.persistence.test.ts tests/circuit-project-command.repository.test.ts tests/circuit-structure-project-command.repository.test.ts tests/circuit-device-row-project-command.repository.test.ts tests/circuit-device-row-structure-project-command.repository.test.ts tests/circuit-device-row-move-project-command.repository.test.ts tests/project-history.repository.test.ts tests/project-history-timeline.test.ts tests/project-version-history.test.ts tests/project-settings-project-command.repository.test.ts tests/project-state-snapshot.test.ts tests/project-snapshot-policy.test.ts tests/project-snapshot.repository.test.ts tests/project-state-restore-command.repository.test.ts tests/project-command.service.test.ts tests/database-backup.test.ts", "test:watch": "tsx --watch --test tests/project-device-schema.test.ts tests/project-device-schema-migration.test.ts tests/project-device-placement.service.test.ts tests/project-device-sync.service.test.ts tests/legacy-consumer-migration-planner.test.ts tests/legacy-consumer-migration.service.test.ts tests/legacy-consumer-migration.repository.test.ts tests/circuit-numbering.service.test.ts tests/circuit-power-calculation.test.ts tests/circuit-tree.controller.test.ts tests/circuit-editor-history.test.ts tests/circuit-grid-insertion.test.ts tests/circuit-grid-safety.test.ts tests/circuit-grid-model.test.ts tests/circuit-structure-command.test.ts tests/circuit-device-row-move-command.test.ts tests/circuit-section-reorder-command.test.ts tests/circuit-section-renumber-command.test.ts tests/circuit-grid-projection.test.ts tests/distribution-board-structure-project-command.repository.test.ts tests/project-location-structure-project-command.repository.test.ts tests/project-device-project-command.repository.test.ts tests/project-device-structure-project-command.repository.test.ts tests/project-device-row-sync-project-command.repository.test.ts tests/circuit-section-reorder-project-command.repository.test.ts tests/circuit-section-renumber-project-command.repository.test.ts tests/project-command.model.test.ts tests/project-revision.persistence.test.ts tests/circuit-project-command.repository.test.ts tests/circuit-structure-project-command.repository.test.ts tests/circuit-device-row-project-command.repository.test.ts tests/circuit-device-row-structure-project-command.repository.test.ts tests/circuit-device-row-move-project-command.repository.test.ts tests/project-history.repository.test.ts tests/project-history-timeline.test.ts tests/project-version-history.test.ts tests/project-settings-project-command.repository.test.ts tests/project-state-snapshot.test.ts tests/project-snapshot-policy.test.ts tests/project-snapshot.repository.test.ts tests/project-state-restore-command.repository.test.ts tests/project-command.service.test.ts tests/database-backup.test.ts", diff --git a/tsconfig.scripts.json b/tsconfig.scripts.json new file mode 100644 index 0000000..ea4c56f --- /dev/null +++ b/tsconfig.scripts.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "rootDir": "." + }, + "include": ["scripts/**/*.ts", "src/**/*.ts"], + "exclude": ["node_modules", "dist"] +}