diff --git a/.eslintrc.json b/.eslintrc.json index b8053795e..7b95ac6da 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,9 +19,10 @@ "plugin:jsdoc/recommended", "plugin:json/recommended", "plugin:markdown/recommended", + "plugin:@cspell/recommended", "prettier" ], - "plugins": ["@typescript-eslint", "html", "jest", "jsdoc", "json"], + "plugins": ["@typescript-eslint", "no-only-tests", "html", "jest", "jsdoc", "json", "@cspell"], "rules": { "no-console": "error", "no-prototype-builtins": "off", @@ -48,7 +49,21 @@ } ], "json/*": ["error", "allowComments"], - "no-empty": ["error", { "allowEmptyCatch": true }] + "@cspell/spellchecker": [ + "error", + { + "checkIdentifiers": false, + "checkStrings": false, + "checkStringTemplates": false + } + ], + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], + "no-only-tests/no-only-tests": "error" }, "overrides": [ { diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 5add84f22..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -updates: - - package-ecosystem: npm - open-pull-requests-limit: 10 - directory: / - target-branch: develop - versioning-strategy: increase - schedule: - interval: weekly - day: monday - time: '07:00' - - package-ecosystem: github-actions - directory: / - target-branch: develop - schedule: - interval: weekly - day: monday - time: '07:00' diff --git a/.vite/server.ts b/.vite/server.ts index c62b6236a..334398dd8 100644 --- a/.vite/server.ts +++ b/.vite/server.ts @@ -1,7 +1,15 @@ -import express from 'express'; +import express, { NextFunction, Request, Response } from 'express'; import { createServer as createViteServer } from 'vite'; // import { getBuildConfig } from './build'; +const cors = (req: Request, res: Response, next: NextFunction) => { + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); + res.header('Access-Control-Allow-Headers', 'Content-Type'); + + next(); +}; + async function createServer() { const app = express(); @@ -12,6 +20,7 @@ async function createServer() { appType: 'custom', // don't include Vite's default HTML handling middlewares }); + app.use(cors); app.use(express.static('./packages/mermaid/dist')); app.use(express.static('./packages/mermaid-example-diagram/dist')); app.use(express.static('./packages/mermaid-mindmap/dist')); diff --git a/cSpell.json b/cSpell.json index 5abf6e283..719c09d14 100644 --- a/cSpell.json +++ b/cSpell.json @@ -2,43 +2,70 @@ "version": "0.2", "language": "en", "words": [ + "gantt", + "mindmaps", + "visio", + "colour", "customizability", - "Gantt", + "flatmap", "jison", - "knsv", - "Knut", + "mermiad", "mindmap", - "Mindmaps", "mitigations", "sandboxed", - "Sveidqvist", + "santize", + "stylis", "verdana", - "Visio" + "xlink" ], "ignoreWords": [ - "Adamiecki", + "adamiecki", + "asciidoctor", + "ashish", + "astah", + "bilkent", + "bisheng", + "docsy", + "doku", + "gitea", + "gitgraph", + "grav", + "inkdrop", + "jaoude", + "kaufmann", + "knut", + "lucida", + "plantuml", + "playfair's", + "podlite", + "sveidqvist", + "tuleap", + "acyclicer", + "antiscript", "applitools", - "Asciidoctor", - "Astah", - "Bisheng", + "bbox", "codedoc", - "Docsy", - "Doku", - "Gitea", - "Gitgraph", - "Grav", - "Inkdrop", - "Jaoude", + "cpettitt", + "cytoscape", + "dagre", + "descr", + "docsify", + "edgechromium", + "graphlib", + "knsv", "mdbook", "mermerd", "mkdocs", "phpbb", - "Plantuml", - "Playfair's", - "Podlite", + "ranksep", "redmine", + "setupgraphviewbox", "sphinxcontrib", - "Tuleap" + "substate", + "techn", + "ts-nocheck", + "viewports", + "vitepress" ], "patterns": [ { diff --git a/cypress/helpers/util.js b/cypress/helpers/util.js index bee9a59f0..33632b28a 100644 --- a/cypress/helpers/util.js +++ b/cypress/helpers/util.js @@ -45,7 +45,6 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) => options.fontSize = '16px'; } const useAppli = Cypress.env('useAppli'); - //const useAppli = false; cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot'); const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-'); diff --git a/cypress/integration/rendering/appli.spec.js b/cypress/integration/rendering/appli.spec.js index d6a83eb8b..462fe869c 100644 --- a/cypress/integration/rendering/appli.spec.js +++ b/cypress/integration/rendering/appli.spec.js @@ -21,7 +21,7 @@ describe('Git Graph diagram', () => { // // Call Open on eyes to initialize a test session // cy.eyesOpen({ // appName: 'Demo App', - // testName: 'Ultrafast grid demo', + // testName: 'UltraFast grid demo', // }); // // check the login page with fluent api, see more info here diff --git a/cypress/integration/rendering/erDiagram.spec.js b/cypress/integration/rendering/erDiagram.spec.js index 0f9084e7c..063727024 100644 --- a/cypress/integration/rendering/erDiagram.spec.js +++ b/cypress/integration/rendering/erDiagram.spec.js @@ -167,7 +167,7 @@ describe('Entity Relationship Diagram', () => { cy.get('svg'); }); - it.only('should render entities with generic and array attributes', () => { + it('should render entities with generic and array attributes', () => { renderGraph( ` erDiagram diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html index 506ac51ae..ef44ed617 100644 --- a/cypress/platform/knsv2.html +++ b/cypress/platform/knsv2.html @@ -72,31 +72,26 @@ classDiagram Student "1" --o "1" IdCard : carries Student "1" --o "1" Bike : rides -
+mindmap - root - A - B - C - D - E - A2 - B2 - C2 - D2 - E2 - child1((Circle)) - grandchild 1 - grandchild 2 - child2(Round rectangle) - grandchild 3 - grandchild 4 - child3[Square] - grandchild 5 - ::icon(mdi mdi-fire) - gc6((grand
child 6)) - ::icon(mdi mdi-fire) - gc7((grand
grand
child 8)) + root((mindmap)) + Origins + Long history + ::icon(fa fa-book) + Popularisation + ::icon(fa fa-book) + British popular psychology author Tony Buzan + Research + ::icon(fa fa-book) + On effectivness
and features + On Automatic creation + Uses + Creative techniques + Strategic planning + Argument mapping + Tools + Pen and paper + Mermaidexample-diagram @@ -113,7 +108,7 @@ mindmap // console.error('Mermaid error: ', err); }; mermaid.initialize({ - theme: 'forest', + theme: 'base', startOnLoad: true, logLevel: 0, // basePath: './packages/', @@ -131,6 +126,10 @@ mindmap console.error('In parse error:'); console.error(err); }; + // mermaid.test1('first_slow', 1200).then((r) => console.info(r)); + // mermaid.test1('second_fast', 200).then((r) => console.info(r)); + // mermaid.test1('third_fast', 200).then((r) => console.info(r)); + // mermaid.test1('forth_slow', 1200).then((r) => console.info(r));