-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(core): 修复依赖ESM-ONLY版本导致CJS项目报错问题 #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughPinned the ast-kit dependency version in packages/core/package.json from ^2.1.2 to 1.4.3, narrowing the acceptable version range. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/core/package.json (2)
64-64: Use a semver range (<2) instead of an exact pin.Pinning to "1.4.3" prevents receiving safe 1.x fixes. Prefer allowing 1.x while excluding ESM-only 2.x.
Option A (preferred, simpler):
- "ast-kit": "1.4.3", + "ast-kit": "^1.4.3",Option B (explicit ceiling):
- "ast-kit": "1.4.3", + "ast-kit": ">=1.4.3 <2",
64-64: Guard transitive deps from pulling in ast-kit v2.Add a workspace-level override to force <2 across the tree. Put this in the repo root package.json.
Example (outside this file):
{ "overrides": { "ast-kit": "1.x" } }For pnpm, use pnpm.overrides if that’s your convention.
📜 Review details
Configuration used: CodeRabbit 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/core/package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test (windows-latest, 20)
🔇 Additional comments (1)
packages/core/package.json (1)
64-64: Add a CJS smoke test to CI (build + require CJS entry)CI should install, build, and require packages/core/dist/index.cjs so the job fails fast if an ESM-only dep (e.g. ast-kit v2+) is introduced.
# CI / local smoke check pnpm install --frozen-lockfile pnpm -w -r build node -e "require('./packages/core/dist/index.cjs'); console.log('CJS OK')" pnpm why ast-kit # verify resolved version is <2Sandbox verification here failed: rimraf not found / node_modules missing — run the above in CI or locally and paste the output.
Description 描述
ast-kit v2+ 都是esm only,会导致uni cjs项目报错
Linked Issues 关联的 Issues
Additional context 额外上下文
Summary by CodeRabbit