Skip to content

fix(web): get deno task check passing and add it to CI#79

Draft
andykais-claude wants to merge 4 commits into
mainfrom
cursor/web-typecheck-bc7e
Draft

fix(web): get deno task check passing and add it to CI#79
andykais-claude wants to merge 4 commits into
mainfrom
cursor/web-typecheck-bc7e

Conversation

@andykais-claude

@andykais-claude andykais-claude commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes deno task --cwd packages/web check (svelte-check) pass with 0 errors, 0 warnings, and adds it as a Typecheck step in Web CI so PRs get TypeScript coverage. Previous attempt: #51.

svelte-check passing with 0 errors

The problem & plan

svelte-check runs tsc, which cannot resolve Deno-style imports (@forager/core, @std/*, jsr:) or the Deno global. With everything unresolved, most types collapsed to any and errors were masked (139 reported). The plan was:

  1. Fix module/global resolution first — this is foundational and (expectedly) raises the error count as real types start resolving.
  2. Fix the genuine type errors that surface, working from foundational modules (runes, controllers, RPC spec) out to leaf components.
  3. Enable the check in CI.

Error trajectory: 139 (mostly-any, masked) → 242 (types resolving) → 0.

Key changes

Type-resolution infrastructure

  • Added real @std/* JSR types, zod, ts-pattern, and @types/deno to packages/web deps so tsc resolves Deno imports and the Deno global.
  • Added tsconfig.svelte.json mapping @forager/core/~/* to core source and re-declaring the SvelteKit $lib/$app aliases (TS does not merge paths across extends). Disabled verbatimModuleSyntax and added DOM.AsyncIterable so Deno-valid imports and async-iterable web streams type-check.
  • Declared App.Locals (forager, config); removed the unused kit.experimental.remoteFunctions.

Real type fixes (app code)

  • Modeled the media view runes as a discriminated union (media_file/media_series/grouped) with union-narrowing getters; fixed genuine bugs (undefined forager/media_response refs in MediaSeriesRune).
  • Exposed media/series/views as ts-rpc modules so InferSpec resolves the client type (previously every client.forager.* chain was never).
  • Narrowed MediaResponse before .media_file access in the file endpoint; corrected RPC route adapter typing, queryparams index/serialize typing, event/target typing in TagAutoCompleteInput, svelte use: action params, and misc component props/casts.
  • One small, runtime-noop core change: a documented cast in file_processor.ts for a TS DOM-lib TextDecoderStream/pipeThrough variance quirk (valid at runtime under Deno).

CI

  • Enabled the Typecheck (deno task check) step in .github/workflows/web.yml.

Verification

  • deno task --cwd packages/web check → 0 errors, 0 warnings, exit 0.
  • deno task --cwd packages/web build → succeeds.
  • deno check packages/core/src/lib/file_processor.ts → passes.
  • Core test suite: the only failures are the pre-existing floating-point/ffmpeg-precision cases documented in AGENTS.md (unrelated to this change).

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 4 commits July 8, 2026 03:15
- Add real @std/* JSR types, zod, ts-pattern and @types/deno to web deps
  so svelte-check can resolve Deno-style imports and the Deno global
- Add tsconfig.svelte.json mapping @forager/core and ~/* to core source
  while excluding the core package from the reported fileset
- Declare App.Locals (forager, config) in app.d.ts
- Remove unused kit.experimental.remoteFunctions from svelte.config.js
- Point check scripts at tsconfig.svelte.json

Co-authored-by: andykais-claude <andykais-claude@users.noreply.github.com>
- Re-declare SvelteKit $lib/$app path aliases in tsconfig.svelte.json
  (paths do not merge across extends)
- Disable verbatimModuleSyntax and add DOM.AsyncIterable in the check config
  so Deno-valid imports and async-iterable streams type-check
- Bridge TextDecoderStream/pipeThrough DOM lib variance in file_processor

Co-authored-by: andykais-claude <andykais-claude@users.noreply.github.com>
- Type the media view runes as a discriminated union (file/series/grouped)
  with union-narrowing getters, fixing MediaResponse member access
- Expose media/series/views as ts-rpc modules so InferSpec resolves the
  client type (fixes 'never' RPC call chains)
- Fix real bugs in MediaSeriesRune.load_detailed_view (undefined refs)
- Assorted fixes: settings setter casts, keybind actions, filmstrip config
  default, Header/SelectInput/StarInput props, hooks env casts

Co-authored-by: andykais-claude <andykais-claude@users.noreply.github.com>
…pecheck

- Type keybind listeners as the dispatched CustomEvent so detail access works
- Relax Tag display/encode contracts to structural/model tag types
- Fix svelte actions (focusable/scrollable) to accept their use: parameter
- Narrow media_type before media_file access in the media_file endpoint
- Correct RPC route adapter typing, queryparams index/serialize typing,
  TagAutoCompleteInput event/target typing, and misc component props
- Enable the web 'deno task check' typecheck step in Web CI

Co-authored-by: andykais-claude <andykais-claude@users.noreply.github.com>
@cursor cursor Bot changed the title fix(web): get deno task check passing for CI type safety fix(web): get deno task check passing and add it to CI Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants