Skip to content

dx: extract hardcoded known-preset list in config.ts into a shared constant #67

@George-iam

Description

@George-iam

In src/storage/config.ts, the parseConfig function contains a hardcoded array of known preset IDs used for validation warnings: ["essential-safety", "ai-agent-guardrails", "production-ready", "team-collaboration"]. This duplicates the preset IDs already defined in src/presets.ts via the PRESET_BUNDLES array. If a new preset is added to presets.ts, the config warning list will silently become stale. Extract the known preset IDs from PRESET_BUNDLES and use that as the single source of truth in both places.

Relevant files:

  • src/storage/config.ts — replace the hardcoded known array (line ~66) with a reference to the shared constant
  • src/presets.ts — export a PRESET_IDS constant (e.g., PRESET_BUNDLES.map(b => b.id)) or export PRESET_BUNDLES (already exported) and derive IDs in config.ts

Acceptance criteria:

  • The hardcoded preset ID list in config.ts is replaced with a derived list from presets.ts
  • npm run lint and npm test pass
  • No change in runtime behavior (same warning message for unknown presets)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxDeveloper experience improvementsgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions