Skip to content

Commit 19e0cef

Browse files
committed
docs: Update development guidelines
1 parent 114f14f commit 19e0cef

File tree

2 files changed

+59
-11
lines changed

2 files changed

+59
-11
lines changed

commitlint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ export default {
2727
2, "always",
2828
["sentence-case", "start-case", "pascal-case"],
2929
],
30+
// Limit scope to package names and special cases
31+
"scope-enum": [
32+
2,
33+
"always",
34+
[
35+
// Package names
36+
"builder",
37+
"cli",
38+
"documentation",
39+
"fs",
40+
"logger",
41+
"project",
42+
"server",
43+
// Special scope for dev dependencies
44+
"deps-dev"
45+
]
46+
],
47+
"scope-case": [2, "always", "lowercase"],
3048
},
3149
ignores: [
3250
// Ignore release commits, as their subject doesn't start with an uppercase letter

docs/Guidelines.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ During development, you might want to use `npm run unit` or `npm run unit-watch`
1212
### No Merge Commits
1313
Please use [rebase instead of merge](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) to update a branch to the latest main. This helps keeping a clean commit history in the project.
1414

15-
16-
1715
### Commit Message Style
1816

1917
This project uses the [Conventional Commits specification](https://www.conventionalcommits.org/) to ensure a consistent way of dealing with commit messages.
@@ -24,27 +22,59 @@ This project uses the [Conventional Commits specification](https://www.conventio
2422
type(scope): Description
2523
```
2624

27-
- required: every commit message has to start with a lowercase `type`. The project has defined a set of [valid types](../commitlint.config.mjs#L10)
28-
- Note that the types `feat`, `fix`, `perf`, `deps`, and `revert` will appear in the public changelog of the released packages
29-
- required: the `scope` is required for changes that will appear in the public changelog. The scope must be the package folder name (e.g. `cli`, `builder`, ...). Other scopes are not allowed.
25+
- **Type (required)**: Every commit message must start with a lowercase `type`. The project has defined a set of [valid types](../commitlint.config.mjs#L10)
26+
- **Scope (conditional)**: Required only for types that appear in the public changelog: `feat`, `fix`, `perf`, `deps`, and `revert`. The scope must be the package folder name (e.g. `cli`, `builder`, `fs`, `logger`, `project`, `server`, `documentation`). No other scopes are allowed (except `build(deps-dev)` for dev dependencies).
27+
- **Description (required)**: Must follow Sentence Case style. Only the first word and proper nouns are written in uppercase.
28+
29+
#### Dependencies
30+
31+
- Use `deps(scope)` for productive dependency updates that are relevant for end users
32+
- Use `build(deps-dev)` for development dependency updates
3033

31-
- required: the `description` has to follow the Sentence Case style. Only the first word and proper nouns are written in uppercase.
34+
#### Breaking Changes
3235

36+
Breaking changes should follow the [Conventional Commits specification](https://www.conventionalcommits.org/):
37+
- Add `!` after the type/scope: `feat(cli)!: Remove deprecated command`
38+
- Include `BREAKING CHANGE:` in the commit footer with details about the change
3339

34-
Rules (for commitlint checks)
35-
- Require a scope for all types that appear in the commit message (TBD: what about deps?)
36-
- Limit the scope to the package folder names (cli, builder, ..., incl. documentation)
37-
-
40+
#### Commitlint Rules
3841

42+
The following rules are enforced by commitlint:
43+
- Valid commit types are enforced (see [commitlint.config.mjs](../commitlint.config.mjs))
44+
- When using a scope, it must be one of: package names (`builder`, `cli`, `documentation`, `fs`, `logger`, `project`, `server`) or `deps-dev` for development dependencies
45+
- Commit messages must follow sentence case for the description
46+
47+
**Important**: Commitlint cannot automatically enforce that scopes are required only for public changelog types. Please manually ensure that:
48+
- `feat`, `fix`, `perf`, `deps`, `revert` commits always include a package scope
49+
- Other commit types should not include a scope (except `build(deps-dev)` for dev dependencies)
3950

4051
#### Examples
4152

53+
**Features and fixes:**
4254
```
4355
feat(cli): Add "versions" command
56+
fix(fs): Correctly handle paths containing non-ASCII characters on Windows
57+
perf(builder): Improve bundle generation speed by 25%
4458
```
4559

60+
**Dependencies:**
4661
```
47-
fix(fs): Correctly handle paths containing non-ASCII characters on Windows
62+
deps(cli): Update @ui5/logger to v4.0.0
63+
build(deps-dev): Update eslint to v9.0.0
64+
```
65+
66+
**Breaking changes:**
67+
```
68+
feat(cli)!: Remove deprecated "init" command
69+
70+
BREAKING CHANGE: The "init" command has been removed. Use "create" instead.
71+
```
72+
73+
**Workspace-wide changes (no scope):**
74+
```
75+
ci: Update GitHub Actions to use Node.js 20
76+
docs: Update contribution guidelines
77+
build: Configure new linting rules
4878
```
4979

5080
### Multi-Package Changes

0 commit comments

Comments
 (0)