Comparing version 10.0.4 to 10.0.5
61
index.js
'use strict' | ||
require('coffeescript/register') | ||
const User = require('./src/user') | ||
const Brain = require('./src/brain') | ||
const Robot = require('./src/robot') | ||
const Adapter = require('./src/adapter') | ||
const Response = require('./src/response') | ||
const Listener = require('./src/listener') | ||
const Message = require('./src/message') | ||
const DataStore = require('./src/datastore') | ||
const inherits = require('util').inherits | ||
module.exports = { | ||
User, | ||
Brain, | ||
Robot, | ||
Adapter, | ||
Response, | ||
Listener: Listener.Listener, | ||
TextListener: Listener.TextListener, | ||
Message: Message.Message, | ||
TextMessage: Message.TextMessage, | ||
EnterMessage: Message.EnterMessage, | ||
LeaveMessage: Message.LeaveMessage, | ||
TopicMessage: Message.TopicMessage, | ||
CatchAllMessage: Message.CatchAllMessage, | ||
DataStore: DataStore.DataStore, | ||
DataStoreUnavailable: DataStore.DataStoreUnavailable, | ||
loadBot (adapter, enableHttpd, name, alias) { | ||
return new module.exports.Robot(adapter, enableHttpd, name, alias) | ||
const hubotExport = require('./es2015') | ||
// make all es2015 class declarations compatible with CoffeeScript’s extend | ||
// see https://github.com/hubotio/evolution/pull/4#issuecomment-306437501 | ||
module.exports = Object.keys(hubotExport).reduce((map, current) => { | ||
if (current !== 'loadBot') { | ||
map[current] = makeClassCoffeeScriptCompatible(hubotExport[current]) | ||
} else { | ||
map[current] = hubotExport[current] | ||
} | ||
return map | ||
}, {}) | ||
function makeClassCoffeeScriptCompatible (klass) { | ||
function CoffeeScriptCompatibleClass () { | ||
const Hack = Function.prototype.bind.apply(klass, [null].concat([].slice.call(arguments))) | ||
const instance = new Hack() | ||
// pass methods from child to returned instance | ||
for (const key in this) { | ||
instance[key] = this[key] | ||
} | ||
// support for constructor methods which call super() | ||
// in which this.* properties are set | ||
for (const key in instance) { | ||
this[key] = instance[key] | ||
} | ||
return instance | ||
} | ||
inherits(CoffeeScriptCompatibleClass, klass) | ||
return CoffeeScriptCompatibleClass | ||
} |
{ | ||
"name": "hubot", | ||
"version": "10.0.4", | ||
"version": "10.0.5", | ||
"author": "hubot", | ||
@@ -18,2 +18,3 @@ "keywords": [ | ||
"dependencies": { | ||
"coffeescript": "^2.7.0", | ||
"connect-multiparty": "^2.2.0", | ||
@@ -20,0 +21,0 @@ "express": "^4.18.2", |
@@ -9,4 +9,6 @@ ![Pipeline Status](https://github.com/hubotio/hubot/actions/workflows/pipeline.yml/badge.svg) | ||
**Please note that in v11, CoffeeScript support was removed.** | ||
**Note: v10.0.4 contains the removal of CoffeeScript** | ||
Semver is looking for **BREAKING CHANGE** singular, not **BREAKING CHANGES**. As a result, the removal of CoffeeScript was marked as the `v10.0.4` release. | ||
Hubot is a framework to build chat bots, modeled after GitHub's Campfire bot of the same name, hubot. | ||
@@ -13,0 +15,0 @@ He's pretty cool. He's [extendable with scripts](https://hubotio.github.io/hubot/docs#scripts) and can work |
@@ -331,2 +331,6 @@ 'use strict' | ||
async loadcoffee (filePath) { | ||
return await this.loadjs(filePath) | ||
} | ||
async loadjs (filePath) { | ||
@@ -352,3 +356,3 @@ const script = require(filePath) | ||
// see https://github.com/hubotio/hubot/issues/1355 | ||
if (['js', 'mjs'].indexOf(ext) === -1) { | ||
if (['js', 'mjs', 'coffee'].indexOf(ext) === -1) { | ||
this.logger.debug(`Skipping unsupported file type ${full}`) | ||
@@ -481,3 +485,3 @@ return | ||
this.adapter = this.requireAdapterFrom(path.resolve(path.join(__dirname, 'adapters', this.adapterName))) | ||
} else if (['.js', '.cjs'].includes(ext)) { | ||
} else if (['.js', '.cjs', '.coffee'].includes(ext)) { | ||
this.adapter = this.requireAdapterFrom(path.resolve(adapterPath)) | ||
@@ -484,0 +488,0 @@ } else if (['.mjs'].includes(ext)) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96755
25
2485
40
5
+ Addedcoffeescript@^2.7.0
+ Addedcoffeescript@2.7.0(transitive)