From bb3dfeb45926ee93b8a28238e9dec37749288136 Mon Sep 17 00:00:00 2001 From: Huan LI Date: Wed, 19 Apr 2017 17:08:12 +0800 Subject: [PATCH] update(module): add default export --- README.md | 2 +- bin/doctor.ts | 9 +++------ bin/io-client.ts | 4 ++-- bin/version.ts | 2 +- src/config.ts | 2 ++ src/doctor.ts | 2 ++ src/io-client.ts | 2 ++ src/io.ts | 2 ++ src/wechaty.ts | 2 ++ 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 23b92232..924053dc 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Wechaty is a Bot Framework for Wechat **Personal** Account which can help you cr # The World's Shortest ChatBot Code: 6 lines of JavaScript ```javascript -const { Wechaty } = require('wechaty') +const { Wechaty } = require('wechaty') // import Wechaty from 'wechaty' Wechaty.instance() // Singleton .on('scan', (url, code) => console.log(`Scan QR Code to login: ${code}\n${url}`)) diff --git a/bin/doctor.ts b/bin/doctor.ts index 40180efd..e50d30cb 100755 --- a/bin/doctor.ts +++ b/bin/doctor.ts @@ -9,12 +9,9 @@ import * as os from 'os' -import { - Config, -} from '../src/config' -import { Wechaty } from '../src/wechaty' - -import { Doctor } from '../src/doctor' +import Config from '../src/config' +import Doctor from '../src/doctor' +import Wechaty from '../src/wechaty' const wechaty = Wechaty.instance() const doctor = new Doctor() diff --git a/bin/io-client.ts b/bin/io-client.ts index ee201493..b83b635d 100755 --- a/bin/io-client.ts +++ b/bin/io-client.ts @@ -10,9 +10,9 @@ import { Config, log, -} from '../src/config' +} from '../src/config' -import { IoClient } from '../src/io-client' +import IoClient from '../src/io-client' const welcome = ` | __ __ _ _ diff --git a/bin/version.ts b/bin/version.ts index 46838b6a..be64c673 100755 --- a/bin/version.ts +++ b/bin/version.ts @@ -7,7 +7,7 @@ * */ -import { Wechaty } from '../src/wechaty' +import Wechaty from '../src/wechaty' const w = Wechaty.instance() console.log(w.version()) diff --git a/src/config.ts b/src/config.ts index e25123dc..e9401757 100644 --- a/src/config.ts +++ b/src/config.ts @@ -231,3 +231,5 @@ if (/verbose|silly/i.test(logLevel)) { }) }) } + +export default Config diff --git a/src/doctor.ts b/src/doctor.ts index 6634b2ee..b156a75b 100644 --- a/src/doctor.ts +++ b/src/doctor.ts @@ -77,3 +77,5 @@ export class Doctor { }) } } + +export default Doctor diff --git a/src/io-client.ts b/src/io-client.ts index 8d3cc544..7a197122 100644 --- a/src/io-client.ts +++ b/src/io-client.ts @@ -269,3 +269,5 @@ export class IoClient { } } + +export default IoClient diff --git a/src/io.ts b/src/io.ts index eac46ce9..0f014556 100644 --- a/src/io.ts +++ b/src/io.ts @@ -412,3 +412,5 @@ export class Io { } } + +export default Io diff --git a/src/wechaty.ts b/src/wechaty.ts index 0eba1787..ea8e43fb 100644 --- a/src/wechaty.ts +++ b/src/wechaty.ts @@ -475,3 +475,5 @@ export class Wechaty extends EventEmitter implements Sayable { }) } } + +export default Wechaty -- GitLab