Skip to content

Commit

Permalink
Merge branch 'release/10.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Apr 4, 2023
2 parents a49cdab + 75adb8a commit e7c237d
Show file tree
Hide file tree
Showing 99 changed files with 2,704 additions and 927 deletions.
12 changes: 2 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,10 @@ body:
label: Setup
description: |-
Please fill out the below info.
Note that you only need to fill out one and not both sections.
Note that you only need to fill out the relevant section
value: |-
**Desktop**
- OS and Version: [Windows, Linux, Mac, ...]
- Mermaid version:
- Browser and Version: [Chrome, Edge, Firefox]
**Smartphone**
- Device: [Samsung, iPhone, ...]
- OS and Version: [Android, iOS, ...]
- Browser and Version: [Chrome, Safari, ...]
- type: textarea
attributes:
label: Additional Context
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ jobs:

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
# Need to skip setup if Cypress run is skipped, otherwise an error
# is thrown since the pnpm cache step fails
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
with:
cache: pnpm
node-version: ${{ matrix.node-version }}

# Install NPM dependencies, cache them correctly
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
pull_request:
branches:
- master
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 8 * * *'
Expand All @@ -35,9 +36,16 @@ jobs:
restore-keys: cache-lychee-

- name: Link Checker
uses: lycheeverse/lychee-action@v1.5.4
uses: lycheeverse/lychee-action@v1.6.1
with:
args: --verbose --no-progress --cache --max-cache-age 1d packages/mermaid/src/docs/**/*.md README.md README.zh-CN.md
args: >-
--verbose
--no-progress
--cache
--max-cache-age 1d
packages/mermaid/src/docs/**/*.md
README.md
README.zh-CN.md
fail: true
jobSummary: true
env:
Expand Down
8 changes: 0 additions & 8 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@
# Network error: Forbidden
https://codepen.io

# Network error: The certificate was not trusted
https://mkdocs.org/
https://osawards.com/javascript/#nominees
https://osawards.com/javascript/2019

# Timeout error, maybe Twitter has anti-bot defenses against GitHub's CI servers?
https://twitter.com/mermaidjs_

# Don't check files that are generated during the build via `pnpm docs:code`
packages/mermaid/src/docs/config/setup/*

# Network error: 502, since few days
https://bundlephobia.com/
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
auto-install-peers=true
strict-peer-dependencies=false
use-inline-specifiers-lockfile-format=true
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ The documentation is written in **Markdown**. For more information about Markdow
The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.

After editing files in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory, be sure to run `pnpm install` and `pnpm run --filter mermaid docs:build` locally to build the `/docs` directory.

```mermaid
flowchart LR
classDef default fill:#fff,color:black,stroke:black
Expand Down
16 changes: 0 additions & 16 deletions cypress/integration/rendering/erDiagram.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render an ER diagram with a recursive relationship', () => {
Expand All @@ -23,7 +22,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render an ER diagram with multiple relationships between the same two entities', () => {
Expand All @@ -35,7 +33,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render a cyclical ER diagram', () => {
Expand All @@ -48,7 +45,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render a not-so-simple ER diagram', () => {
Expand All @@ -66,7 +62,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render multiple ER diagrams', () => {
Expand All @@ -85,7 +80,6 @@ describe('Entity Relationship Diagram', () => {
],
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render an ER diagram with blank or empty labels', () => {
Expand All @@ -98,7 +92,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render an ER diagrams when useMaxWidth is true (default)', () => {
Expand Down Expand Up @@ -151,7 +144,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ er: { useMaxWidth: false } }
);
cy.get('svg');
});

it('should render entities with and without attributes', () => {
Expand All @@ -164,7 +156,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities with generic and array attributes', () => {
Expand All @@ -179,7 +170,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities with length in attributes type', () => {
Expand All @@ -193,7 +183,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities and attributes with big and small entity names', () => {
Expand All @@ -209,7 +198,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities with keys', () => {
Expand All @@ -228,7 +216,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities with comments', () => {
Expand All @@ -247,7 +234,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities with keys and comments', () => {
Expand All @@ -267,7 +253,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('should render entities with aliases', () => {
Expand All @@ -285,7 +270,6 @@ describe('Entity Relationship Diagram', () => {
`,
{ logLevel: 1 }
);
cy.get('svg');
});

it('1433: should render a simple ER diagram with a title', () => {
Expand Down
45 changes: 45 additions & 0 deletions cypress/integration/rendering/errorDiagram.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { imgSnapshotTest } from '../../helpers/util';

describe('Error Diagrams', () => {
beforeEach(() => {
cy.on('uncaught:exception', (err) => {
expect(err.message).to.include('Parse error');
// return false to prevent the error from
// failing this test
return false;
});
});

it('should render a simple ER diagram', () => {
imgSnapshotTest(
`
error
`,
{ logLevel: 1 }
);
});

it('should render error diagram for actual errors', () => {
imgSnapshotTest(
`
flowchart TD
A[Christmas] --|Get money| B(Go shopping)
`,
{ logLevel: 1 }
);
});

it('should render error for wrong ER diagram', () => {
imgSnapshotTest(
`
erDiagram
ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
MONGODB-CLUSTERS ||..|{
ATLAS-TEAMS ||..|{
`,
{ logLevel: 1 }
);
});
});
Loading

0 comments on commit e7c237d

Please sign in to comment.