Commit Graph
5 Commits
Author SHA1 Message Date
John O'Keefe d7d1495753 fix(types): clear web/src type and lint debt with real types
tsc --noEmit and oxlint web/src are now both clean; vp check passes.

- htmx: one canonical Htmx interface in shims.d.ts (ajax/process/trigger
  per the htmx 2.x API). alpine.ts had a second, conflicting Window.htmx
  declaration (TS2717) — removed; bookPicker/collections lose their
  (window as any) escapes now that Window.htmx is properly typed.
- tsconfig lib ES2020 -> ES2021 + DOM.Iterable: replaceAll exists
  (escapeHtml) and for..of over querySelectorAll results is legal.
  Type-checking only — vite emits at esnext regardless.
- custom-section-builder: selectedBooks holds identity fields only;
  typed as Pick<BookInfo, ...> instead of forcing partial API shapes.
  The API-critical BookInfo contract is untouched.
- toast: real bug found by the type system — setup.ts passes 'warning'
  but getToastConfig had no entry, so the warning toast threw TypeError
  at runtime instead of displaying. Added the type + config. Uses
  bg-yellow-500 (verified present in scanned templates => generated by
  Tailwind); the one intentional behavior change in this commit.
- book-detail: instanceof narrowing replaces an as-cast; unused
  AnnotationSource import removed.
- password_validation: explicit HTMLElement | null for the checklist
  list (querySelector('ul') infers HTMLUListElement, conflicting with
  the container-as-list branch).
- stats: tooltip parsed value typed via annotation (bar=scalar,
  line={x,y}); dead getActiveRange() removed (was already tree-shaken
  out of every bundle).
- library-switcher: onSwitch honestly typed void | Promise<void>
  (series.ts passes a sync navigator).
- 20 unused catch bindings converted to optional catch binding.

Verification: fresh build is byte-reproducible; every chunk is
identical to the pre-fix build except main.js (instanceof narrowing,
regex fix, stats refactor), reader.js (destructure), and the shared
storage chunk (renamed — carries toast.ts). reader/main diffs audited
hunk-by-hunk against the intended edits.
2026-10-21 14:17:02 -04:00
john-okeefe ba622bd391 build(typescript): update tsconfig for ES2020 module system
Configure TypeScript to use ES2020 modules with bundler resolution to work
properly with esbuild. Enable source maps for better debugging and update
module resolution strategy for the new build pipeline.

Changes:
- Set module to ES2020 (was "none")
- Add moduleResolution: "bundler" for esbuild compatibility
- Enable sourceMap: true for development debugging
- These changes align TypeScript compilation with the esbuild bundler setup
2026-03-06 20:18:09 -05:00
john-okeefe b6ce478fe3 chore(config): update TypeScript and Tailwind configuration
This commit updates project configuration files:

- tsconfig.json: Updated TypeScript compiler configuration with
  improved module resolution, strict type checking settings,
  and output directory configurations

- tailwind.config.ts: Updated Tailwind CSS configuration with
  custom theme colors, typography settings, and responsive
  design breakpoints for the application styling
2026-02-27 17:07:15 -05:00
john-okeefe 95d78158aa fix: configure TypeScript for non-module browser scripts
- Change module setting from 'ES2020' to 'none'
- Remove resolveJsonModule and moduleResolution options (incompatible with module: none)
- Prevents TypeScript from adding 'export {}' statements to compiled JS
- Scripts are loaded as regular JavaScript, not ES modules
- Fixes 'Unexpected token export' error in browser

This allows TypeScript type checking while generating plain JavaScript
that works with traditional script tags in HTML.
2026-01-29 14:52:43 -05:00
john-okeefe 548343b081 feat: add TypeScript and build configuration
- Add tsconfig.json with ES2020 target and strict mode
- Convert tailwind.config.js to TypeScript
- Update package.json with build scripts:
  - build:ts - Compile TypeScript
  - build:ts:watch - Watch mode for development
  - Updated paths for web/ directory structure
- Set up proper TypeScript compilation pipeline
2026-01-29 14:08:38 -05:00