-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGES: Removed CoffeeScript support; .coffee files will no…
… longer load (#1694) BREAKING CHANGES: Removed es2015.js file; import index.js file instead
- Loading branch information
1 parent
5641d4c
commit f11e5af
Showing
15 changed files
with
83 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
#!/usr/bin/env coffee | ||
#!/usr/bin/env node | ||
|
||
# While all other files have been converted to JavaScript via https://github.com/github/hubot/pull/1347, | ||
# we left the `bin/hubot` file to remain in CoffeeScript in order prevent | ||
# breaking existing 3rd party adapters of which some are still written in | ||
# CoffeeScript themselves. We will deprecate and eventually remove this file | ||
# in a future version of hubot | ||
|
||
require './hubot.js' | ||
require('./hubot.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,31 @@ | ||
'use strict' | ||
require('coffeescript/register') | ||
|
||
const inherits = require('util').inherits | ||
|
||
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 | ||
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') | ||
|
||
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) | ||
} | ||
inherits(CoffeeScriptCompatibleClass, klass) | ||
|
||
return CoffeeScriptCompatibleClass | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.