Skip to content
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

Allow architecture diagrams to support any character for titles #5929

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

wizbit
Copy link

@wizbit wizbit commented Oct 4, 2024

📑 Summary

Allows any character between [ and ] for architecture diagram titles.

Resolves #5928

📏 Design Decisions

Change of regex to allow any character. Also had to tweak the entry Architecture rule as tests were claiming ambiguity.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link

changeset-bot bot commented Oct 4, 2024

⚠️ No Changeset found

Latest commit: 7857686

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label Oct 4, 2024
Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 7857686
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/66ffafab22910800088fa22c
😎 Deploy Preview https://deploy-preview-5929--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Oct 4, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mermaid-js/mermaid@5929
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@5929
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@5929
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@5929

commit: 7857686

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 4.67%. Comparing base (ddf18dd) to head (7857686).

Files with missing lines Patch % Lines
packages/parser/tests/test-util.ts 0.00% 14 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #5929      +/-   ##
==========================================
- Coverage     4.67%   4.67%   -0.01%     
==========================================
  Files          372     372              
  Lines        51669   51683      +14     
  Branches       611     611              
==========================================
  Hits          2414    2414              
- Misses       49255   49269      +14     
Flag Coverage Δ
unit 4.67% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/parser/tests/test-util.ts 0.00% <0.00%> (ø)

@wizbit wizbit force-pushed the bug/5928_architecture-diagram-allow-all-character-for-title branch from 66f4f73 to 7857686 Compare October 4, 2024 09:04
Copy link
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing all characters seems okay at the first glance. Love the unit tests!
We should unify the string handling approach, and support markdown as well. (We already support it in flowcharts and some others, so the same functions should be used).


We should also make the grammar stricter to disallow architecture-beta and group in the same line. As the grammar is in beta, we can make breaking changes.


After this is finalized, we also need E2E tests and documentation updates, which show the capabilities in examples.

Comment on lines +20 to +30
it.each([
`architecture-beta group api(cloud)[API]`,
` architecture-beta group api(cloud)[API] `,
`\tarchitecture-beta\tgroup api(cloud)[API]\t`,
`
architecture-beta\tgroup api(cloud)[API]
`,
])('should handle architecture-beta & group in same line', (context: string) => {
const result = parse(context);
expectNoErrorsOrAlternatives(result);
expect(result.value.$type).toBe(Architecture);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be doing this. Can you change the grammar to disallow this?

Copy link

argos-ci bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 4, 2024, 9:36 AM

@NicolasNewman
Copy link
Collaborator

NicolasNewman commented Oct 5, 2024

Good catch on the ambiguous grammar! If markdown support is planned to be added we may also want to consider KaTeX support. Other then the above request changes everything looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Architecture diagram does not support non-alphanumeric characters in titles
3 participants