Files
medusa-store/docs-util/packages/workflows-diagrams-generator/src/index.ts
Shahed Nasser fa4935259c docs: diagrams plugin tooling (#5741)
* added plugin

* updated plugin + added component

* dummy data TO BE REMOVED

* (wip) workflow generator tool

* add workflow generator tooling

* updated the generator tool

* added code file creation

* fix design of diagrams

* configured diagram theme

* added build script

* removed comments + unnecessary files

* general fixes

* refactored plugin

* added README + more output types
2023-11-28 14:30:23 +00:00

38 lines
1002 B
JavaScript

#!/usr/bin/env node
import { Command, Option } from "commander"
import generate from "./commands/generate.js"
const program = new Command()
program
.name("workflows-diagram-generator")
.description("Generate diagram(s) for workflow(s).")
program
.command("run")
.description(
"Generate Mermaid.js diagrams for your workflows based on the type you choose."
)
.argument(
"<workflowPath>",
"The path to a workflow file or a directory of workflow files."
)
.requiredOption(
"-o, --output <output>",
"The directory to output the files in."
)
.addOption(
new Option("-t, --type <type>", "Type of diagrams to be generated.")
.choices(["docs", "markdown", "mermaid", "console", "svg", "png", "pdf"])
.default("docs")
)
.option("--no-theme", "Remove theming from outputted diagrams.", true)
.option(
"--pretty-names",
"Prettify step names. Useful for creating presentational diagrams.",
false
)
.action(generate)
program.parse()