Skip to content

feat: port yamlize + yamlize-cli into dev-utils monorepo#94

Merged
pyramation merged 2 commits into
mainfrom
feat/yamlize-port
Jul 7, 2026
Merged

feat: port yamlize + yamlize-cli into dev-utils monorepo#94
pyramation merged 2 commits into
mainfrom
feat/yamlize-port

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

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-yaml directive resolution (compose YAML from fragments)
  • ${{yamlize.VAR}} template variable substitution from context
  • File-based API: yamlize(inFile, outFile, context)

New additions:

  • yamlizeString(yaml, context) / yamlizeObject(obj, context) — programmatic API, no file I/O required
  • toYaml() / fromYaml() — thin wrappers around js-yaml
  • merge(base, overrides, opts?) — deep merge with null-inheritance (null/undefined in overrides → inherit from base); { nullRemoves: true } to delete keys instead
  • mergeNullable(base, overrides) — shallow variant for config override patterns
  • All types exported: YamlNode, YamlizeContext, MergeOptions, YamlizeOptions
  • Uses nested-obj from workspace instead of npm

@yamlize/cli

Same CLI interface as before: yamlize --config config.yaml --inFile meta.yaml --outFile output.yaml. Uses inquirerer from 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

…-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
@pyramation pyramation self-assigned this Jul 7, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@socket-security

socket-security Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​js-yaml@​4.0.91001007180100
Addedmkdirp@​3.0.110010010080100

View full report

@pyramation pyramation merged commit 9c347b1 into main Jul 7, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant