Revert implicit-any typing and convert src/ JavaScript to TypeScript #8

Merged
ngu-git-admin merged 2 commits from types/ts-conversion into main 2026-09-26 22:12:39 +01:00

Reverts the implicit-any typing from #3 and converts the frontend's JavaScript modules to TypeScript, letting types come from inference instead of hand-written declarations.

Revert (5cedc68)

  • Drops the .d.ts files beside the JS modules and the annotations threaded through src/ for noImplicitAny; tsconfig turns noImplicitAny off.
  • Keeps the two runtime fixes from that commit: organization website/email pills get an href and label, and the chapter map falls back to FALLBACK_COLOR for an uncoloured region instead of painting black.

Conversion (22d5328)

  • Renames all 13 src/**/*.js modules to .ts (api, useResource, adminSchema, navConfig, adminNav, src/data/*) and updates imports, comments, CLAUDE.md and the seed script's module paths.
  • strict stays on. Remaining errors get the lightest fix: any on empty state/contexts/list defaults, : any on components with optional or spread props, class fields on ApiError.
  • Real types kept where they belong to modules that were already TypeScript and later features import them: PageShell's ShellSection, useContent's corrected record types and EventListItem, and TimelineRef.orgKind.

Notes

  • server/src/seed.js now imports src/data/*.ts, which needs Node >= 23.6 (native type stripping). The server's engines still says >= 22.
  • The seed destructures GROUPS/SPLITS/CHAPTERS from chapters, which no longer exports them. That predates this branch and is untouched here.

Verification

  • pnpm exec tsc: clean
  • pnpm build: passes
  • Not exercised in a browser.

🤖 Generated with Claude Code

Reverts the implicit-any typing from #3 and converts the frontend's JavaScript modules to TypeScript, letting types come from inference instead of hand-written declarations. ## Revert (5cedc68) - Drops the `.d.ts` files beside the JS modules and the annotations threaded through `src/` for `noImplicitAny`; `tsconfig` turns `noImplicitAny` off. - Keeps the two runtime fixes from that commit: organization website/email pills get an href and label, and the chapter map falls back to `FALLBACK_COLOR` for an uncoloured region instead of painting black. ## Conversion (22d5328) - Renames all 13 `src/**/*.js` modules to `.ts` (api, useResource, adminSchema, navConfig, adminNav, src/data/*) and updates imports, comments, CLAUDE.md and the seed script's module paths. - `strict` stays on. Remaining errors get the lightest fix: `any` on empty state/contexts/list defaults, `: any` on components with optional or spread props, class fields on `ApiError`. - Real types kept where they belong to modules that were already TypeScript and later features import them: `PageShell`'s `ShellSection`, `useContent`'s corrected record types and `EventListItem`, and `TimelineRef.orgKind`. ## Notes - `server/src/seed.js` now imports `src/data/*.ts`, which needs Node >= 23.6 (native type stripping). The server's `engines` still says >= 22. - The seed destructures `GROUPS`/`SPLITS`/`CHAPTERS` from `chapters`, which no longer exports them. That predates this branch and is untouched here. ## Verification - `pnpm exec tsc`: clean - `pnpm build`: passes - Not exercised in a browser. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ngu-git-admin added 2 commits 2026-09-26 22:08:31 +01:00
Reverts 2428f44. The .d.ts files beside the JS modules and the
annotations threaded through src/ to satisfy noImplicitAny go;
tsconfig turns noImplicitAny off instead. The JS modules become
TypeScript in the next commit, so their types come from inference.

Kept from that commit, since they're runtime fixes rather than types:
- OrganizationDetail's website and email pills get an href and label
  (they arrive as bare strings, not link objects).
- The chapter map falls back to FALLBACK_COLOR for a region with no
  colour instead of painting its tiles black.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renames every .js module under src/ to .ts (api, useResource,
adminSchema, navConfig, adminNav and src/data/*) and points imports,
comments and the seed script's module paths at the new names. Their
types now come from inference; no .d.ts files and no shape
interfaces.

tsc stays strict (noImplicitAny off). The errors inference leaves
behind get the lightest fix that clears them: `any` on empty state,
contexts and list defaults, `: any` on components with optional or
spread props, class fields on ApiError, and option shapes on
get/useResource.

Kept as real types, since they belong to modules that were already
TypeScript and later features import them: PageShell's ShellSection
and props, useContent's corrected record types (website/email/
instagram are bare strings) and EventListItem, and TimelineRef's
orgKind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngu-git-admin merged commit cbf440bed9 into main 2026-09-26 22:12:39 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ngu-git-admin/NGU-Web#8
No description provided.