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.
105 lines
3.4 KiB
Markdown
105 lines
3.4 KiB
Markdown
# Contributing to newzy
|
|
|
|
Thank you for considering a contribution to **newzy**! This document explains how to set up your environment, follow the branching model, write commits, and submit changes.
|
|
|
|
## Ground Rules
|
|
|
|
Please keep the following in mind:
|
|
|
|
- Be respectful and constructive in all discussions and code reviews.
|
|
- Keep pull requests focused — one logical change per PR.
|
|
- Never commit secrets, credentials, or `.env` files (see `.gitignore`).
|
|
- Follow the existing style and conventions before introducing new patterns.
|
|
|
|
## Prerequisites
|
|
|
|
- [Git](https://git-scm.com/downloads) with your name and email configured:
|
|
|
|
```bash
|
|
git config --global user.name "Your Name"
|
|
git config --global user.email "you@example.com"
|
|
```
|
|
|
|
- A Gitea account with access to the repository.
|
|
|
|
## Git Hooks
|
|
|
|
newzy ships versioned hooks in `hooks/` (currently a `pre-push` hook that runs code quality checks). Enable them once per clone:
|
|
|
|
```bash
|
|
git config core.hooksPath hooks
|
|
```
|
|
|
|
The hook is a no-op until the application toolchain (`package.json`) exists; afterwards it runs the `lint` and `test` scripts (if defined) before every push.
|
|
|
|
## Branching Model
|
|
|
|
newzy uses a `main` / `develop` branching model:
|
|
|
|
| Branch | Purpose | Lives in |
|
|
| ------------ | -------------------------------------------------- | --------------- |
|
|
| `main` | Production-ready code, stable releases | Always |
|
|
| `develop` | Integration branch for feature development | Always |
|
|
| `feature/*` | New features and enhancements (from `develop`) | Temporary |
|
|
| `bugfix/*` | Bug fixes (from `develop`) | Temporary |
|
|
| `hotfix/*` | Critical fixes for production (from `main`) | Temporary |
|
|
|
|
Detailed rules, including merge and rebase workflows, are in [docs/branching.md](docs/branching.md).
|
|
|
|
### Typical Workflow
|
|
|
|
```bash
|
|
# Start from an up-to-date develop
|
|
git checkout develop
|
|
git pull --rebase origin develop
|
|
|
|
# Create your feature branch
|
|
git checkout -b feature/reader-view
|
|
|
|
# Commit your work (Conventional Commits)
|
|
git commit -m "feat: add reader view for articles"
|
|
|
|
# Rebase onto latest develop to keep history linear
|
|
git rebase develop
|
|
|
|
# Push and open a pull request against develop
|
|
git push -u origin feature/reader-view
|
|
```
|
|
|
|
## Commit Conventions
|
|
|
|
All commit messages follow the [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
|
|
```
|
|
<type>: <short description>
|
|
|
|
[optional body]
|
|
|
|
[optional footer]
|
|
```
|
|
|
|
Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`.
|
|
|
|
See [docs/commits.md](docs/commits.md) for the full format and sample messages.
|
|
|
|
## Code Review Process
|
|
|
|
1. Push your branch and open a pull request against `develop` (or `main` for `hotfix/*`).
|
|
2. Ensure the CI checks pass.
|
|
3. At least one approval is required before merging.
|
|
4. Squash-merge feature branches into `develop` so each feature is a single commit.
|
|
5. Delete the source branch after merging.
|
|
|
|
## Releasing
|
|
|
|
Releases are cut from `main` only. The release process is:
|
|
|
|
1. Merge `develop` into `main` (merge commit, no squash).
|
|
2. Tag the commit: `git tag -a v1.0.0 -m "Release v1.0.0"`.
|
|
3. Push the tag: `git push origin v1.0.0`.
|
|
4. Back-merge `main` into `develop` to keep them in sync.
|
|
|
|
## Questions?
|
|
|
|
Open a discussion or issue in the repository if anything in this document is unclear or outdated.
|