Skip to content

Commit ccb14ca

Browse files
zimegmwbrooks
andauthored
feat: introduce the blank template (#1)
Co-authored-by: Michael Brooks <michael@michaelbrooks.ca>
1 parent fd0e66f commit ccb14ca

File tree

13 files changed

+1997
-0
lines changed

13 files changed

+1997
-0
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Code owners are the default owners for everything in
2+
# this repository. The owners listed below will be requested for
3+
# review when a pull request is opened.
4+
# To add code owner(s), uncomment the line below and
5+
# replace the @global-owner users with their GitHub username(s).
6+
# * @global-owner1 @global-owner2

.github/CODE_OF_CONDUCT.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Salesforce Open Source Community Code of Conduct
2+
3+
## About the Code of Conduct
4+
5+
Equality is a core value at Salesforce. We believe a diverse and inclusive
6+
community fosters innovation and creativity, and are committed to building a
7+
culture where everyone feels included.
8+
9+
Salesforce open-source projects are committed to providing a friendly, safe, and
10+
welcoming environment for all, regardless of gender identity and expression,
11+
sexual orientation, disability, physical appearance, body size, ethnicity, nationality,
12+
race, age, religion, level of experience, education, socioeconomic status, or
13+
other similar personal characteristics.
14+
15+
The goal of this code of conduct is to specify a baseline standard of behavior so
16+
that people with different social values and communication styles can work
17+
together effectively, productively, and respectfully in our open source community.
18+
It also establishes a mechanism for reporting issues and resolving conflicts.
19+
20+
All questions and reports of abusive, harassing, or otherwise unacceptable behavior
21+
in a Salesforce open-source project may be reported by contacting the Salesforce
22+
Open Source Conduct Committee at ossconduct@salesforce.com.
23+
24+
## Our Pledge
25+
26+
In the interest of fostering an open and welcoming environment, we as
27+
contributors and maintainers pledge to making participation in our project and
28+
our community a harassment-free experience for everyone, regardless of gender
29+
identity and expression, sexual orientation, disability, physical appearance,
30+
body size, ethnicity, nationality, race, age, religion, level of experience, education,
31+
socioeconomic status, or other similar personal characteristics.
32+
33+
## Our Standards
34+
35+
Examples of behavior that contributes to creating a positive environment
36+
include:
37+
38+
- Using welcoming and inclusive language
39+
- Being respectful of differing viewpoints and experiences
40+
- Gracefully accepting constructive criticism
41+
- Focusing on what is best for the community
42+
- Showing empathy toward other community members
43+
44+
Examples of unacceptable behavior by participants include:
45+
46+
- The use of sexualized language or imagery and unwelcome sexual attention or
47+
advances
48+
- Personal attacks, insulting/derogatory comments, or trolling
49+
- Public or private harassment
50+
- Publishing, or threatening to publish, others' private information—such as
51+
a physical or electronic address—without explicit permission
52+
- Other conduct which could reasonably be considered inappropriate in a
53+
professional setting
54+
- Advocating for or encouraging any of the above behaviors
55+
56+
## Our Responsibilities
57+
58+
Project maintainers are responsible for clarifying the standards of acceptable
59+
behavior and are expected to take appropriate and fair corrective action in
60+
response to any instances of unacceptable behavior.
61+
62+
Project maintainers have the right and responsibility to remove, edit, or
63+
reject comments, commits, code, wiki edits, issues, and other contributions
64+
that are not aligned with this Code of Conduct, or to ban temporarily or
65+
permanently any contributor for other behaviors that they deem inappropriate,
66+
threatening, offensive, or harmful.
67+
68+
## Scope
69+
70+
This Code of Conduct applies both within project spaces and in public spaces
71+
when an individual is representing the project or its community. Examples of
72+
representing a project or community include using an official project email
73+
address, posting via an official social media account, or acting as an appointed
74+
representative at an online or offline event. Representation of a project may be
75+
further defined and clarified by project maintainers.
76+
77+
## Enforcement
78+
79+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
80+
reported by contacting the Salesforce Open Source Conduct Committee
81+
at ossconduct@salesforce.com. All complaints will be reviewed and investigated
82+
and will result in a response that is deemed necessary and appropriate to the
83+
circumstances. The committee is obligated to maintain confidentiality with
84+
regard to the reporter of an incident. Further details of specific enforcement
85+
policies may be posted separately.
86+
87+
Project maintainers who do not follow or enforce the Code of Conduct in good
88+
faith may face temporary or permanent repercussions as determined by other
89+
members of the project's leadership and the Salesforce Open Source Conduct
90+
Committee.
91+
92+
## Attribution
93+
94+
This Code of Conduct is adapted from the [Contributor Covenant][contributor-covenant-home],
95+
version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html.
96+
It includes adaptions and additions from [Go Community Code of Conduct][golang-coc],
97+
[CNCF Code of Conduct][cncf-coc], and [Microsoft Open Source Code of Conduct][microsoft-coc].
98+
99+
This Code of Conduct is licensed under the [Creative Commons Attribution 3.0 License][cc-by-3-us].
100+
101+
[contributor-covenant-home]: https://www.contributor-covenant.org "https://www.contributor-covenant.org/"
102+
[golang-coc]: https://golang.org/conduct
103+
[cncf-coc]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
104+
[microsoft-coc]: https://opensource.microsoft.com/codeofconduct/
105+
[cc-by-3-us]: https://creativecommons.org/licenses/by/3.0/us/

.github/CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributors Guide
2+
3+
Interested in contributing? Awesome! Before you do though, please read our [Code of Conduct](https://github.com/slack-samples/bolt-js-blank-template/blob/main/.github/CODE_OF_CONDUCT.md). We take it very seriously, and expect that you will as well.
4+
5+
There are many ways you can contribute! :heart:
6+
7+
### Bug Reports and Fixes :bug:
8+
9+
- If you find a bug, please search for it in the [Issues](https://github.com/slack-samples/bolt-js-blank-template/issues), and if it isn't already tracked, [create a new issue](https://github.com/slack-samples/bolt-js-blank-template/issues/new). Fill out the "Bug Report" section of the issue template. Even if an Issue is closed, feel free to comment and add details, it will still be reviewed.
10+
- Issues that have already been identified as a bug (note: able to reproduce) will be labelled `bug`.
11+
- Issues that are related to the examples apps will be labelled `area:examples`.
12+
- If you'd like to submit a fix for a bug, [send a Pull Request](#creating-a-pull-request) and mention the Issue number.
13+
- Include tests that isolate the bug and verifies that it was fixed.
14+
15+
### New Features :bulb:
16+
17+
- If you'd like to add new functionality to this project, describe the problem you want to solve in a [new Issue](https://github.com/slack-samples/bolt-js-blank-template/issues/new).
18+
- Issues that have been identified as a feature request will be labelled `enhancement`.
19+
- Issues that are related to the examples apps will be labelled `area:examples`.
20+
- If you'd like to implement the new feature, please wait for feedback from the project maintainers before spending too much time writing the code. In some cases, `enhancement`s may not align well with the project objectives at the time.
21+
22+
### Tests :mag:, Documentation :books:, Miscellaneous :sparkles:
23+
24+
- If you'd like to improve the tests, you want to make the documentation clearer, you have an alternative implementation of something that may have advantages over the way its currently done, or you have any other change, we would be happy to hear about it!
25+
- If its a trivial change, go ahead and [send a Pull Request](#creating-a-pull-request) with the changes you have in mind.
26+
- If not, [open an Issue](https://github.com/slack-samples/bolt-js-blank-template/issues/new) to discuss the idea first.
27+
28+
If you're new to our project and looking for some way to make your first contribution, look for Issues labelled `good first contribution`.
29+
30+
## Requirements
31+
32+
For your contribution to be accepted:
33+
34+
- [x] You must have signed the [Contributor License Agreement (CLA)](https://cla.salesforce.com/sign-cla).
35+
- [x] The test suite must be complete and pass.
36+
- [x] The changes must be approved by code review.
37+
- [x] Commits should be atomic and messages must be descriptive. Related issues should be mentioned by Issue number.
38+
39+
If the contribution doesn't meet the above criteria, you may fail our automated checks or a maintainer will discuss it with you. You can continue to improve a Pull Request by adding commits to the branch from which the PR was created.
40+
41+
[Interested in knowing more about about pull requests at Slack?](https://slack.engineering/on-empathy-pull-requests-979e4257d158#.awxtvmb2z)
42+
43+
## Creating a Pull Request
44+
45+
1. :fork_and_knife: Fork the repository on GitHub.
46+
2. :runner: Clone/fetch your fork to your local development machine. It's a good idea to run the tests just to make sure everything is in order.
47+
3. :herb: Create a new branch and check it out.
48+
4. :crystal_ball: Make your changes and commit them locally. Magic happens here!
49+
5. :arrow_heading_up: Push your new branch to your fork. (e.g. `git push username fix-issue-16`).
50+
6. :inbox_tray: Open a Pull Request on github.com from your new branch on your fork to `master` in this repository.

.github/SECURITY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Security
2+
3+
Please report any security issue to [security@salesforce.com](mailto:security@salesforce.com)
4+
as soon as it is discovered. This library limits its runtime dependencies in
5+
order to reduce the total cost of ownership as much as can be, but all consumers
6+
should remain vigilant and have their security stakeholders review all third-party
7+
products (3PP) like this one and their dependencies.

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
labels:
8+
- "npm"
9+
- "dependencies"
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "monthly"

.github/workflows/lint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 5
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
node-version:
17+
- 18.x
18+
- 20.x
19+
- 22.x
20+
steps:
21+
- uses: actions/checkout@v5
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: npm install
27+
- run: npm run lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Bolt for JavaScript Blank Template
2+
3+
This is a blank [Bolt for JavaScript](https://docs.slack.dev/tools/bolt-js/) template app used to start building new Slack apps.
4+
5+
## Setup
6+
7+
Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and [create one](https://slack.com/create).
8+
9+
### Developer Program
10+
11+
Join the [Slack Developer Program](https://api.slack.com/developer-program) for exclusive access to sandbox environments for building and testing your apps, tooling, and resources created to help you build and grow.
12+
13+
## Installation
14+
15+
### Create a Slack App
16+
17+
1. Open [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and choose "From an app manifest"
18+
2. Choose the workspace you want to install the application to
19+
3. Copy the contents of [manifest.json](./manifest.json) into the text box that says `*Paste your manifest code here*` (within the JSON tab) and click _Next_
20+
4. Review the configuration and click _Create_
21+
5. You'll be redirected to the app settings page for your app. Click _Install App_ in the left hand menu then _Install to Workspace_ and _Allow_ on the screen that follows.
22+
23+
#### Environment Variables
24+
25+
Before you can run the app, you'll need to gather some environment variables.
26+
27+
1. **Bot token**: Open your [app settings](https://api.slack.com/apps) page, click _OAuth & Permissions_ in the left hand menu, then copy the _Bot User OAuth Token_.
28+
2. **App token**: Click _Basic Information_ from the left hand menu and follow the steps in the _App-Level Tokens_ section to create an app-level token with the `connections:write` scope.
29+
30+
Once you have these, export both in a shell for following processes:
31+
32+
```sh
33+
export SLACK_BOT_TOKEN=xoxb-example
34+
export SLACK_APP_TOKEN=xapp-1-example
35+
```
36+
37+
### Setup Your Local Project
38+
39+
```sh
40+
# Clone this project onto your machine
41+
git clone https://github.com/slack-samples/bolt-js-blank-template.git
42+
43+
# Change into this project directory
44+
cd bolt-js-blank-template
45+
46+
# Install dependencies
47+
npm install
48+
49+
# Run Bolt server
50+
npm start
51+
```
52+
53+
At this point a message should appear in the terminal that notes the Bolt app is running! It doesn't do much else at the moment.
54+
55+
#### Linting
56+
57+
```sh
58+
# Run lint for code formatting and linting
59+
npm run lint
60+
```
61+
62+
## Resources
63+
64+
To learn more about developing Slack apps, visit the following pages:
65+
66+
- [API docs](https://docs.slack.dev)
67+
- [Bolt for JavaScript docs](https://docs.slack.dev/tools/bolt-js/)

app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { App } = require('@slack/bolt');
2+
3+
// Initializes your app with your Slack app and bot token
4+
const app = new App({
5+
token: process.env.SLACK_BOT_TOKEN,
6+
socketMode: true,
7+
appToken: process.env.SLACK_APP_TOKEN,
8+
});
9+
10+
(async () => {
11+
// Start your app
12+
await app.start();
13+
14+
app.logger.info('⚡️ Bolt app is running!');
15+
})();

biome.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"assist": {
4+
"enabled": true,
5+
"actions": {
6+
"source": {
7+
"organizeImports": "on"
8+
}
9+
}
10+
},
11+
"files": {
12+
"ignoreUnknown": true
13+
},
14+
"formatter": {
15+
"enabled": true,
16+
"indentStyle": "space"
17+
},
18+
"javascript": {
19+
"formatter": {
20+
"quoteStyle": "single"
21+
}
22+
},
23+
"linter": {
24+
"enabled": true,
25+
"rules": {
26+
"recommended": true
27+
}
28+
},
29+
"vcs": {
30+
"enabled": true,
31+
"clientKind": "git",
32+
"useIgnoreFile": true
33+
}
34+
}

0 commit comments

Comments
 (0)