yinzerflow 0.6.14 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0] - 2026-02-20
4
+
5
+ ### Bug Fixes
6
+
7
+ - **Clarify log level threshold behavior** — Fixed logging logic to properly enforce log level thresholds, ensuring messages below the configured level are correctly filtered (f2ff105)
8
+
9
+ ### Internal
10
+
11
+ - **Move bundle check to preflight in publish workflow** — Reorganized publish process to validate bundles earlier in the pipeline (4b42643)
12
+ - **Improve type safety across core flow** — Enhanced type annotations and removed unsafe `typeof` checks in favor of explicit interfaces (36eb059, 1f29acf, 266a1bd)
13
+ - **Restructure logging into three independent channels** — Refactored logging system to separate concerns with per-instance loggers instead of a global singleton, improving isolation and testability (bb7d752, dc9738d, 534c8e7, 86e1207, 5b769d3, 8c10c1f)
14
+ - **Inject logger dependencies throughout middleware** — Threaded logger instances through cookie parser, rate limiter, and hook registry instead of relying on global state (874f6a4, e8277b3)
15
+ - **Consolidate logging configuration** — Unified logging config handling and clarified log level documentation in InternalConfiguration (15b9158, e9888db)
16
+ - **Improve utility functions** — Enhanced time utilities validation logic, added byte size conversion helpers, and removed unused utility functions (2e2a0bf, 004df51, 5e70bd2)
17
+ - **Verify npm credentials before git operations** — Updated publish script to check npm access before attempting git pushes (65dbead)
18
+ - **Remove dayjs dependency** — Eliminated unnecessary dayjs library from project dependencies (36c57ba)
19
+
3
20
  ## [0.6.14] - 2026-02-20
4
21
 
5
22
  ### Bug Fixes
@@ -69,81 +69,44 @@ Options: `string`
69
69
 
70
70
  </aside>
71
71
 
72
- ### logger — @default <span style="color: #2ecc71">`undefined`</span>
72
+ ### logging — @default <span style="color: #2ecc71">`{ level: 'warn', prefix: 'YINZER', personality: true, requests: false }`</span>
73
73
 
74
- Custom logger instance for application logs.
75
-
76
- <span style="color: #3498db">**💡 Tip:**</span> Use `createLogger()` to create custom logger instances with different prefixes or log levels.
74
+ Logging configuration — controls app logger, access logs, and diagnostics. Three independent channels under one key.
77
75
 
78
76
  ```typescript
79
- import { YinzerFlow, createLogger } from "yinzerflow";
80
-
81
- const customLogger = createLogger({
82
- prefix: "MY-APP",
83
- logLevel: "info"
84
- });
85
-
86
- const app = new YinzerFlow({
87
- port: 3000,
88
- logger: customLogger,
89
- });
90
- ```
91
-
92
- <aside>
93
-
94
- Options: `Logger | undefined`
95
-
96
- - ✅ `undefined`: Uses built-in logger (default)
97
- - 🎨 `Logger`: Custom logger instance via `createLogger()`
98
-
99
- <span style="color: #3498db">🔗 See [Logging Documentation](../core/logging.md) for details</span>
100
-
101
- </aside>
102
-
103
- ### networkLogs — @default <span style="color: #2ecc71">`false`</span>
104
-
105
- Enable nginx-style network request/response logging.
106
-
107
- <span style="color: #e74c3c">**⚠️ Warning:**</span> Network logs are separate from application logs and can generate significant output in high-traffic scenarios.
77
+ import { YinzerFlow } from "yinzerflow";
108
78
 
109
- ```typescript
110
79
  const app = new YinzerFlow({
111
80
  port: 3000,
112
- networkLogs: true, // Enable network logging
81
+ logging: {
82
+ level: "info", // 'off' | 'error' | 'warn' | 'info' | 'debug'
83
+ prefix: "MY-APP", // Log line prefix: [MY-APP]
84
+ personality: true, // Pittsburgh personality phrases
85
+ requests: true, // nginx-style access logs
86
+ logger: winstonLogger, // Custom app logger (optional)
87
+ accessLogger: pinoLogger, // Custom access logger (optional)
88
+ diagnostics: { // Framework health monitoring
89
+ slowRequests: "500ms",
90
+ largeResponses: "1mb",
91
+ memory: "30s",
92
+ eventLoop: "100ms",
93
+ rateLimits: true,
94
+ },
95
+ },
113
96
  });
114
97
  ```
115
98
 
116
99
  <aside>
117
100
 
118
- Options: `boolean`
119
-
120
- - 🔴 `false`: Disabled (default, recommended for production)
121
- - 🟢 `true`: Enabled (useful for debugging)
122
-
123
- </aside>
124
-
125
- ### networkLogger — @default <span style="color: #2ecc71">`undefined`</span>
126
-
127
- Custom logger for network logs (nginx-style request/response logging).
101
+ Key settings:
128
102
 
129
- ```typescript
130
- import { YinzerFlow, createLogger } from "yinzerflow";
103
+ - 🔊 `level`: Minimum app log level (`'warn'` default)
104
+ - 🏷️ `prefix`: Log line prefix (`'YINZER'` default)
105
+ - 🎭 `personality`: Pittsburgh phrases (`true` default)
106
+ - 📊 `requests`: Access logs on/off (`false` default)
107
+ - 🔧 `diagnostics`: Health monitoring thresholds (all `false` default)
131
108
 
132
- const networkLogger = createLogger({ prefix: "NETWORK" });
133
-
134
- const app = new YinzerFlow({
135
- port: 3000,
136
- networkLogs: true,
137
- networkLogger, // Route network logs to custom logger
138
- });
139
- ```
140
-
141
- <aside>
142
-
143
- Options: `Logger | undefined`
144
-
145
- - ✅ `undefined`: Uses built-in network logging format (default)
146
- - 🎨 `Logger`: Custom logger for network logs
109
+ <span style="color: #3498db">🔗 See [Logging Documentation](../core/logging.md) for all options, diagnostic presets, and `createLogger()` usage</span>
147
110
 
148
111
  </aside>
149
112
 
@@ -293,7 +256,7 @@ Options: `TimeString | number`
293
256
 
294
257
  - ✅ **Use environment variables**: Store configuration in environment variables for different environments
295
258
  - 🔒 **Start secure**: Begin with strict limits and relax as needed
296
- - 📊 **Enable logging**: Use `networkLogs: true` in development for debugging
259
+ - 📊 **Enable logging**: Use `logging: { requests: true }` in development for debugging
297
260
  - 🎯 **Validate configuration**: Test configuration before deploying to production
298
261
  - 🔑 **Configure proxies**: Set `trustedProxies` for load balancers and CDNs
299
262
  - ⚡ **Optimize for use case**: Adjust limits based on your specific workload
@@ -364,7 +327,10 @@ import { YinzerFlow } from "yinzerflow";
364
327
 
365
328
  const app = new YinzerFlow({
366
329
  port: 3000,
367
- networkLogs: true, // Verbose request logging
330
+ logging: {
331
+ level: "debug",
332
+ requests: true, // Verbose request logging
333
+ },
368
334
  cors: {
369
335
  enabled: true,
370
336
  origin: "*", // Allow all origins (DEV ONLY!)
@@ -588,7 +554,10 @@ const app = new YinzerFlow({
588
554
  port: parseInt(process.env.PORT || "3000"),
589
555
  host: process.env.HOST || "0.0.0.0",
590
556
 
591
- networkLogs: isDevelopment, // Only in development
557
+ logging: {
558
+ level: isDevelopment ? "debug" : "warn",
559
+ requests: isDevelopment, // Only in development
560
+ },
592
561
 
593
562
  cors: {
594
563
  enabled: true,