Add repository scaffolding: .gitignore, README, CONTRIBUTING, MIT license, pre-push quality hook, and documentation covering branching, file conventions, and commit style. Establish the main/develop branching strategy. This is project setup only; no application functionality is included.
82 lines
2.8 KiB
Markdown
82 lines
2.8 KiB
Markdown
# Commit Conventions
|
|
|
|
All commits in **newzy** follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. This keeps history readable, machine-parseable, and enables automated changelogs.
|
|
|
|
## Format
|
|
|
|
```
|
|
<type>[optional scope]: <short description>
|
|
|
|
[optional body]
|
|
|
|
[optional footer(s)]
|
|
```
|
|
|
|
- **type** (required): what kind of change this is.
|
|
- **scope** (optional): area of the codebase affected, e.g. `reader`, `feed`, `ci`.
|
|
- **description** (required): imperative mood, no trailing period, ≤ 72 chars.
|
|
- **body** (optional): wrap at 72 chars; explain *what* and *why*, not *how*.
|
|
- **footer** (optional): `BREAKING CHANGE:` annotations and issue references (`Closes #12`).
|
|
|
|
## Allowed Types
|
|
|
|
| Type | Use for |
|
|
| ---------- | ---------------------------------------------------------- |
|
|
| `feat` | New functionality for the user |
|
|
| `fix` | Bug fixes |
|
|
| `docs` | Documentation changes only |
|
|
| `style` | Formatting, whitespace — no behavior change |
|
|
| `refactor` | Code change that neither fixes a bug nor adds a feature |
|
|
| `perf` | Performance improvements |
|
|
| `test` | Adding or correcting tests |
|
|
| `build` | Build system, dependencies, bundlers |
|
|
| `ci` | CI configuration and pipeline changes |
|
|
| `chore` | Maintenance, tooling, housekeeping (e.g. repo setup) |
|
|
| `revert` | Reverting a previous commit |
|
|
|
|
## Sample Commit Messages
|
|
|
|
```text
|
|
chore: initial project setup for newzy
|
|
|
|
Add repository scaffolding: .gitignore, README, CONTRIBUTING,
|
|
MIT license, and documentation for branching, conventions,
|
|
and commit style. Establish main/develop branch strategy.
|
|
```
|
|
|
|
```text
|
|
feat(feed): add paginated news feed
|
|
|
|
Fetches the first page of articles on load and appends
|
|
additional pages on scroll. Closes #12.
|
|
```
|
|
|
|
```text
|
|
fix(reader): handle missing article images
|
|
|
|
Falls back to a placeholder image when an article has no
|
|
media, fixing a blank card in the feed.
|
|
```
|
|
|
|
```text
|
|
docs: clarify rebase rules for feature branches
|
|
```
|
|
|
|
```text
|
|
ci: add lint and test checks to pull request workflow
|
|
```
|
|
|
|
```text
|
|
chore(deps): bump vite from 5.2.0 to 5.4.1
|
|
|
|
BREAKING CHANGE: Node 18 is no longer supported; requires Node 20+.
|
|
```
|
|
|
|
## Rules of Thumb
|
|
|
|
1. One logical change per commit — split unrelated changes.
|
|
2. Write the description in imperative mood: `add`, `fix`, `remove` (not `added`, `fixes`, `removed`).
|
|
3. Reference issues in the footer: `Closes #12`, `Refs #34`.
|
|
4. Mark breaking changes with a `BREAKING CHANGE:` footer.
|
|
5. When in doubt about the type, `chore` is the safe fallback for housekeeping.
|