patternfly / patternfly/patternfly-react
Packages do not specify an `exports` field
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 862
- Fork
- 392
- Merge medio
- 4g 8h
- PR unite (30g)
- 9
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Esamina i file package.json del workspace e il contesto del linting della pubblicazione di #10764. Aggiungi voci exports per i pacchetti, rimuovi i campi main e module superati dove applicabile e verifica che l’import ESM documentato venga risolto correttamente da Node.js.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- node.js
- Ambito
- build-system, release
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100