patternfly / patternfly/patternfly-react
Packages do not specify an `exports` field
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 862
- Forks
- 392
- Ø Merge
- 4 T. 8 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Prüfe die package.json-Dateien des Workspace und den Kontext der Publikations-Linting-Regeln aus #10764. Füge für die Pakete Exports-Einträge hinzu, entferne gegebenenfalls die überholten Felder main und module und verifiziere, dass der dokumentierte ESM-Import von Node.js korrekt aufgelöst wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- node.js
- Bereich
- build-system, release
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100