@zenuml/core 3.36.0 → 3.37.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/AGENTS.md +38 -0
- package/dist/zenuml.esm.mjs +5905 -5902
- package/dist/zenuml.js +459 -459
- package/index.html +3 -2
- package/package.json +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure & Module Organization
|
|
4
|
+
- Source: `src/` (React 19 renderer, TypeScript). Parser grammars in `src/g4`, generated code in `src/generated-parser`, enhancements in `src/parser`.
|
|
5
|
+
- Tests: `tests/*.spec.ts` (+ `*-snapshots/`) and `test/unit/**` (Vitest setup in `test/setup.ts`). Playwright config in `playwright.config.ts`.
|
|
6
|
+
- Site/demo: Vite app (entry via `index.html`, assets in `public/`). Build output in `dist/`.
|
|
7
|
+
- Docs & misc: `docs/`, `.storybook/`, `scripts/`, `antlr/`.
|
|
8
|
+
|
|
9
|
+
## Build, Test, and Development Commands
|
|
10
|
+
- `npx pnpm install`: Install dependencies (first run via `npx`).
|
|
11
|
+
- `pnpm dev`: Start Vite dev server at `http://localhost:8080`.
|
|
12
|
+
- `pnpm build`: Build library bundle (Vite, `vite.config.lib.ts`).
|
|
13
|
+
- `pnpm build:site`: Build demo/site; `pnpm preview` serves it.
|
|
14
|
+
- `pnpm test`: Run unit tests (Vitest).
|
|
15
|
+
- `pnpm pw`, `pnpm pw:ui`, `pnpm pw:smoke`: Playwright e2e tests (CLI, UI, smoke).
|
|
16
|
+
- `pnpm eslint`, `pnpm prettier`: Lint and format code.
|
|
17
|
+
- Cloudflare Worker: `pnpm worker:dev`, `pnpm worker:deploy` (builds site first).
|
|
18
|
+
|
|
19
|
+
## Coding Style & Naming Conventions
|
|
20
|
+
- Language: TypeScript (`strict: true`), React JSX (`react-jsx`). Node >= 20.
|
|
21
|
+
- Indentation: 2 spaces, LF line endings (`.editorconfig`).
|
|
22
|
+
- Linting: ESLint + `@typescript-eslint` + Prettier. Prefer `pnpm eslint` and fix before commit.
|
|
23
|
+
- Files: use `.ts/.tsx`. Tests end with `.spec.ts`. Path alias `@/*` maps to `src/*`.
|
|
24
|
+
|
|
25
|
+
## Testing Guidelines
|
|
26
|
+
- Unit: Vitest + Testing Library; setup in `test/setup.ts` (e.g., IntersectionObserver mock).
|
|
27
|
+
- E2E: Playwright; run `pnpm pw` or debug with `pnpm pw:ui`.
|
|
28
|
+
- Snapshots: present in `*-snapshots/`. Update intentionally: `vitest -u` or `pnpm pw:update`.
|
|
29
|
+
- Place new unit tests near subject in `test/unit/**` or add `.spec.ts` under `tests/` with clear names.
|
|
30
|
+
|
|
31
|
+
## Commit & Pull Request Guidelines
|
|
32
|
+
- Commit style: Conventional Commits (e.g., `feat:`, `fix:`, `refactor:`). Scope optional.
|
|
33
|
+
- PRs: clear description, link issues, include screenshots for UI changes, update docs if behavior changes.
|
|
34
|
+
- Quality gate: run `pnpm eslint`, `pnpm prettier`, `pnpm test`, and relevant Playwright suites; ensure CI passes.
|
|
35
|
+
|
|
36
|
+
## Security & Configuration Tips
|
|
37
|
+
- Avoid injecting raw HTML; use safe utilities (e.g., DOMPurify) where needed.
|
|
38
|
+
- ANTLR: grammars in `src/g4`; regenerate via `pnpm antlr` when grammar changes.
|