From 18331b4e408bedd5037a8a51258cc92db49553dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=AE=87=E9=9D=96?= <545641826@qq.com> Date: Mon, 19 Jul 2021 10:05:49 -0400 Subject: [PATCH 1/2] Introduce the dotenv module; update package.json; --- .gitignore | 1 + bin/matrix-appservice-wechaty.ts | 2 ++ package.json | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4cf3f3f..c1ce237 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ t/ .DS_Store .idea +config.yaml diff --git a/bin/matrix-appservice-wechaty.ts b/bin/matrix-appservice-wechaty.ts index d56ae30..00402ea 100644 --- a/bin/matrix-appservice-wechaty.ts +++ b/bin/matrix-appservice-wechaty.ts @@ -6,7 +6,9 @@ import { log, VERSION, } from '../src/' +import dotenv from 'dotenv' +dotenv.config() async function main () { if (process.env.LOG_LEVEL) { log.level(process.env.LOG_LEVEL as any) diff --git a/package.json b/package.json index e2c624c..930a259 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "lint:es": "eslint --ignore-pattern tests/fixtures/ '{bin,src,tests}/**/*.ts' ", "lint:ts": "tsc --noEmit", "dev": "LOG_LEVEL=silly ts-node bin/matrix-appservice-wechaty.ts", + "dev:genarate-registration": "ts-node bin/matrix-appservice-wechaty.ts --config config.yaml --url http://localhost:8788 --generate-registration", + "dev:service": "ts-node bin/matrix-appservice-wechaty.ts --config config.yaml --file wechaty-registration.yaml", "dev:watch": "LOG_LEVEL=silly npx nodemon --watch '{bin,src,tests}/**/*.ts' --exec './node_modules/.bin/ts-node' bin/matrix-appservice-wechaty.ts", "pack": "npm pack", "sloc": "sloc bin scripts src tests --details --format cli-table --keys total,source,comment && sloc bin scripts src tests", @@ -40,10 +42,11 @@ "homepage": "https://github.com/huan/matrix-appservice-wechaty#readme", "dependencies": { "cuid": "^2.1.8", + "dotenv": "^10.0.0", "matrix-appservice-bridge": "^2.4.1", "read-pkg-up": "^7.0.1", "update-notifier": "^5.1.0", - "wechaty": "^0.62.2" + "wechaty": "^0.62.3" }, "devDependencies": { "@chatie/eslint-config": "^0.12.3", From ea138f1dd569bf23939fde22c40305a61660ce9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=AE=87=E9=9D=96?= <545641826@qq.com> Date: Mon, 19 Jul 2021 10:14:03 -0400 Subject: [PATCH 2/2] 0.8.29 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 930a259..d236196 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-appservice-wechaty", - "version": "0.8.28", + "version": "0.8.29", "description": "Matrix Application Services Bridge for Wechat", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts",