@zenuml/core 3.47.8 → 3.48.0
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/dist/cloud-icons-eHuugVSv.js.map +1 -0
- package/dist/zenuml.esm.mjs +2153 -2156
- package/dist/zenuml.esm.mjs.map +1 -0
- package/dist/zenuml.js +82 -82
- package/dist/zenuml.js.map +1 -0
- package/package.json +11 -1
- package/src/cli/zenuml.ts +1164 -0
- package/.agents/skills/babysit-pr/SKILL.md +0 -223
- package/.agents/skills/babysit-pr/agents/openai.yaml +0 -7
- package/.agents/skills/dia-scoring/SKILL.md +0 -139
- package/.agents/skills/dia-scoring/agents/openai.yaml +0 -7
- package/.agents/skills/dia-scoring/references/selectors-and-keys.md +0 -253
- package/.agents/skills/land-pr/SKILL.md +0 -120
- package/.agents/skills/propagate-core-release/SKILL.md +0 -205
- package/.agents/skills/propagate-core-release/agents/openai.yaml +0 -7
- package/.agents/skills/propagate-core-release/references/downstreams.md +0 -42
- package/.agents/skills/ship-branch/SKILL.md +0 -105
- package/.agents/skills/submit-branch/SKILL.md +0 -76
- package/.agents/skills/validate-branch/SKILL.md +0 -72
- package/.claude/commands/README.md +0 -162
- package/.claude/commands/analyze.md +0 -101
- package/.claude/commands/clarify.md +0 -158
- package/.claude/commands/code-review.md +0 -322
- package/.claude/commands/constitution.md +0 -73
- package/.claude/commands/create-docs.md +0 -309
- package/.claude/commands/full-context.md +0 -121
- package/.claude/commands/gemini-consult.md +0 -164
- package/.claude/commands/handoff.md +0 -146
- package/.claude/commands/implement.md +0 -56
- package/.claude/commands/plan.md +0 -43
- package/.claude/commands/refactor.md +0 -188
- package/.claude/commands/specify.md +0 -21
- package/.claude/commands/tasks.md +0 -62
- package/.claude/commands/update-docs.md +0 -314
- package/.claude/hooks/README.md +0 -270
- package/.claude/hooks/config/sensitive-patterns.json +0 -86
- package/.claude/hooks/gemini-context-injector.sh +0 -129
- package/.claude/hooks/mcp-security-scan.sh +0 -147
- package/.claude/hooks/notify.sh +0 -103
- package/.claude/hooks/setup/hook-setup.md +0 -96
- package/.claude/hooks/setup/settings.json.template +0 -63
- package/.claude/hooks/sounds/complete.wav +0 -0
- package/.claude/hooks/sounds/input-needed.wav +0 -0
- package/.claude/hooks/subagent-context-injector.sh +0 -65
- package/.claude/skills/babysit-pr/SKILL.md +0 -223
- package/.claude/skills/babysit-pr/agents/openai.yaml +0 -7
- package/.claude/skills/dia-scoring/SKILL.md +0 -139
- package/.claude/skills/dia-scoring/agents/openai.yaml +0 -7
- package/.claude/skills/dia-scoring/references/selectors-and-keys.md +0 -253
- package/.claude/skills/emoji-eval/SKILL.md +0 -187
- package/.claude/skills/land-pr/SKILL.md +0 -120
- package/.claude/skills/propagate-core-release/SKILL.md +0 -205
- package/.claude/skills/propagate-core-release/agents/openai.yaml +0 -7
- package/.claude/skills/propagate-core-release/references/downstreams.md +0 -42
- package/.claude/skills/ship-branch/SKILL.md +0 -105
- package/.claude/skills/submit-branch/SKILL.md +0 -76
- package/.claude/skills/validate-branch/SKILL.md +0 -72
- package/.claude/skills/zenuml-ux-research/SKILL.md +0 -183
- package/.claude/skills/zenuml-ux-research/references/assertion-catalog.md +0 -261
- package/.claude/skills/zenuml-ux-research/references/best-practices-overview.md +0 -56
- package/.claude/skills/zenuml-ux-research/references/report-template.md +0 -89
- package/.claude/skills/zenuml-ux-research/references/scenarios/edit-message-label.md +0 -37
- package/.claude/skills/zenuml-ux-research/references/scenarios/insert-message.md +0 -36
- package/.claude/skills/zenuml-ux-research/references/scenarios/insert-participant.md +0 -31
- package/.claude/skills/zenuml-ux-research/references/scenarios/rename-participant.md +0 -33
- package/.claude/skills/zenuml-ux-research/references/scenarios/undo-insert.md +0 -35
- package/.devcontainer/devcontainer.json +0 -21
- package/.dockerignore +0 -19
- package/.eslintrc.js +0 -39
- package/.git-blame-ignore-revs +0 -6
- package/.kiro/hooks/README.md +0 -38
- package/.kiro/hooks/session-sound-notification.js +0 -44
- package/.kiro/hooks/session-sound-notification.json +0 -23
- package/.mcp.json.example +0 -17
- package/.nvmrc +0 -1
- package/.prettierignore +0 -4
- package/.prettierrc +0 -1
- package/.specify/memory/constitution.md +0 -33
- package/.specify/scripts/bash/check-prerequisites.sh +0 -166
- package/.specify/scripts/bash/common.sh +0 -113
- package/.specify/scripts/bash/create-new-feature.sh +0 -97
- package/.specify/scripts/bash/setup-plan.sh +0 -60
- package/.specify/scripts/bash/update-agent-context.sh +0 -728
- package/.specify/templates/agent-file-template.md +0 -23
- package/.specify/templates/plan-template.md +0 -219
- package/.specify/templates/spec-template.md +0 -116
- package/.specify/templates/tasks-template.md +0 -127
- package/.storybook/main.ts +0 -25
- package/.storybook/preview.ts +0 -29
- package/.watchmanconfig +0 -3
- package/AGENTS.md +0 -26
- package/CLAUDE.md +0 -124
- package/DEPLOYMENT.md +0 -62
- package/Dockerfile +0 -36
- package/IMPLEMENTATION_PLAN.md +0 -163
- package/Integration/vanilla-js/index.html +0 -42
- package/MCP-ASSISTANT-RULES.md +0 -85
- package/README_CN.md +0 -15
- package/TUTORIAL.md +0 -116
- package/antlr/antlr-4.11.1-complete.jar +0 -0
- package/bun.lock +0 -1544
- package/bunfig.toml +0 -52
- package/docs/UNICODE_SUPPORT.md +0 -179
- package/docs/ai-context/deployment-infrastructure.md +0 -21
- package/docs/ai-context/docs-overview.md +0 -89
- package/docs/ai-context/handoff.md +0 -174
- package/docs/ai-context/project-structure.md +0 -160
- package/docs/ai-context/system-integration.md +0 -21
- package/docs/asciidoc/contributor.adoc +0 -54
- package/docs/asciidoc/create-my-own-theme.adoc +0 -149
- package/docs/asciidoc/images/creation-component.png +0 -0
- package/docs/asciidoc/images/creation-rtl.png +0 -0
- package/docs/asciidoc/images/message-arrow-rtl.png +0 -0
- package/docs/asciidoc/images/occurrence.png +0 -0
- package/docs/asciidoc/images/return-message-conflict.png +0 -0
- package/docs/asciidoc/images/shift-up-half-the-height.png +0 -0
- package/docs/asciidoc/images/three-layer-info-arch.png +0 -0
- package/docs/asciidoc/images/vertical-alignment.svg +0 -1
- package/docs/asciidoc/images/vertically-aligning.png +0 -0
- package/docs/asciidoc/index.adoc +0 -277
- package/docs/asciidoc/theme-debug-web-app.png +0 -0
- package/docs/asciidoc/tutorial.adoc +0 -22
- package/docs/asciidoc/user-css.png +0 -0
- package/docs/async-vs-sync-parser-rules.md +0 -81
- package/docs/divider-parser-allow-spaces.md +0 -38
- package/docs/highlighting-messages.md +0 -52
- package/docs/images/editor-sample.png +0 -0
- package/docs/inherited-vs-provided-from.md +0 -64
- package/docs/parser/Assignment.md +0 -8
- package/docs/parser/PARSER_IMPROVEMENTS_CC.md +0 -425
- package/docs/parser/grammar_review_gemini.md +0 -116
- package/docs/participants-function.md +0 -25
- package/docs/responsive-participant-margin.md +0 -52
- package/docs/starter.md +0 -9
- package/docs/superpowers/plans/2026-03-27-e2e-test-reorg.md +0 -698
- package/docs/superpowers/plans/2026-03-30-emoji-support.md +0 -1220
- package/docs/superpowers/plans/2026-03-30-self-correcting-scoring.md +0 -206
- package/docs/superpowers/plans/2026-04-15-keyboard-editing-on-diagram.md +0 -1992
- package/docs/superpowers/plans/2026-04-15-zenuml-ux-research-skill.md +0 -1452
- package/docs/ux-research/.gitkeep +0 -0
- package/docs/ux-research/2026-04-15-rename-participant.md +0 -156
- package/docs/ux-research/2026-04-18-insert-participant.md +0 -151
- package/docs/width-translate-and-offsets.md +0 -62
- package/docs/xss.md +0 -59
- package/e2e/data/compare-cases.js +0 -1090
- package/e2e/data/diff-algorithm.js +0 -199
- package/e2e/fixtures/create-message.html +0 -26
- package/e2e/fixtures/editable-label.html +0 -35
- package/e2e/fixtures/editable-span.html +0 -122
- package/e2e/fixtures/empty-diagram.html +0 -23
- package/e2e/fixtures/fixture.html +0 -31
- package/e2e/fixtures/insert-participant.html +0 -23
- package/e2e/fixtures/reorder-cross-fragment.html +0 -31
- package/e2e/fixtures/reorder-fragment.html +0 -29
- package/e2e/fixtures/reorder-message.html +0 -27
- package/e2e/fixtures/svg-test.html +0 -21
- package/e2e/fixtures/type-switch.html +0 -29
- package/e2e/tools/canonical-history.html +0 -908
- package/e2e/tools/compare-case.html +0 -371
- package/e2e/tools/compare.html +0 -35
- package/e2e/tools/native-diff-ext/background.js +0 -60
- package/e2e/tools/native-diff-ext/bridge.js +0 -26
- package/e2e/tools/native-diff-ext/content.js +0 -194
- package/e2e/tools/svg-preview.html +0 -56
- package/embed.html +0 -193
- package/eslint.config.mjs +0 -35
- package/firebase-debug.log +0 -108
- package/iframe-container-demo/diagram.html +0 -124
- package/iframe-container-demo/host.html +0 -817
- package/index.html +0 -771
- package/mermaid-zenuml-async-spa-auth.png +0 -0
- package/mermaid-zenuml-async-spa-auth.snapshot.md +0 -96
- package/newsletter/unicode-support-announcement.md +0 -134
- package/playground/creation.html +0 -53
- package/playground/message.html +0 -63
- package/playwright.config.ts +0 -40
- package/renderer.html +0 -366
- package/scripts/analyze-compare-case/collect-data.mjs +0 -1134
- package/scripts/analyze-compare-case/config.mjs +0 -102
- package/scripts/analyze-compare-case/geometry.mjs +0 -101
- package/scripts/analyze-compare-case/native-diff.mjs +0 -224
- package/scripts/analyze-compare-case/output.mjs +0 -74
- package/scripts/analyze-compare-case/panel-diff.mjs +0 -114
- package/scripts/analyze-compare-case/report.mjs +0 -162
- package/scripts/analyze-compare-case/residual-scopes.mjs +0 -347
- package/scripts/analyze-compare-case/scoring.mjs +0 -829
- package/scripts/analyze-compare-case.mjs +0 -149
- package/scripts/bump-version.js +0 -117
- package/scripts/snapshot-dual.js +0 -173
- package/scripts/update-snapshots.js +0 -70
- package/skills/dia-scoring/SKILL.md +0 -129
- package/skills/dia-scoring/agents/openai.yaml +0 -7
- package/skills/dia-scoring/references/selectors-and-keys.md +0 -253
- package/tailwind.config.js +0 -126
- package/test-compression.html +0 -274
- package/test-mermaid-zenuml.html +0 -57
- package/test-setup.ts +0 -124
- package/test-url-params.html +0 -192
- package/tsconfig.app.json +0 -31
- package/tsconfig.node.json +0 -24
- package/tsconfig.test.json +0 -9
- package/vite.config.lib.ts +0 -93
- package/vite.config.ts +0 -84
- package/wrangler.toml +0 -18
package/CLAUDE.md
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Development Commands
|
|
6
|
-
|
|
7
|
-
- **Start development server**: `bun dev` (runs on port 8080)
|
|
8
|
-
- **Build library**: `bun build` (builds library with vite.config.lib.ts)
|
|
9
|
-
- **Build site**: `bun build:site` (builds demo site with vite.config.ts)
|
|
10
|
-
- **Run tests**: `bun run test` (runs Vitest unit tests, excluding E2E). Do NOT use `bun test` — it picks up Playwright E2E files and reports false failures.
|
|
11
|
-
- **Run E2E tests**: `bun pw` (runs Playwright tests)
|
|
12
|
-
- **Run E2E tests (CI)**: `bun pw:ci` (runs with GitHub reporter for CI)
|
|
13
|
-
- **Open Playwright UI**: `bun pw:ui`
|
|
14
|
-
- **Update Playwright snapshots**: `bun pw:update`
|
|
15
|
-
- **Install Playwright browsers**: `bun pw:install`
|
|
16
|
-
- **Run smoke tests**: `bun pw:smoke`
|
|
17
|
-
- **Lint code**: `bun eslint` (runs ESLint with auto-fix)
|
|
18
|
-
- **Format code**: `bun prettier` (runs Prettier)
|
|
19
|
-
- **Generate ANTLR parser**: `bun antlr` (generates JavaScript parser from grammar)
|
|
20
|
-
|
|
21
|
-
## Project Architecture
|
|
22
|
-
|
|
23
|
-
ZenUML is a JavaScript-based diagramming library for creating sequence diagrams from text definitions. The project has two main parts:
|
|
24
|
-
|
|
25
|
-
### 1. DSL Parser (ANTLR-based)
|
|
26
|
-
|
|
27
|
-
- **Grammar files**: `src/g4/` contains ANTLR grammar definitions
|
|
28
|
-
- **Generated parser**: `src/generated-parser/` contains generated JavaScript parser
|
|
29
|
-
- **Parser enhancements**: `src/parser/` contains custom functionality layered on top of ANTLR
|
|
30
|
-
|
|
31
|
-
### 2. React-based Renderer
|
|
32
|
-
|
|
33
|
-
- **Core entry point**: `src/core.tsx` - main library export and ZenUml class
|
|
34
|
-
- **Component structure**: `src/components/` - React components for rendering diagrams
|
|
35
|
-
- **Store management**: `src/store/Store.ts` - Jotai-based state management
|
|
36
|
-
- **Positioning engine**: `src/positioning/` - algorithms for layout and positioning
|
|
37
|
-
|
|
38
|
-
### Key Components Architecture
|
|
39
|
-
|
|
40
|
-
- **DiagramFrame**: Main container component that orchestrates the entire diagram
|
|
41
|
-
- **SeqDiagram**: Core sequence diagram renderer with layers:
|
|
42
|
-
- **LifeLineLayer**: Renders participants and their lifelines
|
|
43
|
-
- **MessageLayer**: Renders messages and interactions between participants
|
|
44
|
-
- **Statement components**: Individual renderers for different UML elements (interactions, fragments, etc.)
|
|
45
|
-
|
|
46
|
-
### Parser Architecture
|
|
47
|
-
|
|
48
|
-
The parser uses a two-stage approach:
|
|
49
|
-
|
|
50
|
-
1. **ANTLR-generated parser**: Converts text to parse tree
|
|
51
|
-
2. **Custom parser layer**: Transforms parse tree into structured data for rendering
|
|
52
|
-
|
|
53
|
-
Key parser modules:
|
|
54
|
-
|
|
55
|
-
- **Participants.ts**: Manages participant detection and ordering
|
|
56
|
-
- **MessageContext.ts**: Handles message parsing and context
|
|
57
|
-
- **FrameBuilder.ts**: Builds the overall diagram structure
|
|
58
|
-
- **Fragment handling**: Support for UML fragments (alt, opt, loop, par, etc.)
|
|
59
|
-
|
|
60
|
-
## Build System
|
|
61
|
-
|
|
62
|
-
The project uses Vite with two configurations:
|
|
63
|
-
|
|
64
|
-
- **vite.config.ts**: Development server and demo site build
|
|
65
|
-
- **vite.config.lib.ts**: Library build (ESM and UMD outputs)
|
|
66
|
-
|
|
67
|
-
Output formats:
|
|
68
|
-
|
|
69
|
-
- **ESM**: `dist/zenuml.esm.mjs` for modern bundlers
|
|
70
|
-
- **UMD**: `dist/zenuml.js` for browser scripts
|
|
71
|
-
|
|
72
|
-
## Testing Strategy
|
|
73
|
-
|
|
74
|
-
- **Unit tests**: Vitest for parser and utility functions
|
|
75
|
-
- **Component tests**: React Testing Library for component logic
|
|
76
|
-
- **E2E tests**: Playwright for full integration testing with visual snapshots
|
|
77
|
-
- **Test files**: Co-located with source files using `.spec.ts` extension
|
|
78
|
-
|
|
79
|
-
## Key Dependencies
|
|
80
|
-
|
|
81
|
-
- **React 19**: UI framework
|
|
82
|
-
- **ANTLR4**: Parser generation
|
|
83
|
-
- **Jotai**: State management
|
|
84
|
-
- **Tailwind CSS**: Styling framework
|
|
85
|
-
- **html-to-image**: PNG export functionality
|
|
86
|
-
- **Vite**: Build tool and development server
|
|
87
|
-
|
|
88
|
-
## Package Management
|
|
89
|
-
|
|
90
|
-
Uses Bun as the package manager and JavaScript runtime. Bun is a fast all-in-one JavaScript runtime that includes a package manager, test runner, and bundler.
|
|
91
|
-
|
|
92
|
-
### Test Configuration
|
|
93
|
-
- **Unit tests with Bun**: `bun test` (alias: `bun run test`) - Runs unit tests in `src/` and `test/unit/` folders (excludes `/tests` E2E folder)
|
|
94
|
-
- **Vitest**: Tests also support Vitest for IDE integration compatibility
|
|
95
|
-
- **E2E tests**: `bun pw` - Runs Playwright tests in `/tests` folder
|
|
96
|
-
- **Test setup**: `test/setup.ts` configures test environment (mocks IntersectionObserver, etc.)
|
|
97
|
-
- Tests use `vi` mocking utilities from Vitest
|
|
98
|
-
- Test files use `.spec.ts` extension and are co-located with source files
|
|
99
|
-
|
|
100
|
-
## Bug Fix Process
|
|
101
|
-
|
|
102
|
-
When starting work on a bug (especially from a GitHub issue):
|
|
103
|
-
|
|
104
|
-
1. **Reproduce first** — write a minimal test case (unit test or Playwright E2E) that demonstrates the bug. The test must fail before any code changes.
|
|
105
|
-
2. **Capture a baseline** — if the bug is visual, take a Playwright snapshot or screenshot of the broken state before fixing. This serves as evidence of what changed.
|
|
106
|
-
3. **Fix the code** — make the minimal change to fix the bug.
|
|
107
|
-
4. **Verify the fix** — the failing test from step 1 must now pass. All other existing tests must still pass.
|
|
108
|
-
|
|
109
|
-
Never skip the reproduction step. If you can't reproduce it, you don't understand the bug well enough to fix it.
|
|
110
|
-
|
|
111
|
-
## No Speculative Codebase Claims
|
|
112
|
-
|
|
113
|
-
**NEVER** claim what the codebase does, uses, or contains without first verifying by reading or grepping the code. Phrases like "if we're currently using X", "since we already have Y", or "the codebase uses Z pattern" are forbidden unless you have Read/Grep/Glob evidence from this conversation.
|
|
114
|
-
|
|
115
|
-
- Before making a claim about codebase state, verify it — use a subagent (Explore) if needed.
|
|
116
|
-
- General programming knowledge is fine. Claims about *this* codebase require evidence.
|
|
117
|
-
|
|
118
|
-
## Development Notes
|
|
119
|
-
|
|
120
|
-
- The project builds both a library and a demo site
|
|
121
|
-
- Parser generation requires Java and ANTLR4
|
|
122
|
-
- E2E tests use visual snapshots for regression testing
|
|
123
|
-
- The library is published as `@zenuml/core` to npm
|
|
124
|
-
- GitHub Pages deployment is automated via GitHub Actions
|
package/DEPLOYMENT.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# ZenUML Web Renderer Deployment
|
|
2
|
-
|
|
3
|
-
This document describes the deployment process for the ZenUML Web Renderer to Cloudflare Pages.
|
|
4
|
-
|
|
5
|
-
## Deployment Strategy
|
|
6
|
-
|
|
7
|
-
- **Production**: Deploys from `main` branch to `zenuml-web-renderer` project
|
|
8
|
-
- **Staging**: Deploys from any non-main branch to `zenuml-web-renderer-staging` project
|
|
9
|
-
|
|
10
|
-
## GitHub Actions Workflow
|
|
11
|
-
|
|
12
|
-
The deployment is automated through GitHub Actions (`.github/workflows/cloudflare-pages.yml`):
|
|
13
|
-
|
|
14
|
-
1. **Triggers**:
|
|
15
|
-
- Push to `main` or `feat/public-renderer` branches
|
|
16
|
-
- Pull requests to `main` branch
|
|
17
|
-
- Only when relevant files are changed (renderer.html, public/**, src/**, etc.)
|
|
18
|
-
|
|
19
|
-
2. **Build Process**:
|
|
20
|
-
- Install dependencies with pnpm
|
|
21
|
-
- Build the site using `pnpm build:site`
|
|
22
|
-
- Deploy to appropriate Cloudflare Pages project
|
|
23
|
-
|
|
24
|
-
## Required Secrets
|
|
25
|
-
|
|
26
|
-
Add these secrets to your GitHub repository settings:
|
|
27
|
-
|
|
28
|
-
- `CLOUDFLARE_API_TOKEN`: Cloudflare API token with Pages permissions
|
|
29
|
-
- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID
|
|
30
|
-
|
|
31
|
-
## Manual Deployment
|
|
32
|
-
|
|
33
|
-
You can also deploy manually using wrangler:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# Deploy to staging
|
|
37
|
-
pnpm pages:deploy:staging
|
|
38
|
-
|
|
39
|
-
# Deploy to production
|
|
40
|
-
pnpm pages:deploy
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Project Structure
|
|
44
|
-
|
|
45
|
-
- `renderer.html`: Main renderer page (root level)
|
|
46
|
-
- `public/renderer.html`: Copy of renderer page for static hosting
|
|
47
|
-
- `dist/`: Build output directory (created by `pnpm build:site`)
|
|
48
|
-
- `wrangler.toml`: Cloudflare configuration
|
|
49
|
-
|
|
50
|
-
## URLs
|
|
51
|
-
|
|
52
|
-
- **Production**: `https://zenuml-web-renderer.pages.dev`
|
|
53
|
-
- **Staging**: `https://zenuml-web-renderer-staging.pages.dev`
|
|
54
|
-
|
|
55
|
-
## Usage
|
|
56
|
-
|
|
57
|
-
Once deployed, you can use the renderer by visiting:
|
|
58
|
-
- `https://your-domain.pages.dev/renderer.html`
|
|
59
|
-
- `https://your-domain.pages.dev/` (if configured as index)
|
|
60
|
-
|
|
61
|
-
Future URL parameter support will allow:
|
|
62
|
-
- `https://your-domain.pages.dev/renderer.html?code=<base64-encoded-zenuml>`
|
package/Dockerfile
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
FROM node:20-slim AS base
|
|
2
|
-
|
|
3
|
-
# Set environment variables for pnpm
|
|
4
|
-
ENV PNPM_HOME="/pnpm"
|
|
5
|
-
ENV PATH="$PNPM_HOME:$PATH"
|
|
6
|
-
ENV DOCKER=true
|
|
7
|
-
|
|
8
|
-
# Enable corepack to use pnpm
|
|
9
|
-
RUN corepack enable
|
|
10
|
-
|
|
11
|
-
# Set the working directory
|
|
12
|
-
WORKDIR /app
|
|
13
|
-
|
|
14
|
-
# Copy the project files to the working directory
|
|
15
|
-
COPY . .
|
|
16
|
-
|
|
17
|
-
RUN pnpm add -g serve
|
|
18
|
-
|
|
19
|
-
FROM base As prod-deps
|
|
20
|
-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts
|
|
21
|
-
FROM base AS deps
|
|
22
|
-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
23
|
-
|
|
24
|
-
FROM base AS build
|
|
25
|
-
COPY --from=deps /app/node_modules /app/node_modules
|
|
26
|
-
RUN pnpm build:site
|
|
27
|
-
|
|
28
|
-
FROM base
|
|
29
|
-
COPY --from=prod-deps /app/node_modules /app/node_modules
|
|
30
|
-
COPY --from=build /app/dist /app/dist
|
|
31
|
-
|
|
32
|
-
# Expose the port the app runs on
|
|
33
|
-
EXPOSE 8080
|
|
34
|
-
|
|
35
|
-
# Command to run the application
|
|
36
|
-
CMD ["serve", "-s", "dist", "-l", "8080"]
|
package/IMPLEMENTATION_PLAN.md
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
# Implementation Plan: Named Parameters Support
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
Add support for named parameters in method calls, allowing syntax like `A.method(param=value)` alongside existing positional parameters.
|
|
5
|
-
|
|
6
|
-
## Current State Analysis
|
|
7
|
-
|
|
8
|
-
### Grammar Structure
|
|
9
|
-
- **Parser**: `src/g4/sequenceParser.g4` defines parameter rules at lines 220-230
|
|
10
|
-
- **Current parameter rule**: `parameter: declaration | expr`
|
|
11
|
-
- **Parameters rule**: `parameters: parameter (COMMA parameter)* COMMA?`
|
|
12
|
-
- **Invocation**: Method calls use `invocation: OPAR parameters? CPAR`
|
|
13
|
-
|
|
14
|
-
### Parser Logic
|
|
15
|
-
- **SignatureText.ts**: Handles parameter display via `getFormattedText()`
|
|
16
|
-
- **Parser.types.ts**: Defines `Parameter` and `Parameters` interfaces
|
|
17
|
-
- **Current behavior**: Parameters are parsed as expressions or type declarations
|
|
18
|
-
|
|
19
|
-
## Implementation Stages
|
|
20
|
-
|
|
21
|
-
### Stage 1: Grammar Extension
|
|
22
|
-
**Goal**: Extend ANTLR grammar to support named parameter syntax
|
|
23
|
-
**Success Criteria**:
|
|
24
|
-
- Grammar accepts `param=value` syntax
|
|
25
|
-
- Backward compatibility with existing positional syntax
|
|
26
|
-
- Parser generates successfully
|
|
27
|
-
|
|
28
|
-
**Tasks**:
|
|
29
|
-
- [x] Add `namedParameter` rule: `ID ASSIGN expr`
|
|
30
|
-
- [x] Update `parameter` rule to include `namedParameter | declaration | expr`
|
|
31
|
-
- [x] Add tests for grammar parsing
|
|
32
|
-
- [x] Regenerate parser with `pnpm antlr`
|
|
33
|
-
|
|
34
|
-
**Tests**:
|
|
35
|
-
- [x] `A.method(x=1, y=2)` parses correctly
|
|
36
|
-
- [x] `A.method(1, name="test")` mixed parameters work
|
|
37
|
-
- [x] Existing `A.method(1, 2)` still works
|
|
38
|
-
|
|
39
|
-
**Status**: Complete
|
|
40
|
-
|
|
41
|
-
### Stage 2: Parser Type Extensions
|
|
42
|
-
**Goal**: Extend parser types and interfaces to handle named parameters
|
|
43
|
-
**Success Criteria**:
|
|
44
|
-
- Named parameter data accessible in parser contexts
|
|
45
|
-
- Type definitions support both named and positional parameters
|
|
46
|
-
|
|
47
|
-
**Tasks**:
|
|
48
|
-
- [x] Extend `Parameter` interface to distinguish parameter types
|
|
49
|
-
- [x] Add `NamedParameter` interface with name and value properties
|
|
50
|
-
- [x] Update `SignatureText.ts` to handle named parameter formatting
|
|
51
|
-
- [x] Update type assertions and context handling
|
|
52
|
-
|
|
53
|
-
**Tests**:
|
|
54
|
-
- [x] Named parameters accessible via parser API
|
|
55
|
-
- [x] `getFormattedText()` displays named parameters correctly
|
|
56
|
-
- [x] Type safety maintained
|
|
57
|
-
|
|
58
|
-
**Status**: Complete
|
|
59
|
-
|
|
60
|
-
### Stage 3: Rendering Support
|
|
61
|
-
**Goal**: Update React components to render named parameters appropriately
|
|
62
|
-
**Success Criteria**:
|
|
63
|
-
- Named parameters displayed in sequence diagrams
|
|
64
|
-
- Clear visual distinction between parameter types
|
|
65
|
-
- Consistent formatting with existing design
|
|
66
|
-
|
|
67
|
-
**Tasks**:
|
|
68
|
-
- [x] Update message rendering components (via SignatureText.ts)
|
|
69
|
-
- [x] Enhance parameter display logic (formatParameters helper)
|
|
70
|
-
- [x] Ensure consistent formatting with existing design
|
|
71
|
-
- [x] Test rendering in development environment
|
|
72
|
-
|
|
73
|
-
**Tests**:
|
|
74
|
-
- [x] Named parameters render correctly: `method(userId=123,name="John")`
|
|
75
|
-
- [x] Mixed parameters work: `method(123,name="John",active=true)`
|
|
76
|
-
- [x] Backward compatibility maintained: `oldMethod(1,2,3)`
|
|
77
|
-
- [x] Complex scenarios: `mixedCall("first",second=456,"third")`
|
|
78
|
-
|
|
79
|
-
**Status**: Complete
|
|
80
|
-
|
|
81
|
-
### Stage 4: Test Coverage & Integration
|
|
82
|
-
**Goal**: Comprehensive testing and integration with existing features
|
|
83
|
-
**Success Criteria**:
|
|
84
|
-
- Full test coverage for named parameter scenarios
|
|
85
|
-
- E2E tests validate end-to-end functionality
|
|
86
|
-
- No regressions in existing functionality
|
|
87
|
-
|
|
88
|
-
**Tasks**:
|
|
89
|
-
- [ ] Unit tests for parser logic
|
|
90
|
-
- [ ] Component tests for rendering
|
|
91
|
-
- [ ] E2E tests with Playwright
|
|
92
|
-
- [ ] Performance regression testing
|
|
93
|
-
- [ ] Documentation updates
|
|
94
|
-
|
|
95
|
-
**Tests**:
|
|
96
|
-
- All test suites pass
|
|
97
|
-
- Performance benchmarks maintained
|
|
98
|
-
- Edge cases handled properly
|
|
99
|
-
|
|
100
|
-
**Status**: Not Started
|
|
101
|
-
|
|
102
|
-
### Stage 5: Documentation & Examples
|
|
103
|
-
**Goal**: User-facing documentation and examples
|
|
104
|
-
**Success Criteria**:
|
|
105
|
-
- Clear documentation of named parameter syntax
|
|
106
|
-
- Working examples in demo site
|
|
107
|
-
- Migration guidance for users
|
|
108
|
-
|
|
109
|
-
**Tasks**:
|
|
110
|
-
- [ ] Update grammar documentation
|
|
111
|
-
- [ ] Add examples to demo site
|
|
112
|
-
- [ ] Update README with new syntax
|
|
113
|
-
- [ ] API documentation updates
|
|
114
|
-
|
|
115
|
-
**Tests**:
|
|
116
|
-
- Documentation examples work correctly
|
|
117
|
-
- Demo site renders named parameter examples
|
|
118
|
-
- No broken links or outdated information
|
|
119
|
-
|
|
120
|
-
**Status**: Not Started
|
|
121
|
-
|
|
122
|
-
## Technical Considerations
|
|
123
|
-
|
|
124
|
-
### Backward Compatibility
|
|
125
|
-
- Existing positional parameter syntax must continue working
|
|
126
|
-
- Mixed parameter styles (positional + named) should be supported
|
|
127
|
-
- No breaking changes to existing APIs
|
|
128
|
-
|
|
129
|
-
### Performance Impact
|
|
130
|
-
- Minimal impact on parser performance
|
|
131
|
-
- Named parameter detection should be efficient
|
|
132
|
-
- Memory usage considerations for parameter storage
|
|
133
|
-
|
|
134
|
-
### Edge Cases
|
|
135
|
-
- Parameter name validation and uniqueness
|
|
136
|
-
- Error handling for invalid syntax
|
|
137
|
-
- Interaction with existing features (fragments, loops, etc.)
|
|
138
|
-
|
|
139
|
-
### Dependencies
|
|
140
|
-
- ANTLR4 parser regeneration
|
|
141
|
-
- No new external dependencies required
|
|
142
|
-
- Maintain compatibility with existing build system
|
|
143
|
-
|
|
144
|
-
## Risk Assessment
|
|
145
|
-
|
|
146
|
-
**Low Risk**:
|
|
147
|
-
- Grammar extension is straightforward
|
|
148
|
-
- Existing infrastructure supports parameter handling
|
|
149
|
-
|
|
150
|
-
**Medium Risk**:
|
|
151
|
-
- Rendering changes may require careful CSS updates
|
|
152
|
-
- Type system changes need thorough testing
|
|
153
|
-
|
|
154
|
-
**High Risk**:
|
|
155
|
-
- Parser performance impact needs monitoring
|
|
156
|
-
- Complex interaction with expression parsing
|
|
157
|
-
|
|
158
|
-
## Success Metrics
|
|
159
|
-
- [ ] All existing tests pass
|
|
160
|
-
- [ ] New functionality covered by tests
|
|
161
|
-
- [ ] No performance degradation
|
|
162
|
-
- [ ] Documentation complete
|
|
163
|
-
- [ ] Community feedback positive
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<title>Integration ZenUML Library with Vanilla JavaScript</title>
|
|
6
|
-
<script>
|
|
7
|
-
window.process = { env: "production" };
|
|
8
|
-
</script>
|
|
9
|
-
<script src="https://www.unpkg.com/@zenuml/core/dist/zenuml.js"></script>
|
|
10
|
-
</head>
|
|
11
|
-
<body class="zenuml">
|
|
12
|
-
<div id="app"></div>
|
|
13
|
-
<script>
|
|
14
|
-
const ZenUml = window["zenuml"].default;
|
|
15
|
-
const zenuml = new ZenUml(document.getElementById("app"));
|
|
16
|
-
const code = `
|
|
17
|
-
A B C D
|
|
18
|
-
|
|
19
|
-
A->B.method() {
|
|
20
|
-
ret0_assign_rtl =C.method_long_to_give_space {
|
|
21
|
-
@return C->D: ret1_annotation_ltr
|
|
22
|
-
ret5_assign_ltr = B.method
|
|
23
|
-
if(x) {
|
|
24
|
-
ret0_assign_rtl =C.method_long_to_give_space {
|
|
25
|
-
@return C->D: ret1_annotation_ltr
|
|
26
|
-
ret5_assign_ltr = B.method
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
B.method2 {
|
|
30
|
-
return ret2_return_ltr
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return ret2_return_rtl
|
|
35
|
-
@return B->A: ret4_annotation_rtl
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`;
|
|
39
|
-
zenuml.render(code, { theme: "theme-blue" });
|
|
40
|
-
</script>
|
|
41
|
-
</body>
|
|
42
|
-
</html>
|
package/MCP-ASSISTANT-RULES.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# MCP Assistant Rules - [Project Name]
|
|
2
|
-
|
|
3
|
-
## Project Context
|
|
4
|
-
[Brief description of what your project does and its main purpose. Keep it concise - 2-3 sentences max.]
|
|
5
|
-
|
|
6
|
-
### Core Vision & Architecture
|
|
7
|
-
- **Product Goal**: [Primary goal of your product]
|
|
8
|
-
- **Target Platform**: [Primary platform(s) - web, mobile, desktop, etc.]
|
|
9
|
-
- **Architecture**: [High-level architecture overview]
|
|
10
|
-
- **Key Technologies**: [Main technologies/frameworks used]
|
|
11
|
-
|
|
12
|
-
### Key Technical Principles
|
|
13
|
-
[List 4-6 core technical principles that guide your project]
|
|
14
|
-
- **Example**: Session-based architecture with clear boundaries
|
|
15
|
-
- **Example**: API-first design with versioning from day one
|
|
16
|
-
- **Example**: Security by default - validate all inputs at boundaries
|
|
17
|
-
- **Example**: Observable systems with structured logging
|
|
18
|
-
|
|
19
|
-
**Note:** The complete project structure and technology stack are provided in the attached `project-structure.md` file.
|
|
20
|
-
|
|
21
|
-
## Key Project Standards
|
|
22
|
-
|
|
23
|
-
### Core Principles
|
|
24
|
-
[List your fundamental development principles]
|
|
25
|
-
- Follow KISS, YAGNI, and DRY - prefer proven solutions over custom implementations
|
|
26
|
-
- Never mock, use placeholders, or omit code - always implement fully
|
|
27
|
-
- Be brutally honest about whether an idea is good or bad
|
|
28
|
-
- [Add project-specific principles]
|
|
29
|
-
|
|
30
|
-
### Code Organization
|
|
31
|
-
[Define your code organization standards]
|
|
32
|
-
- Keep files under [X] lines - split by extracting utilities, constants, types
|
|
33
|
-
- Single responsibility per file with clear purpose
|
|
34
|
-
- Prefer composition over inheritance
|
|
35
|
-
- [Add language/framework specific organization rules]
|
|
36
|
-
|
|
37
|
-
### [Language] Standards
|
|
38
|
-
[Replace with your primary language and its standards]
|
|
39
|
-
- Type safety requirements
|
|
40
|
-
- Naming conventions (classes, functions, constants)
|
|
41
|
-
- Documentation requirements (docstring style, required elements)
|
|
42
|
-
- Error handling patterns
|
|
43
|
-
|
|
44
|
-
### Error Handling & Logging
|
|
45
|
-
- Use specific exceptions with helpful messages
|
|
46
|
-
- Structured logging only - define your logging approach
|
|
47
|
-
- [Specify logging categories or patterns]
|
|
48
|
-
- Every request needs correlation ID for tracing
|
|
49
|
-
|
|
50
|
-
### API Design
|
|
51
|
-
[If applicable - define API standards]
|
|
52
|
-
- RESTful with consistent URL patterns
|
|
53
|
-
- Version from day one (/v1/, /v2/)
|
|
54
|
-
- Consistent response format
|
|
55
|
-
- Proper HTTP status codes
|
|
56
|
-
|
|
57
|
-
### Security & State
|
|
58
|
-
- Never trust external inputs - validate at boundaries
|
|
59
|
-
- [Define session/state management approach]
|
|
60
|
-
- [Specify data retention policies]
|
|
61
|
-
- Keep secrets in environment variables only
|
|
62
|
-
|
|
63
|
-
## Project-Specific Guidelines
|
|
64
|
-
[Add any project-specific guidelines that AI assistants should know]
|
|
65
|
-
|
|
66
|
-
### Domain-Specific Rules
|
|
67
|
-
[Add rules specific to your problem domain]
|
|
68
|
-
|
|
69
|
-
### Integration Points
|
|
70
|
-
[List key integration points or external services]
|
|
71
|
-
|
|
72
|
-
### Performance Considerations
|
|
73
|
-
[Add any performance-critical aspects]
|
|
74
|
-
|
|
75
|
-
## Important Constraints
|
|
76
|
-
- You cannot create, modify, or execute code
|
|
77
|
-
- You operate in a read-only support capacity
|
|
78
|
-
- Your suggestions are for the primary AI (Claude Code) to implement
|
|
79
|
-
- Focus on analysis, understanding, and advisory support
|
|
80
|
-
|
|
81
|
-
## Quick Reference
|
|
82
|
-
[Add frequently needed information]
|
|
83
|
-
- Key commands: [List common commands]
|
|
84
|
-
- Important paths: [List critical file paths]
|
|
85
|
-
- Documentation links: [Add links to detailed docs]
|
package/README_CN.md
DELETED
package/TUTORIAL.md
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# ZenUML Integration Tutorial
|
|
3
|
-
|
|
4
|
-
This tutorial provides a comprehensive guide on how to integrate ZenUML into your applications. There are two primary methods for integration: as a library or as an embedded iframe.
|
|
5
|
-
|
|
6
|
-
## 1. As a Library
|
|
7
|
-
|
|
8
|
-
This is the most flexible method, allowing for deep integration with your application.
|
|
9
|
-
|
|
10
|
-
### Installation
|
|
11
|
-
|
|
12
|
-
First, add the `@zenuml/core` package to your project:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install @zenuml/core
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
or
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
bun add @zenuml/core
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Usage
|
|
25
|
-
|
|
26
|
-
The main entry point of the library is the `ZenUml` class. Here's a basic example of how to use it:
|
|
27
|
-
|
|
28
|
-
```javascript
|
|
29
|
-
import ZenUml from '@zenuml/core';
|
|
30
|
-
|
|
31
|
-
// 1. Get the container element
|
|
32
|
-
const el = document.getElementById('zenuml-container');
|
|
33
|
-
|
|
34
|
-
// 2. Create a new instance of ZenUml
|
|
35
|
-
const zenUml = new ZenUml(el);
|
|
36
|
-
|
|
37
|
-
// 3. Render a diagram
|
|
38
|
-
const code = 'A->B: message';
|
|
39
|
-
const config = {
|
|
40
|
-
theme: 'default',
|
|
41
|
-
};
|
|
42
|
-
zenUml.render(code, config);
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Configuration
|
|
46
|
-
|
|
47
|
-
The `render` method accepts a configuration object with the following properties:
|
|
48
|
-
|
|
49
|
-
- `theme`: The name of the theme to use. A list of available themes can be found in the documentation.
|
|
50
|
-
- `enableScopedTheming`: A boolean that indicates whether to scope the theme to the container element. This is useful when you have multiple diagrams on the same page with different themes.
|
|
51
|
-
- `onThemeChange`: A callback function that is called when the theme is changed.
|
|
52
|
-
- `enableMultiTheme`: A boolean that indicates whether to enable multi-theme support.
|
|
53
|
-
- `stickyOffset`: A number that indicates the offset for the sticky header.
|
|
54
|
-
- `onContentChange`: A callback function that is called when the content of the diagram is changed.
|
|
55
|
-
- `onEventEmit`: A callback function that is called when an event is emitted from the diagram.
|
|
56
|
-
- `mode`: The rendering mode. Can be `RenderMode.Dynamic` or `RenderMode.Static`.
|
|
57
|
-
|
|
58
|
-
### Example
|
|
59
|
-
|
|
60
|
-
Here's a more advanced example that uses some of the configuration options:
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
import ZenUml from '@zenuml/core';
|
|
64
|
-
|
|
65
|
-
const el = document.getElementById('zenuml-container');
|
|
66
|
-
const zenUml = new ZenUml(el);
|
|
67
|
-
|
|
68
|
-
const code = `
|
|
69
|
-
// This is a comment
|
|
70
|
-
A->B: synchronous message
|
|
71
|
-
B-->A: asynchronous message
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
const config = {
|
|
75
|
-
theme: 'blue',
|
|
76
|
-
enableScopedTheming: true,
|
|
77
|
-
onContentChange: (newCode) => {
|
|
78
|
-
console.log('Diagram code changed:', newCode);
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
zenUml.render(code, config);
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Exporting Diagrams
|
|
86
|
-
|
|
87
|
-
You can export diagrams to PNG and SVG formats. The `ZenUml` class provides the following methods for exporting:
|
|
88
|
-
|
|
89
|
-
- `getPng()`: Returns a promise that resolves to a PNG data URL.
|
|
90
|
-
- `getSvg()`: Returns a promise that resolves to an SVG data URL.
|
|
91
|
-
|
|
92
|
-
Here's an example of how to use these methods:
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
import ZenUml from '@zenuml/core';
|
|
96
|
-
|
|
97
|
-
const el = document.getElementById('zenuml-container');
|
|
98
|
-
const zenUml = new ZenUml(el);
|
|
99
|
-
|
|
100
|
-
const code = 'A->B: message';
|
|
101
|
-
|
|
102
|
-
async function exportDiagram() {
|
|
103
|
-
await zenUml.render(code, { theme: 'default' });
|
|
104
|
-
const png = await zenUml.getPng();
|
|
105
|
-
// Do something with the PNG data URL
|
|
106
|
-
console.log(png);
|
|
107
|
-
|
|
108
|
-
const svg = await zenUml.getSvg();
|
|
109
|
-
// Do something with the SVG data URL
|
|
110
|
-
console.log(svg);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
exportDiagram();
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
This tutorial should provide you with a solid foundation for integrating ZenUML into your applications. For more detailed information, please refer to the official documentation.
|
|
Binary file
|