-
Notifications
You must be signed in to change notification settings - Fork 7
[#182] Fix YAML quoting gaps in ManifestBuilder export #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -120,7 +120,7 @@ struct ManifestBuilder { | |||||
|
|
||||||
| // ── MCP Servers ─────────────────────────────────────────────────────── | ||||||
| for server in config.mcpServers where options.selectedMCPServers.contains(server.name) { | ||||||
| let id = "mcp-\(server.name)" | ||||||
| let id = "mcp-\(sanitizeID(server.name))" | ||||||
|
|
||||||
| // Detect brew dependency hint via Homebrew symlink resolution | ||||||
| if let command = server.command, let formula = Homebrew.detectFormula(for: command) { | ||||||
|
|
@@ -332,9 +332,9 @@ struct ManifestBuilder { | |||||
| yaml.keyValue("schemaVersion", manifest.schemaVersion) | ||||||
| yaml.keyValue("identifier", manifest.identifier) | ||||||
| yaml.keyValue("displayName", manifest.displayName, quoted: true) | ||||||
| yaml.keyValue("description", manifest.description) | ||||||
| yaml.keyValue("description", manifest.description, quoted: true) | ||||||
| if let author = manifest.author { | ||||||
| yaml.keyValue("author", author) | ||||||
| yaml.keyValue("author", author, quoted: true) | ||||||
| } | ||||||
|
|
||||||
| // ── Components ──────────────────────────────────────────────────────── | ||||||
|
|
@@ -370,8 +370,8 @@ struct ManifestBuilder { | |||||
| yaml.sectionDivider("Templates — CLAUDE.local.md sections") | ||||||
| yaml.line("templates:") | ||||||
| for template in templates { | ||||||
| yaml.line(" - sectionIdentifier: \(template.sectionIdentifier)") | ||||||
| yaml.line(" contentFile: \(template.contentFile)") | ||||||
| yaml.line(" - sectionIdentifier: \(yamlQuote(template.sectionIdentifier))") | ||||||
| yaml.line(" contentFile: \(yamlQuote(template.contentFile))") | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -381,7 +381,7 @@ struct ManifestBuilder { | |||||
| yaml.sectionDivider("Prompts — resolved interactively during `mcs sync`") | ||||||
| yaml.line("prompts:") | ||||||
| for prompt in prompts { | ||||||
| yaml.line(" - key: \(prompt.key)") | ||||||
| yaml.line(" - key: \(yamlQuote(prompt.key))") | ||||||
| yaml.line(" type: \(prompt.type.rawValue)") | ||||||
| if let label = prompt.label { | ||||||
| yaml.line(" label: \(yamlQuote(label))") | ||||||
|
|
@@ -441,7 +441,7 @@ struct ManifestBuilder { | |||||
| } | ||||||
|
|
||||||
| yaml.line(" - id: \(comp.id)") | ||||||
|
||||||
| yaml.line(" - id: \(comp.id)") | |
| yaml.line(" - id: \(yamlQuote(comp.id))") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
identifieris user-provided (ExportCommand prompts for it) and is still emitted without YAML quoting/escaping. If the user enters values containing YAML-significant sequences (e.g.:,#, leading&, etc.), the generatedtechpack.yamlcan still become invalid YAML. Consider passingquoted: truehere (or running it throughyamlQuote) so parsing succeeds and schema validation can fail with a clearer error instead of a YAML decode failure.