feat: port yamlize + yamlize-cli into dev-utils monorepo#94
Merged
Conversation
…-utils
Port the yamlize YAML templating engine and its CLI into the dev-utils
monorepo as modernized TypeScript packages.
yamlize (core):
- import-yaml directive resolution for composing YAML from fragments
- ${{yamlize.VAR}} template variable substitution from context
- Programmatic API: yamlizeString(), yamlizeObject() (not just file→file)
- toYaml/fromYaml wrappers around js-yaml
- Deep merge with null-inheritance semantics (merge, mergeNullable)
- Typed throughout (YamlNode, YamlizeContext, MergeOptions)
- 26 unit tests covering templates, imports, merge, round-tripping
yamlize-cli (@yamlize/cli):
- CLI wrapper using inquirerer for interactive prompts
- --config, --inFile, --outFile flags
- Version/help support
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Ports the yamlize YAML templating engine and its CLI into dev-utils as two packages, modernized with full TypeScript types and a programmatic API.
yamlize(core)Original functionality preserved:
import-yamldirective resolution (compose YAML from fragments)${{yamlize.VAR}}template variable substitution from contextyamlize(inFile, outFile, context)New additions:
yamlizeString(yaml, context)/yamlizeObject(obj, context)— programmatic API, no file I/O requiredtoYaml()/fromYaml()— thin wrappers aroundjs-yamlmerge(base, overrides, opts?)— deep merge with null-inheritance (null/undefined in overrides → inherit from base);{ nullRemoves: true }to delete keys insteadmergeNullable(base, overrides)— shallow variant for config override patternsYamlNode,YamlizeContext,MergeOptions,YamlizeOptionsnested-objfrom workspace instead of npm@yamlize/cliSame CLI interface as before:
yamlize --config config.yaml --inFile meta.yaml --outFile output.yaml. Usesinquirererfrom workspace for interactive prompts.Tests
26 tests covering: file-based templating with fixtures, programmatic string/object APIs, template variable resolution (flat + nested), missing variable errors, deep merge (null-skip, null-remove, nested, arrays, immutability),
mergeNullable, and YAML round-tripping.Link to Devin session: https://app.devin.ai/sessions/560b356ee4174a3d9776babf0c99ecee
Requested by: @pyramation