Skip to content

Commit 2413440

Browse files
committed
Add readme + contributing docs
1 parent 494a6bb commit 2413440

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Node.js Discord Status Worker Contributing Guide
2+
3+
In short, all changes should ideally be contributed to the [upstream worker](https://github.com/WalshyDev/cf-status-worker) first, with the [`$COMMIT_SHA` in `clone.sh`](./clone.sh) then being updated to the latest commit in the upstream repository. The only exceptions to this are changes to the [`clone.sh`](./clone.sh) script itself, or configuration changes in the Worker's [`wrangler.toml`](./worker/wrangler.toml) and [`src/config.ts`](./worker/src/config.ts) files.
4+
5+
## Updating the upstream worker
6+
7+
To update the version of the upstream worker used by this repository, follow these steps:
8+
9+
- Update the `$COMMIT_SHA` in the [`clone.sh`](./clone.sh) script to the latest commit in the upstream repository.
10+
- Run the [`clone.sh`](./clone.sh) script to update the worker.
11+
- Validate that the patches in the [`patches`](./patches) directory applied successfully.
12+
- Commit the change to `clone.sh`, any patches, and the updated worker source code.
13+
- Create a pull request to merge the changes into the `main` branch.
14+
15+
## Updating the worker configuration
16+
17+
To update the configuration of the worker, follow these steps:
18+
19+
- Update the configuration in the [`wrangler.toml`](./worker/wrangler.toml) and [`src/config.ts`](./worker/src/config.ts) files.
20+
- From within the `worker`, run `GIT_DIR=../.git.worker git diff -- wrangler.toml src/config.ts > ../patches/config.patch` to update the patch file.
21+
- Commit the change to the configuration and the updated patch file.
22+
- Create a pull request to merge the changes into the `main` branch.
23+
24+
## Updating the worker source code
25+
26+
It is highly encouraged that any changes to the logic of the worker be contributed to the [upstream worker](https://github.com/WalshyDev/cf-status-worker) first. If this is not possible, follow these steps:
27+
28+
- Make the changes to the worker source code.
29+
- From within the `worker` directory, run `GIT_DIR=../.git.worker git diff -- <modified files> > ../patches/<group>.patch` to update the patch file.
30+
- `<modified files>` should be replaced with the files that were modified.
31+
- `<group>` should be a one (or few) word summary grouping the changed files.
32+
- If a modified file is included in another existing patch, it should either be removed from that file, or that patch should be updated to include the changes instead. A file should only be present in one patch.
33+
- Commit the change to the worker source code and the new/updated patch file(s).
34+
- Create a pull request to merge the changes into the `main` branch.
35+
36+
## Developer's Certificate of Origin 1.1
37+
38+
```
39+
By contributing to this project, I certify that:
40+
41+
- (a) The contribution was created in whole or in part by me and I have the right to
42+
submit it under the open source license indicated in the file; or
43+
- (b) The contribution is based upon previous work that, to the best of my knowledge,
44+
is covered under an appropriate open source license and I have the right under that
45+
license to submit that work with modifications, whether created in whole or in part
46+
by me, under the same open source license (unless I am permitted to submit under a
47+
different license), as indicated in the file; or
48+
- (c) The contribution was provided directly to me by some other person who certified
49+
(a), (b) or (c) and I have not modified it.
50+
- (d) I understand and agree that this project and the contribution are public and that
51+
a record of the contribution (including all personal information I submit with it,
52+
including my sign-off) is maintained indefinitely and may be redistributed consistent
53+
with this project or the open source license(s) involved.
54+
```

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<p align="center">
2+
<br />
3+
<a href="https://nodejs.org">
4+
<picture>
5+
<source media="(prefers-color-scheme: dark)" srcset="https://nodejs.org/static/logos/nodejsLight.svg">
6+
<img src="https://nodejs.org/static/logos/nodejsDark.svg" width="200px">
7+
</picture>
8+
</a>
9+
</p>
10+
11+
<p align="center">
12+
A <a href="https://workers.cloudflare.com">Cloudflare Worker</a> that provides a <a href="https://status.nodejs.org">status page</a> feed to the <a href="https://nodejs.org/discord">Node.js Discord server</a>.
13+
</p>
14+
15+
<p align="center">
16+
<a title="MIT License" href="LICENSE">
17+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" />
18+
</a>
19+
</p>
20+
21+
## Contributing
22+
23+
This project adopts the Node.js [Code of Conduct](https://github.com/nodejs/admin/blob/main/CODE_OF_CONDUCT.md).
24+
25+
Any person that wants to contribute to the Worker is welcome! Please read the [Contribution Guidelines](CONTRIBUTING.md) to better understand the structure of this repository.
26+
27+
### Deployment
28+
29+
The Worker is deployed to Cloudflare via [a GitHub Action](./.github/workflows/deploy.yml).
30+
31+
The Worker is automatically deployed to this environment when commits are merged into the `main` branch. The Worker is triggered by a cron trigger every minute and does not have any exposed HTTP endpoints.
32+
33+
## Relevant Links
34+
35+
- [Code of Conduct](https://github.com/nodejs/admin/blob/main/CODE_OF_CONDUCT.md)
36+
37+
- [Contribution Guidelines](CONTRIBUTING.md)
38+
39+
- [Upstream Worker](https://github.com/WalshyDev/cf-status-worker)
40+
41+
## License
42+
43+
This repo is licensed under the terms of the [MIT License](./LICENSE.md). It makes use of [WalshyDev's cf-status-worker](https://github.com/WalshyDev/cf-status-worker), which is also licensed under the MIT license.
44+
45+
## Thanks
46+
47+
- Thanks to all the contributors and collaborators that make this project possible.
48+
- Thanks to [Cloudflare](https://cloudflare.com) for providing the infrastructure that serves the Worker under their Open Source Initiative in addition to immense support.

0 commit comments

Comments
 (0)