feat: adopt imposter-project config file name#184
Open
outofcoffee wants to merge 4 commits into
Open
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename the canonical local project config file to the discoverable
imposter-project.*, keeping the hidden.imposter.*name working as a deprecated fallback.Summary
imposter-project.yaml(.yml/.jsonalso accepted) as the canonical local project config file name, replacing the hidden.imposter.*which was easy to miss in file explorers..imposter.*name working: it is merged with lower precedence than the canonical file, soimposter-project.*wins when both are present, and a deprecation warning is logged prompting a rename.imposter scaffoldnow writesimposter-project.yaml.imposter config setupdates an existing config file of either name (via the newFindLocalConfigFile) instead of creating a second, competing file.docs/project_config.mdpage describing the project config file, its precedence, and the deprecation, linked from the main configuration page and the README.Implementation details
impostermodel(scaffolding) previously created aconfig -> impostermodelimport cycle. That cycle existed becauseValidateConfigExistsreached up into the scaffolding package to auto-scaffold missing config. The scaffold-if-missing decision now lives in theupcommand instead, soValidateConfigExistsonly validates, the cycle is gone, and the filename constant stays owned by theconfigpackage.SetConfigNameclearing the resolved config file, so merging the legacy name then the canonical name on the shared viper instance re-resolves correctly.