chore: bump baileys to 7.0.0-rc10 + tsx 4.21 with whatsapp-rust-bridge patch#2531
Closed
DavidsonGomes wants to merge 1 commit intodevelopfrom
Closed
chore: bump baileys to 7.0.0-rc10 + tsx 4.21 with whatsapp-rust-bridge patch#2531DavidsonGomes wants to merge 1 commit intodevelopfrom
DavidsonGomes wants to merge 1 commit intodevelopfrom
Conversation
…whatsapp-rust-bridge@0.5.3
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates Baileys and tsx versions and switches lockfile management to pnpm, adding a pnpm patch for whatsapp-rust-bridge so it can be resolved correctly in this CJS-based project. Sequence diagram for dev server startup with patched whatsapp_rust_bridge resolutionsequenceDiagram
actor Dev
participant NpmScript as npm_run_dev_server
participant Tsx as tsx_loader
participant Node as node_cjs_loader
participant Pnpm as pnpm_with_patch
participant Baileys as baileys_7_0_0_rc10
participant Bridge as whatsapp_rust_bridge_0_5_3
Dev->>NpmScript: run dev:server
NpmScript->>Tsx: start tsx with entrypoint
Tsx->>Node: resolve baileys
Node->>Pnpm: locate baileys_7_0_0_rc10
Pnpm-->>Node: baileys package.json
Node->>Baileys: load baileys
Baileys->>Node: requires whatsapp_rust_bridge
Node->>Pnpm: resolve whatsapp_rust_bridge_0_5_3
Pnpm-->>Bridge: apply pnpm patch (add exports main require default)
Pnpm-->>Node: patched package.json
Node->>Bridge: load CJS entry via exports.require/default
Bridge-->>Baileys: initialized bridge bindings
Baileys-->>Tsx: baileys initialized
Tsx-->>Dev: dev server running and connected to WhatsApp
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Member
Author
|
Reabrindo com nome de branch correto refletindo o bump do baileys. |
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Now that the patch is handled via pnpm’s
patchedDependencies, consider removing thepatch-packagedevDependency if it’s no longer used anywhere else in the repo to avoid confusion.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that the patch is handled via pnpm’s `patchedDependencies`, consider removing the `patch-package` devDependency if it’s no longer used anywhere else in the repo to avoid confusion.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
baileysfrom7.0.0-rc.9to7.0.0-rc10andtsxfrom^4.20.5to^4.21.0.whatsapp-rust-bridge@0.5.3that addsmain,require, anddefaultto theexportsfield so the package can be resolved from CJS projects (this repo has no"type": "module").package-lock.json, addspnpm-workspace.yamlso the patch is picked up).Why
Running
npm run dev:serverondevelopwas failing with:The bridge (a transitive dependency pulled in by baileys rc10) only declares
exports.import+exports.types, with norequire/default. Because evolution-api is a CJS project, both Node and tsx resolve through the CJS loader and fail.The patch adds the missing fields without changing runtime behavior — the same
dist/index.jsis served for every condition.Test plan
pnpm installapplies the patch cleanlypnpm run dev:serverboots the API on port 8080 and connects to WhatsAppNotes for reviewers
exportsfield is missingdefault.Summary by Sourcery
Update WhatsApp integration dependencies and adopt pnpm-based patching for a transitive bridge package.
Bug Fixes:
Enhancements:
Build: