Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Start, Service-oriented Refactor #9

Merged
merged 40 commits into from
Apr 27, 2018

Conversation

martindale
Copy link
Member

@martindale martindale commented Mar 27, 2018

This begins a refactor aimed at making the installation of Doorman as simple as possible.

  • new "Quick Start" section in README
  • upgrade Slack to latest version
  • refactor internal structure to be more easily understood

lib/doorChat.js Outdated
Doorman.setupCommands();

// Discord
require('./discord/discordSupport')(Doorman);
//require('./discord/discordSupport')(Doorman);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've disabled Discord for now as I don't have the ability to test.

const Maki = require('maki');
const makiConfig = require('../config/makiConfig');
const config = require('../config/maki');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing prefixes as they are redundant.

@@ -193,5 +199,5 @@ module.exports = function (Doorman) {
}
}

Doorman.Slack.on(Doorman.Slack.rtm_events.MESSAGE, msg => checkMessageForCommand(msg, false));
Doorman.Slack.on('message', msg => checkMessageForCommand(msg, false));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Slack SDK has changed the location of these helpers, and I feel it would be better to know exactly what message type is being handled — no need to configure these anyway, so it is better to be explicit.

package.json Outdated
@@ -4,6 +4,7 @@
"description": "simple community management",
"main": "doorman.js",
"scripts": {
"start": "node doorman.js",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to using npm start as the recommended command for launching the bot. Will also add section to README on running as a service (probably using pm2).

@@ -7,4 +7,13 @@ describe('Doorman', function () {
it('should expose a constructor', function () {
assert(typeof Doorman, 'function');
});

it('can handle a message', function (done) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stub test to mock up the desired API for 0.2.0.

@martindale
Copy link
Member Author

This is mostly finished, but I'd like to add tests and get some reasonable coverage before merging. I'll keep the WIP: prefix for now, but will remove and then request review when I feel this is ready.

Happy to accept comments before then!

@martindale martindale changed the title WIP: Simple Start, Service-oriented Refactor Simple Start, Service-oriented Refactor Apr 4, 2018
@martindale martindale merged commit 1425117 into FabricLabs:master Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants