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
|
@@ -27,7 +27,12 @@ import { existsSync, readFileSync } from 'node:fs'
|
|
|
27
27
|
import { dirname, relative, resolve } from 'node:path'
|
|
28
28
|
|
|
29
29
|
const REPO_ROOT = resolve(import.meta.dirname, '../..')
|
|
30
|
-
|
|
30
|
+
// `src/ascii/**` moved to `packages/ascii-renderer/src/**` under #767 (the
|
|
31
|
+
// actual extraction #623 was closed without performing — see #767). The
|
|
32
|
+
// entry's own location changed; the allowed-outside-package module list
|
|
33
|
+
// below did not, since #767 was a pure move with no import-graph change
|
|
34
|
+
// beyond adjusting relative-path depth.
|
|
35
|
+
const ASCII_ENTRY = resolve(REPO_ROOT, 'packages/ascii-renderer/src/index.ts')
|
|
31
36
|
|
|
32
37
|
/**
|
|
33
38
|
* Any static `import`/`export ... from '<specifier>'`, capturing whether it
|
|
@@ -173,30 +178,35 @@ const ALLOWED_OUTSIDE_ASCII = {
|
|
|
173
178
|
// around the package boundary still fails loudly against an explicit
|
|
174
179
|
// list instead of silently passing.
|
|
175
180
|
core: [],
|
|
176
|
-
// -> `mermaid-parser` (#624).
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
// `
|
|
180
|
-
//
|
|
181
|
-
parser
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
],
|
|
181
|
+
// -> `mermaid-parser` (#624). #624 landed and moved
|
|
182
|
+
// `class/format.ts`/`parser.ts`, `er/parser.ts`, `sequence/box-color.ts`/
|
|
183
|
+
// `parser.ts`/`activation-check.ts`, and `xychart/colors.ts`/`parser.ts`
|
|
184
|
+
// into `packages/mermaid-parser/` — per-file, not per-half-pair, since the
|
|
185
|
+
// doc's finding 1 only describes each per-type directory as a
|
|
186
|
+
// `parser.ts`+`types.ts` half vs. a `layout.ts`+`renderer.ts` half, and
|
|
187
|
+
// `class/format.ts`, `xychart/colors.ts`, `sequence/box-color.ts` fit
|
|
188
|
+
// neither. The ASCII entry now reaches all of them through the bare
|
|
189
|
+
// `@zombie-mermaid/mermaid-parser` specifier — invisible to this walker,
|
|
190
|
+
// same as the `core` bucket above. `src/parser.ts` (the flowchart/state
|
|
191
|
+
// parser) is NOT part of #624's scope — findings 1-2 are about
|
|
192
|
+
// `class`/`er`/`sequence`/`xychart` only, which already have no shared
|
|
193
|
+
// generic model the way flowcharts do — so it's the one entry still
|
|
194
|
+
// reached by relative import.
|
|
195
|
+
parser: ['src/parser.ts'],
|
|
191
196
|
// The scoping doc's recommendation 5 originally put all three on its
|
|
192
197
|
// `svg-renderer`-only list. #625's addendum found `init-directive.ts` and
|
|
193
198
|
// `style-directives.ts` actually belong to `core` (both moved to
|
|
194
199
|
// `packages/core/` and are now reached the same way as the `core` bucket
|
|
195
200
|
// above — via the bare specifier, invisible here). `expanded-shapes.ts`
|
|
196
|
-
//
|
|
197
|
-
// (`mermaid-parser`)
|
|
198
|
-
//
|
|
199
|
-
|
|
201
|
+
// belonged to neither `core` nor `svg-renderer` and was still awaiting
|
|
202
|
+
// #624 (`mermaid-parser`) — #768 moved it into
|
|
203
|
+
// `packages/mermaid-parser/src/`, so the ASCII entry now reaches it
|
|
204
|
+
// through the bare `@zombie-mermaid/mermaid-parser` specifier too,
|
|
205
|
+
// invisible to this walker. Kept as an empty bucket, not deleted, for the
|
|
206
|
+
// same reason the `core` bucket above is: a future regression that
|
|
207
|
+
// reintroduces a *relative* reach-around across the package boundary
|
|
208
|
+
// should still fail loudly against an explicit list.
|
|
209
|
+
misclassifiedAsSvgOnly: [],
|
|
200
210
|
} as const
|
|
201
211
|
|
|
202
212
|
const ALLOWED = [
|
|
@@ -210,28 +220,28 @@ const ALLOWED = [
|
|
|
210
220
|
* from the bundle, so they cost `dist/ascii.js` nothing, but a real
|
|
211
221
|
* `ascii-renderer` package still has to resolve them at build time.
|
|
212
222
|
*
|
|
213
|
-
*
|
|
214
|
-
* (
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
223
|
+
* Used to list the four per-type `types.ts` halves
|
|
224
|
+
* (`class`/`er`/`sequence`/`xychart`) while they still lived under
|
|
225
|
+
* `src/<type>/` and were reached by a relative `import type`. #624 moved
|
|
226
|
+
* them into `packages/mermaid-parser/src/<type>/types.ts`, so the ASCII
|
|
227
|
+
* entry now reaches them through the bare `@zombie-mermaid/mermaid-parser`
|
|
228
|
+
* specifier — invisible to this relative-only walker, same as `src/types.ts`
|
|
229
|
+
* (`core`) and `src/elk-instance.ts` (`svg-renderer`) before them under
|
|
230
|
+
* #625. Kept as an empty list, not deleted, for the same reason the `core`
|
|
231
|
+
* bucket above is kept empty: a future regression that reintroduces a
|
|
232
|
+
* *relative* `import type` reach-around across the package boundary should
|
|
233
|
+
* still fail loudly against an explicit list.
|
|
221
234
|
*/
|
|
222
|
-
const TYPE_ONLY_REACH = [
|
|
223
|
-
'src/class/types.ts',
|
|
224
|
-
'src/er/types.ts',
|
|
225
|
-
'src/sequence/types.ts',
|
|
226
|
-
'src/xychart/types.ts',
|
|
227
|
-
]
|
|
235
|
+
const TYPE_ONLY_REACH: string[] = []
|
|
228
236
|
|
|
229
237
|
const graph = moduleGraphOf(ASCII_ENTRY)
|
|
230
238
|
const outside = (files: Set<string>): string[] =>
|
|
231
|
-
[...files]
|
|
239
|
+
[...files]
|
|
240
|
+
.filter((file) => !file.startsWith('packages/ascii-renderer/src/'))
|
|
241
|
+
.sort()
|
|
232
242
|
|
|
233
|
-
describe('ascii-renderer package boundary (#623)', () => {
|
|
234
|
-
it('reaches nothing outside
|
|
243
|
+
describe('ascii-renderer package boundary (#623, moved under #767)', () => {
|
|
244
|
+
it('reaches nothing outside packages/ascii-renderer/src/ beyond the core + parser modules', () => {
|
|
235
245
|
expect(outside(graph.runtime)).toEqual(ALLOWED)
|
|
236
246
|
})
|
|
237
247
|
|
|
@@ -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 padding edge cases (issue #343 follow-up)', () => {
|
|
27
27
|
it('a negative boxBorderPadding does not produce a negative-width class box', () => {
|
|
@@ -37,16 +37,19 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import { describe, it, expect } from 'vitest'
|
|
39
39
|
import { parseMermaid } from '../parser.ts'
|
|
40
|
-
import { convertToAsciiGraph } from '
|
|
41
|
-
import { createMapping } from '
|
|
42
|
-
import { renderMermaidASCII } from '
|
|
43
|
-
import {
|
|
40
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
41
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
42
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
43
|
+
import {
|
|
44
|
+
pathCells,
|
|
45
|
+
isOccupied,
|
|
46
|
+
} from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
44
47
|
import type {
|
|
45
48
|
AsciiConfig,
|
|
46
49
|
AsciiEdge,
|
|
47
50
|
AsciiGraph,
|
|
48
51
|
AsciiNode,
|
|
49
|
-
} from '
|
|
52
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
50
53
|
|
|
51
54
|
function buildGraph(source: string, graphDirection: 'LR' | 'TD'): AsciiGraph {
|
|
52
55
|
const parsed = parseMermaid(source)
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
* true departure direction (see edge-bundling.ts's routeBundledEdges).
|
|
15
15
|
*/
|
|
16
16
|
import { describe, it, expect } from 'vitest'
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
routeEdge,
|
|
19
|
+
createPathBudget,
|
|
20
|
+
} from '../../packages/ascii-renderer/src/pathfinder.ts'
|
|
18
21
|
import {
|
|
19
22
|
Up,
|
|
20
23
|
Down,
|
|
@@ -23,9 +26,16 @@ import {
|
|
|
23
26
|
Middle,
|
|
24
27
|
UpperRight,
|
|
25
28
|
requireCardinalDirection,
|
|
26
|
-
} from '
|
|
27
|
-
import type {
|
|
28
|
-
|
|
29
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
30
|
+
import type {
|
|
31
|
+
AsciiGraph,
|
|
32
|
+
PathBudget,
|
|
33
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
34
|
+
import {
|
|
35
|
+
createGrid,
|
|
36
|
+
placeBlock,
|
|
37
|
+
type Grid,
|
|
38
|
+
} from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
29
39
|
|
|
30
40
|
function makeGraph(grid: Grid, pathBudget: PathBudget | undefined): AsciiGraph {
|
|
31
41
|
return {
|
|
@@ -28,11 +28,15 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { describe, it, expect } from 'vitest'
|
|
30
30
|
import { parseMermaid } from '../parser.ts'
|
|
31
|
-
import { convertToAsciiGraph } from '
|
|
32
|
-
import { createMapping } from '
|
|
33
|
-
import { renderMermaidASCII } from '
|
|
34
|
-
import { pathCells } from '
|
|
35
|
-
import type {
|
|
31
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
32
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
33
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
34
|
+
import { pathCells } from '../../packages/ascii-renderer/src/grid-occupancy.ts'
|
|
35
|
+
import type {
|
|
36
|
+
AsciiConfig,
|
|
37
|
+
AsciiEdge,
|
|
38
|
+
AsciiGraph,
|
|
39
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
36
40
|
|
|
37
41
|
const RIGHT_ARROW = '►'
|
|
38
42
|
const LEFT_ARROW = '◄'
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// ============================================================================
|
|
18
18
|
|
|
19
19
|
import { describe, it, expect } from 'vitest'
|
|
20
|
-
import { renderMermaidASCII } from '
|
|
20
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
21
21
|
|
|
22
22
|
describe('ASCII sequence diagrams – alt/else block labels (issue #352)', () => {
|
|
23
23
|
it('does not truncate a long alt/else label mid-word (exact issue repro)', () => {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
// ============================================================================
|
|
32
32
|
|
|
33
33
|
import { describe, it, expect } from 'vitest'
|
|
34
|
-
import { renderMermaidASCII } from '
|
|
34
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
35
35
|
|
|
36
36
|
/** Column indices (0-based) of every lifeline, read off the actor header's
|
|
37
37
|
* bottom border row (the one carrying `┬` junctions). */
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// ============================================================================
|
|
9
9
|
|
|
10
10
|
import { describe, it, expect } from 'vitest'
|
|
11
|
-
import { renderMermaidASCII } from '
|
|
11
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
12
12
|
|
|
13
13
|
describe('ASCII sequence diagrams – box...end', () => {
|
|
14
14
|
const source = `sequenceDiagram
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* the odd one out.
|
|
35
35
|
*/
|
|
36
36
|
import { describe, it, expect } from 'vitest'
|
|
37
|
-
import { renderMermaidASCII } from '
|
|
37
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
38
38
|
import { terminalDisplayWidth } from './helpers/terminal-display-width.ts'
|
|
39
39
|
|
|
40
40
|
const ARROWHEAD_GLYPHS = ['▶', '◀', '◁', '▷']
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// ============================================================================
|
|
9
9
|
|
|
10
10
|
import { describe, it, expect } from 'vitest'
|
|
11
|
-
import { renderMermaidASCII } from '
|
|
11
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
12
12
|
|
|
13
13
|
const source = `sequenceDiagram
|
|
14
14
|
A->>B: one
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
// ============================================================================
|
|
21
21
|
|
|
22
22
|
import { describe, it, expect } from 'vitest'
|
|
23
|
-
import { renderMermaidASCII } from '
|
|
23
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
24
24
|
import { findBoxRect, findTextRect } from './helpers/ascii-form.ts'
|
|
25
25
|
|
|
26
26
|
const LONG_LABEL = 'a rather long condition label that used to get clipped'
|
|
@@ -216,71 +216,69 @@ function lifelineColumn(ascii: string, actorName: string): number {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
describe('ASCII sequence — notes do not collide with an unrelated lifeline', () => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
219
|
+
// Fixed by issue #953 case A: `sequence.ts`'s note-x calculation
|
|
220
|
+
// (`nx = llX[aIdx] - nWidth - 1`) used to clamp straight to
|
|
221
|
+
// `Math.max(0, nx)`, so a note wider than the leftmost actor's (small)
|
|
222
|
+
// left margin clamped to column 0 and swallowed its own actor's lifeline
|
|
223
|
+
// column instead of sitting entirely to its left. The fix reserves room
|
|
224
|
+
// in the leftmost lifeline's own initial position (`llX[0]`) for its
|
|
225
|
+
// widest `left` note up front, so `nx` never needs clamping in the first
|
|
226
|
+
// place. Per this file's header convention, a case confirmed fixed is
|
|
227
|
+
// promoted from `it.fails` to a plain `it()` regression lock.
|
|
228
|
+
it("note left of the leftmost actor does not overlap that actor's own lifeline", () => {
|
|
229
|
+
const src = `sequenceDiagram
|
|
228
230
|
participant A as Alice
|
|
229
231
|
participant B as Bob
|
|
230
232
|
Note left of A: ${LONG_LABEL}
|
|
231
233
|
A->>B: hi`
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
)
|
|
234
|
+
const ascii = renderMermaidASCII(src, { useAscii: true })
|
|
235
|
+
// findBoxRect, not findTextRect — the note's own border/padding must
|
|
236
|
+
// also stay clear of the lifeline, not just its bare text span.
|
|
237
|
+
const noteRect = findBoxRect(ascii, LONG_LABEL)
|
|
238
|
+
const aliceCol = lifelineColumn(ascii, 'Alice')
|
|
239
|
+
expect(aliceCol < noteRect.x0 || aliceCol > noteRect.x1).toBe(true)
|
|
240
|
+
})
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
242
|
+
// Fixed by issue #953 case B: same clamp as above, but the victim is a
|
|
243
|
+
// *different* actor's lifeline — the exact shape visible in
|
|
244
|
+
// samples-data.ts's "Sequence: Notes (Right/Left/Over)" sample ("Alice
|
|
245
|
+
// prepares" reaching into Bob's lifeline). The fix reserves a
|
|
246
|
+
// note-width-aware gap between adjacent lifelines (see `leftNoteWidth`/
|
|
247
|
+
// `rightNoteWidth` in sequence.ts), so a `left` note's own gap is sized to
|
|
248
|
+
// fit it before `nx` is ever computed.
|
|
249
|
+
it("note left of a non-leftmost actor does not overlap the left-neighbor's lifeline", () => {
|
|
250
|
+
const src = `sequenceDiagram
|
|
250
251
|
participant A as Alice
|
|
251
252
|
participant B as Bob
|
|
252
253
|
participant C as Carol
|
|
253
254
|
Note left of B: ${LONG_LABEL}
|
|
254
255
|
B->>C: hi`
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
)
|
|
256
|
+
const ascii = renderMermaidASCII(src, { useAscii: true })
|
|
257
|
+
const noteRect = findBoxRect(ascii, LONG_LABEL)
|
|
258
|
+
const aliceCol = lifelineColumn(ascii, 'Alice')
|
|
259
|
+
expect(aliceCol < noteRect.x0 || aliceCol > noteRect.x1).toBe(true)
|
|
260
|
+
})
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const src = `sequenceDiagram
|
|
262
|
+
// Fixed by issue #953 case C: the lifeline gap used to be sized only from
|
|
263
|
+
// message-label widths — note width never entered that calculation for
|
|
264
|
+
// either side. Notes draw last (after lifelines/boxes/messages/blocks),
|
|
265
|
+
// so a right-note wider than the gap to the *next* actor silently
|
|
266
|
+
// overwrote that actor's lifeline. No `Math.max(0, …)` clamp was involved
|
|
267
|
+
// — a genuinely different bug from the two above, sharing only the
|
|
268
|
+
// visible symptom. The fix folds note width into the same gap-sizing pass
|
|
269
|
+
// that already accounts for message labels.
|
|
270
|
+
it("note right of an actor does not overlap the next actor's lifeline", () => {
|
|
271
|
+
const src = `sequenceDiagram
|
|
273
272
|
participant A as Alice
|
|
274
273
|
participant B as Bob
|
|
275
274
|
participant C as Carol
|
|
276
275
|
A->>B: hi
|
|
277
276
|
Note right of B: ${LONG_LABEL}`
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
)
|
|
277
|
+
const ascii = renderMermaidASCII(src, { useAscii: true })
|
|
278
|
+
const noteRect = findBoxRect(ascii, LONG_LABEL)
|
|
279
|
+
const carolCol = lifelineColumn(ascii, 'Carol')
|
|
280
|
+
expect(carolCol < noteRect.x0 || carolCol > noteRect.x1).toBe(true)
|
|
281
|
+
})
|
|
284
282
|
|
|
285
283
|
// Regression locks: short notes, which don't hit any of the three bugs
|
|
286
284
|
// above, must keep rendering without collision.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ============================================================================
|
|
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('ASCII sequence diagrams – autonumber', () => {
|
|
11
11
|
it('renders sequence numbers near each numbered arrow, in order', () => {
|
|
@@ -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 sequence diagrams – pre-message notes', () => {
|
|
9
9
|
it('renders a note placed before the first message (regression)', () => {
|
|
@@ -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
|
const SEQ = `sequenceDiagram
|
|
18
18
|
participant A
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// ============================================================================
|
|
14
14
|
|
|
15
15
|
import { describe, it, expect } from 'vitest'
|
|
16
|
-
import { renderMermaidASCII } from '
|
|
16
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
17
17
|
|
|
18
18
|
describe('ASCII sequence diagrams – self-arrow labels (issue #68)', () => {
|
|
19
19
|
it('splits <br/> in a self-arrow label across rows without corrupting the canvas', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { diamondRenderer } from '
|
|
3
|
-
import { canvasToString } from '
|
|
4
|
-
import type { ShapeRenderOptions } from '
|
|
2
|
+
import { diamondRenderer } from '../../packages/ascii-renderer/src/shapes/diamond.ts'
|
|
3
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
4
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
5
5
|
|
|
6
6
|
describe('diamondRenderer.render', () => {
|
|
7
7
|
it('draws unicode diamond corner markers around a short label', () => {
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
renderBox,
|
|
5
5
|
getBoxAttachmentPoint,
|
|
6
6
|
rectangleRenderer,
|
|
7
|
-
} from '
|
|
8
|
-
import { canvasToString } from '
|
|
9
|
-
import { getCorners } from '
|
|
7
|
+
} from '../../packages/ascii-renderer/src/shapes/rectangle.ts'
|
|
8
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
9
|
+
import { getCorners } from '../../packages/ascii-renderer/src/shapes/corners.ts'
|
|
10
10
|
import {
|
|
11
11
|
Up,
|
|
12
12
|
Down,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
LowerLeft,
|
|
18
18
|
LowerRight,
|
|
19
19
|
Middle,
|
|
20
|
-
} from '
|
|
21
|
-
import type { ShapeRenderOptions } from '
|
|
20
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
21
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
22
22
|
|
|
23
23
|
const optsP0: ShapeRenderOptions = { useAscii: false, padding: 0 }
|
|
24
24
|
const optsP1: ShapeRenderOptions = { useAscii: false, padding: 1 }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { roundedRenderer } from '
|
|
3
|
-
import { canvasToString } from '
|
|
4
|
-
import type { ShapeRenderOptions } from '
|
|
2
|
+
import { roundedRenderer } from '../../packages/ascii-renderer/src/shapes/rounded.ts'
|
|
3
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
4
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
5
5
|
|
|
6
6
|
describe('roundedRenderer.render', () => {
|
|
7
7
|
it('draws Unicode rounded corners around a single-line label', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { circleRenderer } from '
|
|
3
|
-
import { canvasToString } from '
|
|
4
|
-
import type { ShapeRenderOptions } from '
|
|
2
|
+
import { circleRenderer } from '../../packages/ascii-renderer/src/shapes/circle.ts'
|
|
3
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
4
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
5
5
|
|
|
6
6
|
function render(label: string, options: ShapeRenderOptions): string {
|
|
7
7
|
const dimensions = circleRenderer.getDimensions(label, options)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { hexagonRenderer } from '
|
|
3
|
-
import { canvasToString } from '
|
|
4
|
-
import type { ShapeRenderOptions } from '
|
|
2
|
+
import { hexagonRenderer } from '../../packages/ascii-renderer/src/shapes/hexagon.ts'
|
|
3
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
4
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
5
5
|
|
|
6
6
|
describe('hexagonRenderer.render', () => {
|
|
7
7
|
it('draws Unicode hexagon corner markers around a single-line label', () => {
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
* `[\text/]`. None of these shapes were exercised anywhere before this file.
|
|
6
6
|
*/
|
|
7
7
|
import { describe, it, expect } from 'vitest'
|
|
8
|
-
import { renderMermaidASCII } from '
|
|
9
|
-
import { canvasToString } from '
|
|
10
|
-
import {
|
|
8
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
9
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
10
|
+
import {
|
|
11
|
+
Up,
|
|
12
|
+
Down,
|
|
13
|
+
Left,
|
|
14
|
+
Right,
|
|
15
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
11
16
|
import {
|
|
12
17
|
subroutineRenderer,
|
|
13
18
|
doublecircleRenderer,
|
|
@@ -17,8 +22,8 @@ import {
|
|
|
17
22
|
parallelogramRenderer,
|
|
18
23
|
parallelogramAltRenderer,
|
|
19
24
|
trapezoidAltRenderer,
|
|
20
|
-
} from '
|
|
21
|
-
import type { ShapeRenderOptions } from '
|
|
25
|
+
} from '../../packages/ascii-renderer/src/shapes/special.ts'
|
|
26
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
22
27
|
|
|
23
28
|
const unicodeOpts: ShapeRenderOptions = { useAscii: false, padding: 1 }
|
|
24
29
|
const asciiOpts: ShapeRenderOptions = { useAscii: true, padding: 1 }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { renderMermaidASCII } from '
|
|
3
|
-
import { stadiumRenderer } from '
|
|
4
|
-
import type { Canvas } from '
|
|
2
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
3
|
+
import { stadiumRenderer } from '../../packages/ascii-renderer/src/shapes/stadium.ts'
|
|
4
|
+
import type { Canvas } from '../../packages/ascii-renderer/src/types.ts'
|
|
5
5
|
|
|
6
6
|
function canvasToLines(canvas: Canvas): string[] {
|
|
7
7
|
const height = canvas[0]?.length ?? 0
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { renderMermaidASCII } from '
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
3
|
+
import {
|
|
4
|
+
stateStartRenderer,
|
|
5
|
+
stateEndRenderer,
|
|
6
|
+
} from '../../packages/ascii-renderer/src/shapes/state.ts'
|
|
7
|
+
import { canvasToString } from '../../packages/ascii-renderer/src/canvas.ts'
|
|
8
|
+
import {
|
|
9
|
+
Up,
|
|
10
|
+
Down,
|
|
11
|
+
Left,
|
|
12
|
+
Right,
|
|
13
|
+
Middle,
|
|
14
|
+
UpperLeft,
|
|
15
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
16
|
+
import type { ShapeRenderOptions } from '../../packages/ascii-renderer/src/shapes/types.ts'
|
|
7
17
|
|
|
8
18
|
const unicodeOptions: ShapeRenderOptions = { useAscii: false, padding: 1 }
|
|
9
19
|
const asciiOptions: ShapeRenderOptions = { useAscii: true, padding: 1 }
|
|
@@ -19,10 +19,14 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { describe, it, expect } from 'vitest'
|
|
21
21
|
import { parseMermaid } from '../parser.ts'
|
|
22
|
-
import { convertToAsciiGraph } from '
|
|
23
|
-
import { createMapping } from '
|
|
24
|
-
import { renderMermaidASCII } from '
|
|
25
|
-
import type {
|
|
22
|
+
import { convertToAsciiGraph } from '../../packages/ascii-renderer/src/converter.ts'
|
|
23
|
+
import { createMapping } from '../../packages/ascii-renderer/src/grid.ts'
|
|
24
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
25
|
+
import type {
|
|
26
|
+
AsciiConfig,
|
|
27
|
+
AsciiGraph,
|
|
28
|
+
AsciiSubgraph,
|
|
29
|
+
} from '../../packages/ascii-renderer/src/types.ts'
|
|
26
30
|
|
|
27
31
|
function layoutFlowchart(
|
|
28
32
|
source: string,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { describe, it, expect } from 'vitest'
|
|
16
|
-
import { renderMermaidASCII } from '
|
|
16
|
+
import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
|
|
17
17
|
|
|
18
18
|
describe('ASCII subgraph direction override — honored case (issue #445)', () => {
|
|
19
19
|
it.each(['LR', 'RL'] as const)(
|