Skip to content

20 more vite-plugin-dts packages still print a type error and exit 0 — the shared fail-on-error factory is wired into only packages/layout #5483

Description

@os-support-ai

Found while implementing #5370 (PR #5482). Unassigned, no label — severity is PM's call.

What #5370 left standing

PR #5482 adds scripts/vite-dts-fail-on-type-errors.ts and spreads it into
packages/layout/vite.config.ts, so that package's vite build now exits non-zero when the
declaration step reports type errors. That PR's declared file surface was the shared config plus
packages/layout, so the other call sites were deliberately left alone. #5370 remains open for
this reason.

Measured, on 478ec54ce

22 packages build their typings through vite-plugin-dts. Each was built with
pnpm --filter PACKAGE build after one deliberate TS2322 was appended to its entry file, and
the exit code read from ${PIPESTATUS[0]}:

  • 20 exit 0 with the error printed in the log: components, plugin-ai, plugin-calendar,
    plugin-charts, plugin-chatbot, plugin-dashboard, plugin-designer, plugin-detail,
    plugin-editor, plugin-form, plugin-gantt, plugin-grid, plugin-kanban, plugin-list,
    plugin-map, plugin-markdown, plugin-report, plugin-timeline, plugin-tree,
    plugin-view.
  • fields exits 2, but not through the dts leg — its build script is
    tsc && vite build && node scripts/build-css.mjs, so the leading tsc fails first.
  • layout exits 1, via the factory PR fix(build): make dts type errors fail the build instead of exiting 0 #5482 wires in.

All 22 reported the injected diagnostic, so none of the zeros is the vacuous kind where a
package's dts program never looked at its own src.

Blast radius of finishing the job: measured zero

The same 22 packages were also built unmodified on 478ec54ce: 22/22 exit 0 with zero
TypeScript diagnostics of any category in the log. Wiring the remaining 20 therefore turns
nothing that is green today red.

Suggested disposition

  1. Spread createDtsFailOnTypeErrors({ packageDir: __dirname }) into the remaining 20
    vite.config.ts files — one line and one import each, the form pinned by
    packages/layout/vite.config.ts.
  2. Consider a gate that keeps them wired, so a new vite-plugin-dts package cannot land
    unwired. Without it this is a state someone has to remember, which is how the current spread
    of 1-of-22 came to exist in the first place. A ratchet over every vite.config.ts that calls
    dts( is the obvious shape.
  3. fields can either keep its tsc && prefix or move to the shared factory; if it keeps it,
    that is worth one comment at the build script, because it reads as redundant next to the
    others once they are wired.

Worth scheduling next to #5439 rather than after it: that card wires the OTHER shared dts module
(scripts/vite-dts-explicit-extensions.ts) into a very similar set of vite.config.ts files, so
the two together are one edit per file instead of two rounds of conflict on the same 20 configs.
The defects themselves are unrelated — #5439 is about extensionless specifiers in the emitted
typings, this one is about the exit code.

References


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopm:queue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions