Files
medusa-store/www/utils/packages/workflows-diagrams-generator
Shahed Nasser 6e65158af3 docs-util: Upgrade typedoc to 0.26 (#7853)
Upgrade typedoc to v0.26 + make changes based on the update

Note: This update produces an error when generating model references when the models use the `createPsqlIndexStatementHelper` decorator. As this isn't a breaking error, and as we'll move to DML in the future, it's not necessary to spend time on a fix.
2024-06-27 10:52:44 +00:00
..
2024-05-06 09:13:50 +03:00
2024-05-06 09:13:50 +03:00

Workflows Diagram Generator

An internal tool to generate Mermaid diagrams for workflows.

Note: This tool is a beta tool created to generate diagrams that can be used in the Medusa documentation.

Usage

After installing the dependencies, run the following command:

yarn start run ./path/to/workflow -o ./path/to/output/dir

Where:

  • ./path/to/workflow is the path to a file containing a Workflow, or a directory containing more than one file.
  • ./path/to/output/dir is the path to the directory that outputted diagrams should be placed in.

Command Options

--t, --type

yarn start run ./path/to/workflow -o ./path/to/output/dir -t markdown

The type of diagram to be generated. It can be one of the following:

  • docs (default): For each workflow, it creates a directory holding the diagram of the workflow and its code in separate files. Diagrams are placed in .mermaid files.
  • markdown: Generates the diagram of each workflow in a .md file.
  • mermaid: Generates the diagram of each workflow in a .mermaid file.
  • console: Outputs the diagrams in the console.
  • svg: Generates the diagram in SVG format.
  • png: Generates the diagram in PNG format.
  • pdf: Generates the diagram in PDF format.

--no-theme

yarn start run ./path/to/workflow -o ./path/to/output/dir --no-theme

Removes Medusa's default theming from the outputted diagram. Note that Medusa's theme doesn't support dark mode.

--pretty-names

yarn start run ./path/to/workflow -o ./path/to/output/dir --pretty-names

Changes slug and camel-case names of steps to capitalized names.