fix: workaround for unexpected ajv of bun install #804
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
降级
@microsoft/api-extractor
到7.43.7
以绕过使用 bun install 时,底层依赖拿到错误的 ajv 版本导致 father 报错的问题该问题和 bun 的依赖提升行为有关系,

ajv-draft-04
是@rushstack/node-core-library@5.0.0
才引入的方式,该方式同时声明ajv-draft-04
+ajv
,其中ajv-draft-04
使用peerDependencies
声明了需要的ajv
版本但 bun 却将它提升到了 node_modules 顶层导致拿到错误版本的ajv
进而报错,使用 pnpm 则无此问题:现场链接:https://github.com/react-component/motion/actions/runs/13254919898/job/37000056389?pr=62
为什么降级到
7.43.7
可以解?因为依赖关系是@microsoft/api-extractor@7.43.7
->@rushstack/node-core-library@4.3.0
,连带降级了@rushstack/node-core-library
则不会引入ajv-draft-04
。需要注意的是,后续升级 TypeScript 到更高版本时必定会匹配更高版本的
@microsoft/api-extractor
,那么该绕过方案将会失效 cc @Jinbao1001