@zenuml/core 3.46.1 → 3.46.3
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/.claude/skills/land-pr/SKILL.md +98 -0
- package/.claude/skills/ship-branch/SKILL.md +81 -0
- package/.claude/skills/submit-branch/SKILL.md +76 -0
- package/.claude/skills/validate-branch/SKILL.md +54 -0
- package/dist/stats.html +1 -1
- package/dist/zenuml.esm.mjs +1650 -1621
- package/dist/zenuml.js +518 -517
- package/docs/ship-branch-skill-plan.md +134 -0
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: land-pr
|
|
3
|
+
description: Merge a green PR and verify the npm release succeeds. Use when the user says "merge", "land", "land PR", "merge this", "ship to npm", "merge and release", or when a PR has passed CI and is ready to merge. This is a high-stakes action — merging to main triggers an automatic npm publish, so this skill verifies everything before and after merge.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Land PR
|
|
7
|
+
|
|
8
|
+
Merge a green PR to `main` and verify the npm release. In this repo, **merge = release** — every merge to main triggers automatic npm publish via GitHub Actions. Treat this as a production deployment, not a casual merge.
|
|
9
|
+
|
|
10
|
+
## Preconditions
|
|
11
|
+
|
|
12
|
+
Before merging, verify ALL of these:
|
|
13
|
+
|
|
14
|
+
1. **All CI checks green** — no pending or failed checks
|
|
15
|
+
2. **No pending reviews** — no requested changes outstanding
|
|
16
|
+
3. **Branch is up to date** — no merge conflicts with main
|
|
17
|
+
4. **PR is the right one** — confirm PR number with the user if ambiguous
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
gh pr view <PR_NUMBER> --json state,mergeable,statusCheckRollup,reviewDecision
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If any precondition fails, report which one and stop. Do not attempt to fix — that's `babysit-pr`'s job.
|
|
24
|
+
|
|
25
|
+
## Steps
|
|
26
|
+
|
|
27
|
+
### 1. Verify readiness
|
|
28
|
+
|
|
29
|
+
Run the precondition checks above. If anything is not green, stop and report.
|
|
30
|
+
|
|
31
|
+
### 2. Squash merge
|
|
32
|
+
|
|
33
|
+
This repo uses squash merges. The merge commit message should summarize the PR.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
gh pr merge <PR_NUMBER> --squash --auto
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Using `--auto` arms auto-merge so GitHub merges when all checks pass. If checks are already green, it merges immediately.
|
|
40
|
+
|
|
41
|
+
### 3. Wait for merge
|
|
42
|
+
|
|
43
|
+
If auto-merge was armed, wait for it:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gh pr view <PR_NUMBER> --json state
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Poll until state is `MERGED`. Timeout after 5 minutes — if not merged by then, report and stop.
|
|
50
|
+
|
|
51
|
+
### 4. Monitor npm publish
|
|
52
|
+
|
|
53
|
+
After merge, the `Build, Test, npm Publish, and Deploy` workflow runs on `main`. Watch it:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
gh run list --repo mermaid-js/zenuml-core --branch main --limit 1 --json databaseId,status,conclusion
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Wait for the run to complete:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
gh run watch <RUN_ID> --repo mermaid-js/zenuml-core
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 5. Verify npm publish
|
|
66
|
+
|
|
67
|
+
Check that the new version appeared on npm:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm view @zenuml/core version
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Compare with the version before merge. If it didn't bump, check the `npm-publish` job logs for errors.
|
|
74
|
+
|
|
75
|
+
## Output
|
|
76
|
+
|
|
77
|
+
Report one of:
|
|
78
|
+
|
|
79
|
+
- **LANDED** — merged, published to npm as `@zenuml/core@<version>`
|
|
80
|
+
- **MERGE BLOCKED** — which precondition failed
|
|
81
|
+
- **PUBLISH FAILED** — merged but npm publish failed, with error details
|
|
82
|
+
|
|
83
|
+
## On publish failure
|
|
84
|
+
|
|
85
|
+
**Do NOT auto-rollback.** A failed npm publish after merge is a serious situation that needs human judgment. Report:
|
|
86
|
+
|
|
87
|
+
1. The merge commit SHA
|
|
88
|
+
2. The failing workflow run URL
|
|
89
|
+
3. The npm-publish job error output
|
|
90
|
+
4. Whether the version was partially published
|
|
91
|
+
|
|
92
|
+
The user decides whether to hotfix, revert, or investigate.
|
|
93
|
+
|
|
94
|
+
## Does NOT
|
|
95
|
+
|
|
96
|
+
- Fix CI (use `/babysit-pr`)
|
|
97
|
+
- Create PRs (use `/submit-branch`)
|
|
98
|
+
- Run local tests (use `/validate-branch`)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ship-branch
|
|
3
|
+
description: Ship the current branch from local validation through to npm release. Orchestrates validate-branch, submit-branch, babysit-pr, and land-pr in sequence. Use when the user says "ship", "ship it", "ship this branch", "ship to production", "release this", "get this to npm", or wants to go from local branch to published npm package in one command. Stops at the first failure with a clear report.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ship Branch
|
|
7
|
+
|
|
8
|
+
Orchestrate the full path from local branch to npm release. This skill composes four sub-skills in sequence, stopping at the first failure.
|
|
9
|
+
|
|
10
|
+
## Flow
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
validate-branch → FAIL → stop, report
|
|
14
|
+
| PASS
|
|
15
|
+
submit-branch → FAIL → stop, report
|
|
16
|
+
| PR ready
|
|
17
|
+
babysit-pr → EXHAUSTED → stop, "CI blocked"
|
|
18
|
+
| GREEN
|
|
19
|
+
land-pr → BLOCKED → stop, report
|
|
20
|
+
| MERGED
|
|
21
|
+
land-pr → PUBLISH FAIL → alert, stop
|
|
22
|
+
| PUBLISHED
|
|
23
|
+
done
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
### Step 1: Validate locally
|
|
29
|
+
|
|
30
|
+
Invoke `/validate-branch`. If it reports FAIL, stop and show the failure. The developer needs to fix locally before shipping.
|
|
31
|
+
|
|
32
|
+
### Step 2: Submit as PR
|
|
33
|
+
|
|
34
|
+
Invoke `/submit-branch`. If it reports FAILED, stop and show what went wrong (dirty worktree, push conflict, etc.).
|
|
35
|
+
|
|
36
|
+
On success, note the PR number and URL.
|
|
37
|
+
|
|
38
|
+
### Step 3: Get CI green
|
|
39
|
+
|
|
40
|
+
Invoke `/babysit-pr` with the PR number from Step 2. If it exhausts all 3 retry attempts, stop and report "CI blocked" with the babysit report.
|
|
41
|
+
|
|
42
|
+
On success, the PR is green and ready to merge.
|
|
43
|
+
|
|
44
|
+
### Step 4: Land and verify release
|
|
45
|
+
|
|
46
|
+
Invoke `/land-pr` with the PR number. If merge is blocked (pending reviews, failed checks), stop and report.
|
|
47
|
+
|
|
48
|
+
If merge succeeds but npm publish fails, alert immediately with the failure details. Do NOT auto-rollback.
|
|
49
|
+
|
|
50
|
+
On full success, report the new npm version.
|
|
51
|
+
|
|
52
|
+
## Rules
|
|
53
|
+
|
|
54
|
+
- **Each step is a hard boundary.** No step reaches back to retry a previous step.
|
|
55
|
+
- **No auto-rollback.** Stop and report on any failure. The developer decides next steps.
|
|
56
|
+
- **Only this skill calls babysit-pr.** Sub-skills never cross-call each other.
|
|
57
|
+
- **Confirm before merge.** Since merge = npm release, pause and confirm with the user before Step 4 unless they explicitly said "ship it" (indicating full automation is intended).
|
|
58
|
+
|
|
59
|
+
## Output
|
|
60
|
+
|
|
61
|
+
Final report:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
## Ship Report: <branch-name>
|
|
65
|
+
- Validation: PASS
|
|
66
|
+
- PR: #<number> (<url>)
|
|
67
|
+
- CI: GREEN (attempt <N>)
|
|
68
|
+
- Merge: SQUASHED into main (<sha>)
|
|
69
|
+
- npm: @zenuml/core@<version> published
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or on failure:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
## Ship Report: <branch-name>
|
|
76
|
+
- Validation: PASS
|
|
77
|
+
- PR: #<number>
|
|
78
|
+
- CI: BLOCKED after 3 attempts
|
|
79
|
+
- Stopped at: babysit-pr
|
|
80
|
+
- Details: <failure summary>
|
|
81
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: submit-branch
|
|
3
|
+
description: Push the current branch and create or reuse a PR on mermaid-js/zenuml-core. Use when the user says "submit", "create PR", "push and PR", "open a pull request", "submit branch", or wants to publish their work as a PR without merging. Does not fix CI or merge — those are separate skills.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Submit Branch
|
|
7
|
+
|
|
8
|
+
Publish the current branch as a pull request on `mermaid-js/zenuml-core`. Reuses an existing PR if one already exists for this branch.
|
|
9
|
+
|
|
10
|
+
## Preconditions
|
|
11
|
+
|
|
12
|
+
The worktree must be in a committable state:
|
|
13
|
+
|
|
14
|
+
- **Clean worktree** — nothing to commit, just push. This is the ideal case.
|
|
15
|
+
- **Scoped changes** — all modified files relate to the current work. Stage and commit them.
|
|
16
|
+
- **Mixed/unrelated changes** — modified files include unrelated work. **Stop and ask the user** which files to include. Never auto-commit a mixed worktree.
|
|
17
|
+
|
|
18
|
+
To check: `git status` and review the file list. If in doubt, ask.
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
|
|
22
|
+
### 1. Check worktree state
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git status
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If dirty, evaluate whether changes are scoped (all related to the branch's purpose) or mixed. If mixed, stop and ask.
|
|
29
|
+
|
|
30
|
+
If scoped, stage the relevant files and commit with a descriptive message. Follow the repo's commit conventions (one-line message, Co-Authored-By trailer).
|
|
31
|
+
|
|
32
|
+
### 2. Push
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git push -u origin <branch-name>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Use regular push — never force-push. If push fails due to upstream changes, report the conflict and stop.
|
|
39
|
+
|
|
40
|
+
### 3. Create or reuse PR
|
|
41
|
+
|
|
42
|
+
Check if a PR already exists:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gh pr view --json number,title,url 2>/dev/null
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If a PR exists, report its URL and stop — nothing more to do.
|
|
49
|
+
|
|
50
|
+
If no PR exists, create one:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
gh pr create --title "<concise title>" --body "$(cat <<'EOF'
|
|
54
|
+
## Summary
|
|
55
|
+
<bullet points>
|
|
56
|
+
|
|
57
|
+
## Test plan
|
|
58
|
+
<what was tested>
|
|
59
|
+
EOF
|
|
60
|
+
)"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The PR targets `main` on `mermaid-js/zenuml-core`.
|
|
64
|
+
|
|
65
|
+
## Output
|
|
66
|
+
|
|
67
|
+
Report:
|
|
68
|
+
|
|
69
|
+
- **SUBMITTED** — PR number, URL, and branch name
|
|
70
|
+
- **FAILED** — what went wrong (dirty worktree, push conflict, gh error)
|
|
71
|
+
|
|
72
|
+
## Does NOT
|
|
73
|
+
|
|
74
|
+
- Run tests or lint (use `/validate-branch` for that)
|
|
75
|
+
- Fix CI failures (use `/babysit-pr` for that)
|
|
76
|
+
- Merge the PR (use `/land-pr` for that)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: validate-branch
|
|
3
|
+
description: Run local validation checks on the current branch before shipping. Use when the user says "validate", "check branch", "am I good", "run tests", "preflight", "is this ready", or wants to verify their branch passes all checks before pushing or creating a PR. Also use as a precondition check before invoking submit-branch or ship-branch.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Validate Branch
|
|
7
|
+
|
|
8
|
+
Verify the current branch passes all local checks. This is the "am I good?" skill — run it anytime before shipping, or just to check your work.
|
|
9
|
+
|
|
10
|
+
## Why this order matters
|
|
11
|
+
|
|
12
|
+
Checks run fastest-first so you get feedback quickly. Lint catches syntax issues in seconds. Unit tests catch logic errors in a few seconds. Playwright E2E is slowest (~1-2 min) and catches integration regressions. No point waiting for E2E if lint fails.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
Run from the `zenuml-core` directory. Stop on first failure.
|
|
17
|
+
|
|
18
|
+
### 1. Lint
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bun eslint
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If lint fails, report the errors and stop. These are usually quick fixes.
|
|
25
|
+
|
|
26
|
+
### 2. Unit tests
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bun run test
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Do NOT use `bun test` — it picks up Playwright files and gives false failures. If tests fail, report the failing test names and stop.
|
|
33
|
+
|
|
34
|
+
### 3. Playwright E2E
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bun pw
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If snapshot tests fail, check whether the changes are intentional (rendering code changed) or unexpected. Report which snapshots failed.
|
|
41
|
+
|
|
42
|
+
## Output
|
|
43
|
+
|
|
44
|
+
Report one of:
|
|
45
|
+
|
|
46
|
+
- **PASS** — all 3 checks passed, branch is ready
|
|
47
|
+
- **FAIL** — which check failed, the error output, and a one-line suggestion
|
|
48
|
+
|
|
49
|
+
## Gotchas
|
|
50
|
+
|
|
51
|
+
- `bun run test` not `bun test` — critical difference, the latter runs E2E too
|
|
52
|
+
- Playwright needs browsers installed (`bun pw:install` if missing)
|
|
53
|
+
- If the dev server is running on port 8080, Playwright may conflict — check first
|
|
54
|
+
- HTML Playwright snapshot failures are a hard stop — never update HTML snapshots without understanding why they changed
|