Skip to content

Commit bbbdb31

Browse files
committed
docs: add changelog page and update preversion script to automate changelog updates
1 parent d06a36a commit bbbdb31

4 files changed

Lines changed: 324 additions & 2 deletions

File tree

changelog.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Changelog
2+
3+
## [1.0.3] - 2025-10-03
4+
### Added
5+
- **Server**
6+
- Added env `SERVER_SKIP_HEALTHZ` option to allow bypassing health check endpoints.
7+
8+
### Changed
9+
- **Logger**
10+
- Added env `LOGGER_PRETTY_COLORIZE` option to enable colorized console output for `LOGGER_PRETTY` enabled.
11+
---
12+
13+
## [1.0.2] - 2025-09-27
14+
### Added
15+
- **Controller**
16+
- Added **version prefix support** for controllers and methods.
17+
Example:
18+
```ts
19+
import { Controller, Get, Version } from '@catbee/utils';
20+
@Version('v1')
21+
@Controller('users')
22+
export class UserController {
23+
@Get()
24+
getUsers() {}
25+
}
26+
```
27+
Routes will be exposed as `/v1/users`.
28+
29+
### Fixed
30+
- **Utils**
31+
- Missing exports: added `date`, `performance`, `stream`, and `type` modules to public API surface.
32+
- Ensures tree-shakable builds include all expected utilities.
33+
34+
---
35+
36+
## [1.0.1] - 2025-09-25
37+
- **Patch release** with minor metadata updates.
38+
(No functional changes to runtime code.)
39+
40+
---
41+
42+
## [1.0.0] - 2025-09-24
43+
### Added
44+
- **Decorators**
45+
- `@ReqCookie(key?: string)`Extract cookies directly into controller parameters.
46+
- `@ReqId()`Injects the current request's unique identifier into controllers/methods.
47+
48+
- **Dependency Injection (DI)**
49+
- Introduced `DIContainer` for lightweight dependency injection.
50+
- Added `@Injectable()` decorator for services.
51+
- Added `@Inject()` decorator for constructor/property injection.
52+
53+
- **HTTP & Utility Decorators**
54+
- `@Headers`Access request headers.
55+
- `@Cache(ttl)`Cache route responses for a configurable TTL.
56+
- `@RateLimit(limit, window)`Apply rate limiting on routes.
57+
- `@ContentType(type)`Override default content type.
58+
- `@Version(v)`Attach version metadata to routes.
59+
- `@Timeout(ms)`Automatically abort long-running requests.
60+
- `@Log()`Enable per-route request logging.
61+
62+
### Changed
63+
- **Logger**
64+
- **Refactored** logger type from `pino.Logger` → `PinoLogger` to align with typings.
65+
- Enhanced `setupLogger`:
66+
- New `isGlobal` parameter for toggling between global and scoped loggers.
67+
- Reintroduced serializers for consistent log formatting.
68+
- `getLogger()` updated to support **fresh instance creation** when needed.
69+
70+
- **Decorators**
71+
- Decorators enhanced to **support both class-level and method-level usage** for flexibility.
72+
73+
---
74+
75+
## [0.0.7] - 2025-09-07
76+
### Fixed
77+
- **Server**
78+
- Replaced static imports with **dynamic imports** for optional middleware/features.
79+
- Prevents errors in environments where some dependencies are not installed.
80+
81+
---
82+
83+
## [0.0.6] - 2025-08-27
84+
### Added
85+
- **Utils**
86+
- Added `getPaginationParams` utility for handling pagination parameters.
87+
88+
- **Middleware**
89+
- Added logger in request namespace for enhanced request tracking.
90+
91+
---
92+
93+
## [0.0.5] - 2025-08-22
94+
### Added
95+
- **Server Core**
96+
- Introduced **production-grade Express server bootstrap**:
97+
- Security via Helmet, CORS, and configurable rate limiting.
98+
- Health checks & monitoring endpoints.
99+
- Graceful shutdown handling.
100+
- Middleware enhancements for reliability in microservices.
101+
102+
- **Utils**
103+
- Extended `deepObjMerge`:
104+
- Handles circular references.
105+
- Supports merging **special objects** (e.g., Date, Buffer).
106+
- Improved support for **typed arrays**.
107+
- Added request utilities for handling HTTP requests.
108+
- Introduced new utility methods for various operations.
109+
110+
---
111+
112+
## [0.0.4] - 2025-08-17
113+
### Changed
114+
- **Logger**
115+
- Standardized request ID field: renamed `reqId``requestId`.
116+
117+
### Fixed
118+
- **Server**
119+
- Correctly typed Express `Request` objects in context middleware.
120+
- Request context middleware now sets unique request identifiers automatically.
121+
122+
---
123+
124+
## [0.0.3] - 2025-08-16
125+
### Fixed
126+
- **Utils**
127+
- Fixed incorrect/missing exports in utility modules.
128+
- Added logger typings for better IDE IntelliSense.
129+
130+
---
131+
132+
## [0.0.2] - 2025-08-15
133+
### Added
134+
- **Decorators**
135+
- Initial decorator utility set:
136+
- `@Req()`, `@Res()`, `@Query()`, `@Body()`, etc.
137+
- Provided core request lifecycle metadata helpers.
138+
139+
---
140+
141+
## [0.0.1] - 2025-08-08
142+
### Added
143+
- **Core Modules**
144+
- Initial utility helpers for arrays, async handling, and object operations.
145+
- Context-aware logger using pino.
146+
- Environment parser and validator with type-safe helpers.
147+
- Standard error response classes and API response formats.
148+
- ID generation and validation utilities.
149+
150+
- **Middleware**
151+
- Core middleware utilities for request/response handling.
152+
- Foundation for attaching custom middlewares.
153+
154+
---
155+
156+
# Notes
157+
- This project follows **semantic versioning**:
158+
- **MAJOR**Breaking changes.
159+
- **MINOR**Backward-compatible features.
160+
- **PATCH**Fixes and small improvements.

docs/docusaurus.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ const config: Config = {
229229
position: 'left',
230230
label: 'Docs',
231231
},
232-
{ to: '/license', label: 'License', position: 'left' },
232+
{ to: '/license/', label: 'License', position: 'left' },
233+
{ to: '/changelog/', label: 'Changelog', position: 'left' },
233234
// { to: '/contributors', label: 'Contributors', position: 'left' },
234235
{ href: 'https://github.com/catbee-technologies/catbee-utils', label: 'GitHub', position: 'right' },
235236
{ href: 'https://www.npmjs.com/package/@catbee/utils', label: 'NPM', position: 'right' }

docs/src/pages/changelog.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Changelog
2+
3+
## [1.0.3] - 2025-10-03
4+
### Added
5+
- **Server**
6+
- Added env `SERVER_SKIP_HEALTHZ` option to allow bypassing health check endpoints.
7+
8+
### Changed
9+
- **Logger**
10+
- Added env `LOGGER_PRETTY_COLORIZE` option to enable colorized console output for `LOGGER_PRETTY` enabled.
11+
---
12+
13+
## [1.0.2] - 2025-09-27
14+
### Added
15+
- **Controller**
16+
- Added **version prefix support** for controllers and methods.
17+
Example:
18+
```ts
19+
import { Controller, Get, Version } from '@catbee/utils';
20+
@Version('v1')
21+
@Controller('users')
22+
export class UserController {
23+
@Get()
24+
getUsers() {}
25+
}
26+
```
27+
Routes will be exposed as `/v1/users`.
28+
29+
### Fixed
30+
- **Utils**
31+
- Missing exports: added `date`, `performance`, `stream`, and `type` modules to public API surface.
32+
- Ensures tree-shakable builds include all expected utilities.
33+
34+
---
35+
36+
## [1.0.1] - 2025-09-25
37+
- **Patch release** with minor metadata updates.
38+
(No functional changes to runtime code.)
39+
40+
---
41+
42+
## [1.0.0] - 2025-09-24
43+
### Added
44+
- **Decorators**
45+
- `@ReqCookie(key?: string)`Extract cookies directly into controller parameters.
46+
- `@ReqId()`Injects the current request's unique identifier into controllers/methods.
47+
48+
- **Dependency Injection (DI)**
49+
- Introduced `DIContainer` for lightweight dependency injection.
50+
- Added `@Injectable()` decorator for services.
51+
- Added `@Inject()` decorator for constructor/property injection.
52+
53+
- **HTTP & Utility Decorators**
54+
- `@Headers`Access request headers.
55+
- `@Cache(ttl)`Cache route responses for a configurable TTL.
56+
- `@RateLimit(limit, window)`Apply rate limiting on routes.
57+
- `@ContentType(type)`Override default content type.
58+
- `@Version(v)`Attach version metadata to routes.
59+
- `@Timeout(ms)`Automatically abort long-running requests.
60+
- `@Log()`Enable per-route request logging.
61+
62+
### Changed
63+
- **Logger**
64+
- **Refactored** logger type from `pino.Logger` → `PinoLogger` to align with typings.
65+
- Enhanced `setupLogger`:
66+
- New `isGlobal` parameter for toggling between global and scoped loggers.
67+
- Reintroduced serializers for consistent log formatting.
68+
- `getLogger()` updated to support **fresh instance creation** when needed.
69+
70+
- **Decorators**
71+
- Decorators enhanced to **support both class-level and method-level usage** for flexibility.
72+
73+
---
74+
75+
## [0.0.7] - 2025-09-07
76+
### Fixed
77+
- **Server**
78+
- Replaced static imports with **dynamic imports** for optional middleware/features.
79+
- Prevents errors in environments where some dependencies are not installed.
80+
81+
---
82+
83+
## [0.0.6] - 2025-08-27
84+
### Added
85+
- **Utils**
86+
- Added `getPaginationParams` utility for handling pagination parameters.
87+
88+
- **Middleware**
89+
- Added logger in request namespace for enhanced request tracking.
90+
91+
---
92+
93+
## [0.0.5] - 2025-08-22
94+
### Added
95+
- **Server Core**
96+
- Introduced **production-grade Express server bootstrap**:
97+
- Security via Helmet, CORS, and configurable rate limiting.
98+
- Health checks & monitoring endpoints.
99+
- Graceful shutdown handling.
100+
- Middleware enhancements for reliability in microservices.
101+
102+
- **Utils**
103+
- Extended `deepObjMerge`:
104+
- Handles circular references.
105+
- Supports merging **special objects** (e.g., Date, Buffer).
106+
- Improved support for **typed arrays**.
107+
- Added request utilities for handling HTTP requests.
108+
- Introduced new utility methods for various operations.
109+
110+
---
111+
112+
## [0.0.4] - 2025-08-17
113+
### Changed
114+
- **Logger**
115+
- Standardized request ID field: renamed `reqId``requestId`.
116+
117+
### Fixed
118+
- **Server**
119+
- Correctly typed Express `Request` objects in context middleware.
120+
- Request context middleware now sets unique request identifiers automatically.
121+
122+
---
123+
124+
## [0.0.3] - 2025-08-16
125+
### Fixed
126+
- **Utils**
127+
- Fixed incorrect/missing exports in utility modules.
128+
- Added logger typings for better IDE IntelliSense.
129+
130+
---
131+
132+
## [0.0.2] - 2025-08-15
133+
### Added
134+
- **Decorators**
135+
- Initial decorator utility set:
136+
- `@Req()`, `@Res()`, `@Query()`, `@Body()`, etc.
137+
- Provided core request lifecycle metadata helpers.
138+
139+
---
140+
141+
## [0.0.1] - 2025-08-08
142+
### Added
143+
- **Core Modules**
144+
- Initial utility helpers for arrays, async handling, and object operations.
145+
- Context-aware logger using pino.
146+
- Environment parser and validator with type-safe helpers.
147+
- Standard error response classes and API response formats.
148+
- ID generation and validation utilities.
149+
150+
- **Middleware**
151+
- Core middleware utilities for request/response handling.
152+
- Foundation for attaching custom middlewares.
153+
154+
---
155+
156+
# Notes
157+
- This project follows **semantic versioning**:
158+
- **MAJOR**Breaking changes.
159+
- **MINOR**Backward-compatible features.
160+
- **PATCH**Fixes and small improvements.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"build:start": "npm run build && npm run start",
2424
"lint": "eslint src tests",
2525
"lint:fix": "eslint --fix src tests",
26-
"preversion": "npm run check-license && npm run lint && npm run build:start && npm run test",
26+
"preversion": "npm run check-license && docs:update-changelog && npm run lint && npm run build:start && npm run test",
2727
"pretest": "npm run build",
2828
"dryrun": "npm pack --dry-run",
2929
"dryrun:list": "npm pack --dry-run --json > pack-output.json",
@@ -34,6 +34,7 @@
3434
"add-license": "npx license-check-and-add add -f file-banner-lic.json && npm run lint:fix",
3535
"check-license": "npx license-check-and-add check -f file-banner-lic.json",
3636
"deps:update": "npx npm-check-updates -u --target latest && npm install",
37+
"docs:update-changelog": "rimraf docs/src/pages/changelog.md && cpx changelog.md docs/src/pages/ && git add .",
3738
"docs:install": "cd docs && npm install",
3839
"docs:start": "cd docs && npm run start",
3940
"docs:build": "cd docs && npm run build",

0 commit comments

Comments
 (0)