mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-24 12:23:07 +00:00
This commit addresses CodeRabbit feedback from PR #186 by adding detailed documentation to all public APIs in the settings module: **Server-side documentation:** - SettingsService class: 12 public methods with parameter and return types - Settings types (settings.ts): All type aliases, interfaces, and constants documented with usage context - Route handlers (8 endpoints): Complete endpoint documentation with request/response schemas - Automaker paths utilities: All 13 path resolution functions fully documented **Client-side documentation:** - useSettingsMigration hook: Migration flow and state documented - Sync functions: Three sync helpers (settings, credentials, project) with usage guidelines - localStorage constants: Clear documentation of migration keys and cleanup strategy All docstrings follow JSDoc format with: - Purpose and behavior description - Parameter documentation with types - Return value documentation - Usage examples where applicable - Cross-references between related functions This improves code maintainability, IDE autocomplete, and developer onboarding. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
30 lines
816 B
TypeScript
30 lines
816 B
TypeScript
/**
|
|
* Common utilities for settings routes
|
|
*
|
|
* Provides logger and error handling utilities shared across all settings endpoints.
|
|
* Re-exports error handling helpers from the parent routes module.
|
|
*/
|
|
|
|
import { createLogger } from "../../lib/logger.js";
|
|
import {
|
|
getErrorMessage as getErrorMessageShared,
|
|
createLogError,
|
|
} from "../common.js";
|
|
|
|
/** Logger instance for settings-related operations */
|
|
export const logger = createLogger("Settings");
|
|
|
|
/**
|
|
* Extract user-friendly error message from error objects
|
|
*
|
|
* Re-exported from parent routes common module for consistency.
|
|
*/
|
|
export { getErrorMessageShared as getErrorMessage };
|
|
|
|
/**
|
|
* Log error with automatic logger binding
|
|
*
|
|
* Convenience function for logging errors with the Settings logger.
|
|
*/
|
|
export const logError = createLogError(logger);
|