Skip to content

feat: adopt imposter-project config file name#184

Open
outofcoffee wants to merge 4 commits into
mainfrom
feat/imposter-project-config-file
Open

feat: adopt imposter-project config file name#184
outofcoffee wants to merge 4 commits into
mainfrom
feat/imposter-project-config-file

Conversation

@outofcoffee

Copy link
Copy Markdown
Contributor

Rename the canonical local project config file to the discoverable imposter-project.*, keeping the hidden .imposter.* name working as a deprecated fallback.

Summary

  • Adopt imposter-project.yaml (.yml/.json also accepted) as the canonical local project config file name, replacing the hidden .imposter.* which was easy to miss in file explorers.
  • Keep the legacy .imposter.* name working: it is merged with lower precedence than the canonical file, so imposter-project.* wins when both are present, and a deprecation warning is logged prompting a rename.
  • imposter scaffold now writes imposter-project.yaml.
  • imposter config set updates an existing config file of either name (via the new FindLocalConfigFile) instead of creating a second, competing file.
  • Add a dedicated docs/project_config.md page describing the project config file, its precedence, and the deprecation, linked from the main configuration page and the README.

Implementation details

  • Adopting the constant in impostermodel (scaffolding) previously created a config -> impostermodel import cycle. That cycle existed because ValidateConfigExists reached up into the scaffolding package to auto-scaffold missing config. The scaffold-if-missing decision now lives in the up command instead, so ValidateConfigExists only validates, the cycle is gone, and the filename constant stays owned by the config package.
  • Precedence relies on viper's SetConfigName clearing the resolved config file, so merging the legacy name then the canonical name on the shared viper instance re-resolves correctly.

Rename the canonical local project config file from the hidden
`.imposter.y[a]ml|json` to the discoverable `imposter-project.*`.

The legacy `.imposter.*` name is still honoured as a deprecated
fallback: it is merged with lower precedence than the canonical file
and logs a warning prompting a rename. Scaffolding now writes
`imposter-project.yaml`, and `imposter config set` updates an existing
file of either name rather than creating a competing one.

Move the scaffold-if-missing decision out of ValidateConfigExists and
into the up command, removing the config -> impostermodel import cycle
so the filename constant can live in the config package.

Document the project config file on its own docs page, linked from the
main configuration page and the README.
@outofcoffee outofcoffee added the enhancement New feature or request label Jul 18, 2026
The logic that writes the local project config file scaffolds CLI
config, not a mock model, so it belongs in the config package rather
than impostermodel. Rename DotImposterConfig to ProjectConfig and
writeDotImposterYaml to WriteProjectConfig, dropping the stale "dot"
naming now that the file is imposter-project.yaml.
The project configuration file is user-facing documentation, so its
write-up belongs in the Imposter docs repo (published to
docs.imposter.sh), not here. Remove the duplicated page and point the
configuration doc and README at the canonical page instead.

Add an AGENTS.md recording that user-facing docs live in the docs repo
and this repo should link to them rather than duplicate them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant