@hazeljs/core 0.4.0 → 0.5.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/README.md CHANGED
@@ -1,13 +1,25 @@
1
1
  # @hazeljs/core
2
2
 
3
- **The foundation of HazelJS — DI, routing, and decorators that feel right.**
3
+ **AI-Native Foundation - DI, routing, and decorators built for intelligent applications.**
4
4
 
5
- Stop wiring boilerplate. Build APIs with dependency injection, decorator-based routing, and middleware that just works. TypeScript-first, production-ready, zero Express dependency.
5
+ Part of the HazelJS AI-Native Backend Framework. Stop wiring boilerplate. Build APIs with dependency injection, decorator-based routing, and middleware that just works. TypeScript-first, production-ready, zero Express dependency.
6
+
7
+ **🚀 Trusted by 200K+ monthly downloads • 37+ GitHub stars • 15+ daily active developers**
6
8
 
7
9
  [![npm version](https://img.shields.io/npm/v/@hazeljs/core.svg)](https://www.npmjs.com/package/@hazeljs/core)
8
10
  [![npm downloads](https://img.shields.io/npm/dm/@hazeljs/core)](https://www.npmjs.com/package/@hazeljs/core)
9
11
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
10
12
 
13
+ ## Why @hazeljs/core?
14
+
15
+ Built as the foundation for **AI-native applications** - not just another framework. When you combine @hazeljs/core with our AI packages (@hazeljs/ai, @hazeljs/agent, @hazeljs/rag), you get a complete stack for intelligent backends without glue code.
16
+
17
+ **Perfect for:**
18
+ - AI startups building production agents
19
+ - Teams replacing NestJS/Express with AI-native backends
20
+ - Developers who want TypeScript-first architecture
21
+ - Projects needing dependency injection without complexity
22
+
11
23
  ## Features
12
24
 
13
25
  - 🎯 **Dependency Injection** - Advanced DI with Singleton, Transient, and Request scopes
@@ -557,4 +569,4 @@ Apache 2.0 © [HazelJS](https://hazeljs.ai)
557
569
  - [Documentation](https://hazeljs.ai/docs)
558
570
  - [GitHub](https://github.com/hazel-js/hazeljs)
559
571
  - [Issues](https://github.com/hazel-js/hazeljs/issues)
560
- - [Discord](https://discord.gg/rnxaDcXx)
572
+ - [Discord](https://discord.gg/xe495BvE)
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAwQvD,eAAO,MAAM,aAAa,GACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,MAAM,IAAI,KACf,IAyBF,CAAC;AAQF,QAAA,MAAM,cAAc;0BALO,OAAO;CAOhC,CAAC;AAGH,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAoSvD,eAAO,MAAM,aAAa,GACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,MAAM,IAAI,KACf,IAyBF,CAAC;AAQF,QAAA,MAAM,cAAc;0BALO,OAAO;CAOhC,CAAC;AAGH,eAAe,cAAc,CAAC"}
package/dist/logger.js CHANGED
@@ -178,10 +178,24 @@ if (logEnabled) {
178
178
  const { level, message, timestamp, ...metadata } = info;
179
179
  let msg = `${timestamp} [${String(level).toUpperCase()}] ${message}`;
180
180
  if (Object.keys(metadata).length > 0) {
181
+ // Use the same comprehensive circular reference handling as console logger
182
+ const seen = new WeakSet();
181
183
  msg += ` | ${JSON.stringify(metadata, (key, val) => {
184
+ // Skip known circular references
182
185
  if (key === 'socket' || key === 'parser' || key === 'res' || key === 'req') {
183
186
  return '[Circular]';
184
187
  }
188
+ // Skip Node.js internal objects
189
+ if (key === '_idlePrev' || key === '_idleNext' || key === 'cleanupInterval') {
190
+ return '[Internal]';
191
+ }
192
+ // Handle circular references
193
+ if (typeof val === 'object' && val !== null) {
194
+ if (seen.has(val)) {
195
+ return '[Circular]';
196
+ }
197
+ seen.add(val);
198
+ }
185
199
  return val;
186
200
  })}`;
187
201
  }
@@ -194,10 +208,24 @@ if (logEnabled) {
194
208
  const { level, message, timestamp, ...metadata } = info;
195
209
  let msg = `${timestamp} [${String(level).toUpperCase()}] ${message}`;
196
210
  if (Object.keys(metadata).length > 0) {
211
+ // Use the same comprehensive circular reference handling as console logger
212
+ const seen = new WeakSet();
197
213
  msg += ` | ${JSON.stringify(metadata, (key, val) => {
214
+ // Skip known circular references
198
215
  if (key === 'socket' || key === 'parser' || key === 'res' || key === 'req') {
199
216
  return '[Circular]';
200
217
  }
218
+ // Skip Node.js internal objects
219
+ if (key === '_idlePrev' || key === '_idleNext' || key === 'cleanupInterval') {
220
+ return '[Internal]';
221
+ }
222
+ // Handle circular references
223
+ if (typeof val === 'object' && val !== null) {
224
+ if (seen.has(val)) {
225
+ return '[Circular]';
226
+ }
227
+ seen.add(val);
228
+ }
201
229
  return val;
202
230
  })}`;
203
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hazeljs/core",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Core HazelJS framework - Dependency injection, routing, decorators, and base functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -63,5 +63,5 @@
63
63
  "url": "https://github.com/hazeljs/hazel-js/issues"
64
64
  },
65
65
  "homepage": "https://hazeljs.ai",
66
- "gitHead": "3cde5425a60eed497a777795724c93a926c69155"
66
+ "gitHead": "c23649207e4aba030252b8763752f7f10776f256"
67
67
  }