diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 1544979..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: 2 -updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "21:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: "@chatie/tsconfig" - versions: - - 0.14.1 diff --git a/.gitignore b/.gitignore index 83f73f2..4b6b476 100644 --- a/.gitignore +++ b/.gitignore @@ -76,4 +76,5 @@ examples/.pki log /*.jpg .env +.env.* data/ diff --git a/README.md b/README.md index 919dc33..134cf89 100644 --- a/README.md +++ b/README.md @@ -236,9 +236,11 @@ Learn more about Wechaty Puppet from our documentation at [Wechaty Puppet](https ## History -### master v0.13 +### master v1.0 (Oct 30, 2021) -1. Enable ESM (ES Module) support ([chatie/tsconfig#16](https://github.com/Chatie/tsconfig/issues/16)) +Release v1.0 of Wechaty. + +1. v0.13: Enable ESM (ES Module) support ([chatie/tsconfig#16](https://github.com/Chatie/tsconfig/issues/16)) ### v0.8 (Feb 20, 2021) diff --git a/examples/ding-dong-bot.js b/examples/ding-dong-bot.js index 13c3398..f2761ec 100644 --- a/examples/ding-dong-bot.js +++ b/examples/ding-dong-bot.js @@ -2,14 +2,14 @@ * Wechaty - Conversational RPA SDK for Chatbot Makers. * - https://github.com/wechaty/wechaty */ -import { - Wechaty, + import 'dotenv/config.js' + + import { + WechatyBuilder, ScanStatus, log, -} from 'wechaty' - +} from 'wechaty' import qrcodeTerminal from 'qrcode-terminal' -import 'dotenv/config.js' function onScan (qrcode, status) { if (status === ScanStatus.Waiting || status === ScanStatus.Timeout) { @@ -43,7 +43,7 @@ async function onMessage (msg) { } } -const bot = new Wechaty({ +const bot = WechatyBuilder.build({ name: 'ding-dong-bot', /** * How to set Wechaty Puppet Provider: diff --git a/examples/ding-dong-bot.ts b/examples/ding-dong-bot.ts index f308c00..935480d 100644 --- a/examples/ding-dong-bot.ts +++ b/examples/ding-dong-bot.ts @@ -3,20 +3,20 @@ * Wechaty - Conversational RPA SDK for Chatbot Makers. * - https://github.com/wechaty/wechaty */ +// https://stackoverflow.com/a/42817956/1123955 +// https://github.com/motdotla/dotenv/issues/89#issuecomment-587753552 +import 'dotenv/config.js' + import { Contact, Message, ScanStatus, - Wechaty, + WechatyBuilder, log, } from 'wechaty' import qrcodeTerminal from 'qrcode-terminal' -// https://stackoverflow.com/a/42817956/1123955 -// https://github.com/motdotla/dotenv/issues/89#issuecomment-587753552 -import 'dotenv/config.js' - function onLogout (user: Contact) { log.info('StarterBot', '%s logout', user) } @@ -48,7 +48,7 @@ async function onMessage (msg: Message) { } } -const bot = new Wechaty({ +const bot = WechatyBuilder.build({ name: 'ding-dong-bot', /** * How to set Wechaty Puppet Provider: diff --git a/examples/tutorials/google-cloud-shell-tutorial.md b/examples/tutorials/google-cloud-shell-tutorial.md index 101ac58..52f2694 100644 --- a/examples/tutorials/google-cloud-shell-tutorial.md +++ b/examples/tutorials/google-cloud-shell-tutorial.md @@ -37,14 +37,22 @@ Continue on to the **Next** step to start setting up your chatbot. ## Setting up developing environments 1. Install [Node.js](https://nodejs.org) v16+ -1. Git clone [wechaty-getting-started](https://github.com/wechaty/getting-started) repo +1. Git clone [wechaty/getting-started](https://github.com/wechaty/getting-started) repo 1. Install system dependency packages ### 1. Install Node.js -Node.js has been pre-installed in Google Cloud Shell already. +Node.js has been pre-installed in Google Cloud Shell. -### 2. Git clone `wechaty-getting-started` repo +However, we need to upgrade Node.js to version 16+ + +```sh +nvm install 16 +``` + +You should get a `v16.13.0` output by running command `node --version` + +### 2. Git clone `wechaty/getting-started` repo Git Repo has been already cloned in Google Cloud Shell already. diff --git a/package.json b/package.json index 67d6f52..eeb1e74 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "wechaty-getting-started", - "version": "0.13.20", + "version": "1.0.1", "description": "Wechaty conversational SDK getting start template & examples", "type": "module", "engines": { - "node": ">=16" + "node": ">=16", + "npm": ">=7" }, "scripts": { "lint": "eslint \"examples/*.ts\" \"tests/*.ts\"", @@ -15,7 +16,7 @@ "start:wechat:padlocal": "cross-env WECHATY_LOG=verbose WECHATY_PUPPET=wechaty-puppet-padlocal npm start", "start:whatsapp:web": "cross-env WECHATY_LOG=verbose WECHATY_PUPPET=wechaty-puppet-whatsapp npm start", "test": "npm-run-all lint test:version test:smoke", - "test:smoke": "tap --node-arg=--loader=ts-node/esm --node-arg=--no-warnings \"tests/**/*.spec.ts\"", + "test:smoke": "cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"tests/**/*.spec.ts\"", "test:version": "check-node-version --node \">= 16\"" }, "repository": { @@ -32,25 +33,20 @@ "dependencies": { "dotenv": "^10.0.0", "qrcode-terminal": "^0.12.0", - "wechaty": "^0.73.8", - "wechaty-plugin-contrib": "^0.14.23", - "wechaty-puppet-mock": "^0.31.3", - "wechaty-puppet-oicq": "^0.1.6", - "wechaty-puppet-padlocal": "^0.4.2", - "wechaty-puppet-wechat": "^0.30.1", - "wechaty-puppet-wechat4u": "^0.19.3", - "wechaty-puppet-whatsapp": "^0.3.3", - "wechaty-puppet-xp": "^0.7.2" + "wechaty": "^1.0.4", + "wechaty-plugin-contrib": "^1.0.13", + "wechaty-puppet-oicq": "^1.0.0", + "wechaty-puppet-wechat": "^1.0.1", + "wechaty-puppet-wechat4u": "^1.0.1", + "wechaty-puppet-whatsapp": "^1.0.1" }, "devDependencies": { - "@chatie/eslint-config": "^0.14.1", + "@chatie/eslint-config": "^1.0.4", "@chatie/git-scripts": "^0.6.2", - "@chatie/tsconfig": "^0.20.2", + "@chatie/tsconfig": "^1.0.2", "check-node-version": "^4.1.0", - "cross-env": "^7.0.3", "is-pr": "^2.0.0", - "npm-run-all": "^4.1.5", - "tstest": "^0.7.2" + "wechaty-puppet-mock": "^1.0.2" }, "git": { "scripts": {