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

Diagram Factory / Generator / Template for easy adding new diagrams #4606

Open
nirname opened this issue Jul 6, 2023 · 9 comments · May be fixed by #4911
Open

Diagram Factory / Generator / Template for easy adding new diagrams #4606

nirname opened this issue Jul 6, 2023 · 9 comments · May be fixed by #4911
Labels
Status: Triage Needs to be verified, categorized, etc

Comments

@nirname
Copy link
Contributor

nirname commented Jul 6, 2023

To simplify new diagrams creation process and force developers to create new diagrams in a standard way we need a template that would allow us to generate all required files for the diagram

The structure of generated files should match those in discussion #4499

Perhaps we could turn mermaid-diagram-example into a template

@nirname nirname added the Status: Triage Needs to be verified, categorized, etc label Jul 6, 2023
@nirname nirname changed the title Diagram Factory / Generator for easy adding new diagrams Diagram Factory / Generator / Template for easy adding new diagrams Jul 6, 2023
@Yokozuna59
Copy link
Member

I almost have the list of the files need to be created/modified when creating new diagram, but it's need organizing and more details for what to be added/modified.

Originally, I was planning to create it when finalizing the stuff discussed in #4499.

@sidharthv96
Copy link
Member

mermaid-diagram-example might actually be a bad example. We should properly type and refactor it first before using it.

@Yokozuna59
Copy link
Member

mermaid-diagram-example might actually be a bad example. We should properly type and refactor it first before using it.

We should also export some types from packages/mermaid to be able to create other diagrams similar to mermaied-zenuml, currently it's not fully typed.

@nirname nirname mentioned this issue Aug 3, 2023
4 tasks
@nirname
Copy link
Contributor Author

nirname commented Aug 3, 2023

@Yokozuna59 I added a separate branch for this, in the main repository, so you can commit directly to it, or you may create your own branch, or use my PR as an example

@nirname
Copy link
Contributor Author

nirname commented Aug 3, 2023

My idea is very basic. We need a feature that allows us to make a scaffold for a diagram, like

pnpm create pie

may be with some arguments, and that would result in a bunch of named files. It does not really matter if it is a new package or a list of files inside the main repository are generated

@Yokozuna59
Copy link
Member

That's also my intention, but I was referring to where we should store those files.
Of course, it doesn't make sense to create file in a string variable, we need to store those files some where that the TS language server and prettier could run and throw errors. That's why I suggested using the packages/mermaid-example-diagram as a template.

And when running the command it would add it to packages/mermaid/src/diagrams.

@nirname
Copy link
Contributor Author

nirname commented Aug 3, 2023

Yep, exactly. It doesn't have to be mermaid-example-diagram either, it can be another package like packages/diagram-template. We could rework mermaid-example-diagram but its name does not reflect its potential purpose, so we probably could rename it or create another package for this task.

@Yokozuna59
Copy link
Member

Maybe renaming could be better, it doesn't has any other use right now.

@Yokozuna59
Copy link
Member

The script should handle two type of diagram templates, external and internal.

@weedySeaDragon weedySeaDragon linked a pull request Oct 5, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants