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.
Files changed (251) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +7 -2
  3. package/dist/ascii.cjs +9 -9
  4. package/dist/ascii.cjs.map +1 -1
  5. package/dist/ascii.js +4069 -3969
  6. package/dist/ascii.js.map +1 -1
  7. package/dist/cli.js +7605 -7381
  8. package/dist/index.cjs +52 -52
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.js +7613 -7459
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp.cjs +14142 -13717
  13. package/dist/mcp.cjs.map +1 -1
  14. package/dist/mcp.js +14142 -13717
  15. package/dist/mcp.js.map +1 -1
  16. package/package.json +27 -5
  17. package/packages/ascii-renderer/LICENSE +22 -0
  18. package/{src/ascii → packages/ascii-renderer/src}/class-diagram.ts +277 -57
  19. package/{src/ascii → packages/ascii-renderer/src}/er-diagram.ts +2 -2
  20. package/packages/ascii-renderer/src/flowchart.ts +94 -0
  21. package/{src/ascii → packages/ascii-renderer/src}/grid.ts +23 -0
  22. package/{src/ascii → packages/ascii-renderer/src}/index.ts +13 -84
  23. package/{src/ascii → packages/ascii-renderer/src}/registry.ts +23 -12
  24. package/{src/ascii → packages/ascii-renderer/src}/sequence.ts +55 -8
  25. package/{src/ascii → packages/ascii-renderer/src}/xychart.ts +6 -3
  26. package/packages/core/LICENSE +22 -0
  27. package/packages/core/src/click-directive.ts +106 -0
  28. package/packages/core/src/color-utils.ts +205 -0
  29. package/packages/core/src/diagram-type.ts +35 -0
  30. package/packages/core/src/direction-override.ts +46 -0
  31. package/packages/core/src/direction.ts +56 -0
  32. package/packages/core/src/index.ts +34 -0
  33. package/packages/core/src/init-directive.ts +248 -0
  34. package/packages/core/src/multiline-utils.ts +275 -0
  35. package/packages/core/src/statements.ts +197 -0
  36. package/packages/core/src/style-directives.ts +214 -0
  37. package/packages/core/src/text-metrics.ts +498 -0
  38. package/packages/core/src/theme.ts +696 -0
  39. package/packages/core/src/types.ts +670 -0
  40. package/packages/mcp/LICENSE +22 -0
  41. package/{src/mcp → packages/mcp/src}/server.ts +34 -2
  42. package/{src/mcp → packages/mcp/src}/tools/check-sequence-activations.ts +8 -5
  43. package/packages/mcp/src/tools/fix-sequence-activations.ts +77 -0
  44. package/{src/mcp → packages/mcp/src}/tools/render-ascii.ts +2 -2
  45. package/{src/mcp → packages/mcp/src}/tools/render-svg.ts +1 -1
  46. package/packages/mermaid-parser/LICENSE +22 -0
  47. package/{src → packages/mermaid-parser/src}/class/parser.ts +86 -8
  48. package/{src → packages/mermaid-parser/src}/er/parser.ts +59 -26
  49. package/packages/mermaid-parser/src/index.ts +48 -0
  50. package/{src → packages/mermaid-parser/src}/sequence/activation-check.ts +4 -3
  51. package/packages/mermaid-parser/src/sequence/activation-fix.ts +112 -0
  52. package/{src → packages/mermaid-parser/src}/sequence/parser.ts +74 -16
  53. package/{src → packages/mermaid-parser/src}/xychart/parser.ts +84 -6
  54. package/packages/svg-renderer/LICENSE +22 -0
  55. package/{src → packages/svg-renderer/src}/class/layout.ts +8 -4
  56. package/{src → packages/svg-renderer/src}/class/renderer.ts +7 -6
  57. package/packages/svg-renderer/src/edge-curves.ts +204 -0
  58. package/packages/svg-renderer/src/elk-instance.ts +292 -0
  59. package/{src → packages/svg-renderer/src}/er/layout.ts +6 -4
  60. package/{src → packages/svg-renderer/src}/er/renderer.ts +4 -4
  61. package/packages/svg-renderer/src/index.ts +58 -0
  62. package/packages/svg-renderer/src/layout-engine/constants.ts +19 -0
  63. package/packages/svg-renderer/src/layout-engine/edge-bundling.ts +379 -0
  64. package/packages/svg-renderer/src/layout-engine/elk-adapter-utils.ts +81 -0
  65. package/packages/svg-renderer/src/layout-engine/elk-graph-builder.ts +240 -0
  66. package/packages/svg-renderer/src/layout-engine/from-elk.ts +685 -0
  67. package/packages/svg-renderer/src/layout-engine/layer-alignment.ts +174 -0
  68. package/packages/svg-renderer/src/layout-engine/to-elk.ts +695 -0
  69. package/packages/svg-renderer/src/layout-engine.ts +74 -0
  70. package/packages/svg-renderer/src/layout.ts +8 -0
  71. package/packages/svg-renderer/src/renderer.ts +1485 -0
  72. package/packages/svg-renderer/src/resolve-colors.ts +339 -0
  73. package/{src → packages/svg-renderer/src}/sequence/layout.ts +2 -6
  74. package/{src → packages/svg-renderer/src}/sequence/renderer.ts +4 -4
  75. package/packages/svg-renderer/src/shape-clipping.ts +197 -0
  76. package/packages/svg-renderer/src/styles.ts +118 -0
  77. package/{src → packages/svg-renderer/src}/xychart/layout.ts +2 -2
  78. package/{src → packages/svg-renderer/src}/xychart/renderer.ts +6 -6
  79. package/src/__tests__/ascii-ansi.test.ts +6 -2
  80. package/src/__tests__/ascii-canvas-write.test.ts +2 -2
  81. package/src/__tests__/ascii-charset-border-junctions.test.ts +1 -1
  82. package/src/__tests__/ascii-cjk-width.test.ts +1 -1
  83. package/src/__tests__/ascii-class-box-occupancy.test.ts +147 -45
  84. package/src/__tests__/ascii-class-column-width-488-489.test.ts +1 -1
  85. package/src/__tests__/ascii-class-cross-level-jog-corruption.test.ts +187 -0
  86. package/src/__tests__/ascii-class-detour-label-routing-487.test.ts +1 -1
  87. package/src/__tests__/ascii-class-diagram-compartments.test.ts +1 -1
  88. package/src/__tests__/ascii-class-label-box-collision.test.ts +1 -1
  89. package/src/__tests__/ascii-class-label-row-collision-531.test.ts +1 -1
  90. package/src/__tests__/ascii-class-label-territory-row-awareness.test.ts +1 -1
  91. package/src/__tests__/ascii-class-padding.test.ts +1 -1
  92. package/src/__tests__/ascii-class-reciprocal-relationships-448.test.ts +86 -1
  93. package/src/__tests__/ascii-combining-mark-width.test.ts +2 -2
  94. package/src/__tests__/ascii-coords-overlay.test.ts +2 -2
  95. package/src/__tests__/ascii-decision-lr-box-start.test.ts +2 -2
  96. package/src/__tests__/ascii-display-width-unit.test.ts +1 -1
  97. package/src/__tests__/ascii-draw-arrows-coverage.test.ts +1 -1
  98. package/src/__tests__/ascii-draw-arrows-single-point-path.test.ts +12 -5
  99. package/src/__tests__/ascii-draw-bundles.test.ts +5 -5
  100. package/src/__tests__/ascii-edge-bundling-rank-violation-454.test.ts +1 -1
  101. package/src/__tests__/ascii-edge-bundling-routing.test.ts +9 -5
  102. package/src/__tests__/ascii-edge-cross-style-overlap.test.ts +10 -6
  103. package/src/__tests__/ascii-edge-ending-glyphs.test.ts +1 -1
  104. package/src/__tests__/ascii-edge-label-diagonal-fallback-418.test.ts +2 -2
  105. package/src/__tests__/ascii-edge-routing-fixes.test.ts +1 -1
  106. package/src/__tests__/ascii-edge-routing-single-point-path.test.ts +8 -4
  107. package/src/__tests__/ascii-edge-styles.test.ts +1 -1
  108. package/src/__tests__/ascii-emoji-cluster-width.test.ts +2 -2
  109. package/src/__tests__/ascii-er-box-occupancy.test.ts +1 -1
  110. package/src/__tests__/ascii-er-cardinality.test.ts +1 -1
  111. package/src/__tests__/ascii-er-corner-glyphs.test.ts +1 -1
  112. package/src/__tests__/ascii-er-jog-stray-line.test.ts +1 -1
  113. package/src/__tests__/ascii-er-label-padding.test.ts +1 -1
  114. package/src/__tests__/ascii-er-padding.test.ts +1 -1
  115. package/src/__tests__/ascii-er-relationship-label-corruption-350.test.ts +1 -1
  116. package/src/__tests__/ascii-er-relationship-overwrite.test.ts +1 -1
  117. package/src/__tests__/ascii-er-stray-connectors.test.ts +7 -4
  118. package/src/__tests__/ascii-er-unrelated-stem-separation-411.test.ts +1 -1
  119. package/src/__tests__/ascii-er-vertical-one-marker.test.ts +1 -1
  120. package/src/__tests__/ascii-grid-deep-chain.test.ts +4 -4
  121. package/src/__tests__/ascii-hyperlinks.test.ts +9 -6
  122. package/src/__tests__/ascii-label-line-terminal-fallback.test.ts +8 -4
  123. package/src/__tests__/ascii-lane-search.test.ts +1 -1
  124. package/src/__tests__/ascii-multibox-cjk-width.test.ts +1 -1
  125. package/src/__tests__/ascii-multiline.test.ts +6 -3
  126. package/src/__tests__/ascii-nested-subgraph-sibling-order-444.test.ts +8 -5
  127. package/src/__tests__/ascii-package-boundary.test.ts +47 -37
  128. package/src/__tests__/ascii-padding-edge-cases.test.ts +1 -1
  129. package/src/__tests__/ascii-parallel-edges-329.test.ts +8 -5
  130. package/src/__tests__/ascii-pathfinder-route-edge.test.ts +14 -4
  131. package/src/__tests__/ascii-reverse-direction-edges-629.test.ts +9 -5
  132. package/src/__tests__/ascii-sequence-alt-else-label.test.ts +1 -1
  133. package/src/__tests__/ascii-sequence-block-wall-clearance.test.ts +1 -1
  134. package/src/__tests__/ascii-sequence-box-group.test.ts +1 -1
  135. package/src/__tests__/ascii-sequence-cjk-width.test.ts +1 -1
  136. package/src/__tests__/ascii-sequence-create-destroy.test.ts +1 -1
  137. package/src/__tests__/ascii-sequence-form-invariants.test.ts +48 -50
  138. package/src/__tests__/ascii-sequence-mermaid-parity.test.ts +1 -1
  139. package/src/__tests__/ascii-sequence-notes.test.ts +1 -1
  140. package/src/__tests__/ascii-sequence-padding.test.ts +1 -1
  141. package/src/__tests__/ascii-sequence-self-arrow.test.ts +1 -1
  142. package/src/__tests__/ascii-shape-diamond.test.ts +3 -3
  143. package/src/__tests__/ascii-shape-rectangle.test.ts +5 -5
  144. package/src/__tests__/ascii-shape-rounded.test.ts +3 -3
  145. package/src/__tests__/ascii-shapes-circle.test.ts +3 -3
  146. package/src/__tests__/ascii-shapes-hexagon.test.ts +3 -3
  147. package/src/__tests__/ascii-shapes-special.test.ts +10 -5
  148. package/src/__tests__/ascii-shapes-stadium.test.ts +3 -3
  149. package/src/__tests__/ascii-shapes-state.test.ts +15 -5
  150. package/src/__tests__/ascii-state-bidirectional-label-swap-530.test.ts +1 -1
  151. package/src/__tests__/ascii-subgraph-bbox.test.ts +8 -4
  152. package/src/__tests__/ascii-subgraph-direction-honored-445.test.ts +1 -1
  153. package/src/__tests__/ascii-subgraph-label-border-clip.test.ts +88 -25
  154. package/src/__tests__/ascii-subgraph-later-edgeless-301.test.ts +8 -4
  155. package/src/__tests__/ascii-subgraph-title-padding.test.ts +1 -1
  156. package/src/__tests__/ascii-territory-unit.test.ts +2 -2
  157. package/src/__tests__/ascii-validate.test.ts +1 -1
  158. package/src/__tests__/ascii.test.ts +5 -2
  159. package/src/__tests__/box-color.test.ts +1 -1
  160. package/src/__tests__/class-arrow-directions.test.ts +1 -1
  161. package/src/__tests__/class-click-interactions.test.ts +3 -6
  162. package/src/__tests__/class-integration.test.ts +1 -1
  163. package/src/__tests__/class-notes.test.ts +3 -3
  164. package/src/__tests__/class-parser-error-messages.test.ts +162 -0
  165. package/src/__tests__/class-parser.test.ts +6 -6
  166. package/src/__tests__/class-styling.test.ts +2 -2
  167. package/src/__tests__/cli-render.test.ts +16 -1
  168. package/src/__tests__/direction-override.test.ts +1 -1
  169. package/src/__tests__/draw-lines.test.ts +2 -2
  170. package/src/__tests__/edge-cell-styles.test.ts +5 -2
  171. package/src/__tests__/elk-layout-cache.test.ts +6 -4
  172. package/src/__tests__/er-click-unsupported.test.ts +5 -8
  173. package/src/__tests__/er-parser-error-messages.test.ts +82 -0
  174. package/src/__tests__/er-parser.test.ts +3 -6
  175. package/src/__tests__/expanded-shapes.test.ts +1 -1
  176. package/src/__tests__/grid-occupancy.test.ts +1 -1
  177. package/src/__tests__/mcp-check-sequence-activations-tool.test.ts +1 -1
  178. package/src/__tests__/mcp-fix-sequence-activations-tool.test.ts +134 -0
  179. package/src/__tests__/mcp-render-ascii-tool.test.ts +5 -4
  180. package/src/__tests__/mcp-render-svg-theme-guard.test.ts +3 -3
  181. package/src/__tests__/mcp-render-svg-tool.test.ts +1 -1
  182. package/src/__tests__/mcp-server.test.ts +30 -1
  183. package/src/__tests__/multiline-labels.test.ts +29 -18
  184. package/src/__tests__/parser.test.ts +117 -5
  185. package/src/__tests__/pathfinder.test.ts +11 -4
  186. package/src/__tests__/render-options-overrides.test.ts +28 -21
  187. package/src/__tests__/render-options-per-type.test.ts +13 -9
  188. package/src/__tests__/resolve-colors.test.ts +1 -1
  189. package/src/__tests__/self-loop-edges.test.ts +112 -0
  190. package/src/__tests__/sequence-activation-check.test.ts +7 -8
  191. package/src/__tests__/sequence-activation-fix.test.ts +91 -0
  192. package/src/__tests__/sequence-layout.test.ts +4 -7
  193. package/src/__tests__/sequence-parser-syntax-errors.test.ts +179 -0
  194. package/src/__tests__/sequence-parser.test.ts +3 -6
  195. package/src/__tests__/statements.test.ts +53 -35
  196. package/src/__tests__/testdata/ascii/subgraph_direction_override.txt +21 -21
  197. package/src/__tests__/theme-palette-contrast.test.ts +84 -0
  198. package/src/__tests__/workspace-package-boundaries.test.ts +199 -25
  199. package/src/__tests__/xychart-ascii.test.ts +1 -1
  200. package/src/__tests__/xychart-colors.test.ts +3 -2
  201. package/src/__tests__/xychart-layout.test.ts +1 -1
  202. package/src/__tests__/xychart-parser-errors.test.ts +95 -0
  203. package/src/browser.ts +8 -2
  204. package/src/cli/mcp.ts +1 -1
  205. package/src/cli/render.ts +59 -25
  206. package/src/cli/web.ts +1 -1
  207. package/src/diagram-registry.ts +190 -25
  208. package/src/index.ts +34 -131
  209. package/src/parser.ts +102 -40
  210. /package/{src/ascii → packages/ascii-renderer/src}/ansi.ts +0 -0
  211. /package/{src/ascii → packages/ascii-renderer/src}/canvas.ts +0 -0
  212. /package/{src/ascii → packages/ascii-renderer/src}/converter.ts +0 -0
  213. /package/{src/ascii → packages/ascii-renderer/src}/coords.ts +0 -0
  214. /package/{src/ascii → packages/ascii-renderer/src}/display-width.ts +0 -0
  215. /package/{src/ascii → packages/ascii-renderer/src}/draw-arrows.ts +0 -0
  216. /package/{src/ascii → packages/ascii-renderer/src}/draw-boxes.ts +0 -0
  217. /package/{src/ascii → packages/ascii-renderer/src}/draw-bundles.ts +0 -0
  218. /package/{src/ascii → packages/ascii-renderer/src}/draw-lines.ts +0 -0
  219. /package/{src/ascii → packages/ascii-renderer/src}/draw-subgraphs.ts +0 -0
  220. /package/{src/ascii → packages/ascii-renderer/src}/draw.ts +0 -0
  221. /package/{src/ascii → packages/ascii-renderer/src}/edge-bundling.ts +0 -0
  222. /package/{src/ascii → packages/ascii-renderer/src}/edge-cell-styles.ts +0 -0
  223. /package/{src/ascii → packages/ascii-renderer/src}/edge-routing.ts +0 -0
  224. /package/{src/ascii → packages/ascii-renderer/src}/grid-occupancy.ts +0 -0
  225. /package/{src/ascii → packages/ascii-renderer/src}/hyperlinks.ts +0 -0
  226. /package/{src/ascii → packages/ascii-renderer/src}/lane-search.ts +0 -0
  227. /package/{src/ascii → packages/ascii-renderer/src}/multiline-utils.ts +0 -0
  228. /package/{src/ascii → packages/ascii-renderer/src}/pathfinder.ts +0 -0
  229. /package/{src/ascii → packages/ascii-renderer/src}/shapes/circle.ts +0 -0
  230. /package/{src/ascii → packages/ascii-renderer/src}/shapes/corners.ts +0 -0
  231. /package/{src/ascii → packages/ascii-renderer/src}/shapes/diamond.ts +0 -0
  232. /package/{src/ascii → packages/ascii-renderer/src}/shapes/hexagon.ts +0 -0
  233. /package/{src/ascii → packages/ascii-renderer/src}/shapes/index.ts +0 -0
  234. /package/{src/ascii → packages/ascii-renderer/src}/shapes/rectangle.ts +0 -0
  235. /package/{src/ascii → packages/ascii-renderer/src}/shapes/rounded.ts +0 -0
  236. /package/{src/ascii → packages/ascii-renderer/src}/shapes/special.ts +0 -0
  237. /package/{src/ascii → packages/ascii-renderer/src}/shapes/stadium.ts +0 -0
  238. /package/{src/ascii → packages/ascii-renderer/src}/shapes/state.ts +0 -0
  239. /package/{src/ascii → packages/ascii-renderer/src}/shapes/types.ts +0 -0
  240. /package/{src/ascii → packages/ascii-renderer/src}/territory.ts +0 -0
  241. /package/{src/ascii → packages/ascii-renderer/src}/types.ts +0 -0
  242. /package/{src/ascii → packages/ascii-renderer/src}/validate.ts +0 -0
  243. /package/{src/mcp → packages/mcp/src}/index.ts +0 -0
  244. /package/{src → packages/mermaid-parser/src}/class/format.ts +0 -0
  245. /package/{src → packages/mermaid-parser/src}/class/types.ts +0 -0
  246. /package/{src → packages/mermaid-parser/src}/er/types.ts +0 -0
  247. /package/{src → packages/mermaid-parser/src}/expanded-shapes.ts +0 -0
  248. /package/{src → packages/mermaid-parser/src}/sequence/box-color.ts +0 -0
  249. /package/{src → packages/mermaid-parser/src}/sequence/types.ts +0 -0
  250. /package/{src → packages/mermaid-parser/src}/xychart/colors.ts +0 -0
  251. /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
- const ASCII_ENTRY = resolve(REPO_ROOT, 'src/ascii/index.ts')
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). Note `class/format.ts`, `xychart/colors.ts`
177
- // and `sequence/box-color.ts`: the doc's finding 1 describes each per-type
178
- // directory as a `parser.ts`+`types.ts` half and a `layout.ts`+
179
- // `renderer.ts` half, but these three are in neither, and the ASCII side
180
- // needs all of them — so #624's split is per-file, not per-half-pair.
181
- parser: [
182
- 'src/parser.ts',
183
- 'src/class/format.ts',
184
- 'src/class/parser.ts',
185
- 'src/er/parser.ts',
186
- 'src/sequence/box-color.ts',
187
- 'src/sequence/parser.ts',
188
- 'src/xychart/colors.ts',
189
- 'src/xychart/parser.ts',
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
- // belongs to neither `core` nor `svg-renderer` and is still awaiting #624
197
- // (`mermaid-parser`), so it's the only one left reachable by relative
198
- // import.
199
- misclassifiedAsSvgOnly: ['src/expanded-shapes.ts'],
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
- * These are the `types.ts` halves of the still-unpackaged `mermaid-parser`
214
- * (#624) directories. `src/types.ts` (`core`) and `src/elk-instance.ts`
215
- * (`svg-renderer`) used to appear here too, reached as `src/types.ts` ->
216
- * `import type { LayoutCache }` — exactly the type-graph cycle this list's
217
- * original comment flagged as something #625 would have to resolve. #625's
218
- * addendum confirms it did: `LayoutCache` moved to `packages/core/src/
219
- * types.ts`, and both files are now reached through the bare
220
- * `@zombie-mermaid/core` specifier, invisible to this relative-only walker.
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].filter((file) => !file.startsWith('src/ascii/')).sort()
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 src/ascii/ beyond the core + parser modules #624/#625 will package', () => {
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 '../ascii/index.ts'
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 '../ascii/converter.ts'
41
- import { createMapping } from '../ascii/grid.ts'
42
- import { renderMermaidASCII } from '../ascii/index.ts'
43
- import { pathCells, isOccupied } from '../ascii/grid-occupancy.ts'
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 '../ascii/types.ts'
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 { routeEdge, createPathBudget } from '../ascii/pathfinder.ts'
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 '../ascii/types.ts'
27
- import type { AsciiGraph, PathBudget } from '../ascii/types.ts'
28
- import { createGrid, placeBlock, type Grid } from '../ascii/grid-occupancy.ts'
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 '../ascii/converter.ts'
32
- import { createMapping } from '../ascii/grid.ts'
33
- import { renderMermaidASCII } from '../ascii/index.ts'
34
- import { pathCells } from '../ascii/grid-occupancy.ts'
35
- import type { AsciiConfig, AsciiEdge, AsciiGraph } from '../ascii/types.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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
- it.fails(
220
- // Bug: src/ascii/sequence.ts:199-214 — `nx = llX[aIdx] - nWidth - 1`
221
- // clamped to `Math.max(0, nx)`. For the leftmost actor, a note wider
222
- // than its (small) left margin clamps to column 0, so the note's own
223
- // rectangle swallows its own actor's lifeline column instead of sitting
224
- // entirely to its left.
225
- "note left of the leftmost actor does not overlap that actor's own lifeline",
226
- () => {
227
- const src = `sequenceDiagram
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
- const ascii = renderMermaidASCII(src, { useAscii: true })
233
- // findBoxRect, not findTextRect — the note's own border/padding must
234
- // also stay clear of the lifeline, not just its bare text span.
235
- const noteRect = findBoxRect(ascii, LONG_LABEL)
236
- const aliceCol = lifelineColumn(ascii, 'Alice')
237
- expect(aliceCol < noteRect.x0 || aliceCol > noteRect.x1).toBe(true)
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
- it.fails(
242
- // Bug: same clamp as above, but the victim is a *different* actor's
243
- // lifeline — the exact shape visible in samples-data.ts's "Sequence:
244
- // Notes (Right/Left/Over)" sample ("Alice prepares" reaching into Bob's
245
- // lifeline). A non-leftmost actor with a real left neighbor and a note
246
- // wide enough that `llX[aIdx] - nWidth - 1 < 0`.
247
- "note left of a non-leftmost actor does not overlap the left-neighbor's lifeline",
248
- () => {
249
- const src = `sequenceDiagram
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
- const ascii = renderMermaidASCII(src, { useAscii: true })
256
- const noteRect = findBoxRect(ascii, LONG_LABEL)
257
- const aliceCol = lifelineColumn(ascii, 'Alice')
258
- expect(aliceCol < noteRect.x0 || aliceCol > noteRect.x1).toBe(true)
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
- it.fails(
263
- // Bug: the lifeline gap (sequence.ts:114-131) is sized only from
264
- // message-label widths — note width never enters that calculation for
265
- // either side. Notes draw last (after lifelines/boxes/messages/blocks),
266
- // so a right-note wider than the gap to the *next* actor silently
267
- // overwrites that actor's lifeline. No `Math.max(0, …)` clamp involved
268
- // — a genuinely different bug from the two above, sharing only the
269
- // visible symptom.
270
- "note right of an actor does not overlap the next actor's lifeline",
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
- const ascii = renderMermaidASCII(src, { useAscii: true })
279
- const noteRect = findBoxRect(ascii, LONG_LABEL)
280
- const carolCol = lifelineColumn(ascii, 'Carol')
281
- expect(carolCol < noteRect.x0 || carolCol > noteRect.x1).toBe(true)
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/index.ts'
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 '../ascii/shapes/diamond.ts'
3
- import { canvasToString } from '../ascii/canvas.ts'
4
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 '../ascii/shapes/rectangle.ts'
8
- import { canvasToString } from '../ascii/canvas.ts'
9
- import { getCorners } from '../ascii/shapes/corners.ts'
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 '../ascii/types.ts'
21
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 '../ascii/shapes/rounded.ts'
3
- import { canvasToString } from '../ascii/canvas.ts'
4
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 '../ascii/shapes/circle.ts'
3
- import { canvasToString } from '../ascii/canvas.ts'
4
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 '../ascii/shapes/hexagon.ts'
3
- import { canvasToString } from '../ascii/canvas.ts'
4
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 '../ascii/index.ts'
9
- import { canvasToString } from '../ascii/canvas.ts'
10
- import { Up, Down, Left, Right } from '../ascii/types.ts'
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 '../ascii/shapes/special.ts'
21
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 '../ascii/index.ts'
3
- import { stadiumRenderer } from '../ascii/shapes/stadium.ts'
4
- import type { Canvas } from '../ascii/types.ts'
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 '../ascii/index.ts'
3
- import { stateStartRenderer, stateEndRenderer } from '../ascii/shapes/state.ts'
4
- import { canvasToString } from '../ascii/canvas.ts'
5
- import { Up, Down, Left, Right, Middle, UpperLeft } from '../ascii/types.ts'
6
- import type { ShapeRenderOptions } from '../ascii/shapes/types.ts'
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 }
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { describe, it, expect } from 'vitest'
26
- import { renderMermaidASCII } from '../ascii/index.ts'
26
+ import { renderMermaidASCII } from '@zombie-mermaid/ascii-renderer'
27
27
 
28
28
  const BASIC_STATE_DIAGRAM = `stateDiagram-v2
29
29
  [*] --> Idle
@@ -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 '../ascii/converter.ts'
23
- import { createMapping } from '../ascii/grid.ts'
24
- import { renderMermaidASCII } from '../ascii/index.ts'
25
- import type { AsciiConfig, AsciiGraph, AsciiSubgraph } from '../ascii/types.ts'
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 '../ascii/index.ts'
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)(