Skip to content

Commit dce4beb

Browse files
committed
Add changelog, contributing guide, Makefile, and scripts
1 parent 1dfc2ec commit dce4beb

File tree

5 files changed

+276
-0
lines changed

5 files changed

+276
-0
lines changed

CHANGELOG.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
---
9+
10+
## [Unreleased]
11+
## [1.0.1] - 2025-10-06
12+
13+
### Added
14+
-
15+
16+
### Changed
17+
-
18+
19+
### Removed
20+
-
21+
22+
23+
## [1.0.0] - 2025-10-06
24+
25+
### Added
26+
27+
-
28+
29+
### Changed
30+
31+
-
32+
33+
### Removed
34+
35+
-
36+
37+
## [0.1.2] - 2025-10-06
38+
39+
### Added
40+
41+
-
42+
43+
### Changed
44+
45+
-
46+
47+
### Removed
48+
49+
-
50+
51+
## [0.1.1] - 2025-10-06
52+
53+
### Added
54+
55+
-
56+
57+
### Changed
58+
59+
-
60+
61+
### Removed
62+
63+
-
64+
65+
### Added
66+
67+
- Modular C++ framework structure with `core`, `orm`, `cli`, `docs`, `middleware`, `websocket`, `devtools`, `examples`.
68+
- `App` class for simplified HTTP server setup.
69+
- Router system supporting dynamic route parameters (`/users/{id}` style).
70+
- JSON response wrapper using `nlohmann::json`.
71+
- Middleware system for request handling.
72+
- Example endpoints `/hello`, `/ping`, and `/users/{id}`.
73+
- Thread-safe signal handling for graceful shutdown.
74+
- Basic configuration system (`Config` class) to manage JSON config files.
75+
76+
### Changed
77+
78+
- Logger integrated using `spdlog` with configurable log levels.
79+
- Improved request parameter extraction for performance.
80+
81+
### Fixed
82+
83+
- Path parameter extraction to correctly handle `string_view` types.
84+
- Fixed default response for unmatched routes (`404` JSON message).
85+
86+
---
87+
88+
## [0.1.0] - 2025-10-06
89+
90+
### Added
91+
92+
- Initial release of core module with working HTTP server.
93+
- Basic routing system and request handlers.
94+
- Simple example endpoints demonstrating JSON and text responses.
95+
- Thread-safe server shutdown handling.
96+
- Integration of performance measurement scripts (FlameGraph ready).
97+
98+
### Changed
99+
100+
- Optimized route parameter parsing to avoid `boost::regex` overhead.
101+
102+
### Fixed
103+
104+
- Compilation errors due to `string_view` mismatch in request handler.
105+
- Minor bug fixes in App initialization and signal handling.
106+
107+
---
108+
109+
## [0.0.1] - Draft
110+
111+
- Project skeleton created.
112+
- Basic CMake setup and folder structure.
113+
- Placeholder modules for `core`, `orm`, and `examples`.

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Pull Request Template
2+
3+
## Description
4+
5+
Please include a summary of the changes and the motivation behind this PR.
6+
Also include relevant issues or feature requests that this PR addresses.
7+
8+
Fixes # (issue)
9+
10+
---
11+
12+
## Type of Change
13+
14+
Please delete options that are not relevant:
15+
16+
- [ ] Bug fix (non-breaking change)
17+
- [ ] New feature (non-breaking change)
18+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
19+
- [ ] Documentation update
20+
- [ ] Tests / CI improvements
21+
22+
---
23+
24+
## How Has This Been Tested?
25+
26+
Please describe the tests you ran to verify your changes.
27+
Provide instructions so others can reproduce. Examples:
28+
29+
```bash
30+
# Build project
31+
mkdir build && cd build
32+
cmake ..
33+
make -j$(nproc)
34+
35+
# Run unit tests
36+
./test_core
37+
```
38+
39+
Include details of your test coverage if applicable.
40+
41+
## Checklist
42+
43+
My code follows the style guidelines of this project
44+
45+
I have performed a self-review of my own code
46+
47+
I have commented my code, particularly in hard-to-understand areas
48+
49+
I have updated documentation if necessary
50+
51+
I have added tests that prove my fix is effective or that my feature works
52+
53+
All new and existing tests passed
54+
55+
## Additional Notes
56+
57+
Add any other information or context about the pull request here.
58+
Screenshots, benchmarks, or flamegraphs are welcome if they demonstrate improvements or fixes.

Makefile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
VERSION ?= v0.1.0
2+
BRANCH_DEV = dev
3+
BRANCH_MAIN = main
4+
5+
.PHONY: help release commit push merge tag test changelog
6+
7+
help:
8+
@echo "Available commands:"
9+
@echo " make commit - Add and commit all files (on $(BRANCH_DEV) branch)"
10+
@echo " make push - Push the $(BRANCH_DEV) branch"
11+
@echo " make merge - Merge $(BRANCH_DEV) into $(BRANCH_MAIN)"
12+
@echo " make tag VERSION=vX.Y.Z - Create and push a Git tag (default: $(VERSION))"
13+
@echo " make release VERSION=vX.Y.Z - Full release: changelog + commit + push + merge + tag"
14+
@echo " make test - Compile and run tests"
15+
@echo " make changelog - Update CHANGELOG.md using script"
16+
17+
commit:
18+
git checkout $(BRANCH_DEV)
19+
@if [ -n "$$(git status --porcelain)" ]; then \
20+
echo "📝 Committing changes..."; \
21+
git add .; \
22+
git commit -m "chore(release): prepare $(VERSION)"; \
23+
else \
24+
echo "✅ Nothing to commit."; \
25+
fi
26+
27+
push:
28+
git push origin $(BRANCH_DEV)
29+
30+
merge:
31+
git checkout $(BRANCH_MAIN)
32+
git merge --no-ff --no-edit $(BRANCH_DEV)
33+
git push origin $(BRANCH_MAIN)
34+
35+
tag:
36+
@if git rev-parse $(VERSION) >/dev/null 2>&1; then \
37+
echo "❌ Tag $(VERSION) already exists."; \
38+
exit 1; \
39+
else \
40+
echo "🏷️ Creating annotated tag $(VERSION)..."; \
41+
git tag -a $(VERSION) -m "Release version $(VERSION)"; \
42+
git push origin $(VERSION); \
43+
fi
44+
45+
release:
46+
make changelog
47+
make commit
48+
make push
49+
make merge
50+
make tag VERSION=$(VERSION)
51+
52+
test:
53+
cd build && ctest --output-on-failure
54+
55+
changelog:
56+
bash scripts/update_changelog.sh

scripts/changelog-release.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
echo "Version ? (ex: 0.1.1)"
4+
read VERSION
5+
TODAY=$(date +%F)
6+
7+
echo -e "## [$VERSION] - $TODAY\n### Added\n- \n\n### Changed\n- \n\n### Removed\n- \n\n" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md

scripts/update_changelog.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
CHANGELOG_FILE="CHANGELOG.md"
4+
5+
echo "📝 Entrez la nouvelle version (ex: 0.1.1) :"
6+
read VERSION
7+
8+
if grep -q "## \[$VERSION\]" "$CHANGELOG_FILE"; then
9+
echo "❌ La version $VERSION existe déjà dans le changelog."
10+
exit 1
11+
fi
12+
13+
TODAY=$(date +%F)
14+
15+
if [ ! -f "$CHANGELOG_FILE" ]; then
16+
echo "❌ Le fichier $CHANGELOG_FILE n'existe pas."
17+
exit 1
18+
fi
19+
20+
NEW_ENTRY="## [$VERSION] - $TODAY
21+
22+
### Added
23+
-
24+
25+
### Changed
26+
-
27+
28+
### Removed
29+
-
30+
"
31+
32+
awk -v new_entry="$NEW_ENTRY" '
33+
BEGIN { inserted=0 }
34+
/## \[Unreleased\]/ && !inserted {
35+
print $0 "\n" new_entry
36+
inserted=1
37+
next
38+
}
39+
{ print }
40+
' "$CHANGELOG_FILE" > "$CHANGELOG_FILE.tmp" && mv "$CHANGELOG_FILE.tmp" "$CHANGELOG_FILE"
41+
42+
echo "✅ Bloc version $VERSION ajouté dans $CHANGELOG_FILE."

0 commit comments

Comments
 (0)