Skip to content

Commit

Permalink
Merge branch 'main' into issue-1098-optional-next
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch authored Oct 5, 2021
2 parents b3504ca + 91037be commit a2b8b39
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 26 deletions.
60 changes: 37 additions & 23 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,44 @@ When documentation is in a beta state, it requires a new, distinct collection of
* In `docs`>`_layouts`>`default.html` make a copy of the `basic` or `advanced` section, and modify the div ID and content to correspond to your beta collection. This step requires you to use variables from `_config.yml`.
* Now in `docs`>`_includes`>`sidebar.html`, create a new section after the basic and advanced sections. Again, copy the `basic` or `advanced` section to use as a template. Be careful with the variable naming—it's a little more complex than in `default.html`, and requires you to use variables from `_config.yml`.

### Releasing

1. Create the commit for the release:
* Bump the version number in adherence to [Semantic Versioning](http://semver.org/) in `package.json`.
* Update any dependency versions
* Confirm tests pass by running `npm test`
* Commit with a message including the new version number. For example `v2.2.0`.
* Tag the commit with the version number. For example `git tag @slack/bolt@2.2.0`.

2. Merge into main repository
* Create a pull request with the commit that was just made. Be certain to include the tag. For
example: `git push username main --tags`.
* Once tests pass and a reviewer has approved, merge the pull request. You will also want to
update your local `main` branch.
* Push the new tag up to origin `git push --tags origin`.

3. Distribute the release
* Publish to the package manager. Once you have permission to publish on npm, you can run `npm publish . --otp YOUR_OTP_CODE`.
* Create a GitHub Release with release notes. Release notes should mention contributors (@-mentions) and issues/PRs (#-mentions) for the release.
* Example release: https://github.com/slackapi/bolt/releases/tag/%40slack%2Fbolt%401.5.0

4. (Slack Internal) Communicate the release internally. Include a link to the GitHub Release.
### Releases
_For beta releases, see Beta Releases section below:_

Releasing can feel intimidating at first, but rest assured: if you make a mistake, don't fret! npm allows you to unpublish a release within the first 72 hours of publishing (you just won’t be able to use the same version number again). Venture on!

1. Check the status of the package's GitHub Milestone for issues that should be shipped with the release.
- If all issues have been closed, continue with the release.
- If issues are still open, discuss with the team about whether the open issues should be moved to a future release or if the release should be held off until the issues are resolved.

2. Make sure your local `main` branch has the latest changes.

3. Bump the version number in adherence to [Semantic Versioning](http://semver.org/) in `package.json`. (see [Versioning and Tags](https://github.com/slackapi/node-slack-sdk/blob/main/.github/maintainers_guide.md#versioning-and-tags))
- Update any dependency versions in `package.json` and install locally `rm -rf node_modules && npm install`
- Confirm tests pass and code is free of linting errors by running `npm test`.
- Make a single commit with a message, following the format in: ([Example](https://github.com/slackapi/bolt-js/pull/1133/commits/bcc421cd05b50ddcdeb806fcb27a38d7d9f8ede8)).
- Create a pull request for the version change ([Example](https://github.com/slackapi/bolt-js/pull/1133))
- Add appropriate labels on the PR, including `release`
4. Once the PR has been approved and tests have passed, merged to main repository.
- Update your local main branch: `git pull origin main`
- Add a version tag (ie, `git tag @slack/bolt@3.6.0`)
- Push the new tag up to origin: `git push --tags origin`
5. Distribute the release
- To publish, you need to be a member of the `slack Org` on npm and set up 2-Factor Auth with your passsword generator of choice. Before you can publish with npm, you must run `npm login` from the command line.
- Run `npm publish . --otp YOUR_OTP_CODE`. To generate an OTP (One Time Password), use your password generator of choice (Duo, 1Password)
6. Close Github Milestone
- Close the relevant GitHub Milestone(s) for the release(s)
- Move any unfinished, open issues to the next GitHub Milestone
7. Create GitHub Release(s) with release notes
- From the repository, navigate to the **Releases** section and draft a new release
- Release notes should mention contributors, issues and PRs ([Example](https://github.com/slackapi/bolt-js/releases/tag/%40slack%2Fbolt%403.6.0))

8. Communicate the release (as appropriate)
- **Internal**
- Include a brief description and link to the GitHub release
- **External**
- **community.slack.com**: Post updates in relevant channels (e.g. #lang-javascript, #tools-bolt)
- **Twitter**: Primarily for major updates. Coordinate with Developer Marketing.

5. Announce on community.slack.com in #slack-api

#### Beta Release

Expand Down
41 changes: 38 additions & 3 deletions docs/_advanced/custom_routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,43 @@ order: 10
---

<div class="section-content">
As of `v3.7.0`, custom HTTP routes can be easily added by passing in an array of routes as `customRoutes` when initializing `App`.

Adding custom HTTP routes is quite straightforward when using Bolt's built-in `ExpressReceiver`. Since `v2.1.0`, `ExpressReceiver` added a `router` property, which exposes the Express [Router](http://expressjs.com/en/4x/api.html#router) on which more routes can be added.
Each `CustomRoute` object must contain three properties: `path`, `method`, and `handler`. `method`, which corresponds to the HTTP verb, can be either a string or an array of strings.
</div>

```javascript
const { App } = require('@slack/bolt');

// Initialize Bolt app, using the default HTTPReceiver
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET,
customRoutes: [
{
path: '/health-check',
method: ['GET'],
handler: (req, res) => {
res.writeHead(200);
res.end('Health check information displayed here!');
},
},
],
});

(async () => {
await app.start();
console.log('⚡️ Bolt app started');
})();
```

<details class="secondary-wrapper">
<summary class="section-head" markdown="0">
<h4 class="section-head">Custom ExpressReceiver routes</h4>
</summary>

<div class="secondary-content" markdown="0">
Adding custom HTTP routes is quite straightforward when using Bolt’s built-in ExpressReceiver. Since `v2.1.0`, `ExpressReceiver` added a `router` property, which exposes the Express [Router](http://expressjs.com/en/4x/api.html#router) on which additional routes can be added.
</div>

```javascript
Expand Down Expand Up @@ -36,7 +70,8 @@ receiver.router.post('/secret-page', (req, res) => {
});

(async () => {
await app.start(8080);
console.log('app is running');
await app.start();
console.log('⚡️ Bolt app started');
})();
```
</details>

0 comments on commit a2b8b39

Please sign in to comment.