Skip to content

Add a webjs typecheck command (tsc --noEmit wrapper) #265

Description

@vivek7405

Problem

webjs ships erasable TypeScript as a first-class authoring mode (tsconfig strict+noEmit+erasableSyntaxOnly, @webjsdev/ts-plugin) but there is no command to run the type checker. The runtime only catches strip-time failures (non-erasable syntax) with a 500; genuine type errors are never surfaced by any webjs command or in CI, and webjs check is correctness-only and explicitly does not type-check. So a webjs app has no first-party is-my-TypeScript-valid gate, and the scaffold ships no script to start from.

Design / approach

A thin command that shells out to the project's own tsc --noEmit and a scaffolded npm script. The framework runs the standard compiler, it does not embed one.

Web-standards fit: Delegates to the standard tsc the project already has; the command is a few lines of process spawning.

Prior art: Next.js runs tsc in next build; Remix wires a typecheck: tsc script into every scaffold.

Acceptance criteria

  • webjs typecheck runs tsc --noEmit over the app and exits non-zero on type errors
  • Scaffolded package.json includes a typecheck script wired to the command
  • It degrades gracefully with a clear message when typescript is not installed
  • Documented in the AGENTS.md CLI reference and the scaffold's CONVENTIONS.md test/CI section
  • Tests cover the new behaviour at the applicable layer(s)
  • Docs / AGENTS.md / CONVENTIONS.md updated if the public surface changed

Filed from the production-readiness audit (webjs vs Next.js / Remix / Rails / Turbo / Lit). Theme: dx-cli. Priority: P1. Kept to webjs identity: no-build, progressive enhancement, web-components-first, AI-first, batteries-included, close to web standards.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions