-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Create Mermaid live editor preview for PRs #3348
Comments
I'm slightly against moving Currently, people can use (they can also fork mermaid and use Unfortunately, npm/yarn git urls don't yet support mono-repos.
Every PR's action also creates a Alternatives (in my opinion) We could make a GitHub action that does a: git clone https://github.com/mermaid-js/mermaid-live-editor
cd mermaid-live-editor
yarn add ${{ github.event.head_repository.html_url}}#${{ github.event.head_sha }}
yarn install
yarn build but I've got no idea if Netlify will support this for PRs. Even better (visual inspection tests) Edit: Nevermind, I'm dumb. There's already visual inspection tests with
|
Seems like the best option without making any breaking changes, keeping things simple. |
@sidharthv96 not sure this would work - the git does not contain the built version, only the source. EDIT: Just saw the
@aloisklink This doesn't actually solve the problem, as you can make sure that things don't break, but you can't do exploratory testing. |
Implemented by #4769! The approach isn't exactly the same (since Mermaid is now a |
Is your feature request related to a problem? Please describe.
When developing new features for mermaid itself, it can be hard to review them easily, as there is no easy way to just play around with Mermaid diagrams in the browser. This discussion came up for the C4 integration.
Describe the solution you'd like
Ideally, each PR creates a custom deployment of the Mermaid Live Editor, using the PRs version of Mermaid. This could be achieved with a service like Netlify that is already used to deploy the production version of the Mermaid Live Editor.
The biggest challenge is to get the correct mermaid version to be used by the Live Editor. In the current form, the Live Editor uses the npm repository to install mermaid itself.
One solution to this problem could be to move the project into a monorepo, and then to use the local git version of Mermaid instead of the npm version. This could be facilitated with a monorepo management tool like rush or turborepo.
Describe alternatives you've considered
The simplest alternative to a live editor would be running mermaid PRs locally with help of the e2e setup, but this would be significantly more work for a reviewer compared to just clicking a link in the PR.
As an alternative to using a monorepo, we could change the Live Editor to load mermaid asynchronously with an option to select the source, and publish a mermaid version for each PR. This would be significantly more work than moving the projects to a monorepo.
Instead of Netlify, we could also use other services like e.g. Amplify, but since the editor already uses Netlify, this might be additional work without additional benefits.
Additional context
I'm happy to help around implementation. I've already moved open source projects to monorepos and have experience specifically with rush.
The text was updated successfully, but these errors were encountered: