Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js): use export type for exports from schema.d.ts files #17392

Merged
merged 1 commit into from
Jun 6, 2023
Merged

fix(js): use export type for exports from schema.d.ts files #17392

merged 1 commit into from
Jun 6, 2023

Conversation

MageJohn
Copy link
Contributor

@MageJohn MageJohn commented Jun 2, 2023

Current Behavior

In the rollup and esbuild packages, types held in a schema.d.ts are being exported with export * from. This export is not removed when TypeScript transforms the file, likely because TypeScript can't be sure that an actual implementation won't be added separately. However, this results in some systems (such as our Jest setup) importing the schema.d.ts file and choking on the invalid syntax.

Expected Behavior

The types should be exported, but the export should not exist at runtime.

Related Issue(s)

Fixes #17391

A similar problem was brought up before in #12145, and that specific instance was fixed in #12403. In this PR I have fixed the remaining instances. I did a search for other .d.ts files that were being exported and this is all of them.

@MageJohn MageJohn requested a review from a team as a code owner June 2, 2023 17:01
@MageJohn MageJohn requested a review from jaysoo June 2, 2023 17:01
@vercel
Copy link

vercel bot commented Jun 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2023 4:41pm

packages/esbuild/index.ts Outdated Show resolved Hide resolved
packages/rollup/index.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! LGTM 🎉

@FrozenPandaz FrozenPandaz merged commit d26d0f4 into nrwl:master Jun 6, 2023
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@nx/rollup is exporting a schema.d.ts file, which breaks Jest
3 participants