feat: add .replicated config file parser and discovery logic#113
Merged
jdewinne merged 1 commit intoMay 12, 2026
Merged
Conversation
- Add src/config.ts with ReplicatedConfig interfaces (ChartConfig, PreflightConfig, ReplLintConfig) - Implement findAndParseConfig() to walk upward and discover .replicated / .replicated.yaml files - Implement parseConfigFile() to read, validate, and resolve relative paths to absolute - Add monorepo config merging: scalars override, channel arrays replace, resource arrays append+dedupe - Validate chart/preflight/manifest paths, preflight cross-fields, and glob syntax via picomatch - Export new types and functions from src/index.ts - Add comprehensive tests in src/config.test.ts - Add picomatch dependency for glob pattern validation
mikhailswift
approved these changes
May 12, 2026
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
Adds
.replicatedand.replicated.yamlconfig file parser and discovery logic to the library, matching the behavior of thereplicatedhq/replicatedCLI.Changes
New
src/config.tsReplicatedConfig,ChartConfig,PreflightConfig, andReplLintConfiginterfacesfindAndParseConfig(startPath)— walks upward fromstartPathtoward the filesystem root, collecting all.replicatedand.replicated.yamlfiles along the way (monorepo support). IfstartPathis a file, parses it directly.parseConfigFile(filePath)— reads, parses YAML, validates, resolves relative paths to absolute (relative to the config file's directory), and returns the config.appId,appSlug,releaseLabel) are overridden by child configspromoteToChannelIds,promoteToChannelNames) are replaced if presentcharts,manifests,preflights) are appended and deduplicated by resolved absolute pathchart.path,preflight.path, andmanifestsentrieschartName↔chartVersion)*?[{New
src/config.test.ts.replicated.yaml, relative path resolution, monorepo merging, deduplication, valid/invalid YAML parsing, validation errors, andrepl-lintparsing.src/index.ts— exports all new types and functionspackage.json— addspicomatchdependency for glob pattern validationTesting
npm run build✅npm test— 87 passed, 0 failed ✅npm run prettier✅