Repository navigation
Build on the Wechaty 2.0 Puppet - #20
Conversation
wechaty-puppet 2.0.0-alpha.19 is on npm's next tag with the rest of Wechaty 2.0 (wechaty/wechaty#3091). Neo pinned its peer to exactly wechaty-puppet 1.20.2, so npm refused to install Neo next to Wechaty 2.0 (ERESOLVE), and the Wechaty Docker image had to install Neo with --legacy-peer-deps. The peer is now ^2.0.0-alpha.19. The Puppet itself needs no change: it already loads as a 2.0 Puppet. Wechaty 2.0 turns the type enums into `as const` maps without reverse mapping, so the example prints the scan status with helpers.typeName(types.ScanStatus, status) instead of types.ScanStatus[status]. The README says which wechaty-puppet Neo needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR SummaryLow Risk Overview The ding-dong example logs scan status with README adds one sentence on needing Reviewed by Cursor Bugbot for commit 2cde393. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approved
No active review issues require resolution for the Wechaty 2.0 compatibility update.
No open issues 🎉
What changed in this PR
Updates Neo to target Wechaty 2.0, removing the peer-dependency conflict when installing it alongside Wechaty 2.0 without changing the Puppet adapter.
Changes:
- Updates the
wechaty-puppetpeer range and locked version to 2.0.0-alpha.19. - Uses
helpers.typeNameto display scan statuses with Wechaty 2.0’s constant maps. - Documents the required peer dependency and Wechaty loading configuration.
| File | Description |
|---|---|
| README.md | Documents Wechaty 2.0 compatibility, installation, and loading. |
| package.json | Changes the Puppet peer dependency to ^2.0.0-alpha.19. |
| package-lock.json | Locks Puppet 2.0.0-alpha.19 and updates its dependency metadata. |
| examples/ding-dong-bot.ts | Replaces enum reverse lookup with helpers.typeName. |
Review effort: Balanced (adaptive)
Neo now targets the Wechaty 2.0 Puppet:
wechaty-puppet2.0.0-alpha.19 is on npm'snexttag together with the rest of Wechaty 2.0 (wechaty/wechaty#3091).Why
The peer dependency was pinned to exactly
wechaty-puppet@1.20.2. Sonpm install wechaty@next wechaty-puppet-neofailed with ERESOLVE, and the Wechaty 2.0 Docker image had to install Neo with--legacy-peer-deps(wechaty/wechaty#3090).Changes
peerDependencies:"wechaty-puppet": "^2.0.0-alpha.19". The lockfile resolves2.0.0-alpha.19, updated with npm 11.21.2 like CI.examples/ding-dong-bot.ts: Wechaty 2.0 turns the type enums intoas constmaps without reverse mapping. The example therefore prints the scan status withhelpers.typeName(types.ScanStatus, status)instead oftypes.ScanStatus[status]; that was the only type error.README.md: one sentence saying that Neo needswechaty-puppet2.0 and how Wechaty 2.0 loads it.src/needs no change:PuppetNeoalready builds and runs against the 2.0Puppet. The version stays 0.1.1; the next release PR can bump it.Verified locally (linux-arm64, Node.js 26)
main:npm run build:native,npm test(9 tests) andnpm run test:packagepass. The package test needs npm 11: with npm 12,npm pack --jsonno longer returns an array, soscripts/test-package.mjsfails before testing anything.npm run build,npm run typecheck,npm test(9/9), andnpm run test:packagewith npm 11.21.2 (9/9) all pass.npm install wechaty@next ./wechaty-puppet-neo-0.1.1.tgzsucceeds without--legacy-peer-deps, with one deduplicatedwechaty-puppet@2.0.0-alpha.19. ThenWechatyBuilder.build({ puppet: 'wechaty-puppet-neo' })followed byinit()loadsPuppetNeoas a 2.0Puppet. That'sinit()only, with no QR login.🤖 Generated with Claude Code