Skip to content

Commit e6200d7

Browse files
dhensbyclaude
andcommitted
docs: align CONTRIBUTING with conventional commits and master-based flow
semantic-release and the commitlint CI gate replace the previous gitflow `development` branch model and the ad-hoc Angular-style commit convention. Update the contributor guide to match: document Conventional Commits (required, linted in CI) and which types trigger releases, note that the version and CHANGELOG.md are produced automatically, and switch all branching/PR guidance from `development` to `master`. Also fix the stale `npm run docs` script reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7fd1c53 commit e6200d7

1 file changed

Lines changed: 45 additions & 19 deletions

File tree

CONTRIBUTING.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,31 @@ First, clone and install this project from source via
6161
```bash
6262
git clone git@github.com:node-oauth/node-oauth2-server.git
6363
cd node-oauth2-server
64-
git checkout development # important! do not work on master!
6564
npm install
6665
```
6766

67+
> **Note:** CI runs on **Node 24 (npm 11)**. Use a matching version locally, and
68+
> regenerate `package-lock.json` with npm 11 if you change dependencies. Older npm
69+
> versions rewrite the lock file — dropping the cross-platform optional
70+
> dependencies that `npm ci` needs — which breaks CI even when it installs fine on
71+
> your machine.
72+
6873
From here you can run several scripts for development purposes:
6974

7075
```bash
71-
npm run test # runs the tests once
76+
npm run test # runs the linter, then the tests once
7277
npm run test:coverage # runs the tests including coverage
73-
npm run docs # generates the API docs
78+
npm run lint # runs the linter
79+
npm run lint:fix # runs the linter and auto-fixes what it can
80+
npm run docs:api # regenerates the API docs from JSDoc comments
81+
npm run docs:dev # serves the documentation site locally
7482
```
7583

76-
To work on a new feature or a fix please create a new branch:
84+
Make sure your `master` is up to date, then create a branch for your work:
7785

7886
```bash
79-
git checkout -b feature-xyz # or fix-xyz
87+
git switch master && git pull
88+
git switch -c feature-xyz # or fix-xyz
8089
```
8190

8291
### Coding rules
@@ -86,15 +95,34 @@ git checkout -b feature-xyz # or fix-xyz
8695

8796
### Commit message convention
8897

89-
We use a commit convention, inspired by [angular commit message format](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format)
90-
with ticket number at the end of summary:
98+
We follow [Conventional Commits](https://www.conventionalcommits.org/). Every
99+
commit is linted in CI against
100+
[`@commitlint/config-conventional`](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional),
101+
and releases are produced automatically from the commit history by
102+
[semantic-release](https://github.com/semantic-release/semantic-release) — so the
103+
format is **required**, not just a style preference. Non-conforming commits fail
104+
CI.
91105

92106
```
93-
<type>(<scope>): <short summary> #<issue number>
107+
<type>(<optional scope>): <short summary>
94108
```
95109

96-
Summary in present tense. Not capitalized. No period at the end.
97-
The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` and `#<number>` fields are optional.
110+
The summary is written in the imperative mood, lower-case, with no trailing
111+
period. The `<type>` and `<summary>` are mandatory; the `(<scope>)` is optional.
112+
113+
**Release-triggering types** — these appear in the changelog and, on merge to
114+
`master`, trigger a release:
115+
116+
- `fix:` — patch release
117+
- `feat:` — minor release
118+
- `feat!:` (or any commit with a `BREAKING CHANGE:` footer) — major release
119+
120+
**Non-release types:** `docs`, `test`, `refactor`, `perf`, `style`, `build`,
121+
`ci`, `chore`.
122+
123+
Do **not** reference issues or PRs in the commit summary or body — link them from
124+
the pull request description instead. References in commit messages get replayed
125+
(re-notifying the linked thread) every time history is rebased or squashed.
98126

99127
### Run the tests before committing
100128

@@ -127,12 +155,10 @@ Note: sometimes a pull request (PR) is also referred to as merge request (MR).
127155

128156
There are a few basic requirements for your pull request to become accepted:
129157

130-
- Make sure to open your pull request to target the `development` branch and not
131-
`master`
132-
- Make sure you are working on a branch, other than `development`; usually you
133-
can name the branch after the feature or fix you want to provide
134-
- Resolve any merge conflicts (usually by keeping your branch updated with
135-
`development`)
158+
- Open your pull request against the `master` branch
159+
- Make sure you are working on a dedicated branch, not `master`; usually you can
160+
name the branch after the feature or fix you want to provide
161+
- Resolve any merge conflicts by keeping your branch up to date with `master`
136162
- Have a clear description on what the PR does, including any steps necessary
137163
for testing, reviewing, reproduction etc.
138164
- Link to the existing issue
@@ -142,11 +168,11 @@ There are a few basic requirements for your pull request to become accepted:
142168

143169
Also make sure, to comply with the following list:
144170

145-
- Do not work on `development` directly
171+
- Do not work on `master` directly
146172
- Do not implement multiple features in one pull request (this includes bumping
147173
versions of dependencies that are not related to the PR/issue)
148-
- Do not bump the release version (unless you are a maintainer)
149-
- Do not edit the Changelog as this will be done after your PR is merged
174+
- Do not bump the release version or edit `CHANGELOG.md` — both are produced
175+
automatically by semantic-release when your PR is merged
150176
- Do not introduce tight dependencies to a certain package that has not been
151177
approved during the discussion in the issue
152178

0 commit comments

Comments
 (0)