patternfly / patternfly/patternfly-react

Packages do not specify an `exports` field

未关闭
#10,832 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Breaking change :boom: Pinned
主要语言
TypeScript
星标
862
派生
392
平均合并
4 天 8 小时
30 天内合并 PR
9

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

检查 workspace 中的 package.json 文件以及 #10764 中的发布 linting 上下文。为各个包添加 exports 条目,在适用的情况下移除已被取代的 main 和 module 字段,并验证 Node.js 能正确解析文档中说明的 ESM 导入。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js
领域
build-system, release
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。