-
Notifications
You must be signed in to change notification settings - Fork 87
Fix/module error #177
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
Fix/module error #177
Conversation
WalkthroughThis pull request introduces patches for two packages. In the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🔇 Additional comments (8)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3143571 to
bf761ab
Compare
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 (1)
common/changes/@coze/realtime-api/fix-module-error_2025-04-01-06-28.json (1)
1-12: JSON Metadata: Remove Extraneous Trailing Line
The JSON metadata correctly documents the patch for moving theEventNamesenum to a separate file. However, it appears that the literal "12" at the end (line 12) is an extraneous artifact that should be removed to ensure the file remains valid JSON.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
common/changes/@coze/api/fix-module-error_2025-04-01-05-22.json(1 hunks)common/changes/@coze/realtime-api/fix-module-error_2025-04-01-06-28.json(1 hunks)packages/coze-js/package.json(2 hunks)packages/realtime-api/src/client.ts(1 hunks)packages/realtime-api/src/event-handler.ts(1 hunks)packages/realtime-api/src/event-names.ts(1 hunks)packages/realtime-api/src/index.ts(1 hunks)packages/realtime-api/test/client.spec.ts(1 hunks)packages/realtime-api/test/event-handler.spec.ts(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
packages/realtime-api/src/event-names.ts (1)
packages/realtime-api/src/index.ts (1)
EventNames(366-366)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Node.js v20 (ubuntu-latest)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (11)
packages/coze-js/package.json (4)
3-3: Version Update to Beta:The version has been updated to
"1.1.1-beta.1", reflecting the pre-release status. Make sure that downstream users and your changelog/documentation clearly indicate that this is a beta release.
91-91: ESM Main Export Path Update:The main export
"import"path has been changed to use the.mjsextension ("./dist/esm/index.mjs"). This update ensures compliance with the ESM specification. Confirm that your build outputs the corresponding.mjsfiles.
96-96: WS-Tools Export Path Update:The export path for
"./ws-tools"now uses the.mjsextension ("./dist/esm/ws-tools/index.mjs"), which aligns with the rest of the module's changes. This looks consistent—just verify that the build pipeline handles these files correctly.
101-101: Module Field Update in Publish Config:The
"module"field within thecozePublishConfighas been updated to"dist/esm/index.mjs", ensuring it adheres to the ESM convention. This change is essential for module resolution in environments supporting ESM.common/changes/@coze/api/fix-module-error_2025-04-01-05-22.json (1)
1-12: ESM Extension Patch Documentation:This JSON file correctly documents the patch for the
@coze/apipackage by noting the update of ECMAScript Module (ESM) file extensions from.jsto.mjs. The metadata (package name, comment, type, and email) appears complete. Ensure internal documentation references this file for clear traceability of the change.packages/realtime-api/test/client.spec.ts (1)
5-7: Import Path Update forEventNames
The import forEventNameshas been updated from the old path to../src/event-namesto reflect the module restructuring. This change promotes consistency across the codebase and aligns with the new file organization.packages/realtime-api/src/index.ts (1)
8-11: Updated Import forEventNames
The import statement forEventNamesnow correctly references./event-namesinstead of the older location. This update is clear and consistent with the recent refactor.packages/realtime-api/src/client.ts (1)
14-16: Consistent Import Update in Client Module
The update on lines 15–16 adjusts the import ofEventNamesto./event-names, ensuring that the client module references the enum from its new location. The change is straightforward and correctly implemented.packages/realtime-api/test/event-handler.spec.ts (1)
1-2: Refined Imports in Event Handler Tests
The test file now importsEventNamesfrom the new path (../src/event-names), and the ordering withRealtimeEventHandlerhas been updated accordingly. This ensures that the tests remain aligned with the recent module reorganization.packages/realtime-api/src/event-names.ts (1)
1-142: Well-organized extraction of EventNames enumThe creation of a dedicated file for the EventNames enum is a good refactoring practice that improves code organization by following the single responsibility principle. The enum is comprehensive, well-documented with bilingual comments, and follows consistent naming conventions.
packages/realtime-api/src/event-handler.ts (1)
1-1: Import path correctly updated for EventNames enumThe import statement has been properly updated to reference the EventNames enum from its new location in the dedicated event-names.ts file. This maintains all functionality while improving code organization.
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## main #177 +/- ##
==========================================
- Coverage 91.82% 90.58% -1.25%
==========================================
Files 117 77 -40
Lines 5469 3760 -1709
Branches 1106 685 -421
==========================================
- Hits 5022 3406 -1616
+ Misses 447 351 -96
- Partials 0 3 +3
... and 71 files with indirect coverage changes 🚀 New features to boost your workflow:
|
f9c5153 to
a64f1c8
Compare
Summary by CodeRabbit
Chores
@coze/realtime-apipackage to a new beta version.Refactor
event-namessubpath in the@coze/realtime-apipackage.@coze/apiand@coze/realtime-apipackages.