Skip to content

Build on the Wechaty 2.0 Puppet - #20

Merged
thisnick merged 1 commit into
mainfrom
upgrade/wechaty-puppet-2
Dec 2, 2026
Merged

thisnick merged 1 commit into
mainfrom
upgrade/wechaty-puppet-2

Conversation

@huan

@huan huan commented Nov 24, 2026

Copy link
Copy Markdown
Member

Neo now targets the Wechaty 2.0 Puppet: wechaty-puppet 2.0.0-alpha.19 is on npm's next tag together with the rest of Wechaty 2.0 (wechaty/wechaty#3091).

Why

The peer dependency was pinned to exactly wechaty-puppet@1.20.2. So npm install wechaty@next wechaty-puppet-neo failed 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 resolves 2.0.0-alpha.19, updated with npm 11.21.2 like CI.
  • examples/ding-dong-bot.ts: Wechaty 2.0 turns the type enums into as const maps without reverse mapping. The example therefore prints the scan status with helpers.typeName(types.ScanStatus, status) instead of types.ScanStatus[status]; that was the only type error.
  • README.md: one sentence saying that Neo needs wechaty-puppet 2.0 and how Wechaty 2.0 loads it.

src/ needs no change: PuppetNeo already builds and runs against the 2.0 Puppet. The version stays 0.1.1; the next release PR can bump it.

Verified locally (linux-arm64, Node.js 26)

  • Baseline on main: npm run build:native, npm test (9 tests) and npm run test:package pass. The package test needs npm 11: with npm 12, npm pack --json no longer returns an array, so scripts/test-package.mjs fails before testing anything.
  • This branch: npm run build, npm run typecheck, npm test (9/9), and npm run test:package with npm 11.21.2 (9/9) all pass.
  • With Wechaty 2.0: in a fresh project, npm install wechaty@next ./wechaty-puppet-neo-0.1.1.tgz succeeds without --legacy-peer-deps, with one deduplicated wechaty-puppet@2.0.0-alpha.19. Then WechatyBuilder.build({ puppet: 'wechaty-puppet-neo' }) followed by init() loads PuppetNeo as a 2.0 Puppet. That's init() only, with no QR login.
  • Not tested: a live login. The protocol code is unchanged.

🤖 Generated with Claude Code

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>
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 02:39
@cursor

cursor Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Dependency and example/doc updates only; core puppet implementation is unchanged and reportedly already compatible with the 2.0 Puppet API.

Overview
Neo now declares wechaty-puppet ^2.0.0-alpha.19 (lockfile at 2.0.0-alpha.19) so it installs cleanly with Wechaty 2.0 without --legacy-peer-deps. Package version stays 0.1.1; only peer deps, lockfile, docs, and the example are touched—no src/ changes.

The ding-dong example logs scan status with helpers.typeName(types.ScanStatus, status) because Wechaty 2.0’s as const enums no longer support types.ScanStatus[status].

README adds one sentence on needing wechaty-puppet@next and loading Neo via WECHATY_PUPPET=wechaty-puppet-neo.

Reviewed by Cursor Bugbot for commit 2cde393. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T02:40:00.083004Z 2cde393 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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-puppet peer range and locked version to 2.0.0-alpha.19.
  • Uses helpers.typeName to 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)

@huan
huan requested a review from thisnick November 24, 2026 02:41
@thisnick
thisnick merged commit 4e8059f into main Dec 2, 2026
15 checks passed
@thisnick
thisnick deleted the upgrade/wechaty-puppet-2 branch December 2, 2026 23:43
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.

4 participants