diagram-contracts 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +2 -2
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/generated/contract.ts
|
|
7
|
-
var CONTRACT_YAML = "cli_contracts: 0.1.0\n\ninfo:\n title: diagram-contracts\n version: 0.2.
|
|
8
|
-
var CONTRACT_JSON_STR = '{\n "cli_contracts": "0.1.0",\n "info": {\n "title": "diagram-contracts",\n "version": "0.2.4",\n "description": "Convert Layout IR to SVG."\n },\n "command_sets": {\n "diagram-contracts": {\n "summary": "DSL-to-SVG diagram tool.",\n "groups": {\n "components": {\n "description": "Component Pack tooling."\n },\n "icons": {\n "description": "Icon provider tooling."\n }\n },\n "commands": {\n "render": {\n "summary": "Render Layout IR to SVG.",\n "description": "Reads Layout IR JSON from a file or stdin and outputs SVG. A .md/.markdown file input renders each ```draw / ```mermaid fenced block to its own SVG (spec \xA78, stretch); with -o, per-block files (out.svg -> out.1.svg, out.2.svg, ...); without -o, blocks concatenate to stdout separated by <!-- draw-block N --> comments.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input IR JSON file (or Draw Text / .draw.tsx / .md source). Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output SVG file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "theme",\n "description": "Theme YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "tokens",\n "description": "Tokens YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "font-file",\n "description": "Font file(s) for text measurement (.woff/.ttf/.otf). Comma-separated entries, each a path or <weight>=<path> (e.g. \\"400=inter.woff,700=inter-bold.woff\\"). Overrides font-family based resolution.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "config",\n "description": "draw.config.yaml file (project-level bindings/props/doc/theme + icon providers, spec \xA75). Merged under inline %%@ directives.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "exits": {\n "0": {\n "description": "SVG rendered successfully."\n },\n "1": {\n "description": "IR validation error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "convert": {\n "summary": "Eject Draw Text to Draw TSX (spec \xA78.1).",\n "description": "Parses a Draw Text source to the Draw DSL tree (post-bind, pre-expansion) and serializes it as readable Draw TSX. The output compiled via the TSX path renders byte-identical SVG to rendering the Draw Text source directly.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input Draw Text file. Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output .draw.tsx file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "config",\n "description": "draw.config.yaml file (project-level bindings/props/doc/theme + icon providers, spec \xA75). Merged under inline %%@ directives.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Draw TSX emitted successfully."\n },\n "1": {\n "description": "Parse / bind diagnostic error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "validate": {\n "summary": "Validate Layout IR JSON.",\n "description": "Validates IR JSON against the schema without rendering.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input IR JSON file. Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "exits": {\n "0": {\n "description": "IR is valid.",\n "stdout": {\n "format": "text"\n }\n },\n "1": {\n "description": "Validation error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "ir": {\n "summary": "Output normalized IR or resolved artifact as JSON.",\n "description": "Reads Layout IR JSON input and outputs the normalized IR or resolved layout artifact.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input IR JSON file. Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output JSON file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "theme",\n "description": "Theme YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "tokens",\n "description": "Tokens YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "stage",\n "aliases": [\n "s"\n ],\n "description": "Output stage.",\n "schema": {\n "type": "string",\n "enum": [\n "normalized",\n "artifact"\n ],\n "default": "artifact"\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Success."\n },\n "1": {\n "description": "IR validation error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "components.build": {\n "summary": "Build a Component Pack from a .draw.tsx entry.",\n "arguments": [\n {\n "name": "entry",\n "index": 0,\n "required": true,\n "description": "Entry .draw.tsx file whose exported/imported components are packed.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output pack JSON file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "icons",\n "description": "Comma-separated qualified icon names to embed offline (e.g. aws:ecs,aws:rds). Explicit list only \u2014 no template scan. A name that does not resolve at build time is an error.",\n "schema": {\n "type": "string"\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Component Pack built successfully."\n },\n "1": {\n "description": "Extraction / icon-resolution diagnostic error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "icons.export": {\n "summary": "Export built-in provider icons as static SVG files.",\n "arguments": [\n {\n "name": "provider",\n "index": 0,\n "required": true,\n "description": "Icon provider (e.g. aws).",\n "schema": {\n "type": "string"\n }\n }\n ],\n "options": [\n {\n "name": "names",\n "description": "Comma-separated icon short names to export (e.g. ecs,rds,vpc-group).",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output directory (created if missing).",\n "schema": {\n "type": "string"\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Icons exported successfully."\n },\n "1": {\n "description": "Icon-resolution error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n }\n }\n }\n }\n}';
|
|
7
|
+
var CONTRACT_YAML = "cli_contracts: 0.1.0\n\ninfo:\n title: diagram-contracts\n version: 0.2.6\n description: Convert Layout IR to SVG.\n\ncommand_sets:\n diagram-contracts:\n summary: DSL-to-SVG diagram tool.\n\n # Parent-group descriptions for the nested subcommand groups (spec #62 /\n # #71). cli-contracts@0.33.15 emits these as `.description(...)` on the\n # generated `program.command(<group>)`, so the group help lines live in the\n # contract SSoT rather than in hand-written cli.ts (cli-contracts#77).\n groups:\n components:\n description: Component Pack tooling.\n icons:\n description: Icon provider tooling.\n\n commands:\n render:\n summary: Render Layout IR to SVG.\n description: Reads Layout IR JSON from a file or stdin and outputs SVG. A .md/.markdown file input renders each ```draw / ```mermaid fenced block to its own SVG (spec \xA78, stretch); with -o, per-block files (out.svg -> out.1.svg, out.2.svg, ...); without -o, blocks concatenate to stdout separated by <!-- draw-block N --> comments.\n arguments:\n - name: input\n index: 0\n required: false\n description: Input IR JSON file (or Draw Text / .draw.tsx / .md source). Reads from stdin if omitted.\n schema:\n type: string\n file:\n mode: read\n exists: true\n options:\n - name: output\n aliases: [o]\n description: Output SVG file. Writes to stdout if omitted.\n schema:\n type: string\n - name: theme\n description: Theme YAML file path.\n schema:\n type: string\n file:\n mode: read\n exists: true\n - name: tokens\n description: Tokens YAML file path.\n schema:\n type: string\n file:\n mode: read\n exists: true\n - name: font-file\n description: Font file(s) for text measurement (.woff/.ttf/.otf). Comma-separated entries, each a path or <weight>=<path> (e.g. \"400=inter.woff,700=inter-bold.woff\"). Overrides font-family based resolution.\n schema:\n type: string\n - name: config\n description: draw.config.yaml file (project-level bindings/props/doc/theme + icon providers, spec \xA75). Merged under inline %%@ directives.\n schema:\n type: string\n file:\n mode: read\n exists: true\n exits:\n '0':\n description: SVG rendered successfully.\n '1':\n description: IR validation error.\n stderr:\n format: text\n '2':\n description: File I/O error.\n stderr:\n format: text\n\n convert:\n summary: Eject Draw Text to Draw TSX (spec \xA78.1).\n description: Parses a Draw Text source to the Draw DSL tree (post-bind, pre-expansion) and serializes it as readable Draw TSX. The output compiled via the TSX path renders byte-identical SVG to rendering the Draw Text source directly.\n arguments:\n - name: input\n index: 0\n required: false\n description: Input Draw Text file. Reads from stdin if omitted.\n schema:\n type: string\n file:\n mode: read\n exists: true\n options:\n - name: output\n aliases: [o]\n description: Output .draw.tsx file. Writes to stdout if omitted.\n schema:\n type: string\n - name: config\n description: draw.config.yaml file (project-level bindings/props/doc/theme + icon providers, spec \xA75). Merged under inline %%@ directives.\n schema:\n type: string\n file:\n mode: read\n exists: true\n exits:\n '0':\n description: Draw TSX emitted successfully.\n '1':\n description: Parse / bind diagnostic error.\n stderr:\n format: text\n '2':\n description: File I/O error.\n stderr:\n format: text\n\n validate:\n summary: Validate Layout IR JSON.\n description: Validates IR JSON against the schema without rendering.\n arguments:\n - name: input\n index: 0\n required: false\n description: Input IR JSON file. Reads from stdin if omitted.\n schema:\n type: string\n file:\n mode: read\n exists: true\n exits:\n '0':\n description: IR is valid.\n stdout:\n format: text\n '1':\n description: Validation error.\n stderr:\n format: text\n\n ir:\n summary: Output normalized IR or resolved artifact as JSON.\n description: Reads Layout IR JSON input and outputs the normalized IR or resolved layout artifact.\n arguments:\n - name: input\n index: 0\n required: false\n description: Input IR JSON file. Reads from stdin if omitted.\n schema:\n type: string\n file:\n mode: read\n exists: true\n options:\n - name: output\n aliases: [o]\n description: Output JSON file. Writes to stdout if omitted.\n schema:\n type: string\n - name: theme\n description: Theme YAML file path.\n schema:\n type: string\n file:\n mode: read\n exists: true\n - name: tokens\n description: Tokens YAML file path.\n schema:\n type: string\n file:\n mode: read\n exists: true\n - name: stage\n aliases: [s]\n description: Output stage.\n schema:\n type: string\n enum: [normalized, artifact]\n default: artifact\n exits:\n '0':\n description: Success.\n '1':\n description: IR validation error.\n stderr:\n format: text\n '2':\n description: File I/O error.\n stderr:\n format: text\n\n # Nested subcommands (`<group> <verb>`, spec #62 / #71). The map key uses\n # dot notation, which cli-contracts splits into an invocation path\n # (`components build`) and a camelCase handler name (`componentsBuild`).\n components.build:\n summary: Build a Component Pack from a .draw.tsx entry.\n arguments:\n - name: entry\n index: 0\n required: true\n description: Entry .draw.tsx file whose exported/imported components are packed.\n schema:\n type: string\n file:\n mode: read\n exists: true\n options:\n - name: output\n aliases: [o]\n description: Output pack JSON file. Writes to stdout if omitted.\n schema:\n type: string\n - name: icons\n description: Comma-separated qualified icon names to embed offline (e.g. aws:ecs,aws:rds). Explicit list only \u2014 no template scan. A name that does not resolve at build time is an error.\n schema:\n type: string\n exits:\n '0':\n description: Component Pack built successfully.\n '1':\n description: Extraction / icon-resolution diagnostic error.\n stderr:\n format: text\n '2':\n description: File I/O error.\n stderr:\n format: text\n\n icons.export:\n summary: Export built-in provider icons as static SVG files.\n arguments:\n - name: provider\n index: 0\n required: true\n description: Icon provider (e.g. aws).\n schema:\n type: string\n options:\n - name: names\n description: Comma-separated icon short names to export (e.g. ecs,rds,vpc-group).\n schema:\n type: string\n - name: output\n aliases: [o]\n description: Output directory (created if missing).\n schema:\n type: string\n exits:\n '0':\n description: Icons exported successfully.\n '1':\n description: Icon-resolution error.\n stderr:\n format: text\n '2':\n description: File I/O error.\n stderr:\n format: text\n";
|
|
8
|
+
var CONTRACT_JSON_STR = '{\n "cli_contracts": "0.1.0",\n "info": {\n "title": "diagram-contracts",\n "version": "0.2.6",\n "description": "Convert Layout IR to SVG."\n },\n "command_sets": {\n "diagram-contracts": {\n "summary": "DSL-to-SVG diagram tool.",\n "groups": {\n "components": {\n "description": "Component Pack tooling."\n },\n "icons": {\n "description": "Icon provider tooling."\n }\n },\n "commands": {\n "render": {\n "summary": "Render Layout IR to SVG.",\n "description": "Reads Layout IR JSON from a file or stdin and outputs SVG. A .md/.markdown file input renders each ```draw / ```mermaid fenced block to its own SVG (spec \xA78, stretch); with -o, per-block files (out.svg -> out.1.svg, out.2.svg, ...); without -o, blocks concatenate to stdout separated by <!-- draw-block N --> comments.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input IR JSON file (or Draw Text / .draw.tsx / .md source). Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output SVG file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "theme",\n "description": "Theme YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "tokens",\n "description": "Tokens YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "font-file",\n "description": "Font file(s) for text measurement (.woff/.ttf/.otf). Comma-separated entries, each a path or <weight>=<path> (e.g. \\"400=inter.woff,700=inter-bold.woff\\"). Overrides font-family based resolution.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "config",\n "description": "draw.config.yaml file (project-level bindings/props/doc/theme + icon providers, spec \xA75). Merged under inline %%@ directives.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "exits": {\n "0": {\n "description": "SVG rendered successfully."\n },\n "1": {\n "description": "IR validation error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "convert": {\n "summary": "Eject Draw Text to Draw TSX (spec \xA78.1).",\n "description": "Parses a Draw Text source to the Draw DSL tree (post-bind, pre-expansion) and serializes it as readable Draw TSX. The output compiled via the TSX path renders byte-identical SVG to rendering the Draw Text source directly.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input Draw Text file. Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output .draw.tsx file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "config",\n "description": "draw.config.yaml file (project-level bindings/props/doc/theme + icon providers, spec \xA75). Merged under inline %%@ directives.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Draw TSX emitted successfully."\n },\n "1": {\n "description": "Parse / bind diagnostic error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "validate": {\n "summary": "Validate Layout IR JSON.",\n "description": "Validates IR JSON against the schema without rendering.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input IR JSON file. Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "exits": {\n "0": {\n "description": "IR is valid.",\n "stdout": {\n "format": "text"\n }\n },\n "1": {\n "description": "Validation error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "ir": {\n "summary": "Output normalized IR or resolved artifact as JSON.",\n "description": "Reads Layout IR JSON input and outputs the normalized IR or resolved layout artifact.",\n "arguments": [\n {\n "name": "input",\n "index": 0,\n "required": false,\n "description": "Input IR JSON file. Reads from stdin if omitted.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output JSON file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "theme",\n "description": "Theme YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "tokens",\n "description": "Tokens YAML file path.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n },\n {\n "name": "stage",\n "aliases": [\n "s"\n ],\n "description": "Output stage.",\n "schema": {\n "type": "string",\n "enum": [\n "normalized",\n "artifact"\n ],\n "default": "artifact"\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Success."\n },\n "1": {\n "description": "IR validation error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "components.build": {\n "summary": "Build a Component Pack from a .draw.tsx entry.",\n "arguments": [\n {\n "name": "entry",\n "index": 0,\n "required": true,\n "description": "Entry .draw.tsx file whose exported/imported components are packed.",\n "schema": {\n "type": "string"\n },\n "file": {\n "mode": "read",\n "exists": true\n }\n }\n ],\n "options": [\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output pack JSON file. Writes to stdout if omitted.",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "icons",\n "description": "Comma-separated qualified icon names to embed offline (e.g. aws:ecs,aws:rds). Explicit list only \u2014 no template scan. A name that does not resolve at build time is an error.",\n "schema": {\n "type": "string"\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Component Pack built successfully."\n },\n "1": {\n "description": "Extraction / icon-resolution diagnostic error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n },\n "icons.export": {\n "summary": "Export built-in provider icons as static SVG files.",\n "arguments": [\n {\n "name": "provider",\n "index": 0,\n "required": true,\n "description": "Icon provider (e.g. aws).",\n "schema": {\n "type": "string"\n }\n }\n ],\n "options": [\n {\n "name": "names",\n "description": "Comma-separated icon short names to export (e.g. ecs,rds,vpc-group).",\n "schema": {\n "type": "string"\n }\n },\n {\n "name": "output",\n "aliases": [\n "o"\n ],\n "description": "Output directory (created if missing).",\n "schema": {\n "type": "string"\n }\n }\n ],\n "exits": {\n "0": {\n "description": "Icons exported successfully."\n },\n "1": {\n "description": "Icon-resolution error.",\n "stderr": {\n "format": "text"\n }\n },\n "2": {\n "description": "File I/O error.",\n "stderr": {\n "format": "text"\n }\n }\n }\n }\n }\n }\n }\n}';
|
|
9
9
|
|
|
10
10
|
// src/generated/program.ts
|
|
11
11
|
function createProgram(handlers2, version) {
|
package/package.json
CHANGED