Skip to content

feat(ts): typecheck requires a tsconfig and type-checks Deno code - #33

Merged
CMaintz merged 1 commit into
mainfrom
feat/ts-typecheck-coverage
Sep 29, 2026
Merged

CMaintz merged 1 commit into
mainfrom
feat/ts-typecheck-coverage

Conversation

@CMaintz

@CMaintz CMaintz commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Summary

Foundry v2 does not make sure a TypeScript project's typecheck actually covers its TypeScript. It also has no answer for Deno code. tech-atlas hit both:

Changes

  • mise/ts.toml typecheck
    • Fails with a clear message when tsconfig.json is missing. (Plain tsc -b already fails, but only with a cryptic TS5083.) The guard is documented to stay when a framework checker replaces tsc -b, since that is where the silent pass happens.
    • Runs deno check $FOUNDRY_DENO_PATHS when that is set, with deno pinned in [tools]. Both are shown commented out in the template.
    • If git tracks Deno code (supabase/functions/*.ts, deno.json[c]) and FOUNDRY_DENO_PATHS is unset, the verb fails instead of leaving that code unchecked.
  • presets/typecheck/tsconfig.json (new): strict and check-only (noEmit). Its include covers src, scripts, tests and root *.ts, with notes on extending a framework's strict preset and on keeping Deno code out.
  • foundry-init.sh copies the preset for the ts stack (never clobbering an existing file) and prints a note when supabase/functions exists.
  • README / FEATURES: preset row and behaviour.

These are additive. A consumer that copied the old template is unaffected until it re-syncs. The gate.yml facade needs no change: mise-action installs deno from [tools], and the verb runs as before.

Verification

I ran the new typecheck script (extracted from mise/ts.toml, Git Bash) in a scratch repo:

Case Result
tsconfig present, tracked supabase/functions/f/index.ts, FOUNDRY_DENO_PATHS unset exit 1, message names the file
same, FOUNDRY_DENO_PATHS=supabase/functions Check supabase/functions/f/index.ts, exit 0
no tsconfig exit 1, message points at the preset
no Deno code exit 0

The preset with a type error in src/ makes tsc -b exit 1, and exit 0 once the error is fixed.

Not changed here: tsc -b writes tsconfig.tsbuildinfo even with noEmit. That was already the template's behaviour; consumers may want it in .gitignore.

Found adopting v2 in tech-atlas: its typecheck was `astro check` with no tsconfig, which
exits 0 after checking only .astro files with loose defaults, so src/lib, tests and
scripts were never type-checked. That hid 124 errors. Its Supabase Edge Functions
(Deno) were not type-checked by anything.

- mise/ts.toml `typecheck` fails with a clear message when there is no tsconfig.json.
  The guard stays when a framework checker (astro check, vue-tsc) replaces `tsc -b`.
- It runs `deno check $FOUNDRY_DENO_PATHS` when that is set (deno pinned in
  [tools]). If git tracks Deno code (supabase/functions/*.ts, deno.json[c]) and the
  variable is unset, the verb fails instead of silently skipping it.
- presets/typecheck/tsconfig.json: a strict, check-only tsconfig covering src,
  scripts and tests, with notes on extending a framework preset and keeping Deno
  code out. foundry-init copies it for the ts stack (never clobbering) and flags
  supabase/functions.
- README and FEATURES list the preset and the behaviour.
@CMaintz
CMaintz merged commit e28f777 into main Sep 29, 2026
4 checks passed
@CMaintz
CMaintz deleted the feat/ts-typecheck-coverage branch September 30, 2026 12:25
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.

1 participant