Skip to content

Commit

Permalink
Merge branch 'add-pie-langium-parser' of github.com:Yokozuna59/mermai…
Browse files Browse the repository at this point in the history
…d into pr/Yokozuna59/4751

* 'add-pie-langium-parser' of github.com:Yokozuna59/mermaid: (48 commits)
  make pie parser async
  Changes to gantt.html 1. Added a Gantt diagram that demonstrates to users that hashtages and semicolons can be added to titles, sections, and task data. Changes to gantt.spec.js 1. Added unit tests to ensure that semicolons and hashtags didn't break the functionality of the gantt diagram when used in titles, sections or task data. Changes to /parser/gantt.spec.js 1. Added rendering tests to ensure that semicolons and hashtags in titles, sections, and task data didn't break the rendering of Gantt diagrams.
  perf: prevent adding multiple DOMPurify hooks
  Update docs
  chore: Update tests
  Fix types
  refactor: Make parser.parse async
  refactor: Support async parsers Add `Diagram.fromText`
  Lint
  Remove echo
  RefTest
  Echo event
  Update cypress
  Fix applitools
  Fix applitools
  add sequenceDiagram link e2e test
  fix sequence diagram popup
  Changes to gantt.jison 1. Consistent spacing on line 30
  Changes to gantt.jison 1. Removed typo
  Changes to gnatt.jison 1. Removed the hash and semicolon symbols from the title regex to allow for their use. 2. Removed the hash and semicolon symbols from the section regex to allow for their use. 3. Removed the hash and semicolon symbols for the taskTxt regex to allow for their use. I did not remove the colon because the parser fails to recognize when the actual taskData begins if that distinctions isn't kept. 4. Removed the regex \#[^\n]* which skipped comments to fix some bugs with hash symbols in the taskTxt. I tested this changed by putting it back and using the comment  to see if it was recognized as a comment, but I would receive a syntax error and the diagram would not be rendered. So, I think we can safely remove that line, BUT it would be best practice if someone else tested this change to ensure that this will not break anyone's Gantt diagrams.
  ...
  • Loading branch information
sidharthv96 committed Feb 11, 2024
2 parents 16968eb + 191ea24 commit b30d609
Show file tree
Hide file tree
Showing 74 changed files with 2,002 additions and 857 deletions.
1 change: 1 addition & 0 deletions .build/jsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const MERMAID_CONFIG_DIAGRAM_KEYS = [
'gitGraph',
'c4',
'sankey',
'packet',
] as const;

/**
Expand Down
4 changes: 2 additions & 2 deletions .esbuild/build.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { build } from 'esbuild';
import { mkdir, writeFile } from 'node:fs/promises';
import { MermaidBuildOptions, defaultOptions, getBuildConfig } from './util.js';
import { packageOptions } from '../.build/common.js';
import { generateLangium } from '../.build/generateLangium.js';
import { MermaidBuildOptions, defaultOptions, getBuildConfig } from './util.js';

const shouldVisualize = process.argv.includes('--visualize');

Expand Down Expand Up @@ -56,7 +56,7 @@ const main = async () => {
await generateLangium();
await mkdir('stats').catch(() => {});
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
// it should build `parser` before `mermaid` because it's a dependecy
// it should build `parser` before `mermaid` because it's a dependency
for (const pkg of packageNames) {
await buildPackage(pkg).catch(handler);
}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:

env:
# For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used.
targetHash: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before }}
targetHash: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || (github.event.before == '0000000000000000000000000000000000000000' && 'develop' || github.event.before) }}

jobs:
cache:
Expand All @@ -30,7 +30,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Cache snapshots
id: cache-snapshot
uses: actions/cache@v4
Expand Down
21 changes: 0 additions & 21 deletions __mocks__/c4Renderer.js

This file was deleted.

16 changes: 0 additions & 16 deletions __mocks__/classRenderer-v2.js

This file was deleted.

13 changes: 0 additions & 13 deletions __mocks__/classRenderer.js

This file was deleted.

1 change: 0 additions & 1 deletion __mocks__/dagre-d3.ts

This file was deleted.

3 changes: 0 additions & 3 deletions __mocks__/entity-decode/browser.ts

This file was deleted.

16 changes: 0 additions & 16 deletions __mocks__/erRenderer.js

This file was deleted.

24 changes: 0 additions & 24 deletions __mocks__/flowRenderer-v2.js

This file was deleted.

16 changes: 0 additions & 16 deletions __mocks__/ganttRenderer.js

This file was deleted.

13 changes: 0 additions & 13 deletions __mocks__/gitGraphRenderer.js

This file was deleted.

15 changes: 0 additions & 15 deletions __mocks__/journeyRenderer.js

This file was deleted.

8 changes: 0 additions & 8 deletions __mocks__/pieRenderer.ts

This file was deleted.

13 changes: 0 additions & 13 deletions __mocks__/requirementRenderer.js

This file was deleted.

13 changes: 0 additions & 13 deletions __mocks__/sankeyRenderer.js

This file was deleted.

23 changes: 0 additions & 23 deletions __mocks__/sequenceRenderer.js

This file was deleted.

22 changes: 0 additions & 22 deletions __mocks__/stateRenderer-v2.js

This file was deleted.

19 changes: 0 additions & 19 deletions applitools.config.js

This file was deleted.

32 changes: 0 additions & 32 deletions cypress.config.cjs

This file was deleted.

30 changes: 30 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from 'cypress';
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';
import coverage from '@cypress/code-coverage/task';
import eyesPlugin from '@applitools/eyes-cypress';
export default eyesPlugin(
defineConfig({
projectId: 'n2sma2',
viewportWidth: 1440,
viewportHeight: 1024,
e2e: {
specPattern: 'cypress/integration/**/*.{js,ts}',
setupNodeEvents(on, config) {
coverage(on, config);
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--window-size=1440,1024', '--force-device-scale-factor=1');
}
return launchOptions;
});
addMatchImageSnapshotPlugin(on, config);
// copy any needed variables from process.env to config.env
config.env.useAppli = process.env.USE_APPLI ? true : false;

// do not forget to return the changed config object!
return config;
},
},
video: false,
})
);
Loading

0 comments on commit b30d609

Please sign in to comment.