hubot 10.0.3 → 10.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bin/hubot +2 -8
- package/index.js +27 -36
- package/package.json +1 -2
- package/src/robot.js +2 -6
- package/es2015.js +0 -31
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
# Hubot
|
|
8
8
|
|
|
9
|
+
**Please note that in v11, CoffeeScript support was removed.**
|
|
10
|
+
|
|
9
11
|
Hubot is a framework to build chat bots, modeled after GitHub's Campfire bot of the same name, hubot.
|
|
10
12
|
He's pretty cool. He's [extendable with scripts](https://hubotio.github.io/hubot/docs#scripts) and can work
|
|
11
13
|
on [many different chat services](https://hubotio.github.io/hubot/adapters.html).
|
package/bin/hubot
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
# we left the `bin/hubot` file to remain in CoffeeScript in order prevent
|
|
5
|
-
# breaking existing 3rd party adapters of which some are still written in
|
|
6
|
-
# CoffeeScript themselves. We will deprecate and eventually remove this file
|
|
7
|
-
# in a future version of hubot
|
|
8
|
-
|
|
9
|
-
require './hubot.js'
|
|
3
|
+
require('./hubot.js')
|
package/index.js
CHANGED
|
@@ -1,40 +1,31 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
require('coffeescript/register')
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
for (const key in instance) {
|
|
32
|
-
this[key] = instance[key]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return instance
|
|
3
|
+
const User = require('./src/user')
|
|
4
|
+
const Brain = require('./src/brain')
|
|
5
|
+
const Robot = require('./src/robot')
|
|
6
|
+
const Adapter = require('./src/adapter')
|
|
7
|
+
const Response = require('./src/response')
|
|
8
|
+
const Listener = require('./src/listener')
|
|
9
|
+
const Message = require('./src/message')
|
|
10
|
+
const DataStore = require('./src/datastore')
|
|
11
|
+
|
|
12
|
+
module.exports = {
|
|
13
|
+
User,
|
|
14
|
+
Brain,
|
|
15
|
+
Robot,
|
|
16
|
+
Adapter,
|
|
17
|
+
Response,
|
|
18
|
+
Listener: Listener.Listener,
|
|
19
|
+
TextListener: Listener.TextListener,
|
|
20
|
+
Message: Message.Message,
|
|
21
|
+
TextMessage: Message.TextMessage,
|
|
22
|
+
EnterMessage: Message.EnterMessage,
|
|
23
|
+
LeaveMessage: Message.LeaveMessage,
|
|
24
|
+
TopicMessage: Message.TopicMessage,
|
|
25
|
+
CatchAllMessage: Message.CatchAllMessage,
|
|
26
|
+
DataStore: DataStore.DataStore,
|
|
27
|
+
DataStoreUnavailable: DataStore.DataStoreUnavailable,
|
|
28
|
+
loadBot (adapter, enableHttpd, name, alias) {
|
|
29
|
+
return new module.exports.Robot(adapter, enableHttpd, name, alias)
|
|
36
30
|
}
|
|
37
|
-
inherits(CoffeeScriptCompatibleClass, klass)
|
|
38
|
-
|
|
39
|
-
return CoffeeScriptCompatibleClass
|
|
40
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hubot",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.4",
|
|
4
4
|
"author": "hubot",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"url": "https://github.com/hubotio/hubot.git"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"coffeescript": "^2.7.0",
|
|
19
18
|
"connect-multiparty": "^2.2.0",
|
|
20
19
|
"express": "^4.18.2",
|
|
21
20
|
"express-basic-auth": "^1.2.1",
|
package/src/robot.js
CHANGED
|
@@ -328,10 +328,6 @@ class Robot {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
async loadcoffee (filePath) {
|
|
332
|
-
return await this.loadjs(filePath)
|
|
333
|
-
}
|
|
334
|
-
|
|
335
331
|
async loadjs (filePath) {
|
|
336
332
|
const script = require(filePath)
|
|
337
333
|
if (typeof script === 'function') {
|
|
@@ -352,7 +348,7 @@ class Robot {
|
|
|
352
348
|
const full = path.join(filepath, path.basename(filename))
|
|
353
349
|
|
|
354
350
|
// see https://github.com/hubotio/hubot/issues/1355
|
|
355
|
-
if (['js', 'mjs'
|
|
351
|
+
if (['js', 'mjs'].indexOf(ext) === -1) {
|
|
356
352
|
this.logger.debug(`Skipping unsupported file type ${full}`)
|
|
357
353
|
return
|
|
358
354
|
}
|
|
@@ -480,7 +476,7 @@ class Robot {
|
|
|
480
476
|
try {
|
|
481
477
|
if (Array.from(HUBOT_DEFAULT_ADAPTERS).indexOf(this.adapterName) > -1) {
|
|
482
478
|
this.adapter = this.requireAdapterFrom(path.resolve(path.join(__dirname, 'adapters', this.adapterName)))
|
|
483
|
-
} else if (['.js', '.cjs'
|
|
479
|
+
} else if (['.js', '.cjs'].includes(ext)) {
|
|
484
480
|
this.adapter = this.requireAdapterFrom(path.resolve(adapterPath))
|
|
485
481
|
} else if (['.mjs'].includes(ext)) {
|
|
486
482
|
this.adapter = await this.importAdapterFrom(pathToFileURL(path.resolve(adapterPath)).href)
|
package/es2015.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const User = require('./src/user')
|
|
4
|
-
const Brain = require('./src/brain')
|
|
5
|
-
const Robot = require('./src/robot')
|
|
6
|
-
const Adapter = require('./src/adapter')
|
|
7
|
-
const Response = require('./src/response')
|
|
8
|
-
const Listener = require('./src/listener')
|
|
9
|
-
const Message = require('./src/message')
|
|
10
|
-
const DataStore = require('./src/datastore')
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
User,
|
|
14
|
-
Brain,
|
|
15
|
-
Robot,
|
|
16
|
-
Adapter,
|
|
17
|
-
Response,
|
|
18
|
-
Listener: Listener.Listener,
|
|
19
|
-
TextListener: Listener.TextListener,
|
|
20
|
-
Message: Message.Message,
|
|
21
|
-
TextMessage: Message.TextMessage,
|
|
22
|
-
EnterMessage: Message.EnterMessage,
|
|
23
|
-
LeaveMessage: Message.LeaveMessage,
|
|
24
|
-
TopicMessage: Message.TopicMessage,
|
|
25
|
-
CatchAllMessage: Message.CatchAllMessage,
|
|
26
|
-
DataStore: DataStore.DataStore,
|
|
27
|
-
DataStoreUnavailable: DataStore.DataStoreUnavailable,
|
|
28
|
-
loadBot (adapter, enableHttpd, name, alias) {
|
|
29
|
-
return new module.exports.Robot(adapter, enableHttpd, name, alias)
|
|
30
|
-
}
|
|
31
|
-
}
|