Skip to content

chore(dx): add package.json#type for npm package releases #38

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

Merged
merged 3 commits into from
Mar 26, 2025

Conversation

li-yechao
Copy link
Collaborator

@li-yechao li-yechao commented Mar 26, 2025

Related Issue

Major Changes

  1. chore(mdoule): add a package.json and set type to module/commonjs in dist folder

Checklist

None

Summary by CodeRabbit

  • New Feature: Added package.json files to distribution folders for both CJS and ESM formats. This ensures Node.js correctly interprets the module format, enhancing compatibility and module resolution.

Copy link

github-actions bot commented Mar 26, 2025

Image description CodeRabbit

## 概述
The changes ensure Node.js correctly interprets module formats by adding `package.json` files with appropriate `type` settings to distribution folders.

## 变更

| Files                                                                 | Summary                                                                                                                      |
|-----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| `packages/agent-library/scripts/after-build.js`, `packages/core/scripts/after-build.js` | Added `package.json` files to distribution folders, setting `type` to "commonjs" for CJS and "module" for ESM directories.   |

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between b228d22 and 616f4cc commits.
Files selected (2)
  • packages/agent-library/scripts/after-build.js (1)
  • packages/core/scripts/after-build.js (1)
Files ignored due to filter (2)
  • packages/agent-library/package.json
  • packages/core/package.json
Review comments generated (3)
  • Review: 3
  • LGTM: 0

提示

Image description CodeRabbit 机器人 (@coderabbitai) 聊天

  • 回复此机器人留下的审查评论以提出后续问题。审查评论是对差异或文件的评论。
  • 通过在回复中标记 @coderabbitai 邀请机器人加入审查评论链。

代码建议

  • 机器人可能会提出代码建议,但在提交前请仔细审查它们,因为行号范围可能会不对齐。
  • 你可以编辑机器人做出的评论,并在建议稍有偏差时手动调整。

暂停增量审查

  • 在 PR 描述中的任何位置添加 @coderabbitai: ignore 以暂停机器人的进一步审查。

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@li-yechao li-yechao requested a review from wangshijun March 26, 2025 03:49
@wangshijun wangshijun changed the title chore(mdoule): add a package.json and set type to module/commonjs in dist folder chore(dx): add package.json#type for npm package releases Mar 26, 2025
wangshijun
wangshijun previously approved these changes Mar 26, 2025
@li-yechao li-yechao merged commit 02c2c07 into main Mar 26, 2025
4 checks passed
@li-yechao li-yechao deleted the fix/module branch March 26, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants