hazo_ui 3.1.1 → 3.1.2

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/CHANGE_LOG.md CHANGED
@@ -5,24 +5,36 @@ All notable changes to this 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
- ## v3.1.1 — 2026-05-30
9
-
10
- **Fix:** Bundling failure when hazo_ui is consumed by a Next.js client component.
11
-
12
- `src/utils/logger.ts` did `import { createLogger } from "hazo_core"` at module
13
- top-level. hazo_core's package exports route browser bundles to its
14
- `index.client.js`, which intentionally omits `createLogger` (the factory loads
15
- hazo_logs dynamically, which is Node-only). Static named-import failed bundle
16
- resolution for every downstream consumer that pulled hazo_ui into a client
17
- component, including transitively via `hazo_auth/client`.
18
-
19
- Switched to a namespace import + runtime feature check. When `createLogger` is
20
- present (server bundle), the structured logger is used; otherwise the existing
21
- `console_logger` fallback applies. No public API change.
22
-
23
- Discovered during the gotimer Wave 3 consumer migration. Filing this as a
24
- patch instead of a republish of 3.1.0 to preserve the published artifact's
25
- hash for downstream auditability.
8
+ ## v3.1.2 — 2026-05-30
9
+
10
+ **Fix (supersedes 3.1.1):** Drop the hazo_core import from the logger module
11
+ entirely.
12
+
13
+ 3.1.1 switched to a namespace import + runtime `typeof` check, which works
14
+ under classic webpack and Node but fails under Turbopack — Turbopack tracks
15
+ namespace-member reads against statically-known module exports and flags any
16
+ missing property as a bundle error, even when the property is only read
17
+ defensively.
18
+
19
+ 3.1.2 removes the hazo_core reference from `src/utils/logger.ts`. The default
20
+ logger is now `console_logger`. Server-side consumers that want structured
21
+ correlation-ID-aware logs through hazo_core/hazo_logs should call
22
+ `set_logger(createLogger("hazo_ui"))` from their own server boot. The
23
+ override mechanism is unchanged.
24
+
25
+ Rationale: hazo_ui ships with a top-of-bundle `"use client"` directive, so
26
+ the bundle is bundled for the React client in every consumer. Defaulting to
27
+ a server-only structured logger was always a mismatch; the previous default
28
+ only "worked" because consumers never exercised the bundle in a Turbopack
29
+ client context until the gotimer migration.
30
+
31
+ ## v3.1.1 — 2026-05-30 (superseded by 3.1.2)
32
+
33
+ **Attempted fix:** Switched `src/utils/logger.ts` to a namespace import of
34
+ hazo_core + runtime `typeof` check on `.createLogger`. Did not resolve the
35
+ underlying defect because Turbopack's static analysis still flags the
36
+ missing property read. Retained on npm for traceability but consumers should
37
+ upgrade directly to 3.1.2.
26
38
 
27
39
  ## v3.1.0 — Wave 2 hazo_core wiring
28
40
 
package/dist/index.cjs CHANGED
@@ -4,7 +4,7 @@
4
4
  var clsx = require('clsx');
5
5
  var tailwindMerge = require('tailwind-merge');
6
6
  var React26 = require('react');
7
- var hazoCore = require('hazo_core');
7
+ var hazo_core = require('hazo_core');
8
8
  var client = require('hazo_core/client');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
  var reactSlot = require('@radix-ui/react-slot');
@@ -93,7 +93,6 @@ function _interopNamespace(e) {
93
93
  }
94
94
 
95
95
  var React26__namespace = /*#__PURE__*/_interopNamespace(React26);
96
- var hazoCore__namespace = /*#__PURE__*/_interopNamespace(hazoCore);
97
96
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
98
97
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
99
98
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
@@ -207,7 +206,7 @@ function HazoContextProvider({
207
206
  children
208
207
  }) {
209
208
  const id = React26__namespace.useMemo(
210
- () => correlationId ?? hazoCore.generateRequestId(),
209
+ () => correlationId ?? hazo_core.generateRequestId(),
211
210
  [correlationId]
212
211
  );
213
212
  React26__namespace.useEffect(() => {
@@ -220,33 +219,23 @@ function HazoContextProvider({
220
219
  }, [id, userId]);
221
220
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
222
221
  }
222
+
223
+ // src/utils/logger.ts
223
224
  var console_logger = {
224
225
  info: (m, d) => d ? console.log(`[hazo_ui] ${m}`, d) : console.log(`[hazo_ui] ${m}`),
225
226
  debug: (m, d) => d ? console.debug(`[hazo_ui] ${m}`, d) : console.debug(`[hazo_ui] ${m}`),
226
227
  warn: (m, d) => d ? console.warn(`[hazo_ui] ${m}`, d) : console.warn(`[hazo_ui] ${m}`),
227
228
  error: (m, d) => d ? console.error(`[hazo_ui] ${m}`, d) : console.error(`[hazo_ui] ${m}`)
228
229
  };
229
- function build_default_logger() {
230
- const factory = hazoCore__namespace.createLogger;
231
- if (typeof factory !== "function") return console_logger;
232
- try {
233
- return factory("hazo_ui");
234
- } catch {
235
- return console_logger;
236
- }
237
- }
238
- var current_logger = null;
230
+ var current_logger = console_logger;
239
231
  function set_logger(logger) {
240
- current_logger = logger ?? null;
232
+ current_logger = logger ?? console_logger;
241
233
  }
242
234
  function get_logger() {
243
- if (!current_logger) {
244
- current_logger = build_default_logger();
245
- }
246
235
  return current_logger;
247
236
  }
248
237
  function generateUUID() {
249
- return hazoCore.generateRequestId().slice(4);
238
+ return hazo_core.generateRequestId().slice(4);
250
239
  }
251
240
 
252
241
  // src/lib/hazo_ui_config.ts