Skip to content

Check exported types API #1059

@franky47

Description

@franky47

We use vitest-package-exports to check the stability of exported runtime symbols, which is neat, but we could extend the concept to checking what types the API exposes, to make sure they are both stable and invariant (ie: detect additions, suppressions, or modifications of exported types).

This is particularly helpful as some files (eg: parsers.ts) barrel-expose everything exported within the file.

What this would look like is unknown, but could be:

  • Comparing against a snapshot of the bundled .d.ts (might break often due to chunks changing hash when the runtime content changes)
  • Bundling a single-file .d.ts that is stable enough to be used in a snapshot comparison
  • Some other unknown libraries.

This would likely be better to be contributed back into antfu/vitest-package-exports#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededinternalInternal issues & discussions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions