Convert env config from JSON to YAML so users can comment out lines - #224
Merged
Conversation
Switch the environment configuration file from env.json to env.yaml so users can comment out individual lines. Changes: - Replace env.example.json with env.example.yaml using real YAML comments instead of _comment hack fields - .gitignore now ignores env.yaml - src/env-config.ts: use js-yaml load() instead of JSON.parse, default path is now env.yaml, error messages updated throughout - test/env-config.test.ts: writeEnvJson -> writeEnvYaml using js-yaml dump() - Add js-yaml dependency and @types/js-yaml dev dependency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Reviewed code, no issues found. |
The entire motivation for this PR is comment support; without this test, the feature has no regression coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Reviewed code and pushed fixes. |
Contributor
Author
|
Reviewed code, no issues found. |
js-yaml v5 ships its own bundled TypeScript declarations (dist/js-yaml.d.ts via the package exports field). The @types/js-yaml package is the DefinitelyTyped shim for the old v4 API and is entirely unused when moduleResolution is nodenext, which resolves types from the package's own exports.types field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Reviewed code and pushed fixes. |
Contributor
Author
|
Reviewed code, no issues found. |
1 similar comment
Contributor
Author
|
Reviewed code, no issues found. |
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.
Summary
Replaces the JSON-based configuration with YAML to enable native comment support, resolving #222. JSON cannot contain comments, which forced workarounds like
_commentfields. YAML's native comment syntax makes the configuration cleaner and more maintainable.Changes
env.example.json→env.example.yaml: Converted to YAML format with native#comments replacing the old_comment/_keyhack fields. Comments now annotate settings directly without cluttering the configuration structure..gitignore: Updated to ignoreenv.yamlinstead ofenv.json.src/env-config.ts:js-yamlimport to parse YAML filesloadEnvConfig()now parses withloadYaml()instead ofJSON.parse()env.yamlenv.yamlandenv.example.yamltest/env-config.test.ts:writeEnvJson()→writeEnvYaml()js-yaml'sdump()functionpackage.json/package-lock.json:js-yaml(v5.2.0) as a runtime dependency@types/js-yaml(it was redundant — js-yaml v5 ships with bundled TypeScript declarations)Testing
All 34 unit tests pass, including a new test verifying that YAML comments are properly ignored during config loading.
Closes #222