platform-api-docs: `scan` strategy misses ESM-only packages, which ship `.d.ts` rather than `.d.cts`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 packages/platform-api-docs/src/generate.ts 第 393 行附近开始,检查扫描 glob 及其去重行为。在匹配两种声明扩展名后运行一次全新的 yarn build;当两种扩展名都存在时,ESM-only 包能够被包含且不会生成重复文档,即表示完成。
由索引模型根据 Issue 内容生成。
描述
platform-api-docs's scan strategy reads published declaration files with this glob (generate.ts):
node_modules/@metamask/*/dist/**/*.d.cts
That only matches CommonJS declaration files. A package published ESM-only emits .d.ts, so it is skipped silently: no warning, it just contributes nothing to the docs.
Current impact: none
Worth stating plainly so this isn't over-prioritised. Measured on main with a fresh yarn build:
- 654
.d.ctsfiles still match, so the glob is not dead. - 112 of 150
@metamaskpackages with adistwould be missed (they ship only.d.ts). - 99 of those are workspace symlinks, already covered by the
packages/*/srcscan, and since #10085 source is preferred over build output anyway. - The remaining 13 are real npm dependencies:
abi-utils,action-utils,api-specs,browser-passworder,create-release-branch,eth-json-rpc-infura,eth-sig-util,metamask-eth-abis,nonce-tracker,object-multiplex,scure-bip39,snaps-registry,swappable-obj-proxy. - Zero of those 13 contain messenger types, so nothing is missing from the docs today.
Why file it anyway
The monorepo is migrating to ESM-only (#9536 did platform-api-docs itself). As published @metamask packages follow, their declaration files become .d.ts and this glob stops seeing them. The failure mode is a silent omission rather than an error, which is the part that makes it worth fixing before it bites.
Suggested fix
Match both extensions, e.g. **/*.d.cts and **/*.d.ts, keeping them in the same call so the exclusion scoping established in #10085 is preserved. Note that a package shipping both would then be matched twice, so it is worth checking that deduplication resolves that the way we want.
- 主要语言
- TypeScript
- 星标
- 414
- 派生
- 309
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 388
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetaMask/core 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
[utils] Replace the `uuid` dependency with `crypto.randomUUID()`可能已有人在做 @avantikonde 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
MetaMask/core#10210 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
eth-json-rpc-middleware: `TransactionParamsStruct` rejects numeric `chainId`, breaking dapp transactions可能已有人在做 @truehazker 于 48 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
[eth-block-tracker]: `json-rpc-engine` should be a production dependency可能已有人在做 @SnowingFox 于 62 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 83/100
维护者通常 1 天内回复
-
Feil lovtekst i bekreftelsen når leder melder unntak fra oppfølgingsplan可能已有人在做 @AudunSorheim 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
navikt/syfo-oppfolgingsplan-frontend#1110 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
db-ux-design-system/core-web#8461 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Cannot run an integration on windows when power shell is selected as the default profile terminal未关闭Priority/Blocker Type/Bug
难度 2/5 1-3 小时 新手友好度 76/100
wso2/product-integrator#2767 ·
维护者通常 1 天内回复