Skip to content

Support wechaty-puppet 2.0.0-alpha.21 and release 0.1.2 - #22

Merged
thisnick merged 3 commits into
mainfrom
fix/wechaty-puppet-alpha21
Dec 3, 2026
Merged

thisnick merged 3 commits into
mainfrom
fix/wechaty-puppet-alpha21

Conversation

@thisnick

@thisnick thisnick commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

wechaty@next now installs wechaty-puppet 2.0.0-alpha.21. After #20 merged, main's clean-install package test failed against it on every platform (run), and Neo no longer compiled against alpha.21's types. This PR supports alpha.21 and releases 0.1.2.

Changes

Support alpha.21

  • alpha.21 declares every Puppet API method abstract. A new PuppetUnsupported base class implements the APIs Neo doesn't support yet with wechaty-puppet's own throwUnsupportedError. Calling one, such as messageSendFile from Wechaty's official Ding Dong example, now rejects with the unsupported-API error instead of TypeError: puppet.messageSendFile is not a function.
  • alpha.21 uses gerror 2, whose GError.from() no longer reads data from an error payload, so every Neo error reached error listeners as Unknown error (object). Neo now emits Error objects, which keep their message.
  • The base Puppet now clears the logged-in user on a timer tick after logout, not on the next setImmediate, so the two lifecycle tests wait for that tick.
  • In the alpha.21 dependency tree, TypeScript types only jsqr's .default as callable. Neo calls jsQR.default, which is the same function at runtime.
  • The peer dependency moves to ^2.0.0-alpha.21, and the lockfile resolves 2.0.0-alpha.21 (npm 11.21.2).

Release 0.1.2

  • Version 0.1.2 in package.json, package-lock.json, PuppetNeo.VERSION and the README's release example.
  • npm trusted publishing is configured on npmjs.com for wechaty/puppet-neo, workflow ci.yml, environment npm. The publish step no longer passes NPM_TOKEN, and the secret will be deleted before tagging, so v0.1.2 publishes through OIDC.

Testing

  • npm test on Node.js 26 (linux-x64, npm 11.21.2): build and typecheck pass, and 8 of 9 offline tests pass. The ninth loads the compiled addon, which wasn't built locally; CI builds it.
  • Live, before this PR: Wechaty 2.0.0-alpha.21 running its official ding-dong-bot.ts with Build on the Wechaty 2.0 Puppet #20's build logged in with the account nickname and replied dong to a direct ding. The example then crashed on its image reply (messageSendFile). This PR turns that into the unsupported-API error. The example still exits, because it has no error handling around msg.say().

🤖 Generated with Claude Code

thisnick and others added 3 commits December 2, 2026 17:02
wechaty@next now pulls wechaty-puppet 2.0.0-alpha.21, and main's clean-install
package test failed against it on every platform.

- alpha.21 declares every Puppet API method abstract. PuppetUnsupported
  implements the ones Neo doesn't support yet with the Puppet's own
  throwUnsupportedError, so calling one (for example messageSendFile from
  Wechaty's official Ding Dong example) rejects with the unsupported-API
  error instead of "is not a function".
- Its gerror 2 no longer reads `data` from an error payload, so every Neo
  error reached listeners as "Unknown error (object)". Neo now emits Error
  objects, which keep their message.
- The base Puppet now clears the logged-in user on a timer tick after
  logout, so the tests wait for that tick.
- Under the new dependency tree TypeScript types only jsqr's `.default` as
  callable; Neo calls that, which is the same function at runtime.
- The peer dependency and lockfile move to ^2.0.0-alpha.21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bumps the version to 0.1.2 (package.json, package-lock.json,
PuppetNeo.VERSION and the README's release example). The publish step no
longer passes NPM_TOKEN: npmjs.com now trusts ci.yml in the npm environment,
so the v0.1.2 tag publishes with OIDC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thisnick
thisnick merged commit 5ae20f1 into main Dec 3, 2026
9 checks passed
@thisnick
thisnick deleted the fix/wechaty-puppet-alpha21 branch December 3, 2026 01:28
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.

1 participant