@zenuml/core 3.46.2 → 3.46.4

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.
@@ -1,134 +0,0 @@
1
- # Ship Branch Skills
2
-
3
- ## Overview
4
-
5
- 5 skills that compose into a branch-to-production pipeline for `mermaid-js/zenuml-core`.
6
-
7
- Merge to main triggers npm publish automatically — every merge is a release.
8
-
9
- ## Skills
10
-
11
- ### `/validate-branch`
12
-
13
- **Purpose**: Check if the current branch is locally good.
14
-
15
- **Standalone use**: "Am I good?" — developer runs this before shipping or just to check.
16
-
17
- **Steps**:
18
- 1. `bun eslint` — fastest, fail first
19
- 2. `bun run test` — unit tests
20
- 3. `bun pw` — Playwright E2E (slowest)
21
-
22
- **Output**: pass or structured failure report.
23
-
24
- **Does NOT**: push, commit, create PRs, fix anything.
25
-
26
- ### `/submit-branch`
27
-
28
- **Purpose**: Publish the current branch as a PR.
29
-
30
- **Precondition**: Clean or committable worktree. Fails on mixed/unrelated changes.
31
-
32
- **Steps**:
33
- 1. Inspect worktree — fail if dirty with unrelated changes
34
- 2. Stage and commit scoped changes if needed
35
- 3. Push branch
36
- 4. Create PR if missing, reuse if exists
37
- 5. Return PR number and URL
38
-
39
- **Output**: PR created/reused with URL.
40
-
41
- **Does NOT**: fix CI, merge, validate locally.
42
-
43
- ### `/babysit-pr` (existing)
44
-
45
- **Purpose**: Get PR CI to green.
46
-
47
- **Input**: PR number or current branch PR.
48
-
49
- **Steps**:
50
- 1. Check CI status
51
- 2. Diagnose failures (snapshot mismatch, test failure, lint, build, infra)
52
- 3. Apply safe fixes (update snapshots, fix lint, rerun flaky)
53
- 4. Push and wait — up to 3 attempts
54
-
55
- **Output**: green PR, or concrete failure report after 3 attempts.
56
-
57
- **Does NOT**: merge, create PRs, validate locally.
58
-
59
- ### `/land-pr`
60
-
61
- **Purpose**: Merge a green PR and verify the npm release.
62
-
63
- **Precondition**: All CI checks green, no pending reviews.
64
-
65
- **Steps**:
66
- 1. Verify all checks green + mergeable
67
- 2. Squash merge (hardcoded for this repo)
68
- 3. Watch the post-merge npm-publish GitHub Action
69
- 4. Verify new version appears on npm
70
-
71
- **Output**: merged + published, or failure report.
72
-
73
- **On publish failure**: Alert immediately. Do NOT auto-rollback.
74
-
75
- **Does NOT**: fix CI, create PRs, validate locally.
76
-
77
- ### `/ship-branch` (orchestrator)
78
-
79
- **Purpose**: Full happy path from local branch to npm release.
80
-
81
- **Flow**:
82
- ```
83
- validate-branch → FAIL → stop, report
84
- ↓ PASS
85
- submit-branch → FAIL → stop, report
86
- ↓ PR created
87
- babysit-pr → EXHAUSTED → stop, report "CI blocked"
88
- ↓ GREEN
89
- land-pr → MERGE BLOCKED → stop, report
90
- ↓ MERGED
91
- land-pr → PUBLISH FAILED → alert, stop
92
- ↓ PUBLISHED
93
- done ✓
94
- ```
95
-
96
- **Rules**:
97
- - Each arrow is a hard boundary — no skill reaches back to retry a previous step
98
- - No auto-rollback — stop and report on any failure
99
- - Only `ship-branch` decides when to call `babysit-pr`
100
- - Sub-skills never cross-call each other
101
-
102
- ## Design Principles
103
-
104
- 1. **Each skill owns one state transition** — not just commands
105
- 2. **Each skill is independently invokable** — developers use them standalone
106
- 3. **Stop on failure, report clearly** — no auto-rollback (rollback is more dangerous than stopping)
107
- 4. **Merge = release** — `land-pr` treats merge as a production deployment, not a casual action
108
- 5. **`babysit-pr` is the only skill that fixes CI** — other skills report failures and stop
109
-
110
- ## State Machine
111
-
112
- ```
113
- ┌─────────────────┐
114
- │ validate-branch │──FAIL──→ STOP + report
115
- └────────┬────────┘
116
- │ PASS
117
- ┌────────▼────────┐
118
- │ submit-branch │──FAIL──→ STOP + report
119
- └────────┬────────┘
120
- │ PR ready
121
- ┌────────▼────────┐
122
- │ babysit-pr │──EXHAUSTED──→ STOP + "CI blocked"
123
- └────────┬────────┘
124
- │ GREEN
125
- ┌────────▼────────┐
126
- │ land-pr │──BLOCKED──→ STOP + report
127
- └────────┬────────┘
128
- │ MERGED
129
- ┌────────▼────────┐
130
- │ land-pr (verify) │──PUBLISH FAIL──→ ALERT + STOP
131
- └────────┬────────┘
132
- │ PUBLISHED
133
- ✓ done
134
- ```
@@ -1,283 +0,0 @@
1
- # SVG Parity Features Implementation Plan
2
-
3
- > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
-
5
- **Goal:** Add stereotype labels, participant colors, and group rendering to the native SVG renderer to close feature parity gaps before publishing.
6
-
7
- **Architecture:** Extend the existing data flow: parser model → `OrderedParticipants()` → `IParticipantModel` → `ParticipantGeometry` → SVG rendering. Each feature adds a field to the model interface, passes it through geometry, and renders it in the SVG participant component.
8
-
9
- **Tech Stack:** TypeScript, SVG, Bun test runner
10
-
11
- ---
12
-
13
- ## File Structure
14
-
15
- | File | Responsibility | Changes |
16
- |------|---------------|---------|
17
- | `src/parser/IParticipantModel.ts` | Model interface | Add `stereotype?`, `color?`, `groupId?` |
18
- | `src/parser/OrderedParticipants.ts` | Parser → model extraction | Pass stereotype, color, groupId from collector |
19
- | `src/svg/geometry.ts` | Geometry IR types | Add `stereotype?`, `color?`, `groupId?` to `ParticipantGeometry` |
20
- | `src/svg/buildGeometry.ts` | Geometry builder | Extract new fields in `buildParticipants()` |
21
- | `src/svg/components/participant.ts` | SVG participant renderer | Render stereotype label, apply color fill |
22
- | `src/svg/components/group.ts` | **New** — SVG group renderer | Render dashed outline + title bar |
23
- | `src/svg/composeSvg.ts` | SVG compositor | Render group elements |
24
- | `cy/compare-cases.js` | Test cases | order-service case already added |
25
-
26
- ---
27
-
28
- ### Task 1: Add stereotype to SVG participants
29
-
30
- **Files:**
31
- - Modify: `src/parser/IParticipantModel.ts:4-19`
32
- - Modify: `src/parser/OrderedParticipants.ts:49-59`
33
- - Modify: `src/svg/geometry.ts:10-24`
34
- - Modify: `src/svg/buildGeometry.ts:301-312`
35
- - Modify: `src/svg/components/participant.ts:19-70`
36
- - Test: `src/svg/renderToSvg.spec.ts`
37
-
38
- - [ ] **Step 1: Write the failing test**
39
-
40
- In `src/svg/renderToSvg.spec.ts`, add:
41
- ```typescript
42
- it("renders stereotype label on participant", () => {
43
- const result = renderToSvg('@EC2 <<BFF>> OrderService\nOrderService.method()');
44
- expect(result.innerSvg).toContain("«BFF»");
45
- });
46
- ```
47
-
48
- - [ ] **Step 2: Run test to verify it fails**
49
-
50
- Run: `bun run test -- --testPathPattern renderToSvg`
51
- Expected: FAIL — "«BFF»" not found in output
52
-
53
- - [ ] **Step 3: Add `stereotype` to `IParticipantModel`**
54
-
55
- In `src/parser/IParticipantModel.ts`, add `stereotype?: string;` to the interface.
56
-
57
- - [ ] **Step 4: Pass stereotype from `OrderedParticipants`**
58
-
59
- In `src/parser/OrderedParticipants.ts:53-58`, pass `participant.stereotype`:
60
- ```typescript
61
- return new Participant(
62
- participant.name,
63
- previousName,
64
- participant.label,
65
- participant.type,
66
- participant.stereotype, // NEW
67
- );
68
- ```
69
-
70
- Update the `Participant` class constructor (same file, around line 7) to accept and store `stereotype`.
71
-
72
- - [ ] **Step 5: Add `stereotype` to `ParticipantGeometry`**
73
-
74
- In `src/svg/geometry.ts`, add to the interface:
75
- ```typescript
76
- stereotype?: string;
77
- ```
78
-
79
- - [ ] **Step 6: Extract stereotype in `buildParticipants`**
80
-
81
- In `src/svg/buildGeometry.ts`, in the return object around line 301-312, add:
82
- ```typescript
83
- stereotype: m.stereotype,
84
- ```
85
-
86
- - [ ] **Step 7: Render stereotype in SVG participant**
87
-
88
- In `src/svg/components/participant.ts`, in `renderParticipant()`, add stereotype label rendering above the participant name. The stereotype renders as `«text»` in a smaller font, positioned between the icon (if any) and the main label. Reference HTML: `src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.tsx:126-130`.
89
-
90
- Add after the label text element:
91
- ```typescript
92
- if (p.stereotype) {
93
- const stereoY = textY - 14; // Above main label
94
- elements.push(`<text x="${textX}" y="${stereoY}" text-anchor="middle" font-size="12" fill="#666">«${escXml(p.stereotype)}»</text>`);
95
- }
96
- ```
97
-
98
- - [ ] **Step 8: Run test to verify it passes**
99
-
100
- Run: `bun run test -- --testPathPattern renderToSvg`
101
- Expected: PASS
102
-
103
- - [ ] **Step 9: Commit**
104
-
105
- ```bash
106
- git add -A && git commit -m "feat: add stereotype labels to SVG participants"
107
- ```
108
-
109
- ---
110
-
111
- ### Task 2: Add participant background colors
112
-
113
- **Files:**
114
- - Modify: `src/parser/IParticipantModel.ts`
115
- - Modify: `src/parser/OrderedParticipants.ts`
116
- - Modify: `src/svg/geometry.ts`
117
- - Modify: `src/svg/buildGeometry.ts`
118
- - Modify: `src/svg/components/participant.ts`
119
- - Test: `src/svg/renderToSvg.spec.ts`
120
-
121
- - [ ] **Step 1: Write the failing test**
122
-
123
- ```typescript
124
- it("renders participant with background color", () => {
125
- const result = renderToSvg('@Actor Client #FFEBE6\nClient.method()');
126
- expect(result.innerSvg).toContain('fill="#FFEBE6"');
127
- });
128
- ```
129
-
130
- - [ ] **Step 2: Run test to verify it fails**
131
-
132
- Run: `bun run test -- --testPathPattern renderToSvg`
133
- Expected: FAIL
134
-
135
- - [ ] **Step 3: Add `color` to model, geometry, and builder**
136
-
137
- Same pattern as Task 1:
138
- - `IParticipantModel.ts`: add `color?: string`
139
- - `OrderedParticipants.ts`: pass `participant.color` to constructor
140
- - `geometry.ts`: add `color?: string` to `ParticipantGeometry`
141
- - `buildGeometry.ts`: add `color: m.color` to the return object
142
-
143
- - [ ] **Step 4: Apply color in SVG participant renderer**
144
-
145
- In `src/svg/components/participant.ts`, modify the participant rect fill:
146
- ```typescript
147
- // If color is provided, use it; otherwise use default white
148
- const fillColor = p.color ? `#${p.color.replace('#', '')}` : "#ffffff";
149
- ```
150
-
151
- Apply to the rect element's `fill` attribute. Also compute text color for contrast:
152
- ```typescript
153
- // Simple brightness check for text color
154
- function textColorForBg(hex: string): string {
155
- const r = parseInt(hex.slice(1, 3), 16);
156
- const g = parseInt(hex.slice(3, 5), 16);
157
- const b = parseInt(hex.slice(5, 7), 16);
158
- return (r * 0.299 + g * 0.587 + b * 0.114) > 186 ? "#333" : "#fff";
159
- }
160
- ```
161
-
162
- - [ ] **Step 5: Run test to verify it passes**
163
-
164
- Run: `bun run test -- --testPathPattern renderToSvg`
165
- Expected: PASS
166
-
167
- - [ ] **Step 6: Commit**
168
-
169
- ```bash
170
- git add -A && git commit -m "feat: add participant background colors to SVG renderer"
171
- ```
172
-
173
- ---
174
-
175
- ### Task 3: Add participant group rendering
176
-
177
- **Files:**
178
- - Create: `src/svg/components/group.ts`
179
- - Modify: `src/svg/geometry.ts`
180
- - Modify: `src/svg/buildGeometry.ts`
181
- - Modify: `src/svg/composeSvg.ts`
182
- - Test: `src/svg/renderToSvg.spec.ts`
183
-
184
- - [ ] **Step 1: Write the failing test**
185
-
186
- ```typescript
187
- it("renders participant group container", () => {
188
- const code = 'group BusinessService {\n @Lambda A\n @Database B\n}\nA.method()';
189
- const result = renderToSvg(code);
190
- expect(result.innerSvg).toContain("BusinessService");
191
- // Group should have a dashed outline
192
- expect(result.innerSvg).toContain("stroke-dasharray");
193
- });
194
- ```
195
-
196
- - [ ] **Step 2: Run test to verify it fails**
197
-
198
- Run: `bun run test -- --testPathPattern renderToSvg`
199
- Expected: FAIL
200
-
201
- - [ ] **Step 3: Add `GroupGeometry` to geometry types**
202
-
203
- In `src/svg/geometry.ts`:
204
- ```typescript
205
- export interface GroupGeometry {
206
- name: string;
207
- x: number;
208
- y: number;
209
- width: number;
210
- height: number;
211
- }
212
- ```
213
-
214
- Add `groups: GroupGeometry[]` to the build result.
215
-
216
- - [ ] **Step 4: Build group geometry**
217
-
218
- In `src/svg/buildGeometry.ts`, detect groups from the parser context. The parser's `ToCollector.getParticipants()` returns participants with `groupId`. Group participants that share a `groupId`, compute the bounding box from the leftmost to rightmost participant in the group, and create `GroupGeometry` entries.
219
-
220
- Key data: Each participant from the collector has `groupId` and the group context has `name().getFormattedText()` for the label.
221
-
222
- - [ ] **Step 5: Create group SVG renderer**
223
-
224
- Create `src/svg/components/group.ts`:
225
- ```typescript
226
- export function renderGroup(g: GroupGeometry): string {
227
- // Dashed outline matching HTML's outline-dashed
228
- return `<g class="participant-group">
229
- <rect x="${g.x}" y="${g.y}" width="${g.width}" height="${g.height}" fill="none" stroke="#999" stroke-dasharray="4 2" rx="2"/>
230
- <text x="${g.x + 4}" y="${g.y + 14}" font-size="12" fill="#666">${escXml(g.name)}</text>
231
- </g>`;
232
- }
233
- ```
234
-
235
- - [ ] **Step 6: Integrate groups into composeSvg**
236
-
237
- In `src/svg/composeSvg.ts`, render groups before participants (so they appear behind).
238
-
239
- - [ ] **Step 7: Run test to verify it passes**
240
-
241
- Run: `bun run test -- --testPathPattern renderToSvg`
242
- Expected: PASS
243
-
244
- - [ ] **Step 8: Visual verification**
245
-
246
- Run: `bun dev` → open `http://localhost:8080/cy/compare-case.html?case=order-service`
247
- Verify: "BusinessService" group container visible around PurchaseService and InvoiceService
248
-
249
- - [ ] **Step 9: Commit**
250
-
251
- ```bash
252
- git add -A && git commit -m "feat: add participant group rendering to SVG renderer"
253
- ```
254
-
255
- ---
256
-
257
- ### Task 4: Visual verification and regression check
258
-
259
- - [ ] **Step 1: Run all unit tests**
260
-
261
- Run: `bun run test`
262
- Expected: All tests pass
263
-
264
- - [ ] **Step 2: Check order-service compare case**
265
-
266
- Open `http://localhost:8080/cy/compare-case.html?case=order-service`
267
- Verify:
268
- - Stereotype `«BFF»` appears on OrderService
269
- - Client has pink (#FFEBE6) background
270
- - OrderController has blue (#0747A6) background with white text
271
- - OrderService has green (#E3FCEF) background
272
- - BusinessService group outline visible around PurchaseService + InvoiceService
273
-
274
- - [ ] **Step 3: Check existing cases for regressions**
275
-
276
- Open `http://localhost:8080/cy/compare-case.html?case=self-sync` — should still be ~98%
277
- Open `http://localhost:8080/cy/compare-case.html?case=demo1-smoke` — check icons + groups
278
-
279
- - [ ] **Step 4: Final commit if any fixes needed**
280
-
281
- ```bash
282
- git add -A && git commit -m "fix: visual parity adjustments"
283
- ```
@@ -1,27 +0,0 @@
1
- ```html
2
- <meta charset="utf-8" />
3
- <title>vue-sequence demo</title>
4
- <script src="https://unpkg.com/vue@2.6.12/dist/vue.js"></script>
5
- <script src="https://unpkg.com/vuex@3.6.2/dist/vuex.js"></script>
6
- <script src="./vue-sequence.umd.min.js"></script>
7
-
8
- <link rel="stylesheet" href="./vue-sequence.css" />
9
-
10
- <div id="mounting-point"></div>
11
-
12
- <script>
13
- window.addEventListener('load', function (event) {
14
- console.log('window loaded');
15
- Vue.use(Vuex);
16
- let { SeqDiagram, Store } = window['vue-sequence'];
17
- let storeConfig = Store();
18
- storeConfig.state.code = 'A.method';
19
- Vue.component('seq-diagram', SeqDiagram);
20
- window.app = new Vue({
21
- el: document.getElementById('mounting-point'),
22
- store: new Vuex.Store(storeConfig),
23
- render: (h) => h('seq-diagram'),
24
- });
25
- });
26
- </script>
27
- ```
package/docs/watch.md DELETED
@@ -1 +0,0 @@
1
- watch 'bun run antlr' src/g4
@@ -1,16 +0,0 @@
1
- We have got two options to host the embed view: on GitHub pages or
2
- Cloudflare pages (or other third party).
3
-
4
- The benefit of Cloudflare pages is:
5
-
6
- 1. It offers multiple versions. Basically every publish will generate
7
- a standalone url with current commit hash.
8
- 2. It does not require commit the `dist` folder to the repository.
9
-
10
- The benefit of using GitHub Pages:
11
-
12
- 1. It will definitely be easier to set up for collaborators on GitHub,
13
- because they do not need a Cloudflare account.
14
-
15
- Easy collaboration is more important to us, so we will host this on
16
- GitHub Pages.