* Creates a utility method `jsdomIt` that overrides `it` from `vitest` and fakes a browser environment by :
* Creating a DOM with `jsdom` (and `canvas`)
* Adding (for the duration of the test) that DOM's `window` and `document` on `global`
* Monkey-patching DOM methods that require a rendering engine (`Element.getBBox` & `Element.getComputedLength`)
* Removes all d3 mocking since it can now work normally in `jsdomIt` tests
* Re-writes existing rendering tests to :
* Use `jsdomIt`
* Get rid of most of the involved mocking
* Run `expect` calls on the generated SVG instead
Inspired by d3's own test code mocking : https://github.com/d3/d3-selection/blob/v3.0.0/test/jsdom.js
* develop: (70 commits)
build(deps-dev): bump vite from 4.4.9 to 4.4.12
Changes to .prettierignore 1. Added 'demos/dev/**' to be ignored by Prettier. 2. Added '!/demos/dev/example.html' so that Prettier ensures no one changes the example.html in a way that doesn't obey the Prettier code formatting rules.
build: use `tsx` instead of `ts-node-esm`
chore: Downgrade node to 18.18.2
fix: #5100 Add viewbox to sankey
chore(deps): update all minor dependencies
chore: Rename test
test: Add unit test for generic classname and namespace
fix: Check if parentCommit is provided
Split type from generic class name
Condition of Parent Id Without Merge Commit Added
Referenced the PmWiki's Cookbook recipe enabling MermaidJs schematics in wiki pages
test(e2e): fix pie chart E2E tests for PR #4288
Add dummy commit to trigger GH checks
chore: Revert unnecessary export
refactor: Remove unnecessary calculations
chore: Fix computeWidth function
chore: Cleanup setupGraphViewbox
Update docs
update mermaidAPI to cleanup the text before passing to getDiagramFromText
...
* next: (27 commits)
chore: Fix type
refactor!: remove MermaidConfig type enum fallback
test: rewrite some `config` vals to tighten types
chore: Add comment for `yy`.
chore: Increase heap size when building
chore: increase `test-util.ts` converage by returning `undefined`
chore: add `vitest` imports to `test-util.ts`
chore: run `pnpm lint:fix`
create `noErrorsOrAlternatives` parser helper function
chore: export `InfoModule` from `infoModule.ts`
docs(parser): create `packages/parser` README.md file
build: build `.langium` file using `generate` from `langium-cli`
build: update `langium` and `langium-cli` to `v2.0.1`
fix: fix if statment logic checks if `parser` is not `undefined`
chore: add a comment illustrate why we build packages sequentially
chore: refactore `&&` into `if` in `populateCommonDb`
chore: remove `./*` part from `exports` in `parser/package.json`
fix: use `execFileSync` instead of `execSync` in `generateLangium`
fix(mermaid): mark `mermaid-parser` dependecy with `^`
reorder `packages/parser` after `packages/mermaid/src/vitepress`
...
Adds a vitepress JsonSchema plugin that automatically loads
the Mermaid Config JSON Schema from a .schema.yaml file and
gets the default values from it.
The `node16` module resolution requires imports to use the `.js` file
extension in type definitions.
`@rollup/plugin-typescript` is needed to make this work with the Vite
setup used by Mermaid.
The module option for Mermaid internally is set to `nodenext`. This is
needed to support `.json` imports. Note that setting `module` to
`node16` or `nodenext` implies a matching `moduleResolution` value.