mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Compare commits
10 Commits
@mermaid-j
...
@mermaid-j
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1aa2870224 | ||
![]() |
8fbcbb6dc9 | ||
![]() |
3e545d7925 | ||
![]() |
75d2a259ed | ||
![]() |
746280b3e2 | ||
![]() |
fa4e30bb15 | ||
![]() |
950b107dd4 | ||
![]() |
35b84761a9 | ||
![]() |
0da2922ee7 | ||
![]() |
85eba01663 |
@@ -10,13 +10,16 @@ const buildType = (packageName: string) => {
|
||||
console.log(out.toString());
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
if (e.stdout.length > 0) {
|
||||
console.error(e.stdout.toString());
|
||||
}
|
||||
if (e.stderr.length > 0) {
|
||||
console.error(e.stderr.toString());
|
||||
}
|
||||
// Exit the build process if we are in CI
|
||||
if (process.env.CI) {
|
||||
throw new Error(`Failed to build types for ${packageName}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,5 +1,12 @@
|
||||
# mermaid
|
||||
|
||||
## 11.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0da2922`](https://github.com/mermaid-js/mermaid/commit/0da2922ee7f47959e324ec10d3d21ee70594f557)]:
|
||||
- @mermaid-js/parser@0.6.1
|
||||
|
||||
## 11.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid",
|
||||
"version": "11.8.0",
|
||||
"version": "11.8.1",
|
||||
"description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",
|
||||
"type": "module",
|
||||
"module": "./dist/mermaid.core.mjs",
|
||||
|
@@ -1,5 +1,11 @@
|
||||
# @mermaid-js/parser
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#6725](https://github.com/mermaid-js/mermaid/pull/6725) [`0da2922`](https://github.com/mermaid-js/mermaid/commit/0da2922ee7f47959e324ec10d3d21ee70594f557) Thanks [@shubham-mermaid](https://github.com/shubham-mermaid)! - chore: use Treemap instead of TreemapDoc in parser.
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mermaid-js/parser",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"description": "MermaidJS parser",
|
||||
"author": "Yokozuna59",
|
||||
"contributors": [
|
||||
|
@@ -8,7 +8,7 @@ export {
|
||||
Architecture,
|
||||
GitGraph,
|
||||
Radar,
|
||||
TreemapDoc,
|
||||
Treemap,
|
||||
Branch,
|
||||
Commit,
|
||||
Merge,
|
||||
@@ -20,7 +20,7 @@ export {
|
||||
isPieSection,
|
||||
isArchitecture,
|
||||
isGitGraph,
|
||||
isTreemapDoc,
|
||||
isTreemap,
|
||||
isBranch,
|
||||
isCommit,
|
||||
isMerge,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { ValidationAcceptor, ValidationChecks } from 'langium';
|
||||
import type { MermaidAstType, TreemapDoc } from '../generated/ast.js';
|
||||
import type { MermaidAstType, Treemap } from '../generated/ast.js';
|
||||
import type { TreemapServices } from './module.js';
|
||||
|
||||
/**
|
||||
@@ -9,10 +9,10 @@ export function registerValidationChecks(services: TreemapServices) {
|
||||
const validator = services.validation.TreemapValidator;
|
||||
const registry = services.validation.ValidationRegistry;
|
||||
if (registry) {
|
||||
// Use any to bypass type checking since we know TreemapDoc is part of the AST
|
||||
// Use any to bypass type checking since we know Treemap is part of the AST
|
||||
// but the type system is having trouble with it
|
||||
const checks: ValidationChecks<MermaidAstType> = {
|
||||
TreemapDoc: validator.checkSingleRoot.bind(validator),
|
||||
Treemap: validator.checkSingleRoot.bind(validator),
|
||||
// Remove unused validation for TreemapRow
|
||||
};
|
||||
registry.register(checks, validator);
|
||||
@@ -27,7 +27,7 @@ export class TreemapValidator {
|
||||
* Validates that a treemap has only one root node.
|
||||
* A root node is defined as a node that has no indentation.
|
||||
*/
|
||||
checkSingleRoot(doc: TreemapDoc, accept: ValidationAcceptor): void {
|
||||
checkSingleRoot(doc: Treemap, accept: ValidationAcceptor): void {
|
||||
let rootNodeIndentation;
|
||||
|
||||
for (const row of doc.TreemapRows) {
|
||||
|
@@ -34,14 +34,14 @@ interface ClassDefStatement {
|
||||
className: string
|
||||
styleText: string // Optional style text
|
||||
}
|
||||
interface TreemapDoc {
|
||||
interface Treemap {
|
||||
TreemapRows: TreemapRow[]
|
||||
title?: string
|
||||
accTitle?: string
|
||||
accDescr?: string
|
||||
}
|
||||
|
||||
entry TreemapDoc returns TreemapDoc:
|
||||
entry Treemap returns Treemap:
|
||||
TREEMAP_KEYWORD
|
||||
(
|
||||
TitleAndAccessibilities
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { expectNoErrorsOrAlternatives } from './test-util.js';
|
||||
import type { TreemapDoc, Section, Leaf, TreemapRow } from '../src/language/generated/ast.js';
|
||||
import type { Treemap, Section, Leaf, TreemapRow } from '../src/language/generated/ast.js';
|
||||
import type { LangiumParser } from 'langium';
|
||||
import { createTreemapServices } from '../src/language/treemap/module.js';
|
||||
|
||||
@@ -9,21 +9,21 @@ describe('Treemap Parser', () => {
|
||||
const parser: LangiumParser = services.parser.LangiumParser;
|
||||
|
||||
const parse = (input: string) => {
|
||||
return parser.parse<TreemapDoc>(input);
|
||||
return parser.parse<Treemap>(input);
|
||||
};
|
||||
|
||||
describe('Basic Parsing', () => {
|
||||
it('should parse empty treemap', () => {
|
||||
const result = parse('treemap');
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
expect(result.value.TreemapRows).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should parse a section node', () => {
|
||||
const result = parse('treemap\n"Root"');
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
expect(result.value.TreemapRows).toHaveLength(1);
|
||||
if (result.value.TreemapRows[0].item) {
|
||||
expect(result.value.TreemapRows[0].item.$type).toBe('Section');
|
||||
@@ -39,7 +39,7 @@ describe('Treemap Parser', () => {
|
||||
"Child2" : 200
|
||||
`);
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
expect(result.value.TreemapRows).toHaveLength(3);
|
||||
|
||||
if (result.value.TreemapRows[0].item) {
|
||||
@@ -95,7 +95,7 @@ describe('Treemap Parser', () => {
|
||||
|
||||
// We're only checking that the multiple root nodes parse successfully
|
||||
// The validation errors would be reported by the validator during validation
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
expect(result.value.TreemapRows).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
@@ -104,7 +104,7 @@ describe('Treemap Parser', () => {
|
||||
it('should parse a treemap with title', () => {
|
||||
const result = parse('treemap\ntitle My Treemap Diagram\n"Root"\n "Child": 100');
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
// We can't directly test the title property due to how Langium processes TitleAndAccessibilities
|
||||
// but we can verify the TreemapRows are parsed correctly
|
||||
expect(result.value.TreemapRows).toHaveLength(2);
|
||||
@@ -113,7 +113,7 @@ describe('Treemap Parser', () => {
|
||||
it('should parse a treemap with accTitle', () => {
|
||||
const result = parse('treemap\naccTitle: Accessible Title\n"Root"\n "Child": 100');
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
// We can't directly test the accTitle property due to how Langium processes TitleAndAccessibilities
|
||||
expect(result.value.TreemapRows).toHaveLength(2);
|
||||
});
|
||||
@@ -123,7 +123,7 @@ describe('Treemap Parser', () => {
|
||||
'treemap\naccDescr: This is an accessible description\n"Root"\n "Child": 100'
|
||||
);
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
// We can't directly test the accDescr property due to how Langium processes TitleAndAccessibilities
|
||||
expect(result.value.TreemapRows).toHaveLength(2);
|
||||
});
|
||||
@@ -136,7 +136,7 @@ accDescr: This is an accessible description
|
||||
"Root"
|
||||
"Child": 100`);
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
expect(result.value.$type).toBe('TreemapDoc');
|
||||
expect(result.value.$type).toBe('Treemap');
|
||||
// We can't directly test these properties due to how Langium processes TitleAndAccessibilities
|
||||
expect(result.value.TreemapRows).toHaveLength(2);
|
||||
});
|
||||
|
@@ -1,5 +1,12 @@
|
||||
# mermaid
|
||||
|
||||
## 11.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0da2922`](https://github.com/mermaid-js/mermaid/commit/0da2922ee7f47959e324ec10d3d21ee70594f557)]:
|
||||
- @mermaid-js/parser@0.6.1
|
||||
|
||||
## 11.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mermaid-js/tiny",
|
||||
"version": "11.8.0",
|
||||
"version": "11.8.1",
|
||||
"description": "Tiny version of mermaid",
|
||||
"type": "commonjs",
|
||||
"main": "./dist/mermaid.tiny.js",
|
||||
|
Reference in New Issue
Block a user