feat: add multi-file merge support to generate command#36
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a generate-types subcommand to manifest-to-bicep for producing only types.json, including support for merging multiple manifests that share a namespace.
Changes:
- Registers the new
generate-typesCobra subcommand. - Adds
RunGenerateTypes, manifest merge logic, andtypes.json-only output handling.
c61cf5b to
8458df0
Compare
|
Re: Copilot's comment on the Good catch. Removed the forward reference to the Fixed in the latest force-push. |
8458df0 to
81f917b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
bicep-tools/cmd/manifest-to-bicep/main.go:121
- This multi-file path still uses the full extension generator, which produces
types.json,index.json, andindex.md. The requestedgenerate-typesbehavior needs a types-only path; otherwise callers that are aggregating namespace-specifictypes.jsonfiles will also overwrite or create index artifacts that should be rebuilt separately.
result, err = generator.GenerateFromString(merged)
81f917b to
b776515
Compare
b927fe6 to
a2cddf0
Compare
Update the existing 'generate' subcommand of manifest-to-bicep to accept multiple manifest files. When given multiple YAML manifests with the same namespace, their Types maps are merged into a single output (types.json, index.json, index.md). This supports per-type manifest files (e.g. containers.yaml, routes.yaml) as introduced by the automated resource type registration design, where each file defines a single resource type within a namespace. Backward compatible: single-file usage works exactly as before. Part of: unified Bicep extension publishing (PR 1/4)
a2cddf0 to
6f82b5d
Compare
Overview
Update the existing
generatesubcommand ofmanifest-to-bicepto accept multiple manifest files. When given multiple YAML manifests with the same namespace, theirTypesmaps are merged into a single output (types.json,index.json,index.md).This supports per-type manifest files (e.g.
containers.yaml,routes.yaml) as introduced by the automated resource type registration design, where each file defines a single resource type within a namespace.Backward compatible: single-file usage works exactly as before.
Part of Unified Bicep extension publishing (PR 1/4). See design doc.
Changes
bicep-tools/cmd/manifest-to-bicep/main.go: Updatedgenerateto accept<manifest1> [manifest2...] <output>(last arg is always output dir). AddedmergeManifestFiles()that validates same namespace and rejects duplicate types.Usage
Single file (backward compatible):
Multiple files (merge into one output):