Skip to content

dev-call build-artifacts fails when schema changes affect type definitions #13914

@cderv

Description

@cderv

When making schema changes that affect TypeScript type definitions, dev-call build-artifacts fails type checking before it can regenerate the types - a chicken-and-egg problem.

Example

Adding a new option to logo-light-dark-specifier in definitions.yml:

- id: logo-light-dark-specifier
  anyOf:
    - enum: [false]  # NEW
    - ref: logo-specifier

Then updating code to handle the new option:

if (spec === false) {
  return undefined;
}

Running build-artifacts fails:

TS2367 [ERROR]: This comparison appears to be unintentional because the types 
'string | objectOutputType<...>' and 'boolean' have no overlap.
  if (spec === false) {
      ~~~~~~~~~~~~~~

The types haven't been regenerated yet, so TypeScript doesn't know spec can be false.

Current workaround

Add // @ts-ignore temporarily, run build-artifacts, then remove the comment.

Suggestion

We could add a --no-check flag to dev-call build-artifacts that passes through to Deno, allowing type regeneration to proceed despite temporary type mismatches.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions