All Projects → JCMais → hubot-typescript-boilerplate

JCMais / hubot-typescript-boilerplate

Licence: MIT license
ChatOps made easier

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to hubot-typescript-boilerplate

hubot-code-review
A Hubot script for GitHub code review on Slack.
Stars: ✭ 38 (+90%)
Mutual labels:  hubot, chatops
hubot-messenger-bot
🔌 A Hubot adapter for Facebook Messenger Platform (Bots) with zero external dependencies.
Stars: ✭ 44 (+120%)
Mutual labels:  hubot, chatops
Sactive Bot
😈 An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
Stars: ✭ 212 (+960%)
Mutual labels:  hubot, chatops
st2chatops
Packaging environment for building StackStorm chatops native packages
Stars: ✭ 26 (+30%)
Mutual labels:  hubot, chatops
docker-hubot
Docker container for running hubot in a container.
Stars: ✭ 17 (-15%)
Mutual labels:  hubot, chatops
Showcase Ansible Chatops
Vagrant Demo showing ChatOps with Ansible
Stars: ✭ 71 (+255%)
Mutual labels:  hubot, chatops
ansible-hubot
💬 Ansible role for Hubot
Stars: ✭ 63 (+215%)
Mutual labels:  hubot, chatops
trax
Simple time tracker designed for ChatOps
Stars: ✭ 40 (+100%)
Mutual labels:  chatops
hubot-alias
Action alias for hubot
Stars: ✭ 21 (+5%)
Mutual labels:  hubot
gubot
A hubot like bot written in golang which is langage agnostic and cloud agnostic
Stars: ✭ 29 (+45%)
Mutual labels:  hubot
slash-heroku
/heroku commands for slack
Stars: ✭ 37 (+85%)
Mutual labels:  chatops
evolution
proposals for changes and user-visible enhancements to Hubot
Stars: ✭ 42 (+110%)
Mutual labels:  hubot
chatops-controller
A rails plugin to make creating chatops easy
Stars: ✭ 58 (+190%)
Mutual labels:  chatops
flixctl
A toolkit for controlling the infrastructure necessary for a true MaSaS (Movies and Shows as a Service) architecture.
Stars: ✭ 43 (+115%)
Mutual labels:  chatops
hackmit-hackbot
🤖 HackMIT's personal assistant!
Stars: ✭ 13 (-35%)
Mutual labels:  hubot
cog-helm
A Helm chart to deploy Cog on Kubernetes
Stars: ✭ 17 (-15%)
Mutual labels:  chatops
bender
A Concourse resource that can trigger and pass parameters to jobs using slack
Stars: ✭ 32 (+60%)
Mutual labels:  chatops
hubot-pager-me
PagerDuty integration for Hubot
Stars: ✭ 74 (+270%)
Mutual labels:  hubot
hubot-broadlink-rm
A hubot script to learn and send IR hex codes with Broadlink RM
Stars: ✭ 24 (+20%)
Mutual labels:  hubot
hubot-bearychat
BearyChat Adapter for Hubot
Stars: ✭ 99 (+395%)
Mutual labels:  hubot

Hubot Typescript Boilerplate

This is a boilerplate for having your own hubot instance running using Typescript.

Supports all existing hubot scripts written in coffescript / javascript.

It comes with the slack adapter pre-installed.

simple demo

Development

Run:

cp .env.sample .env

To create your own .env file. Modify it as desired, then run:

yarn dev

The .env file is only used during development. When running in production use your provider means of setting environment variables.

Running in Production

First build the code:

yarn build

Then run the bot:

HUBOT_NAME=my-bot HUBOT_OTHER_ENVS=x yarn start

If using Windows I recommend to install cross-env, so you can run like the following:

cross-env HUBOT_NAME=my-bot HUBOT_OTHER_ENVS=x yarn start

This will by default use the shell adapter, which is great for testing.

This boilerplate comes with the slack adapter pre-installed, so you can specify it by running:

HUBOT_NAME=my-bot HUBOT_ADAPTER=slack HUBOT_SLACK_TOKEN=xoxb-YOUR-TOKEN-HERE yarn start

For more documentation about running hubot itself or the slack adapter, please check their corresponding docs:
https://hubot.github.com/docs/
https://slackapi.github.io/hubot-slack/#basic-setup

Documentation

The code should be self-documented.

Start by looking into the .env.sample file, then the scripts inside src/scripts, the files inside the src/utils and finally test files.

The folder types has some helpers for Typescript.

Notes

Do not use Hubot robot.http method, it uses an old lib and cannot be easily tested.

Use something more modern, like axios or fetch.

Testing

We are using hubot-test-helper.

Testing hubot is not an easy task, mainly because if you have any async call inside your scripts, your tests will need to have some kind of delay.

The best option here is to include a mock for the library you are using to make async calls, and include a small delay on your tests for each async interaction.

This boilerplate comes with axios installed, and a mock that works with jest, preinstalled. The test example at example.spec.ts can be used as reference. It should be self-documented.

See mtsmfm/hubot-test-helper#19

Persistence

There is no brain persister installed, it's your job to install one if needed.

How does the coffee script can be run alongside typescript during development?

They don't.

There is a postinstall hook that calls the script tools/compile-coffee-deps.js which is responsible for compilling the dependencies .coffee files to pure .js.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].