Skip to content

fix(scaffold-core): generated project typechecks clean out of the box#248

Merged
stackbilt-admin merged 1 commit into
mainfrom
fix/scaffold-typecheck-clean
Jul 5, 2026
Merged

fix(scaffold-core): generated project typechecks clean out of the box#248
stackbilt-admin merged 1 commit into
mainfrom
fix/scaffold-typecheck-clean

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Follow-through on #247 / stackbilt-web#151. Production-testing the 1.8.0 candidate end-to-end (generate → npm install → tsc --noEmit, the exact visitor path) surfaced three residual template defects that still broke a downloaded project's typecheck:

  1. tsconfig missing lib — tsc injects lib.dom by default, which collides with @cloudflare/workers-types globals (~40 declaration-conflict errors). Now pins lib: ["ES2022"] + skipLibCheck: true, matching the materializer's renderTsConfig (the two templates had drifted).
  2. HttpError.status: number — Hono's c.json(body, status) requires ContentfulStatusCode; the generated app.onError failed typecheck. Now typed as ContentfulStatusCode.
  3. .json<T>().catch(() => ({})) — widens the body union to {} and breaks property access under strict. Catch fallbacks now typed {} as T (4 route templates).

Verified: both a URL-shortener and a realtime-chat intention now generate projects that install, typecheck, and pass their generated tests from a cold download. Regression guards added to output-quality.test.ts (108 scaffold-core tests pass; 850 repo-wide).

Gate for the scaffold-core 1.8.0 npm publish — this completes the production-test requirement.

🤖 Generated with Claude Code

… pin, ContentfulStatusCode, typed body catch

E2E production test (generate -> npm install -> tsc --noEmit) on the merged
1.8.0 candidate caught three residual template defects:

- generated tsconfig omitted "lib", so tsc injected lib.dom which collides
  with @cloudflare/workers-types globals; pin lib: ["ES2022"] + skipLibCheck,
  matching the materializer's renderTsConfig
- HttpError.status was number; Hono's c.json(body, status) requires
  ContentfulStatusCode, so the generated app.onError failed typecheck
- route templates' .json<T>().catch(() => ({})) widened the body union to {},
  breaking property access under strict

Both representative archetypes now install + typecheck + run generated tests
clean from a cold download. Regression guards in output-quality.test.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@stackbilt-admin stackbilt-admin merged commit 149e17a into main Jul 5, 2026
5 checks passed
@stackbilt-admin stackbilt-admin deleted the fix/scaffold-typecheck-clean branch July 5, 2026 07:37
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