@crimsonsunset/jsg-logger 1.8.4 → 1.8.5

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.d.ts +19 -0
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to the JSG Logger project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.8.5] - 2026-03-28 🏷️ **configure() TypeScript types**
9
+
10
+ ### Added
11
+ - **`configure()` TypeScript types** — `JSGLogger.configure(partialConfig?)` is now typed in `index.d.ts`. The method already existed in the JS implementation (1.8.4) but was missing from the type definitions, causing `any`-cast workarounds in consuming projects.
12
+
13
+ ### Migration
14
+ Replace `JSGLogger.getInstanceSync(loggerConfig)` in post-init contexts (e.g. Next.js `instrumentation-client.ts`) with:
15
+ ```ts
16
+ JSGLogger.configure(loggerConfig);
17
+ ```
18
+ This merges config into the running singleton without triggering the reinit guard or wiping registered transports.
19
+
20
+ ---
21
+
8
22
  ## [1.8.3] - 2026-03-28 🔌 **addTransport() API**
9
23
 
10
24
  ### Added
package/index.d.ts CHANGED
@@ -231,6 +231,25 @@ export interface JSGLogger {
231
231
  */
232
232
  getInstanceSync(config?: JSGLoggerConfig): LoggerInstanceType;
233
233
 
234
+ /**
235
+ * Update config on an already-initialized singleton without reinitializing.
236
+ * Merges the provided partial config into the running instance, preserving all
237
+ * registered transports. Use this instead of getInstanceSync(config) when the
238
+ * singleton may already be initialized (e.g. by module-level auto-init).
239
+ *
240
+ * If the singleton has not yet been initialized, behaves like getInstanceSync(config).
241
+ *
242
+ * @param partialConfig - Partial config to merge into the running instance
243
+ * @returns The enhanced logger exports with controls API
244
+ *
245
+ * @example
246
+ * ```ts
247
+ * // instrumentation-client.ts — configure project name + display before anything uses the logger
248
+ * JSGLogger.configure({ projectName: 'My App', display: { timestamp: true } });
249
+ * ```
250
+ */
251
+ configure(partialConfig?: Partial<JSGLoggerConfig>): LoggerInstanceType;
252
+
234
253
  /**
235
254
  * Add a transport to the running singleton without reinitializing.
236
255
  * Safe to call even after the singleton was initialized by module-level code or a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crimsonsunset/jsg-logger",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "type": "module",
5
5
  "description": "Multi-environment logger with smart detection, file-level overrides, and beautiful console formatting. Test it live: https://logger.joesangiorgio.com/",
6
6
  "main": "index.js",