hazo_config 2.1.4 → 2.1.6
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 +16 -0
- package/dist/components/app_config.js +1 -1
- package/dist/components/app_config_list_editor/app_config_list_editor.js +1 -1
- package/dist/components/app_config_list_editor/components/color_swatch_picker.js +1 -1
- package/dist/components/app_config_list_editor/components/edit_modal.js +1 -1
- package/dist/components/app_config_list_editor/components/empty_state.js +1 -1
- package/dist/components/app_config_list_editor/components/import_export_buttons.js +1 -1
- package/dist/components/app_config_list_editor/components/list_item_row.js +1 -1
- package/dist/components/app_config_list_editor/components/save_status_indicator.js +1 -1
- package/dist/components/app_config_list_editor/components/search_bar.js +1 -1
- package/dist/components/config_editor.js +1 -1
- package/dist/components/config_viewer.js +1 -1
- package/dist/components/example_component.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/lib/config_loader.d.ts.map +1 -1
- package/dist/lib/config_loader.js +35 -6
- package/package.json +8 -5
package/CHANGE_LOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.6 — 2026-05-29
|
|
4
|
+
|
|
5
|
+
### Changed (internal — no API surface change)
|
|
6
|
+
- `cn()` consolidation: deleted local `src/lib/utils.ts` and dropped the `cn` re-export from the package barrel. 17 internal components (incl. `app_config_list_editor/*` and `ui/*`) now `import { cn } from 'hazo_ui'`. No external consumers found via grep.
|
|
7
|
+
- `hazo_ui ^3.1.0` added to `peerDependencies` (consequence of the `cn` migration).
|
|
8
|
+
- `clsx` and `tailwind-merge` removed from `dependencies` (no longer used directly).
|
|
9
|
+
- Added `design/feature_requests/INDEX.md` (audit-warning backfill).
|
|
10
|
+
|
|
11
|
+
## 2.1.5
|
|
12
|
+
|
|
13
|
+
- chore: bump `hazo_connect` devDep range to `^2.7.3` to match workspace canonical (no functional change).
|
|
14
|
+
|
|
15
|
+
## 2.1.4
|
|
16
|
+
|
|
17
|
+
- chore: pre-2.1.5 workspace dep alignment (initial monorepo consolidation snapshot).
|
|
18
|
+
|
|
3
19
|
## 2.1.3
|
|
4
20
|
- chore: upgrade to Tailwind CSS v4 (`tailwindcss`, `@tailwindcss/postcss`); switch PostCSS pipeline to `@tailwindcss/postcss` and drop `autoprefixer`
|
|
5
21
|
- chore: update `globals.css` to v4 syntax (`@import "tailwindcss"`, `@custom-variant dark`, `@config` reference)
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
// AppConfig component for managing database-backed configuration
|
|
3
3
|
// Provides UI for viewing and editing configuration stored in hazo_app_config table
|
|
4
4
|
import React, { useState, useCallback, useMemo } from 'react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
import { RefreshCw, Save, Trash2, Eye, EyeOff, Plus, X } from 'lucide-react';
|
|
7
7
|
import { useAppConfig } from './use_app_config.js';
|
|
8
8
|
import { is_sensitive_field, mask_value, DEFAULT_SENSITIVE_PATTERNS } from './use_config_sections.js';
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// Generic CRUD list editor for arrays of structured objects stored as JSON config
|
|
4
4
|
import { useState, useCallback, useMemo } from 'react';
|
|
5
5
|
import { Plus } from 'lucide-react';
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'hazo_ui';
|
|
7
7
|
import { ListItemRow } from './components/list_item_row.js';
|
|
8
8
|
import { EditModal } from './components/edit_modal.js';
|
|
9
9
|
import { SearchBar } from './components/search_bar.js';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// Color swatch picker component
|
|
3
3
|
// Displays a row of circular color swatches for selection
|
|
4
4
|
import { Check } from 'lucide-react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
export function ColorSwatchPicker({ value, options, on_change, className, }) {
|
|
7
7
|
return (_jsx("div", { className: cn('cls_color_swatch_picker flex flex-wrap gap-2', className), children: options.map((color) => {
|
|
8
8
|
const is_selected = value === color;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// Edit modal component
|
|
3
3
|
// Centered dialog for creating/editing items with dynamic form fields
|
|
4
4
|
import React, { useState, useCallback, useEffect } from 'react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
import { Input } from '../../ui/input.js';
|
|
7
7
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from '../../ui/dialog.js';
|
|
8
8
|
import { Button } from '../../ui/button.js';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// Empty state component
|
|
3
3
|
// Displayed when the list has no items
|
|
4
4
|
import { Inbox, Plus } from 'lucide-react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
export function EmptyState({ item_label, on_add, className, }) {
|
|
7
7
|
return (_jsxs("div", { className: cn('cls_empty_state flex flex-col items-center justify-center py-12 px-4', className), children: [_jsx("div", { className: "w-12 h-12 rounded-full bg-gray-100 flex items-center justify-center mb-3", children: _jsx(Inbox, { className: "w-6 h-6 text-gray-400" }) }), _jsxs("p", { className: "text-sm font-medium text-gray-900 mb-1", children: ["No ", item_label, " yet"] }), _jsxs("p", { className: "text-sm text-gray-500 mb-4", children: ["Get started by adding your first ", item_label.replace(/s$/, ''), "."] }), _jsxs("button", { type: "button", onClick: on_add, className: "inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-white bg-violet-600 hover:bg-violet-700 rounded-full transition-colors", children: [_jsx(Plus, { className: "w-4 h-4" }), "Add your first ", item_label.replace(/s$/, '')] })] }));
|
|
8
8
|
}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// Provides JSON export (download) and import (file picker) with transient status messages
|
|
4
4
|
import { useRef, useState, useCallback, useEffect } from 'react';
|
|
5
5
|
import { Download, Upload } from 'lucide-react';
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'hazo_ui';
|
|
7
7
|
import { validate_import_data, merge_items, export_items_to_json, generate_export_filename, } from '../utils/json_import_export.js';
|
|
8
8
|
export function ImportExportButtons({ items, on_items_change, columns, id_field, title, max_items, }) {
|
|
9
9
|
const file_input_ref = useRef(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Pencil, Trash2 } from 'lucide-react';
|
|
3
|
-
import { cn } from '
|
|
3
|
+
import { cn } from 'hazo_ui';
|
|
4
4
|
export function ListItemRow({ item, index, columns, render_item, render_item_indicator, on_edit, on_delete, }) {
|
|
5
5
|
// Custom render overrides everything
|
|
6
6
|
if (render_item) {
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
// Shows saving/saved/error states inline
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import { Loader2, CheckCircle2, AlertCircle } from 'lucide-react';
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from 'hazo_ui';
|
|
7
7
|
export function SaveStatusIndicator({ status, className, }) {
|
|
8
8
|
const [visible, set_visible] = useState(false);
|
|
9
9
|
useEffect(() => {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// Search bar component
|
|
3
3
|
// Pill-shaped search input with icon, clear button, and item count
|
|
4
4
|
import { Search, X } from 'lucide-react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
export function SearchBar({ value, on_change, item_count, item_label, className, }) {
|
|
7
7
|
return (_jsxs("div", { className: cn('cls_search_bar flex items-center gap-3', className), children: [_jsxs("div", { className: "relative flex-1", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }), _jsx("input", { type: "text", value: value, onChange: (e) => on_change(e.target.value), placeholder: `Search ${item_label}...`, className: "w-full pl-9 pr-8 py-2 text-sm rounded-full border border-gray-200 bg-white focus:outline-none focus:ring-2 focus:ring-violet-500/20 focus:border-violet-300 transition-colors", "aria-label": `Search ${item_label}` }), value && (_jsx("button", { type: "button", onClick: () => on_change(''), className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-5 h-5 flex items-center justify-center rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100", "aria-label": "Clear search", children: _jsx(X, { className: "w-3.5 h-3.5" }) }))] }), _jsxs("span", { className: "text-sm text-gray-500 whitespace-nowrap", children: [item_count, " ", item_label] })] }));
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
// Config editor component for managing configuration
|
|
3
3
|
// Provides a more advanced interface for editing configuration values with sensitive field masking
|
|
4
4
|
import React, { useState, useCallback, useMemo } from 'react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
import { RefreshCw, Save, Trash2, Eye, EyeOff } from 'lucide-react';
|
|
7
7
|
import { useConfigSections, is_sensitive_field, mask_value, DEFAULT_SENSITIVE_PATTERNS } from './use_config_sections.js';
|
|
8
8
|
/**
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// Config viewer component for displaying configuration data
|
|
3
3
|
// Displays configuration sections and values in a readable format with sensitive field masking
|
|
4
4
|
import React, { useState, useCallback, useMemo } from 'react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
import { Pencil, CheckCircle2, XCircle, Eye, EyeOff } from 'lucide-react';
|
|
7
7
|
import { useConfigSections, is_sensitive_field, mask_value, DEFAULT_SENSITIVE_PATTERNS } from './use_config_sections.js';
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from 'hazo_ui';
|
|
5
5
|
import { buttonVariants } from "./button.js";
|
|
6
6
|
const AlertDialog = AlertDialogPrimitive.Root;
|
|
7
7
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
@@ -3,7 +3,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/dist/types
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;mFA2BnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
4
|
import { X } from "lucide-react";
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from 'hazo_ui';
|
|
6
6
|
const Dialog = DialogPrimitive.Root;
|
|
7
7
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
8
|
const DialogPortal = DialogPrimitive.Portal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from 'hazo_ui';
|
|
4
4
|
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
5
5
|
return (_jsx("input", { type: type, className: cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className), ref: ref, ...props }));
|
|
6
6
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_loader.d.ts","sourceRoot":"","sources":["../../src/lib/config_loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"config_loader.d.ts","sourceRoot":"","sources":["../../src/lib/config_loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAU,MAAM,YAAY,CAAA;AAgF3E;;;;;GAKG;AACH,qBAAa,UAAW,YAAW,cAAc;IAC/C,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,kBAAkB,CAAY;IAEtC;;;;OAIG;gBACS,OAAO,EAAE,iBAAiB;IAoCtC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAsB1B;;;;;OAKG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKrD;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAK/D;;;OAGG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAUxD;;;;;OAKG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQtD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAa1C;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAOpC;;;OAGG;IACH,IAAI,IAAI,IAAI;IAmBZ;;;OAGG;IACH,OAAO,IAAI,IAAI;IA0Cf;;;OAGG;IACH,WAAW,IAAI,MAAM;CAGtB"}
|
|
@@ -18,12 +18,26 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import fs from 'fs';
|
|
20
20
|
import path from 'path';
|
|
21
|
+
import { createRequire } from 'module';
|
|
21
22
|
import ini from 'ini';
|
|
22
23
|
import { ConfigErrorCode as EC } from './types.js';
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Optional hazo_core integration — HazoConfigError when available
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
const _require = createRequire(import.meta.url);
|
|
28
|
+
let HazoCoreConfigError = null;
|
|
29
|
+
try {
|
|
30
|
+
const errorsModule = _require('hazo_core/errors');
|
|
31
|
+
HazoCoreConfigError = errorsModule.HazoConfigError ?? null;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// hazo_core not installed — use local fallback below
|
|
35
|
+
}
|
|
23
36
|
/**
|
|
24
|
-
*
|
|
37
|
+
* Local fallback error for when hazo_core is not installed.
|
|
38
|
+
* When hazo_core IS installed, throws HazoConfigError from hazo_core instead.
|
|
25
39
|
*/
|
|
26
|
-
class
|
|
40
|
+
class LocalConfigError extends Error {
|
|
27
41
|
constructor(message, code, originalError) {
|
|
28
42
|
super(message);
|
|
29
43
|
Object.defineProperty(this, "code", {
|
|
@@ -43,6 +57,21 @@ class HazoConfigError extends Error {
|
|
|
43
57
|
this.originalError = originalError;
|
|
44
58
|
}
|
|
45
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Throw a config error — uses hazo_core's HazoConfigError when available,
|
|
62
|
+
* otherwise falls back to the local error class.
|
|
63
|
+
*/
|
|
64
|
+
function throwConfigError(message, code, cause) {
|
|
65
|
+
if (HazoCoreConfigError) {
|
|
66
|
+
throw new HazoCoreConfigError({
|
|
67
|
+
code,
|
|
68
|
+
pkg: 'hazo_config',
|
|
69
|
+
message,
|
|
70
|
+
...(cause instanceof Error ? { cause } : {}),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
throw new LocalConfigError(message, code, cause);
|
|
74
|
+
}
|
|
46
75
|
/**
|
|
47
76
|
* Helper to extract error message from unknown error type
|
|
48
77
|
*/
|
|
@@ -138,7 +167,7 @@ export class HazoConfig {
|
|
|
138
167
|
}
|
|
139
168
|
else {
|
|
140
169
|
this.logger.error(`[HazoConfig] Configuration file not found: ${this.filePath}`);
|
|
141
|
-
|
|
170
|
+
throwConfigError(`Configuration file not found: ${this.filePath}`, EC.FILE_NOT_FOUND);
|
|
142
171
|
}
|
|
143
172
|
}
|
|
144
173
|
else {
|
|
@@ -256,7 +285,7 @@ export class HazoConfig {
|
|
|
256
285
|
catch (error) {
|
|
257
286
|
const message = `Failed to save configuration: ${get_error_message(error)}`;
|
|
258
287
|
this.logger.error(`[HazoConfig] ${message}`, { error: String(error) });
|
|
259
|
-
|
|
288
|
+
throwConfigError(message, EC.WRITE_ERROR, error);
|
|
260
289
|
}
|
|
261
290
|
}
|
|
262
291
|
/**
|
|
@@ -289,12 +318,12 @@ export class HazoConfig {
|
|
|
289
318
|
// Handle file read errors
|
|
290
319
|
if (has_error_code(error) && error.code === 'ENOENT') {
|
|
291
320
|
this.logger.error(`[HazoConfig] Configuration file not found: ${this.filePath}`);
|
|
292
|
-
|
|
321
|
+
throwConfigError(`Configuration file not found: ${this.filePath}`, EC.FILE_NOT_FOUND, error);
|
|
293
322
|
}
|
|
294
323
|
// Handle parse errors
|
|
295
324
|
const message = `Failed to parse configuration: ${get_error_message(error)}`;
|
|
296
325
|
this.logger.error(`[HazoConfig] ${message}`, { error: String(error) });
|
|
297
|
-
|
|
326
|
+
throwConfigError(message, EC.PARSE_ERROR, error);
|
|
298
327
|
}
|
|
299
328
|
}
|
|
300
329
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_config",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "Config wrapper with error handling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -69,11 +69,9 @@
|
|
|
69
69
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
70
70
|
"@radix-ui/react-slot": "^1.2.4",
|
|
71
71
|
"class-variance-authority": "^0.7.0",
|
|
72
|
-
"clsx": "^2.1.1",
|
|
73
72
|
"ini": "^4.1.0",
|
|
74
73
|
"lucide-react": "^0.553.0",
|
|
75
|
-
"server-only": "^0.0.1"
|
|
76
|
-
"tailwind-merge": "^3.5.0"
|
|
74
|
+
"server-only": "^0.0.1"
|
|
77
75
|
},
|
|
78
76
|
"devDependencies": {
|
|
79
77
|
"@storybook/addon-essentials": "^8.0.0",
|
|
@@ -90,7 +88,7 @@
|
|
|
90
88
|
"@types/react-dom": "^18.3.0",
|
|
91
89
|
"@tailwindcss/postcss": "^4.2.4",
|
|
92
90
|
"@vitejs/plugin-react": "^4.2.0",
|
|
93
|
-
"hazo_connect": "^
|
|
91
|
+
"hazo_connect": "^3.0.0",
|
|
94
92
|
"jsdom": "^24.1.3",
|
|
95
93
|
"postcss": "^8.4.49",
|
|
96
94
|
"react": "^18.2.0",
|
|
@@ -102,11 +100,16 @@
|
|
|
102
100
|
"vitest": "^1.6.1"
|
|
103
101
|
},
|
|
104
102
|
"peerDependencies": {
|
|
103
|
+
"hazo_core": "^1.0.0",
|
|
104
|
+
"hazo_ui": "^3.1.0",
|
|
105
105
|
"react": "^18.0.0 || ^19.0.0",
|
|
106
106
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
107
107
|
"tailwindcss": "^4.0.0"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
|
+
"hazo_core": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
110
113
|
"tailwindcss": {
|
|
111
114
|
"optional": true
|
|
112
115
|
}
|