From 66f388801670ff11da95299ccea2d7285287c4d3 Mon Sep 17 00:00:00 2001 From: Matheus B Date: Mon, 15 Jan 2024 22:02:35 -0300 Subject: [PATCH] Revert merge --- .github/pr-labeler.yml | 26 +- .github/release-drafter.yml | 2 + .../workflows/pr-labeler-config-validator.yml | 23 ++ .github/workflows/pr-labeler.yml | 22 +- .github/workflows/release-draft.yml | 10 +- README.md | 16 - .../integration/rendering/gitGraph.spec.js | 110 ------ demos/git.html | 358 +----------------- demos/sequence.html | 7 - .../src/diagrams/class/classTypes.spec.ts | 79 ---- .../mermaid/src/diagrams/class/classTypes.ts | 2 +- .../mermaid/src/diagrams/flowchart/flowDb.js | 7 - .../flowchart/parser/flow-style.spec.js | 24 -- .../src/diagrams/git/gitGraphRenderer.js | 91 ++--- .../src/diagrams/sequence/sequenceRenderer.ts | 11 +- .../mermaid/src/diagrams/sequence/svgDraw.js | 2 +- 16 files changed, 87 insertions(+), 703 deletions(-) create mode 100644 .github/workflows/pr-labeler-config-validator.yml diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml index 15e1843276..0bbd8db66a 100644 --- a/.github/pr-labeler.yml +++ b/.github/pr-labeler.yml @@ -1,22 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/release-drafter/release-drafter/master/schema.json -autolabeler: - - label: 'Type: Bug / Error' - branch: - - '/bug\/.+/' - - '/fix\/.+/' - - label: 'Type: Enhancement' - branch: - - '/feature\/.+/' - - '/feat\/.+/' - - label: 'Type: Other' - branch: - - '/other\/.+/' - - '/chore\/.+/' - - '/test\/.+/' - - '/refactor\/.+/' - - label: 'Area: Documentation' - branch: - - '/docs\/.+/' - -template: | - This field is unused, as we only use this config file for labeling PRs. +'Type: Bug / Error': ['bug/*', fix/*] +'Type: Enhancement': ['feature/*', 'feat/*'] +'Type: Other': ['other/*', 'chore/*', 'test/*', 'refactor/*'] +'Area: Documentation': ['docs/*'] diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 83138c3d46..e650f8dd11 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -25,6 +25,8 @@ categories: change-template: '- $TITLE (#$NUMBER) @$AUTHOR' sort-by: title sort-direction: ascending +branches: + - develop exclude-labels: - 'Skip changelog' no-changes-template: 'This release contains minor changes and bugfixes.' diff --git a/.github/workflows/pr-labeler-config-validator.yml b/.github/workflows/pr-labeler-config-validator.yml new file mode 100644 index 0000000000..8bdfed21bc --- /dev/null +++ b/.github/workflows/pr-labeler-config-validator.yml @@ -0,0 +1,23 @@ +name: Validate PR Labeler Configuration +on: + push: + paths: + - .github/workflows/pr-labeler-config-validator.yml + - .github/workflows/pr-labeler.yml + - .github/pr-labeler.yml + pull_request: + paths: + - .github/workflows/pr-labeler-config-validator.yml + - .github/workflows/pr-labeler.yml + - .github/pr-labeler.yml + +jobs: + pr-labeler: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Configuration + uses: Yash-Singh1/pr-labeler-config-validator@releases/v0.0.3 + with: + configuration-path: .github/pr-labeler.yml diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index b2fc1cc26e..0a53c6e424 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -1,31 +1,13 @@ name: Apply labels to PR on: pull_request_target: - # required for pr-labeler to support PRs from forks - # ===================== ⛔ ☢️ 🚫 ⚠️ Warning ⚠️ 🚫 ☢️ ⛔ ======================= - # Be very careful what you put in this GitHub Action workflow file to avoid - # malicious PRs from getting access to the Mermaid-js repo. - # - # Please read the following first before reviewing/merging: - # - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target - # - https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ - types: [opened, reopened, synchronize] - -permissions: - contents: read + types: [opened] jobs: pr-labeler: runs-on: ubuntu-latest - permissions: - contents: read # read permission is required to read config file - pull-requests: write # write permission is required to label PRs steps: - name: Label PR - uses: release-drafter/release-drafter@v5 - with: - config-name: pr-labeler.yml - disable-autolabeler: false - disable-releaser: true + uses: TimonVS/pr-labeler-action@v4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index 8ad1b13ecd..a37b7bcf2a 100644 --- a/.github/workflows/release-draft.yml +++ b/.github/workflows/release-draft.yml @@ -5,19 +5,11 @@ on: branches: - develop -permissions: - contents: read - jobs: draft-release: runs-on: ubuntu-latest - permissions: - contents: write # write permission is required to create a github release - pull-requests: read # required to read PR titles/labels steps: - name: Draft Release - uses: release-drafter/release-drafter@v5 - with: - disable-autolabeler: true + uses: toolmantim/release-drafter@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index cf21fdb8e6..ab2aeb2e73 100644 --- a/README.md +++ b/README.md @@ -44,22 +44,6 @@ Try Live Editor previews of future releases: Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out! -## Table of content - -
-Expand contents - -- [About](#about) -- [Examples](#examples) -- [Release](#release) -- [Related projects](#related-projects) -- [Contributors](#contributors) -- [Security and safe diagrams](#security-and-safe-diagrams) -- [Reporting vulnerabilities](#reporting-vulnerabilities) -- [Appreciation](#appreciation) - -
- ## About diff --git a/cypress/integration/rendering/gitGraph.spec.js b/cypress/integration/rendering/gitGraph.spec.js index 2aab34c343..9f040a36f0 100644 --- a/cypress/integration/rendering/gitGraph.spec.js +++ b/cypress/integration/rendering/gitGraph.spec.js @@ -701,114 +701,4 @@ gitGraph TB: {} ); }); - it('34: should render a simple gitgraph with two branches from same commit', () => { - imgSnapshotTest( - `gitGraph - commit id:"1-abcdefg" - commit id:"2-abcdefg" - branch feature-001 - commit id:"3-abcdefg" - commit id:"4-abcdefg" - checkout main - branch feature-002 - commit id:"5-abcdefg" - checkout feature-001 - merge feature-002 - `, - {} - ); - }); - it('35: should render a simple gitgraph with two branches from same commit | Vertical Branch', () => { - imgSnapshotTest( - `gitGraph TB: - commit id:"1-abcdefg" - commit id:"2-abcdefg" - branch feature-001 - commit id:"3-abcdefg" - commit id:"4-abcdefg" - checkout main - branch feature-002 - commit id:"5-abcdefg" - checkout feature-001 - merge feature-002 - `, - {} - ); - }); - it('36: should render GitGraph with branch that is not used immediately', () => { - imgSnapshotTest( - `gitGraph LR: - commit id:"1-abcdefg" - branch x - checkout main - commit id:"2-abcdefg" - checkout x - commit id:"3-abcdefg" - checkout main - merge x - `, - {} - ); - }); - it('37: should render GitGraph with branch that is not used immediately | Vertical Branch', () => { - imgSnapshotTest( - `gitGraph TB: - commit id:"1-abcdefg" - branch x - checkout main - commit id:"2-abcdefg" - checkout x - commit id:"3-abcdefg" - checkout main - merge x - `, - {} - ); - }); - it('38: should render GitGraph with branch and sub-branch neither of which used immediately', () => { - imgSnapshotTest( - `gitGraph LR: - commit id:"1-abcdefg" - branch x - checkout main - commit id:"2-abcdefg" - checkout x - commit id:"3-abcdefg" - checkout main - merge x - checkout x - branch y - checkout x - commit id:"4-abcdefg" - checkout y - commit id:"5-abcdefg" - checkout x - merge y - `, - {} - ); - }); - it('39: should render GitGraph with branch and sub-branch neither of which used immediately | Vertical Branch', () => { - imgSnapshotTest( - `gitGraph TB: - commit id:"1-abcdefg" - branch x - checkout main - commit id:"2-abcdefg" - checkout x - commit id:"3-abcdefg" - checkout main - merge x - checkout x - branch y - checkout x - commit id:"4-abcdefg" - checkout y - commit id:"5-abcdefg" - checkout x - merge y - `, - {} - ); - }); }); diff --git a/demos/git.html b/demos/git.html index 92e0e68635..f24217711e 100644 --- a/demos/git.html +++ b/demos/git.html @@ -14,364 +14,30 @@ -

Git graph demo

-

Simple "branch and merge" graph

+

Git diagram demo

     ---
-    title: Simple "branch and merge" (left-to-right)
+    title: Simple Git diagram
     ---
-    gitGraph LR:
+    gitGraph:
+    options
+    {
+    "nodeSpacing": 50,
+    "nodeRadius": 5
+    }
+    end
+    branch master
     commit
     branch newbranch
     checkout newbranch
     commit
-    checkout main
-    merge newbranch
-    
-
-    ---
-    title: Simple "branch and merge" (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit
-    checkout main
-    merge newbranch
-    
-

Continuous development graph

-
-    ---
-    title: Continuous development (left-to-right)
-    ---
-    gitGraph LR:
     commit
-    branch develop
-    checkout develop
+    checkout master
     commit
-    checkout main
-    merge develop
-    checkout develop
-    commit
-    checkout main
-    merge develop
-    
-
-    ---
-    title: Continuous development (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch develop
-    checkout develop
-    commit
-    checkout main
-    merge develop
-    checkout develop
-    commit
-    checkout main
-    merge develop
-    
-

Merge feature to advanced main graph

-
-    ---
-    title: Merge feature to advanced main (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit
-    checkout main
     commit
     merge newbranch
     
-
-    ---
-    title: Merge feature to advanced main (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit
-    checkout main
-    commit
-    merge newbranch
-    
-

Two-way merges

-
-    ---
-    title: Two-way merges (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch develop
-    checkout develop
-    commit
-    checkout main
-    merge develop
-    commit
-    checkout develop
-    merge main
-    commit
-    checkout main
-    merge develop
-    
-
-    ---
-    title: Two-way merges (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch develop
-    checkout develop
-    commit
-    checkout main
-    merge develop
-    commit
-    checkout develop
-    merge main
-    commit
-    checkout main
-    merge develop
-    
-

Cherry-pick from branch graph

-
-    ---
-    title: Cherry-pick from branch (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit id: "Pick me"
-    checkout main
-    commit
-    checkout newbranch
-    commit
-    checkout main
-    cherry-pick id: "Pick me"
-    
-
-    ---
-    title: Cherry-pick from branch (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit id: "Pick me"
-    checkout main
-    commit
-    checkout newbranch
-    commit
-    checkout main
-    cherry-pick id: "Pick me"
-    
-

Cherry-pick from main graph

-
-    ---
-    title: Cherry-pick from main (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch develop
-    commit
-    checkout main
-    commit id:"A"
-    checkout develop
-    commit
-    cherry-pick id: "A"
-    
-
-    ---
-    title: Cherry-pick from main (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch develop
-    commit
-    checkout main
-    commit id:"A"
-    checkout develop
-    commit
-    cherry-pick id: "A"
-    
-

Cherry-pick then merge graph

-
-    ---
-    title: Cherry-pick then merge (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit id: "Pick me"
-    checkout main
-    commit
-    checkout newbranch
-    commit
-    checkout main
-    cherry-pick id: "Pick me"
-    merge newbranch
-    
-
-    ---
-    title: Cherry-pick then merge (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch newbranch
-    checkout newbranch
-    commit id: "Pick me"
-    checkout main
-    commit
-    checkout newbranch
-    commit
-    checkout main
-    cherry-pick id: "Pick me"
-    merge newbranch
-    
-

Merge from main onto undeveloped branch graph

-
-    ---
-    title: Merge from main onto undeveloped branch (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch develop
-    commit
-    checkout main
-    commit
-    checkout develop
-    merge main
-    
-
-    ---
-    title: Merge from main onto undeveloped branch (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch develop
-    commit
-    checkout main
-    commit
-    checkout develop
-    merge main
-    
-

Merge from main onto developed branch graph

-
-    ---
-    title: Merge from main onto developed branch (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    branch develop
-    commit
-    checkout main
-    commit
-    checkout develop
-    commit
-    merge main
-    
-
-    ---
-    title: Merge from main onto developed branch (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    branch develop
-    commit
-    checkout main
-    commit
-    checkout develop
-    commit
-    merge main
-    
-

Two branches from same commit graph

-
-    ---
-    title: Two branches from same commit (left-to-right)
-    ---
-    gitGraph LR:
-    commit
-    commit
-    branch feature-001
-    commit
-    commit
-    checkout main
-    branch feature-002
-    commit
-    checkout feature-001
-    merge feature-002
-    
-
-    ---
-    title: Two branches from same commit (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit
-    commit
-    branch feature-001
-    commit
-    commit
-    checkout main
-    branch feature-002
-    commit
-    checkout feature-001
-    merge feature-002
-    
-

Three branches and a cherry-pick from each graph

-
-    ---
-    title: Three branches and a cherry-pick from each (left-to-right)
-    ---
-    gitGraph LR:
-    commit id: "ZERO"
-    branch develop
-    commit id:"A"
-    checkout main
-    commit id:"ONE"
-    checkout develop
-    commit id:"B"
-    branch featureA
-    commit id:"FIX"
-    commit id: "FIX-2"
-    checkout main
-    commit id:"TWO"
-    cherry-pick id:"A"
-    commit id:"THREE"
-    cherry-pick id:"FIX"
-    checkout develop
-    commit id:"C"
-    merge featureA
-    
-
-    ---
-    title: Three branches and a cherry-pick from each (top-to-bottom)
-    ---
-    gitGraph TB:
-    commit id: "ZERO"
-    branch develop
-    commit id:"A"
-    checkout main
-    commit id:"ONE"
-    checkout develop
-    commit id:"B"
-    branch featureA
-    commit id:"FIX"
-    commit id: "FIX-2"
-    checkout main
-    commit id:"TWO"
-    cherry-pick id:"A"
-    commit id:"THREE"
-    cherry-pick id:"FIX"
-    checkout develop
-    commit id:"C"
-    merge featureA
-    
+