Skip to content

feat(admin): extract shared settings-config module for CLI and admin UI#672

Open
Ferryx349 wants to merge 3 commits into
cameri:mainfrom
Ferryx349:Settings
Open

feat(admin): extract shared settings-config module for CLI and admin UI#672
Ferryx349 wants to merge 3 commits into
cameri:mainfrom
Ferryx349:Settings

Conversation

@Ferryx349

Copy link
Copy Markdown
Collaborator

Description

Extracts settings read/validate/path logic from src/cli/utils/config.ts into shared runtime modules so the admin settings editor (Phase 3) can reuse the same primitives as the CLI.
Also exports the guided field schema from the configure TUI for admin UI consumption.

Why

The admin console settings editor needs the same dot-path get/set, validation, and guided field metadata that the CLI already uses. Duplicating that logic would drift over time; this PR establishes a single source of truth ahead of the admin UI work.

Related Issue

Fixes:- #664

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89f09b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls

coveralls commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 67.814% (+0.1%) from 67.674% — Ferryx349:Settings into cameri:main

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the CLI’s settings configuration primitives (settings file paths, load/save, dot-path get/set, and validation) into shared runtime modules under src/utils, so both the CLI and the upcoming admin settings editor can reuse the same implementation. It also exports the guided settings schema previously embedded in the CLI configure TUI.

Changes:

  • Introduces shared src/utils/settings-config.ts (settings IO, dot-path helpers, validation) and src/utils/settings-guided-schema.ts (guided field metadata + validators).
  • Updates CLI commands/TUI to consume the shared modules (and turns the old CLI config module into a re-export shim).
  • Adds unit tests for the extracted settings-config and guided schema modules, plus a changeset.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/unit/utils/settings-config.spec.ts Adds unit coverage for parsing, dot-path helpers, defaults-path validation, and guided schema exports.
src/utils/settings-guided-schema.ts New shared guided schema module for reuse by CLI and admin UI.
src/utils/settings-config.ts New shared settings config module (paths, IO, parsing, dot-path ops, schema validation).
src/cli/utils/paths.ts Switches CLI path helpers to re-export shared settings-config path functions.
src/cli/utils/config.ts Replaces prior implementation with re-exports from shared settings-config.
src/cli/tui/menus/configure.ts Uses shared format/path helpers and imports guided schema from the new shared module.
src/cli/commands/config.ts Uses shared settings-config helpers and removes duplicated label/category logic.
.changeset/shared-settings-config-module.md Publishes the refactor as a minor change via changeset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/settings-config.ts Outdated
Comment thread src/utils/settings-config.ts Outdated
Comment thread src/utils/settings-config.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants