wechaty / puppet-mock

Puppet Mocker for Wechaty (& A Puppet Template Starter)
https://paka.dev/npm/wechaty-puppet-mock
Apache License 2.0
46 stars 14 forks source link

make the repo to start #15

Closed lijiarui closed 4 years ago

lijiarui commented 5 years ago

In order to let more developers create puppet themselves, I suggest them to run mock bot first.

But I found this repo cannot run because a lot of packages is out of date and README lack a lot of intro of how to run the bot.

Also, when I npm install this package in another repo, it cannot run as expected, see #14

So I add did 3 kinds of things on this pr:

  1. update the related packages
  2. add intro in README
  3. add a demo to run the mock bot.

After this pr, it can run as expect:

➜  wechaty-puppet-mock git:(master) npm run start

> wechaty-puppet-mock@0.15.2 start /Users/jiaruili/git/rui/wechaty-puppet-mock
> ts-node example/starter-bot.ts

21:58:12 INFO Wechaty <Puppet#0<PuppetMock>()> start() v0.22.4 is starting...
Scan QR Code to login
User Contact<mock-name> logined
Message: Message#Text(🗣Contact<mock-name>👤Contact<mock-name>)<mock text>
Message: Message#Text(🗣Contact<mock-name>👤Contact<mock-name>)<mock text>
Message: Message#Text(🗣Contact<mock-name>👤Contact<mock-name>)<mock text>
Message: Message#Text(🗣Contact<mock-name>👤Contact<mock-name>)<mock text>
Message: Message#Text(🗣Contact<mock-name>👤Contact<mock-name>)<mock text>
Message: Message#Text(🗣Contact<mock-name>👤Contact<mock-name>)<mock text>
huan commented 5 years ago

This are some major issues in your PR that you need to pay attention to.

The most important part is: we must never put wechaty as a dependencies in any puppet implementations, like this repo(wechaty-puppet-mock), so does others(like wechaty-puppet-padchat).

That's because wechaty will load wechaty-puppet by default, and so does wechaty-puppet-mock. However, those two wechaty-puppet might be different version, and if so, it will definatelly cause problems, the system will crash.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

huan commented 4 years ago

House cleaning...