Skip to content

feat(verification): add Mermaid support for Docker-based verification#268

Merged
mttrbrts merged 2 commits into
accordproject:mainfrom
apoorv7g:Mermaid-CI
Jul 20, 2026
Merged

feat(verification): add Mermaid support for Docker-based verification#268
mttrbrts merged 2 commits into
accordproject:mainfrom
apoorv7g:Mermaid-CI

Conversation

@apoorv7g

Copy link
Copy Markdown
Contributor

Adds Mermaid to the Docker verification pipeline so generated .mmd diagrams from the corpus are syntax-checked in CI and locally, consistent with other codegen targets.

Changes

  • Register mermaid in verification/docker/targets.json with Mermaid CLI target and mermaid.parse validation tool.
  • Add a Mermaid verification Docker image (verification/docker/mermaid/) that generates diagrams via run-case.sh and validates each .mmd with mermaid.parse (via jsdom for Node DOM APIs).
  • Add verification/docker/mermaid/validate.js with a shared parseMermaid() helper used by both Docker and unit tests.
  • Add test/verification/mermaid.validate.test.js to run corpus cases through MermaidVisitor and assert every generated .mmd parses.
  • Wire Mermaid into CI: verify-codegen.yml matrix, scripts/verification/docker-run.js targets list, and verify:docker:mermaid npm script.
  • Add mermaid@11.12.0 and jsdom@25.0.1 as devDependencies for local test validation.

Flags

  • Mermaid’s parser expects browser DOM APIs; validation installs a minimal jsdom environment before calling mermaid.parse.
  • The Docker image installs mermaid and jsdom under /opt/mermaid-verify (next to validate.js) so ESM import resolution works; NODE_PATH alone is insufficient for ESM.
  • Mermaid and jsdom versions are pinned to match between the Docker image and package.json devDependencies.

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

apoorv7g added 2 commits July 15, 2026 07:44
- Introduced Mermaid as a new target in the Docker verification setup.
- Updated package.json and Dockerfiles to include Mermaid dependencies and configuration.
- Added a new validation test for Mermaid diagrams to ensure proper parsing.
- Enhanced the verification manifest to include Mermaid as a target.

This commit expands the verification capabilities to include Mermaid, ensuring a consistent environment for testing and validation.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
- Added jsdom and mermaid as new dependencies.
- Included @antfu/install-pkg and @asamuzakjp/css-color with their respective dependencies.
- Updated several other packages to their latest versions.

This commit enhances the project by incorporating additional libraries and ensuring up-to-date dependencies for improved functionality.

Signed-off-by: Apoorv <130035517+APOORV7G@users.noreply.github.com>
@apoorv7g

Copy link
Copy Markdown
Contributor Author

@DianaLease @ekarademir Review for this PR whenever possible( but a little quick :))

@mttrbrts
mttrbrts merged commit d9bc2c7 into accordproject:main Jul 20, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants