fix(service): webpack-chain should be dependencies of @tarojs/service#18709
fix(service): webpack-chain should be dependencies of @tarojs/service#18709Amour1688 wants to merge 1 commit intoNervJS:mainfrom
webpack-chain should be dependencies of @tarojs/service#18709Conversation
…es of `@tarojs/service`
概览调整 变更
预期代码审查工作量🎯 1 (简单) | ⏱️ ~3 分钟 推荐审查人
诗文
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
packages/taro-service/package.json
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。
Applied to files:
packages/taro-service/package.json
📚 Learning: 2025-11-21T07:15:22.634Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18646
File: packages/taro/package.json:40-40
Timestamp: 2025-11-21T07:15:22.634Z
Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。
Applied to files:
packages/taro-service/package.json
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.
Applied to files:
packages/taro-service/package.json
📚 Learning: 2025-05-25T18:02:31.387Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Applied to files:
packages/taro-service/package.json
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。
Applied to files:
packages/taro-service/package.json
🔇 Additional comments (2)
packages/taro-service/package.json (2)
44-44: 确认webpack-chain正确位于 dependencies 中
webpack-chain位于 dependencies 中是正确的,这符合 PR 的目标——确保外部使用者可以获取webpack-chain的类型定义。由于@tarojs/service的公共 API 可能会暴露webpack-chain的类型,将其作为 dependencies 而非 devDependencies 是必要的。
36-36:@tarojs/taro仅被用于类型定义,应放在devDependencies而非dependencies中
AppConfig是从@tarojs/taro导入的接口(纯类型定义),仅在packages/taro-service/src/utils/types.ts:146的类型注解中使用:modifyAppConfig: (fn: (args: { appConfig: AppConfig }) => void) => void。由于 TypeScript 在编译时会擦除类型信息,@tarojs/taro不会包含在运行时代码中,应当作为devDependency。建议改为import type { AppConfig } from '@tarojs/taro'以进一步明确意图。⛔ Skipped due to learnings
Learnt from: ianzone Repo: NervJS/taro PR: 18150 File: packages/taro-platform-harmony-hybrid/package.json:43-45 Timestamp: 2025-09-05T18:40:45.775Z Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。Learnt from: ianzone Repo: NervJS/taro PR: 18646 File: packages/taro/package.json:40-40 Timestamp: 2025-11-21T07:15:22.634Z Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。Learnt from: ianzone Repo: NervJS/taro PR: 18146 File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14 Timestamp: 2025-08-08T02:32:58.265Z Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。Learnt from: ianzone Repo: NervJS/taro PR: 17746 File: packages/taro-runtime/tsdown.config.ts:10-16 Timestamp: 2025-05-25T18:02:31.387Z Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。Learnt from: ianzone Repo: NervJS/taro PR: 18649 File: packages/taroize/src/wxml.ts:731-731 Timestamp: 2025-11-24T08:49:07.365Z Learning: 在 packages/taroize/src/wxml.ts 中,prettier.format() 返回值的 `as string` 类型断言是必要的,因为需要将结果重新赋值给类型为 `string | undefined` 的变量,而 prettier.format() 的返回类型可能是 `string | Promise<string>`,TypeScript 无法自动收窄类型。Learnt from: ianzone Repo: NervJS/taro PR: 18150 File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356 Timestamp: 2025-08-25T22:16:50.118Z Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.Learnt from: ianzone Repo: NervJS/taro PR: 18578 File: .github/workflows/nodejs.yml:191-191 Timestamp: 2025-11-06T11:19:51.376Z Learning: 在 Taro 项目的 pnpm workspace 中,`pnpm install` 在仓库根目录执行时会自动递归安装所有 workspace 包的依赖并链接本地包(因为 pnpm 的 recursiveInstall 默认为 true),因此 `pnpm install` 和 `pnpm -r install` 在根目录是等效的。
Single-Dancer
left a comment
There was a problem hiding this comment.
直接挪到Dependency里不太合适,加peerDependency合理些
为什么是 peerDependency,依赖 |
这个 PR 做了什么? (简要描述所做更改)
修复外部使用
@tarojs/service获取不到 webpack-chain 类型的问题这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit
发布说明
✏️ Tip: You can customize this high-level summary in your review settings.