{"id":15374021,"url":"https://github.com/jcmais/hubot-typescript-boilerplate","last_synced_at":"2025-07-24T19:12:26.801Z","repository":{"id":80044685,"uuid":"158009972","full_name":"JCMais/hubot-typescript-boilerplate","owner":"JCMais","description":"ChatOps made easier","archived":false,"fork":false,"pushed_at":"2018-12-02T19:47:20.000Z","size":84,"stargazers_count":23,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T14:46:56.263Z","etag":null,"topics":["chatops","devops","hubot","nodejs","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JCMais.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-17T17:51:56.000Z","updated_at":"2023-10-15T00:35:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"36aae927-6312-4220-b42c-7805236fe14a","html_url":"https://github.com/JCMais/hubot-typescript-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JCMais/hubot-typescript-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCMais%2Fhubot-typescript-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCMais%2Fhubot-typescript-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCMais%2Fhubot-typescript-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCMais%2Fhubot-typescript-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JCMais","download_url":"https://codeload.github.com/JCMais/hubot-typescript-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCMais%2Fhubot-typescript-boilerplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266890404,"owners_count":24001543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatops","devops","hubot","nodejs","typescript"],"created_at":"2024-10-01T13:57:01.308Z","updated_at":"2025-07-24T19:12:26.794Z","avatar_url":"https://github.com/JCMais.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hubot Typescript Boilerplate\n\nThis is a boilerplate for having your own hubot instance running using Typescript.\n\nSupports all existing hubot scripts written in coffescript / javascript.\n\nIt comes with the slack adapter pre-installed.\n\n![simple demo](https://thumbs.gfycat.com/CoolReflectingAmericanlobster-size_restricted.gif)\n\n## Development\nRun:\n```sh\ncp .env.sample .env\n```\n\nTo create your own .env file. Modify it as desired, then run:\n```sh\nyarn dev\n```\n\nThe .env file is only used during development. When running in production use your provider means of setting environment variables.\n\n## Running in Production\n\nFirst build the code:\n```sh\nyarn build\n```\n\nThen run the bot:\n```sh\nHUBOT_NAME=my-bot HUBOT_OTHER_ENVS=x yarn start\n```\n\u003e \n\u003e If using Windows I recommend to install [`cross-env`][cross-env], so you can run like the following:\n\u003e ```sh\n\u003e cross-env HUBOT_NAME=my-bot HUBOT_OTHER_ENVS=x yarn start\n\u003e ```\n\u003e \n\nThis will by default use the `shell` adapter, which is great for testing.\n\nThis boilerplate comes with the `slack` adapter pre-installed, so you can specify it by running:\n```sh\nHUBOT_NAME=my-bot HUBOT_ADAPTER=slack HUBOT_SLACK_TOKEN=xoxb-YOUR-TOKEN-HERE yarn start\n```\n\nFor more documentation about running hubot itself or the slack adapter, please check their corresponding\n docs:  \n https://hubot.github.com/docs/  \n https://slackapi.github.io/hubot-slack/#basic-setup  \n\n## Documentation\n\nThe code should be self-documented.\n\nStart by looking into the `.env.sample` file, then the scripts inside `src/scripts`, the files inside the `src/utils` and finally test files.\n\nThe folder `types` has some helpers for Typescript.\n\n## Notes\n\nDo not use Hubot [`robot.http`][robot.http] method, it uses [an old lib][node-scoped-http-client] and cannot be easily tested.\n\n\nUse something more modern, like axios or fetch.\n\n## Testing\n\nWe are using [hubot-test-helper][hubot-test-helper].\n\nTesting 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.\n\nThe best option here is to include a mock for the library you are using to make async calls,\n and include a small delay on your tests for each async interaction.\n\nThis boilerplate comes with `axios` installed, and a mock that works with jest, preinstalled. The test example at [`example.spec.ts`][example.spec.ts] can be used as reference. It should be self-documented.\n\nSee https://github.com/mtsmfm/hubot-test-helper/issues/19\n\n## Persistence\n\nThere is no brain persister installed, it's your job to install one if needed.\n\n## How does the coffee script can be run alongside typescript during development?\n\nThey don't.\n\nThere is a postinstall hook that calls the script [`tools/compile-coffee-deps.js`][tools/compile-coffee-deps.js]\n which is responsible for compilling the dependencies .coffee files to pure .js.\n\n[cross-env]:https://www.npmjs.com/package/cross-env\n[robot.http]:https://hubot.github.com/docs/scripting/#making-http-calls\n[node-scoped-http-client]:https://github.com/technoweenie/node-scoped-http-client\n[hubot-test-helper]:https://github.com/mtsmfm/hubot-test-helper\n[example.spec.ts]: ./src/scripts/__tests__/example.spec.ts\n[tools/compile-coffee-deps.js]: ./tools/compile-coffee-deps.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcmais%2Fhubot-typescript-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcmais%2Fhubot-typescript-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcmais%2Fhubot-typescript-boilerplate/lists"}