You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is important that we can see at a glance all of the exports that a package has (both JavaScript and TypeScript exports) and that we can also easily spot changes to the exports in PRs.
Currently for some packages we have an index.test.ts which tells us which JavaScript exports that package has. However, we don't have similar tests for TypeScript exports, so we don't have visibility into those at all. Also, we only tend to write tests for the primary export (.) but if we decide to add custom subpath exports for packages in the future we'd have to remember to add tests for those.
It would be good if we had a way to automatically find all of the exports for a package, taking subpath exports into consideration, and then assert the correct list, all in one go.
Having better tests around exports means that we would no longer need to enforce that packages use explicit exports; they could go back to using export * instead. (See #5224 for the PR that prompted this ticket.)
Acceptance Criteria
Each package has a file exports.test.ts which asserts all JavaScript and TypeScript exports for that package, for all defined paths in the package manifest's exports field.
Under the hood this uses a custom matcher and function which iterates through the defined exports in that package's manifest and discovers all of the exports which that package has.
The text was updated successfully, but these errors were encountered:
It is important that we can see at a glance all of the exports that a package has (both JavaScript and TypeScript exports) and that we can also easily spot changes to the exports in PRs.
Currently for some packages we have an
index.test.ts
which tells us which JavaScript exports that package has. However, we don't have similar tests for TypeScript exports, so we don't have visibility into those at all. Also, we only tend to write tests for the primary export (.
) but if we decide to add custom subpath exports for packages in the future we'd have to remember to add tests for those.It would be good if we had a way to automatically find all of the exports for a package, taking subpath exports into consideration, and then assert the correct list, all in one go.
Having better tests around exports means that we would no longer need to enforce that packages use explicit exports; they could go back to using
export *
instead. (See #5224 for the PR that prompted this ticket.)Acceptance Criteria
exports.test.ts
which asserts all JavaScript and TypeScript exports for that package, for all defined paths in the package manifest'sexports
field.exports
in that package's manifest and discovers all of the exports which that package has.The text was updated successfully, but these errors were encountered: