Skip to content

Commit 5f0df8d

Browse files
fengmk2claude
andcommitted
docs: add Angular commit message format guidelines
Add comprehensive commit message format documentation to both CLAUDE.md and .github/copilot-instructions.md following the Angular convention specified in CONTRIBUTING.md. - Include required types, scope guidelines, and subject rules - Provide project-specific examples with actual package names - Emphasize importance for automated changelog and release processes - Ensure consistency across all development documentation This ensures all developers follow the established commit conventions for maintaining project consistency and automated tooling compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 75d076d commit 5f0df8d

2 files changed

Lines changed: 150 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,75 @@ After making changes, always verify:
223223
4. **Tests Run**: `pnpm run test` executes (some failures expected, focus on your changes)
224224

225225
**Remember**: This is a complex enterprise framework. Always build first, validate incrementally, and focus on the core packages (`egg`, `core`, `utils`) for most development work.
226+
227+
## Commit Message Format
228+
229+
**CRITICAL: All commits MUST follow the [Angular Commit Message Format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) as specified in CONTRIBUTING.md.**
230+
231+
### Required Format Structure
232+
233+
```
234+
<type>(<scope>): <subject>
235+
<BLANK LINE>
236+
<body>
237+
<BLANK LINE>
238+
<footer>
239+
```
240+
241+
### Mandatory Types
242+
243+
- **feat**: A new feature
244+
- **fix**: A bug fix
245+
- **docs**: Documentation-only changes
246+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
247+
- **refactor**: A code change that neither fixes a bug nor adds a feature
248+
- **perf**: A code change that improves performance
249+
- **test**: Adding missing tests
250+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
251+
- **deps**: Updates about dependencies
252+
253+
### Scope Guidelines
254+
255+
- **Package-specific changes**: Use package names like `core`, `mock`, `cluster`, `utils`, `tsconfig`, `extend2`
256+
- **Cross-package changes**: Use feature areas like `loader`, `plugin`, `config`, `build`
257+
- **Component-specific**: Use component names like `application`, `agent`, `context`
258+
259+
### Subject Rules
260+
261+
- Use imperative, present tense: "change" not "changed" nor "changes"
262+
- Don't capitalize first letter
263+
- No period (.) at the end
264+
- Be succinct and descriptive
265+
266+
### Examples
267+
268+
```
269+
feat(tsconfig): integrate package into monorepo with vitest
270+
271+
Merge @eggjs/tsconfig repository into packages/tsconfig/ and refactor
272+
to use vitest testing framework instead of Node.js test runner.
273+
274+
- Update all consuming packages to use workspace:* dependencies
275+
- Add vitest configuration and convert test assertions
276+
- Remove external catalog dependency in favor of workspace package
277+
278+
Closes #123
279+
```
280+
281+
```
282+
fix(core): resolve loader initialization race condition
283+
284+
The loader was attempting to initialize plugins before configurations
285+
were fully loaded, causing intermittent startup failures.
286+
287+
Fixes #456
288+
```
289+
290+
```
291+
chore: update dependencies to latest versions
292+
293+
Update catalog dependencies and rebuild packages to ensure
294+
compatibility with latest versions.
295+
```
296+
297+
**NEVER commit without following this format - it breaks the project's automated changelog and release process.**

CLAUDE.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,81 @@ The framework extends Koa's context with Egg-specific features:
230230
- Update versions in one place to keep consistency across packages
231231
- Use `pnpm update --latest` to update catalog entries
232232
- Reference catalog entries in individual packages with `"package-name": "catalog:"`
233+
234+
## Commit Message Format
235+
236+
**IMPORTANT: All commits MUST follow the [Angular Commit Message Format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) as specified in CONTRIBUTING.md.**
237+
238+
### Format Structure
239+
240+
```
241+
<type>(<scope>): <subject>
242+
<BLANK LINE>
243+
<body>
244+
<BLANK LINE>
245+
<footer>
246+
```
247+
248+
### Required Types
249+
250+
- **feat**: A new feature
251+
- **fix**: A bug fix
252+
- **docs**: Documentation-only changes
253+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
254+
- **refactor**: A code change that neither fixes a bug nor adds a feature
255+
- **perf**: A code change that improves performance
256+
- **test**: Adding missing tests
257+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
258+
- **deps**: Updates about dependencies
259+
260+
### Scope Guidelines
261+
262+
- Use package names for package-specific changes: `core`, `mock`, `cluster`, `utils`, etc.
263+
- Use feature areas for cross-package changes: `loader`, `plugin`, `config`, etc.
264+
- Use component names for specific functionality: `application`, `agent`, `context`, etc.
265+
266+
### Subject Guidelines
267+
268+
- Use succinct words to describe what you did in the commit change
269+
- Use imperative, present tense: "change" not "changed" nor "changes"
270+
- Don't capitalize first letter
271+
- No period (.) at the end
272+
273+
### Body Guidelines (Optional)
274+
275+
- Add more content if the subject is not self-explanatory enough
276+
- Explain the purpose or reason for the commit
277+
- Include motivation for the change and contrasts with previous behavior
278+
279+
### Footer Guidelines
280+
281+
- **Breaking Changes**: Note clearly with "BREAKING CHANGE:" prefix
282+
- **Related Issues**: Use format like "Closes #1, Closes #2, #3"
283+
- **Cross-references**: Reference related repos like "eggjs/egg-core#123"
284+
285+
### Examples
286+
287+
```
288+
feat(core): add support for async configuration loading
289+
290+
Allow configuration files to export async functions for dynamic config loading.
291+
This enables loading configuration from external services or databases.
292+
293+
Closes #123
294+
```
295+
296+
```
297+
fix(mock): resolve memory leak in test cleanup
298+
299+
The mock cleanup process was not properly disposing of event listeners,
300+
causing memory leaks during test runs.
301+
302+
Fixes #456
303+
```
304+
305+
```
306+
docs(tsconfig): update README with vitest integration examples
307+
308+
Add examples showing how to configure vitest with the tsconfig package.
309+
Include setup instructions and common configuration patterns.
310+
```

0 commit comments

Comments
 (0)