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

Packages do not specify an exports field #10832

Open
Tracked by #10833
jonkoops opened this issue Aug 3, 2024 · 2 comments
Open
Tracked by #10833

Packages do not specify an exports field #10832

jonkoops opened this issue Aug 3, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@jonkoops
Copy link
Contributor

jonkoops commented Aug 3, 2024

Packages in the workspaces should set the exports field in the package.json file. As Node.JS doesn't read the module field, the ESM output may be skipped if the exports field is not added.

Specifying the exports field also prevents modules that are written in ESM from being interpreted as CommmonJS. For example, it is currently possible to make the following import:

import foo from "@patternfly/react-drag-drop/dist/esm/next/components/DragDrop/DragButton"

Since there is no type specified this file would be considered CommonJS, even though the source is actually written in ESM.

The exports field supplants the main and module fields, which should be removed when the exports field is introduced. This would be considered a breaking change.

This is part of a series of issues resulting from publication linting introduced under #10764

Copy link

github-actions bot commented Jan 6, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@jonkoops
Copy link
Contributor Author

jonkoops commented Jan 6, 2025

@tlabaj can this issue be pinned?

@tlabaj tlabaj added Pinned and removed wontfix labels Jan 6, 2025
@thatblindgeye thatblindgeye moved this from In Progress to Ready to assign in PatternFly Issues Jan 13, 2025
@mfrances17 mfrances17 self-assigned this Jan 24, 2025
@mfrances17 mfrances17 moved this from Ready to assign to Not started in PatternFly Issues Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Not started
Development

No branches or pull requests

4 participants