zombie-mermaid 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +7 -2
- package/dist/ascii.cjs +9 -9
- package/dist/ascii.cjs.map +1 -1
- package/dist/ascii.js +4069 -3969
- package/dist/ascii.js.map +1 -1
- package/dist/cli.js +7605 -7381
- package/dist/index.cjs +52 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7613 -7459
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +14142 -13717
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.js +14142 -13717
- package/dist/mcp.js.map +1 -1
- package/package.json +27 -5
- package/packages/ascii-renderer/LICENSE +22 -0
- package/{src/ascii → packages/ascii-renderer/src}/class-diagram.ts +277 -57
- package/{src/ascii → packages/ascii-renderer/src}/er-diagram.ts +2 -2
- package/packages/ascii-renderer/src/flowchart.ts +94 -0
- package/{src/ascii → packages/ascii-renderer/src}/grid.ts +23 -0
- package/{src/ascii → packages/ascii-renderer/src}/index.ts +13 -84
- package/{src/ascii → packages/ascii-renderer/src}/registry.ts +23 -12
- package/{src/ascii → packages/ascii-renderer/src}/sequence.ts +55 -8
- package/{src/ascii → packages/ascii-renderer/src}/xychart.ts +6 -3
- package/packages/core/LICENSE +22 -0
- package/packages/core/src/click-directive.ts +106 -0
- package/packages/core/src/color-utils.ts +205 -0
- package/packages/core/src/diagram-type.ts +35 -0
- package/packages/core/src/direction-override.ts +46 -0
- package/packages/core/src/direction.ts +56 -0
- package/packages/core/src/index.ts +34 -0
- package/packages/core/src/init-directive.ts +248 -0
- package/packages/core/src/multiline-utils.ts +275 -0
- package/packages/core/src/statements.ts +197 -0
- package/packages/core/src/style-directives.ts +214 -0
- package/packages/core/src/text-metrics.ts +498 -0
- package/packages/core/src/theme.ts +696 -0
- package/packages/core/src/types.ts +670 -0
- package/packages/mcp/LICENSE +22 -0
- package/{src/mcp → packages/mcp/src}/server.ts +34 -2
- package/{src/mcp → packages/mcp/src}/tools/check-sequence-activations.ts +8 -5
- package/packages/mcp/src/tools/fix-sequence-activations.ts +77 -0
- package/{src/mcp → packages/mcp/src}/tools/render-ascii.ts +2 -2
- package/{src/mcp → packages/mcp/src}/tools/render-svg.ts +1 -1
- package/packages/mermaid-parser/LICENSE +22 -0
- package/{src → packages/mermaid-parser/src}/class/parser.ts +86 -8
- package/{src → packages/mermaid-parser/src}/er/parser.ts +59 -26
- package/packages/mermaid-parser/src/index.ts +48 -0
- package/{src → packages/mermaid-parser/src}/sequence/activation-check.ts +4 -3
- package/packages/mermaid-parser/src/sequence/activation-fix.ts +112 -0
- package/{src → packages/mermaid-parser/src}/sequence/parser.ts +74 -16
- package/{src → packages/mermaid-parser/src}/xychart/parser.ts +84 -6
- package/packages/svg-renderer/LICENSE +22 -0
- package/{src → packages/svg-renderer/src}/class/layout.ts +8 -4
- package/{src → packages/svg-renderer/src}/class/renderer.ts +7 -6
- package/packages/svg-renderer/src/edge-curves.ts +204 -0
- package/packages/svg-renderer/src/elk-instance.ts +292 -0
- package/{src → packages/svg-renderer/src}/er/layout.ts +6 -4
- package/{src → packages/svg-renderer/src}/er/renderer.ts +4 -4
- package/packages/svg-renderer/src/index.ts +58 -0
- package/packages/svg-renderer/src/layout-engine/constants.ts +19 -0
- package/packages/svg-renderer/src/layout-engine/edge-bundling.ts +379 -0
- package/packages/svg-renderer/src/layout-engine/elk-adapter-utils.ts +81 -0
- package/packages/svg-renderer/src/layout-engine/elk-graph-builder.ts +240 -0
- package/packages/svg-renderer/src/layout-engine/from-elk.ts +685 -0
- package/packages/svg-renderer/src/layout-engine/layer-alignment.ts +174 -0
- package/packages/svg-renderer/src/layout-engine/to-elk.ts +695 -0
- package/packages/svg-renderer/src/layout-engine.ts +74 -0
- package/packages/svg-renderer/src/layout.ts +8 -0
- package/packages/svg-renderer/src/renderer.ts +1485 -0
- package/packages/svg-renderer/src/resolve-colors.ts +339 -0
- package/{src → packages/svg-renderer/src}/sequence/layout.ts +2 -6
- package/{src → packages/svg-renderer/src}/sequence/renderer.ts +4 -4
- package/packages/svg-renderer/src/shape-clipping.ts +197 -0
- package/packages/svg-renderer/src/styles.ts +118 -0
- package/{src → packages/svg-renderer/src}/xychart/layout.ts +2 -2
- package/{src → packages/svg-renderer/src}/xychart/renderer.ts +6 -6
- package/src/__tests__/ascii-ansi.test.ts +6 -2
- package/src/__tests__/ascii-canvas-write.test.ts +2 -2
- package/src/__tests__/ascii-charset-border-junctions.test.ts +1 -1
- package/src/__tests__/ascii-cjk-width.test.ts +1 -1
- package/src/__tests__/ascii-class-box-occupancy.test.ts +147 -45
- package/src/__tests__/ascii-class-column-width-488-489.test.ts +1 -1
- package/src/__tests__/ascii-class-cross-level-jog-corruption.test.ts +187 -0
- package/src/__tests__/ascii-class-detour-label-routing-487.test.ts +1 -1
- package/src/__tests__/ascii-class-diagram-compartments.test.ts +1 -1
- package/src/__tests__/ascii-class-label-box-collision.test.ts +1 -1
- package/src/__tests__/ascii-class-label-row-collision-531.test.ts +1 -1
- package/src/__tests__/ascii-class-label-territory-row-awareness.test.ts +1 -1
- package/src/__tests__/ascii-class-padding.test.ts +1 -1
- package/src/__tests__/ascii-class-reciprocal-relationships-448.test.ts +86 -1
- package/src/__tests__/ascii-combining-mark-width.test.ts +2 -2
- package/src/__tests__/ascii-coords-overlay.test.ts +2 -2
- package/src/__tests__/ascii-decision-lr-box-start.test.ts +2 -2
- package/src/__tests__/ascii-display-width-unit.test.ts +1 -1
- package/src/__tests__/ascii-draw-arrows-coverage.test.ts +1 -1
- package/src/__tests__/ascii-draw-arrows-single-point-path.test.ts +12 -5
- package/src/__tests__/ascii-draw-bundles.test.ts +5 -5
- package/src/__tests__/ascii-edge-bundling-rank-violation-454.test.ts +1 -1
- package/src/__tests__/ascii-edge-bundling-routing.test.ts +9 -5
- package/src/__tests__/ascii-edge-cross-style-overlap.test.ts +10 -6
- package/src/__tests__/ascii-edge-ending-glyphs.test.ts +1 -1
- package/src/__tests__/ascii-edge-label-diagonal-fallback-418.test.ts +2 -2
- package/src/__tests__/ascii-edge-routing-fixes.test.ts +1 -1
- package/src/__tests__/ascii-edge-routing-single-point-path.test.ts +8 -4
- package/src/__tests__/ascii-edge-styles.test.ts +1 -1
- package/src/__tests__/ascii-emoji-cluster-width.test.ts +2 -2
- package/src/__tests__/ascii-er-box-occupancy.test.ts +1 -1
- package/src/__tests__/ascii-er-cardinality.test.ts +1 -1
- package/src/__tests__/ascii-er-corner-glyphs.test.ts +1 -1
- package/src/__tests__/ascii-er-jog-stray-line.test.ts +1 -1
- package/src/__tests__/ascii-er-label-padding.test.ts +1 -1
- package/src/__tests__/ascii-er-padding.test.ts +1 -1
- package/src/__tests__/ascii-er-relationship-label-corruption-350.test.ts +1 -1
- package/src/__tests__/ascii-er-relationship-overwrite.test.ts +1 -1
- package/src/__tests__/ascii-er-stray-connectors.test.ts +7 -4
- package/src/__tests__/ascii-er-unrelated-stem-separation-411.test.ts +1 -1
- package/src/__tests__/ascii-er-vertical-one-marker.test.ts +1 -1
- package/src/__tests__/ascii-grid-deep-chain.test.ts +4 -4
- package/src/__tests__/ascii-hyperlinks.test.ts +9 -6
- package/src/__tests__/ascii-label-line-terminal-fallback.test.ts +8 -4
- package/src/__tests__/ascii-lane-search.test.ts +1 -1
- package/src/__tests__/ascii-multibox-cjk-width.test.ts +1 -1
- package/src/__tests__/ascii-multiline.test.ts +6 -3
- package/src/__tests__/ascii-nested-subgraph-sibling-order-444.test.ts +8 -5
- package/src/__tests__/ascii-package-boundary.test.ts +47 -37
- package/src/__tests__/ascii-padding-edge-cases.test.ts +1 -1
- package/src/__tests__/ascii-parallel-edges-329.test.ts +8 -5
- package/src/__tests__/ascii-pathfinder-route-edge.test.ts +14 -4
- package/src/__tests__/ascii-reverse-direction-edges-629.test.ts +9 -5
- package/src/__tests__/ascii-sequence-alt-else-label.test.ts +1 -1
- package/src/__tests__/ascii-sequence-block-wall-clearance.test.ts +1 -1
- package/src/__tests__/ascii-sequence-box-group.test.ts +1 -1
- package/src/__tests__/ascii-sequence-cjk-width.test.ts +1 -1
- package/src/__tests__/ascii-sequence-create-destroy.test.ts +1 -1
- package/src/__tests__/ascii-sequence-form-invariants.test.ts +48 -50
- package/src/__tests__/ascii-sequence-mermaid-parity.test.ts +1 -1
- package/src/__tests__/ascii-sequence-notes.test.ts +1 -1
- package/src/__tests__/ascii-sequence-padding.test.ts +1 -1
- package/src/__tests__/ascii-sequence-self-arrow.test.ts +1 -1
- package/src/__tests__/ascii-shape-diamond.test.ts +3 -3
- package/src/__tests__/ascii-shape-rectangle.test.ts +5 -5
- package/src/__tests__/ascii-shape-rounded.test.ts +3 -3
- package/src/__tests__/ascii-shapes-circle.test.ts +3 -3
- package/src/__tests__/ascii-shapes-hexagon.test.ts +3 -3
- package/src/__tests__/ascii-shapes-special.test.ts +10 -5
- package/src/__tests__/ascii-shapes-stadium.test.ts +3 -3
- package/src/__tests__/ascii-shapes-state.test.ts +15 -5
- package/src/__tests__/ascii-state-bidirectional-label-swap-530.test.ts +1 -1
- package/src/__tests__/ascii-subgraph-bbox.test.ts +8 -4
- package/src/__tests__/ascii-subgraph-direction-honored-445.test.ts +1 -1
- package/src/__tests__/ascii-subgraph-label-border-clip.test.ts +88 -25
- package/src/__tests__/ascii-subgraph-later-edgeless-301.test.ts +8 -4
- package/src/__tests__/ascii-subgraph-title-padding.test.ts +1 -1
- package/src/__tests__/ascii-territory-unit.test.ts +2 -2
- package/src/__tests__/ascii-validate.test.ts +1 -1
- package/src/__tests__/ascii.test.ts +5 -2
- package/src/__tests__/box-color.test.ts +1 -1
- package/src/__tests__/class-arrow-directions.test.ts +1 -1
- package/src/__tests__/class-click-interactions.test.ts +3 -6
- package/src/__tests__/class-integration.test.ts +1 -1
- package/src/__tests__/class-notes.test.ts +3 -3
- package/src/__tests__/class-parser-error-messages.test.ts +162 -0
- package/src/__tests__/class-parser.test.ts +6 -6
- package/src/__tests__/class-styling.test.ts +2 -2
- package/src/__tests__/cli-render.test.ts +16 -1
- package/src/__tests__/direction-override.test.ts +1 -1
- package/src/__tests__/draw-lines.test.ts +2 -2
- package/src/__tests__/edge-cell-styles.test.ts +5 -2
- package/src/__tests__/elk-layout-cache.test.ts +6 -4
- package/src/__tests__/er-click-unsupported.test.ts +5 -8
- package/src/__tests__/er-parser-error-messages.test.ts +82 -0
- package/src/__tests__/er-parser.test.ts +3 -6
- package/src/__tests__/expanded-shapes.test.ts +1 -1
- package/src/__tests__/grid-occupancy.test.ts +1 -1
- package/src/__tests__/mcp-check-sequence-activations-tool.test.ts +1 -1
- package/src/__tests__/mcp-fix-sequence-activations-tool.test.ts +134 -0
- package/src/__tests__/mcp-render-ascii-tool.test.ts +5 -4
- package/src/__tests__/mcp-render-svg-theme-guard.test.ts +3 -3
- package/src/__tests__/mcp-render-svg-tool.test.ts +1 -1
- package/src/__tests__/mcp-server.test.ts +30 -1
- package/src/__tests__/multiline-labels.test.ts +29 -18
- package/src/__tests__/parser.test.ts +117 -5
- package/src/__tests__/pathfinder.test.ts +11 -4
- package/src/__tests__/render-options-overrides.test.ts +28 -21
- package/src/__tests__/render-options-per-type.test.ts +13 -9
- package/src/__tests__/resolve-colors.test.ts +1 -1
- package/src/__tests__/self-loop-edges.test.ts +112 -0
- package/src/__tests__/sequence-activation-check.test.ts +7 -8
- package/src/__tests__/sequence-activation-fix.test.ts +91 -0
- package/src/__tests__/sequence-layout.test.ts +4 -7
- package/src/__tests__/sequence-parser-syntax-errors.test.ts +179 -0
- package/src/__tests__/sequence-parser.test.ts +3 -6
- package/src/__tests__/statements.test.ts +53 -35
- package/src/__tests__/testdata/ascii/subgraph_direction_override.txt +21 -21
- package/src/__tests__/theme-palette-contrast.test.ts +84 -0
- package/src/__tests__/workspace-package-boundaries.test.ts +199 -25
- package/src/__tests__/xychart-ascii.test.ts +1 -1
- package/src/__tests__/xychart-colors.test.ts +3 -2
- package/src/__tests__/xychart-layout.test.ts +1 -1
- package/src/__tests__/xychart-parser-errors.test.ts +95 -0
- package/src/browser.ts +8 -2
- package/src/cli/mcp.ts +1 -1
- package/src/cli/render.ts +59 -25
- package/src/cli/web.ts +1 -1
- package/src/diagram-registry.ts +190 -25
- package/src/index.ts +34 -131
- package/src/parser.ts +102 -40
- /package/{src/ascii → packages/ascii-renderer/src}/ansi.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/canvas.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/converter.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/coords.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/display-width.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/draw-arrows.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/draw-boxes.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/draw-bundles.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/draw-lines.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/draw-subgraphs.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/draw.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/edge-bundling.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/edge-cell-styles.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/edge-routing.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/grid-occupancy.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/hyperlinks.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/lane-search.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/multiline-utils.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/pathfinder.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/circle.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/corners.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/diamond.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/hexagon.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/index.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/rectangle.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/rounded.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/special.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/stadium.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/state.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/shapes/types.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/territory.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/types.ts +0 -0
- /package/{src/ascii → packages/ascii-renderer/src}/validate.ts +0 -0
- /package/{src/mcp → packages/mcp/src}/index.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/class/format.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/class/types.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/er/types.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/expanded-shapes.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/sequence/box-color.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/sequence/types.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/xychart/colors.ts +0 -0
- /package/{src → packages/mermaid-parser/src}/xychart/types.ts +0 -0
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import { describe, it, expect } from 'vitest'
|
|
29
|
-
import { renderMermaidASCII } from '
|
|
29
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
30
30
|
|
|
31
31
|
const MVC_SOURCE = `classDiagram
|
|
32
32
|
class Model {
|
|
@@ -82,3 +82,88 @@ describe('ASCII class diagram — reciprocal relationships (issue #448)', () =>
|
|
|
82
82
|
expect(ascii).toContain('uses')
|
|
83
83
|
})
|
|
84
84
|
})
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Regression test for issue #632 — a weekly form-judge audit comparing this
|
|
88
|
+
* repo's ASCII output against real mermaid.js SVG flagged the "Class:
|
|
89
|
+
* Relationship Labels" sample (samples-data.ts): `Teacher --> Course` and
|
|
90
|
+
* `Student --> Course` are two *distinct* pairs (not a reciprocal pair
|
|
91
|
+
* between the same two classes, which #448 above already covers) that both
|
|
92
|
+
* terminate at the same target, `Course`.
|
|
93
|
+
*
|
|
94
|
+
* Root cause: `pairGroups` (the #448 fix, keyed by the unordered
|
|
95
|
+
* `[from, to]` pair) only fans relationships between the exact same two
|
|
96
|
+
* classes — it never grouped these, so both anchored at Course's identical
|
|
97
|
+
* center column, collapsing their arrowheads onto the same cell. Since
|
|
98
|
+
* both relationships' single horizontal jog then also landed on the exact
|
|
99
|
+
* same row, the later-drawn label (in the separate label-drawing pass)
|
|
100
|
+
* blotted out most of the visible line, so `Student --> Course` looked
|
|
101
|
+
* like it terminated in blank space short of Course instead of reaching it.
|
|
102
|
+
*
|
|
103
|
+
* The fix (`relFromOffset`/`relToOffset` in `class-diagram.ts`) fans a
|
|
104
|
+
* relationship at whichever single end it shares with another
|
|
105
|
+
* relationship, even when the two relationships are between otherwise
|
|
106
|
+
* unrelated classes — scoped to a direct, adjacent-level convergence (see
|
|
107
|
+
* that code's comment for why a level-skipping relationship, which already
|
|
108
|
+
* needs the separate box-collision detour routing, is excluded).
|
|
109
|
+
*/
|
|
110
|
+
describe('ASCII class diagram — relationships converging on a shared target from different sources (issue #632)', () => {
|
|
111
|
+
const STUDENT_COURSE_SOURCE = `classDiagram
|
|
112
|
+
class Teacher {
|
|
113
|
+
+String name
|
|
114
|
+
}
|
|
115
|
+
class Student {
|
|
116
|
+
+String name
|
|
117
|
+
}
|
|
118
|
+
class Course {
|
|
119
|
+
+String title
|
|
120
|
+
}
|
|
121
|
+
Teacher --> Course : teaches
|
|
122
|
+
Student --> Course : enrolled in`
|
|
123
|
+
|
|
124
|
+
it('renders both relationship labels', () => {
|
|
125
|
+
const ascii = renderMermaidASCII(STUDENT_COURSE_SOURCE, {
|
|
126
|
+
colorMode: 'none',
|
|
127
|
+
})
|
|
128
|
+
expect(ascii).toContain('teaches')
|
|
129
|
+
expect(ascii).toContain('enrolled in')
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('draws two distinct arrowheads into Course instead of collapsing both onto one shared cell', () => {
|
|
133
|
+
const ascii = renderMermaidASCII(STUDENT_COURSE_SOURCE, {
|
|
134
|
+
colorMode: 'none',
|
|
135
|
+
})
|
|
136
|
+
// Before the fix, both relationships anchored at the exact same
|
|
137
|
+
// column, so only a single '▼' was ever drawn for both of them
|
|
138
|
+
// combined — the `Student --> Course` connector had no arrowhead of
|
|
139
|
+
// its own at all.
|
|
140
|
+
const arrowCount = (ascii.match(/▼/g) ?? []).length
|
|
141
|
+
expect(arrowCount).toBe(2)
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('gives the two relationships distinct target columns, both landing on Course', () => {
|
|
145
|
+
const ascii = renderMermaidASCII(STUDENT_COURSE_SOURCE, {
|
|
146
|
+
colorMode: 'none',
|
|
147
|
+
})
|
|
148
|
+
const lines = ascii.split('\n')
|
|
149
|
+
const arrowCols = lines.flatMap((line) =>
|
|
150
|
+
[...line].map((ch, i) => (ch === '▼' ? i : -1)).filter((i) => i >= 0),
|
|
151
|
+
)
|
|
152
|
+
expect(arrowCols).toHaveLength(2)
|
|
153
|
+
expect(arrowCols[0]).not.toBe(arrowCols[1])
|
|
154
|
+
|
|
155
|
+
// Course's box must actually span both arrow columns — otherwise
|
|
156
|
+
// they've merely moved apart without both still landing on the target.
|
|
157
|
+
const courseRow = lines.findIndex((line) => line.includes('Course'))
|
|
158
|
+
expect(courseRow).toBeGreaterThan(0)
|
|
159
|
+
const boxRow = lines[courseRow - 1]!
|
|
160
|
+
const boxLeft = boxRow.indexOf('┌')
|
|
161
|
+
const boxRight = boxRow.indexOf('┐')
|
|
162
|
+
expect(boxLeft).toBeGreaterThanOrEqual(0)
|
|
163
|
+
expect(boxRight).toBeGreaterThan(boxLeft)
|
|
164
|
+
for (const col of arrowCols) {
|
|
165
|
+
expect(col).toBeGreaterThanOrEqual(boxLeft)
|
|
166
|
+
expect(col).toBeLessThanOrEqual(boxRight)
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
})
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* against an authority separate from the implementation under test.
|
|
16
16
|
*/
|
|
17
17
|
import { describe, it, expect } from 'vitest'
|
|
18
|
-
import { renderMermaidASCII } from '
|
|
19
|
-
import { displayWidth } from '
|
|
18
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
19
|
+
import { displayWidth } from '../../packages/ascii-renderer/src/display-width.ts'
|
|
20
20
|
import {
|
|
21
21
|
terminalDisplayWidth,
|
|
22
22
|
assertUniformDisplayWidth,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { addCoordsOverlay } from '
|
|
3
|
-
import { renderMermaidASCII } from '
|
|
2
|
+
import { addCoordsOverlay } from '../../packages/ascii-renderer/src/coords.ts'
|
|
3
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
4
4
|
|
|
5
5
|
describe('addCoordsOverlay', () => {
|
|
6
6
|
it('prepends a two-row column ruler and a row-index gutter', () => {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* true`), since ASCII mode skips box-start connectors entirely.
|
|
14
14
|
*/
|
|
15
15
|
import { describe, it, expect } from 'vitest'
|
|
16
|
-
import { renderMermaidASCII } from '
|
|
17
|
-
import { findOrphanedJunctions } from '
|
|
16
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
17
|
+
import { findOrphanedJunctions } from '../../packages/ascii-renderer/src/validate.ts'
|
|
18
18
|
import { readdirSync, readFileSync } from 'node:fs'
|
|
19
19
|
import { join, dirname } from 'node:path'
|
|
20
20
|
import { fileURLToPath } from 'node:url'
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// ============================================================================
|
|
5
5
|
|
|
6
6
|
import { describe, it, expect } from 'vitest'
|
|
7
|
-
import { renderMermaidASCII } from '
|
|
7
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
8
8
|
|
|
9
9
|
describe('ASCII arrow drawing: no-arrow edges', () => {
|
|
10
10
|
it('renders a solid no-arrow edge without an arrowhead in unicode mode', () => {
|
|
@@ -16,11 +16,18 @@
|
|
|
16
16
|
* segment was drawn.
|
|
17
17
|
*/
|
|
18
18
|
import { describe, it, expect } from 'vitest'
|
|
19
|
-
import { drawArrow } from '
|
|
20
|
-
import { Down } from '
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
import { drawArrow } from '../../packages/ascii-renderer/src/draw-arrows.ts'
|
|
20
|
+
import { Down } from '../../packages/ascii-renderer/src/types.ts'
|
|
21
|
+
import {
|
|
22
|
+
mkCanvas,
|
|
23
|
+
mkRoleCanvas,
|
|
24
|
+
} from '../../packages/ascii-renderer/src/canvas.ts'
|
|
25
|
+
import type {
|
|
26
|
+
AsciiEdge,
|
|
27
|
+
AsciiGraph,
|
|
28
|
+
AsciiNode,
|
|
29
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
30
|
+
import { createGrid } from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
24
31
|
|
|
25
32
|
function makeNode(name: string, x: number, y: number): AsciiNode {
|
|
26
33
|
return {
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { describe, it, expect } from 'vitest'
|
|
18
18
|
import { parseMermaid } from '../parser.ts'
|
|
19
|
-
import { convertToAsciiGraph } from '
|
|
20
|
-
import { createMapping } from '
|
|
19
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
20
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
21
21
|
import type {
|
|
22
22
|
AsciiConfig,
|
|
23
23
|
AsciiGraph,
|
|
24
24
|
EdgeBundle,
|
|
25
25
|
GridCoord,
|
|
26
|
-
} from '
|
|
26
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
27
27
|
import {
|
|
28
28
|
drawBundledEdgeSegment,
|
|
29
29
|
drawBundleSharedPath,
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
drawBundledEdgeArrowhead,
|
|
33
33
|
drawBundledEdgeArrowheadStart,
|
|
34
34
|
drawJunctionCharacter,
|
|
35
|
-
} from '
|
|
36
|
-
import { renderMermaidASCII } from '
|
|
35
|
+
} from '../../packages/ascii-renderer/src/draw-bundles.ts'
|
|
36
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
37
37
|
|
|
38
38
|
function buildGraph(src: string, useAscii = false): AsciiGraph {
|
|
39
39
|
const config: AsciiConfig = {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { describe, it, expect } from 'vitest'
|
|
24
|
-
import { renderMermaidASCII } from '
|
|
24
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
25
25
|
|
|
26
26
|
describe('ASCII edge bundling — refuses to bundle a rank-violating edge (issue #454)', () => {
|
|
27
27
|
it('gives a fan-in edge its own arrowhead when its source shares a rank with the target', () => {
|
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { describe, it, expect } from 'vitest'
|
|
18
18
|
import { parseMermaid } from '../parser.ts'
|
|
19
|
-
import { convertToAsciiGraph } from '
|
|
20
|
-
import { createMapping } from '
|
|
19
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
20
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
21
21
|
import {
|
|
22
22
|
calculateJunctionPoint,
|
|
23
23
|
routeBundledEdges,
|
|
24
|
-
} from '
|
|
25
|
-
import { Middle } from '
|
|
26
|
-
import type {
|
|
24
|
+
} from '../../packages/ascii-renderer/src/edge-bundling.ts'
|
|
25
|
+
import { Middle } from '../../packages/ascii-renderer/src/types.ts'
|
|
26
|
+
import type {
|
|
27
|
+
AsciiConfig,
|
|
28
|
+
AsciiGraph,
|
|
29
|
+
EdgeBundle,
|
|
30
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
27
31
|
|
|
28
32
|
function buildGraph(src: string, graphDirection: 'TD' | 'LR'): AsciiGraph {
|
|
29
33
|
const config: AsciiConfig = {
|
|
@@ -18,22 +18,26 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { describe, it, expect } from 'vitest'
|
|
20
20
|
import { parseMermaid } from '../parser.ts'
|
|
21
|
-
import { convertToAsciiGraph } from '
|
|
22
|
-
import { createMapping } from '
|
|
21
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
22
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
23
23
|
import {
|
|
24
24
|
isOccupied,
|
|
25
25
|
pathCells,
|
|
26
26
|
createGrid,
|
|
27
27
|
cloneGrid,
|
|
28
28
|
placeBlock,
|
|
29
|
-
} from '
|
|
29
|
+
} from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
30
30
|
import {
|
|
31
31
|
createEdgeCellStyles,
|
|
32
32
|
findStyleConflict,
|
|
33
33
|
claimPathCells,
|
|
34
|
-
} from '
|
|
35
|
-
import { renderMermaidASCII } from '
|
|
36
|
-
import type {
|
|
34
|
+
} from '../../packages/ascii-renderer/src/edge-cell-styles.ts'
|
|
35
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
36
|
+
import type {
|
|
37
|
+
AsciiConfig,
|
|
38
|
+
AsciiEdge,
|
|
39
|
+
AsciiGraph,
|
|
40
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
37
41
|
|
|
38
42
|
const RETRY_LOOP_SOURCE = `graph TD
|
|
39
43
|
A[Push Code] --> B{Tests Pass?}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// ============================================================================
|
|
11
11
|
|
|
12
12
|
import { describe, it, expect } from 'vitest'
|
|
13
|
-
import { renderMermaidASCII } from '
|
|
13
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
14
14
|
|
|
15
15
|
describe('ASCII flowchart edges: --o circle-end / --x cross-end glyphs', () => {
|
|
16
16
|
it('draws a circle glyph for --o in unicode mode', () => {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* column (`┆thick`) instead of sitting on its own `┃` line.
|
|
9
9
|
*/
|
|
10
10
|
import { describe, it, expect } from 'vitest'
|
|
11
|
-
import { renderMermaidASCII } from '
|
|
12
|
-
import { expandDiagonalSegments } from '
|
|
11
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
12
|
+
import { expandDiagonalSegments } from '../../packages/ascii-renderer/src/edge-routing.ts'
|
|
13
13
|
|
|
14
14
|
const ALL_EDGE_STYLES = `graph TD
|
|
15
15
|
A[Source] -->|solid| B[Target 1]
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* drift. Repro diagrams are taken directly from the issue.
|
|
6
6
|
*/
|
|
7
7
|
import { describe, it, expect } from 'vitest'
|
|
8
|
-
import { renderMermaidASCII } from '
|
|
8
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
9
9
|
|
|
10
10
|
describe('issue #64: edge-routing crashes and layout bugs', () => {
|
|
11
11
|
describe('bug 1: dense fan-in pathfinding blowup', () => {
|
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
* zero-length line at that single point instead of indexing past the end.
|
|
16
16
|
*/
|
|
17
17
|
import { describe, it, expect } from 'vitest'
|
|
18
|
-
import { determineLabelLine } from '
|
|
19
|
-
import { Down } from '
|
|
20
|
-
import type {
|
|
21
|
-
|
|
18
|
+
import { determineLabelLine } from '../../packages/ascii-renderer/src/edge-routing.ts'
|
|
19
|
+
import { Down } from '../../packages/ascii-renderer/src/types.ts'
|
|
20
|
+
import type {
|
|
21
|
+
AsciiEdge,
|
|
22
|
+
AsciiGraph,
|
|
23
|
+
AsciiNode,
|
|
24
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
25
|
+
import { createGrid } from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
22
26
|
|
|
23
27
|
function makeNode(name: string, x: number, y: number): AsciiNode {
|
|
24
28
|
return {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect } from 'vitest'
|
|
6
|
-
import { renderMermaidASCII } from '
|
|
6
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
7
7
|
|
|
8
8
|
describe('ASCII edge styles', () => {
|
|
9
9
|
describe('solid edges (default)', () => {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* against an authority separate from the implementation under test.
|
|
22
22
|
*/
|
|
23
23
|
import { describe, it, expect } from 'vitest'
|
|
24
|
-
import { renderMermaidASCII } from '
|
|
25
|
-
import { displayWidth } from '
|
|
24
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
25
|
+
import { displayWidth } from '../../packages/ascii-renderer/src/display-width.ts'
|
|
26
26
|
import {
|
|
27
27
|
terminalDisplayWidth,
|
|
28
28
|
assertUniformDisplayWidth,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// ============================================================================
|
|
15
15
|
|
|
16
16
|
import { describe, it, expect } from 'vitest'
|
|
17
|
-
import { renderMermaidASCII } from '
|
|
17
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
18
18
|
import {
|
|
19
19
|
findBoxRect,
|
|
20
20
|
findTextRect,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect } from 'vitest'
|
|
6
|
-
import { renderMermaidASCII } from '
|
|
6
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
7
7
|
|
|
8
8
|
describe('ASCII ER crow-foot cardinality markers', () => {
|
|
9
9
|
it('mirrors the zero-one marker orientation on the left side (regression)', () => {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// ============================================================================
|
|
29
29
|
|
|
30
30
|
import { describe, it, expect } from 'vitest'
|
|
31
|
-
import { renderMermaidASCII } from '
|
|
31
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
32
32
|
|
|
33
33
|
describe('ASCII ER relationship routing draws a corner glyph at each turn (issue #414)', () => {
|
|
34
34
|
it('draws corner glyphs at a same-row detour around an obstructing entity', () => {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// ============================================================================
|
|
27
27
|
|
|
28
28
|
import { describe, it, expect } from 'vitest'
|
|
29
|
-
import { renderMermaidASCII } from '
|
|
29
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* True when some row's only non-whitespace content is a doubled line/dash
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// ============================================================================
|
|
11
11
|
|
|
12
12
|
import { describe, it, expect } from 'vitest'
|
|
13
|
-
import { renderMermaidASCII } from '
|
|
13
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
14
14
|
|
|
15
15
|
const REPRO = `erDiagram
|
|
16
16
|
CUSTOMER ||--o{ ORDER : places
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// ============================================================================
|
|
12
12
|
|
|
13
13
|
import { describe, it, expect } from 'vitest'
|
|
14
|
-
import { renderMermaidASCII } from '
|
|
14
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
15
15
|
|
|
16
16
|
// A single relationship with a short label — exercises the horizontal gap
|
|
17
17
|
// between entities without the label itself becoming the binding constraint
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
// ============================================================================
|
|
25
25
|
|
|
26
26
|
import { describe, it, expect } from 'vitest'
|
|
27
|
-
import { renderMermaidASCII } from '
|
|
27
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
28
28
|
|
|
29
29
|
/** Assert every one of `needles` appears verbatim, exactly once, in `text`. */
|
|
30
30
|
function expectAllPresentOnce(text: string, needles: string[]): void {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// ============================================================================
|
|
22
22
|
|
|
23
23
|
import { describe, it, expect } from 'vitest'
|
|
24
|
-
import { renderMermaidASCII } from '
|
|
24
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
25
25
|
|
|
26
26
|
describe('ASCII ER relationship draws do not overwrite existing text (issue #392)', () => {
|
|
27
27
|
it('does not let a later vertical relationship line cut through an earlier label', () => {
|
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
// ============================================================================
|
|
8
8
|
|
|
9
9
|
import { describe, it, expect } from 'vitest'
|
|
10
|
-
import { renderMermaidASCII } from '
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
11
|
+
import {
|
|
12
|
+
chooseFreeRow,
|
|
13
|
+
isRowFree,
|
|
14
|
+
} from '../../packages/ascii-renderer/src/er-diagram.ts'
|
|
15
|
+
import { mkCanvas, write } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
16
|
+
import type { Canvas } from '../../packages/ascii-renderer/src/types.ts'
|
|
14
17
|
|
|
15
18
|
/** Mark every cell in row `y` across [xStart, xEnd] as occupied. */
|
|
16
19
|
function occupyRow(canvas: Canvas, y: number, xStart: number, xEnd: number) {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// ============================================================================
|
|
13
13
|
|
|
14
14
|
import { describe, it, expect } from 'vitest'
|
|
15
|
-
import { renderMermaidASCII } from '
|
|
15
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
16
16
|
|
|
17
17
|
describe('ASCII ER — unrelated relationship stems stay visually separated (issue #411)', () => {
|
|
18
18
|
it('keeps CUSTOMER→ADDRESS and PRODUCT→LINE_ITEM stems at least one column apart', () => {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// ============================================================================
|
|
29
29
|
|
|
30
30
|
import { describe, it, expect } from 'vitest'
|
|
31
|
-
import { renderMermaidASCII } from '
|
|
31
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
32
32
|
|
|
33
33
|
describe('ASCII ER vertical "one" cardinality marker (invisible-marker fix)', () => {
|
|
34
34
|
it('renders a distinct tick for the upper entity\'s "one" marker, not the invisible line glyph', () => {
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { describe, it, expect } from 'vitest'
|
|
13
13
|
import { parseMermaid } from '../parser.ts'
|
|
14
|
-
import { convertToAsciiGraph } from '
|
|
15
|
-
import { createMapping } from '
|
|
16
|
-
import { renderMermaidASCII } from '
|
|
17
|
-
import type { AsciiConfig } from '
|
|
14
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
15
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
16
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
17
|
+
import type { AsciiConfig } from '../../packages/ascii-renderer/src/types.ts'
|
|
18
18
|
|
|
19
19
|
function longChainSource(depth: number): string {
|
|
20
20
|
const lines = ['flowchart TD']
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* can import samples-data.ts without tripping tsconfig's rootDir).
|
|
11
11
|
*/
|
|
12
12
|
import { describe, it, expect } from 'vitest'
|
|
13
|
-
import { renderMermaidASCII } from '
|
|
13
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
14
14
|
import {
|
|
15
15
|
OSC8_CLOSE,
|
|
16
16
|
OSC8_SEQUENCE,
|
|
@@ -20,13 +20,16 @@ import {
|
|
|
20
20
|
LinkRunTracker,
|
|
21
21
|
markBoxLabelLinks,
|
|
22
22
|
mkLinkCanvas,
|
|
23
|
-
} from '
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
} from '../../packages/ascii-renderer/src/hyperlinks.ts'
|
|
24
|
+
import {
|
|
25
|
+
colorizeLine,
|
|
26
|
+
DEFAULT_ASCII_THEME,
|
|
27
|
+
} from '../../packages/ascii-renderer/src/ansi.ts'
|
|
28
|
+
import { mkCanvas, write } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
29
|
+
import { addCoordsOverlay } from '../../packages/ascii-renderer/src/coords.ts'
|
|
27
30
|
import { runRender } from '../cli/render.ts'
|
|
28
31
|
import { createMockStdout, renderArgs } from './cli-test-helpers.ts'
|
|
29
|
-
import type { CharRole } from '
|
|
32
|
+
import type { CharRole } from '../../packages/ascii-renderer/src/types.ts'
|
|
30
33
|
|
|
31
34
|
const OSC8_PREFIX = '\x1b]8;;'
|
|
32
35
|
|
|
@@ -36,10 +36,14 @@
|
|
|
36
36
|
* some real diagram happens to hit this deep a fallback tier.
|
|
37
37
|
*/
|
|
38
38
|
import { describe, it, expect } from 'vitest'
|
|
39
|
-
import { determineLabelLine } from '
|
|
40
|
-
import { Down, gridKey } from '
|
|
41
|
-
import type {
|
|
42
|
-
|
|
39
|
+
import { determineLabelLine } from '../../packages/ascii-renderer/src/edge-routing.ts'
|
|
40
|
+
import { Down, gridKey } from '../../packages/ascii-renderer/src/types.ts'
|
|
41
|
+
import type {
|
|
42
|
+
AsciiEdge,
|
|
43
|
+
AsciiGraph,
|
|
44
|
+
AsciiNode,
|
|
45
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
46
|
+
import { createGrid } from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
43
47
|
|
|
44
48
|
function makeNode(name: string, x: number, y: number): AsciiNode {
|
|
45
49
|
return {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// originals are kept here as reference implementations and the shared
|
|
15
15
|
// function is required to agree with them on every generated input.
|
|
16
16
|
import { describe, it, expect } from 'vitest'
|
|
17
|
-
import { findFreeLane } from '
|
|
17
|
+
import { findFreeLane } from '../../packages/ascii-renderer/src/lane-search.ts'
|
|
18
18
|
|
|
19
19
|
describe('findFreeLane', () => {
|
|
20
20
|
it('returns the preferred lane when it is free', () => {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* — see the shared helper.
|
|
20
20
|
*/
|
|
21
21
|
import { describe, it, expect } from 'vitest'
|
|
22
|
-
import { renderMermaidASCII } from '
|
|
22
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
23
23
|
import {
|
|
24
24
|
terminalDisplayWidth,
|
|
25
25
|
assertUniformDisplayWidth,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { renderMermaidASCII } from '
|
|
3
|
-
import {
|
|
2
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
3
|
+
import {
|
|
4
|
+
mkCanvas,
|
|
5
|
+
canvasToString,
|
|
6
|
+
} from '../../packages/ascii-renderer/src/canvas.ts'
|
|
4
7
|
import {
|
|
5
8
|
drawMultilineTextCentered,
|
|
6
9
|
drawMultilineTextLeft,
|
|
7
|
-
} from '
|
|
10
|
+
} from '../../packages/ascii-renderer/src/multiline-utils.ts'
|
|
8
11
|
|
|
9
12
|
describe('ASCII multi-line labels', () => {
|
|
10
13
|
describe('flowchart nodes', () => {
|
|
@@ -35,11 +35,14 @@
|
|
|
35
35
|
*/
|
|
36
36
|
import { describe, it, expect } from 'vitest'
|
|
37
37
|
import { parseMermaid } from '../parser.ts'
|
|
38
|
-
import { convertToAsciiGraph } from '
|
|
39
|
-
import { createMapping } from '
|
|
40
|
-
import { renderMermaidASCII } from '
|
|
41
|
-
import type {
|
|
42
|
-
|
|
38
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
39
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
40
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
41
|
+
import type {
|
|
42
|
+
AsciiConfig,
|
|
43
|
+
AsciiGraph,
|
|
44
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
45
|
+
import { requireGridCoord } from '../../packages/ascii-renderer/src/types.ts'
|
|
43
46
|
|
|
44
47
|
function layoutFlowchart(source: string): AsciiGraph {
|
|
45
48
|
const parsed = parseMermaid(source)
|