4ddf834990
Restructure the core API module to improve clarity, consistency, and maintainability: - Introduce `defineApiRoutes()` helper for declarative route definitions with built-in config validation at startup - Add `apiSuccess()` / `apiError()` response utilities; enforce their use across all handlers (core and modules) - Move auth enforcement to route definitions (`auth: 'public' | 'user' | 'admin'`), removing manual auth checks from handlers - Extract core routes into `core-routes.js`; router now has no knowledge of specific features - Rename `nx-route.js` to `route-handler.js` and update package.json export accordingly - Update ARCHITECTURE.md to reflect new API conventions and point to `src/core/api/README.md` for details
57 lines
1.5 KiB
Markdown
57 lines
1.5 KiB
Markdown
# Conventions de commit
|
|
|
|
Tous les messages de commit sont rédigés en **anglais**, en suivant le format [Conventional Commits](https://www.conventionalcommits.org/) :
|
|
|
|
```
|
|
<type>(<scope>): <description courte>
|
|
```
|
|
|
|
---
|
|
|
|
## Types
|
|
|
|
| Type | Usage |
|
|
|------|-------|
|
|
| `feat` | New feature |
|
|
| `fix` | Bug fix |
|
|
| `refactor` | Code restructuring without behavior change |
|
|
| `style` | Formatting only (spaces, commas, no logic change) |
|
|
| `docs` | Documentation only |
|
|
| `test` | Add or update tests |
|
|
| `chore` | Maintenance, dependencies, build config |
|
|
| `perf` | Performance improvement |
|
|
| `revert` | Revert a previous commit |
|
|
|
|
---
|
|
|
|
## Exemples
|
|
|
|
```
|
|
feat(auth): add OAuth2 login support
|
|
fix(api): handle null response from payment gateway
|
|
refactor(storage): extract upload logic into helper
|
|
docs(guide): add git commit message conventions
|
|
chore(deps): update dependencies
|
|
perf(db): cache user metadata on repeated reads
|
|
revert: revert "feat(auth): add OAuth2 login support"
|
|
```
|
|
|
|
---
|
|
|
|
## Règles
|
|
|
|
- **Scope** : facultatif, précise la zone touchée `auth`, `api`, `storage`, `ui`, `config`
|
|
- **Description** : minuscules, sans point final, en anglais
|
|
- Un commit = une intention. Ne pas mélanger fix et refactor
|
|
- Pas de `wip`, `fix fix`, `oups` ou messages vides
|
|
|
|
## Breaking changes
|
|
|
|
Ajouter `!` après le type et un pied de page `BREAKING CHANGE:` :
|
|
|
|
```
|
|
feat(api)!: remove legacy query parameter
|
|
|
|
BREAKING CHANGE: the `legacy` param is no longer accepted, use `version` instead.
|
|
```
|