Skip to content

Migrate from cosmiconfig to c12 for configuration management #261

@bhouston

Description

@bhouston

Migrate from cosmiconfig to c12 for configuration management

Description

We currently use cosmiconfig for configuration management in the mycoder project. This issue proposes migrating to c12, which is part of the UnJS ecosystem and offers more features, better TypeScript support, and is actively maintained.

Benefits

  • More powerful configuration capabilities (environment-specific configs, extending configs)
  • Better TypeScript support
  • Active development and maintenance
  • Built-in support for watching configuration changes
  • Support for more configuration formats (TS, JSONC, JSON5, TOML)
  • Built-in .env support
  • Config directory support

Implementation Plan

  1. Install c12 as a dependency
  2. Update the configuration loading code in packages/cli/src/settings/config.ts
  3. Ensure backward compatibility with existing configuration files
  4. Update tests to work with the new implementation
  5. Update documentation to reflect the new capabilities

Acceptance Criteria

  • c12 is installed and used for configuration loading
  • Existing configuration files continue to work
  • Tests pass with the new implementation
  • Documentation is updated
  • New features (environment-specific config, extending, watching) are properly implemented and documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions