Skip to content

Commit

Permalink
Merge branch 'release/9.4.2' into pr/AielloChan/4101
Browse files Browse the repository at this point in the history
* release/9.4.2:
  RC version
  Revert mermaid-js#4034
  Revert mermaid-js#4034
  fix: Vite, D3, Vitest Types
  • Loading branch information
sidharthv96 committed Feb 18, 2023
2 parents e31924e + 2c062d6 commit 735faa8
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 362 deletions.
22 changes: 11 additions & 11 deletions docs/config/setup/modules/mermaidAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi)

#### Defined in

[mermaidAPI.ts:74](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L74)
[mermaidAPI.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L75)

## Variables

Expand Down Expand Up @@ -90,7 +90,7 @@ mermaid.initialize(config);

#### Defined in

[mermaidAPI.ts:886](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L886)
[mermaidAPI.ts:887](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L887)

## Functions

Expand Down Expand Up @@ -121,7 +121,7 @@ Return the last node appended

#### Defined in

[mermaidAPI.ts:287](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L287)
[mermaidAPI.ts:288](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L288)

---

Expand All @@ -147,7 +147,7 @@ the cleaned up svgCode

#### Defined in

[mermaidAPI.ts:238](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L238)
[mermaidAPI.ts:239](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L239)

---

Expand All @@ -173,7 +173,7 @@ the string with all the user styles

#### Defined in

[mermaidAPI.ts:167](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L167)
[mermaidAPI.ts:168](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L168)

---

Expand All @@ -196,7 +196,7 @@ the string with all the user styles

#### Defined in

[mermaidAPI.ts:215](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L215)
[mermaidAPI.ts:216](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L216)

---

Expand All @@ -223,7 +223,7 @@ with an enclosing block that has each of the cssClasses followed by !important;

#### Defined in

[mermaidAPI.ts:151](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L151)
[mermaidAPI.ts:152](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L152)

---

Expand All @@ -243,7 +243,7 @@ with an enclosing block that has each of the cssClasses followed by !important;

#### Defined in

[mermaidAPI.ts:131](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L131)
[mermaidAPI.ts:132](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L132)

---

Expand All @@ -263,7 +263,7 @@ with an enclosing block that has each of the cssClasses followed by !important;

#### Defined in

[mermaidAPI.ts:102](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L102)
[mermaidAPI.ts:103](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L103)

---

Expand All @@ -289,7 +289,7 @@ Put the svgCode into an iFrame. Return the iFrame code

#### Defined in

[mermaidAPI.ts:266](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L266)
[mermaidAPI.ts:267](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L267)

---

Expand All @@ -314,4 +314,4 @@ Remove any existing elements from the given document

#### Defined in

[mermaidAPI.ts:337](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L337)
[mermaidAPI.ts:338](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L338)
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:watch": "vitest --watch",
"test:coverage": "vitest --coverage",
"prepublishOnly": "pnpm build && pnpm test",
"prepare": "concurrently \"husky install\" \"pnpm build\"",
"prepare": "husky install && pnpm build",
"pre-commit": "lint-staged"
},
"repository": {
Expand Down Expand Up @@ -103,11 +103,11 @@
"prettier-plugin-jsdoc": "^0.4.2",
"rimraf": "^4.0.0",
"rollup-plugin-visualizer": "^5.8.3",
"start-server-and-test": "^1.14.0",
"start-server-and-test": "^1.15.4",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"vite": "^4.0.0",
"vitest": "^0.28.4"
"vite": "^4.1.1",
"vitest": "^0.28.5"
},
"volta": {
"node": "18.14.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/mermaid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mermaid",
"version": "9.4.0",
"version": "9.4.2-rc.1",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"main": "./dist/mermaid.min.js",
"module": "./dist/mermaid.core.mjs",
Expand Down Expand Up @@ -56,13 +56,13 @@
"cytoscape": "^3.23.0",
"cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-fcose": "^2.1.0",
"d3": "^7.0.0",
"d3": "^7.4.0",
"dagre-d3-es": "7.0.8",
"dompurify": "2.4.3",
"elkjs": "^0.8.2",
"khroma": "^2.0.0",
"lodash-es": "^4.17.21",
"moment": "^2.29.4",
"moment-mini": "^2.29.4",
"non-layered-tidy-tree-layout": "^2.0.2",
"stylis": "^4.1.2",
"ts-dedent": "^2.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/mermaid/src/diagrams/error/errorRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** Created by knut on 14-12-11. */
// @ts-ignore TODO: Investigate D3 issue
import { select } from 'd3';
import { log } from '../../logger';
import { getErrorMessage } from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/gantt/ganttDb.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-mini';
import { sanitizeUrl } from '@braintree/sanitize-url';
import { log } from '../../logger';
import * as configApi from '../../config';
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck TODO: Fix TS
import moment from 'moment';
import moment from 'moment-mini';
import ganttDb from './ganttDb';
import { convert } from '../../tests/util';

Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/gantt/ganttRenderer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-mini';
import { log } from '../../logger';
import {
select,
Expand Down
11 changes: 3 additions & 8 deletions packages/mermaid/src/docs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,28 @@ export default defineConfig({
// TODO: will be fixed in the next vitepress release.
name: 'fix-virtual',

async resolveId(id) {
async resolveId(id: string) {
if (id === virtualModuleId) {
return resolvedVirtualModuleId;
}
},
async load(this, id) {
async load(this, id: string) {
if (id === resolvedVirtualModuleId) {
return `export default ${JSON.stringify({
securityLevel: 'loose',
startOnLoad: false,
})};`;
}
},
},
} as PluginOption,
],
resolve: {
alias: {
mermaid: path.join(__dirname, '../../dist/mermaid.esm.min.mjs'), // Use this one to build

'@mermaid-js/mermaid-example-diagram': path.join(
__dirname,
'../../../mermaid-example-diagram/dist/mermaid-example-diagram.esm.min.mjs'
), // Use this one to build
// '@mermaid-js/mermaid-timeline': path.join(
// __dirname,
// '../../../mermaid-timeline/dist/mermaid-timeline.esm.min.mjs'
// ),
},
},
server: {
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable no-console */
import moment from 'moment';
import moment from 'moment-mini';

export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';

Expand Down
1 change: 1 addition & 0 deletions packages/mermaid/src/mermaidAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* In addition to the render function, a number of behavioral configuration options are available.
*/
// @ts-ignore TODO: Investigate D3 issue
import { select } from 'd3';
import { compile, serialize, stringify } from 'stylis';
// @ts-ignore: TODO Fix ts errors
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/tests/MockedD3.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {} from '@vitest/spy';
import type {} from '@vitest/spy/dist/index';

/**
* This is a mocked/stubbed version of the d3 Selection type. Each of the main functions are all
Expand Down
Loading

0 comments on commit 735faa8

Please sign in to comment.