diff --git a/.claude/skills/upgrade-packages/SKILL.md b/.claude/skills/upgrade-packages/SKILL.md index ff83f30..15eb40c 100644 --- a/.claude/skills/upgrade-packages/SKILL.md +++ b/.claude/skills/upgrade-packages/SKILL.md @@ -10,7 +10,7 @@ argument-hint: "[--check-only] [--major] [package-name]" Upgrade all project dependencies to their latest compatible (or latest major, if `--major`) versions. -This repo is a TypeScript/Node monorepo with `package.json` + `package-lock.json` at the root managing the `packages/typediagram`, `packages/cli`, `packages/vscode`, and `packages/web` workspaces. The package manager is **npm**. +This repo is a TypeScript/Node monorepo with `package.json` + `package-lock.json` at the root managing the `src/typediagram`, `src/cli`, `src/vscode`, and `src/web` workspaces. The package manager is **npm**. ## Arguments @@ -23,7 +23,7 @@ This repo is a TypeScript/Node monorepo with `package.json` + `package-lock.json Confirm the expected manifests exist. For this repo: - Root: `package.json`, `package-lock.json` -- Workspaces: `packages/*/package.json` +- Workspaces: `src/*/package.json` If any of these are missing or the lockfile type has changed (e.g. a `yarn.lock` or `pnpm-lock.yaml` has appeared), STOP and tell the user before proceeding — the commands below assume npm. @@ -38,10 +38,10 @@ npm outdated Also check each workspace individually if the root output groups them together confusingly: ```bash -npm outdated --workspace=packages/typediagram -npm outdated --workspace=packages/cli -npm outdated --workspace=packages/vscode -npm outdated --workspace=packages/web +npm outdated --workspace=src/typediagram +npm outdated --workspace=src/cli +npm outdated --workspace=src/vscode +npm outdated --workspace=src/web ``` **Read the docs:** https://docs.npmjs.com/cli/v10/commands/npm-update diff --git a/.claude/skills/website-audit/SKILL.md b/.claude/skills/website-audit/SKILL.md index e57b850..47d1ee8 100644 --- a/.claude/skills/website-audit/SKILL.md +++ b/.claude/skills/website-audit/SKILL.md @@ -51,7 +51,7 @@ If the repo has a business plan doc, take it into account Identify the website source files in the repo. Determine the framework (static site generator, Next.js, Hugo, etc.) so you know where to find templates, metadata, and content. -For typeDiagram: the website lives in `packages/web/` and is built with Eleventy (11ty). Edit templates/content in that package — never the generated output under `packages/web/.eleventy-out/`. +For typeDiagram: the website lives in `src/web/` and is built with Eleventy (11ty). Edit templates/content in that package — never the generated output under `src/web/.eleventy-out/`. ## Step 2 — Audit AI search readiness @@ -146,7 +146,7 @@ Read the design system docs and view the design screens in the designsystem fold ## Step 11 — Test with Playwright -Build and run the website locally using the project's dev server command (e.g. `npm run -w packages/web dev`). +Build and run the website locally using the project's dev server command (e.g. `npm run -w src/web dev`). **Desktop tests (1280x720):** diff --git a/.deslop.toml b/.deslop.toml index fb01188..61d2837 100644 --- a/.deslop.toml +++ b/.deslop.toml @@ -11,8 +11,8 @@ # source, and never authored tests. node_modules/target/build are already # default-excluded; dist + coverage are this repo's generated-output dirs. # The `generated_*/mod.rs` fixtures are codegen output of -# `packages/typediagram/src/converters/rust-tdbin.ts` (regenerated via -# `scripts/tdbin-regen-fixtures.mjs`, pinned by rust-tdbin-corpus.test.ts). Their +# `src/typediagram/src/converters/rust-tdbin.ts` (regenerated via +# `src/scripts/tdbin/tdbin-regen-fixtures.mjs`, pinned by rust-tdbin-corpus.test.ts). Their # structural repetition is emitted by the generator, not hand-written, so it is not # authored duplication and does not belong in the budget — the fix for any real # repetition there is in the generator, gated by the codegen pin test. diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/SECURITY.md b/.github/SECURITY.md similarity index 100% rename from SECURITY.md rename to .github/SECURITY.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6919307..d7c6f02 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -33,7 +33,7 @@ updates: github-actions: patterns: ["*"] - # npm / Node — package.json (root workspaces + packages/*) + # npm / Node — package.json (root workspaces + src/*) - package-ecosystem: npm directory: / target-branch: "dependabot-upgrades" @@ -49,10 +49,9 @@ updates: applies-to: security-updates patterns: ["*"] - # Cargo / Rust — the incoming Rust workspace (crates/*). Active once a crate with - # dependencies lands; harmless before then. + # Cargo / Rust — the Rust workspace rooted at src/Cargo.toml. - package-ecosystem: cargo - directory: / + directory: /src target-branch: "dependabot-upgrades" schedule: interval: weekly diff --git a/schemas/shipwright.schema.json b/.github/schemas/shipwright.schema.json similarity index 100% rename from schemas/shipwright.schema.json rename to .github/schemas/shipwright.schema.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dffcd59..e26cd80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: # lightweight build + lint + web-unit check instead. The single `CI` job # always runs and reports, so it stays valid as a required status check # (path filters that skip the job would leave it pending forever). - # "Web scope" = every changed path is under packages/web/, docs/, or is a + # "Web scope" = every changed path is under src/web/, docs/, or is a # *.md file; anything else (framework/cli/vscode src, Makefile, configs, # workflows) forces the full pipeline. - name: Detect change scope @@ -50,7 +50,7 @@ jobs: BASE_SHA: ${{ github.event.pull_request.base.sha }} HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | - ALLOW='(^packages/web/)|(^docs/)|(\.md$)' + ALLOW='(^src/web/)|(^docs/)|(\.md$)' CHANGED="$(git diff --name-only "$BASE_SHA...$HEAD_SHA")" echo "Changed files:" echo "$CHANGED" @@ -75,7 +75,7 @@ jobs: - name: Install dependencies run: npm ci - # [CI-RUST-TOOLCHAIN] The Makefile wires the Rust `crates/` workspace into + # [CI-RUST-TOOLCHAIN] The Makefile wires the Rust `src/` workspace into # make test/lint/fmt (cargo test --workspace, cargo clippy -D warnings, # cargo fmt --check). Both CI scopes reach cargo: full scope via `make ci`, # web scope via `make lint` + `make _fmt_check`. Install/pin stable with the @@ -110,7 +110,7 @@ jobs: npm run -w @typediagram/web build # ───────────────────────── Full scope ─────────────────────────── - # Playwright needs chromium for the packages/web E2E tests. --with-deps + # Playwright needs chromium for the src/web E2E tests. --with-deps # ensures required OS libraries are present on ubuntu-latest. - name: Install Playwright browsers if: steps.scope.outputs.scope == 'full' @@ -137,10 +137,10 @@ jobs: - name: Shipwright acceptance gates if: steps.scope.outputs.scope == 'full' run: | - npx --yes @nimblesite/shipwright-validate-manifest@0.9.0 --schema schemas/shipwright.schema.json shipwright.json + npx --yes @nimblesite/shipwright-validate-manifest@0.9.0 --schema .github/schemas/shipwright.schema.json shipwright.json npm run -w typediagram build - node packages/cli/dist/bin.js --version - node packages/cli/dist/bin.js --version --json + node src/cli/dist/bin.js --version + node src/cli/dist/bin.js --version --json - name: Upload coverage uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 @@ -149,5 +149,5 @@ jobs: name: coverage-report path: | coverage/ - packages/*/coverage/ + src/*/coverage/ retention-days: 7 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1913cde..8f5cd7c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,8 +10,8 @@ name: CodeQL # Never add security-rule linter plugins that re-cover CodeQL: no doubling up. # # Matrix = (languages in this repo) ∩ (CodeQL-supported at skill-run time): -# javascript-typescript — the packages/* monorepo (core, cli, web, vscode) -# rust — the incoming crates/* workspace (build-mode: none) +# javascript-typescript — the src/* monorepo (core, cli, web, vscode) +# rust — the src/Cargo.toml workspace (build-mode: none) # actions — always, scans the workflow files themselves # Action SHAs are kept current by the github-actions Dependabot group. on: diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 6d38c8f..599de08 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: - path: packages/web/dist + path: src/web/dist deploy: needs: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 700460d..553f497 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release # [SWR-REL-WORKFLOW] Tag-triggered only. Builds the EXACT tagged SHA; the version is -# stamped in the runner working tree by scripts/stamp-version.mjs and never committed +# stamped in the runner working tree by src/scripts/stamp-version.mjs and never committed # or pushed back ([SWR-VERSION-BUILD-STAMPING]). Deploy the website manually via # deploy-pages.yml after a green Release. on: @@ -68,9 +68,9 @@ jobs: echo "npm_tag=$NPM_TAG" >> "$GITHUB_OUTPUT" # [SWR-VERSION-BUILD-STAMPING] First-class stamper — covered by - # packages/cli/test/stamp-version.e2e.test.ts. Runner working tree only. + # src/cli/test/stamp-version.e2e.test.ts. Runner working tree only. - name: Stamp version in all carriers - run: node scripts/stamp-version.mjs --version "${{ steps.derive.outputs.version }}" + run: node src/scripts/stamp-version.mjs --version "${{ steps.derive.outputs.version }}" - run: npm install --package-lock-only @@ -91,11 +91,11 @@ jobs: # [SWR-GATE-CI] [SWR-GATE-VERIFY-BINARIES] manifest + version contract gates. - name: Shipwright acceptance gates run: | - npx --yes @nimblesite/shipwright-validate-manifest@0.9.0 --schema schemas/shipwright.schema.json shipwright.json + npx --yes @nimblesite/shipwright-validate-manifest@0.9.0 --schema .github/schemas/shipwright.schema.json shipwright.json V="${{ steps.derive.outputs.version }}" - OUT="$(node packages/cli/dist/bin.js --version)" + OUT="$(node src/cli/dist/bin.js --version)" test "$OUT" = "typediagram $V" - node packages/cli/dist/bin.js --version --json + node src/cli/dist/bin.js --version --json # Idempotent publishes: a re-run of a partially-failed release is safe ([SWR-REL-WORKFLOW]). - name: Publish typediagram-core @@ -104,7 +104,7 @@ jobs: if [ -n "$(npm view "typediagram-core@$V" version 2>/dev/null || true)" ]; then echo "typediagram-core@$V already published — skipping" else - npm publish --workspace=packages/typediagram --tag ${{ steps.derive.outputs.npm_tag }} --provenance --access public + npm publish --workspace=src/typediagram --tag ${{ steps.derive.outputs.npm_tag }} --provenance --access public fi - name: Publish typediagram CLI @@ -113,7 +113,21 @@ jobs: if [ -n "$(npm view "typediagram@$V" version 2>/dev/null || true)" ]; then echo "typediagram@$V already published — skipping" else - npm publish --workspace=packages/cli --tag ${{ steps.derive.outputs.npm_tag }} --provenance --access public + npm publish --workspace=src/cli --tag ${{ steps.derive.outputs.npm_tag }} --provenance --access public + fi + + # [TDBIN-RS-PUBLISH] the Rust runtime that `typediagram encode` output + # depends on. Version comes from the stamped [workspace.package]; idempotent + # like the npm steps. Requires the CARGO_REGISTRY_TOKEN repo secret. + - name: Publish tdbin crate + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + V="${{ steps.derive.outputs.version }}" + if curl -fsS -A "typediagram-release" "https://crates.io/api/v1/src/tdbin/$V" >/dev/null 2>&1; then + echo "tdbin@$V already published — skipping" + else + cargo publish --manifest-path src/Cargo.toml -p tdbin --allow-dirty fi - name: Package VSIX @@ -133,8 +147,8 @@ jobs: - name: Pack npm tarballs for release assets run: | - npm pack --workspace=packages/typediagram --pack-destination=. - npm pack --workspace=packages/cli --pack-destination=. + npm pack --workspace=src/typediagram --pack-destination=. + npm pack --workspace=src/cli --pack-destination=. # [SWR-SEC-CHECKSUM] One SHA256SUMS over all release assets. - name: Generate SHA256SUMS diff --git a/.gitignore b/.gitignore index 170ad4f..a2f62e6 100644 --- a/.gitignore +++ b/.gitignore @@ -72,16 +72,16 @@ build/ # ============================================================================= # REPO-SPECIFIC # ============================================================================= -packages/typediagram/logs/ +src/typediagram/logs/ .ruff_cache/ -packages/web/.eleventy-out/ -packages/web/.typedoc-out/ +src/web/.eleventy-out/ +src/web/.typedoc-out/ # Repo-root screenshot PNGs (kept for README but not accidentally re-added elsewhere) /*.png dist-test-pdfs/ -packages/web/test-results/ +src/web/test-results/ .deslop-cache/ # Deslop report artifacts (generated by `deslop .` in the CI gate, post-`make ci`) @@ -95,12 +95,16 @@ deslop-*.log .vscode/code-navigator/ # ============================================================================= -# RUST (workspace under crates/ — REPO-STANDARDS-SPEC [GITIGNORE-LANG]) +# RUST (workspace under src/ — REPO-STANDARDS-SPEC [GITIGNORE-LANG]) # ============================================================================= -/target/ +/src/target/ **/*.rs.bk # Cargo.lock IS committed on purpose — this workspace produces a binary (CLI). # Do NOT add Cargo.lock here. -*.log \ No newline at end of file +*.log + +.deslop/ +.vscode/code-navigator/ +.deslop/cache/ diff --git a/Claude.md b/Claude.md index d2383e0..0a7fc99 100644 --- a/Claude.md +++ b/Claude.md @@ -14,7 +14,7 @@ Call out irrelevant context before proceeding. Bloat degrades reasoning. ⚠️ typeDiagram is a small DSL for diagramming algebraic data types (records + tagged unions). Language-neutral, no methods. Includes a parser, model, layout engine, SVG renderer, and markdown support. Ships as an npm library, CLI tool, VS Code extension, and web playground. -A **Rust workspace** under `crates/` (root `Cargo.toml`) is being introduced alongside the TypeScript monorepo. It is a multi-language repo: TypeScript config and Rust config are chained orthogonally, never merged. +A **Rust workspace** under `src/` (`src/Cargo.toml`) is being introduced alongside the TypeScript monorepo. It is a multi-language repo: TypeScript config and Rust config are chained orthogonally, never merged. ## Testing Rules @@ -68,7 +68,7 @@ A **Rust workspace** under `crates/` (root `Cargo.toml`) is being introduced alo ## Hard Rules — Rust -Rust lives in the `crates/` workspace. Lints: `[workspace.lints]` in the root `Cargo.toml` (REPO-STANDARDS-SPEC [LINT-RUST]); formatting: `rustfmt.toml` ([LINT-RUST-FMT]). +Rust lives in the `src/` workspace. Lints: `[workspace.lints]` in `src/Cargo.toml` (REPO-STANDARDS-SPEC [LINT-RUST]); formatting: `src/rustfmt.toml` ([LINT-RUST-FMT]). - **Every crate inherits the workspace lints** — add `[lints]` / `workspace = true` to its `Cargo.toml`. - **All lints ON and at `deny`.** `unsafe_code = "deny"`; clippy `all` + `pedantic` denied. @@ -79,7 +79,7 @@ Rust lives in the `crates/` workspace. Lints: `[workspace.lints]` in the root `C ## Duplication — Deslop (MANDATORY MCP loop) -Duplication is debt with a ratcheted budget in `.deslop.toml` (REPO-STANDARDS-SPEC [CI-DESLOP]); CI runs `deslop .` and fails when the repo exceeds it. Deslop scans this repo's TypeScript today and the Rust under `crates/`. Use its MCP tools: +Duplication is debt with a ratcheted budget in `.deslop.toml` (REPO-STANDARDS-SPEC [CI-DESLOP]); CI runs `deslop .` and fails when the repo exceeds it. Deslop scans this repo's TypeScript today and the Rust under `src/tdbin/`. Use its MCP tools: - **BEFORE** authoring any function, helper, fixture, or test setup → call `find-similar`. `signals.fused ≥ 0.85` or an `identical`/`nearly_identical` bucket → REUSE the existing code, do not duplicate; `0.6 ≤ fused < 0.85` → review the canonical occurrence and bias toward reuse. - **AFTER** changing code → `rescan`, then `top-offenders` / `cluster-by-id`; `report-for-file` / `report-for-range` for a file or selection; `schema-doc` once per session. @@ -104,14 +104,16 @@ If the TMC server is available: register on start (name, intent, files), lock fi ## Packages Layout -Monorepo under `packages/`: +Monorepo under `src/`: -- `packages/typediagram/` — core framework (parser, model, layout, render-svg, markdown). Owned by `typediagram-builder` agent. -- `packages/cli/` — CLI app (`typediagram` bin). Pure consumer of the framework public API. Owned by `type-model-claude`. -- `packages/web/` — web playground (Vite). Pure consumer of the framework public API. Owned by `type-model-claude`. -- `packages/vscode/` — VS Code extension. +- `src/typediagram/` — core framework (parser, model, layout, render-svg, markdown). Owned by `typediagram-builder` agent. +- `src/cli/` — CLI app (`typediagram` bin). Pure consumer of the framework public API. Owned by `type-model-claude`. +- `src/web/` — web playground (Vite). Pure consumer of the framework public API. Owned by `type-model-claude`. +- `src/vscode/` — VS Code extension. +- `src/tdbin/` — Rust TDBIN runtime crate (workspace: `src/Cargo.toml`). +- `src/scripts/` — repo tooling (codegen fixtures, version stamping, coverage ratchet). -Framework logic lives only in `packages/typediagram/`. `cli`, `web`, and `vscode` are glue — no parsing, layout, or rendering logic duplicated. +Framework logic lives only in `src/typediagram/`. `cli`, `web`, and `vscode` are glue — no parsing, layout, or rendering logic duplicated. ## Website @@ -143,12 +145,17 @@ Only those 7 public targets are standard (see REPO-STANDARDS-SPEC [MAKE-TARGETS] ## Repo Structure ``` -packages/ +src/ typediagram/ — core framework (parser, model, layout, render-svg, markdown) cli/ — CLI app (typediagram bin) web/ — web playground (Vite) vscode/ — VS Code extension + tdbin/ — Rust TDBIN runtime crate + scripts/ — repo tooling + Cargo.toml — Rust workspace (+ Cargo.lock, rustfmt.toml) + eslint.config.mjs docs/ + research/ — benchmarks, reports, proofs specs/ — specification documents plans/ — plan documents with TODO checklists design/ — design system docs and assets diff --git a/Makefile b/Makefile index f1d4c87..616ae3e 100644 --- a/Makefile +++ b/Makefile @@ -38,24 +38,24 @@ build: @echo "==> Building..." npm run -w typediagram-core build @echo "==> Building Rust workspace..." - cargo build --workspace + cd src && cargo build --workspace ## test: Fail-fast tests + coverage + threshold enforcement + ratchet. ## See REPO-STANDARDS-SPEC [TEST-RULES] and [COVERAGE-THRESHOLDS-JSON]. ## Runs each package sequentially so coverage threshold failures exit non-zero. -## packages/web runs vitest AND Playwright (desktop + mobile) and enforces -## the threshold against their MERGED coverage — see packages/web/scripts/merge-coverage.ts. +## src/web runs vitest AND Playwright (desktop + mobile) and enforces +## the threshold against their MERGED coverage — see src/web/scripts/merge-coverage.ts. ## After all tests pass, ratchets coverage-thresholds.json UP to max(current, measured - 1%). test: @echo "==> Testing (fail-fast + coverage + threshold)..." @$(MAKE) _cargo_test - npm run -w packages/typediagram test - npm run -w packages/cli test - npm run -w packages/vscode test - npm run -w packages/web test + npm run -w src/typediagram test + npm run -w src/cli test + npm run -w src/vscode test + npm run -w src/web test $(MAKE) _coverage_check @echo "==> Ratcheting coverage thresholds..." - node scripts/ratchet-coverage.mjs + node src/scripts/ratchet-coverage.mjs ## lint: Run all linters/analyzers (read-only). Does NOT format. Fails fast on first error. ## Chains: typecheck -> eslint -> banned-deps. @@ -63,7 +63,7 @@ lint: @echo "==> Pre-building typediagram-core (needed for consumer typecheck)..." npm run -w typediagram-core build @echo "==> Typechecking..." - npm run -ws --if-present typecheck + npm run --workspaces --if-present typecheck @$(MAKE) _eslint @$(MAKE) _banned_deps @$(MAKE) _cargo_clippy @@ -73,16 +73,16 @@ fmt: @echo "==> Formatting (write)..." npx prettier --write . @echo "==> Formatting Rust (cargo fmt)..." - cargo fmt + cd src && cargo fmt ## clean: Remove all build artifacts from every package (dist, per-package ## coverage, root coverage, eleventy + typedoc output). clean: @echo "==> Cleaning all packages..." - $(RM) packages/typediagram/dist packages/cli/dist packages/web/dist packages/vscode/dist - $(RM) packages/typediagram/coverage packages/cli/coverage packages/web/coverage packages/vscode/coverage + $(RM) src/typediagram/dist src/cli/dist src/web/dist src/vscode/dist + $(RM) src/typediagram/coverage src/cli/coverage src/web/coverage src/vscode/coverage $(RM) coverage - $(RM) packages/web/.eleventy-out packages/web/.typedoc-out + $(RM) src/web/.eleventy-out src/web/.typedoc-out ## ci: full CI simulation. Fail-fast on every gate, in order: ## fmt-check -> lint -> test+coverage -> build -> bundle-size @@ -116,27 +116,27 @@ _fmt_check: @echo "==> Format check (read-only)..." npx prettier --check . @echo "==> Rust format check (read-only)..." - cargo fmt --check + cd src && cargo fmt --check _eslint: @echo "==> ESLint..." - npx eslint . + npx eslint --config src/eslint.config.mjs src _banned_deps: @echo "==> Banned-deps check..." - npm run check-banned-deps --workspace=packages/typediagram + npm run check-banned-deps --workspace=src/typediagram _cargo_test: @echo "==> Rust tests (cargo test --workspace, fail-fast)..." - cargo test --workspace + cd src && cargo test --workspace _cargo_clippy: @echo "==> Rust clippy (workspace, all targets, deny-all)..." - cargo clippy --workspace --all-targets -- -D warnings + cd src && cargo clippy --workspace --all-targets -- -D warnings _bundle_size: @echo "==> Bundle-size budget..." - npm run bundle-size --workspace=packages/typediagram + npm run bundle-size --workspace=src/typediagram # ============================================================================= @@ -149,25 +149,25 @@ _bundle_size: ## for iterating on the crate alone. test-tdbin: @echo "==> tdbin crate tests (cargo test -p tdbin)..." - cargo test -p tdbin + cd src && cargo test -p tdbin ## bench: TDBIN vs Protobuf benchmark. Runs tests and the full Criterion matrix, ## then generates Markdown and raw JSON reports from the measured output. bench: @echo "==> TDBIN crate tests (round-trip + deterministic size gate)..." - cargo test -p tdbin + cd src && cargo test -p tdbin @echo "==> TDBIN vs Protobuf Criterion benchmark matrix..." - cargo bench -p tdbin --bench gate -- --noplot + cd src && cargo bench -p tdbin --bench gate -- --noplot @echo "==> Generating data-derived TDBIN benchmark report..." - node scripts/tdbin-bench-report.mjs + node src/scripts/tdbin/tdbin-bench-report.mjs -## test-playwright: Run Playwright end-to-end tests only (packages/web), both +## test-playwright: Run Playwright end-to-end tests only (src/web), both ## desktop and mobile viewports. Does NOT run vitest or enforce ## coverage threshold — for that, use `make test`. Useful for ## iterating on UI tests. test-playwright: @echo "==> Playwright E2E (desktop + mobile)..." - npm run -w packages/web test:e2e + npm run -w src/web test:e2e ## rebuild-install-vsix: Full clean rebuild-and-reinstall cycle for the VS Code ## extension (see REPO-STANDARDS-SPEC [MAKE-IDE-EXT]): @@ -186,7 +186,7 @@ _vsix_uninstall: _vsix_clean: @echo "==> Cleaning VSIX build output..." $(RM) typediagram-*.vsix - $(RM) packages/vscode/dist + $(RM) src/vscode/dist _vsix_rebuild: @echo "==> Rebuilding extension from source..." @@ -209,7 +209,7 @@ dev-web: @echo "==> Building typediagram-core (required by web dev server)..." npm run -w typediagram-core build @echo "==> Starting web dev server (clean + eleventy --watch + vite)..." - npm run -w packages/web dev + npm run -w src/web dev ## clean-start: Full clean -> build -> dev. Use this when stale dist/ output ## from another package (e.g. typediagram-core) is being served diff --git a/README.md b/README.md index 1500873..f060c97 100644 --- a/README.md +++ b/README.md @@ -117,16 +117,16 @@ No Chromium download, no extra binaries — the extension reuses VS Code's built ## Monorepo layout -| Package | What | -| ---------------------------------------------- | ----------------------------------------------------------------------- | -| [packages/typediagram/](packages/typediagram/) | Core framework: parser, model, layout, render-svg, converters | -| [packages/cli/](packages/cli/) | `typediagram` CLI binary | -| [packages/web/](packages/web/) | Web playground + docs site ([typediagram.dev](https://typediagram.dev)) | -| [packages/vscode/](packages/vscode/) | VS Code extension | +| Package | What | +| ------------------------------------ | ----------------------------------------------------------------------- | +| [src/typediagram/](src/typediagram/) | Core framework: parser, model, layout, render-svg, converters | +| [src/cli/](src/cli/) | `typediagram` CLI binary | +| [src/web/](src/web/) | Web playground + docs site ([typediagram.dev](https://typediagram.dev)) | +| [src/vscode/](src/vscode/) | VS Code extension | ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow, repo layout, and rules. **Always run `make ci` before opening a PR** — it runs exactly what CI runs. +See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for the full workflow, repo layout, and rules. **Always run `make ci` before opening a PR** — it runs exactly what CI runs. ```sh make setup # install deps + build framework (first time only) diff --git a/coverage-thresholds.json b/coverage-thresholds.json index d9664d4..70529e3 100644 --- a/coverage-thresholds.json +++ b/coverage-thresholds.json @@ -3,25 +3,25 @@ "_doc": "Single source of truth for code coverage thresholds. See REPO-STANDARDS-SPEC [COVERAGE-THRESHOLDS-JSON]. NO GitHub repo variables. NO env vars. Keys match vitest coverage.thresholds: statements, branches, functions, lines. Thresholds are monotonically increasing — only ratchet UP, never down.", "default_threshold": 90, "projects": { - "packages/typediagram": { - "statements": 97.22, + "src/typediagram": { + "statements": 97.35, "branches": 91.05, "functions": 98.8, - "lines": 97.18 + "lines": 97.29 }, - "packages/cli": { + "src/cli": { "statements": 99, "branches": 98.37, "functions": 99, "lines": 99 }, - "packages/web": { + "src/web": { "statements": 97.7878787878788, "branches": 96.46835443037975, "functions": 99, "lines": 97.7012987012987 }, - "packages/vscode": { + "src/vscode": { "statements": 99, "branches": 99, "functions": 99, diff --git a/crates/tdbin/src/scalar.rs b/crates/tdbin/src/scalar.rs deleted file mode 100644 index 66a085a..0000000 --- a/crates/tdbin/src/scalar.rs +++ /dev/null @@ -1,59 +0,0 @@ -//! Scalar <-> word bit conversions for data-section fields ([TDBIN-PRIM-MAP]). -//! Pure reinterpretation — no arithmetic, no `as` casts. Generated ADT code -//! calls these to fill and read scalar slots. - -/// Encode a `bool` as a data word (low bit). -#[must_use] -pub fn bool_bits(value: bool) -> u64 { - u64::from(value) -} - -/// Decode a `bool` from a data word. -#[must_use] -pub fn bool_from(word: u64) -> bool { - (word & 1) == 1 -} - -/// Encode an `i64` as its little-endian bit pattern. -#[must_use] -pub fn i64_bits(value: i64) -> u64 { - u64::from_le_bytes(value.to_le_bytes()) -} - -/// Decode an `i64` from its little-endian bit pattern. -#[must_use] -pub fn i64_from(word: u64) -> i64 { - i64::from_le_bytes(word.to_le_bytes()) -} - -/// Encode an `f64` as its IEEE-754 bit pattern. -#[must_use] -pub fn f64_bits(value: f64) -> u64 { - value.to_bits() -} - -/// Decode an `f64` from its IEEE-754 bit pattern. -#[must_use] -pub fn f64_from(word: u64) -> f64 { - f64::from_bits(word) -} - -/// Split a 16-byte semantic scalar into two little-endian words. -#[must_use] -pub const fn bytes16_words(bytes: &[u8; 16]) -> (u64, u64) { - let [b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15] = *bytes; - ( - u64::from_le_bytes([b0, b1, b2, b3, b4, b5, b6, b7]), - u64::from_le_bytes([b8, b9, b10, b11, b12, b13, b14, b15]), - ) -} - -/// Join two little-endian words into a 16-byte semantic scalar. -#[must_use] -pub const fn bytes16_from_words(first: u64, second: u64) -> [u8; 16] { - let [a0, a1, a2, a3, a4, a5, a6, a7] = first.to_le_bytes(); - let [b0, b1, b2, b3, b4, b5, b6, b7] = second.to_le_bytes(); - [ - a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, b3, b4, b5, b6, b7, - ] -} diff --git a/docs/chat-model-example.svg b/docs/design/chat-model-example.svg similarity index 100% rename from docs/chat-model-example.svg rename to docs/design/chat-model-example.svg diff --git a/docs/plans/pdf-export.md b/docs/plans/pdf-export.md index 67fe442..0f83492 100644 --- a/docs/plans/pdf-export.md +++ b/docs/plans/pdf-export.md @@ -21,7 +21,7 @@ Add `typediagram.exportMarkdownPdf` command to the VS Code extension. Right-clic ## Dependencies to add -- **`markdown-it`** — move from `devDependencies` to `dependencies` in `packages/vscode/package.json`. No version bump. Must also bundle it into `dist/extension.js` via esbuild (already does this since the preview plugin uses it at test time; need to verify it's pulled into the extension bundle for runtime use too). +- **`markdown-it`** — move from `devDependencies` to `dependencies` in `src/vscode/package.json`. No version bump. Must also bundle it into `dist/extension.js` via esbuild (already does this since the preview plugin uses it at test time; need to verify it's pulled into the extension bundle for runtime use too). No other runtime deps. @@ -30,7 +30,7 @@ No other runtime deps. ### New ``` -packages/vscode/ +src/vscode/ src/ export-pdf.ts # [PDF-*] Command handler: compose HTML, print to PDF, write next to source. test/ @@ -45,7 +45,7 @@ packages/vscode/ ### Modified ``` -packages/vscode/ +src/vscode/ src/ extension.ts # Register typediagram.exportMarkdownPdf command in activate(). # Route to export-pdf.ts. Add to subscriptions. @@ -132,9 +132,9 @@ Skipped on darwin-arm64 for the same reason the existing electron tests are skip ### Phase G — Docs + finalise -15. Update `packages/vscode/README.md` with the new command. +15. Update `src/vscode/README.md` with the new command. 16. Run `make ci` one last time — format, lint, test, build, bundle-size all green. -17. Coverage ratcheted via `scripts/ratchet-coverage.mjs`. +17. Coverage ratcheted via `src/scripts/ratchet-coverage.mjs`. ## Risk register @@ -206,7 +206,7 @@ Check items off as each lands with its tests passing. ### Phase G — Docs + finalise -- [ ] **`packages/vscode/README.md`** — new section documenting the export command + context menu entry + default output location. +- [ ] **`src/vscode/README.md`** — new section documenting the export command + context menu entry + default output location. - [ ] **`make ci`** — format, lint, test, build, bundle-size all green. -- [ ] **Coverage ratchet** — `scripts/ratchet-coverage.mjs` bumps vscode package thresholds upward. +- [ ] **Coverage ratchet** — `src/scripts/ratchet-coverage.mjs` bumps vscode package thresholds upward. - [ ] **Manual smoke** — right-click `examples/doc.md` in the real VS Code → confirm `doc.pdf` appears next to source with the ChatRequest/ToolResult diagram as a zoomable vector. diff --git a/docs/plans/plan.md b/docs/plans/plan.md index b37c13c..28ce667 100644 --- a/docs/plans/plan.md +++ b/docs/plans/plan.md @@ -33,7 +33,7 @@ Each layer is independently importable. A consumer can stop at any layer and sup ## Critical files (to be created) ```` -packages/typediagram/ +src/typediagram/ src/ parser/ lexer.ts # token stream @@ -107,7 +107,7 @@ export interface RenderOpts { ### 0. Project scaffold -- [x] `npm init` at `packages/typediagram/`; set `"type": "module"`, `"main"`, `"types"`, `"exports"` (`.` and `./markdown`). +- [x] `npm init` at `src/typediagram/`; set `"type": "module"`, `"main"`, `"types"`, `"exports"` (`.` and `./markdown`). - [x] Install: `typescript`, `vitest`, `@types/node`. Runtime dep: `elkjs` only. Dev-time only: nothing else. - [x] `tsconfig.json`: `strict`, `target: ES2022`, `module: ESNext`, `moduleResolution: bundler`, `declaration: true`. - [x] `vitest.config.ts` with snapshot dir `test/__snapshots__/`. @@ -218,24 +218,24 @@ This layer is the framework's programmatic API. Importers (JSON Schema, OpenAPI, ### 12. Documentation - [x] `README.md`: trimmed user-facing version of spec.md (grammar, both examples, install, basic usage). -- [x] One screenshot of the chat-model example rendered. (`docs/chat-model-example.svg`) +- [x] One screenshot of the chat-model example rendered. (`docs/design/chat-model-example.svg`) -### 13. CLI app (`packages/cli/`) +### 13. CLI app (`src/cli/`) Validates the framework works headless in Node. Pure consumer of the layered API — does not duplicate any framework logic. -- [x] `packages/cli/package.json` with `"bin": { "typediagram": "./dist/cli.js" }`. Depend on `typediagram` via workspace. +- [x] `src/cli/package.json` with `"bin": { "typediagram": "./dist/cli.js" }`. Depend on `typediagram` via workspace. - [x] `src/cli.ts`: read `argv[2]` (file path) or stdin → call `typediagram` `parse` + `renderToString` → write SVG to stdout, errors to stderr with exit code 1. - [x] Flag: `--theme light|dark` (default light), `--font-size N`. - [x] Test: pipe both spec examples through the CLI → SVG starts with `` on right. - [x] `src/main.ts`: on textarea input (debounced), `parse(src)` → if ok, `renderToString` → set `preview.innerHTML`; if err, render the formatted diagnostic list in the preview pane. - [x] No framework logic in the web app — only glue. @@ -258,7 +258,7 @@ The original plan said "throw on parse error, expose .diagnostics". User directi ### 17. Things originally missed — must add before MVP ships -- [x] **Workspace root setup.** Top-level `package.json` with `"workspaces": ["packages/*"]`, top-level lockfile, top-level scripts. +- [x] **Workspace root setup.** Top-level `package.json` with `"workspaces": ["src/*"]`, top-level lockfile, top-level scripts. - [x] **AST → typeRef span fidelity.** TypeRef interface carries full `span: Span` with line, col, offset, length. - [x] **Cycle detection in resolution.** `[EDGE-CYCLE]` tests in `edge-cases.test.ts`: self-ref types parse, build model, render without crash. - [x] **Self-referential edges.** Same test suite confirms self-loop edges (e.g. `Tree → Tree`). ELK routes them. @@ -268,21 +268,21 @@ The original plan said "throw on parse error, expose .diagnostics". User directi - [x] **Comments preserved as a token kind?** Decision: drop (current). Comments stripped during lex, not preserved. LSP folding ranges will need revisiting. - [x] **Trailing-newline tolerance.** `[EDGE-TRAILING]` tests: no trailing newline, multiple trailing newlines, CRLF all parse cleanly. - [x] **Position info on Diagnostic from validate/json/builder paths.** Diagnostics carry line/col/length; spans at AST level. -- [x] **Public-API smoke test.** `packages/cli/test/public-api-smoke.test.ts` imports from `"typediagram"` package name — 8 tests covering all subpath exports. +- [x] **Public-API smoke test.** `src/cli/test/public-api-smoke.test.ts` imports from `"typediagram"` package name — 8 tests covering all subpath exports. - [x] **`exports` map verification.** `package.json` has subpaths for `./parser`, `./model`, `./layout`, `./render-svg`, `./markdown`. Smoke test verifies resolution. - [x] **Markdown integration (Section 9).** Fully implemented in `src/integrations/markdown.ts` with tests. - [x] **CI workflow.** `.github/workflows/ci.yml`: matrix Node 20/22, check-banned-deps, typecheck, test, bundle-size. - [x] **Bundle size budget.** `scripts/bundle-size.mjs` via esbuild: fail if > 50KB excl. elkjs. Currently 23.54 KB. - [x] **Stable edge IDs.** Content-based `${sourceDeclName}:${sourceRowIndex}:${targetDeclName}:${kind}` in `elk.ts`. -### 18. VS Code syntax highlighting (`packages/vscode/`) +### 18. VS Code syntax highlighting (`src/vscode/`) -- [x] TextMate grammar (`packages/vscode/syntaxes/typediagram.tmLanguage.json`): keywords (`type|union|alias|typeDiagram`), PascalCase type names, field names before `:`, builtins (`Bool|Int|Float|String|Bytes|Unit|List|Map|Option`), `#` comments, punctuation. +- [x] TextMate grammar (`src/vscode/syntaxes/typediagram.tmLanguage.json`): keywords (`type|union|alias|typeDiagram`), PascalCase type names, field names before `:`, builtins (`Bool|Int|Float|String|Bytes|Unit|List|Map|Option`), `#` comments, punctuation. - [x] Language configuration: bracket matching, auto-close `{}` `<>`, `#` line comments, indentation rules. - [x] Extension manifest: `.td` and `.typediagram` file extensions. - [x] Grammar test: 16/16 tokenization assertions pass via `vscode-textmate` + `vscode-oniguruma`. -### 19. Web playground UX (`packages/web/`) +### 19. Web playground UX (`src/web/`) - [x] **Preview zoom.** SVG preview supports scroll-wheel zoom. Preserve center point on zoom. (`src/viewport.ts`, 12 tests) - [x] **Preview pan.** Click-drag to pan the SVG preview. Cursor changes to grab/grabbing. (`src/viewport.ts`) diff --git a/docs/plans/render-hooks.md b/docs/plans/render-hooks.md index 7e6dc07..2612c08 100644 --- a/docs/plans/render-hooks.md +++ b/docs/plans/render-hooks.md @@ -8,11 +8,11 @@ Add six render hooks (`defs`, `node`, `row`, `edge`, `background`, `post`) to th ## Layering (read spec [HOOK-LAYERS] first) -| Layer | Concern | Module | Depends on | -| ----- | ------------------------------------------ | ----------------------------------------------------------- | -------------------- | -| 1 | `RenderHooks` interface + phase invocation | `packages/typediagram/src/render-svg/hooks.ts`, `render.ts` | nothing | -| 2 | User JS compiled to Layer 1 | `packages/web/src/eval-hooks.ts` | Layer 1 (types only) | -| 3 | Preset snippets (strings) + splice helpers | `packages/web/src/hook-presets.ts` | Layer 2 (tests only) | +| Layer | Concern | Module | Depends on | +| ----- | ------------------------------------------ | ------------------------------------------------------ | -------------------- | +| 1 | `RenderHooks` interface + phase invocation | `src/typediagram/src/render-svg/hooks.ts`, `render.ts` | nothing | +| 2 | User JS compiled to Layer 1 | `src/web/src/eval-hooks.ts` | Layer 1 (types only) | +| 3 | Preset snippets (strings) + splice helpers | `src/web/src/hook-presets.ts` | Layer 2 (tests only) | **Review rejections**: @@ -37,15 +37,15 @@ Add six render hooks (`defs`, `node`, `row`, `edge`, `background`, `post`) to th ## Affected files ``` -packages/typediagram/src/render-svg/ +src/typediagram/src/render-svg/ hooks.ts NEW — RenderHooks type, context types, safe invoker helper render.ts EDIT — thread hooks through renderSvg; invoke at each phase index.ts EDIT — re-export hook types -packages/typediagram/src/index.ts +src/typediagram/src/index.ts EDIT — re-export hook types at framework root -packages/typediagram/test/render-hooks.test.ts +src/typediagram/test/render-hooks.test.ts NEW — phase coverage + worked-example + positioning-PoC tests -packages/typediagram/test/render-svg.test.ts +src/typediagram/test/render-svg.test.ts EDIT — add "no hooks → byte-identical to baseline" assertion docs/specs/render-hooks.md (done — this PR) docs/plans/render-hooks.md (done — this PR) @@ -139,9 +139,9 @@ export { DARK, LIGHT, getTheme } from "./theme.js"; export type { Theme, ThemeName } from "./theme.js"; ``` -Root `packages/typediagram/src/index.ts` re-exports the same. +Root `src/typediagram/src/index.ts` re-exports the same. -### 4. Tests — `packages/typediagram/test/render-hooks.test.ts` +### 4. Tests — `src/typediagram/test/render-hooks.test.ts` Complex diagrams, heavy assertions per CLAUDE.md test rules. One file per concern-cluster is fine; keep them E2E through `renderSvg`: @@ -186,9 +186,9 @@ Tests must keep coverage ratcheting up (CLAUDE.md coverage rule). New branches a ## TODO -- [ ] Create [`packages/typediagram/src/render-svg/hooks.ts`](../../packages/typediagram/src/render-svg/hooks.ts) with all context interfaces and `RenderHooks`. +- [ ] Create [`src/typediagram/src/render-svg/hooks.ts`](../../src/typediagram/src/render-svg/hooks.ts) with all context interfaces and `RenderHooks`. - [ ] Add the try/catch invoker helper in `hooks.ts` (logs via `pino`, returns default). -- [ ] Thread `hooks?: RenderHooks` through `SvgOpts` in [`render.ts`](../../packages/typediagram/src/render-svg/render.ts). +- [ ] Thread `hooks?: RenderHooks` through `SvgOpts` in [`render.ts`](../../src/typediagram/src/render-svg/render.ts). - [ ] Invoke `defs` hook; append result inside ``. - [ ] Invoke `background` hook; emit between `` and first node. - [ ] Refactor `renderRows` into per-row iteration that invokes `row` hook when present. @@ -198,7 +198,7 @@ Tests must keep coverage ratcheting up (CLAUDE.md coverage rule). New branches a - [ ] Build `NodeCtx` including resolved `accent`, `header`, and `badge` (unions only). - [ ] Build `RowCtx` including `textX`, `textY`, `isUnionVariant`. - [ ] Build `EdgeCtx` including absolute `points`, `midpoint`, `stroke`, `strokeWidth`, `dashArray`. -- [ ] Export hook types from [`render-svg/index.ts`](../../packages/typediagram/src/render-svg/index.ts) and [`typediagram/src/index.ts`](../../packages/typediagram/src/index.ts). +- [ ] Export hook types from [`render-svg/index.ts`](../../src/typediagram/src/render-svg/index.ts) and [`typediagram/src/index.ts`](../../src/typediagram/src/index.ts). - [ ] Write [HOOK-TEST-DEFAULT-IDENTITY] baseline snapshot (lock in byte-identical output pre/post change). - [ ] Write [HOOK-TEST-PHASES] (all six phases fire in order). - [ ] Write [HOOK-TEST-DEFS], [HOOK-TEST-BACKGROUND], [HOOK-TEST-POST] (singleton-phase tests). @@ -216,9 +216,9 @@ Tests must keep coverage ratcheting up (CLAUDE.md coverage rule). New branches a ## Web playground integration (Layers 2 + 3) -- [ ] Create [`packages/web/src/eval-hooks.ts`](../../packages/web/src/eval-hooks.ts) (Layer 2): `evalHooks(code)` -> `{ ok, hooks?, error? }`. Empty / whitespace-only input returns `{ ok: true }` with no hooks. Uses `new Function("svg", "raw", body)` with `svg`/`raw` from `typediagram-core`. -- [ ] Create [`packages/web/src/hook-presets.ts`](../../packages/web/src/hook-presets.ts) (Layer 3): `PRESETS` as `ReadonlyArray<{ id, label, blurb, source }>`. `togglePresetInCode(code, id, on)` splices block in/out by sentinel-comment regex. `presetsInCode(code)` returns ids of present blocks. No `RenderHooks` exports. -- [ ] Add tabbed UI to [`playground.ts`](../../packages/web/src/playground.ts): `source` (default) and `hooks`. Hooks tab owns a textarea, a diagnostics block, and a row of preset chips along its bottom. +- [ ] Create [`src/web/src/eval-hooks.ts`](../../src/web/src/eval-hooks.ts) (Layer 2): `evalHooks(code)` -> `{ ok, hooks?, error? }`. Empty / whitespace-only input returns `{ ok: true }` with no hooks. Uses `new Function("svg", "raw", body)` with `svg`/`raw` from `typediagram-core`. +- [ ] Create [`src/web/src/hook-presets.ts`](../../src/web/src/hook-presets.ts) (Layer 3): `PRESETS` as `ReadonlyArray<{ id, label, blurb, source }>`. `togglePresetInCode(code, id, on)` splices block in/out by sentinel-comment regex. `presetsInCode(code)` returns ids of present blocks. No `RenderHooks` exports. +- [ ] Add tabbed UI to [`playground.ts`](../../src/web/src/playground.ts): `source` (default) and `hooks`. Hooks tab owns a textarea, a diagnostics block, and a row of preset chips along its bottom. - [ ] Hooks editor `input` event: re-run `evalHooks`; on success, pass `hooks` into `renderPane`; on failure, show error in diag block and render with NO hooks (default path). - [ ] Chip click: `togglePresetInCode(editor.value, id, !present)` → set editor value → fire input. Chips re-sync from textarea content on every keystroke. - [ ] `renderPane(source, hooks?)` accepts optional `RenderHooks`; passes `hooks` only when defined (never `{ hooks: {} }`). diff --git a/docs/plans/tdbin-implementation-plan.md b/docs/plans/tdbin-implementation-plan.md index be0c151..6849bce 100644 --- a/docs/plans/tdbin-implementation-plan.md +++ b/docs/plans/tdbin-implementation-plan.md @@ -2,7 +2,7 @@ > Executes [docs/specs/tdbin-wire-format.md](../specs/tdbin-wire-format.md) + [docs/specs/tdbin-rust-api.md](../specs/tdbin-rust-api.md). > Research basis: [docs/research/binary-format-research.md](../research/binary-format-research.md). -> First language: **Rust** (`crates/tdbin`, the workspace's first crate). TypeScript follows via golden-vector conformance. +> First language: **Rust** (`src/tdbin`, the workspace's first crate). TypeScript follows via golden-vector conformance. > End state (roadmap): two-way streaming + an RPC framework (`[TDRPC-*]`) where typeDiagram `type`s are the payloads and typeDiagram **functions are the service contract** — every phase keeps that door open (self-delimiting frames, forward-only encode, reserved capability pointer kind). Rules of engagement: every function/test references its `[TDBIN-*]` ID; deslop `find-similar` before authoring, `rescan` after; functions < 20 lines, files < 500 lines; no panics; `Result` everywhere. @@ -20,7 +20,7 @@ typeDiagram .td ──parse──▶ Model ──┬─ rust.ts toSource(model) your Rust object ──.to_bytes()──▶ binary ──Object::from_bytes()──▶ your Rust object ``` -1. **The ADTs are GENERATED by typeDiagram codegen — never hand-written.** typeDiagram already ships language converters (`packages/typediagram/src/converters/*.ts`); the Rust one emits the `struct`/`enum` types. We **extend that codegen** to also emit the TDBIN codec (`impl tdbin::Struct`). This is mandatory. +1. **The ADTs are GENERATED by typeDiagram codegen — never hand-written.** typeDiagram already ships language converters (`src/typediagram/src/converters/*.ts`); the Rust one emits the `struct`/`enum` types. We **extend that codegen** to also emit the TDBIN codec (`impl tdbin::Struct`). This is mandatory. 2. **No runtime `Schema`, no dynamic `Value` on the hot path.** Layout (data/pointer sections, slots, discriminant) is baked into the generated `impl` at generation time. Decode materializes straight into the typed object. This is what makes it faster than a reflective codec. 3. **`TypeDef`/`TypeRef` (reflective schema model) is an OPTIONAL EXTRA**, for tooling that wants to inspect model structure — explicitly NOT part of serialize/deserialize. Recorded in [tdbin-rust-api.md](../specs/tdbin-rust-api.md) `[TDBIN-RS-REFLECT]`. @@ -28,7 +28,7 @@ typeDiagram .td ──parse──▶ Model ──┬─ rust.ts toSource(model) ## Phase 0 — v0 runtime + direct bidirectional round-trip ✅ DONE -- [x] `crates/tdbin/Cargo.toml`: `[lints] workspace = true`, **zero external deps** (offline-safe; `thiserror`/`tracing` deferred to the logging pass) `[TDBIN-RS-CRATE]` +- [x] `src/tdbin/Cargo.toml`: `[lints] workspace = true`, **zero external deps** (offline-safe; `thiserror`/`tracing` deferred to the logging pass) `[TDBIN-RS-CRATE]` - [x] Wire primitives: 8-byte LE words `[TDBIN-WIRE-WORD]`, struct/list/null pointers `[TDBIN-PTR-STRUCT]` `[TDBIN-PTR-LIST]` `[TDBIN-PTR-NULL]`, reserved-kind rejection `[TDBIN-PTR-RESERVED]` - [x] Encoder `Writer`: preorder allocation + in-message back-patching, scalar/string/bytes/child slots, byte-list packing `[TDBIN-ENC-ORDER]` `[TDBIN-REC-ALLOC]` - [x] Decoder `Reader`: schema-independent whole-message structural verification followed by typed decode, bounds-checked, **depth cap 64** `[TDBIN-SAFE-DEPTH]`, **physical-word amplification budget** `[TDBIN-SAFE-AMPLIFY]`, UTF-8 validation `[TDBIN-SAFE-UTF8]` @@ -45,7 +45,7 @@ v0 wire subset (documented in-crate): one word per scalar int/float, direct bool - [x] `converters/rust-tdbin.ts`: `emitRustCodec(model): Result` → `impl tdbin::Struct` per record/union, layout computed from the Model at generation time `[TDBIN-REC-ALLOC]` `[TDBIN-UNION-DISC]`; unsupported shapes fail loudly (no placeholders) - [x] Field classification: scalar (Bool/Int/Float → data section) vs pointer (String/Bytes/`Option`/declared record|union → pointer section); union ordinal = declaration index (pinned discriminants codegen-only, never on wire) `[TDBIN-UNION-DISC]` - [x] vitest `test/converters/rust-tdbin.test.ts`: asserts emitted codec for a Person-shaped `.td` (exact `DATA_WORDS`/`PTR_WORDS`, slot indices, `Self::` union arms + `UnknownVariant` fallback, required-vs-`Option` reads), every unsupported-shape error path, plus a **drift guard** tying `generateRustModule` output to the committed crate fixture. `rust-tdbin.ts` coverage 100% stmts / 99% branch; full package suite 373/373 green over threshold `[TDBIN-TEST-ROUNDTRIP]` -- [x] **End-to-end proof**: generated types (`rust.toSource`) + codec (`emitRustCodec`) for a `.td` are committed to `crates/tdbin/tests/generated/mod.rs`, compiled against the `tdbin` crate and round-tripped by `tests/roundtrip.rs` under `cargo test` (5/5) — **typeDiagram ADT → binary → typeDiagram ADT** on generated code, object↔binary identity + byte-identical re-encode + adversarial typed-errors +- [x] **End-to-end proof**: generated types (`rust.toSource`) + codec (`emitRustCodec`) for a `.td` are committed to `src/tdbin/tests/generated/mod.rs`, compiled against the `tdbin` crate and round-tripped by `tests/roundtrip.rs` under `cargo test` (5/5) — **typeDiagram ADT → binary → typeDiagram ADT** on generated code, object↔binary identity + byte-identical re-encode + adversarial typed-errors - [x] Follow-up: generated code is deny-all-clean (doc comments on every type/field/variant, `#[derive]`s, `Self::` variants, checked codec) — `cargo clippy --all-targets` (deny-all) = 0 errors, `cargo fmt --check` clean; the generated round-trip lives in-crate under `make test` ## Phase 2 — Wire completeness (size + fidelity) — PARTIAL @@ -66,31 +66,49 @@ v0 wire subset (documented in-crate): one word per scalar int/float, direct bool - [x] Verifier slot-typing rule made explicit for overlapped union slots + unknown variants `[TDBIN-SAFE-ZEROSLOT]` `[TDBIN-UNION-UNKNOWN]` - [x] `Map` and `Any`: reject explicitly with a typed error (review finding `map-any`) — codec fails LOUDLY (`Result` err `Diagnostic`, never a placeholder) naming the exact type (`unsupported field type 'Map'` / `'Any'`); locked by 2 tests in `rust-tdbin.test.ts` (17/17 green). No v0 wire form promised for these. - [x] Evolution suite `[TDBIN-TEST-EVOLVE]`: append-field/variant compatibility, short/long structs `[TDBIN-REC-SHORT]`, width-crossing breaking case `[TDBIN-EVOLVE-WIDTH]` — `Reader` now carries actual wire `data_words`/`ptr_words`, defaults missing scalar slots to zero, and treats missing pointer slots as null; `tests/evolution.rs` covers newer-reader/older-writer defaults, older-reader/newer-writer pointer lookup, appended variants, and width-crossing unknown ordinals; `cargo test -p tdbin` 33/33 and clippy green -- [x] `cargo-fuzz` decode target, CI time-budgeted `[TDBIN-TEST-FUZZ]` — libFuzzer package lives under `crates/tdbin/fuzz` with target `decode` covering bare decode, framed decode, and pack decode over a generated-style schema; `cargo check --manifest-path crates/tdbin/fuzz/Cargo.toml` green; `cargo +nightly fuzz run decode -- -runs=256` green; deterministic `tests/fuzz_decode.rs` remains in `cargo test -p tdbin` +- [x] `cargo-fuzz` decode target, CI time-budgeted `[TDBIN-TEST-FUZZ]` — libFuzzer package lives under `src/tdbin/fuzz` with target `decode` covering bare decode, framed decode, and pack decode over a generated-style schema; `cargo check --manifest-path src/tdbin/fuzz/Cargo.toml` green; `cargo +nightly fuzz run decode -- -runs=256` green; deterministic `tests/fuzz_decode.rs` remains in `cargo test -p tdbin` ## Phase 4 — The gate: benchmark vs Protobuf (make "smaller AND faster" enforceable) — SUITE COMPLETE, GATE 2/3 + ONE 1.4% MARGIN -> **MEASURED VERDICT (2026-07-12)** — authoritative report: [docs/reports/tdbin-bench-report.md](../reports/tdbin-bench-report.md) (values are never hand-copied here). After the columnar layout-2 rework ([tdbin-columnar.md](../specs/tdbin-columnar.md)): every corpus and batch fixture is now BOTH smaller than Protobuf and faster on every measured operation in its qualifying production mode. Against the stretch 1.5x-headroom bar, `metric_batch` and `diagram_document` PASS (as do the `person_batch` and `contact_batch` stress rows); `event_batch` passes encode at 2.0x but its framed decode has repeatedly measured 1.48-1.50x — statistically on the bar, below the pin. The designed mechanism for decisive decode headroom is the verify-once borrowed reader ([tdbin-future-reader.md](../specs/tdbin-future-reader.md)); the materializing API is now allocation-bound at parity shape with prost. +> **MEASURED VERDICT (2026-07-12)** — authoritative report: [docs/research/reports/tdbin-bench-report.md](../reports/tdbin-bench-report.md) (values are never hand-copied here). After the columnar layout-2 rework ([tdbin-columnar.md](../specs/tdbin-columnar.md)): every corpus and batch fixture is now BOTH smaller than Protobuf and faster on every measured operation in its qualifying production mode. Against the stretch 1.5x-headroom bar, `metric_batch` and `diagram_document` PASS (as do the `person_batch` and `contact_batch` stress rows); `event_batch` passes encode at 2.0x but its framed decode has repeatedly measured 1.48-1.50x — statistically on the bar, below the pin. The designed mechanism for decisive decode headroom is the verify-once borrowed reader ([tdbin-future-reader.md](../specs/tdbin-future-reader.md)); the materializing API is now allocation-bound at parity shape with prost. -- [x] Corpus in typeDiagram + `.proto`: record-heavy document, union-heavy event stream, and list-heavy dataset `[TDBIN-BENCH-CORPUS]` — the committed paired schemas live in `docs/benchmarks/tdbin-corpus.{td,proto}` and the executable suite also retains tiny and repeated-record/union stress rows. +- [x] Corpus in typeDiagram + `.proto`: record-heavy document, union-heavy event stream, and list-heavy dataset `[TDBIN-BENCH-CORPUS]` — the committed paired schemas live in `docs/research/benchmarks/tdbin-corpus.{td,proto}` and the executable suite also retains tiny and repeated-record/union stress rows. - [x] Criterion suite vs `prost` across all production modes `[TDBIN-BENCH-GATE]` — seven paired fixtures × bare/framed/packed-framed encode/decode plus Protobuf encode/decode, 50 samples and five-second measurement windows. -- [x] Deterministic report generation — `make bench` writes raw machine data to [docs/reports/tdbin-bench-data.json](../reports/tdbin-bench-data.json), then generates the human-readable Markdown report and its pass/fail verdict solely from that data. -- [x] Size assertions inside `[TDBIN-TEST-ROUNDTRIP]` — `crates/tdbin/tests/size_gate.rs` pins all seven fixtures and proves packed-framed round-trip identity, including the rows where TDBIN currently loses. +- [x] Deterministic report generation — `make bench` writes raw machine data to [docs/research/reports/tdbin-bench-data.json](../reports/tdbin-bench-data.json), then generates the human-readable Markdown report and its pass/fail verdict solely from that data. +- [x] Size assertions inside `[TDBIN-TEST-ROUNDTRIP]` — `src/tdbin/tests/size_gate.rs` pins all seven fixtures and proves packed-framed round-trip identity, including the rows where TDBIN currently loses. - [~] Gate status (2026-07-12): the "smaller AND faster than Protobuf" claim is now MEASURED TRUE on every realistic corpus and batch entry (all sizes smaller, all operations faster in the qualifying mode). The stretch 1.5x-headroom bar passes on 4 of 5 realistic rows; `event_batch` decode measures 1.48-1.50x (encode 2.0x, size -12%). Remaining headroom belongs to `[TDBIN-FUTURE-READER]`. ## Phase 5 — Full `.td` pipeline + tooling -- [x] CLI glue (`packages/cli` or a `tdbin` bin): `typediagram encode|decode|verify` — thin consumer of the generated codec — `packages/cli` now recognizes TDBIN command mode: `encode` emits the generated Rust ADT+codec module, `decode` emits codec impls for already-generated Rust ADTs, and `verify` parses/builds/validates the `.td` schema and TDBIN Rust codegen support without pretending to be the later dynamic `Value` decoder; focused CLI tests cover all three commands plus unsupported-schema diagnostics; `npm run -w typediagram-core build`, `npm run -w typediagram build`, focused `args.test.ts`/`cli.e2e.test.ts` (59/59), and edited-file ESLint green +- [x] CLI glue (`src/cli` or a `tdbin` bin): `typediagram encode|decode|verify` — thin consumer of the generated codec — `src/cli` now recognizes TDBIN command mode: `encode` emits the generated Rust ADT+codec module, `decode` emits codec impls for already-generated Rust ADTs, and `verify` parses/builds/validates the `.td` schema and TDBIN Rust codegen support without pretending to be the later dynamic `Value` decoder; focused CLI tests cover all three commands plus unsupported-schema diagnostics; `npm run -w typediagram-core build`, `npm run -w typediagram build`, focused `args.test.ts`/`cli.e2e.test.ts` (59/59), and edited-file ESLint green - [x] `[TDBIN-RS-REFLECT]` optional reflective `TypeDef`/`TypeRef` model + dynamic `Value` codec — for tooling only, clearly off the typed hot path — `tdbin::reflect` now exposes `TypeDef`, `FieldDef`, `VariantDef`, `TypeRef`, dynamic `Value`, `ReflectError`, and a tooling-only `ValueCodec` bridge; `reflect::encode/decode/verify` converts through `ValueCodec` and delegates final bytes to the typed `TdBin` path, so it does not put a schema interpreter on the hot path; `tests/reflect.rs` proves Value→typed bytes→Value and typed shape errors; `cargo test -p tdbin` and `cargo clippy -p tdbin --all-targets -- -D warnings` green ## Phase 6 — Roadmap tracks (each opens with its own spec) - [x] `[TDBIN-FUTURE-READER]` zero-copy reader: `verify` once → nanosecond typed accessors (research §2) — roadmap opened in [tdbin-future-reader.md](../specs/tdbin-future-reader.md) - [x] `[TDBIN-FUTURE-COLUMNAR]` struct-of-arrays lists: validity bitmaps, dense-union columns, SIMD-BP128 integer columns — roadmap opened in [tdbin-future-columnar.md](../specs/tdbin-future-columnar.md) -- [ ] `[TDBIN-FUTURE-TS]` TypeScript codec in `packages/typediagram/` passing every golden vector — the runtime and initial typed codegen pass focused vectors, but generated output is not compiled/executed in a browser matrix and several schema forms remain unsupported; see [tdbin-future-typescript.md](../specs/tdbin-future-typescript.md). +- [ ] `[TDBIN-FUTURE-TS]` TypeScript codec in `src/typediagram/` passing every golden vector — the runtime and initial typed codegen pass focused vectors, but generated output is not compiled/executed in a browser matrix and several schema forms remain unsupported; see [tdbin-future-typescript.md](../specs/tdbin-future-typescript.md). - [x] `[TDBIN-FUTURE-RPC]` **`[TDRPC-*]` spec — streaming/RPC framework**: typeDiagram function definitions → service contract; unary/server-stream/client-stream/bidi from signature shape; numeric method ids; capability pointer kind `11`; promise pipelining; QUIC-first transport (RPC research pass, research §6) — roadmap opened in [tdrpc.md](../specs/tdrpc.md) - [x] `[TDBIN-FUTURE-WIDTH-TYPES]` width-refined DSL numerics; `[TDBIN-FUTURE-ORDINALS]` explicit ordinals for non-append evolution — roadmap opened in [tdbin-future-width-types.md](../specs/tdbin-future-width-types.md) +## Phase 7 — Consumer blockers (GitHub issues) + +- [x] #85 `[TDBIN-SCHEMA-HASH]` generated TS codecs pin `layoutHash` identical to Rust `LAYOUT_HASH`; `decodeFramed` requires it (typed `HashMismatch`). +- [x] #85 `[TDBIN-FRAME-BASE64]` `encodeFramedBase64` / `decodeFramedBase64` with typed `BadBase64`/`BadMagic`/`HashMismatch` errors. +- [x] #85 `[TDBIN-TS-BUNDLE]` generated modules import only `typediagram-core/tdbin`; `sideEffects: false`; bundle 18.5 KB min / 6.3 KB gz. +- [x] #61 `[TDBIN-UNION-STRUCT]` struct-form union variants encode/decode/verify in the Rust and TS generators (payload = pointer to a struct laid out by `[TDBIN-REC-ALLOC]`). Layout 1 only; layout 2 rejects with a diagnostic. +- [x] #71 `[CONV-RUST-IDIOM]` `--to rust` derives `Debug, Clone, PartialEq`, snake_case fields with `#[serde(rename)]` (round-trips), serde derives only when needed; tdbin codecs bind the same names. +- [x] #62 `[CLI-TDBIN-LANG]` `typediagram encode|verify --to typescript` emits/checks the TS codec module (Rust stays the default). +- [x] #62 `[TDBIN-TS-LIST]` TS codec supports every layout-1 `List` / `Option>` form; Rust↔TS golden byte identity (`golden/report_lists.hex`). +- [x] #65 `[CLI-CONFIG-TDBIN]` `--config` `tdbin` outputs (rust full/codec-only, typescript); `--watch` regenerates types and codecs from one parse. +- [x] #77 `[CONV-DART-RECORD]` Dart named record typedefs import as records; function types / positional records fail loudly with every diagnostic (no more exit 0 with invalid `.td`). +- [x] #60 `[TDBIN-RS-PUBLISH]` `tdbin` crate is publishable (metadata, README, runtime-only `include`, `cargo publish --dry-run` verified); release workflow publishes it at the tag version via the stamped `[workspace.package].version`. +- [ ] #60 Add the `CARGO_REGISTRY_TOKEN` repo secret, then confirm the first release lands on crates.io. +- [x] #85 `[MODEL-WIDTH]` `I32/U8/U16/U32/U64/Size/Path` primitives in every converter. +- [x] #85 `[TDBIN-WIDTH-RANGE]` `[TDBIN-WIDTH-LIST]` `[TDBIN-WIDTH-PATH]` Rust runtime + codegen: one-word range-checked scalars, 1/2/4/8-byte lists, `PathBuf` as UTF-8 string. +- [x] #85 TypeScript codec for width types and `Path` (`tdbin.width`, range-checked encode+decode, `U64` bigint); Rust↔TS golden `golden/widths.hex`. +- [ ] #61 follow-up: struct-form variants in layout 2 column groups (`[TDBIN-COL-UNION]` dense groups). + ## Exit criteria (v1 = phases 0–4) - [x] `make ci` completes in one invocation (2026-07-12): lint, every test suite, coverage ratchet (thresholds bumped), workspace builds, and the bundle budget all passed in a single run. @@ -99,7 +117,7 @@ v0 wire subset (documented in-crate): one word per scalar int/float, direct bool - [x] Golden vectors committed and byte-stable `[TDBIN-TEST-GOLDEN]`. - [x] Fuzz target runs clean on the recorded local budget `[TDBIN-TEST-FUZZ]`. - [~] **Bench gate** `[TDBIN-BENCH-GATE]` (2026-07-12): smaller than Protobuf on EVERY realistic entry and faster on EVERY operation; the stretch 1.5x bar holds on 4 of 5 realistic rows, with `event_batch` decode at 1.48-1.50x pending the borrowed reader. The generated report is the sole numeric source. -- [x] Every normative `[TDBIN-*]` ID has an implementing code reference and a test reference — enforced by `scripts/tdbin-spec-trace.mjs` (84/84 as of 2026-07-12). +- [x] Every normative `[TDBIN-*]` ID has an implementing code reference and a test reference — enforced by `src/scripts/tdbin/tdbin-spec-trace.mjs` (84/84 as of 2026-07-12). ## Audit remediation (2026-07-10) @@ -129,7 +147,7 @@ Complete these in dependency order. Check an item only after its acceptance evid - [x] Generated codecs pin `LAYOUT_HASH`; normal framed decode rejects contradicting advertised hashes automatically; checked encode variants embed the hash; `frozenManifest` covers append-compatible republishing; wrong/missing/pinned-hash paths tested. 3. **Finish TypeScript conformance.** Follow [tdbin-future-typescript.md](../specs/tdbin-future-typescript.md): lossless i64, inline enum-unions and enum lists, every Rust-supported schema form, generated-module execution, Node/browser byte identity, and measured bundle impact. 4. **Finish conformance evidence.** - - [x] Every normative `[TDBIN-*]` requirement has an implementation and a test reference — enforced by `scripts/tdbin-spec-trace.mjs` (84/84). + - [x] Every normative `[TDBIN-*]` requirement has an implementation and a test reference — enforced by `src/scripts/tdbin/tdbin-spec-trace.mjs` (84/84). - [x] `[TDBIN-RS-LOG]` removed from the v1 contract (zero-dependency mandate; resolution recorded in [tdbin-rust-api.md](../specs/tdbin-rust-api.md)). - [ ] Deslop: the repo measures 18.6% duplication against the 15% budget (breached before this work; generated fixture modules add to it). A dedicated dedup pass is required before the scan can join the enforced CI path. 5. **Implement the research performance path.** — columnar + scalar integer blocks DONE 2026-07-12 @@ -156,8 +174,8 @@ make ci ### Ownership map - Wire bytes and compatibility rules: `docs/specs/tdbin-wire-format.md`. -- Rust runtime, verifier, and materializing reader: `crates/tdbin/src/`; Rust conformance: `crates/tdbin/tests/`. -- Shared layout planning and generated codecs: `packages/typediagram/src/converters/`. -- TypeScript runtime and conformance: `packages/typediagram/src/tdbin/` and `packages/typediagram/test/tdbin/`. -- Benchmark payloads and execution: `docs/benchmarks/`, `crates/tdbin/tests/support/`, `crates/tdbin/benches/gate.rs`, and `crates/tdbin/examples/bench.rs`. -- Benchmark artifact generation: `scripts/tdbin-bench-report.mjs`; generated artifacts: `docs/reports/tdbin-bench-{data.json,report.md}`. +- Rust runtime, verifier, and materializing reader: `src/tdbin/src/`; Rust conformance: `src/tdbin/tests/`. +- Shared layout planning and generated codecs: `src/typediagram/src/converters/`. +- TypeScript runtime and conformance: `src/typediagram/src/tdbin/` and `src/typediagram/test/tdbin/`. +- Benchmark payloads and execution: `docs/research/benchmarks/`, `src/tdbin/tests/support/`, `src/tdbin/benches/gate.rs`, and `src/tdbin/examples/bench.rs`. +- Benchmark artifact generation: `src/scripts/tdbin/tdbin-bench-report.mjs`; generated artifacts: `docs/research/reports/tdbin-bench-{data.json,report.md}`. diff --git a/docs/benchmarks/tdbin-corpus.proto b/docs/research/benchmarks/tdbin-corpus.proto similarity index 100% rename from docs/benchmarks/tdbin-corpus.proto rename to docs/research/benchmarks/tdbin-corpus.proto diff --git a/docs/benchmarks/tdbin-corpus.td b/docs/research/benchmarks/tdbin-corpus.td similarity index 100% rename from docs/benchmarks/tdbin-corpus.td rename to docs/research/benchmarks/tdbin-corpus.td diff --git a/docs/research/proofs/AdtCompleteness.lean b/docs/research/proofs/AdtCompleteness.lean new file mode 100644 index 0000000..7d0c828 --- /dev/null +++ b/docs/research/proofs/AdtCompleteness.lean @@ -0,0 +1,281 @@ +/- + Implements [TD-ADT-COMPLETENESS]: every algebraic data type signature has a + typeDiagram encoding that the decoder recovers exactly. + + Checked with plain Lean 4 core (no Mathlib): lean docs/research/proofs/AdtCompleteness.lean + Prose companion: docs/specs/adt-completeness.md +-/ + +namespace AdtTd + +/-! ## Source language: ADT signatures (Haskell 98 `data`, plus empty types) -/ + +/-- A type expression. `var a ts` is a type variable applied to arguments + (`ts = []` for an ordinary variable, non-empty for a higher-kinded one); + `con c ts` applies a type constructor (declared or primitive). -/ +inductive Ty where + | var : String → List Ty → Ty + | con : String → List Ty → Ty + +/-- A data constructor with positional arguments. -/ +structure Ctor where + name : String + args : List Ty + +/-- `data name params = ctor₁ | … | ctorₙ`, where `n = 0` gives an empty type. -/ +structure Data where + name : String + params : List String + ctors : List Ctor + +/-- An ADT signature: a set of mutually recursive data declarations. -/ +abbrev Sig := List Data + +/-! ## Target language: the typeDiagram AST (docs/specs/language-reference.md) -/ + +/-- `TypeRef = Name ("<" TypeRef ("," TypeRef)* ">")?` -/ +inductive TypeRef where + | node : String → List TypeRef → TypeRef + +structure Field where + name : String + type : TypeRef + +/-- `Variant = Name ("=" Number)? ("{" Field* "}")?` -/ +structure Variant where + name : String + discr : Option Int + fields : List Field + +inductive Decl where + | record : String → List String → List Field → Decl + | union : String → List String → List Variant → Decl + | alias : String → List String → TypeRef → Decl + +abbrev Diagram := List Decl + +/-! ## Well-formedness of ADT signatures -/ + +mutual + /-- Variables are bound by `ps`; constructor names are not variables + (in Haskell this is the upper/lower-case split). -/ + def bound (ps : List String) : Ty → Bool + | .var a ts => ps.contains a && boundAll ps ts + | .con c ts => !ps.contains c && boundAll ps ts + def boundAll (ps : List String) : List Ty → Bool + | [] => true + | t :: ts => bound ps t && boundAll ps ts +end + +def ctorBound (ps : List String) (c : Ctor) : Bool := boundAll ps c.args + +def Data.wf (d : Data) : Bool := d.ctors.all (ctorBound d.params) + +def Sig.wf (s : Sig) : Bool := s.all Data.wf + +/-! ## Encoding ⟦·⟧ : Sig → Diagram -/ + +mutual + def encTy : Ty → TypeRef + | .var a ts => .node a (encTys ts) + | .con c ts => .node c (encTys ts) + def encTys : List Ty → List TypeRef + | [] => [] + | t :: ts => encTy t :: encTys ts +end + +/-- Positional argument `i` becomes field `_i`, exactly as the parser + desugars a tuple variant `C(A, B)` into fields `_0: A, _1: B`. -/ +def posFields (i : Nat) : List Ty → List Field + | [] => [] + | t :: ts => ⟨"_" ++ toString i, encTy t⟩ :: posFields (i + 1) ts + +def encCtor (c : Ctor) : Variant := ⟨c.name, none, posFields 0 c.args⟩ + +def encData (d : Data) : Decl := .union d.name d.params (d.ctors.map encCtor) + +def encode (s : Sig) : Diagram := s.map encData + +/-! ## Decoding ⟦·⟧⁻¹ : Diagram → Option Sig -/ + +mutual + def decTy (ps : List String) : TypeRef → Ty + | .node n ts => if ps.contains n then .var n (decTys ps ts) else .con n (decTys ps ts) + def decTys (ps : List String) : List TypeRef → List Ty + | [] => [] + | t :: ts => decTy ps t :: decTys ps ts +end + +def decVariant (ps : List String) (v : Variant) : Ctor := + ⟨v.name, v.fields.map (fun f => decTy ps f.type)⟩ + +/-- Records decode as single-constructor types; aliases are not data. -/ +def decDecl : Decl → Option Data + | .union n ps vs => some ⟨n, ps, vs.map (decVariant ps)⟩ + | .record n ps fs => some ⟨n, ps, [decVariant ps ⟨n, none, fs⟩]⟩ + | .alias .. => none + +def decode (g : Diagram) : Option Sig := g.mapM decDecl + +/-! ## Theorem 1: decoding inverts encoding on well-formed signatures -/ + +mutual + theorem dec_enc_ty (ps : List String) : ∀ t, bound ps t = true → decTy ps (encTy t) = t + | .var a ts, h => by + simp only [bound, Bool.and_eq_true] at h + simp [encTy, decTy, dec_enc_tys ps ts h.2]; simpa using h.1 + | .con c ts, h => by + simp only [bound, Bool.and_eq_true, Bool.not_eq_true'] at h + simp [encTy, decTy, dec_enc_tys ps ts h.2]; simpa using h.1 + theorem dec_enc_tys (ps : List String) : ∀ ts, boundAll ps ts = true → decTys ps (encTys ts) = ts + | [], _ => rfl + | t :: ts, h => by + simp only [boundAll, Bool.and_eq_true] at h + simp [encTys, decTys, dec_enc_ty ps t h.1, dec_enc_tys ps ts h.2] +end + +theorem posFields_types (ps : List String) : + ∀ i ts, (posFields i ts).map (fun f => decTy ps f.type) = decTys ps (encTys ts) + | _, [] => rfl + | i, _ :: ts => by simp [posFields, encTys, decTys, posFields_types ps (i + 1) ts] + +theorem dec_enc_ctor (ps : List String) (c : Ctor) (h : ctorBound ps c = true) : + decVariant ps (encCtor c) = c := by + cases c with + | mk n args => + simp only [ctorBound] at h + simp [decVariant, encCtor, posFields_types, dec_enc_tys ps args h] + +theorem dec_enc_ctors (ps : List String) : + ∀ cs : List Ctor, cs.all (ctorBound ps) = true → (cs.map encCtor).map (decVariant ps) = cs + | [], _ => rfl + | c :: cs, h => by + simp only [List.all_cons, Bool.and_eq_true] at h + simp [dec_enc_ctor ps c h.1, dec_enc_ctors ps cs h.2] + +theorem dec_enc_data (d : Data) (h : d.wf = true) : decDecl (encData d) = some d := by + cases d with + | mk n ps cs => simp [decDecl, encData, dec_enc_ctors ps cs h] + +theorem decode_encode : ∀ s : Sig, s.wf = true → decode (encode s) = some s + | [], _ => rfl + | d :: s, h => by + simp only [Sig.wf, List.all_cons, Bool.and_eq_true] at h + have hs : decode (encode s) = some s := decode_encode s h.2 + simp only [decode, encode] at hs + simp [decode, encode, List.mapM_cons, dec_enc_data d h.1, hs] + +/-- Corollary: distinct well-formed ADTs never share a diagram. -/ +theorem encode_injective (s₁ s₂ : Sig) (h₁ : s₁.wf = true) (h₂ : s₂.wf = true) + (h : encode s₁ = encode s₂) : s₁ = s₂ := by + have e₁ := decode_encode s₁ h₁ + rw [h, decode_encode s₂ h₂] at e₁ + exact (Option.some.inj e₁).symm + +/-! ## Theorem 2: closed signatures encode to fully resolved diagrams + + typeDiagram code generation requires every referenced name to be a primitive + or built-in generic, a declared type, or a generic parameter + (language-reference.md, "Code generation and unknown types"). -/ + +mutual + def namesIn : TypeRef → List String + | .node n ts => n :: namesInAll ts + def namesInAll : List TypeRef → List String + | [] => [] + | t :: ts => namesIn t ++ namesInAll ts +end + +mutual + /-- Every name in a type is a bound variable or in the constructor scope `cs`. -/ + def closedTy (ps cs : List String) : Ty → Bool + | .var a ts => ps.contains a && closedTys ps cs ts + | .con c ts => cs.contains c && closedTys ps cs ts + def closedTys (ps cs : List String) : List Ty → Bool + | [] => true + | t :: ts => closedTy ps cs t && closedTys ps cs ts +end + +mutual + theorem closed_names (ps cs : List String) : + ∀ t, closedTy ps cs t = true → ∀ n ∈ namesIn (encTy t), n ∈ ps ∨ n ∈ cs + | .var a ts, h, n, hn => by + simp only [closedTy, Bool.and_eq_true, List.contains_iff_mem] at h + simp only [encTy, namesIn, List.mem_cons] at hn + rcases hn with rfl | hn + · exact .inl h.1 + · exact closed_names_all ps cs ts h.2 n hn + | .con c ts, h, n, hn => by + simp only [closedTy, Bool.and_eq_true, List.contains_iff_mem] at h + simp only [encTy, namesIn, List.mem_cons] at hn + rcases hn with rfl | hn + · exact .inr h.1 + · exact closed_names_all ps cs ts h.2 n hn + theorem closed_names_all (ps cs : List String) : + ∀ ts, closedTys ps cs ts = true → ∀ n ∈ namesInAll (encTys ts), n ∈ ps ∨ n ∈ cs + | [], _, n, hn => by simp [encTys, namesInAll] at hn + | t :: ts, h, n, hn => by + simp only [closedTys, Bool.and_eq_true] at h + simp only [encTys, namesInAll, List.mem_append] at hn + rcases hn with hn | hn + · exact closed_names ps cs t h.1 n hn + · exact closed_names_all ps cs ts h.2 n hn +end + +theorem posFields_names (ps cs : List String) : + ∀ i ts, closedTys ps cs ts = true → + ∀ f ∈ posFields i ts, ∀ n ∈ namesIn f.type, n ∈ ps ∨ n ∈ cs + | _, [], _, f, hf => by simp [posFields] at hf + | i, t :: ts, h, f, hf => by + simp only [closedTys, Bool.and_eq_true] at h + simp only [posFields, List.mem_cons] at hf + rcases hf with rfl | hf + · exact closed_names ps cs t h.1 + · exact posFields_names ps cs (i + 1) ts h.2 f hf + +/-- The encoding declares exactly the signature's type names. -/ +theorem union_names : + ∀ s : Sig, (encode s).filterMap (fun | .union n .. => some n | _ => none) = s.map Data.name + | [] => rfl + | d :: s => by + have ih := union_names s + simp only [encode] at ih + simp [encode, encData, ih] + +/-- If every constructor a signature mentions is declared in it or is a + built-in, every reference in the encoded diagram resolves. -/ +theorem encode_resolves (builtins : List String) (s : Sig) + (h : ∀ d ∈ s, ∀ c ∈ d.ctors, + closedTys d.params (s.map Data.name ++ builtins) c.args = true) : + ∀ d ∈ s, ∀ v ∈ (encData d |> fun | .union _ _ vs => vs | _ => []), + ∀ f ∈ v.fields, ∀ n ∈ namesIn f.type, + n ∈ d.params ∨ n ∈ (encode s).filterMap (fun | .union n .. => some n | _ => none) ∨ + n ∈ builtins := by + intro d hd v hv f hf n hn + simp only [encData, List.mem_map] at hv + obtain ⟨c, hc, rfl⟩ := hv + rcases posFields_names d.params _ 0 c.args (h d hd c hc) f hf n hn with hp | hp + · exact .inl hp + · right + simp only [List.mem_append] at hp + rcases hp with hp | hp + · left + rw [union_names s]; exact hp + · exact .inr hp + +/-! ## Worked instances (each also runs through the real checker) -/ + +def tA : Ty := .var "A" [] +def nest : Data := ⟨"Nest", ["A"], [⟨"Nil", []⟩, + ⟨"Cons", [tA, .con "Nest" [.con "Pair" [tA]]]⟩]⟩ +def fix : Data := ⟨"Fix", ["F"], [⟨"In", [.var "F" [.con "Fix" [.var "F" []]]]⟩]⟩ +def void : Data := ⟨"Void", [], []⟩ + +example : decode (encode [nest, fix, void]) = some [nest, fix, void] := + decode_encode _ (by decide +kernel) + +#print axioms decode_encode +#print axioms encode_injective +#print axioms encode_resolves + +end AdtTd diff --git a/docs/research/proofs/README.md b/docs/research/proofs/README.md new file mode 100644 index 0000000..94de795 --- /dev/null +++ b/docs/research/proofs/README.md @@ -0,0 +1,47 @@ +# Proofs + +## typeDiagram can express every algebraic data type + +[`AdtCompleteness.lean`](AdtCompleteness.lean) is a machine-checked proof that every algebraic data type (ADT) can be written in typeDiagram markup, with nothing lost. The prose version, with the exact scope, is [ADT completeness](../specs/adt-completeness.md). + +### Why it matters + +ADTs are how most modern languages model data. Rust and Swift enums, F# and OCaml unions, Haskell `data`, Kotlin sealed classes and TypeScript discriminated unions are all ADTs. A schema language that can describe only some of them pushes people into lossy workarounds, such as turning a union into a record of nullable fields, or flattening a recursive type. Generated code then permits states the original model ruled out. + +The proof gives three guarantees: + +1. **Nothing is lost.** Any ADT can be written as a typeDiagram diagram, and the diagram can be read back into exactly the original ADT. That includes empty types, unit types, sums, products, recursive and mutually recursive types, generic and phantom parameters, nested types such as `Nest>`, and higher-kinded parameters such as `Fix`. A diagram is therefore a faithful single source of truth that every converter can generate from. +2. **Nothing collides.** Two different ADTs never produce the same diagram, so the diagram never merges two models into one. +3. **The checker accepts every encoded ADT.** If every type an ADT mentions is declared or built in, its diagram passes the code-generation checks for unknown names and type arity. The encoding never produces markup that typeDiagram's own checker rejects. + +These results are proved, not just tested. Lean checks every step, the proof contains no `sorry`, and it relies only on Lean's standard axioms (`propext` and `Quot.sound`). + +### Proved and then run through the real parser + +A proof is only as good as its model of the language. [`adt-completeness.test.ts`](../../src/typediagram/test/adt-completeness.test.ts) therefore runs the same encoding through the real parser and checker: + +- 400 seeded random ADTs that respect type arity, plus fixed cases for each kind of type listed above. +- Each one is parsed, decoded back, compared with the original, and resolved for Rust and TypeScript code generation. +- A negative control confirms the checker rejects an undeclared type, so the test is not passing vacuously. + +### What it found + +The markup can express every ADT, but some converters cannot yet turn every diagram into valid code: + +- **Rust:** `--to rust` emits recursive variants without a `Box`, and emits higher-kinded parameters such as `F>`. rustc rejects both. +- **TypeScript:** `--to typescript` emits `export type Void = | ;` for an empty union instead of `never`. + +### What it does not cover + +These fall outside the definition of an ADT used here, and typeDiagram cannot express them today: + +- function-typed fields, such as `Int -> Int`; +- GADTs and existential types; +- type-class constraints. + +### Run it + +```sh +lean docs/research/proofs/AdtCompleteness.lean +cd src/typediagram && npx vitest run test/adt-completeness.test.ts +``` diff --git a/docs/reports/tdbin-bench-data.json b/docs/research/reports/tdbin-bench-data.json similarity index 98% rename from docs/reports/tdbin-bench-data.json rename to docs/research/reports/tdbin-bench-data.json index 74d7ef2..8c29b41 100644 --- a/docs/reports/tdbin-bench-data.json +++ b/docs/research/reports/tdbin-bench-data.json @@ -1,8 +1,8 @@ { "format_version": 1, "generated_at": "2026-07-13T23:32:23.773Z", - "commands": ["cargo bench -p tdbin --bench gate -- --noplot", "node scripts/tdbin-bench-report.mjs"], - "corpus_schemas": ["docs/benchmarks/tdbin-corpus.td", "docs/benchmarks/tdbin-corpus.proto"], + "commands": ["cargo bench -p tdbin --bench gate -- --noplot", "node src/scripts/tdbin/tdbin-bench-report.mjs"], + "corpus_schemas": ["docs/research/benchmarks/tdbin-corpus.td", "docs/research/benchmarks/tdbin-corpus.proto"], "gate": { "size_ratio_max": 1, "encode_speed_ratio_min": 1.5, @@ -18,7 +18,7 @@ "memory_bytes": 38654705664, "rustc": "rustc 1.97.0 (2d8144b78 2026-07-07)", "cargo": "cargo 1.97.0 (c980f4866 2026-06-30)", - "dependencies": "tdbin v0.0.0 (/Users/christianfindlay/Documents/Code/typeDiagram/crates/tdbin)\n[dev-dependencies]\n├── criterion v0.8.2\n├── prost v0.14.3\n├── rmp-serde v1.3.1\n└── serde v1.0.228" + "dependencies": "tdbin v0.0.0 (/Users/christianfindlay/Documents/Code/typeDiagram/src/tdbin)\n[dev-dependencies]\n├── criterion v0.8.2\n├── prost v0.14.3\n├── rmp-serde v1.3.1\n└── serde v1.0.228" }, "sizes": { "format_version": 1, diff --git a/docs/reports/tdbin-bench-report.md b/docs/research/reports/tdbin-bench-report.md similarity index 94% rename from docs/reports/tdbin-bench-report.md rename to docs/research/reports/tdbin-bench-report.md index bc57852..a1c5617 100644 --- a/docs/reports/tdbin-bench-report.md +++ b/docs/research/reports/tdbin-bench-report.md @@ -1,6 +1,6 @@ # TDBIN Benchmark Report -> GENERATED FILE. Source: `scripts/tdbin-bench-report.mjs` and `docs/reports/tdbin-bench-data.json`. +> GENERATED FILE. Source: `src/scripts/tdbin/tdbin-bench-report.mjs` and `docs/research/reports/tdbin-bench-data.json`. > Every value and verdict is computed from machine-readable Criterion and encoder output. No benchmark result is entered manually. Generated: 2026-07-13T23:32:23.773Z @@ -13,7 +13,7 @@ Raw data SHA-256: `46c48e4a8ae7f959b364576d3592682bd96f1257dd266fa8810cbb15c18fb Qualifying modes: `with_address` = none, `without_address` = none, `metric_batch` = framed, `person_batch` = framed, `contact_batch` = framed & packed framed, `diagram_document` = framed, `event_batch` = none. -The release gate ([TDBIN-BENCH-GATE]) requires, for every corpus entry — the committed realistic schemas in `docs/benchmarks/tdbin-corpus.{td,proto}` (record-heavy document, union-heavy event stream, list-heavy dataset) — that at least one self-describing production wire mode (framed, or packed framed; the frame's PACKED flag makes the two interchangeable to every decoder) beats Protobuf on size and by 1.50x on both encode and decode simultaneously. Both modes are always measured and published below. Stress rows (marked) are reported against the identical bar; the tiny single-message rows carry a fixed 12-byte frame plus pointer-per-string overhead that no fixed-layout format recovers at sub-100-byte payloads (research §2.2), so they are not corpus entries. +The release gate ([TDBIN-BENCH-GATE]) requires, for every corpus entry — the committed realistic schemas in `docs/research/benchmarks/tdbin-corpus.{td,proto}` (record-heavy document, union-heavy event stream, list-heavy dataset) — that at least one self-describing production wire mode (framed, or packed framed; the frame's PACKED flag makes the two interchangeable to every decoder) beats Protobuf on size and by 1.50x on both encode and decode simultaneously. Both modes are always measured and published below. Stress rows (marked) are reported against the identical bar; the tiny single-message rows carry a fixed 12-byte frame plus pointer-per-string overhead that no fixed-layout format recovers at sub-100-byte payloads (research §2.2), so they are not corpus entries. ## Size and Speed @@ -43,7 +43,7 @@ The headline comparison — one row per test, all three self-describing formats Dependency tree: ```text -tdbin v0.0.0 (/Users/christianfindlay/Documents/Code/typeDiagram/crates/tdbin) +tdbin v0.0.0 (/Users/christianfindlay/Documents/Code/typeDiagram/src/tdbin) [dev-dependencies] ├── criterion v0.8.2 ├── prost v0.14.3 @@ -177,9 +177,9 @@ This secondary table exposes unpacked tradeoffs; it does not replace the packed- ## Commands - `cargo bench -p tdbin --bench gate -- --noplot` -- `node scripts/tdbin-bench-report.mjs` +- `node src/scripts/tdbin/tdbin-bench-report.mjs` Corpus schemas: -- `docs/benchmarks/tdbin-corpus.td` -- `docs/benchmarks/tdbin-corpus.proto` +- `docs/research/benchmarks/tdbin-corpus.td` +- `docs/research/benchmarks/tdbin-corpus.proto` diff --git a/docs/reports/tdbin-implementation-audit.md b/docs/research/reports/tdbin-implementation-audit.md similarity index 98% rename from docs/reports/tdbin-implementation-audit.md rename to docs/research/reports/tdbin-implementation-audit.md index ffdf549..0350c4c 100644 --- a/docs/reports/tdbin-implementation-audit.md +++ b/docs/research/reports/tdbin-implementation-audit.md @@ -118,7 +118,7 @@ The list-heavy metric fixture is deliberately favorable to fixed words: its large integer IDs require long Protobuf varints, and its numeric/bool columns create many packable zero bytes. It is a valid fixed workload, but it is not evidence of a general serialization win. The document and event rows execute -the paired schemas committed under `docs/benchmarks/`, rather than proxying +the paired schemas committed under `docs/research/benchmarks/`, rather than proxying those workload shapes. ## Profiler Results @@ -192,7 +192,7 @@ numeric authority. tests that also flushed out and fixed a latent generated-encode bug), 1-bit `Option` presence via one shared cross-language allocator, automatic layout-hash emission and enforcement, normative-ID traceability - (84/84 via `scripts/tdbin-spec-trace.mjs`). + (84/84 via `src/scripts/tdbin/tdbin-spec-trace.mjs`). ### Measured outcome (see the generated report for numbers) diff --git a/docs/specs/adt-completeness.md b/docs/specs/adt-completeness.md new file mode 100644 index 0000000..f9aa815 --- /dev/null +++ b/docs/specs/adt-completeness.md @@ -0,0 +1,118 @@ +# ADT completeness [TD-ADT-COMPLETENESS] + +**Claim.** Every algebraic data type signature can be written in typeDiagram, and the written form determines the original signature exactly. + +The proof is checked by Lean 4 in [`docs/research/proofs/AdtCompleteness.lean`](../proofs/AdtCompleteness.lean), using only Lean core and its standard axioms `propext` and `Quot.sound`. It contains no `sorry`. The real parser and code-generation checker run the same encoding in [`adt-completeness.test.ts`](../../src/typediagram/test/adt-completeness.test.ts). + +## What counts as an ADT [TD-ADT-COMPLETENESS-SCOPE] + +An ADT signature is a finite set of mutually recursive declarations in the style of Haskell 98 `data`, plus empty types: + +``` +data T a₁ … aₖ = C₁ τ₁₁ … τ₁ₘ | … | Cₙ τₙ₁ … τₙₘ (n ≥ 0) +τ ::= a τ₁ … τⱼ (a type variable, possibly higher-kinded, j ≥ 0) + | K τ₁ … τⱼ (a declared type or a primitive, j ≥ 0) +``` + +This grammar produces all of the following: + +- the empty type (`n = 0`) and the unit type (one constructor with no arguments); +- sums, products and their combinations; +- direct recursion and mutual recursion; +- parametric types and phantom parameters; +- nested (non-regular) types such as `Nest a = Nil | Cons a (Nest (Pair a))`; +- higher-kinded parameters such as `Fix f = In (f (Fix f))`. + +Semantically, each declaration is an equation `T(ā) = Σᵢ Πⱼ τᵢⱼ`, and the signature denotes the least solution of that system of polynomial equations. + +The signature is **well-formed** when two conditions hold: + +- every variable in a declaration is one of its own parameters; +- no type constructor name is also a parameter name. In Haskell, the upper-case and lower-case split guarantees this. + +Record syntax and strictness annotations are notation over this grammar. Named fields map directly onto typeDiagram fields. + +## Encoding [TD-ADT-COMPLETENESS-ENCODING] + +The encoding ⟦·⟧ maps each signature to a typeDiagram diagram as follows: + +- **Declarations:** `data T a₁ … aₖ` becomes `union T { … }`, with the `<…>` omitted when `k = 0`. +- **Constructors:** constructor `C τ₀ … τₘ` becomes the variant `C { _0: ⟦τ₀⟧, …, _m: ⟦τₘ⟧ }`, or a bare `C` when `m = 0`. + - The tuple form `C(⟦τ₀⟧, …)` parses to exactly the same AST. The parser itself desugars positional payloads into fields named `_0`, `_1`, and so on. +- **Types:** `⟦a τ₁ … τⱼ⟧` and `⟦K τ₁ … τⱼ⟧` both become `Name<⟦τ₁⟧, …, ⟦τⱼ⟧>`, with the `<…>` omitted when `j = 0`. + +Every production used here belongs to the typeDiagram grammar in [language-reference.md](language-reference.md#grammar-formal): + +- `Union` allows `Variant*`, so zero variants is legal; +- `Variant` allows an optional field block; +- `TypeRef` nests arbitrarily; +- `Generics` binds the parameters. + +For example, the empty type, a nested type and a higher-kinded fixed point are written like this: + +```typediagram +union Void {} +type Pair { _0: A, _1: A } +union Nest { + Nil + Cons(A, Nest>) +} +union Fix { In(F>) } +``` + +## Theorem 1: the encoding loses nothing [TD-ADT-COMPLETENESS-ROUNDTRIP] + +Define the decoder ⟦·⟧⁻¹ as follows: + +- A union `T<ā>` decodes to `data T ā` with one constructor per variant, taking the field types in order. +- A `TypeRef` `n<…>` decodes to the variable `n` when `n ∈ ā`, and to the type constructor `n` otherwise. + +**Theorem.** For every well-formed signature `s`, `⟦⟦s⟧⟧⁻¹ = s`. In Lean this is `decode_encode`. + +_Proof._ The proof is by mutual structural induction over types and lists of types. + +1. **Type expressions.** Consider a variable `a`. Well-formedness gives `a ∈ ā`, so the decoder returns a variable, and by induction its arguments decode to the originals. Now consider a constructor `K`. Well-formedness gives `K ∉ ā`, so the decoder returns a constructor, and again its arguments decode to the originals. +2. **Constructors.** Field `_i` holds `⟦τᵢ⟧`, and the decoder reads field types in order. The names `_i` are discarded, so constructor arguments are recovered (lemma `posFields_types`). +3. **Declarations and signatures.** These follow by induction on the lists, because a union keeps its name and parameters verbatim. ∎ + +**Corollary (`encode_injective`).** Distinct well-formed ADTs have distinct diagrams. Together with Theorem 1, this means typeDiagram can express every ADT in the class, and no two of them collapse into one diagram. + +**Semantics.** The decoder recovers the exact system of equations `T(ā) = Σᵢ Πⱼ τᵢⱼ`. typeDiagram's own reading assigns the same meaning to each part: + +- a union is a tagged choice among its variants; +- a variant's fields are a product; +- a name refers to its declaration. + +So the encoded diagram denotes the same system of equations, and therefore the same least solution. + +## Theorem 2: the encoding passes code generation [TD-ADT-COMPLETENESS-RESOLVES] + +Code generation rejects any reference that is not one of these: + +- a primitive; +- a built-in generic; +- a declared type; +- a generic parameter. + +**Theorem.** Suppose every constructor that a signature uses is either declared in the signature or is a built-in. Then every name in the encoded diagram is a parameter of its declaration, a declared union, or a built-in. In Lean this is `encode_resolves`, proved with `closed_names` and `union_names`. + +Theorem 1 preserves every application's argument list exactly, so it also preserves the arity of each application. The checker's arity rule ("type 'T' takes k type argument(s)") therefore accepts any well-kinded signature. + +## Machine checks [TD-ADT-COMPLETENESS-CHECKS] + +| Check | Command | Result | +| ----------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Lean proof | `lean docs/research/proofs/AdtCompleteness.lean` | Theorems 1 and 2 and the corollary check. `#print axioms` lists only `propext` and `Quot.sound`. | +| Real parser and checker | `npx vitest run test/adt-completeness.test.ts` in `src/typediagram` | 400 seeded random well-kinded signatures (1–4 declarations, 0–3 parameters including one of kind `* → *`, 0–4 constructors, 0–3 arguments, type depth up to 3, tuple and braced variants mixed) pass. Each one parses, decodes back exactly, and resolves for both Rust and TypeScript code generation. The six fixed cases pass: empty, unit, nested, mutual, higher-kinded and phantom. | +| Negative control | same test | `MkBad(Missing)` fails resolution, so the check is not vacuous. | +| CLI | `typediagram FILE` and `typediagram --to rust FILE` | The empty, unit, tuple, nested, mutual and higher-kinded samples all render and convert. | + +## Outside the class [TD-ADT-COMPLETENESS-LIMITS] + +These are not ADTs in the sense above, and typeDiagram cannot express them faithfully today: + +- **Function-typed fields** (exponentials, such as `data F = F (Int -> Int)`). A `TypeRef` has no arrow form. A `function` declaration names a signature but is not a field type. +- **GADTs, existential types and class constraints.** Variants cannot refine or quantify type parameters. +- **Kinds of variable applications are not checked.** `F` is accepted for any parameter `F`. This makes typeDiagram more permissive than ADTs; it does not make it less expressive. + +The proof covers the markup. It does not show that every target-language converter can express every ADT. For example, `--to rust` emits `Cons(A, Nest>)` without a `Box` and emits `F>` for a higher-kinded parameter, and rustc rejects both. `--to typescript` emits `export type Void = | ;` for the empty union instead of `never`. These are defects in the converters, not limits of typeDiagram. diff --git a/docs/specs/cli.md b/docs/specs/cli.md index 7ba30b2..3b7d758 100644 --- a/docs/specs/cli.md +++ b/docs/specs/cli.md @@ -55,6 +55,25 @@ typediagram --config typediagram.json `"watch": true` performs initial generation and then watches the source. `--watch` enables the same behavior from the command line when the config omits it. Each valid save regenerates every selected language. Invalid source reports diagnostics without overwriting the last good generated files; the watcher recovers automatically after the next valid save. +### TDBIN codecs in the config [CLI-CONFIG-TDBIN] + +Add a `tdbin` object to emit codec modules from the same parse as `outputs`. Under `--watch`, one save regenerates types and codecs together, so their layout hashes can't drift apart: + +```json +{ + "source": "docs/models/wire.td", + "outputs": { "rust": "crates/core/src/wire_types.rs", "typescript": "client/src/wire-types.ts" }, + "tdbin": { + "rust": { "path": "crates/core/src/wire_codec.rs", "mode": "codec-only" }, + "typescript": "client/src/wire.ts" + } +} +``` + +- `rust` mode `"full"` (the default) matches `typediagram encode`: ADT types plus `impl tdbin::Struct`. `"codec-only"` matches `typediagram decode`: impls only, for types emitted elsewhere. +- `typescript` matches `typediagram encode --to typescript` and supports only `"full"`. +- A plain string is shorthand for `{ "path": …, "mode": "full" }`. `outputs` may be omitted when `tdbin` selects at least one target. + ## Examples ### Render typeDiagram to SVG diff --git a/docs/specs/converters.md b/docs/specs/converters.md index 26da450..557f974 100644 --- a/docs/specs/converters.md +++ b/docs/specs/converters.md @@ -104,6 +104,15 @@ The dedicated `typeshed` converter parses `.pyi` syntax with a Python concrete s Supports struct variants, tuple variants, and unit variants in enums. Generic bounds (e.g. `T: Clone`) are parsed but bounds are dropped (only the type parameter name is kept). +### Lint-clean output [CONV-RUST-IDIOM] + +`--to rust` output compiles under `cargo clippy -- -D warnings`: + +- Every struct and enum derives `Debug, Clone, PartialEq`. +- Field names are snake_case (`typeText` → `type_text`, `isHTTPServer` → `is_http_server`). When the name changes, `#[serde(rename = "typeText")]` keeps the schema name as the JSON name, and reading the Rust back restores `typeText`. +- If any type in the output carries a serde attribute (a renamed field or `untagged`), every type in that output also derives `serde::Serialize, serde::Deserialize`, because a serialisable type needs serialisable contents. Add `serde` (with `derive`) to the crate in that case. All-snake_case schemas need no serde. +- The TDBIN module (`typediagram encode`) uses the same declarations and adds `Default` to records. + ## Go ### What maps @@ -163,6 +172,10 @@ F# discriminated unions map directly. Record syntax is used for struct types. Uses Dart 3 `sealed class` for tagged unions. First-class generics are preserved. +### Record typedefs [CONV-DART-RECORD] + +`typedef SessionData = ({String draft, String phase});` imports as `type SessionData { draft: String phase: String }`. Generic and nullable fields keep their types (`Map`, `Set` → `List`, `int?` → `Option`). Function types (`void Function(String)`) and positional record fields (`(int, int)`) have no typeDiagram equivalent, so the import fails, listing every offending declaration, instead of emitting invalid `.td`. + ## PHP ### What maps diff --git a/docs/specs/language-reference.md b/docs/specs/language-reference.md index 324cd61..051418b 100644 --- a/docs/specs/language-reference.md +++ b/docs/specs/language-reference.md @@ -122,6 +122,20 @@ These primitive types are always available (no declaration needed): | `Bytes` | Binary data | | `Unit` | No value (void) | +### Exact TypeScript integer types [CONV-TS-EXACT-INTEGERS] + +The framework API `converters.typescript.toSource(model, { integerType: "bigint" })` emits `bigint` for built-in `Int`, including aliases, optional values, containers and union payloads; `Float` stays `number`. The default remains `number`. Reading TypeScript `bigint` maps back to `Int`. This is a model-generation option, not a CLI flag or a runtime validator: consumers must enforce their protocol's bounds and decode integers without first converting through JavaScript `number`. Ordinary JSON number parsing cannot preserve all 64-bit identities, and ordinary JSON stringification does not support bigint. Shared-memory and binary adapters need exact integer accessors and explicit range checks; model declarations alone do not supply them. + +The TypeScript tdbin runtime scalar writer `i64Bits` accepts safe integer numbers or bigint values in the inclusive signed-64-bit range. It rejects overflow before producing unsigned wire bits; negative zero normalizes to zero. Exact readers use the raw bigint word with signed interpretation, never the number-returning `i64From` convenience function. `emitTypeScriptCodec(model, { integerType: "bigint" })` and `generateTypeScriptModule` with the same option produce exact bigint readers and bigint record defaults, including optional integers and child defaults. The option changes the JavaScript representation, not the wire layout; supported shapes and wire bounds are unchanged. Model generation alone does not enable this option on separately generated codecs. + +### Osprey model generation [CONV-OSPREY] + +`generateOspreyModule(model)` (imported from `typediagram-core/converters/osprey`) returns a Result containing Osprey ML declarations or diagnostics. It reuses the common target-aware declaration walker for records, unions and aliases, including generic references, List, Option and Result. Int maps to int, Float to float, Bool to bool, String and Uuid to string, and Unit to unit. UUID formatting and protocol bounds remain boundary validation responsibilities. Unsupported scalar mappings, external types, empty records/unions, functions, reserved identifiers and conflicting constructor names are rejected instead of silently renamed or omitted. This is a one-way model emitter, not a source parser, CLI converter, binary codec or fixed-layout ABI generator. + +### Swift model generation [CONV-SWIFT] + +`converters.generateSwiftModule(model)` returns a Result containing monomorphic, acyclic Swift model declarations or diagnostics. Records have immutable public fields and explicit public initializers so consuming modules can construct them; enums preserve named associated values and aliases preserve their names. Identifiers are backtick-escaped. Int maps to Int64, Float to Double, Uuid to Foundation UUID, String/Bool/Unit to String/Bool/Void, List to Array syntax and Option to optional syntax. The module imports Foundation. Unsupported external/scalar mappings, generic declarations, functions and recursive dependency graphs are rejected. Recursive UI model support remains outstanding; no implicit boxing layer is inserted. This API produces logical models, not Codable conformance, canonical wire encodings, fixed-layout shared views or a two-way CLI converter. + ### Semantic scalars Three semantic scalars are also built in. They render like any other primitive, but code generation maps each one to the **native** date / UUID / decimal type of the target language — so a timestamp or an id keeps its real type instead of degrading to a plain string. @@ -132,6 +146,22 @@ Three semantic scalars are also built in. They render like any other primitive, | `Uuid` | `uuid.UUID` | `Guid` | `string` | `uuid::Uuid` | `string` | `String` | `string` | `string` | | `Decimal` | `decimal.Decimal` | `decimal` | `string` | `rust_decimal::Decimal` | `string` | `String` | `string` | `string` | +### Width-refined integers and `Path` [MODEL-WIDTH] + +`Int` is a signed 64-bit integer. When a field needs a narrower or unsigned range, use a width-refined integer. Code generation emits the closest native type, and the TDBIN codecs range-check every value on encode and decode, failing with a typed error instead of truncating ([TDBIN-FUTURE-WIDTH-TYPES]). `Path` is a file-system path: a UTF-8 string on the wire and in most languages, and `std::path::PathBuf` in Rust. + +| typeDiagram | Range | Rust | TypeScript | C# | F# | Go | Protobuf | Swift | +| ----------- | ---------- | -------------------- | ---------- | -------- | -------- | -------- | -------- | -------- | +| `I32` | −2³¹…2³¹−1 | `i32` | `number` | `int` | `int` | `int32` | `int32` | `Int32` | +| `U8` | 0…255 | `u8` | `number` | `byte` | `byte` | `uint8` | `uint32` | `UInt8` | +| `U16` | 0…65535 | `u16` | `number` | `ushort` | `uint16` | `uint16` | `uint32` | `UInt16` | +| `U32` | 0…2³²−1 | `u32` | `number` | `uint` | `uint32` | `uint32` | `uint32` | `UInt32` | +| `U64` | 0…2⁶⁴−1 | `u64` | `bigint` | `ulong` | `uint64` | `uint64` | `uint64` | `UInt64` | +| `Size` | 0…2⁶⁴−1 | `usize` | `number` | `ulong` | `uint64` | `uint` | `uint64` | `UInt` | +| `Path` | UTF-8 text | `std::path::PathBuf` | `string` | `string` | `string` | `string` | `string` | `String` | + +Python, Typeshed, Dart, PHP and Osprey have one integer type, so every width maps to `int` there. Protobuf has no 8- or 16-bit integers, so `U8`/`U16` widen to `uint32`. Reading Rust source back maps `i32`/`u8`/`u16`/`u32`/`u64`/`usize`/`PathBuf` to these types. + A declaration that reuses a built-in name shadows it: `alias Uuid = String` makes `Uuid` mean `String` again. Declared names always win over built-ins, so existing schemas never break. ## Container types @@ -201,3 +231,11 @@ Number = "-"? [0-9] ([0-9_]* [0-9])? ``` The grammar is LL(1) with ~6 productions. Newlines and commas both work as separators inside `{ }` blocks. + +### Native C# integer models [CONV-CS-INTEGER-WIDTH] + +`converters.csharp.toSource(model, { integerWidth: 64 })` emits `long` for Int through aliases, optional values, containers and union payloads; the default is 32-bit `int`. Aliases precede declarations, and generated alias-order comments preserve round-trip ordering. UUID aliases use `System.Guid`. Logical records are not shared-memory layouts: range validation and generated ABI views remain separate responsibilities. + +### Explicit native generator entry points [CONV-SHARED-LAYOUT] + +Native build tooling imports `generateSwiftModule` from `typediagram-core/converters/swift` and `generateSharedLayout` from `typediagram-core/converters/shared-layout`. These build-time generators are deliberately absent from the default browser converter registry. The Swift emitter currently supports monomorphic acyclic logical models. The shared-layout generator returns a profile-specific manifest and exact SHA-256 fingerprint; it does not grant ownership or validate borrowed memory. Neither API supplies host runtime views or completes a bridge migration. diff --git a/docs/specs/pdf-export.md b/docs/specs/pdf-export.md index 2787556..f387ce7 100644 --- a/docs/specs/pdf-export.md +++ b/docs/specs/pdf-export.md @@ -42,7 +42,7 @@ This spec pins down the exact pipeline, the dependency footprint, and the verifi ### `typediagram.exportMarkdownPdf` -- **Registered in:** `packages/vscode/src/extension.ts` via `vscode.commands.registerCommand`. +- **Registered in:** `src/vscode/src/extension.ts` via `vscode.commands.registerCommand`. - **Argument:** optional `vscode.Uri`. If omitted, falls back to `vscode.window.activeTextEditor.document.uri`. - **Valid when:** `resourceLangId == markdown`. No-op otherwise. - **UI surfaces:** @@ -142,7 +142,7 @@ A task is done when ALL of the following pass: ### Integration (black-box) -- Invoking `vscode.commands.executeCommand('typediagram.exportMarkdownPdf', uri)` on [`packages/vscode/examples/doc.md`](../../packages/vscode/examples/doc.md) produces a PDF whose byte size is within ±10% of a golden snapshot (seed PDF checked in, regenerated when the golden changes intentionally). +- Invoking `vscode.commands.executeCommand('typediagram.exportMarkdownPdf', uri)` on [`src/vscode/examples/doc.md`](../../src/vscode/examples/doc.md) produces a PDF whose byte size is within ±10% of a golden snapshot (seed PDF checked in, regenerated when the golden changes intentionally). - The generated PDF can be opened by `open` (macOS), `xdg-open` (Linux), `start` (Windows) — we assert it's readable by reading back the first 1024 bytes. - All existing markdown-preview behaviour (fence highlighting, live preview rendering) continues to work — no regressions. diff --git a/docs/specs/render-hooks.md b/docs/specs/render-hooks.md index 751901b..934da60 100644 --- a/docs/specs/render-hooks.md +++ b/docs/specs/render-hooks.md @@ -2,14 +2,14 @@ ## Context -The SVG renderer ([`packages/typediagram/src/render-svg/render.ts`](../../packages/typediagram/src/render-svg/render.ts)) emits fixed markup: rounded rects, a header strip, row dividers, a `◇` glyph for union variants, orthogonal polylines. Theming is limited to colors via `Theme`. Consumers who want per-field coloring, icons, drop shadows, custom glyphs, pattern fills, conditional classes, or — critically — **absolute positioning** cannot reach into the pipeline. A CSS layer could only restyle what the renderer already emits; it cannot inject ``, replace geometry, or decide what to draw based on the semantic model (declKind, field name, edge kind). +The SVG renderer ([`src/typediagram/src/render-svg/render.ts`](../../src/typediagram/src/render-svg/render.ts)) emits fixed markup: rounded rects, a header strip, row dividers, a `◇` glyph for union variants, orthogonal polylines. Theming is limited to colors via `Theme`. Consumers who want per-field coloring, icons, drop shadows, custom glyphs, pattern fills, conditional classes, or — critically — **absolute positioning** cannot reach into the pipeline. A CSS layer could only restyle what the renderer already emits; it cannot inject ``, replace geometry, or decide what to draw based on the semantic model (declKind, field name, edge kind). This spec defines **Render Hooks**: a typed, phase-based extension API that lets JavaScript callbacks inspect the laid-out graph and emit or transform SVG at well-defined points. Hooks are strictly more powerful than CSS: they see the model, receive resolved geometry, and can return arbitrary (safe) SVG. ## Design principles 1. **Semantic input.** Hooks receive `NodeBox`, `EdgeRoute`, `NodeRow` plus computed geometry (absolute x/y with padding baked in, theme, fontSize). No DOM, no selectors — the model itself is the selector. -2. **Typed SVG output only.** Hooks return `SafeSvg` (see [svg-tag.ts](../../packages/typediagram/src/render-svg/svg-tag.ts)), not raw strings. XSS guarantees of the `svg`\`...\` tagged template extend to hook output. Returning `undefined` means "use default". +2. **Typed SVG output only.** Hooks return `SafeSvg` (see [svg-tag.ts](../../src/typediagram/src/render-svg/svg-tag.ts)), not raw strings. XSS guarantees of the `svg`\`...\` tagged template extend to hook output. Returning `undefined` means "use default". 3. **Override-with-default pattern.** Transform hooks receive the default `SafeSvg` and can wrap, prepend, append, or replace it. 90% of customization is "decorate the default". 4. **Phase-based, not event-based.** Fixed set of phases, each with a precise contract. No catch-all `onRender`. 5. **Pure functions.** Hooks must not mutate inputs, must not retain state between calls, must be deterministic given inputs. Same graph + hooks = byte-identical SVG. @@ -146,7 +146,7 @@ interface SvgOpts { } ``` -Hooks are exported from [`packages/typediagram/src/render-svg/index.ts`](../../packages/typediagram/src/render-svg/index.ts) alongside `renderSvg`. +Hooks are exported from [`src/typediagram/src/render-svg/index.ts`](../../src/typediagram/src/render-svg/index.ts) alongside `renderSvg`. ## Safety @@ -162,11 +162,11 @@ Hooks are exported from [`packages/typediagram/src/render-svg/index.ts`](../../p Three strictly-stacked layers. Each layer knows nothing about the one above it. **Breaking this layering is a review-rejection.** -| Layer | Name | Artifact | Location | Who depends on it | -| ----------- | --------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------- | ----------------------------- | -| **Layer 1** | `RenderHooks` — core API | TypeScript `RenderHooks` interface + phase invocation inside `renderSvg` | `packages/typediagram/src/render-svg` | everyone | -| **Layer 2** | Hook **code** (user JS) | A string of JavaScript the user writes; compiled to a Layer-1 `RenderHooks` object | `packages/web/src/eval-hooks.ts` | Layer 3, playground, docs | -| **Layer 3** | **Presets** — code snippets | Named strings of Layer-2 JS (with `// --- preset: ---` delimiters) | `packages/web/src/hook-presets.ts` | the playground's chip UI only | +| Layer | Name | Artifact | Location | Who depends on it | +| ----------- | --------------------------- | ---------------------------------------------------------------------------------- | -------------------------------- | ----------------------------- | +| **Layer 1** | `RenderHooks` — core API | TypeScript `RenderHooks` interface + phase invocation inside `renderSvg` | `src/typediagram/src/render-svg` | everyone | +| **Layer 2** | Hook **code** (user JS) | A string of JavaScript the user writes; compiled to a Layer-1 `RenderHooks` object | `src/web/src/eval-hooks.ts` | Layer 3, playground, docs | +| **Layer 3** | **Presets** — code snippets | Named strings of Layer-2 JS (with `// --- preset: ---` delimiters) | `src/web/src/hook-presets.ts` | the playground's chip UI only | ### Layer 1 — `RenderHooks` (core) diff --git a/crates/README.md b/docs/specs/rust-workspace.md similarity index 90% rename from crates/README.md rename to docs/specs/rust-workspace.md index fd631c4..791a828 100644 --- a/crates/README.md +++ b/docs/specs/rust-workspace.md @@ -11,7 +11,7 @@ Every crate MUST inherit the shared strict lint table by adding this to its own workspace = true ``` -- **Formatting** is governed by the root `rustfmt.toml` (`cargo fmt`). +- **Formatting** is governed by `src/rustfmt.toml` (`cargo fmt`). - **Linting** is governed by the root `Cargo.toml` `[workspace.lints]` — all lints on and up to `deny`, per REPO-STANDARDS-SPEC `[LINT-RUST]`. diff --git a/docs/specs/spec.md b/docs/specs/spec.md index 3b23956..8c7a18d 100644 --- a/docs/specs/spec.md +++ b/docs/specs/spec.md @@ -215,7 +215,7 @@ Browser and Node share **identical code paths** in every layer (no conditional i ### Source layout ```` -packages/typediagram/ +src/typediagram/ src/ parser/ lexer.ts # token stream with {line, col, offset} @@ -339,7 +339,7 @@ export function renderMarkdown(md: string, opts?: AllOpts): Promise **Scope: these figures are for the Rust implementation only.** Both the encoded sizes and the speeds are measured against the Rust `tdbin` codec crate ([`crates/tdbin`](https://github.com/Nimblesite/typeDiagram/blob/main/crates/tdbin)), the Rust `prost` Protobuf encoder, and the Rust `rmp-serde` MessagePack encoder. The TDBIN **wire format** and its byte sizes are language-neutral, but serialize/deserialize **speeds** depend on each language's implementation — typeDiagram's other codec targets, and other Protobuf/MessagePack libraries, will differ, sometimes substantially. +> **Scope: these figures are for the Rust implementation only.** Both the encoded sizes and the speeds are measured against the Rust `tdbin` codec crate ([`src/tdbin`](https://github.com/Nimblesite/typeDiagram/blob/main/src/tdbin)), the Rust `prost` Protobuf encoder, and the Rust `rmp-serde` MessagePack encoder. The TDBIN **wire format** and its byte sizes are language-neutral, but serialize/deserialize **speeds** depend on each language's implementation — typeDiagram's other codec targets, and other Protobuf/MessagePack libraries, will differ, sometimes substantially. ## Size and Speed @@ -32,12 +32,12 @@ The following are read directly off the table above — each is a comparison of ## Methodology -- **Rust implementations.** Every timing is for a Rust codec: typeDiagram's [`tdbin`](https://github.com/Nimblesite/typeDiagram/blob/main/crates/tdbin) crate, Protobuf via `prost`, and MessagePack via `rmp-serde`. Encoded sizes are a property of the wire format and hold across languages; speeds do not — typeDiagram's other language targets and other Protobuf/MessagePack libraries will produce different timings. -- **Same values, three encoders.** Every test builds one logical value and feeds the identical value to the typeDiagram codec, to a hand-written Protobuf mirror (`prost`), and — via `serde` derives on that same mirror — to MessagePack (`rmp-serde`). No format receives a different input. See the fixtures in [`crates/tdbin/tests/support/bench_corpus.rs`](https://github.com/Nimblesite/typeDiagram/blob/main/crates/tdbin/tests/support/bench_corpus.rs). +- **Rust implementations.** Every timing is for a Rust codec: typeDiagram's [`tdbin`](https://github.com/Nimblesite/typeDiagram/blob/main/src/tdbin) crate, Protobuf via `prost`, and MessagePack via `rmp-serde`. Encoded sizes are a property of the wire format and hold across languages; speeds do not — typeDiagram's other language targets and other Protobuf/MessagePack libraries will produce different timings. +- **Same values, three encoders.** Every test builds one logical value and feeds the identical value to the typeDiagram codec, to a hand-written Protobuf mirror (`prost`), and — via `serde` derives on that same mirror — to MessagePack (`rmp-serde`). No format receives a different input. See the fixtures in [`src/tdbin/tests/support/bench_corpus.rs`](https://github.com/Nimblesite/typeDiagram/blob/main/src/tdbin/tests/support/bench_corpus.rs). - **Self-describing modes only.** typeDiagram _framed_, Protobuf, and MessagePack _struct-as-map_ all carry enough structure to be decoded without an external schema, so the comparison is like-for-like. -- **Sizes are exact byte counts** emitted by each encoder (see [`crates/tdbin/examples/bench_data.rs`](https://github.com/Nimblesite/typeDiagram/blob/main/crates/tdbin/examples/bench_data.rs)) — not estimates. -- **Timings are Criterion medians** over 50 samples per operation; each measured value flows through `black_box` so the optimizer cannot elide the work. The benchmark harness is [`crates/tdbin/benches/gate.rs`](https://github.com/Nimblesite/typeDiagram/blob/main/crates/tdbin/benches/gate.rs). -- **Corpus schemas** are committed at [`docs/benchmarks/tdbin-corpus.td`](https://github.com/Nimblesite/typeDiagram/blob/main/docs/benchmarks/tdbin-corpus.td) and [`docs/benchmarks/tdbin-corpus.proto`](https://github.com/Nimblesite/typeDiagram/blob/main/docs/benchmarks/tdbin-corpus.proto). +- **Sizes are exact byte counts** emitted by each encoder (see [`src/tdbin/examples/bench_data.rs`](https://github.com/Nimblesite/typeDiagram/blob/main/src/tdbin/examples/bench_data.rs)) — not estimates. +- **Timings are Criterion medians** over 50 samples per operation; each measured value flows through `black_box` so the optimizer cannot elide the work. The benchmark harness is [`src/tdbin/benches/gate.rs`](https://github.com/Nimblesite/typeDiagram/blob/main/src/tdbin/benches/gate.rs). +- **Corpus schemas** are committed at [`docs/research/benchmarks/tdbin-corpus.td`](https://github.com/Nimblesite/typeDiagram/blob/main/docs/research/benchmarks/tdbin-corpus.td) and [`docs/research/benchmarks/tdbin-corpus.proto`](https://github.com/Nimblesite/typeDiagram/blob/main/docs/research/benchmarks/tdbin-corpus.proto). ## Test machine @@ -55,4 +55,4 @@ The following are read directly off the table above — each is a comparison of Run the benchmark, then regenerate this page: - `cargo bench -p tdbin --bench gate -- --noplot` -- `node scripts/tdbin-bench-report.mjs` +- `node src/scripts/tdbin/tdbin-bench-report.mjs` diff --git a/docs/specs/tdbin-future-columnar.md b/docs/specs/tdbin-future-columnar.md index 6854bec..961755c 100644 --- a/docs/specs/tdbin-future-columnar.md +++ b/docs/specs/tdbin-future-columnar.md @@ -1,6 +1,6 @@ # TDBIN Future Columnar Specification -> **Status:** SUPERSEDED — the columnar layout is now specified normatively in [tdbin-columnar.md](tdbin-columnar.md) (`[TDBIN-COL-*]`) and implemented by the Rust runtime (`crates/tdbin/src/column.rs`, `column_read.rs`) and generated codecs at layout major 2. This file remains as the research roadmap that led to it; the SIMD integer-block stage is still future work. +> **Status:** SUPERSEDED — the columnar layout is now specified normatively in [tdbin-columnar.md](tdbin-columnar.md) (`[TDBIN-COL-*]`) and implemented by the Rust runtime (`src/tdbin/src/column.rs`, `column_read.rs`) and generated codecs at layout major 2. This file remains as the research roadmap that led to it; the SIMD integer-block stage is still future work. > Depends on: [tdbin-wire-format.md](tdbin-wire-format.md), [tdbin-future-reader.md](tdbin-future-reader.md), and the [implementation audit](../reports/tdbin-implementation-audit.md). ## Scope diff --git a/docs/specs/tdbin-future-typescript.md b/docs/specs/tdbin-future-typescript.md index 7e83287..09ae653 100644 --- a/docs/specs/tdbin-future-typescript.md +++ b/docs/specs/tdbin-future-typescript.md @@ -6,15 +6,15 @@ ## Scope `[TDBIN-FUTURE-TS]` adds a TypeScript TDBIN codec emitted by -`packages/typediagram` from the same typeDiagram model used by Rust codegen. +`src/typediagram` from the same typeDiagram model used by Rust codegen. The implementation lives in: -- `packages/typediagram/src/tdbin/`: DataView/Uint8Array runtime for bare, +- `src/typediagram/src/tdbin/`: DataView/Uint8Array runtime for bare, framed, and packed framed messages. -- `packages/typediagram/src/converters/typescript-tdbin.ts`: typed +- `src/typediagram/src/converters/typescript-tdbin.ts`: typed `StructCodec` code generator with baked record/union layout. -- `packages/typediagram/test/tdbin/golden.test.ts`: Rust golden-vector +- `src/typediagram/test/tdbin/golden.test.ts`: Rust golden-vector conformance for Person/Contact, including framed and packed framed decode. ## Requirements @@ -34,7 +34,7 @@ The implementation lives in: ## Acceptance -- Golden-vector conformance tests run in `packages/typediagram`. +- Golden-vector conformance tests run in `src/typediagram`. - Cross-language fixtures prove Rust encode -> TypeScript decode -> Rust encode byte identity and the reverse. - Bundle-size impact is measured and kept under the package budget. @@ -51,15 +51,32 @@ The implementation lives in: equivalent lossless representation. - [ ] Emit enum-unions as inline discriminant scalars, including `List`, rather than pointer child structs. -- [ ] Complete generated support for lists, semantic scalars, scalar options, - generics, and every Rust codegen schema form. +- [x] Generated support for every layout-1 list form and scalar options + ([TDBIN-TS-LIST]); a Rust-produced golden vector is reproduced byte for + byte by the generated TypeScript codec. +- [ ] Generated support for semantic scalars, nested lists, maps, generics, + and layout-2 columnar groups. - [ ] Apply required-pointer null/default semantics consistently with the wire specification. -- [ ] Generate the compatibility-major layout hash and require it during normal - framed decode; the current API only checks a caller-supplied expected hash. +- [x] Generate the compatibility-major layout hash and require it during normal + framed decode ([TDBIN-SCHEMA-HASH]): every generated codec carries + `layoutHash`, identical to the Rust `LAYOUT_HASH` for the same schema; + `encodeFramed`/`encodePackedFramed` advertise it; `decodeFramed` requires + it (missing or different → `HashMismatch`); `decodeAuto` rejects a + contradicting advertised hash. +- [x] Base64 framed helpers for JSON envelopes such as JSON-RPC/LSP + ([TDBIN-FRAME-BASE64]): `encodeFramedBase64` emits a packed, hashed frame + as standard base64; `decodeFramedBase64` returns `BadBase64`, `BadMagic`, + `HashMismatch`, … as typed errors. - [ ] Compile and execute generated codecs, run Rust-to-TypeScript-to-Rust byte identity in both directions, and cover browser as well as Node execution. -- [ ] Measure and record bundle-size impact. +- [x] Measure and record bundle-size impact ([TDBIN-TS-BUNDLE]). Generated + modules import only `typediagram-core/tdbin` (`ok` is re-exported there) + and the package is `"sideEffects": false`, so esbuild tree-shakes the + parser, layout, and renderer away. A three-type generated module (record, + union, `Option` child) plus the base64 framed round-trip bundles to + **18.5 KB minified / 6.3 KB gzipped** (esbuild `--bundle --minify`, + ESM), with no elkjs or lezer code. ## Pickup order diff --git a/docs/specs/tdbin-future-width-types.md b/docs/specs/tdbin-future-width-types.md index 003c0d7..62c8101 100644 --- a/docs/specs/tdbin-future-width-types.md +++ b/docs/specs/tdbin-future-width-types.md @@ -24,3 +24,28 @@ - Parser, model, converters, Rust codegen, and TDBIN tests cover every width. - Golden vectors pin scalar fields, lists, and enum-list ordinal bounds. - Protobuf conversion documents any lossy width mapping explicitly. + +## Implemented (#85) + +### [TDBIN-WIDTH-RANGE] + +`I32`, `U8`, `U16`, `U32`, `U64` and `Size` are DSL primitives ([MODEL-WIDTH]). As a record field, each one occupies **one data word**, like `Int`: signed widths store the i64 two's-complement bit pattern and unsigned widths store the raw value. `Option` uses the `[TDBIN-PRIM-OPTION]` presence bit plus value word. Encoding is lossless (the native type already bounds the value). Decoding narrows, and a word outside the declared range fails with the typed `ValueOutOfRange` error; it is never truncated. The layout manifest names each width (`i32@w0`, `u16@w2`, …), so changing `Int` to `I32` changes the layout hash: a breaking change, as `[TDBIN-EVOLVE-WIDTH]` requires. + +### [TDBIN-WIDTH-LIST] + +Lists use the element widths `[TDBIN-PTR-LIST]` reserves for them, little-endian: + +| Element | List elem code | Bytes per element | +| ------- | -------------- | ----------------- | +| `U8` | 2 | 1 | +| `U16` | 3 | 2 | +| `U32` | 4 | 4 | +| `I32` | 4 | 4 | +| `U64` | 5 | 8 | +| `Size` | 5 | 8 | + +### [TDBIN-WIDTH-PATH] + +`Path` is a UTF-8 `String` on the wire (wire-identical to `String`, so its manifest token is `str`). Rust maps it to `std::path::PathBuf`. Encoding a non-UTF-8 path fails with `EncodeError::NonUtf8Path`. + +Layout-2 column groups don't encode width types or `Path` yet; they fail with a diagnostic. `F32`, `I8`/`I16`, and explicit ordinals (`[TDBIN-FUTURE-ORDINALS]`) remain roadmap items. diff --git a/docs/specs/tdbin-rust-api.md b/docs/specs/tdbin-rust-api.md index c135d1f..38b55f3 100644 --- a/docs/specs/tdbin-rust-api.md +++ b/docs/specs/tdbin-rust-api.md @@ -9,7 +9,7 @@ Every public behavior lives under a `[TDBIN-RS-*]` / `[TDBIN-TEST-*]` / `[TDBIN- ## [TDBIN-RS-CRATE] Crate -- Path `crates/tdbin`, library name `tdbin`. Inherits workspace lints (`[lints] workspace = true`) — all lints deny, per root `Cargo.toml` (REPO-STANDARDS-SPEC `[LINT-RUST]`). +- Path `src/tdbin`, library name `tdbin`. Inherits workspace lints (`[lints] workspace = true`) — all lints deny, per root `Cargo.toml` (REPO-STANDARDS-SPEC `[LINT-RUST]`). - Runtime dependencies: **none** — the shipped crate builds offline and uses hand-written error enums. `criterion` and `prost` are dev dependencies used only by `[TDBIN-BENCH-GATE]`. The crate deliberately has no logging facility (see the `[TDBIN-RS-LOG]` resolution below). - No `unsafe`. No panics reachable from any public function on any input — `unwrap`/`expect`/`panic!`/indexing are workspace-denied; all offset arithmetic is `checked_*` and failures surface as errors (`[TDBIN-RS-NOPANIC]`). @@ -72,8 +72,8 @@ pub trait TdBin: Struct { // blanket impl for - `to_bytes` is deterministic/canonical (`[TDBIN-ENC-CANON]`): the same value always yields the same bytes, and `bytes → object → bytes` is byte-identical. - **The ADT types _and_ their codec are produced by typeDiagram codegen — never hand-written.** - `packages/typediagram/src/converters/rust.ts` emits the `struct`/`enum`; `rust-tdbin.ts` - (`generateRustModule`) emits the `impl tdbin::Struct`. `crates/tdbin/tests/generated/mod.rs` is + `src/typediagram/src/converters/rust.ts` emits the `struct`/`enum`; `rust-tdbin.ts` + (`generateRustModule`) emits the `impl tdbin::Struct`. `src/tdbin/tests/generated/mod.rs` is a checked-in example of that output, round-tripped by `tests/roundtrip.rs` under `cargo test`. The current runtime supports bare, framed, and packed-framed messages; direct bool bit packing; diff --git a/docs/specs/tdbin-wire-format.md b/docs/specs/tdbin-wire-format.md index 0949c6b..5b2f8b5 100644 --- a/docs/specs/tdbin-wire-format.md +++ b/docs/specs/tdbin-wire-format.md @@ -186,6 +186,10 @@ A named `union` type encodes as a struct of its own (reached by pointer, like an Variant payload fields are laid out by `[TDBIN-REC-ALLOC]` with one change: intervals and pointer slots allocated by **other variants of the same union are treated as free** (only one variant is ever live). Allocation order is global and deterministic: variants in declaration order, fields within a variant in declaration order. Tuple-form payloads (`Number(Int)`) are positional fields ordinal 0, 1, …. Writers MUST zero all slots belonging to inactive variants (`[TDBIN-SAFE-ZEROSLOT]`). +### [TDBIN-UNION-STRUCT] + +The v0 generators (Rust and TypeScript) encode a struct-form variant (`Circle { radius: Float, label: String }`) or a multi-field tuple variant (`Pair(Int, String)`) exactly like a single-child variant: the declaration ordinal in data word 0, and pointer slot 0 → a struct whose fields are laid out by `[TDBIN-REC-ALLOC]` in declaration order (tuple positions are fields 0, 1, …). Field names never reach the wire. Codegen plans that struct as a synthetic payload record named `TdbinPayload` (tuple fields `v0`, `v1`, …); it appears in the layout manifest as a `ref` like any child, so Rust `LAYOUT_HASH` and TypeScript `layoutHash` agree. The user-facing ADT and its JSON shape are unchanged. A null payload pointer decodes as the payload record's default (`[TDBIN-PTR-NULL]`). Layout major 2 column groups reject struct-form variants with a diagnostic until a dense-group encoding is specified. + ### [TDBIN-UNION-ENUM] A union whose variants are **all bare** (no payloads) is an **enum-union**: it is NOT pointer-encoded. As a field it inlines directly into the parent's data section as a scalar of the discriminant width; in lists it occupies 1 byte per element (`[TDBIN-LIST-ELEM]`). The encoding class is layout-pinned when the type is published: an enum-union stays enum-encoded for that schema major, and a struct-union stays pointer/struct encoded. Adding the first payload variant to an enum-union would flip the encoding class, so it is breaking (`[TDBIN-EVOLVE-BREAKING]`). Its width is a pure function of its own definition, so parents' layouts shift only if the enum's width changes — governed by `[TDBIN-EVOLVE-WIDTH]`. @@ -350,7 +354,7 @@ Columnar layout major 2 (`[TDBIN-COL-*]`, [tdbin-columnar.md](tdbin-columnar.md) - **[TDBIN-FUTURE-COLUMNAR]** — DELIVERED as layout major 2: struct-of-arrays encoding for `List` / `List` (dense-union columns, validity bitmaps) is now normative in [tdbin-columnar.md](tdbin-columnar.md) (`[TDBIN-COL-*]`), built from existing pointer primitives without reinterpreting v1 composite elem kind 7. SIMD-BP128 bit-packed integer columns remain future work. - **[TDBIN-FUTURE-READER]** — zero-copy verify-once/access-lazily reader (nanosecond field access; research §2.4). - **[TDBIN-FUTURE-RPC]** — the `[TDRPC-*]` spec: typeDiagram **function definitions as the service contract** (research §6.0), streaming modes from signature shape, numeric method ids (no method-name strings on the wire), capability pointers (kind `11`), promise pipelining. Fed by the dedicated RPC research pass. -- **[TDBIN-FUTURE-TS]** — TypeScript codec in `packages/typediagram/` implementing this spec byte-for-byte (golden vectors are the conformance suite). +- **[TDBIN-FUTURE-TS]** — TypeScript codec in `src/typediagram/` implementing this spec byte-for-byte (golden vectors are the conformance suite). - **[TDBIN-FUTURE-WIDTH-TYPES]** — width-refined DSL numerics (`I8…U64`, `F32`); wire widths and list element kinds already reserved. - **[TDBIN-FUTURE-ORDINALS]** — explicit per-declaration ordinal annotations to allow non-append evolution (Cap'n Proto-style). diff --git a/docs/specs/tdbin.md b/docs/specs/tdbin.md index 5616490..c0d2db3 100644 --- a/docs/specs/tdbin.md +++ b/docs/specs/tdbin.md @@ -80,12 +80,12 @@ schema. ## Rust: encode and decode generated types -Add the in-workspace runtime to the consuming Rust crate. In a standalone -checkout, replace the relative path with the path to this repository. +Add the runtime from crates.io, at the same version as the `typediagram` CLI +that generated the code; every release publishes both ([TDBIN-RS-PUBLISH]): ```toml [dependencies] -tdbin = { path = "../typeDiagram/crates/tdbin" } +tdbin = "0.14" ``` Place the result of `typediagram encode person.td` in `src/person.rs`. The @@ -169,9 +169,14 @@ produces TypeScript interfaces/unions plus a `StructCodec` for every supported type. It returns a `Result`, so diagnostics stay values instead of becoming thrown exceptions. -This is a build-time script that reads the same `person.td` schema and writes a -module named `person.ts`. The current CLI has TDBIN commands for Rust only; use -this public API for TypeScript generation. +Generate it from the CLI, the same way as the Rust module ([CLI-TDBIN-LANG]): + +```sh +typediagram verify --to typescript person.td +typediagram encode --to typescript person.td > src/person.ts +``` + +Or call the same generator from a build script: ```ts import { readFile, writeFile } from "node:fs/promises"; @@ -240,19 +245,32 @@ such as `HashMismatch`, `BadMagic`, `InvalidUtf8`, `UnknownVariant`, or ### TypeScript support boundary -The TypeScript implementation is deliberately conservative in its current -state. It supports generated records with `Bool`, `Int`, `Float`, `String`, -`Bytes`, optional pointer fields, and nested generated records/unions. It also -supports unions with bare variants, a single generated-record payload, or a -single `String` payload. - -It does **not** yet generate codecs for lists, scalar `Option`, semantic -scalars (`DateTime`, `Uuid`, `Decimal`), generics, inline enum-unions, or every -Rust-supported schema form. Generated modules are not yet compiled and -executed across the full browser and Rust interoperability matrix. Keep a -schema inside the supported subset and use the Rust codec when you need the -broader implemented feature set. See the [TypeScript codec roadmap](tdbin-future-typescript.md) -for the release criteria. +The TypeScript generator supports records with `Bool`, `Int`, `Float`, +`String`, `Bytes`, scalar `Option` (`Bool`/`Int`/`Float`), optional pointer +fields, and nested records/unions. Every layout-1 list form is supported as +`List` or `Option>` ([TDBIN-TS-LIST]): `Bool`, `Int`, `Float`, +`String`, `Bytes`, records, unions, and all-bare enum-unions (one ordinal byte +per element). Unions may have bare variants, a single record or `String` +payload, or struct-form / multi-field tuple payloads ([TDBIN-UNION-STRUCT]). +`integerType: "bigint"` keeps the full i64 domain; the default `number` mode +rejects unsafe integers on encode with `LimitExceeded`. + +A golden vector (`src/tdbin/tests/golden/report_lists.hex`) pins the bytes: +the Rust and TypeScript codecs generated from the same schema must both +reproduce it exactly. + +Not yet generated for TypeScript: semantic scalars (`DateTime`, `Uuid`, +`Decimal`), nested lists, maps, generics, and layout-2 columnar groups. Use the +Rust codec for those. See the [TypeScript codec roadmap](tdbin-future-typescript.md). + +**Any field or variant name is safe ([TDBIN-CODEGEN-LOCALS]).** Generated +codecs bind positional locals (`f0`, `f0Word`, `f0_present`, `v0`), never the +schema name. A field called `value`, `writer`, `at`, `r`, `w`, `count`, +`items`, `tdbin` or `ok`, or a pair like `x` + `xPresent`, can never shadow a +codec parameter, an import or another field's local. The +`fixtures/names.td` schema proves it: `tdbin-locals.test.ts` round-trips the +TypeScript codec, and `src/tdbin/tests/names.rs` compiles and round-trips +the Rust struct and column-group codecs. ## What the bytes guarantee @@ -289,10 +307,12 @@ long-lived schemas: malformed-message retry. Publish a new major layout when a frozen fact must change. -The current generators do not derive and enforce a layout hash automatically. -Until they do, choose, distribute, and pass the expected `u64`/`bigint` hash at -the application boundary yourself. That limitation is why the explicit hash -argument appears in both framed examples. +The Rust and TypeScript generators derive the same hash for each type (Rust +`LAYOUT_HASH`, TypeScript `layoutHash`) and enforce it automatically +([TDBIN-SCHEMA-HASH]): framed encodes advertise it, and TypeScript +`decodeFramed` / Rust `from_framed_bytes_with_hash(T::LAYOUT_HASH)` reject a +missing or different hash with `HashMismatch`. Pass an explicit hash only to +override the pinned one. ## Debugging checklist diff --git a/docs/specs/typeshed-conversion.md b/docs/specs/typeshed-conversion.md index b647aa4..7b77653 100644 --- a/docs/specs/typeshed-conversion.md +++ b/docs/specs/typeshed-conversion.md @@ -103,7 +103,7 @@ Python permits special and variadic generic arities that typeDiagram does not. ` `[TYPESHED-CORPUS]` audits an external checkout without making network access part of normal CI: ```sh -cd packages/typediagram +cd src/typediagram npm run test:typeshed -- /path/to/typeshed ``` diff --git a/package-lock.json b/package-lock.json index 9f35249..1e0a8fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,13 +6,17 @@ "": { "name": "type-model-monorepo", "workspaces": [ - "packages/*" + "src/typediagram", + "src/cli", + "src/web", + "src/vscode" ], "devDependencies": { "@eslint/js": "^10.0.1", - "@vitest/coverage-v8": "^4.1.10", + "@vitest/coverage-v8": "^4.1.12", "eslint": "^10.6.0", "prettier": "^3.9.5", + "smol-toml": "^1.9.1", "typescript-eslint": "^8.63.0" } }, @@ -222,9 +226,9 @@ "license": "MIT" }, "node_modules/@11ty/recursive-copy/node_modules/brace-expansion": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", - "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", + "version": "1.1.22", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.22.tgz", + "integrity": "sha512-CKLDTuSsN0+r1ThM0WkzzBI7dnPI6xEGfa/JnVYIK9JNBA1N1NyPwXVHor//NKD/y3sDxp764sZdLhFK7pH8XQ==", "dev": true, "license": "MIT", "dependencies": { @@ -306,80 +310,77 @@ } }, "node_modules/@emnapi/core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", - "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", + "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==", "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { - "@emnapi/wasi-threads": "1.2.2", + "@emnapi/wasi-threads": "2.2.0", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", - "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz", + "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==", "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "tslib": "^2.4.0" } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", - "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz", + "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==", "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "tslib": "^2.4.0" } }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", "cpu": [ - "arm64" + "ppc64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "netbsd" + "aix" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", "cpu": [ - "arm64" + "arm" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "openbsd" + "android" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", "cpu": [ "arm64" ], @@ -387,392 +388,254 @@ "license": "MIT", "optional": true, "os": [ - "openharmony" + "android" ], "engines": { "node": ">=18" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + "node": ">=18" } }, - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=18" } }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": ">=18" } }, - "node_modules/@eslint/config-array": { - "version": "0.23.5", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^3.0.5", - "debug": "^4.3.1", - "minimatch": "^10.2.4" - }, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=18" } }, - "node_modules/@eslint/config-helpers": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", - "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^1.2.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=18" } }, - "node_modules/@eslint/core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", - "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=18" } }, - "node_modules/@eslint/js": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", - "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "eslint": "^10.0.0" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } + "node": ">=18" } }, - "node_modules/@eslint/object-schema": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", - "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=18" } }, - "node_modules/@eslint/plugin-kit": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", - "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^1.2.1", - "levn": "^0.4.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=18" } }, - "node_modules/@gerrit0/mini-shiki": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.23.0.tgz", - "integrity": "sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==", + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], "dev": true, "license": "MIT", - "dependencies": { - "@shikijs/engine-oniguruma": "^3.23.0", - "@shikijs/langs": "^3.23.0", - "@shikijs/themes": "^3.23.0", - "@shikijs/types": "^3.23.0", - "@shikijs/vscode-textmate": "^10.0.2" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" } }, - "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.18.0" + "node": ">=18" } }, - "node_modules/@humanfs/node": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", - "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.4.0" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.18.0" + "node": ">=18" } }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" + "node": ">=18" } }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@lezer/common": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.2.tgz", - "integrity": "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==", - "license": "MIT" - }, - "node_modules/@lezer/highlight": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.3.tgz", - "integrity": "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==", - "license": "MIT", - "dependencies": { - "@lezer/common": "^1.3.0" - } - }, - "node_modules/@lezer/lr": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.10.tgz", - "integrity": "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==", - "license": "MIT", - "dependencies": { - "@lezer/common": "^1.0.0" - } - }, - "node_modules/@lezer/python": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@lezer/python/-/python-1.1.19.tgz", - "integrity": "sha512-MhQIURHRytsNzP/YXnqpYKW6la6voAH3kyplTOOiCdjyFY6cWWGFVmYVdHIPrElqSDf4iCDktQCockB9FxuhzQ==", - "license": "MIT", - "dependencies": { - "@lezer/common": "^1.2.0", - "@lezer/highlight": "^1.0.0", - "@lezer/lr": "^1.0.0" - } - }, - "node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", - "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1", - "@emnapi/runtime": "^1.7.1" - } - }, - "node_modules/@noble/ciphers": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", - "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", - "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@oxc-project/types": { - "version": "0.139.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", - "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/Boshen" - } - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@playwright/test": { - "version": "1.61.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz", - "integrity": "sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright": "1.61.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@rolldown/binding-android-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", - "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", "cpu": [ - "arm64" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "android" + "linux" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", - "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", "cpu": [ "arm64" ], @@ -780,17 +643,16 @@ "license": "MIT", "optional": true, "os": [ - "darwin" + "netbsd" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", - "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", "cpu": [ "x64" ], @@ -798,53 +660,50 @@ "license": "MIT", "optional": true, "os": [ - "darwin" + "netbsd" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", - "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "freebsd" + "openbsd" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", - "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", "cpu": [ - "arm" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "openbsd" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", - "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", "cpu": [ "arm64" ], @@ -852,71 +711,67 @@ "license": "MIT", "optional": true, "os": [ - "linux" + "openharmony" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", - "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", "cpu": [ - "arm64" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "sunos" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", - "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", "cpu": [ - "ppc64" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", - "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", "cpu": [ - "s390x" + "ia32" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", - "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", "cpu": [ "x64" ], @@ -924,4983 +779,4785 @@ "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=18" } }, - "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", - "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", - "cpu": [ - "x64" - ], + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", - "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", - "cpu": [ - "arm64" - ], + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "peer": true, + "license": "Apache-2.0", "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", - "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", - "cpu": [ - "wasm32" - ], + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", - "optional": true, - "peer": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", "dependencies": { - "@emnapi/core": "1.11.1", - "@emnapi/runtime": "1.11.1", - "@napi-rs/wasm-runtime": "^1.1.6" + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", - "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", - "cpu": [ - "arm64" - ], + "node_modules/@eslint/config-helpers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", + "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", - "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", - "cpu": [ - "x64" - ], + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", - "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } }, - "node_modules/@shikijs/engine-oniguruma": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", - "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", + "node_modules/@eslint/plugin-kit": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@shikijs/types": "3.23.0", - "@shikijs/vscode-textmate": "^10.0.2" + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@shikijs/langs": { + "node_modules/@gerrit0/mini-shiki": { "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", - "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.23.0.tgz", + "integrity": "sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "3.23.0" + "@shikijs/engine-oniguruma": "^3.23.0", + "@shikijs/langs": "^3.23.0", + "@shikijs/themes": "^3.23.0", + "@shikijs/types": "^3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" } }, - "node_modules/@shikijs/themes": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", - "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@shikijs/types": "3.23.0" + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" } }, - "node_modules/@shikijs/types": { - "version": "3.23.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", - "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" } }, - "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", - "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } }, - "node_modules/@sindresorhus/slugify": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", - "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/transliterate": "^1.0.0", - "escape-string-regexp": "^5.0.0" - }, + "license": "Apache-2.0", "engines": { - "node": ">=12" + "node": ">=12.22" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "engines": { - "node": ">=12" + "node": ">=18.18" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@sindresorhus/transliterate": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.6.0.tgz", - "integrity": "sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "escape-string-regexp": "^5.0.0" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6.0.0" } }, - "node_modules/@standard-schema/spec": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@swc/helpers": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.21.tgz", - "integrity": "sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.8.0" - } - }, - "node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@typediagram/web": { - "resolved": "packages/web", - "link": true - }, - "node_modules/@types/chai": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", - "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/deep-eql": "*", - "assertion-error": "^2.0.1" - } - }, - "node_modules/@types/deep-eql": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/esrecurse": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", - "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "dev": true, "license": "MIT" }, - "node_modules/@types/markdown-it": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", - "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", "dependencies": { - "@types/linkify-it": "^5", - "@types/mdurl": "^2" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@types/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/mocha": { - "version": "10.0.10", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", - "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", - "dev": true, + "node_modules/@lezer/common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.2.tgz", + "integrity": "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==", "license": "MIT" }, - "node_modules/@types/node": { - "version": "26.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", - "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", - "dev": true, + "node_modules/@lezer/highlight": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.3.tgz", + "integrity": "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==", "license": "MIT", "dependencies": { - "undici-types": "~8.3.0" + "@lezer/common": "^1.3.0" } }, - "node_modules/@types/pdfkit": { - "version": "0.17.6", - "resolved": "https://registry.npmjs.org/@types/pdfkit/-/pdfkit-0.17.6.tgz", - "integrity": "sha512-tIwzxk2uWKp0Cq9JIluQXJid77lYhF52EsIOwhsMF4iWLA6YneoBR1xVKYYdAysHuepUB0OX4tdwMiUDdGKmig==", - "dev": true, + "node_modules/@lezer/lr": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.10.tgz", + "integrity": "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==", "license": "MIT", "dependencies": { - "@types/node": "*" + "@lezer/common": "^1.0.0" } }, - "node_modules/@types/prismjs": { - "version": "1.26.6", - "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.6.tgz", - "integrity": "sha512-vqlvI7qlMvcCBbVe0AKAb4f97//Hy0EBTaiW8AalRnG/xAN5zOiWWyrNqNXeq8+KAuvRewjCVY1+IPxk4RdNYw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/whatwg-mimetype": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz", - "integrity": "sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", - "dev": true, + "node_modules/@lezer/python": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/@lezer/python/-/python-1.1.19.tgz", + "integrity": "sha512-MhQIURHRytsNzP/YXnqpYKW6la6voAH3kyplTOOiCdjyFY6cWWGFVmYVdHIPrElqSDf4iCDktQCockB9FxuhzQ==", "license": "MIT", "dependencies": { - "@types/node": "*" + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz", - "integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==", + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", + "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.63.0", - "@typescript-eslint/type-utils": "8.63.0", - "@typescript-eslint/utils": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0", - "ignore": "^7.0.5", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.5.0" + "@tybys/wasm-util": "^0.10.3" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.63.0", - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" + "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", + "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "node_modules/@noble/ciphers": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", + "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", "dev": true, "license": "MIT", "engines": { - "node": ">= 4" + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@typescript-eslint/parser": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz", - "integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==", + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "8.63.0", - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0", - "debug": "^4.4.3" - }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^14.21.3 || >=16" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@typescript-eslint/project-service": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz", - "integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==", + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.63.0", - "@typescript-eslint/types": "^8.63.0", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" + "url": "https://github.com/sponsors/oxc-project" } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz", - "integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz", - "integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz", - "integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0", - "@typescript-eslint/utils": "8.63.0", - "debug": "^4.4.3", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz", - "integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "license": "MIT", + "optional": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">=14" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz", - "integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==", + "node_modules/@playwright/test": { + "version": "1.61.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz", + "integrity": "sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@typescript-eslint/project-service": "8.63.0", - "@typescript-eslint/tsconfig-utils": "8.63.0", - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/visitor-keys": "8.63.0", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "playwright": "1.61.1" }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz", - "integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.63.0", - "@typescript-eslint/types": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0" + "bin": { + "playwright": "cli.js" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" + "node": ">=18" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz", - "integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==", + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", + "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.63.0", - "eslint-visitor-keys": "^5.0.0" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-aix-ppc64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", - "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz", + "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==", "cpu": [ - "ppc64" + "arm64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "aix" + "android" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-darwin-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", - "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz", + "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==", "cpu": [ "arm64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-darwin-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", - "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz", + "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-freebsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", - "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz", + "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==", "cpu": [ - "arm64" + "x64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-freebsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", - "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz", + "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==", "cpu": [ - "x64" + "arm" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "freebsd" + "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-linux-arm": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", - "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz", + "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==", "cpu": [ - "arm" + "arm64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-linux-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", - "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz", + "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==", "cpu": [ "arm64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-linux-loong64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", - "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz", + "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==", "cpu": [ - "loong64" + "ppc64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-linux-mips64el": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", - "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz", + "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==", "cpu": [ - "mips64el" + "s390x" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-linux-ppc64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", - "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz", + "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==", "cpu": [ - "ppc64" + "x64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-linux-riscv64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", - "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-s390x": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", - "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", - "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz", + "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-netbsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", - "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz", + "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==", "cpu": [ "arm64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "netbsd" + "openharmony" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-netbsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", - "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz", + "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==", "cpu": [ - "x64" + "wasm32" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "@emnapi/core": "2.0.0-beta.2", + "@emnapi/runtime": "2.0.0-beta.2", + "@napi-rs/wasm-runtime": "1.2.6" + }, "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" } }, - "node_modules/@typescript/typescript-openbsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", - "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz", + "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==", "cpu": [ "arm64" ], "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-openbsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", - "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "openbsd" + "win32" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-sunos-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", - "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz", + "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-win32-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", - "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=16.20.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@typescript/typescript-win32-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", - "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", - "cpu": [ - "x64" - ], + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16.20.0" - } + "license": "MIT" }, - "node_modules/@vitest/coverage-v8": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.10.tgz", - "integrity": "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g==", + "node_modules/@shikijs/engine-oniguruma": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", + "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", "dev": true, "license": "MIT", "dependencies": { - "@bcoe/v8-coverage": "^1.0.2", - "@vitest/utils": "4.1.10", - "ast-v8-to-istanbul": "^1.0.0", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.2.0", - "magicast": "^0.5.2", - "obug": "^2.1.1", - "std-env": "^4.0.0-rc.1", - "tinyrainbow": "^3.1.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@vitest/browser": "4.1.10", - "vitest": "4.1.10" - }, - "peerDependenciesMeta": { - "@vitest/browser": { - "optional": true - } + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" } }, - "node_modules/@vitest/expect": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz", - "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==", + "node_modules/@shikijs/langs": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", + "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", "dev": true, "license": "MIT", "dependencies": { - "@standard-schema/spec": "^1.1.0", - "@types/chai": "^5.2.2", - "@vitest/spy": "4.1.10", - "@vitest/utils": "4.1.10", - "chai": "^6.2.2", - "tinyrainbow": "^3.1.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@shikijs/types": "3.23.0" } }, - "node_modules/@vitest/pretty-format": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", - "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==", + "node_modules/@shikijs/themes": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", + "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", "dev": true, "license": "MIT", "dependencies": { - "tinyrainbow": "^3.1.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@shikijs/types": "3.23.0" } }, - "node_modules/@vitest/runner": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz", - "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==", + "node_modules/@shikijs/types": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "4.1.10", - "pathe": "^2.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" } }, - "node_modules/@vitest/snapshot": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz", - "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==", + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sindresorhus/slugify": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", + "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.1.10", - "@vitest/utils": "4.1.10", - "magic-string": "^0.30.21", - "pathe": "^2.0.3" + "@sindresorhus/transliterate": "^1.0.0", + "escape-string-regexp": "^5.0.0" + }, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://opencollective.com/vitest" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@vitest/spy": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz", - "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==", + "node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "license": "MIT", + "engines": { + "node": ">=12" + }, "funding": { - "url": "https://opencollective.com/vitest" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@vitest/utils": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz", - "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==", + "node_modules/@sindresorhus/transliterate": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.6.0.tgz", + "integrity": "sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.1.10", - "convert-source-map": "^2.0.0", - "tinyrainbow": "^3.1.0" + "escape-string-regexp": "^5.0.0" + }, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://opencollective.com/vitest" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@vscode/test-electron": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.0.0.tgz", - "integrity": "sha512-TY5mC7aAjxSLDXsyjhrG8cJHgc/HLdiE5lvtW7hABYQrY24Qwozzr5UoO3HiuAM4Hzz4b7K/eZlwrCILj94CcA==", + "node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "license": "MIT", - "dependencies": { - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.5", - "jszip": "^3.10.1", - "ora": "^8.1.0", - "semver": "^7.6.2" - }, "engines": { - "node": ">=22" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/a-sync-waterfall": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", - "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==", + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "dev": true, "license": "MIT" }, - "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "node_modules/@swc/helpers": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.21.tgz", + "integrity": "sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==", "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "node_modules/@tybys/wasm-util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", "dev": true, "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, - "node_modules/acorn-loose": { - "version": "8.5.2", - "resolved": "https://registry.npmjs.org/acorn-loose/-/acorn-loose-8.5.2.tgz", - "integrity": "sha512-PPvV6g8UGMGgjrMu+n/f9E/tCSkNQ2Y97eFvuVdJfG11+xdIeDcLyNdC8SHcrHbRqkfwLASdplyR6B6sKM1U4A==", + "node_modules/@typediagram/web": { + "resolved": "src/web", + "link": true + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", "dev": true, "license": "MIT", "dependencies": { - "acorn": "^8.15.0" - }, - "engines": { - "node": ">=0.4.0" + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" } }, - "node_modules/acorn-walk": { - "version": "8.3.5", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", - "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dev": true, "license": "MIT", "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" + "@types/unist": "*" } }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } + "license": "MIT" }, - "node_modules/ajv": { - "version": "6.15.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", - "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", "dev": true, "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "@types/linkify-it": "^5", + "@types/mdurl": "^2" } }, - "node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } + "license": "MIT" }, - "node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "license": "MIT" }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "node_modules/@types/node": { + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" + "undici-types": "~8.3.0" } }, - "node_modules/anymatch/node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "node_modules/@types/pdfkit": { + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/@types/pdfkit/-/pdfkit-0.17.6.tgz", + "integrity": "sha512-tIwzxk2uWKp0Cq9JIluQXJid77lYhF52EsIOwhsMF4iWLA6YneoBR1xVKYYdAysHuepUB0OX4tdwMiUDdGKmig==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "dependencies": { + "@types/node": "*" } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0" + "node_modules/@types/prismjs": { + "version": "1.26.6", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.6.tgz", + "integrity": "sha512-vqlvI7qlMvcCBbVe0AKAb4f97//Hy0EBTaiW8AalRnG/xAN5zOiWWyrNqNXeq8+KAuvRewjCVY1+IPxk4RdNYw==", + "dev": true, + "license": "MIT" }, - "node_modules/asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true, "license": "MIT" }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "node_modules/@types/vscode": { + "version": "1.99.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.99.1.tgz", + "integrity": "sha512-cQlqxHZ040ta6ovZXnXRxs3fJiTmlurkIWOfZVcLSZPcm9J4ikFpXuB7gihofGn5ng+kDVma5EmJIclfk0trPQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } + "license": "MIT" }, - "node_modules/ast-v8-to-istanbul": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.4.tgz", - "integrity": "sha512-0bC0/4bTSrnwdhU3IsZDwEdojvuPrSg59OYZfKsLRtJZ0u8VBx9DebfqqG8bRdCC0I7vjgxmPi41P0lpkhJHtA==", + "node_modules/@types/whatwg-mimetype": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz", + "integrity": "sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.31", - "estree-walker": "^3.0.3", - "js-tokens": "^10.0.0" + "@types/node": "*" } }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/bcp-47": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz", - "integrity": "sha512-9IIS3UPrvIa1Ej+lVDdDwO7zLehjqsaByECw0bu2RRGP73jALm6FYbzI5gWbgHLvNdkvfXB5YrSbocZdOS0c0w==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz", + "integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==", "dev": true, "license": "MIT", "dependencies": { - "is-alphabetical": "^2.0.0", - "is-alphanumerical": "^2.0.0", - "is-decimal": "^2.0.0" + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/type-utils": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.63.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/bcp-47-match": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", - "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "engines": { + "node": ">= 4" } }, - "node_modules/bcp-47-normalize": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/bcp-47-normalize/-/bcp-47-normalize-2.3.0.tgz", - "integrity": "sha512-8I/wfzqQvttUFz7HVJgIZ7+dj3vUaIyIxYXaTRP1YWoSDfzt6TUmxaKZeuXR62qBmYr+nvuWINFRl6pZ5DlN4Q==", + "node_modules/@typescript-eslint/parser": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz", + "integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==", "dev": true, "license": "MIT", "dependencies": { - "bcp-47": "^2.0.0", - "bcp-47-match": "^2.0.0" + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "debug": "^4.4.3" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "license": "MIT", "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "node_modules/@typescript-eslint/project-service": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz", + "integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^4.0.2" + "@typescript-eslint/tsconfig-utils": "^8.63.0", + "@typescript-eslint/types": "^8.63.0", + "debug": "^4.4.3" }, "engines": { - "node": "18 || 20 || >=22" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz", + "integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==", "dev": true, "license": "MIT", "dependencies": { - "fill-range": "^7.1.1" + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/brotli": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", - "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", - "dev": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.1.2" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true, - "license": "ISC" - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz", + "integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==", "dev": true, "license": "MIT", - "dependencies": { - "pako": "~1.0.5" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/buffer-image-size": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/buffer-image-size/-/buffer-image-size-0.6.4.tgz", - "integrity": "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==", + "node_modules/@typescript-eslint/type-utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz", + "integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==", "dev": true, "license": "MIT", "dependencies": { - "@types/node": "*" + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" }, "engines": { - "node": ">=4.0" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/chai": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "node_modules/@typescript-eslint/types": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz", + "integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz", + "integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@typescript-eslint/project-service": "8.63.0", + "@typescript-eslint/tsconfig-utils": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" }, "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/chalk/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@typescript-eslint/utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz", + "integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0" }, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz", + "integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==", "dev": true, "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "@typescript-eslint/types": "8.63.0", + "eslint-visitor-keys": "^5.0.0" }, "engines": { - "node": ">= 8.10.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/chokidar/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">= 6" + "node": ">=16.20.0" } }, - "node_modules/cli-cursor": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", - "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "restore-cursor": "^5.0.0" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=16.20.0" } }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=16.20.0" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=12" + "node": ">=16.20.0" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=8" + "node": ">=16.20.0" } }, - "node_modules/cliui/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=16.20.0" } }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=8" + "node": ">=16.20.0" } }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=8" + "node": ">=16.20.0" } }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "node": ">=16.20.0" } }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "dev": true, - "license": "MIT", + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=0.8" + "node": ">=16.20.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=7.0.0" + "node": ">=16.20.0" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } }, - "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" + "node": ">=16.20.0" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } }, - "node_modules/concurrently": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-10.0.3.tgz", - "integrity": "sha512-hc3LH4UaKWd/bbyDK/IGVa4RB6PtQ3CUYwtrkzqHn+wIG3Hr5fhpRlk0L/gCa8ZE1L/Ufj50Zho69cI5w8SQBA==", + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "5.6.2", - "rxjs": "7.8.2", - "shell-quote": "1.8.4", - "supports-color": "10.2.2", - "tree-kill": "1.2.2", - "yargs": "18.0.0" - }, - "bin": { - "conc": "dist/bin/index.js", - "concurrently": "dist/bin/index.js" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], "engines": { - "node": ">=22" - }, - "funding": { - "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + "node": ">=16.20.0" } }, - "node_modules/concurrently/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=16.20.0" } }, - "node_modules/concurrently/node_modules/cliui": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", - "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^7.2.0", - "strip-ansi": "^7.1.0", - "wrap-ansi": "^9.0.0" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": ">=20" + "node": ">=16.20.0" } }, - "node_modules/concurrently/node_modules/emoji-regex": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", - "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" + } }, - "node_modules/concurrently/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=16.20.0" } }, - "node_modules/concurrently/node_modules/supports-color": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", - "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "node": ">=16.20.0" } }, - "node_modules/concurrently/node_modules/wrap-ansi": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", - "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "node_modules/@vitest/coverage-v8": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.12.tgz", + "integrity": "sha512-6S7/iVknKglLAxMFxQGNppBI0iqJS2NgM6FBxavitj7KaDq/vywOWGf6dGu7F2L1Qy0G6S3uTp7aGshHrzK8JA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } + "@bcoe/v8-coverage": "^1.0.2", + "@vitest/utils": "4.1.12", + "ast-v8-to-istanbul": "^1.0.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.2.0", + "magicast": "^0.5.2", + "obug": "^2.1.1", + "std-env": "^4.0.0-rc.1", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/browser": "4.1.12", + "vitest": "4.1.12" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } + } }, - "node_modules/concurrently/node_modules/yargs": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", - "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "node_modules/@vitest/expect": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.12.tgz", + "integrity": "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==", "dev": true, "license": "MIT", "dependencies": { - "cliui": "^9.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "string-width": "^7.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^22.0.0" + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/concurrently/node_modules/yargs-parser": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", - "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "node_modules/@vitest/mocker": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.12.tgz", + "integrity": "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==", "dev": true, - "license": "ISC", - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.12", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } } }, - "node_modules/console-grid": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.4.tgz", - "integrity": "sha512-OLjCRTiHhOpTRo9lQp/2FgJDyq5uQHwkEmVJulEnQ6JVf27oKKzXHZnNOv/e72V4++UdMZCrDWtvXW5sx4lyQg==", - "dev": true, - "license": "MIT" - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "node_modules/@vitest/pretty-format": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.12.tgz", + "integrity": "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "node_modules/@vitest/runner": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.12.tgz", + "integrity": "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.12", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "node_modules/@vitest/snapshot": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.12.tgz", + "integrity": "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==", "dev": true, "license": "MIT", "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "@vitest/pretty-format": "4.1.12", + "@vitest/utils": "4.1.12", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" }, - "engines": { - "node": ">= 8" + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/@vitest/spy": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.12.tgz", + "integrity": "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.12.tgz", + "integrity": "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==", "dev": true, "license": "MIT", "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" + "@vitest/pretty-format": "4.1.12", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "node_modules/@vscode/test-electron": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.0.0.tgz", + "integrity": "sha512-TY5mC7aAjxSLDXsyjhrG8cJHgc/HLdiE5lvtW7hABYQrY24Qwozzr5UoO3HiuAM4Hzz4b7K/eZlwrCILj94CcA==", "dev": true, "license": "MIT", - "engines": { - "node": ">=10" + "dependencies": { + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "jszip": "^3.10.1", + "ora": "^8.1.0", + "semver": "^7.6.2" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=22" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "node_modules/a-sync-waterfall": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", + "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==", "dev": true, "license": "MIT" }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">= 0.8" + "node": ">=0.4.0" } }, - "node_modules/dependency-graph": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-1.0.0.tgz", - "integrity": "sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg==", + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=4" + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "node_modules/acorn-loose": { + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/acorn-loose/-/acorn-loose-8.5.2.tgz", + "integrity": "sha512-PPvV6g8UGMGgjrMu+n/f9E/tCSkNQ2Y97eFvuVdJfG11+xdIeDcLyNdC8SHcrHbRqkfwLASdplyR6B6sKM1U4A==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "acorn": "^8.15.0" + }, "engines": { - "node": ">=8" + "node": ">=0.4.0" } }, - "node_modules/dfa": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz", - "integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==", + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } }, - "node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "dev": true, - "license": "BSD-3-Clause", + "license": "MIT", "engines": { - "node": ">=0.3.1" + "node": ">= 14" } }, - "node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/dom-serializer/node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "dev": true, - "license": "BSD-2-Clause", + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "license": "BSD-2-Clause" + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, - "node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, - "license": "BSD-2-Clause", + "license": "ISC", "dependencies": { - "domelementtype": "^2.2.0" + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" }, "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" + "node": ">= 8" } }, - "node_modules/domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" + "license": "MIT", + "engines": { + "node": ">=8.6" }, "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true, "license": "MIT" }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=12" + } }, - "node_modules/eight-colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.3.tgz", - "integrity": "sha512-4B54S2Qi4pJjeHmCbDIsveQZWQ/TSSQng4ixYJ9/SYHHpeS5nYK0pzcHvWzWUfRsvJQjwoIENhAwqg59thQceg==", + "node_modules/ast-v8-to-istanbul": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.4.tgz", + "integrity": "sha512-0bC0/4bTSrnwdhU3IsZDwEdojvuPrSg59OYZfKsLRtJZ0u8VBx9DebfqqG8bRdCC0I7vjgxmPi41P0lpkhJHtA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.31", + "estree-walker": "^3.0.3", + "js-tokens": "^10.0.0" + } }, - "node_modules/elkjs": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.11.1.tgz", - "integrity": "sha512-zxxR9k+rx5ktMwT/FwyLdPCrq7xN6e4VGGHH8hA01vVYKjTFik7nHOxBnAYtrgYUB1RpAiLvA1/U2YraWxyKKg==", - "license": "EPL-2.0" + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "license": "MIT" }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "node_modules/bcp-47": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz", + "integrity": "sha512-9IIS3UPrvIa1Ej+lVDdDwO7zLehjqsaByECw0bu2RRGP73jALm6FYbzI5gWbgHLvNdkvfXB5YrSbocZdOS0c0w==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.8" + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "dev": true, + "license": "MIT", "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/errno": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/errno/-/errno-1.0.0.tgz", - "integrity": "sha512-3zV5mFS1E8/1bPxt/B0xxzI1snsg3uSCIh6Zo1qKg6iMw93hzPANk9oBFzSFBFrwuVoQuE3rLoouAUfwOAj1wQ==", + "node_modules/bcp-47-normalize": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/bcp-47-normalize/-/bcp-47-normalize-2.3.0.tgz", + "integrity": "sha512-8I/wfzqQvttUFz7HVJgIZ7+dj3vUaIyIxYXaTRP1YWoSDfzt6TUmxaKZeuXR62qBmYr+nvuWINFRl6pZ5DlN4Q==", "dev": true, "license": "MIT", "dependencies": { - "prr": "~1.0.1" + "bcp-47": "^2.0.0", + "bcp-47-match": "^2.0.0" }, - "bin": { - "errno": "cli.js" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/es-module-lexer": { + "node_modules/binary-extensions": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", - "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", - "dev": true, - "license": "MIT" - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, "license": "MIT", "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "node_modules/brace-expansion": { + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "license": "MIT", - "engines": { - "node": ">=10" + "dependencies": { + "fill-range": "^7.1.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=8" } }, - "node_modules/eslint": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.6.0.tgz", - "integrity": "sha512-6lVbcqSodALYo+4ELD0heG6lFiFxnLMuLkiMi2qV8LMp54N8tE8FT1GMH+ev4Ti00nFjNze2+Su6DsV5OQW3Dg==", + "node_modules/brotli": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", + "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", "dev": true, "license": "MIT", - "workspaces": [ - "packages/*" - ], "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.2", - "@eslint/config-array": "^0.23.5", - "@eslint/config-helpers": "^0.6.0", - "@eslint/core": "^1.2.1", - "@eslint/plugin-kit": "^0.7.2", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "ajv": "^6.14.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^9.1.2", - "eslint-visitor-keys": "^5.0.1", - "espree": "^11.2.0", - "esquery": "^1.7.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "minimatch": "^10.2.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } + "base64-js": "^1.1.2" } }, - "node_modules/eslint-scope": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", - "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true, - "license": "BSD-2-Clause", + "license": "ISC" + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "license": "MIT", "dependencies": { - "@types/esrecurse": "^4.3.1", - "@types/estree": "^1.0.8", - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "pako": "~1.0.5" + } + }, + "node_modules/buffer-image-size": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/buffer-image-size/-/buffer-image-size-0.6.4.tgz", + "integrity": "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" }, "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=4.0" } }, - "node_modules/eslint-visitor-keys": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", - "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=10" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esm-import-transformer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/esm-import-transformer/-/esm-import-transformer-3.0.5.tgz", - "integrity": "sha512-1GKLvfuMnnpI75l8c6sHoz0L3Z872xL5akGuBudgqTDPv4Vy6f2Ec7jEMKTxlqWl/3kSvNbHELeimJtnqgYniw==", + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", "dev": true, "license": "MIT", - "dependencies": { - "acorn": "^8.15.0" + "engines": { + "node": ">=18" } }, - "node_modules/espree": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", - "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "acorn": "^8.16.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^5.0.1" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">=10" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/esquery": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", - "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, - "license": "BSD-3-Clause", + "license": "MIT", "dependencies": { - "estraverse": "^5.1.0" + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" }, "engines": { - "node": ">=0.10" + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "license": "BSD-2-Clause", + "license": "ISC", "dependencies": { - "estraverse": "^5.2.0" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=4.0" + "node": ">= 6" } }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, "engines": { - "node": ">=4.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, - "license": "BSD-2-Clause", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/evaluate-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/evaluate-value/-/evaluate-value-2.0.0.tgz", - "integrity": "sha512-VonfiuDJc0z4sOO7W0Pd130VLsXN6vmBWZlrog1mCb/o7o/Nl5Lr25+Kj/nkCCAhG+zqeeGjxhkK9oHpkgTHhQ==", + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 8" + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/expect-type": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", - "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } + "license": "MIT" }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { - "is-extendable": "^0.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", "dev": true, "license": "MIT", "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } + "node": ">=0.8" } }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^4.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=16.0.0" + "node": ">=7.0.0" } }, - "node_modules/filesize": { - "version": "10.1.6", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-10.1.6.tgz", - "integrity": "sha512-sJslQKU2uM33qH5nqewAwVB2QgR6w1aMNsYUp3aN5rMRyXEwJGmZvaWzeJFNTOXWlHQyBFCWrdj3fV/fsTOX8w==", + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "BSD-3-Clause", + "license": "MIT" + }, + "node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 10.4.0" + "node": ">=14" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-10.0.6.tgz", + "integrity": "sha512-qgICXXFp2/3nAebRLmxcINKEXM1mLK3ij/y31P02VTs/KIkddIeC05n73DxOXsXMB9LFSqNU1/na3lDlOhcbIw==", "dev": true, "license": "MIT", "dependencies": { - "to-regex-range": "^5.0.1" + "chalk": "5.6.2", + "rxjs": "7.8.2", + "shell-quote": "1.12.0", + "supports-color": "10.2.2", + "tree-kill": "1.2.2", + "yargs": "18.0.0" + }, + "bin": { + "conc": "dist/bin/index.js", + "concurrently": "dist/bin/index.js" }, "engines": { - "node": ">=8" + "node": ">=22" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, - "node_modules/finalhandler": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", - "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "node_modules/concurrently/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "statuses": "~2.0.2", - "unpipe": "~1.0.0" - }, "engines": { - "node": ">= 0.8" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/concurrently/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "ms": "2.0.0" + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" } }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "node_modules/concurrently/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", "dev": true, "license": "MIT" }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/concurrently/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, "license": "MIT", "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "node_modules/concurrently/node_modules/supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", "dev": true, - "license": "BSD-3-Clause", - "bin": { - "flat": "cli.js" + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "node_modules/concurrently/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", "dev": true, "license": "MIT", "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=16" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/flatted": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", - "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", - "dev": true, - "license": "ISC" - }, - "node_modules/fontkit": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/fontkit/-/fontkit-2.0.4.tgz", - "integrity": "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==", + "node_modules/concurrently/node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", "dev": true, "license": "MIT", "dependencies": { - "@swc/helpers": "^0.5.12", - "brotli": "^1.3.2", - "clone": "^2.1.2", - "dfa": "^1.2.0", - "fast-deep-equal": "^3.1.3", - "restructure": "^3.0.0", - "tiny-inflate": "^1.0.3", - "unicode-properties": "^1.4.0", - "unicode-trie": "^2.0.0" + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", "dev": true, "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^20.19.0 || ^22.12.0 || >=23" } }, - "node_modules/fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", - "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "node_modules/console-grid": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.4.tgz", + "integrity": "sha512-OLjCRTiHhOpTRo9lQp/2FgJDyq5uQHwkEmVJulEnQ6JVf27oKKzXHZnNOv/e72V4++UdMZCrDWtvXW5sx4lyQg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } + "license": "MIT" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } + "license": "MIT" }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } + "license": "MIT" }, - "node_modules/get-east-asian-width": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", - "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", - "engines": { - "node": ">=18" + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 8" } }, - "node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "ms": "^2.1.3" }, - "bin": { - "glob": "dist/esm/bin.mjs" + "engines": { + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, + "license": "MIT", "engines": { - "node": ">=10.13.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/glob/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, "license": "MIT" }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">= 0.8" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "node_modules/dependency-graph": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-1.0.0.tgz", + "integrity": "sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg==", "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.2" - }, + "license": "MIT", "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=4" } }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, - "license": "MIT", - "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" - }, + "license": "Apache-2.0", "engines": { - "node": ">=6.0" + "node": ">=8" } }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/dfa": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz", + "integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==", "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" + "license": "MIT" + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" } }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "node_modules/dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", "dev": true, "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, - "node_modules/happy-dom": { - "version": "20.10.6", - "resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-20.10.6.tgz", - "integrity": "sha512-6QD0ilzDDt93tX44y8tbmZdAcdTRYDhUP+Asgi6pC8Pp5IA3cvaZGyoVN/EGtlq9ziT65iPuBBn3ASLr6hCgVw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": ">=20.0.0", - "@types/whatwg-mimetype": "^3.0.2", - "@types/ws": "^8.18.1", - "buffer-image-size": "^0.6.4", - "entities": "^7.0.1", - "whatwg-mimetype": "^3.0.0", - "ws": "^8.21.0" - }, - "engines": { - "node": ">=20.0.0" - } - }, - "node_modules/happy-dom/node_modules/entities": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", - "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", "dev": true, "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "license": "MIT", - "bin": { - "he": "bin/he" - } - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" - }, - "node_modules/htmlparser2": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-7.2.0.tgz", - "integrity": "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==", + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "dev": true, "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", { "type": "github", "url": "https://github.com/sponsors/fb55" } ], - "license": "MIT", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.2", - "domutils": "^2.8.0", - "entities": "^3.0.1" - } + "license": "BSD-2-Clause" }, - "node_modules/htmlparser2/node_modules/entities": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", - "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "node_modules/domhandler": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", "dev": true, "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.2.0" + }, "engines": { - "node": ">=0.12" + "node": ">= 4" }, "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "url": "https://github.com/fb55/domhandler?sponsor=1" } }, - "node_modules/http-equiv-refresh": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-equiv-refresh/-/http-equiv-refresh-2.0.1.tgz", - "integrity": "sha512-XJpDL/MLkV3dKwLzHwr2dY05dYNfBNlyPu4STQ8WvKCFdc6vC5tPXuq28of663+gHVg03C+16pHHs/+FmmDjcw==", + "node_modules/domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" } }, - "node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true, + "license": "MIT" + }, + "node_modules/eight-colors": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.3.tgz", + "integrity": "sha512-4B54S2Qi4pJjeHmCbDIsveQZWQ/TSSQng4ixYJ9/SYHHpeS5nYK0pzcHvWzWUfRsvJQjwoIENhAwqg59thQceg==", + "dev": true, + "license": "MIT" + }, + "node_modules/elkjs": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.11.1.tgz", + "integrity": "sha512-zxxR9k+rx5ktMwT/FwyLdPCrq7xN6e4VGGHH8hA01vVYKjTFik7nHOxBnAYtrgYUB1RpAiLvA1/U2YraWxyKKg==", + "license": "EPL-2.0" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, "license": "MIT", - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, "engines": { "node": ">= 0.8" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "node_modules/errno": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/errno/-/errno-1.0.0.tgz", + "integrity": "sha512-3zV5mFS1E8/1bPxt/B0xxzI1snsg3uSCIh6Zo1qKg6iMw93hzPANk9oBFzSFBFrwuVoQuE3rLoouAUfwOAj1wQ==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" + "prr": "~1.0.1" }, - "engines": { - "node": ">= 14" + "bin": { + "errno": "cli.js" } }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "node_modules/es-module-lexer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", + "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" + "bin": { + "esbuild": "bin/esbuild" }, "engines": { - "node": ">= 14" + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" } }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { - "node": ">= 4" + "node": ">=6" } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true, "license": "MIT" }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/is-alphabetical": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", - "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", - "dev": true, - "license": "MIT", + "node": ">=10" + }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-alphanumerical": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", - "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "node_modules/eslint": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.6.0.tgz", + "integrity": "sha512-6lVbcqSodALYo+4ELD0heG6lFiFxnLMuLkiMi2qV8LMp54N8tE8FT1GMH+ev4Ti00nFjNze2+Su6DsV5OQW3Dg==", "dev": true, "license": "MIT", + "workspaces": [ + "packages/*" + ], "dependencies": { - "is-alphabetical": "^2.0.0", - "is-decimal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.6.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "binary-extensions": "^2.0.0" + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8" + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/is-decimal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", - "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "url": "https://opencollective.com/eslint" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "node_modules/esm-import-transformer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/esm-import-transformer/-/esm-import-transformer-3.0.5.tgz", + "integrity": "sha512-1GKLvfuMnnpI75l8c6sHoz0L3Z872xL5akGuBudgqTDPv4Vy6f2Ec7jEMKTxlqWl/3kSvNbHELeimJtnqgYniw==", "dev": true, "license": "MIT", - "engines": { - "node": ">=0.10.0" + "dependencies": { + "acorn": "^8.15.0" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "dependencies": { - "is-extglob": "^2.1.1" + "estraverse": "^5.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.10" } }, - "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=4.0" } }, - "node_modules/is-json": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-json/-/is-json-2.0.1.tgz", - "integrity": "sha512-6BEnpVn1rcf3ngfmViLM6vjUjGErbdrL4rwlv+u1NO1XO8kqT4YGL8+19Q+Z/bas8tY90BTWMk2+fW1g6hQjbA==", - "dev": true, - "license": "ISC" - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "engines": { - "node": ">=0.12.0" + "node": ">=4.0" } }, - "node_modules/is-path-inside": { + "node_modules/estree-walker": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8" + "dependencies": { + "@types/estree": "^1.0.0" } }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, "license": "MIT", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 0.6" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { + "node_modules/evaluate-value": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/iso-639-1": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/iso-639-1/-/iso-639-1-3.1.5.tgz", - "integrity": "sha512-gXkz5+KN7HrG0Q5UGqSMO2qB9AsbEeyLP54kF1YrMsIxmu+g4BdB7rflReZTSTZGpfj8wywu6pfPBCylPIzGQA==", + "resolved": "https://registry.npmjs.org/evaluate-value/-/evaluate-value-2.0.0.tgz", + "integrity": "sha512-VonfiuDJc0z4sOO7W0Pd130VLsXN6vmBWZlrog1mCb/o7o/Nl5Lr25+Kj/nkCCAhG+zqeeGjxhkK9oHpkgTHhQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=6.0" + "node": ">= 8" } }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", "dev": true, - "license": "BSD-3-Clause", + "license": "Apache-2.0", "engines": { - "node": ">=8" + "node": ">=12.0.0" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-reports": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", - "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "BSD-3-Clause", + "license": "MIT", "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" + "is-extendable": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } + "license": "MIT" }, - "node_modules/js-md5": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.8.3.tgz", - "integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, "license": "MIT" }, - "node_modules/js-tokens": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", - "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, "license": "MIT" }, - "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" + "engines": { + "node": ">=12.0.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "node_modules/filesize": { + "version": "10.1.6", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-10.1.6.tgz", + "integrity": "sha512-sJslQKU2uM33qH5nqewAwVB2QgR6w1aMNsYUp3aN5rMRyXEwJGmZvaWzeJFNTOXWlHQyBFCWrdj3fV/fsTOX8w==", "dev": true, - "license": "MIT" + "license": "BSD-3-Clause", + "engines": { + "node": ">= 10.4.0" + } }, - "node_modules/jszip": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", - "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, - "license": "(MIT OR GPL-3.0-or-later)", + "license": "MIT", "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "setimmediate": "^1.0.5" + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/junk": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", - "integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==", + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", "dev": true, "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, "engines": { - "node": ">=8" + "node": ">= 0.8" } }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { - "json-buffer": "3.0.1" + "ms": "2.0.0" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": ">= 0.8.0" + "node": ">=16" } }, - "node_modules/lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/fontkit": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fontkit/-/fontkit-2.0.4.tgz", + "integrity": "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==", "dev": true, "license": "MIT", "dependencies": { - "immediate": "~3.0.5" + "@swc/helpers": "^0.5.12", + "brotli": "^1.3.2", + "clone": "^2.1.2", + "dfa": "^1.2.0", + "fast-deep-equal": "^3.1.3", + "restructure": "^3.0.0", + "tiny-inflate": "^1.0.3", + "unicode-properties": "^1.4.0", + "unicode-trie": "^2.0.0" } }, - "node_modules/lightningcss": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, - "license": "MPL-2.0", + "license": "ISC", "dependencies": { - "detect-libc": "^2.0.3" + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">= 12.0.0" + "node": ">=14" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "lightningcss-android-arm64": "1.32.0", - "lightningcss-darwin-arm64": "1.32.0", - "lightningcss-darwin-x64": "1.32.0", - "lightningcss-freebsd-x64": "1.32.0", - "lightningcss-linux-arm-gnueabihf": "1.32.0", - "lightningcss-linux-arm64-gnu": "1.32.0", - "lightningcss-linux-arm64-musl": "1.32.0", - "lightningcss-linux-x64-gnu": "1.32.0", - "lightningcss-linux-x64-musl": "1.32.0", - "lightningcss-win32-arm64-msvc": "1.32.0", - "lightningcss-win32-x64-msvc": "1.32.0" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/lightningcss-android-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", - "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", - "cpu": [ - "arm64" - ], + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "android" - ], - "peer": true, + "license": "MIT", "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": ">= 0.8" } }, - "node_modules/lightningcss-darwin-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", - "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", - "cpu": [ - "arm64" - ], + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "license": "MPL-2.0", + "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], - "peer": true, "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/lightningcss-darwin-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", - "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", - "cpu": [ - "x64" - ], + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, + "license": "ISC", "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/lightningcss-freebsd-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", - "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", - "cpu": [ - "x64" - ], + "node_modules/get-east-asian-width": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", + "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "peer": true, + "license": "MIT", "engines": { - "node": ">= 12.0.0" + "node": ">=18" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", - "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", - "cpu": [ - "arm" - ], + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 12.0.0" + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", - "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 12.0.0" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", - "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", - "cpu": [ - "arm64" - ], + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 12.0.0" + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "engines": { + "node": ">=10.13.0" } }, - "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", - "cpu": [ - "x64" - ], + "node_modules/glob/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } + "license": "MIT" }, - "node_modules/lightningcss-linux-x64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", - "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", - "cpu": [ - "x64" - ], + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", - "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", - "cpu": [ - "arm64" - ], + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "peer": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, "engines": { - "node": ">= 12.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", - "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", - "cpu": [ - "x64" - ], + "node_modules/gray-matter": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">= 12.0.0" + "license": "MIT", + "dependencies": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "engines": { + "node": ">=6.0" } }, - "node_modules/linebreak": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/linebreak/-/linebreak-1.1.0.tgz", - "integrity": "sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ==", + "node_modules/gray-matter/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { - "base64-js": "0.0.8", - "unicode-trie": "^2.0.0" + "sprintf-js": "~1.0.2" } }, - "node_modules/linebreak/node_modules/base64-js": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", - "integrity": "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==", + "node_modules/gray-matter/node_modules/js-yaml": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/happy-dom": { + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-20.10.6.tgz", + "integrity": "sha512-6QD0ilzDDt93tX44y8tbmZdAcdTRYDhUP+Asgi6pC8Pp5IA3cvaZGyoVN/EGtlq9ziT65iPuBBn3ASLr6hCgVw==", "dev": true, "license": "MIT", + "dependencies": { + "@types/node": ">=20.0.0", + "@types/whatwg-mimetype": "^3.0.2", + "@types/ws": "^8.18.1", + "buffer-image-size": "^0.6.4", + "entities": "^7.0.1", + "whatwg-mimetype": "^3.0.0", + "ws": "^8.21.0" + }, "engines": { - "node": ">= 0.4" + "node": ">=20.0.0" } }, - "node_modules/linkify-it": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz", - "integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==", + "node_modules/happy-dom/node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/htmlparser2": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-7.2.0.tgz", + "integrity": "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==", + "dev": true, "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", { "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/markdown-it" + "url": "https://github.com/sponsors/fb55" } ], "license": "MIT", "dependencies": { - "uc.micro": "^2.0.0" + "domelementtype": "^2.0.1", + "domhandler": "^4.2.2", + "domutils": "^2.8.0", + "entities": "^3.0.1" } }, - "node_modules/liquidjs": { - "version": "10.27.0", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.27.0.tgz", - "integrity": "sha512-tw/OA59K7aIBlMKIrKlumr37fiZUheShVHXY8cVctWisgY1p9mc5hreOvlreoS0wTiwlWk14Ya7305c2a/Cg5w==", + "node_modules/htmlparser2/node_modules/entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", "dev": true, - "license": "MIT", - "dependencies": { - "commander": "^10.0.0" - }, - "bin": { - "liquid": "bin/liquid.js", - "liquidjs": "bin/liquid.js" - }, + "license": "BSD-2-Clause", "engines": { - "node": ">=16" + "node": ">=0.12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/liquidjs" + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/list-to-array": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/list-to-array/-/list-to-array-1.1.0.tgz", - "integrity": "sha512-+dAZZ2mM+/m+vY9ezfoueVvrgnHIGi5FvgSymbIgJOFwiznWyA59mav95L+Mc6xPtL3s9gm5eNTlNtxJLbNM1g==", + "node_modules/http-equiv-refresh": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-equiv-refresh/-/http-equiv-refresh-2.0.1.tgz", + "integrity": "sha512-XJpDL/MLkV3dKwLzHwr2dY05dYNfBNlyPu4STQ8WvKCFdc6vC5tPXuq28of663+gHVg03C+16pHHs/+FmmDjcw==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">= 6" + } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dev": true, "license": "MIT", "dependencies": { - "p-locate": "^5.0.0" + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" }, "engines": { - "node": ">=10" + "node": ">= 0.8" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">=10" + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 14" } }, - "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, - "license": "ISC" + "license": "MIT", + "engines": { + "node": ">= 4" + } }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", "dev": true, "license": "MIT" }, - "node_modules/luxon": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", - "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=0.8.19" } }, - "node_modules/lz-utils": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.1.1.tgz", - "integrity": "sha512-d3Thjos0PSJQAoyMj6vipSSrtrRHS7DImqUNR8x9NW3+zQIftPIbMJAWhi5nPdg5Q9zHz6lxtN8kp/VdMlhi/Q==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, - "license": "MIT" + "license": "ISC" }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", "dev": true, "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/magicast": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", - "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.3", - "@babel/types": "^7.29.0", - "source-map-js": "^1.2.1" + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "license": "MIT", "dependencies": { - "semver": "^7.5.3" + "binary-extensions": "^2.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/markdown-it": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.0.tgz", - "integrity": "sha512-RCEsPjR+sr0x+AuYp601tKTkgFG4YEPLCzHST3cQ/fhlJkqAkz1L2/Qbp1j9qw5SBwQHFBoW8+hoN5xssOF0Tw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/markdown-it" - } - ], + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "dev": true, "license": "MIT", - "dependencies": { - "argparse": "^2.0.1", - "entities": "^4.5.0", - "linkify-it": "^5.0.2", - "mdurl": "^2.0.0", - "punycode.js": "^2.3.1", - "uc.micro": "^2.1.0" - }, - "bin": { - "markdown-it": "bin/markdown-it.mjs" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/marked": { - "version": "18.0.6", - "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.6.tgz", - "integrity": "sha512-MrV5puXBfuiy6wl6DLaq3BtIJQAJToAd5zt/ZKhRfGRAuFPALE7/4Y7jnxRQoEgK/pBgurGqLyAuRgZ2xOjr6w==", + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, "license": "MIT", - "bin": { - "marked": "bin/marked.js" - }, "engines": { - "node": ">= 20" + "node": ">=0.10.0" } }, - "node_modules/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "license": "MIT" - }, - "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "license": "MIT", - "bin": { - "mime": "cli.js" - }, "engines": { - "node": ">=10.0.0" + "node": ">=0.10.0" } }, - "node_modules/mime-db": { - "version": "1.54.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/mime-types": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", - "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "license": "MIT", "dependencies": { - "mime-db": "^1.54.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "node": ">=0.10.0" } }, - "node_modules/mimic-function": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", - "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "node_modules/is-json": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-json/-/is-json-2.0.1.tgz", + "integrity": "sha512-6BEnpVn1rcf3ngfmViLM6vjUjGErbdrL4rwlv+u1NO1XO8kqT4YGL8+19Q+Z/bas8tY90BTWMk2+fW1g6hQjbA==", "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, + "license": "ISC" + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=0.12.0" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=8" } }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, - "license": "BlueOak-1.0.0", + "license": "MIT", "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=8" } }, - "node_modules/mocha": { - "version": "11.7.6", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.6.tgz", - "integrity": "sha512-nS9xOGbw2I3cjCpxwZAEJ9xK9lmJ08vEkQvLtz4du9ZrF9UrjRpeJGiIgl2Z+Qs++pmB4ecDe48Fwsh+j+j7xA==", + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "license": "MIT", - "dependencies": { - "browser-stdout": "^1.3.1", - "chokidar": "^4.0.1", - "debug": "^4.3.5", - "diff": "^7.0.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^10.4.5", - "he": "^1.2.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^9.0.5", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^9.2.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true, "license": "MIT" }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/iso-639-1": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/iso-639-1/-/iso-639-1-3.1.5.tgz", + "integrity": "sha512-gXkz5+KN7HrG0Q5UGqSMO2qB9AsbEeyLP54kF1YrMsIxmu+g4BdB7rflReZTSTZGpfj8wywu6pfPBCylPIzGQA==", "dev": true, "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=6.0" } }, - "node_modules/mocha/node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, + "license": "BSD-3-Clause", "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" + "node": ">=8" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "ISC", + "license": "BSD-3-Clause", "dependencies": { - "brace-expansion": "^2.0.2" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=10" } }, - "node_modules/mocha/node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/monocart-coverage-reports": { - "version": "2.12.12", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.12.12.tgz", - "integrity": "sha512-d9FdUr2dn58Crweon0IE0zVi8r/i4vLvfvb2G7eL5vL5LfrxCB2X6F6qzuiwV6RioA4zbAI//7CYi6LjCvN3zA==", + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "dependencies": { - "acorn": "^8.16.0", - "acorn-loose": "^8.5.2", - "acorn-walk": "^8.3.5", - "commander": "^14.0.3", - "console-grid": "^2.2.4", - "eight-colors": "^1.3.3", - "foreground-child": "^4.0.3", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.2.0", - "lz-utils": "^2.1.1", - "monocart-locator": "^1.0.3" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" }, - "bin": { - "mcr": "lib/cli.js" - } - }, - "node_modules/monocart-coverage-reports/node_modules/commander": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", - "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", - "dev": true, - "license": "MIT", "engines": { - "node": ">=20" + "node": ">=8" } }, - "node_modules/monocart-coverage-reports/node_modules/foreground-child": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-4.0.3.tgz", - "integrity": "sha512-yeXZaNbCBGaT9giTpLPBdtedzjwhlJBUoL/R4BVQU5mn0TQXOHwVIl1Q2DMuBIdNno4ktA1abZ7dQFVxD6uHxw==", + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=16" + "@isaacs/cliui": "^8.0.2" }, "funding": { "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/monocart-locator": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.3.tgz", - "integrity": "sha512-pe29W2XAoA1WQmZZqxXoP7s06ZEXUhcb81086v68cqjk1HnVL7Q/iU/WJnnetxjPcLqwb4qG8vaSGUOMQU602g==", - "dev": true, - "license": "MIT" - }, - "node_modules/moo": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", - "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/morphdom": { - "version": "2.7.8", - "resolved": "https://registry.npmjs.org/morphdom/-/morphdom-2.7.8.tgz", - "integrity": "sha512-D/fR4xgGUyVRbdMGU6Nejea1RFzYxYtyurG4Fbv2Fi/daKlWKuXGLOdXtl+3eIwL110cI2hz1ZojGICjjFLgTg==", + "node_modules/js-md5": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.8.3.tgz", + "integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==", "dev": true, "license": "MIT" }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "node_modules/js-tokens": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", "dev": true, "license": "MIT" }, - "node_modules/nanoid": { - "version": "3.3.15", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", - "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", "dev": true, "funding": [ { "type": "github", - "url": "https://github.com/sponsors/ai" + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" } ], "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" + "dependencies": { + "argparse": "^2.0.1" }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, "license": "MIT" }, - "node_modules/node-retrieve-globals": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/node-retrieve-globals/-/node-retrieve-globals-6.0.1.tgz", - "integrity": "sha512-j0DeFuZ/Wg3VlklfbxUgZF/mdHMTEiEipBb3q0SpMMbHaV3AVfoUQF8UGxh1s/yjqO0TgRZd4Pi/x2yRqoQ4Eg==", + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, - "license": "MIT", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "license": "(MIT OR GPL-3.0-or-later)", "dependencies": { - "acorn": "^8.14.1", - "acorn-walk": "^8.3.4", - "esm-import-transformer": "^3.0.3" + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/junk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", + "integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/nunjucks": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz", - "integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==", + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "a-sync-waterfall": "^1.0.0", - "asap": "^2.0.3", - "commander": "^5.1.0" - }, - "bin": { - "nunjucks-precompile": "bin/precompile" - }, - "engines": { - "node": ">= 6.9.0" - }, - "peerDependencies": { - "chokidar": "^3.3.0" - }, - "peerDependenciesMeta": { - "chokidar": { - "optional": true - } + "json-buffer": "3.0.1" } }, - "node_modules/nunjucks/node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=0.10.0" } }, - "node_modules/obug": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.3.tgz", - "integrity": "sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==", + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true, - "funding": [ - "https://github.com/sponsors/sxzz", - "https://opencollective.com/debug" - ], "license": "MIT", "engines": { - "node": ">=12.20.0" + "node": ">=6" } }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", "dependencies": { - "ee-first": "1.1.1" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.8.0" } }, - "node_modules/onetime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", - "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", "dev": true, "license": "MIT", "dependencies": { - "mimic-function": "^5.0.0" + "immediate": "~3.0.5" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" }, "engines": { - "node": ">=18" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" + "type": "opencollective", + "url": "https://opencollective.com/parcel" }, - "engines": { - "node": ">= 0.8.0" + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" } }, - "node_modules/ora": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz", - "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==", + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^5.3.0", - "cli-cursor": "^5.0.0", - "cli-spinners": "^2.9.2", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^2.0.0", - "log-symbols": "^6.0.0", - "stdin-discarder": "^0.2.2", - "string-width": "^7.2.0", - "strip-ansi": "^7.1.0" - }, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/ora/node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/ora/node_modules/emoji-regex": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", - "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "dev": true, - "license": "MIT" - }, - "node_modules/ora/node_modules/is-unicode-supported": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", - "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/ora/node_modules/log-symbols": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", - "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^5.3.0", - "is-unicode-supported": "^1.3.0" - }, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=12" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/ora/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true, - "license": "(MIT AND Zlib)" - }, - "node_modules/parse-srcset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz", - "integrity": "sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 0.8" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=8" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=8" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "node_modules/linebreak": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/linebreak/-/linebreak-1.1.0.tgz", + "integrity": "sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ==", "dev": true, - "license": "BlueOak-1.0.0", + "license": "MIT", "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "base64-js": "0.0.8", + "unicode-trie": "^2.0.0" } }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "node_modules/linebreak/node_modules/base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">= 0.4" + } }, - "node_modules/pdfkit": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/pdfkit/-/pdfkit-0.19.1.tgz", - "integrity": "sha512-6Gzk+wDwTs4VSxsR5rCMTnIl5nlmkye1oWB0l2hDB1EX6ZNSIBroKQEv+2+fPPn+stVjyqzmsqRJVDfB9fo5DA==", - "dev": true, + "node_modules/linkify-it": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz", + "integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], "license": "MIT", "dependencies": { - "@noble/ciphers": "^1.0.0", - "@noble/hashes": "^1.6.0", - "fontkit": "^2.0.4", - "js-md5": "^0.8.3", - "linebreak": "^1.1.0", - "png-js": "^1.1.0" + "uc.micro": "^2.0.0" } }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "node_modules/liquidjs": { + "version": "10.30.1", + "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.30.1.tgz", + "integrity": "sha512-P1Iz14WUHZdfbOYwHOIhtl/iAWIOYk1ks5l9rPZlDM6vZo+6BLeYIuWHAPkIz+U8Mm8HKZKITIrjX7DQJO2fqA==", "dev": true, "license": "MIT", + "dependencies": { + "commander": "^10.0.0" + }, + "bin": { + "liquid": "bin/liquid.js", + "liquidjs": "bin/liquid.js" + }, "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "type": "opencollective", + "url": "https://opencollective.com/liquidjs" } }, - "node_modules/playwright": { - "version": "1.61.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1.tgz", - "integrity": "sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==", + "node_modules/list-to-array": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/list-to-array/-/list-to-array-1.1.0.tgz", + "integrity": "sha512-+dAZZ2mM+/m+vY9ezfoueVvrgnHIGi5FvgSymbIgJOFwiznWyA59mav95L+Mc6xPtL3s9gm5eNTlNtxJLbNM1g==", "dev": true, - "license": "Apache-2.0", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", "dependencies": { - "playwright-core": "1.61.1" - }, - "bin": { - "playwright": "cli.js" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=18" + "node": ">=10" }, - "optionalDependencies": { - "fsevents": "2.3.2" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/playwright-core": { - "version": "1.61.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1.tgz", - "integrity": "sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==", + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, - "license": "Apache-2.0", - "bin": { - "playwright-core": "cli.js" + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/playwright/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/luxon": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", "dev": true, - "hasInstallScript": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=12" } }, - "node_modules/please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "node_modules/lz-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.1.1.tgz", + "integrity": "sha512-d3Thjos0PSJQAoyMj6vipSSrtrRHS7DImqUNR8x9NW3+zQIftPIbMJAWhi5nPdg5Q9zHz6lxtN8kp/VdMlhi/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "dev": true, "license": "MIT", "dependencies": { - "semver-compare": "^1.0.0" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/png-js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/png-js/-/png-js-1.1.0.tgz", - "integrity": "sha512-PM/uYGzGdNSzqeOgly68+6wKQDL1SY0a/N+OEa/+br6LnHWOAJB0Npiamnodfq3jd2LS/i2fMeOKSAILjA+m5Q==", + "node_modules/magicast": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", "dev": true, + "license": "MIT", "dependencies": { - "browserify-zlib": "^0.2.0" + "@babel/parser": "^7.29.3", + "@babel/types": "^7.29.0", + "source-map-js": "^1.2.1" } }, - "node_modules/postcss": { - "version": "8.5.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", - "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/markdown-it": { + "version": "14.3.3", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.3.tgz", + "integrity": "sha512-L//tDAkjTjJCU6pBUSBTgs3Kg4InVaZuUZog/b6V12UKhcDQ7S78877ibbCanRExwPuYP1CZD7Gd2dxSy1GXRg==", "funding": [ { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" + "type": "github", + "url": "https://github.com/sponsors/puzrin" }, { "type": "github", - "url": "https://github.com/sponsors/ai" + "url": "https://github.com/sponsors/markdown-it" } ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.12", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "argparse": "^2.0.1", + "entities": "^4.5.0", + "linkify-it": "^5.0.2", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" }, - "engines": { - "node": "^10 || ^12 || >=14" + "bin": { + "markdown-it": "bin/markdown-it.mjs" } }, - "node_modules/posthtml": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.7.tgz", - "integrity": "sha512-7Hc+IvlQ7hlaIfQFZnxlRl0jnpWq2qwibORBhQYIb0QbNtuicc5ZxvKkVT71HJ4Py1wSZ/3VR1r8LfkCtoCzhw==", - "dev": true, + "node_modules/marked": { + "version": "18.0.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.6.tgz", + "integrity": "sha512-MrV5puXBfuiy6wl6DLaq3BtIJQAJToAd5zt/ZKhRfGRAuFPALE7/4Y7jnxRQoEgK/pBgurGqLyAuRgZ2xOjr6w==", "license": "MIT", - "dependencies": { - "posthtml-parser": "^0.11.0", - "posthtml-render": "^3.0.0" + "bin": { + "marked": "bin/marked.js" }, "engines": { - "node": ">=12.0.0" + "node": ">= 20" } }, - "node_modules/posthtml-match-helper": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/posthtml-match-helper/-/posthtml-match-helper-2.0.3.tgz", - "integrity": "sha512-p9oJgTdMF2dyd7WE54QI1LvpBIkNkbSiiECKezNnDVYhGhD1AaOnAkw0Uh0y5TW+OHO8iBdSqnd8Wkpb6iUqmw==", + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "license": "MIT" + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "dev": true, "license": "MIT", - "engines": { - "node": ">=18" + "bin": { + "mime": "cli.js" }, - "peerDependencies": { - "posthtml": "^0.16.6" + "engines": { + "node": ">=10.0.0" } }, - "node_modules/posthtml-parser": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.11.0.tgz", - "integrity": "sha512-QecJtfLekJbWVo/dMAA+OSwY79wpRmbqS5TeXvXSX+f0c6pW4/SE6inzZ2qkU7oAMCPqIDkZDvd/bQsSFUnKyw==", + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "dev": true, "license": "MIT", - "dependencies": { - "htmlparser2": "^7.1.1" - }, "engines": { - "node": ">=12" + "node": ">= 0.6" } }, - "node_modules/posthtml-render": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/posthtml-render/-/posthtml-render-3.0.0.tgz", - "integrity": "sha512-z+16RoxK3fUPgwaIgH9NGnK1HKY9XIDpydky5eQGgAFVXTCSezalv9U2jQuNV+Z9qV1fDWNzldcw4eK0SSbqKA==", + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", "dev": true, "license": "MIT", "dependencies": { - "is-json": "^2.0.1" + "mime-db": "^1.54.0" }, "engines": { - "node": ">=12" + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.8.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/prettier": { - "version": "3.9.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz", - "integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==", + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=14" + "node": "18 || 20 || >=22" }, "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/prismjs": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", - "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "license": "MIT", - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "license": "MIT" - }, - "node_modules/prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", - "dev": true, - "license": "MIT" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/punycode.js": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "license": "MIT", + "license": "BlueOak-1.0.0", "engines": { - "node": ">=6" + "node": ">=16 || 14 >=14.17" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "node_modules/mocha": { + "version": "11.7.6", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.6.tgz", + "integrity": "sha512-nS9xOGbw2I3cjCpxwZAEJ9xK9lmJ08vEkQvLtz4du9ZrF9UrjRpeJGiIgl2Z+Qs++pmB4ecDe48Fwsh+j+j7xA==", "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "^5.1.0" + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "node_modules/mocha/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } + "license": "MIT" }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", "dev": true, "license": "MIT", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "balanced-match": "^1.0.0" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "node_modules/mocha/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", "dependencies": { - "picomatch": "^2.2.1" + "readdirp": "^4.0.1" }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/readdirp/node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "node_modules/mocha/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, - "license": "MIT", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, "engines": { - "node": ">=8.6" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "node_modules/mocha/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, - "node_modules/restore-cursor": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", - "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", "dependencies": { - "onetime": "^7.0.0", - "signal-exit": "^4.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/restructure": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/restructure/-/restructure-3.0.2.tgz", - "integrity": "sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==", - "dev": true, - "license": "MIT" - }, - "node_modules/rolldown": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", - "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", + "node_modules/monocart-coverage-reports": { + "version": "2.12.12", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.12.12.tgz", + "integrity": "sha512-d9FdUr2dn58Crweon0IE0zVi8r/i4vLvfvb2G7eL5vL5LfrxCB2X6F6qzuiwV6RioA4zbAI//7CYi6LjCvN3zA==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.139.0", - "@rolldown/pluginutils": "^1.0.0" + "acorn": "^8.16.0", + "acorn-loose": "^8.5.2", + "acorn-walk": "^8.3.5", + "commander": "^14.0.3", + "console-grid": "^2.2.4", + "eight-colors": "^1.3.3", + "foreground-child": "^4.0.3", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.2.0", + "lz-utils": "^2.1.1", + "monocart-locator": "^1.0.3" }, "bin": { - "rolldown": "bin/cli.mjs" - }, + "mcr": "lib/cli.js" + } + }, + "node_modules/monocart-coverage-reports/node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.1.5", - "@rolldown/binding-darwin-arm64": "1.1.5", - "@rolldown/binding-darwin-x64": "1.1.5", - "@rolldown/binding-freebsd-x64": "1.1.5", - "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", - "@rolldown/binding-linux-arm64-gnu": "1.1.5", - "@rolldown/binding-linux-arm64-musl": "1.1.5", - "@rolldown/binding-linux-ppc64-gnu": "1.1.5", - "@rolldown/binding-linux-s390x-gnu": "1.1.5", - "@rolldown/binding-linux-x64-gnu": "1.1.5", - "@rolldown/binding-linux-x64-musl": "1.1.5", - "@rolldown/binding-openharmony-arm64": "1.1.5", - "@rolldown/binding-wasm32-wasi": "1.1.5", - "@rolldown/binding-win32-arm64-msvc": "1.1.5", - "@rolldown/binding-win32-x64-msvc": "1.1.5" + "node": ">=20" } }, - "node_modules/rxjs": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", - "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "node_modules/monocart-coverage-reports/node_modules/foreground-child": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-4.0.3.tgz", + "integrity": "sha512-yeXZaNbCBGaT9giTpLPBdtedzjwhlJBUoL/R4BVQU5mn0TQXOHwVIl1Q2DMuBIdNno4ktA1abZ7dQFVxD6uHxw==", "dev": true, - "license": "Apache-2.0", + "license": "BlueOak-1.0.0", "dependencies": { - "tslib": "^2.1.0" + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "node_modules/monocart-locator": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.3.tgz", + "integrity": "sha512-pe29W2XAoA1WQmZZqxXoP7s06ZEXUhcb81086v68cqjk1HnVL7Q/iU/WJnnetxjPcLqwb4qG8vaSGUOMQU602g==", "dev": true, "license": "MIT" }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "node_modules/moo": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", + "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", "dev": true, - "license": "MIT", - "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=4" - } + "license": "BSD-3-Clause" }, - "node_modules/semver": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", - "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", + "node_modules/morphdom": { + "version": "2.7.8", + "resolved": "https://registry.npmjs.org/morphdom/-/morphdom-2.7.8.tgz", + "integrity": "sha512-D/fR4xgGUyVRbdMGU6Nejea1RFzYxYtyurG4Fbv2Fi/daKlWKuXGLOdXtl+3eIwL110cI2hz1ZojGICjjFLgTg==", "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } + "license": "MIT" }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, - "node_modules/send": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", - "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "license": "MIT", - "dependencies": { - "debug": "^4.4.3", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "fresh": "^2.0.0", - "http-errors": "^2.0.1", - "mime-types": "^3.0.2", - "ms": "^2.1.3", - "on-finished": "^2.4.1", - "range-parser": "^1.2.1", - "statuses": "^2.0.2" + "bin": { + "nanoid": "bin/nanoid.cjs" }, "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, "license": "MIT" }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true, - "license": "ISC" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/node-retrieve-globals": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/node-retrieve-globals/-/node-retrieve-globals-6.0.1.tgz", + "integrity": "sha512-j0DeFuZ/Wg3VlklfbxUgZF/mdHMTEiEipBb3q0SpMMbHaV3AVfoUQF8UGxh1s/yjqO0TgRZd4Pi/x2yRqoQ4Eg==", "dev": true, "license": "MIT", "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" + "acorn": "^8.14.1", + "acorn-walk": "^8.3.4", + "esm-import-transformer": "^3.0.3" } }, - "node_modules/shebang-regex": { + "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/shell-quote": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.4.tgz", - "integrity": "sha512-VsC6n6vz1ihYYyZZwX7YZSF5l5x36ca17OC+a69h94YqB7X6XLwf+5MOgynYir2SLFUbl8gIYvBo8K8RoNQ6bQ==", + "node_modules/nunjucks": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz", + "integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" + "license": "BSD-2-Clause", + "dependencies": { + "a-sync-waterfall": "^1.0.0", + "asap": "^2.0.3", + "commander": "^5.1.0" + }, + "bin": { + "nunjucks-precompile": "bin/precompile" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", "engines": { - "node": ">=14" + "node": ">= 6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependencies": { + "chokidar": "^3.3.0" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "node_modules/nunjucks/node_modules/commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 6" } }, - "node_modules/slugify": { - "version": "1.6.9", - "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.9.tgz", - "integrity": "sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg==", + "node_modules/obug": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.3.tgz", + "integrity": "sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==", "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], "license": "MIT", "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" + "node": ">=12.20.0" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/ssri": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-11.0.0.tgz", - "integrity": "sha512-aZpUoMN/Jj2MqA4vMCeiKGnc/8SuSyHbGSBdgFbZxP8OJGF/lFkIuElzPxsN0q8TQQ+prw3P4EDfB3TBHHgfXw==", + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "minipass": "^7.0.3" + "ee-first": "1.1.1" }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", - "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, - "node_modules/std-env": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", - "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", - "dev": true, - "license": "MIT" - }, - "node_modules/stdin-discarder": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", - "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", "dev": true, "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, "engines": { "node": ">=18" }, @@ -5908,1398 +5565,922 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "~5.1.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/ora": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz", + "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==", "dev": true, "license": "MIT", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "chalk": "^5.3.0", + "cli-cursor": "^5.0.0", + "cli-spinners": "^2.9.2", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^2.0.0", + "log-symbols": "^6.0.0", + "stdin-discarder": "^0.2.2", + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/ora/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/ora/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", "dev": true, "license": "MIT" }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "node_modules/ora/node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", "dev": true, "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/ora/node_modules/log-symbols": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", + "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "chalk": "^5.3.0", + "is-unicode-supported": "^1.3.0" }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "node_modules/ora/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/svg-to-pdfkit": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/svg-to-pdfkit/-/svg-to-pdfkit-0.1.8.tgz", - "integrity": "sha512-QItiGZBy5TstGy+q8mjQTMGRlDDOARXLxH+sgVm1n/LYeo0zFcQlcCh8m4zi8QxctrxB9Kue/lStc/RD5iLadQ==", + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "dev": true, - "license": "MIT", - "dependencies": { - "pdfkit": ">=0.8.1" - } + "license": "BlueOak-1.0.0" }, - "node_modules/tiny-inflate": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", - "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "dev": true, - "license": "MIT" + "license": "(MIT AND Zlib)" }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "node_modules/parse-srcset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz", + "integrity": "sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q==", "dev": true, "license": "MIT" }, - "node_modules/tinyexec": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", - "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 0.8" } }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" + "node": ">=8" } }, - "node_modules/tinyrainbow": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", - "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", "engines": { - "node": ">=14.0.0" + "node": ">=8" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "license": "MIT", + "license": "BlueOak-1.0.0", "dependencies": { - "is-number": "^7.0.0" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=8.0" + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.6" - } + "license": "MIT" }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "node_modules/pdfkit": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/pdfkit/-/pdfkit-0.19.1.tgz", + "integrity": "sha512-6Gzk+wDwTs4VSxsR5rCMTnIl5nlmkye1oWB0l2hDB1EX6ZNSIBroKQEv+2+fPPn+stVjyqzmsqRJVDfB9fo5DA==", "dev": true, "license": "MIT", - "bin": { - "tree-kill": "cli.js" + "dependencies": { + "@noble/ciphers": "^1.0.0", + "@noble/hashes": "^1.6.0", + "fontkit": "^2.0.4", + "js-md5": "^0.8.3", + "linebreak": "^1.1.0", + "png-js": "^1.1.0" } }, - "node_modules/ts-api-utils": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", - "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { - "node": ">=18.12" + "node": ">=12" }, - "peerDependencies": { - "typescript": ">=4.8.4" + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD" - }, - "node_modules/tsx": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.0.tgz", - "integrity": "sha512-eUdUIaCr963q2h5u3+QwvYp0+eqPvn+egeqZUm0hwERCqqx1E3kK5ehbGCvqSE5MQAULr67ww0cA3jKc3YkM1w==", + "node_modules/playwright": { + "version": "1.61.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1.tgz", + "integrity": "sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "esbuild": "~0.28.0" + "playwright-core": "1.61.1" }, "bin": { - "tsx": "dist/cli.mjs" + "playwright": "cli.js" }, "engines": { - "node": ">=18.0.0" + "node": ">=18" }, "optionalDependencies": { - "fsevents": "~2.3.3" + "fsevents": "2.3.2" } }, - "node_modules/tsx/node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", - "cpu": [ - "ppc64" - ], + "node_modules/playwright-core": { + "version": "1.61.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1.tgz", + "integrity": "sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "peer": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, "engines": { "node": ">=18" } }, - "node_modules/tsx/node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", - "cpu": [ - "arm" - ], + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, + "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ - "android" + "darwin" ], - "peer": true, "engines": { - "node": ">=18" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/tsx/node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", - "cpu": [ - "arm64" - ], + "node_modules/please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "peer": true, - "engines": { - "node": ">=18" + "dependencies": { + "semver-compare": "^1.0.0" } }, - "node_modules/tsx/node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", - "cpu": [ - "x64" - ], + "node_modules/png-js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/png-js/-/png-js-1.1.0.tgz", + "integrity": "sha512-PM/uYGzGdNSzqeOgly68+6wKQDL1SY0a/N+OEa/+br6LnHWOAJB0Npiamnodfq3jd2LS/i2fMeOKSAILjA+m5Q==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "peer": true, - "engines": { - "node": ">=18" + "dependencies": { + "browserify-zlib": "^0.2.0" } }, - "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", - "cpu": [ - "arm64" - ], + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } ], - "peer": true, + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, "engines": { - "node": ">=18" + "node": "^10 || ^12 || >=14" } }, - "node_modules/tsx/node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, + "node_modules/posthtml": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.7.tgz", + "integrity": "sha512-7Hc+IvlQ7hlaIfQFZnxlRl0jnpWq2qwibORBhQYIb0QbNtuicc5ZxvKkVT71HJ4Py1wSZ/3VR1r8LfkCtoCzhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "posthtml-parser": "^0.11.0", + "posthtml-render": "^3.0.0" + }, "engines": { - "node": ">=18" + "node": ">=12.0.0" } }, - "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", - "cpu": [ - "arm64" - ], + "node_modules/posthtml-match-helper": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/posthtml-match-helper/-/posthtml-match-helper-2.0.3.tgz", + "integrity": "sha512-p9oJgTdMF2dyd7WE54QI1LvpBIkNkbSiiECKezNnDVYhGhD1AaOnAkw0Uh0y5TW+OHO8iBdSqnd8Wkpb6iUqmw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "peer": true, "engines": { "node": ">=18" + }, + "peerDependencies": { + "posthtml": "^0.16.6" } }, - "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", - "cpu": [ - "x64" - ], + "node_modules/posthtml-parser": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/posthtml-parser/-/posthtml-parser-0.11.0.tgz", + "integrity": "sha512-QecJtfLekJbWVo/dMAA+OSwY79wpRmbqS5TeXvXSX+f0c6pW4/SE6inzZ2qkU7oAMCPqIDkZDvd/bQsSFUnKyw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "peer": true, + "dependencies": { + "htmlparser2": "^7.1.1" + }, "engines": { - "node": ">=18" + "node": ">=12" } }, - "node_modules/tsx/node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", - "cpu": [ - "arm" - ], + "node_modules/posthtml-render": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/posthtml-render/-/posthtml-render-3.0.0.tgz", + "integrity": "sha512-z+16RoxK3fUPgwaIgH9NGnK1HKY9XIDpydky5eQGgAFVXTCSezalv9U2jQuNV+Z9qV1fDWNzldcw4eK0SSbqKA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, + "dependencies": { + "is-json": "^2.0.1" + }, "engines": { - "node": ">=18" + "node": ">=12" } }, - "node_modules/tsx/node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", - "cpu": [ - "arm64" - ], + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">= 0.8.0" } }, - "node_modules/tsx/node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", - "cpu": [ - "ia32" - ], + "node_modules/prettier": { + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, "engines": { - "node": ">=18" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/tsx/node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", - "cpu": [ - "loong64" - ], + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">=6" } }, - "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", - "cpu": [ - "mips64el" - ], + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true, + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">=6" } }, - "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", - "cpu": [ - "ppc64" - ], - "dev": true, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">=6" } }, - "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", - "cpu": [ - "riscv64" - ], + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" + "dependencies": { + "safe-buffer": "^5.1.0" } }, - "node_modules/tsx/node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", - "cpu": [ - "s390x" - ], + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">= 0.6" } }, - "node_modules/tsx/node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", - "cpu": [ - "x64" - ], + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", - "cpu": [ - "x64" - ], + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "peer": true, + "dependencies": { + "picomatch": "^2.2.1" + }, "engines": { - "node": ">=18" + "node": ">=8.10.0" } }, - "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", - "cpu": [ - "x64" - ], + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/tsx/node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", - "cpu": [ - "x64" - ], + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "peer": true, "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "node_modules/tsx/node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/tsx/node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", - "cpu": [ - "ia32" - ], + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, "engines": { "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tsx/node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", - "cpu": [ - "x64" - ], + "node_modules/restructure": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/restructure/-/restructure-3.0.2.tgz", + "integrity": "sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">=18" - } + "license": "MIT" }, - "node_modules/tsx/node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "node_modules/rolldown": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz", + "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==", "dev": true, - "hasInstallScript": true, "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, "bin": { - "esbuild": "bin/esbuild" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=18" + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" + "@rolldown/binding-android-arm-eabi": "1.2.19", + "@rolldown/binding-android-arm64": "1.2.19", + "@rolldown/binding-darwin-arm64": "1.2.19", + "@rolldown/binding-darwin-x64": "1.2.19", + "@rolldown/binding-freebsd-x64": "1.2.19", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.19", + "@rolldown/binding-linux-arm64-gnu": "1.2.19", + "@rolldown/binding-linux-arm64-musl": "1.2.19", + "@rolldown/binding-linux-ppc64-gnu": "1.2.19", + "@rolldown/binding-linux-s390x-gnu": "1.2.19", + "@rolldown/binding-linux-x64-gnu": "1.2.19", + "@rolldown/binding-linux-x64-musl": "1.2.19", + "@rolldown/binding-openharmony-arm64": "1.2.19", + "@rolldown/binding-wasm32-wasi": "1.2.19", + "@rolldown/binding-win32-arm64-msvc": "1.2.19", + "@rolldown/binding-win32-x64-msvc": "1.2.19" } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" + "tslib": "^2.1.0" } }, - "node_modules/typediagram": { - "resolved": "packages/cli", - "link": true - }, - "node_modules/typediagram-core": { - "resolved": "packages/typediagram", - "link": true - }, - "node_modules/typediagram-vscode": { - "resolved": "packages/vscode", - "link": true - }, - "node_modules/typedoc": { - "version": "0.28.20", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.20.tgz", - "integrity": "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg==", + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@gerrit0/mini-shiki": "^3.23.0", - "lunr": "^2.3.9", - "markdown-it": "^14.3.0", - "minimatch": "^10.2.5", - "yaml": "^2.9.0" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 18", - "pnpm": ">= 10" - }, - "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x" - } + "license": "MIT" }, - "node_modules/typedoc-plugin-markdown": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.12.0.tgz", - "integrity": "sha512-eJDEMAfxCmede22c/Jw7d0FA13ggAQv+KkwQYKYCdqI02cin6Rc9QRwbG/7XvvHWinuFejySnZVUWDtvGk3Vbg==", + "node_modules/section-matter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 18" + "dependencies": { + "extend-shallow": "^2.0.1", + "kind-of": "^6.0.0" }, - "peerDependencies": { - "typedoc": "0.28.x" + "engines": { + "node": ">=4" } }, - "node_modules/typescript": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "node_modules/semver": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", "dev": true, - "license": "Apache-2.0", - "peer": true, + "license": "ISC", "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "semver": "bin/semver.js" }, "engines": { - "node": ">=14.17" + "node": ">=10" } }, - "node_modules/typescript-compiler": { - "name": "typescript", - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } + "license": "MIT" }, - "node_modules/typescript-eslint": { - "version": "8.63.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.63.0.tgz", - "integrity": "sha512-xgwXyzG4sK9ALkBxbyGkTMMOS+imnW65iPhxCQMK83KhxyoDNW7l+IDqEf9vMdoUidHpOoS967RCq4eMiTexwQ==", + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.63.0", - "@typescript-eslint/parser": "8.63.0", - "@typescript-eslint/typescript-estree": "8.63.0", - "@typescript-eslint/utils": "8.63.0" + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">= 18" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" + "url": "https://opencollective.com/express" } }, - "node_modules/uc.micro": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "license": "MIT" + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } }, - "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true, "license": "MIT" }, - "node_modules/unicode-properties": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", - "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.0", - "unicode-trie": "^2.0.0" - } + "license": "ISC" }, - "node_modules/unicode-trie": { + "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", - "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", "dependencies": { - "pako": "^0.2.5", - "tiny-inflate": "^1.0.0" + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/unicode-trie/node_modules/pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", - "dev": true, - "license": "MIT" - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.8" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/urlpattern-polyfill": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz", - "integrity": "sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw==", - "dev": true, - "license": "MIT" - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "license": "MIT" - }, - "node_modules/vitest": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz", - "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "4.1.10", - "@vitest/mocker": "4.1.10", - "@vitest/pretty-format": "4.1.10", - "@vitest/runner": "4.1.10", - "@vitest/snapshot": "4.1.10", - "@vitest/spy": "4.1.10", - "@vitest/utils": "4.1.10", - "es-module-lexer": "^2.0.0", - "expect-type": "^1.3.0", - "magic-string": "^0.30.21", - "obug": "^2.1.1", - "pathe": "^2.0.3", - "picomatch": "^4.0.3", - "std-env": "^4.0.0-rc.1", - "tinybench": "^2.9.0", - "tinyexec": "^1.0.2", - "tinyglobby": "^0.2.15", - "tinyrainbow": "^3.1.0", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^20.0.0 || ^22.0.0 || >=24.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@opentelemetry/api": "^1.9.0", - "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.1.10", - "@vitest/browser-preview": "4.1.10", - "@vitest/browser-webdriverio": "4.1.10", - "@vitest/coverage-istanbul": "4.1.10", - "@vitest/coverage-v8": "4.1.10", - "@vitest/ui": "4.1.10", - "happy-dom": "*", - "jsdom": "*", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@opentelemetry/api": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser-playwright": { - "optional": true - }, - "@vitest/browser-preview": { - "optional": true - }, - "@vitest/browser-webdriverio": { - "optional": true - }, - "@vitest/coverage-istanbul": { - "optional": true - }, - "@vitest/coverage-v8": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - }, - "vite": { - "optional": false - } - } - }, - "node_modules/vitest/node_modules/@vitest/mocker": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz", - "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "4.1.10", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.21" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } + "node": ">=8" } }, - "node_modules/vitest/node_modules/vite": { - "version": "8.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", - "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", + "node_modules/shell-quote": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", "dev": true, "license": "MIT", - "dependencies": { - "lightningcss": "^1.32.0", - "picomatch": "^4.0.5", - "postcss": "^8.5.16", - "rolldown": "~1.1.4", - "tinyglobby": "^0.2.17" - }, - "bin": { - "vite": "bin/vite.js" - }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.3.0", - "esbuild": "^0.27.0 || ^0.28.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "@vitejs/devtools": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/vscode-oniguruma": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-2.0.1.tgz", - "integrity": "sha512-poJU8iHIWnC3vgphJnrLZyI3YdqRlR27xzqDmpPXYzA93R4Gk8z7T6oqDzDoHjoikA2aS82crdXFkjELCdJsjQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/vscode-textmate": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.3.2.tgz", - "integrity": "sha512-n2uGbUcrjhUEBH16uGA0TvUfhWwliFZ1e3+pTjrkim1Mt7ydB41lV08aUvsi70OlzDWp6X7Bx3w/x3fAXIsN0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } + "license": "ISC" }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/workerpool": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", - "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/slugify": { + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.9.tgz", + "integrity": "sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg==", "dev": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=8.0.0" } }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/smol-toml": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.1.tgz", + "integrity": "sha512-j7WyPdf0CJoutMzMoPLF/bVXHtKZIT9Rb4eGeEbWw8X2t5oirjPgpL+OpaENZrILYaXqYwnVH+qgUwVbl+pUJQ==", "dev": true, - "license": "MIT" + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, + "license": "BSD-3-Clause", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause" + }, + "node_modules/ssri": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-11.0.0.tgz", + "integrity": "sha512-aZpUoMN/Jj2MqA4vMCeiKGnc/8SuSyHbGSBdgFbZxP8OJGF/lFkIuElzPxsN0q8TQQ+prw3P4EDfB3TBHHgfXw==", + "dev": true, + "license": "ISC", "dependencies": { - "ansi-regex": "^5.0.1" + "minipass": "^7.0.3" }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/ws": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", - "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "node": ">= 0.8" } }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "node_modules/std-env": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } + "license": "MIT" }, - "node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "node_modules/stdin-discarder": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", + "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, + "license": "MIT", "engines": { - "node": ">= 14.6" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/eemeli" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "license": "MIT", "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" + "safe-buffer": "~5.1.0" } }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "ISC", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/yargs/node_modules/ansi-regex": { + "node_modules/string-width-cjs/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", @@ -7309,29 +6490,44 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/emoji-regex": { + "node_modules/string-width-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/yargs/node_modules/strip-ansi": { + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -7344,1024 +6540,1001 @@ "node": ">=8" } }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "packages/cli": { - "name": "typediagram", - "version": "0.0.0-dev", + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "dev": true, "license": "MIT", - "dependencies": { - "typediagram-core": "0.0.0-dev" - }, - "bin": { - "typediagram": "dist/bin.js" + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" }, - "devDependencies": { - "@types/node": "^26.1.1", - "typescript": "^7.0.2", - "vitest": "^4.1.10" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/cli/node_modules/typescript": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc" + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" }, "engines": { - "node": ">=16.20.0" - }, - "optionalDependencies": { - "@typescript/typescript-aix-ppc64": "7.0.2", - "@typescript/typescript-darwin-arm64": "7.0.2", - "@typescript/typescript-darwin-x64": "7.0.2", - "@typescript/typescript-freebsd-arm64": "7.0.2", - "@typescript/typescript-freebsd-x64": "7.0.2", - "@typescript/typescript-linux-arm": "7.0.2", - "@typescript/typescript-linux-arm64": "7.0.2", - "@typescript/typescript-linux-loong64": "7.0.2", - "@typescript/typescript-linux-mips64el": "7.0.2", - "@typescript/typescript-linux-ppc64": "7.0.2", - "@typescript/typescript-linux-riscv64": "7.0.2", - "@typescript/typescript-linux-s390x": "7.0.2", - "@typescript/typescript-linux-x64": "7.0.2", - "@typescript/typescript-netbsd-arm64": "7.0.2", - "@typescript/typescript-netbsd-x64": "7.0.2", - "@typescript/typescript-openbsd-arm64": "7.0.2", - "@typescript/typescript-openbsd-x64": "7.0.2", - "@typescript/typescript-sunos-x64": "7.0.2", - "@typescript/typescript-win32-arm64": "7.0.2", - "@typescript/typescript-win32-x64": "7.0.2" + "node": ">=8" } }, - "packages/typediagram": { - "name": "typediagram-core", - "version": "0.0.0-dev", + "node_modules/svg-to-pdfkit": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/svg-to-pdfkit/-/svg-to-pdfkit-0.1.8.tgz", + "integrity": "sha512-QItiGZBy5TstGy+q8mjQTMGRlDDOARXLxH+sgVm1n/LYeo0zFcQlcCh8m4zi8QxctrxB9Kue/lStc/RD5iLadQ==", + "dev": true, "license": "MIT", "dependencies": { - "@lezer/python": "^1.1.19", - "elkjs": "^0.11.1" - }, - "devDependencies": { - "@types/node": "^26.1.1", - "esbuild": "^0.28.1", - "happy-dom": "^20.10.6", - "typescript": "^7.0.2", - "typescript-compiler": "npm:typescript@6.0.3", - "vitest": "^4.1.10" + "pdfkit": ">=0.8.1" } }, - "packages/typediagram/node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", - "cpu": [ - "ppc64" - ], + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "aix" - ], "engines": { "node": ">=18" } }, - "packages/typediagram/node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", - "cpu": [ - "arm" - ], + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ], + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, "engines": { - "node": ">=18" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" } }, - "packages/typediagram/node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", - "cpu": [ - "arm64" - ], + "node_modules/tinyrainbow": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ], "engines": { - "node": ">=18" + "node": ">=14.0.0" } }, - "packages/typediagram/node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", - "cpu": [ - "x64" - ], + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ], + "dependencies": { + "is-number": "^7.0.0" + }, "engines": { - "node": ">=18" + "node": ">=8.0" } }, - "packages/typediagram/node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", - "cpu": [ - "arm64" - ], + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": ">=18" + "node": ">=0.6" } }, - "packages/typediagram/node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", - "cpu": [ - "x64" - ], + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" + "bin": { + "tree-kill": "cli.js" } }, - "packages/typediagram/node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", - "cpu": [ - "arm64" - ], + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], "engines": { - "node": ">=18" + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" } }, - "packages/typediagram/node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", - "cpu": [ - "x64" - ], + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.0.tgz", + "integrity": "sha512-eUdUIaCr963q2h5u3+QwvYp0+eqPvn+egeqZUm0hwERCqqx1E3kK5ehbGCvqSE5MQAULr67ww0cA3jKc3YkM1w==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, "engines": { - "node": ">=18" + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" } }, - "packages/typediagram/node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", - "cpu": [ - "arm" - ], + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "prelude-ls": "^1.2.1" + }, "engines": { - "node": ">=18" + "node": ">= 0.8.0" } }, - "packages/typediagram/node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", - "cpu": [ - "arm64" - ], + "node_modules/typediagram": { + "resolved": "src/cli", + "link": true + }, + "node_modules/typediagram-core": { + "resolved": "src/typediagram", + "link": true + }, + "node_modules/typediagram-vscode": { + "resolved": "src/vscode", + "link": true + }, + "node_modules/typedoc": { + "version": "0.28.20", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.20.tgz", + "integrity": "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "Apache-2.0", + "dependencies": { + "@gerrit0/mini-shiki": "^3.23.0", + "lunr": "^2.3.9", + "markdown-it": "^14.3.0", + "minimatch": "^10.2.5", + "yaml": "^2.9.0" + }, + "bin": { + "typedoc": "bin/typedoc" + }, "engines": { - "node": ">=18" + "node": ">= 18", + "pnpm": ">= 10" + }, + "peerDependencies": { + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x" } }, - "packages/typediagram/node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", - "cpu": [ - "ia32" - ], + "node_modules/typedoc-plugin-markdown": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.12.0.tgz", + "integrity": "sha512-eJDEMAfxCmede22c/Jw7d0FA13ggAQv+KkwQYKYCdqI02cin6Rc9QRwbG/7XvvHWinuFejySnZVUWDtvGk3Vbg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.28.x" } }, - "packages/typediagram/node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", - "cpu": [ - "loong64" - ], + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, "engines": { - "node": ">=18" + "node": ">=14.17" } }, - "packages/typediagram/node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", - "cpu": [ - "mips64el" - ], + "node_modules/typescript-compiler": { + "name": "typescript", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, "engines": { - "node": ">=18" + "node": ">=14.17" } }, - "packages/typediagram/node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", - "cpu": [ - "ppc64" - ], + "node_modules/typescript-eslint": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.63.0.tgz", + "integrity": "sha512-xgwXyzG4sK9ALkBxbyGkTMMOS+imnW65iPhxCQMK83KhxyoDNW7l+IDqEf9vMdoUidHpOoS967RCq4eMiTexwQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.63.0", + "@typescript-eslint/parser": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0" + }, "engines": { - "node": ">=18" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "packages/typediagram/node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", - "cpu": [ - "riscv64" - ], + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unicode-properties": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", + "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "base64-js": "^1.3.0", + "unicode-trie": "^2.0.0" } }, - "packages/typediagram/node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", - "cpu": [ - "s390x" - ], + "node_modules/unicode-trie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", + "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "pako": "^0.2.5", + "tiny-inflate": "^1.0.0" } }, - "packages/typediagram/node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", - "cpu": [ - "x64" - ], + "node_modules/unicode-trie/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">= 0.8" } }, - "packages/typediagram/node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", - "cpu": [ - "x64" - ], + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" } }, - "packages/typediagram/node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", - "cpu": [ - "x64" - ], + "node_modules/urlpattern-polyfill": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz", + "integrity": "sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.8.tgz", + "integrity": "sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.32", + "rolldown": "~1.2.18", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, "engines": { - "node": ">=18" + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } } }, - "packages/typediagram/node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", - "cpu": [ - "x64" - ], + "node_modules/vitest": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.12.tgz", + "integrity": "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], + "dependencies": { + "@vitest/expect": "4.1.12", + "@vitest/mocker": "4.1.12", + "@vitest/pretty-format": "4.1.12", + "@vitest/runner": "4.1.12", + "@vitest/snapshot": "4.1.12", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, "engines": { - "node": ">=18" + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.12", + "@vitest/browser-preview": "4.1.12", + "@vitest/browser-webdriverio": "^4.1.11", + "@vitest/coverage-istanbul": "4.1.12", + "@vitest/coverage-v8": "4.1.12", + "@vitest/ui": "4.1.12", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } } }, - "packages/typediagram/node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", - "cpu": [ - "arm64" - ], + "node_modules/vscode-oniguruma": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-2.0.1.tgz", + "integrity": "sha512-poJU8iHIWnC3vgphJnrLZyI3YdqRlR27xzqDmpPXYzA93R4Gk8z7T6oqDzDoHjoikA2aS82crdXFkjELCdJsjQ==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } + "license": "MIT" }, - "packages/typediagram/node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", - "cpu": [ - "ia32" - ], + "node_modules/vscode-textmate": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.3.2.tgz", + "integrity": "sha512-n2uGbUcrjhUEBH16uGA0TvUfhWwliFZ1e3+pTjrkim1Mt7ydB41lV08aUvsi70OlzDWp6X7Bx3w/x3fAXIsN0Q==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } + "license": "MIT" }, - "packages/typediagram/node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", - "cpu": [ - "x64" - ], + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], "engines": { - "node": ">=18" + "node": ">=12" } }, - "packages/typediagram/node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" - } - }, - "packages/typediagram/node_modules/typescript": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", - "dev": true, - "license": "Apache-2.0", "bin": { - "tsc": "bin/tsc" + "node-which": "bin/node-which" }, "engines": { - "node": ">=16.20.0" - }, - "optionalDependencies": { - "@typescript/typescript-aix-ppc64": "7.0.2", - "@typescript/typescript-darwin-arm64": "7.0.2", - "@typescript/typescript-darwin-x64": "7.0.2", - "@typescript/typescript-freebsd-arm64": "7.0.2", - "@typescript/typescript-freebsd-x64": "7.0.2", - "@typescript/typescript-linux-arm": "7.0.2", - "@typescript/typescript-linux-arm64": "7.0.2", - "@typescript/typescript-linux-loong64": "7.0.2", - "@typescript/typescript-linux-mips64el": "7.0.2", - "@typescript/typescript-linux-ppc64": "7.0.2", - "@typescript/typescript-linux-riscv64": "7.0.2", - "@typescript/typescript-linux-s390x": "7.0.2", - "@typescript/typescript-linux-x64": "7.0.2", - "@typescript/typescript-netbsd-arm64": "7.0.2", - "@typescript/typescript-netbsd-x64": "7.0.2", - "@typescript/typescript-openbsd-arm64": "7.0.2", - "@typescript/typescript-openbsd-x64": "7.0.2", - "@typescript/typescript-sunos-x64": "7.0.2", - "@typescript/typescript-win32-arm64": "7.0.2", - "@typescript/typescript-win32-x64": "7.0.2" + "node": ">= 8" } }, - "packages/vscode": { - "name": "typediagram-vscode", - "version": "0.0.0-dev", + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, "license": "MIT", "dependencies": { - "markdown-it": "^14.3.0", - "typediagram-core": "0.0.0-dev" + "siginfo": "^2.0.0", + "stackback": "0.0.2" }, - "devDependencies": { - "@types/markdown-it": "^14.1.2", - "@types/mocha": "^10.0.10", - "@types/node": "^26.1.1", - "@types/pdfkit": "^0.17.6", - "@types/vscode": "1.99.1", - "@vscode/test-electron": "^3.0.0", - "esbuild": "^0.28.1", - "mocha": "^11.7.6", - "pdfkit": "^0.19.1", - "svg-to-pdfkit": "^0.1.8", - "typescript": "^7.0.2", - "vitest": "^4.1.10", - "vscode-oniguruma": "^2.0.1", - "vscode-textmate": "^9.1.0" + "bin": { + "why-is-node-running": "cli.js" }, "engines": { - "vscode": "^1.99.0" - } - }, - "packages/vscode/node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "packages/vscode/node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", - "cpu": [ - "arm64" - ], + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ], "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "packages/vscode/node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", - "cpu": [ - "x64" - ], + "node_modules/workerpool": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } + "license": "Apache-2.0" }, - "packages/vscode/node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", - "cpu": [ - "arm64" - ], + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "packages/vscode/node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", - "cpu": [ - "x64" - ], + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "packages/vscode/node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", - "cpu": [ - "arm64" - ], + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", - "cpu": [ - "x64" - ], + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=18" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "packages/vscode/node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", - "cpu": [ - "arm" - ], + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", - "cpu": [ - "arm64" - ], + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", - "cpu": [ - "ia32" - ], + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, - "packages/vscode/node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", - "cpu": [ - "loong64" - ], + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "ISC", "engines": { - "node": ">=18" + "node": ">=10" } }, - "packages/vscode/node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", - "cpu": [ - "mips64el" - ], + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, "engines": { - "node": ">=18" + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" } }, - "packages/vscode/node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", - "cpu": [ - "ppc64" - ], + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, "engines": { - "node": ">=18" + "node": ">=12" } }, - "packages/vscode/node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", - "cpu": [ - "riscv64" - ], + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "license": "ISC", "engines": { - "node": ">=18" + "node": ">=12" } }, - "packages/vscode/node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", - "cpu": [ - "s390x" - ], + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, "engines": { - "node": ">=18" + "node": ">=10" } }, - "packages/vscode/node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", - "cpu": [ - "x64" - ], + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", - "cpu": [ - "x64" - ], + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", - "cpu": [ - "x64" - ], + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { - "node": ">=18" + "node": ">=8" } }, - "packages/vscode/node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", - "cpu": [ - "x64" - ], + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/vscode/node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", - "cpu": [ - "arm64" - ], - "dev": true, + "src/cli": { + "name": "typediagram", + "version": "0.0.0-dev", "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "typediagram-core": "0.0.0-dev" + }, + "bin": { + "typediagram": "dist/bin.js", + "typediagram-typeshed": "dist/typeshed-bin.js" + }, + "devDependencies": { + "@types/node": "^26.1.1", + "typescript": "^7.0.2", + "vitest": "^4.1.12" } }, - "packages/vscode/node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", - "cpu": [ - "ia32" - ], + "src/cli/node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc" + }, "engines": { - "node": ">=18" + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" } }, - "packages/vscode/node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", - "cpu": [ - "x64" - ], - "dev": true, + "src/typediagram": { + "name": "typediagram-core", + "version": "0.0.0-dev", "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@lezer/python": "^1.1.19", + "elkjs": "^0.11.1" + }, + "devDependencies": { + "@types/node": "^26.1.1", + "esbuild": "^0.28.1", + "happy-dom": "^20.10.6", + "typescript": "^7.0.2", + "typescript-compiler": "npm:typescript@6.0.3", + "vitest": "^4.1.12" } }, - "packages/vscode/node_modules/@types/vscode": { - "version": "1.99.1", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.99.1.tgz", - "integrity": "sha512-cQlqxHZ040ta6ovZXnXRxs3fJiTmlurkIWOfZVcLSZPcm9J4ikFpXuB7gihofGn5ng+kDVma5EmJIclfk0trPQ==", - "dev": true, - "license": "MIT" - }, - "packages/vscode/node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "src/typediagram/node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dev": true, - "hasInstallScript": true, - "license": "MIT", + "license": "Apache-2.0", "bin": { - "esbuild": "bin/esbuild" + "tsc": "bin/tsc" }, "engines": { - "node": ">=18" + "node": ">=16.20.0" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" - } - }, - "packages/vscode/node_modules/typescript": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + }, + "src/vscode": { + "name": "typediagram-vscode", + "version": "0.0.0-dev", + "license": "MIT", + "dependencies": { + "markdown-it": "^14.3.3", + "typediagram-core": "0.0.0-dev" + }, + "devDependencies": { + "@types/markdown-it": "^14.1.2", + "@types/mocha": "^10.0.10", + "@types/node": "^26.1.1", + "@types/pdfkit": "^0.17.6", + "@types/vscode": "1.99.1", + "@vscode/test-electron": "^3.0.0", + "esbuild": "^0.28.1", + "mocha": "^11.7.6", + "pdfkit": "^0.19.1", + "svg-to-pdfkit": "^0.1.8", + "typescript": "^7.0.2", + "vitest": "^4.1.12", + "vscode-oniguruma": "^2.0.1", + "vscode-textmate": "^9.1.0" + }, + "engines": { + "vscode": "^1.99.0" + } + }, + "src/vscode/node_modules/typescript": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", @@ -8396,7 +7569,7 @@ "@typescript/typescript-win32-x64": "7.0.2" } }, - "packages/web": { + "src/web": { "name": "@typediagram/web", "version": "0.0.0-dev", "dependencies": { @@ -8407,7 +7580,7 @@ "@11ty/eleventy": "^3.1.6", "@playwright/test": "^1.61.1", "@types/prismjs": "^1.26.6", - "concurrently": "^10.0.3", + "concurrently": "^10.0.6", "happy-dom": "^20.10.6", "monocart-coverage-reports": "^2.12.12", "prismjs": "^1.30.0", @@ -8415,11 +7588,11 @@ "typedoc": "^0.28.20", "typedoc-plugin-markdown": "^4.12.0", "typescript": "^7.0.2", - "vite": "^8.1.4", - "vitest": "^4.1.10" + "vite": "^8.3.5", + "vitest": "^4.1.12" } }, - "packages/web/node_modules/typescript": { + "src/web/node_modules/typescript": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", @@ -8453,84 +7626,6 @@ "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" } - }, - "packages/web/node_modules/vite": { - "version": "8.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", - "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "lightningcss": "^1.32.0", - "picomatch": "^4.0.5", - "postcss": "^8.5.16", - "rolldown": "~1.1.4", - "tinyglobby": "^0.2.17" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.3.0", - "esbuild": "^0.27.0 || ^0.28.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "@vitejs/devtools": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } } } } diff --git a/package.json b/package.json index c9d2414..a88d99f 100644 --- a/package.json +++ b/package.json @@ -3,21 +3,25 @@ "private": true, "type": "module", "workspaces": [ - "packages/*" + "src/typediagram", + "src/cli", + "src/web", + "src/vscode" ], "scripts": { "build": "npm run -ws --if-present build", "test": "npm run -ws --if-present test", "typecheck": "npm run -ws --if-present typecheck", - "lint": "eslint .", + "lint": "eslint --config src/eslint.config.mjs src", "fmt": "prettier --write .", "fmt:check": "prettier --check ." }, "devDependencies": { "@eslint/js": "^10.0.1", - "@vitest/coverage-v8": "^4.1.10", + "@vitest/coverage-v8": "^4.1.12", "eslint": "^10.6.0", "prettier": "^3.9.5", + "smol-toml": "^1.9.1", "typescript-eslint": "^8.63.0" } } diff --git a/packages/typediagram/src/tdbin/index.ts b/packages/typediagram/src/tdbin/index.ts deleted file mode 100644 index 615852b..0000000 --- a/packages/typediagram/src/tdbin/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { ok, type Result } from "../result.js"; -import { tdbinErr } from "./error.js"; -import { decodeFrame, encodeFrame, encodePackedFrame, looksFramed, unpackFrameBody } from "./frame.js"; -import { message as readMessage } from "./reader.js"; -import type { StructCodec, TdbinError } from "./types.js"; -import { message as writeMessage } from "./writer.js"; - -export type { FrameMessage, Reader, StructCodec, TdbinError, TdbinErrorCode, Writer } from "./types.js"; -export * as frame from "./frame.js"; -export * as pack from "./pack.js"; -export * as pointer from "./pointer.js"; -export * as reader from "./reader.js"; -export * as scalar from "./word.js"; -export * as writer from "./writer.js"; -export const readerError = tdbinErr; - -export const encode = (codec: StructCodec, value: T): Result => - writeMessage(codec, value); - -export const decode = (codec: StructCodec, bytes: Uint8Array): Result => readMessage(codec, bytes); - -export const encodeFramed = ( - codec: StructCodec, - value: T, - schemaHash: bigint | null = null -): Result => { - const body = encode(codec, value); - return body.ok ? encodeFrame(body.value, { schemaHash }) : body; -}; - -export const encodePackedFramed = ( - codec: StructCodec, - value: T, - schemaHash: bigint | null = null -): Result => { - const body = encode(codec, value); - return body.ok ? encodePackedFrame(body.value, schemaHash) : body; -}; - -export const decodeAuto = ( - codec: StructCodec, - bytes: Uint8Array, - expectedHash: bigint | null = null -): Result => { - if (!looksFramed(bytes)) { - return decode(codec, bytes); - } - const framed = decodeFrame(bytes); - if (framed.ok && expectedHash !== null && framed.value.schemaHash !== expectedHash) { - return tdbinErr("HashMismatch", { expectedHash, gotHash: framed.value.schemaHash }); - } - const body = framed.ok ? unpackFrameBody(framed.value) : framed; - return body.ok ? decode(codec, body.value) : body; -}; - -export const fromHex = (hex: string): Result => { - if (hex.length % 2 !== 0) { - return tdbinErr("BadLength"); - } - const bytes: number[] = []; - for (let offset = 0; offset < hex.length; offset += 2) { - const byte = Number.parseInt(hex.slice(offset, offset + 2), 16); - if (!Number.isInteger(byte)) { - return tdbinErr("BadLength"); - } - bytes.push(byte); - } - return ok(Uint8Array.from(bytes)); -}; - -export const toHex = (bytes: Uint8Array): string => - Array.from(bytes) - .map((byte) => byte.toString(16).padStart(2, "0")) - .join(""); diff --git a/packages/typediagram/test/converters/typescript-tdbin.test.ts b/packages/typediagram/test/converters/typescript-tdbin.test.ts deleted file mode 100644 index b60c206..0000000 --- a/packages/typediagram/test/converters/typescript-tdbin.test.ts +++ /dev/null @@ -1,414 +0,0 @@ -// [CONV-TS-TDBIN] Pins the TypeScript TDBIN code generator: it emits typed -// StructCodec objects over the runtime in `src/tdbin`, with layout baked into -// the generated code ([TDBIN-FUTURE-TS], [TDBIN-REC-ALLOC]). -import { runInNewContext } from "node:vm"; -import * as ts from "typescript-compiler"; -import { describe, expect, it } from "vitest"; -import { emitRustCodec } from "../../src/converters/rust-tdbin.js"; -import { emitTypeScriptCodec, generateTypeScriptModule } from "../../src/converters/typescript-tdbin.js"; -import { buildModel } from "../../src/model/index.js"; -import { parse } from "../../src/parser/index.js"; -import type { Model } from "../../src/model/types.js"; -import { ok } from "../../src/result.js"; -import * as tdbin from "../../src/tdbin/index.js"; -import { expectErrorMessages, unwrap } from "./helpers.js"; - -const PERSON_TD = `type Address { - street: String - zip: Int -} -type EmailContact { - addr: String -} -type PhoneContact { - number: Int - country: Int -} -union Contact { - Email(EmailContact) - Phone(PhoneContact) -} -type Person { - name: String - age: Int - active: Bool - score: Float - address: Option
- nickname: Option - contact: Contact -}`; - -const modelFor = (td: string): Model => unwrap(buildModel(unwrap(parse(td)))); - -// Executes generated codec source for behavior tests: the emitted TypeScript is -// transpiled with the real compiler (never regex on code) and evaluated against -// the real runtime, exactly as a consumer module would run it. The host-realm -// Uint8Array is injected so generated defaults share the test realm. -const instantiateCodecs = (source: string): Record => { - const js = ts.transpileModule(source, { - compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 }, - }).outputText; - const moduleExports: Record = {}; - runInNewContext(js, { exports: moduleExports, tdbin, ok, Uint8Array }); - return moduleExports; -}; - -const codecFor = (source: string, name: string): tdbin.StructCodec => { - const generated = instantiateCodecs(source)[name]; - expect(generated).toBeDefined(); - // Safe: the generator declares every exported `${Type}Codec` as - // tdbin.StructCodec, pinned by the text assertions in this file. - return generated as tdbin.StructCodec; -}; - -interface Sensor { - readonly id: number; -} - -interface Measurement { - readonly label: string; - readonly count: number; - readonly ratio: number; - readonly enabled: boolean; - readonly unit: string | undefined; - readonly sensor: Sensor; -} - -const MEASUREMENT_TD = `type Sensor { - id: Int -} -type Measurement { - label: String - count: Int - ratio: Float - enabled: Bool - unit: Option - sensor: Sensor -}`; - -type WriterSignal = { readonly kind: "Idle" } | { readonly kind: "Note"; readonly _0: string }; - -interface WriterPacket { - readonly name: string | undefined; - readonly data: Uint8Array | undefined; - readonly contact: WriterSignal | undefined; -} - -interface IdleInfo { - readonly reason: string; -} - -type ReaderSignal = { readonly kind: "Idle"; readonly _0: IdleInfo } | { readonly kind: "Note"; readonly _0: string }; - -interface ReaderPacket { - readonly name: string; - readonly data: Uint8Array; - readonly contact: ReaderSignal; -} - -// Same wire layout as NULL_READER_TD (ptr slots 0..2, union disc + 1 ptr slot), -// but every pointer field is optional so nulls can actually be written. -const NULL_WRITER_TD = `type Packet { - name: Option - data: Option - contact: Option -} -union Signal { - Idle - Note(String) -}`; - -const NULL_READER_TD = `type Packet { - name: String - data: Bytes - contact: Signal -} -union Signal { - Idle(IdleInfo) - Note(String) -} -type IdleInfo { - reason: String -}`; - -describe("[CONV-TS-TDBIN] TypeScript codec generator", () => { - it("emits slot-addressed record codecs over the TypeScript runtime", () => { - const code = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); - expect(code).toContain("export const PersonCodec: tdbin.StructCodec"); - expect(code).toContain("dataWords: 3"); - expect(code).toContain("ptrWords: 4"); - expect(code).toContain("tdbin.writer.string(writer, at, PersonCodec.dataWords, 0, value.name)"); - expect(code).toContain("const ageBits = tdbin.scalar.i64Bits(value.age);"); - expect(code).toContain("if (!age.ok) return age;"); - expect(code).toContain("tdbin.writer.boolBit(writer, at, 1, 0, value.active)"); - expect(code).toContain( - "tdbin.writer.child(writer, at, PersonCodec.dataWords, 1, AddressCodec, value.address ?? null)" - ); - expect(code).toContain("const scoreWord = tdbin.reader.scalar(reader, at, 2);"); - expect(code).toContain("age: tdbin.scalar.i64From(ageWord.value)"); - expect(code).toContain("address: address.value ?? undefined"); - expect(code).toContain('name: name.value ?? ""'); - expect(code).toContain("contact: contact.value ?? defaultContact()"); - expect(code).not.toContain('tdbin.readerError("UnexpectedNull")'); - }); - - it("emits union discriminant arms and null-payload defaults", () => { - const code = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); - expect(code).toContain("export const ContactCodec: tdbin.StructCodec"); - expect(code).toContain('case "Email": {'); - expect(code).toContain("const disc = tdbin.writer.scalar(writer, at, 0, 0n);"); - expect(code).toContain("tdbin.writer.child(writer, at, ContactCodec.dataWords, 0, EmailContactCodec, value._0)"); - expect(code).toContain("case 1n: {"); - expect(code).toContain('return ok({ kind: "Phone", _0: payload.value ?? defaultPhoneContact() });'); - expect(code).toContain('return tdbin.readerError("UnknownVariant", { ordinal: ordinal.value });'); - }); - - it("generates a self-contained module with type declarations and runtime imports", () => { - const moduleText = unwrap(generateTypeScriptModule(modelFor(PERSON_TD))); - expect(moduleText).toContain('import * as tdbin from "typediagram-core/tdbin";'); - expect(moduleText).toContain("export interface Person"); - expect(moduleText).toContain('export type Contact =\n | { kind: "Email"; _0: EmailContact }'); - expect(moduleText).toContain("const defaultContact = "); - expect(moduleText).toContain("export const PersonCodec"); - }); - - it("rejects unsupported shapes loudly", () => { - const result = emitTypeScriptCodec(modelFor("type R {\n items: List\n}")); - expectErrorMessages(result, ["unsupported field type 'List'"]); - const moduleResult = generateTypeScriptModule(modelFor("type R {\n items: List\n}")); - expectErrorMessages(moduleResult, ["unsupported field type 'List'"]); - }); - - it("emits bytes, optional bytes, bare variants, and string-payload variants", () => { - const code = unwrap( - emitTypeScriptCodec( - modelFor(`type Blob { - raw: Bytes - maybe: Option -} -union Notice { - Empty - Text(String) -}`) - ) - ); - expect(code).toContain("tdbin.writer.bytes(writer, at, BlobCodec.dataWords, 0, value.raw)"); - expect(code).toContain("tdbin.writer.bytes(writer, at, BlobCodec.dataWords, 1, value.maybe ?? null)"); - expect(code).toContain("raw: raw.value ?? new Uint8Array(0)"); - expect(code).toContain("maybe: maybe.value ?? undefined"); - expect(code).toContain("const inactive = tdbin.reader.requireNullPointer(reader, at, 0);"); - expect(code).toContain('return inactive.ok ? ok({ kind: "Empty" }) : inactive;'); - expect(code).toContain("tdbin.writer.string(writer, at, NoticeCodec.dataWords, 0, value._0)"); - expect(code).toContain("tdbin.reader.string(reader, at, NoticeCodec.dataWords, 0)"); - expect(code).toContain('return ok({ kind: "Text", _0: payload.value ?? "" });'); - }); - - it("rejects unsupported generic and variant shapes", () => { - const generic = emitTypeScriptCodec(modelFor("type Box {\n value: T\n}")); - const multi = emitTypeScriptCodec(modelFor("union Bad {\n Both(Int, String)\n}")); - const payload = emitTypeScriptCodec(modelFor("union Bad {\n Count(Int)\n}")); - expect(generic.ok ? "" : generic.error[0]?.message).toContain("must be monomorphized"); - expect(multi.ok ? "" : multi.error[0]?.message).toContain("bare or a single tuple field"); - expect(payload.ok ? "" : payload.error[0]?.message).toContain("payload 'Int' unsupported"); - }); - - it("emits empty records using the runtime's non-null zero-size marker", () => { - const code = unwrap(emitTypeScriptCodec(modelFor("alias Id = String\ntype Empty {}"))); - expect(code).toContain("export const EmptyCodec"); - expect(code).toContain("dataWords: 0"); - expect(code).toContain("ptrWords: 0"); - expect(code).not.toContain("IdCodec"); - }); - - it("decodes required null pointers to per-type schema defaults [TDBIN-PTR-NULL]", () => { - const person = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); - expect(person).toContain('const defaultEmailContact = (): EmailContact => ({ addr: "" });'); - expect(person).toContain("const defaultPhoneContact = (): PhoneContact => ({ number: 0, country: 0 });"); - expect(person).toContain('const defaultContact = (): Contact => ({ kind: "Email", _0: defaultEmailContact() });'); - expect(person).not.toContain("const defaultAddress"); - expect(person).not.toContain("const defaultPerson"); - expect(person.indexOf("const defaultEmailContact")).toBeLessThan(person.indexOf("export const AddressCodec")); - const chain = unwrap( - emitTypeScriptCodec( - modelFor("type Leaf {\n tag: String\n}\ntype Mid {\n leaf: Leaf\n}\ntype Root {\n mid: Mid\n}") - ) - ); - expect(chain).toContain('const defaultLeaf = (): Leaf => ({ tag: "" });'); - expect(chain).toContain("const defaultMid = (): Mid => ({ leaf: defaultLeaf() });"); - expect(chain).toContain("mid: mid.value ?? defaultMid()"); - const blob = unwrap( - emitTypeScriptCodec( - modelFor( - "type Blob {\n raw: Bytes\n flag: Bool\n ratio: Float\n maybe: Option\n}\ntype Wrap {\n blob: Blob\n}" - ) - ) - ); - expect(blob).toContain( - "const defaultBlob = (): Blob => ({ raw: new Uint8Array(0), flag: false, ratio: 0, maybe: undefined });" - ); - expect(blob).toContain("blob: blob.value ?? defaultBlob()"); - const emptyRec = unwrap(emitTypeScriptCodec(modelFor("type Empty {}\ntype Holder {\n e: Empty\n}"))); - expect(emptyRec).toContain("const defaultEmpty = (): Empty => ({});"); - expect(emptyRec).toContain("e: e.value ?? defaultEmpty()"); - const bareFirst = unwrap( - emitTypeScriptCodec(modelFor("union Notice {\n Empty\n Text(String)\n}\ntype Holder {\n notice: Notice\n}")) - ); - expect(bareFirst).toContain('const defaultNotice = (): Notice => ({ kind: "Empty" });'); - expect(bareFirst).toContain("notice: notice.value ?? defaultNotice()"); - const stringFirst = unwrap( - emitTypeScriptCodec(modelFor("union Label {\n Text(String)\n}\ntype Tag {\n label: Label\n}")) - ); - expect(stringFirst).toContain('const defaultLabel = (): Label => ({ kind: "Text", _0: "" });'); - }); - - it("rejects defaults that cannot terminate: recursive and empty-union required fields", () => { - const selfRecursive = emitTypeScriptCodec(modelFor("type Node {\n next: Node\n}")); - expect(selfRecursive.ok).toBe(false); - expect(selfRecursive.ok ? "" : selfRecursive.error[0]?.message).toContain( - "cannot derive [TDBIN-PTR-NULL] default for recursive type 'Node' (Node -> Node)" - ); - const mutual = emitTypeScriptCodec(modelFor("union Tree {\n Node(Branch)\n}\ntype Branch {\n left: Tree\n}")); - expect(mutual.ok).toBe(false); - expect(mutual.ok ? "" : mutual.error[0]?.message).toContain("recursive type 'Tree' (Tree -> Branch -> Tree)"); - const optionBreaksCycle = unwrap( - emitTypeScriptCodec( - modelFor("type Node {\n next: Option\n label: Node2\n}\ntype Node2 {\n tag: String\n}") - ) - ); - expect(optionBreaksCycle).toContain('const defaultNode2 = (): Node2 => ({ tag: "" });'); - expect(optionBreaksCycle).not.toContain("const defaultNode = "); - const emptyUnion = emitTypeScriptCodec(modelFor("union Never {}\ntype Holder {\n n: Never\n}")); - expect(emptyUnion.ok).toBe(false); - expect(emptyUnion.ok ? "" : emptyUnion.error[0]?.message).toContain( - "union 'Never' has no variants; cannot derive its [TDBIN-PTR-NULL] default" - ); - }); - - it("emits 1-bit presence flags plus natural-width value slots for Option [TDBIN-PRIM-OPTION]", () => { - const code = unwrap( - emitTypeScriptCodec( - modelFor( - "type Reading {\n label: String\n count: Option\n flagged: Option\n ratio: Option\n}" - ) - ) - ); - // Bitset word 0: count-presence bit 0, flagged-presence bit 1, - // flagged-VALUE bit 2, ratio-presence bit 3; count value w1, ratio w2. - expect(code).toContain("dataWords: 3"); - expect(code).toContain("tdbin.writer.boolBit(writer, at, 0, 0, value.count !== undefined)"); - expect(code).toContain("const countBits = tdbin.scalar.i64Bits(value.count ?? 0);"); - expect(code).toContain("const count = tdbin.writer.scalar(writer, at, 1, countBits.value);"); - expect(code).toContain("tdbin.writer.boolBit(writer, at, 0, 1, value.flagged !== undefined)"); - expect(code).toContain("const flagged = tdbin.writer.boolBit(writer, at, 0, 2, value.flagged ?? false);"); - expect(code).toContain("tdbin.writer.boolBit(writer, at, 0, 3, value.ratio !== undefined)"); - expect(code).toContain("const ratio = tdbin.writer.scalar(writer, at, 2, tdbin.scalar.f64Bits(value.ratio ?? 0));"); - expect(code).toContain("const countPresent = tdbin.reader.boolBit(reader, at, 0, 0);"); - expect(code).toContain("const countWord = tdbin.reader.scalar(reader, at, 1);"); - expect(code).toContain("count: countPresent.value ? tdbin.scalar.i64From(countWord.value) : undefined"); - expect(code).toContain("const flaggedValue = tdbin.reader.boolBit(reader, at, 0, 2);"); - expect(code).toContain("flagged: flaggedPresent.value ? flaggedValue.value : undefined"); - expect(code).toContain("ratio: ratioPresent.value ? tdbin.scalar.f64From(ratioWord.value) : undefined"); - expect(code).toContain("if (!countPresent.ok) return countPresent;"); - }); - - it("bakes the SAME slot/bit numbers as the Rust emitter (cross-language layout parity)", () => { - // Mixed Bool and Option fields exercise the shared first-fit bit - // allocator: a w0.0, b presence w0.1 + value w1, c presence w0.2 + value - // w0.3, d w0.4, e presence w0.5 + value w2, f w3 -> 4 data words. - const PARITY_TD = - "type Mixed {\n a: Bool\n b: Option\n c: Option\n d: Bool\n e: Option\n f: Int\n}"; - const rust = unwrap(emitRustCodec(modelFor(PARITY_TD))); - const tsCode = unwrap(emitTypeScriptCodec(modelFor(PARITY_TD))); - expect(rust).toContain("const DATA_WORDS: u16 = 4;"); - expect(tsCode).toContain("dataWords: 4"); - expect(rust).toContain("w.bool_bit(at, 0, 0, self.a)?;"); - expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 0, value.a)"); - expect(rust).toContain("w.bool_bit(at, 0, 1, self.b.is_some())?;"); - expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 1, value.b !== undefined)"); - expect(rust).toContain("w.scalar(at, 1, self.b.map_or(0, tdbin::scalar::i64_bits))?;"); - expect(tsCode).toContain("tdbin.writer.scalar(writer, at, 1, bBits.value)"); - expect(rust).toContain("w.bool_bit(at, 0, 2, self.c.is_some())?;"); - expect(rust).toContain("w.bool_bit(at, 0, 3, self.c.unwrap_or_default())?;"); - expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 2, value.c !== undefined)"); - expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 3, value.c ?? false)"); - expect(rust).toContain("w.bool_bit(at, 0, 4, self.d)?;"); - expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 4, value.d)"); - expect(rust).toContain("w.bool_bit(at, 0, 5, self.e.is_some())?;"); - expect(rust).toContain("w.scalar(at, 2, self.e.map_or(0, tdbin::scalar::f64_bits))?;"); - expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 5, value.e !== undefined)"); - expect(tsCode).toContain("tdbin.writer.scalar(writer, at, 2, tdbin.scalar.f64Bits(value.e ?? 0))"); - expect(rust).toContain("w.scalar(at, 3, tdbin::scalar::i64_bits(self.f))?;"); - expect(tsCode).toContain("const f = tdbin.writer.scalar(writer, at, 3, fBits.value);"); - }); - - it("executes generated Option codecs: present and absent round-trips [TDBIN-PRIM-OPTION]", () => { - interface Reading { - readonly label: string; - readonly count: number | undefined; - readonly flagged: boolean | undefined; - readonly ratio: number | undefined; - } - const readingCodec = codecFor( - unwrap( - emitTypeScriptCodec( - modelFor( - "type Reading {\n label: String\n count: Option\n flagged: Option\n ratio: Option\n}" - ) - ) - ), - "ReadingCodec" - ); - const full: Reading = { label: "t", count: -5, flagged: true, ratio: 0.25 }; - expect(unwrap(tdbin.decode(readingCodec, unwrap(tdbin.encode(readingCodec, full))))).toEqual(full); - // A present-but-default value must stay Some (presence bit, not sentinel). - const zeroes: Reading = { label: "", count: 0, flagged: false, ratio: 0 }; - expect(unwrap(tdbin.decode(readingCodec, unwrap(tdbin.encode(readingCodec, zeroes))))).toEqual(zeroes); - const absent: Reading = { label: "n", count: undefined, flagged: undefined, ratio: undefined }; - expect(unwrap(tdbin.decode(readingCodec, unwrap(tdbin.encode(readingCodec, absent))))).toEqual(absent); - const encodedFull = unwrap(tdbin.encode(readingCodec, full)); - const encodedAbsent = unwrap(tdbin.encode(readingCodec, absent)); - expect(Buffer.from(encodedFull).equals(Buffer.from(encodedAbsent))).toBe(false); - }); - - it("executes generated codecs: scalar writes, round-trips, and null-to-default decodes [TDBIN-PTR-NULL]", () => { - const measurementCodec = codecFor( - unwrap(emitTypeScriptCodec(modelFor(MEASUREMENT_TD))), - "MeasurementCodec" - ); - const full: Measurement = { label: "temp", count: -42, ratio: 2.5, enabled: true, unit: "C", sensor: { id: 7 } }; - expect(unwrap(tdbin.decode(measurementCodec, unwrap(tdbin.encode(measurementCodec, full))))).toEqual(full); - const sparse: Measurement = { - label: "", - count: Number.MAX_SAFE_INTEGER, - ratio: -0.125, - enabled: false, - unit: undefined, - sensor: { id: 0 }, - }; - expect(unwrap(tdbin.decode(measurementCodec, unwrap(tdbin.encode(measurementCodec, sparse))))).toEqual(sparse); - const writerCodec = codecFor(unwrap(emitTypeScriptCodec(modelFor(NULL_WRITER_TD))), "PacketCodec"); - const readerCodec = codecFor(unwrap(emitTypeScriptCodec(modelFor(NULL_READER_TD))), "PacketCodec"); - const nulls = unwrap(tdbin.encode(writerCodec, { name: undefined, data: undefined, contact: undefined })); - expect(unwrap(tdbin.decode(readerCodec, nulls))).toEqual({ - name: "", - data: new Uint8Array(0), - contact: { kind: "Idle", _0: { reason: "" } }, - }); - const bareArm = unwrap( - tdbin.encode(writerCodec, { name: "ping", data: new Uint8Array([9, 8]), contact: { kind: "Idle" } }) - ); - expect(unwrap(tdbin.decode(readerCodec, bareArm))).toEqual({ - name: "ping", - data: new Uint8Array([9, 8]), - contact: { kind: "Idle", _0: { reason: "" } }, - }); - const present = unwrap( - tdbin.encode(writerCodec, { name: "n", data: new Uint8Array([1]), contact: { kind: "Note", _0: "hi" } }) - ); - expect(unwrap(tdbin.decode(readerCodec, present))).toEqual({ - name: "n", - data: new Uint8Array([1]), - contact: { kind: "Note", _0: "hi" }, - }); - }); -}); diff --git a/packages/vscode/vitest.config.ts b/packages/vscode/vitest.config.ts deleted file mode 100644 index 37417f8..0000000 --- a/packages/vscode/vitest.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createVitestConfig } from "../../scripts/vitest-config-base"; - -export default createVitestConfig({ - configDir: __dirname, - project: "packages/vscode", - exclude: ["src/webview/**"], -}); diff --git a/scripts/tdbin-regen-fixtures.mjs b/scripts/tdbin-regen-fixtures.mjs deleted file mode 100644 index bab6eaa..0000000 --- a/scripts/tdbin-regen-fixtures.mjs +++ /dev/null @@ -1,120 +0,0 @@ -// Regenerates the four committed GENERATED tdbin crate modules from their -// single-source `.td` schemas, then reformats the crate. Run from the repo -// root after any rust-tdbin codegen change: -// -// node scripts/tdbin-regen-fixtures.mjs -// -// The vitest drift guards (rust-tdbin.test.ts, rust-tdbin-corpus.test.ts) -// read the SAME schema files, so committed modules and pinned expectations -// can never disagree about the source of truth. -import { execFileSync } from "node:child_process"; -import { readFileSync, writeFileSync } from "node:fs"; -import { join } from "node:path"; - -const root = process.cwd(); -const run = (command, args) => execFileSync(command, args, { cwd: root, stdio: "inherit" }); - -run("npm", ["run", "-w", "typediagram-core", "build"]); - -const dist = join(root, "packages/typediagram/dist"); -const { parse } = await import(join(dist, "parser/index.js")); -const { buildModel } = await import(join(dist, "model/index.js")); -const { generateRustModule } = await import(join(dist, "converters/rust-tdbin.js")); - -const fail = (context, error) => { - console.error(`tdbin-regen-fixtures: ${context}`, error); - process.exit(1); -}; - -const generate = (tdPath, layout) => { - const source = readFileSync(join(root, tdPath), "utf8"); - const parsed = parse(source); - if (!parsed.ok) { - fail(`parse ${tdPath}`, parsed.error); - } - const model = buildModel(parsed.value); - if (!model.ok) { - fail(`model ${tdPath}`, model.error); - } - const generated = generateRustModule(model.value, { layout }); - if (!generated.ok) { - fail(`generate ${tdPath} (layout ${layout})`, generated.error); - } - return generated.value; -}; - -const MARKER_V1 = "// <<>>"; -const MARKER_V2 = "// <<>>"; - -const FIXTURES = [ - { - out: "crates/tdbin/tests/generated/mod.rs", - td: "packages/typediagram/test/converters/fixtures/person.td", - layout: 1, - marker: MARKER_V1, - header: `//! [TDBIN-TEST-ROUNDTRIP] typeDiagram ADT + TDBIN codec, GENERATED by -//! \`packages/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`) -//! from the fixed Person-shaped schema in -//! \`packages/typediagram/test/converters/fixtures/person.td\`. \`roundtrip.rs\`, -//! \`frame.rs\` and \`golden.rs\` exercise these types so the end-to-end proof — -//! typeDiagram ADT -> binary -> typeDiagram ADT — runs under \`cargo test\`. -//! The \`rust-tdbin.test.ts\` vitest suite pins the emitted text and fails if -//! this file drifts from codegen; regenerate with -//! \`node scripts/tdbin-regen-fixtures.mjs\` rather than hand-editing. -`, - }, - { - out: "crates/tdbin/tests/generated_opt/mod.rs", - td: "packages/typediagram/test/converters/fixtures/measurement.td", - layout: 1, - marker: MARKER_V1, - header: `//! [TDBIN-PRIM-OPTION] GENERATED \`Option\` fixture (1-bit presence -//! flags in the shared bool bitset + natural-width value slots), emitted by -//! \`packages/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`) -//! from \`packages/typediagram/test/converters/fixtures/measurement.td\`. -//! Included only by \`roundtrip.rs\`; kept separate from the shared Person -//! fixture so the framing/golden test binaries do not carry an unused type -//! (\`-D dead-code\`). Regenerate with \`node scripts/tdbin-regen-fixtures.mjs\` -//! rather than hand-editing. -`, - }, - { - out: "crates/tdbin/tests/generated_corpus/mod.rs", - td: "docs/benchmarks/tdbin-corpus.td", - layout: 2, - marker: MARKER_V2, - header: `//! [TDBIN-BENCH-CORPUS] typeDiagram ADT + TDBIN columnar codec (layout major -//! 2), GENERATED by \`packages/typediagram/src/converters/rust-tdbin.ts\` -//! (\`generateRustModule(model, { layout: 2 })\`) from -//! \`docs/benchmarks/tdbin-corpus.td\`. The benchmark support fixtures and the -//! \`golden_columnar.rs\` vectors consume these types. The -//! \`rust-tdbin-corpus.test.ts\` vitest suite pins the emitted text and fails if -//! this file drifts from codegen; regenerate with -//! \`node scripts/tdbin-regen-fixtures.mjs\` rather than hand-editing. -`, - }, - { - out: "crates/tdbin/tests/generated_batches/mod.rs", - td: "packages/typediagram/test/converters/fixtures/batches.td", - layout: 2, - marker: MARKER_V2, - header: `//! [TDBIN-BENCH-CORPUS] typeDiagram ADT + TDBIN columnar codec (layout major -//! 2), GENERATED by \`packages/typediagram/src/converters/rust-tdbin.ts\` -//! (\`generateRustModule(model, { layout: 2 })\`) from the Person/PersonBatch/ -//! ContactBatch schema in -//! \`packages/typediagram/test/converters/fixtures/batches.td\`. The benchmark -//! support fixtures consume these types. The \`rust-tdbin-corpus.test.ts\` -//! vitest suite pins the emitted text and fails if this file drifts from -//! codegen; regenerate with \`node scripts/tdbin-regen-fixtures.mjs\` rather -//! than hand-editing. -`, - }, -]; - -for (const fixture of FIXTURES) { - const body = generate(fixture.td, fixture.layout); - writeFileSync(join(root, fixture.out), `${fixture.header}\n${fixture.marker}\n${body}`); - console.log(`regenerated ${fixture.out} (layout ${fixture.layout})`); -} - -run("cargo", ["fmt", "-p", "tdbin"]); diff --git a/Cargo.lock b/src/Cargo.lock similarity index 99% rename from Cargo.lock rename to src/Cargo.lock index 695956f..4ef7c2d 100644 --- a/Cargo.lock +++ b/src/Cargo.lock @@ -407,7 +407,7 @@ dependencies = [ [[package]] name = "tdbin" -version = "0.0.0" +version = "0.0.0-dev" dependencies = [ "criterion", "prost", diff --git a/Cargo.toml b/src/Cargo.toml similarity index 86% rename from Cargo.toml rename to src/Cargo.toml index fa73b6e..d34c0b0 100644 --- a/Cargo.toml +++ b/src/Cargo.toml @@ -1,7 +1,7 @@ # agent-pmo:372ce7f # Rust workspace for typeDiagram — REPO-STANDARDS-SPEC [LINT-RUST]. # -# Crates live under `crates/` and inherit the strict lint table below by adding +# Crates live beside this manifest under `src/` and inherit the strict lint table below by adding # # [lints] # workspace = true @@ -10,13 +10,15 @@ # exceptions are the documented ones below. `make fmt`/`make lint`/`make test` # gain `cargo fmt`/`cargo clippy`/`cargo llvm-cov` steps once the first crate lands. # -# NOTE: until the first crate is added under `crates/`, `cargo build` reports an +# NOTE: until the first crate is added under `src/`, `cargo build` reports an # empty workspace — expected while Rust is being introduced. [workspace] resolver = "2" -members = ["crates/*"] +members = ["tdbin"] [workspace.package] +# Stamped from the release tag by src/scripts/stamp-version.mjs ([TDBIN-RS-PUBLISH]). +version = "0.0.0-dev" edition = "2021" license = "MIT" repository = "https://github.com/Nimblesite/typeDiagram" diff --git a/packages/cli/LICENSE b/src/cli/LICENSE similarity index 100% rename from packages/cli/LICENSE rename to src/cli/LICENSE diff --git a/packages/cli/README.md b/src/cli/README.md similarity index 100% rename from packages/cli/README.md rename to src/cli/README.md diff --git a/packages/cli/package.json b/src/cli/package.json similarity index 93% rename from packages/cli/package.json rename to src/cli/package.json index 80f1169..e476ab1 100644 --- a/packages/cli/package.json +++ b/src/cli/package.json @@ -6,7 +6,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Nimblesite/typeDiagram.git", - "directory": "packages/cli" + "directory": "src/cli" }, "type": "module", "bin": { @@ -29,7 +29,7 @@ }, "devDependencies": { "typescript": "^7.0.2", - "vitest": "^4.1.10", + "vitest": "^4.1.12", "@types/node": "^26.1.1" } } diff --git a/packages/cli/src/args.ts b/src/cli/src/args.ts similarity index 91% rename from packages/cli/src/args.ts rename to src/cli/src/args.ts index cc6e3a9..dde2a9e 100644 --- a/packages/cli/src/args.ts +++ b/src/cli/src/args.ts @@ -83,11 +83,13 @@ export const parseArgs = (argv: readonly string[]): Result => ? err({ message: "--config cannot be combined with --from, --to, or a tdbin command" }) : state.from !== null && state.to !== null ? err({ message: "--from and --to are mutually exclusive" }) - : state.tdbinCommand !== null && (state.from !== null || state.to !== null) - ? err({ message: "tdbin commands cannot be combined with --from or --to" }) - : state.json && !state.version - ? err({ message: "--json requires --version" }) - : ok(state); + : state.tdbinCommand !== null && state.from !== null + ? err({ message: "tdbin commands cannot be combined with --from" }) + : state.tdbinCommand !== null && state.to !== null && state.to !== "rust" && state.to !== "typescript" + ? err({ message: "tdbin commands support --to rust or --to typescript" }) + : state.json && !state.version + ? err({ message: "--json requires --version" }) + : ok(state); }; const applyArg = ( @@ -179,9 +181,9 @@ export const HELP_TEXT = `typediagram — render typeDiagram DSL to SVG, or conv Usage: typediagram [options] [file] typediagram --config FILE [--watch] - typediagram encode [file] + typediagram encode [--to rust|typescript] [file] typediagram decode [file] - typediagram verify [file] + typediagram verify [--to rust|typescript] [file] Options: --config FILE Generate configured language outputs from one .td source @@ -200,7 +202,7 @@ If file is omitted, reads from stdin. SVG (or language source with --to) is written to stdout. With --emit td, outputs the intermediate typeDiagram source. With --emit td+svg, outputs typeDiagram source then a --- separator then SVG. -TDBIN encode emits a generated Rust ADT+codec module; decode emits codec impls for generated Rust ADTs; verify validates schema support. +TDBIN encode emits a generated ADT+codec module (Rust by default, or --to typescript); decode emits Rust codec impls for generated Rust ADTs; verify validates schema support for the --to target. Config paths are resolved relative to FILE. Invalid watched edits retain the last generated outputs and recover on the next valid edit. Errors go to stderr; exit code 1 on failure. `; diff --git a/packages/cli/src/bin.ts b/src/cli/src/bin.ts similarity index 100% rename from packages/cli/src/bin.ts rename to src/cli/src/bin.ts diff --git a/packages/cli/src/cli.ts b/src/cli/src/cli.ts similarity index 90% rename from packages/cli/src/cli.ts rename to src/cli/src/cli.ts index 9ebaa73..a573b07 100644 --- a/packages/cli/src/cli.ts +++ b/src/cli/src/cli.ts @@ -9,6 +9,7 @@ import { type Diagnostic, } from "typediagram-core"; import { emitRustCodec, generateRustModule } from "typediagram-core/converters/rust-tdbin"; +import { generateTypeScriptModule } from "typediagram-core/converters/typescript-tdbin"; import { HELP_TEXT, parseArgs, type CliArgs } from "./args.js"; import { runGenerationConfig } from "./generation-config.js"; import { readSource } from "./io.js"; @@ -46,22 +47,31 @@ const versionFlow = (args: CliArgs, stdout: NodeJS.WritableStream, stderr: NodeJ return r.ok ? (stdout.write(`${r.value}\n`), 0) : (stderr.write(`${r.error.message}\n`), 1); }; -/** [TDBIN-CLI] `.td` schema → generated Rust TDBIN glue or schema verification. */ +/** [TDBIN-CLI] [CLI-TDBIN-LANG] `.td` schema → generated TDBIN glue for the + * `--to` target (Rust by default, or TypeScript), or schema verification. */ const tdbinFlow = async ( args: CliArgs, stdout: NodeJS.WritableStream, stderr: NodeJS.WritableStream ): Promise => { + const typescript = args.to === "typescript"; + if (typescript && args.tdbinCommand === "decode") { + return (stderr.write("decode --to typescript is not supported; use encode --to typescript\n"), 1); + } const model = await readTdModel(args.file, stderr); if (!model.ok) { return 1; } - const codegenDiags = modelLayer.validateForCodegen(model.value, "rust"); + const codegenDiags = modelLayer.validateForCodegen(model.value, typescript ? "typescript" : "rust"); if (codegenDiags.length > 0) { return (writeDiagnostics(codegenDiags, stderr), 1); } const command = args.tdbinCommand; - const generated = command === "decode" ? emitRustCodec(model.value) : generateRustModule(model.value); + const generated = typescript + ? generateTypeScriptModule(model.value) + : command === "decode" + ? emitRustCodec(model.value) + : generateRustModule(model.value); if (!generated.ok) { return (writeDiagnostics(generated.error, stderr), 1); } diff --git a/packages/cli/src/generation-config.ts b/src/cli/src/generation-config.ts similarity index 67% rename from packages/cli/src/generation-config.ts rename to src/cli/src/generation-config.ts index a3a67ee..3adf562 100644 --- a/packages/cli/src/generation-config.ts +++ b/src/cli/src/generation-config.ts @@ -3,11 +3,19 @@ import { watch, type FSWatcher } from "node:fs"; import { mkdir, readFile, rename, writeFile } from "node:fs/promises"; import { basename, dirname, resolve } from "node:path"; import { converters, model as modelLayer, parser } from "typediagram-core"; +import { emitRustCodec, generateRustModule } from "typediagram-core/converters/rust-tdbin"; +import { generateTypeScriptModule } from "typediagram-core/converters/typescript-tdbin"; import { err, errorMessage, ok, type Result } from "./result.js"; type GenerationError = { readonly message: string }; -type OutputTarget = { readonly language: converters.Language; readonly path: string }; -type GeneratedOutput = OutputTarget & { readonly content: string }; +/** One configured output: a label for reporting and a generator over the ONE + * parsed model, so types and tdbin codecs can never disagree ([CLI-CONFIG-TDBIN]). */ +type OutputTarget = { + readonly label: string; + readonly path: string; + readonly generate: (model: modelLayer.Model) => Result; +}; +type GeneratedOutput = { readonly label: string; readonly path: string; readonly content: string }; type GenerationConfig = { readonly source: string; readonly outputs: readonly OutputTarget[]; @@ -37,12 +45,66 @@ const parseJson = (text: string, path: string): Result } }; +const diagnosticsError = (diagnostics: readonly parser.Diagnostic[]): GenerationError => ({ + message: parser.formatDiagnostics([...diagnostics]), +}); + +const languageGenerator = (language: converters.Language) => (model: modelLayer.Model) => { + const diagnostics = modelLayer.validateForCodegen(model, language); + return diagnostics.length === 0 + ? ok(converters.byLanguage[language].toSource(model)) + : err(diagnosticsError(diagnostics)); +}; + +const nonEmptyPath = (path: unknown): path is string => typeof path === "string" && path.trim().length > 0; + const parseOutput = ([language, path]: [string, unknown]): Result => !languageValue(language) ? err({ message: `unsupported output language '${language}'` }) - : typeof path !== "string" || path.trim().length === 0 + : !nonEmptyPath(path) ? err({ message: `output '${language}' expects a non-empty file path` }) - : ok({ language, path }); + : ok({ label: language, path, generate: languageGenerator(language) }); + +type TdbinKind = "rust:full" | "rust:codec-only" | "typescript:full"; + +const TDBIN_GENERATORS: Record Result> = { + "rust:full": (model) => generateRustModule(model), + "rust:codec-only": (model) => emitRustCodec(model), + "typescript:full": (model) => generateTypeScriptModule(model), +}; + +const tdbinGenerator = (kind: TdbinKind) => (model: modelLayer.Model) => { + const diagnostics = modelLayer.validateForCodegen(model, kind.startsWith("rust") ? "rust" : "typescript"); + const generated = diagnostics.length === 0 ? TDBIN_GENERATORS[kind](model) : err(diagnostics); + return generated.ok ? ok(generated.value) : err(diagnosticsError(generated.error)); +}; + +const tdbinSpec = (target: string, value: unknown): Result => { + const spec = recordValue(value) ? value : { path: value }; + const mode = spec.mode ?? "full"; + return target !== "rust" && target !== "typescript" + ? err({ message: `unsupported tdbin target '${target}' (use 'rust' or 'typescript')` }) + : !nonEmptyPath(spec.path) + ? err({ message: `tdbin '${target}' expects a non-empty file path` }) + : mode !== "full" && mode !== "codec-only" + ? err({ message: `tdbin '${target}' mode must be 'full' or 'codec-only'` }) + : target === "typescript" && mode !== "full" + ? err({ message: "tdbin 'typescript' supports only mode 'full'" }) + : ok({ + label: `tdbin-${target}`, + path: spec.path, + generate: tdbinGenerator( + target === "typescript" ? "typescript:full" : mode === "full" ? "rust:full" : "rust:codec-only" + ), + }); +}; + +const parseTdbin = (value: unknown): Result => + value === undefined + ? ok([]) + : !recordValue(value) + ? err({ message: "config.tdbin must be an object keyed by 'rust' / 'typescript'" }) + : collectResults(Object.entries(value).map(([target, spec]) => tdbinSpec(target, spec))); const collectResults = (results: readonly Result[]) => { const values: T[] = []; @@ -58,13 +120,20 @@ const collectResults = (results: readonly Result[]) => { return ok(values); }; -const parseOutputs = (value: unknown) => { +const parseOutputs = (value: unknown, tdbin: Result) => { const results = recordValue(value) ? Object.entries(value).map(parseOutput) : []; - return !recordValue(value) - ? err({ message: "config.outputs must be an object keyed by language" }) - : results.length === 0 - ? err({ message: "config.outputs must select at least one language" }) - : collectResults(results); + const languages = collectResults(results); + return !tdbin.ok + ? tdbin + : value === undefined && tdbin.value.length > 0 + ? ok(tdbin.value) + : !recordValue(value) + ? err({ message: "config.outputs must be an object keyed by language" }) + : results.length === 0 && tdbin.value.length === 0 + ? err({ message: "config.outputs must select at least one language" }) + : languages.ok + ? ok([...languages.value, ...tdbin.value]) + : languages; }; const parseWatch = (value: unknown) => @@ -79,13 +148,13 @@ const resolveConfig = (path: string, source: string, outputs: readonly OutputTar const collision = resolvedOutputs.find((output) => output.path === resolvedSource); return collision === undefined ? ok({ source: resolvedSource, outputs: resolvedOutputs, watch: watchEnabled }) - : err({ message: `output '${collision.language}' cannot overwrite the .td source` }); + : err({ message: `output '${collision.label}' cannot overwrite the .td source` }); }; const parseConfig = (value: unknown, path: string): Result => { const config = recordValue(value) ? value : undefined; const source = config?.source; - const outputs = parseOutputs(config?.outputs); + const outputs = parseOutputs(config?.outputs, parseTdbin(config?.tdbin)); const watchEnabled = parseWatch(config?.watch); return config === undefined ? err({ message: "generation config must be a JSON object" }) @@ -113,10 +182,8 @@ const modelFromSource = (source: string) => { }; const generateOutput = (model: modelLayer.Model, output: OutputTarget) => { - const diagnostics = modelLayer.validateForCodegen(model, output.language); - return diagnostics.length === 0 - ? ok({ ...output, content: converters.byLanguage[output.language].toSource(model) }) - : err({ message: parser.formatDiagnostics(diagnostics) }); + const content = output.generate(model); + return content.ok ? ok({ label: output.label, path: output.path, content: content.value }) : content; }; const generateAll = async (config: GenerationConfig) => { @@ -152,7 +219,7 @@ const reportError = (error: GenerationError, stderr: NodeJS.WritableStream) => { const reportGenerated = (outputs: readonly GeneratedOutput[], stdout: NodeJS.WritableStream) => { outputs.forEach((output) => { - stdout.write(`generated ${output.language} -> ${output.path}\n`); + stdout.write(`generated ${output.label} -> ${output.path}\n`); }); return true; }; diff --git a/packages/cli/src/io.ts b/src/cli/src/io.ts similarity index 100% rename from packages/cli/src/io.ts rename to src/cli/src/io.ts diff --git a/packages/cli/src/result.ts b/src/cli/src/result.ts similarity index 100% rename from packages/cli/src/result.ts rename to src/cli/src/result.ts diff --git a/packages/cli/src/typeshed-bin.ts b/src/cli/src/typeshed-bin.ts similarity index 100% rename from packages/cli/src/typeshed-bin.ts rename to src/cli/src/typeshed-bin.ts diff --git a/packages/cli/src/typeshed-cli.ts b/src/cli/src/typeshed-cli.ts similarity index 100% rename from packages/cli/src/typeshed-cli.ts rename to src/cli/src/typeshed-cli.ts diff --git a/packages/cli/src/version.ts b/src/cli/src/version.ts similarity index 100% rename from packages/cli/src/version.ts rename to src/cli/src/version.ts diff --git a/packages/cli/test/__snapshots__/alias-chain.svg b/src/cli/test/__snapshots__/alias-chain.svg similarity index 100% rename from packages/cli/test/__snapshots__/alias-chain.svg rename to src/cli/test/__snapshots__/alias-chain.svg diff --git a/packages/cli/test/__snapshots__/all-external.svg b/src/cli/test/__snapshots__/all-external.svg similarity index 100% rename from packages/cli/test/__snapshots__/all-external.svg rename to src/cli/test/__snapshots__/all-external.svg diff --git a/packages/cli/test/__snapshots__/all-primitives.svg b/src/cli/test/__snapshots__/all-primitives.svg similarity index 100% rename from packages/cli/test/__snapshots__/all-primitives.svg rename to src/cli/test/__snapshots__/all-primitives.svg diff --git a/packages/cli/test/__snapshots__/chat-model-render.test.svg b/src/cli/test/__snapshots__/chat-model-render.test.svg similarity index 100% rename from packages/cli/test/__snapshots__/chat-model-render.test.svg rename to src/cli/test/__snapshots__/chat-model-render.test.svg diff --git a/packages/cli/test/__snapshots__/deep-generics.svg b/src/cli/test/__snapshots__/deep-generics.svg similarity index 100% rename from packages/cli/test/__snapshots__/deep-generics.svg rename to src/cli/test/__snapshots__/deep-generics.svg diff --git a/packages/cli/test/__snapshots__/empty-diagram.svg b/src/cli/test/__snapshots__/empty-diagram.svg similarity index 100% rename from packages/cli/test/__snapshots__/empty-diagram.svg rename to src/cli/test/__snapshots__/empty-diagram.svg diff --git a/packages/cli/test/__snapshots__/long-names.svg b/src/cli/test/__snapshots__/long-names.svg similarity index 100% rename from packages/cli/test/__snapshots__/long-names.svg rename to src/cli/test/__snapshots__/long-names.svg diff --git a/packages/cli/test/__snapshots__/many-nodes.svg b/src/cli/test/__snapshots__/many-nodes.svg similarity index 100% rename from packages/cli/test/__snapshots__/many-nodes.svg rename to src/cli/test/__snapshots__/many-nodes.svg diff --git a/packages/cli/test/__snapshots__/mixed-union.svg b/src/cli/test/__snapshots__/mixed-union.svg similarity index 100% rename from packages/cli/test/__snapshots__/mixed-union.svg rename to src/cli/test/__snapshots__/mixed-union.svg diff --git a/packages/cli/test/__snapshots__/multi-generics.svg b/src/cli/test/__snapshots__/multi-generics.svg similarity index 100% rename from packages/cli/test/__snapshots__/multi-generics.svg rename to src/cli/test/__snapshots__/multi-generics.svg diff --git a/packages/cli/test/__snapshots__/self-ref.svg b/src/cli/test/__snapshots__/self-ref.svg similarity index 100% rename from packages/cli/test/__snapshots__/self-ref.svg rename to src/cli/test/__snapshots__/self-ref.svg diff --git a/packages/cli/test/__snapshots__/single-alias.svg b/src/cli/test/__snapshots__/single-alias.svg similarity index 100% rename from packages/cli/test/__snapshots__/single-alias.svg rename to src/cli/test/__snapshots__/single-alias.svg diff --git a/packages/cli/test/__snapshots__/single-record.svg b/src/cli/test/__snapshots__/single-record.svg similarity index 100% rename from packages/cli/test/__snapshots__/single-record.svg rename to src/cli/test/__snapshots__/single-record.svg diff --git a/packages/cli/test/__snapshots__/single-union.svg b/src/cli/test/__snapshots__/single-union.svg similarity index 100% rename from packages/cli/test/__snapshots__/single-union.svg rename to src/cli/test/__snapshots__/single-union.svg diff --git a/packages/cli/test/__snapshots__/small-example.svg b/src/cli/test/__snapshots__/small-example.svg similarity index 100% rename from packages/cli/test/__snapshots__/small-example.svg rename to src/cli/test/__snapshots__/small-example.svg diff --git a/packages/cli/test/__snapshots__/union-refs-union.svg b/src/cli/test/__snapshots__/union-refs-union.svg similarity index 100% rename from packages/cli/test/__snapshots__/union-refs-union.svg rename to src/cli/test/__snapshots__/union-refs-union.svg diff --git a/packages/cli/test/args.test.ts b/src/cli/test/args.test.ts similarity index 88% rename from packages/cli/test/args.test.ts rename to src/cli/test/args.test.ts index 6eaced8..430996e 100644 --- a/packages/cli/test/args.test.ts +++ b/src/cli/test/args.test.ts @@ -42,9 +42,15 @@ describe("[CLI-ARGS] parseArgs", () => { expect(r.ok && r.value.file).toBeNull(); }); - it("rejects TDBIN commands combined with --to", () => { - const r = parseArgs(["decode", "--to", "rust"]); - expect(r.ok).toBe(false); + it("accepts TDBIN commands with --to rust|typescript and rejects other targets or --from", () => { + const rs = parseArgs(["decode", "--to", "rust"]); + expect(rs.ok && rs.value.to).toBe("rust"); + const ts = parseArgs(["encode", "--to", "typescript", "a.td"]); + expect(ts.ok && [ts.value.tdbinCommand, ts.value.to, ts.value.file]).toEqual(["encode", "typescript", "a.td"]); + const go = parseArgs(["encode", "--to", "go"]); + expect(go.ok ? "" : go.error.message).toBe("tdbin commands support --to rust or --to typescript"); + const from = parseArgs(["verify", "--from", "rust"]); + expect(from.ok ? "" : from.error.message).toBe("tdbin commands cannot be combined with --from"); }); it("parses --theme dark", () => { diff --git a/packages/cli/test/bin-flush.e2e.test.ts b/src/cli/test/bin-flush.e2e.test.ts similarity index 100% rename from packages/cli/test/bin-flush.e2e.test.ts rename to src/cli/test/bin-flush.e2e.test.ts diff --git a/packages/cli/test/cli-emit-error.test.ts b/src/cli/test/cli-emit-error.test.ts similarity index 100% rename from packages/cli/test/cli-emit-error.test.ts rename to src/cli/test/cli-emit-error.test.ts diff --git a/packages/cli/test/cli.e2e.test.ts b/src/cli/test/cli.e2e.test.ts similarity index 75% rename from packages/cli/test/cli.e2e.test.ts rename to src/cli/test/cli.e2e.test.ts index 659fcb5..87c3e39 100644 --- a/packages/cli/test/cli.e2e.test.ts +++ b/src/cli/test/cli.e2e.test.ts @@ -143,6 +143,37 @@ describe("[CLI-E2E-TO] --to language export", () => { }); }); +describe("[CLI-FROM-DART-RECORDS] Dart record typedefs (#77)", () => { + it("imports named record typedefs as records, and never exits 0 with invalid .td", async () => { + const td = await run(["--from", "dart", "--emit", "td", fixturePath("records.dart")]); + expect(td.stderr).toBe(""); + expect(td.code).toBe(0); + expect(td.stdout).toContain("type SessionData {\n draft: String\n phase: String\n}"); + expect(td.stdout).toContain( + "type WorkspaceState {\n sessions: Map\n contextFiles: List\n retries: Option\n}" + ); + expect(td.stdout).toContain("type Pair {\n first: T\n rest: List\n}"); + expect(td.stdout).toContain("alias Email = String"); + expect(td.stdout).not.toContain("({"); + const svg = await run(["--from", "dart", "--emit", "svg", fixturePath("records.dart")]); + expect(svg.code).toBe(0); + expect(svg.stdout).toContain(" { it("encode emits generated Rust ADTs plus TDBIN codec impls", async () => { const { code, stdout, stderr } = await run(["encode", fixturePath("scalars.td")]); @@ -189,6 +220,45 @@ describe("[CLI-TDBIN] generated Rust TDBIN glue", () => { } }); + it("encode/verify --to typescript emit and check the TS codec; --to selects the target [CLI-TDBIN-LANG] #62", async () => { + const ts = await run(["encode", "--to", "typescript", fixturePath("wire.td")]); + expect(ts.stderr).toBe(""); + expect(ts.code).toBe(0); + expect(ts.stdout).toContain('import * as tdbin from "typediagram-core/tdbin";'); + expect(ts.stdout).toContain("export interface Canvas {"); + expect(ts.stdout).toContain("export const CanvasCodec: tdbin.StructCodec = {"); + expect(ts.stdout).toContain("export const ShapeCodec: tdbin.StructCodec = {"); + expect(ts.stdout).toMatch(/layoutHash: 0x[0-9a-f]{16}n,/); + expect(ts.stdout).not.toContain("impl tdbin::Struct"); + const rs = await run(["encode", "--to", "rust", fixturePath("wire.td")]); + expect(rs.code).toBe(0); + expect(rs.stdout).toContain("impl tdbin::Struct for Canvas"); + expect(rs.stdout).toContain("pub is_pinned: bool,"); + const tsHash = ts.stdout.slice(ts.stdout.indexOf("CanvasCodec")); + const rsHash = rs.stdout.slice(rs.stdout.indexOf("impl tdbin::Struct for Canvas")); + const tsValue = BigInt( + tsHash.slice(tsHash.indexOf("layoutHash: ") + 12, tsHash.indexOf("n,", tsHash.indexOf("layoutHash"))) + ); + const rsValue = BigInt( + rsHash + .slice(rsHash.indexOf("LAYOUT_HASH: u64 = ") + 19, rsHash.indexOf(";", rsHash.indexOf("LAYOUT_HASH"))) + .replaceAll("_", "") + ); + expect(tsValue).toBe(rsValue); + const verify = await run(["verify", "--to", "typescript", fixturePath("wire.td")]); + expect(verify).toMatchObject({ code: 0, stdout: "tdbin schema ok\n", stderr: "" }); + const unsupported = await run(["verify", "--to", "typescript", fixturePath("scalars.td")]); + expect(unsupported.code).toBe(1); + expect(unsupported.stderr).toContain("tdbin-ts:"); + const decodeTs = await run(["decode", "--to", "typescript", fixturePath("wire.td")]); + expect(decodeTs.code).toBe(1); + expect(decodeTs.stdout).toBe(""); + expect(decodeTs.stderr).toContain("decode --to typescript is not supported; use encode --to typescript"); + const go = await run(["encode", "--to", "go", fixturePath("wire.td")]); + expect(go.code).toBe(1); + expect(go.stderr).toContain("tdbin commands support --to rust or --to typescript"); + }); + it("verify reports Rust codegen validation errors before TDBIN generation", async () => { const { code, stdout, stderr } = await run(["verify", fixturePath("unknown-types.td")]); expect(code).toBe(1); diff --git a/packages/cli/test/config-generation.e2e.test.ts b/src/cli/test/config-generation.e2e.test.ts similarity index 67% rename from packages/cli/test/config-generation.e2e.test.ts rename to src/cli/test/config-generation.e2e.test.ts index a313a87..0047934 100644 --- a/packages/cli/test/config-generation.e2e.test.ts +++ b/src/cli/test/config-generation.e2e.test.ts @@ -219,4 +219,102 @@ describe("[CLI-CONFIG-GENERATE] configured ADT generation", () => { expect(signalErr.text()).toBe(""); expect(process.listeners("SIGINT")).toEqual([...originalSignals]); }); + + it("emits tdbin codecs from config and regenerates them with the types under --watch [CLI-CONFIG-TDBIN] #65", async () => { + const root = await mkdtemp(join(tmpdir(), "td-config-tdbin-")); + const configPath = join(root, "typediagram.json"); + const sourcePath = join(root, "wire.td"); + const out = (name: string) => join(root, "gen", name); + await writeFile(sourcePath, source(" id: Int"), "utf8"); + await writeFile( + configPath, + JSON.stringify({ + source: "wire.td", + watch: true, + outputs: { rust: "gen/types.rs", typescript: "gen/types.ts" }, + tdbin: { + rust: { path: "gen/codec.rs", mode: "codec-only" }, + typescript: "gen/wire.ts", + }, + }), + "utf8" + ); + const stdout = makeStream(); + const stderr = makeStream(); + const controller = new AbortController(); + const watched = main(["--config", configPath], stdout.stream, stderr.stream, controller.signal); + await vi.waitFor(() => { + expect(stdout.text()).toContain(`watching ${sourcePath}`); + }); + expect(stdout.text()).toContain(`generated tdbin-rust -> ${out("codec.rs")}`); + expect(stdout.text()).toContain(`generated tdbin-typescript -> ${out("wire.ts")}`); + const rustCodec = await readFile(out("codec.rs"), "utf8"); + expect(rustCodec).toContain("impl tdbin::Struct for Person"); + expect(rustCodec).not.toContain("pub struct Person"); + expect(await readFile(out("wire.ts"), "utf8")).toContain("export const PersonCodec: tdbin.StructCodec"); + const hashOf = (text: string, marker: string, end: string) => + text.slice(text.indexOf(marker) + marker.length, text.indexOf(end, text.indexOf(marker))).replaceAll("_", ""); + const firstRustHash = hashOf(rustCodec, "LAYOUT_HASH: u64 = ", ";"); + await writeFile(sourcePath, source(" id: Int\n name: String"), "utf8"); + await vi.waitFor(async () => { + expect(await readFile(out("codec.rs"), "utf8")).toContain("Ok(Self { id: f0, name: f1 })"); + expect(await readFile(out("wire.ts"), "utf8")).toContain( + "tdbin.writer.string(writer, at, PersonCodec.dataWords, 0, value.name)" + ); + expect(await readFile(out("types.rs"), "utf8")).toContain("pub name: String"); + expect(await readFile(out("types.ts"), "utf8")).toContain("name: string"); + }); + const rustAfter = await readFile(out("codec.rs"), "utf8"); + const tsAfter = await readFile(out("wire.ts"), "utf8"); + expect(hashOf(rustAfter, "LAYOUT_HASH: u64 = ", ";")).not.toBe(firstRustHash); + expect(BigInt(hashOf(rustAfter, "LAYOUT_HASH: u64 = ", ";"))).toBe(BigInt(hashOf(tsAfter, "layoutHash: ", "n,"))); + controller.abort(); + expect(await watched).toBe(0); + expect(stderr.text()).toBe(""); + + const cases: ReadonlyArray = [ + [ + "tdbin-array.json", + { source: "wire.td", outputs: { rust: "a.rs" }, tdbin: [] }, + "config.tdbin must be an object", + ], + [ + "tdbin-go.json", + { source: "wire.td", outputs: { rust: "a.rs" }, tdbin: { go: "a.go" } }, + "unsupported tdbin target 'go'", + ], + [ + "tdbin-mode.json", + { source: "wire.td", outputs: { rust: "a.rs" }, tdbin: { rust: { path: "c.rs", mode: "half" } } }, + "tdbin 'rust' mode must be 'full' or 'codec-only'", + ], + [ + "tdbin-ts-mode.json", + { source: "wire.td", outputs: { rust: "a.rs" }, tdbin: { typescript: { path: "c.ts", mode: "codec-only" } } }, + "tdbin 'typescript' supports only mode 'full'", + ], + [ + "tdbin-path.json", + { source: "wire.td", outputs: { rust: "a.rs" }, tdbin: { rust: { path: "" } } }, + "tdbin 'rust' expects a non-empty file path", + ], + [ + "tdbin-source.json", + { source: "wire.td", outputs: { rust: "a.rs" }, tdbin: { typescript: "wire.td" } }, + "cannot overwrite the .td source", + ], + ]; + for (const [name, value, message] of cases) { + expectFailure(await runConfig(root, name, value), message); + } + const onlyTdbin = await runConfig(root, "only-tdbin.json", { source: "wire.td", tdbin: { rust: "gen/full.rs" } }); + expect(onlyTdbin.code).toBe(0); + expect(await readFile(out("full.rs"), "utf8")).toContain("pub struct Person"); + const unsupported = join(root, "bad.td"); + await writeFile(unsupported, "type Bad {\n m: Map\n}\n", "utf8"); + expectFailure( + await runConfig(root, "bad-schema.json", { source: "bad.td", tdbin: { rust: "gen/bad.rs" } }), + "tdbin:" + ); + }); }); diff --git a/packages/cli/test/fixtures/bad.td b/src/cli/test/fixtures/bad.td similarity index 100% rename from packages/cli/test/fixtures/bad.td rename to src/cli/test/fixtures/bad.td diff --git a/packages/cli/test/fixtures/chat-model.td b/src/cli/test/fixtures/chat-model.td similarity index 100% rename from packages/cli/test/fixtures/chat-model.td rename to src/cli/test/fixtures/chat-model.td diff --git a/packages/cli/test/fixtures/duplicate.td b/src/cli/test/fixtures/duplicate.td similarity index 100% rename from packages/cli/test/fixtures/duplicate.td rename to src/cli/test/fixtures/duplicate.td diff --git a/packages/cli/test/fixtures/ecommerce.rs b/src/cli/test/fixtures/ecommerce.rs similarity index 100% rename from packages/cli/test/fixtures/ecommerce.rs rename to src/cli/test/fixtures/ecommerce.rs diff --git a/src/cli/test/fixtures/records-fn.dart b/src/cli/test/fixtures/records-fn.dart new file mode 100644 index 0000000..90ecb77 --- /dev/null +++ b/src/cli/test/fixtures/records-fn.dart @@ -0,0 +1,3 @@ +typedef SessionData = ({String draft, String phase}); +typedef Actions = ({void Function(String) editDraft, void Function() submit}); +typedef Point = (int, int); diff --git a/src/cli/test/fixtures/records.dart b/src/cli/test/fixtures/records.dart new file mode 100644 index 0000000..575dbf4 --- /dev/null +++ b/src/cli/test/fixtures/records.dart @@ -0,0 +1,4 @@ +typedef SessionData = ({String draft, String phase}); +typedef WorkspaceState = ({Map sessions, Set contextFiles, int? retries}); +typedef Pair = ({T first, List rest}); +typedef Email = String; diff --git a/packages/cli/test/fixtures/scalars.td b/src/cli/test/fixtures/scalars.td similarity index 100% rename from packages/cli/test/fixtures/scalars.td rename to src/cli/test/fixtures/scalars.td diff --git a/packages/cli/test/fixtures/small.td b/src/cli/test/fixtures/small.td similarity index 100% rename from packages/cli/test/fixtures/small.td rename to src/cli/test/fixtures/small.td diff --git a/packages/cli/test/fixtures/types.cs b/src/cli/test/fixtures/types.cs similarity index 100% rename from packages/cli/test/fixtures/types.cs rename to src/cli/test/fixtures/types.cs diff --git a/packages/cli/test/fixtures/types.py b/src/cli/test/fixtures/types.py similarity index 100% rename from packages/cli/test/fixtures/types.py rename to src/cli/test/fixtures/types.py diff --git a/packages/cli/test/fixtures/types.rs b/src/cli/test/fixtures/types.rs similarity index 100% rename from packages/cli/test/fixtures/types.rs rename to src/cli/test/fixtures/types.rs diff --git a/packages/cli/test/fixtures/types.ts b/src/cli/test/fixtures/types.ts similarity index 100% rename from packages/cli/test/fixtures/types.ts rename to src/cli/test/fixtures/types.ts diff --git a/packages/cli/test/fixtures/unknown-types.td b/src/cli/test/fixtures/unknown-types.td similarity index 100% rename from packages/cli/test/fixtures/unknown-types.td rename to src/cli/test/fixtures/unknown-types.td diff --git a/src/cli/test/fixtures/wire.td b/src/cli/test/fixtures/wire.td new file mode 100644 index 0000000..20777aa --- /dev/null +++ b/src/cli/test/fixtures/wire.td @@ -0,0 +1,19 @@ +type Point { + x: Float + y: Float +} +union Shape { + Circle { + radius: Float + label: String + } + Pair(Int, String) + Tagged(Point) + Empty +} +type Canvas { + name: String + isPinned: Bool + shape: Shape + backup: Option +} diff --git a/packages/cli/test/helpers.ts b/src/cli/test/helpers.ts similarity index 100% rename from packages/cli/test/helpers.ts rename to src/cli/test/helpers.ts diff --git a/packages/cli/test/io.test.ts b/src/cli/test/io.test.ts similarity index 100% rename from packages/cli/test/io.test.ts rename to src/cli/test/io.test.ts diff --git a/packages/cli/test/multi-language-pipeline.e2e.test.ts b/src/cli/test/multi-language-pipeline.e2e.test.ts similarity index 100% rename from packages/cli/test/multi-language-pipeline.e2e.test.ts rename to src/cli/test/multi-language-pipeline.e2e.test.ts diff --git a/packages/cli/test/public-api-smoke.test.ts b/src/cli/test/public-api-smoke.test.ts similarity index 100% rename from packages/cli/test/public-api-smoke.test.ts rename to src/cli/test/public-api-smoke.test.ts diff --git a/packages/cli/test/roundtrip.e2e.test.ts b/src/cli/test/roundtrip.e2e.test.ts similarity index 100% rename from packages/cli/test/roundtrip.e2e.test.ts rename to src/cli/test/roundtrip.e2e.test.ts diff --git a/packages/cli/test/snapshot-scenarios.test.ts b/src/cli/test/snapshot-scenarios.test.ts similarity index 100% rename from packages/cli/test/snapshot-scenarios.test.ts rename to src/cli/test/snapshot-scenarios.test.ts diff --git a/packages/cli/test/stamp-version.e2e.test.ts b/src/cli/test/stamp-version.e2e.test.ts similarity index 63% rename from packages/cli/test/stamp-version.e2e.test.ts rename to src/cli/test/stamp-version.e2e.test.ts index 35431dd..22f3118 100644 --- a/packages/cli/test/stamp-version.e2e.test.ts +++ b/src/cli/test/stamp-version.e2e.test.ts @@ -10,20 +10,20 @@ import { promisify } from "node:util"; import { describe, expect, it } from "vitest"; const run = promisify(execFile); -const SCRIPT = fileURLToPath(new URL("../../../scripts/stamp-version.mjs", import.meta.url)); +const SCRIPT = fileURLToPath(new URL("../../../src/scripts/stamp-version.mjs", import.meta.url)); const PKG_RELS = [ - "packages/typediagram/package.json", - "packages/cli/package.json", - "packages/vscode/package.json", - "packages/web/package.json", + "src/typediagram/package.json", + "src/cli/package.json", + "src/vscode/package.json", + "src/web/package.json", ]; const writeFixtureRepo = async (): Promise => { const root = await mkdtemp(join(tmpdir(), "stamp-test-")); for (const rel of PKG_RELS) { await mkdir(join(root, rel, ".."), { recursive: true }); - const withDep = rel !== "packages/typediagram/package.json"; + const withDep = rel !== "src/typediagram/package.json"; await writeFile( join(root, rel), `${JSON.stringify( @@ -47,9 +47,33 @@ const writeFixtureRepo = async (): Promise => { 2 )}\n` ); + await mkdir(join(root, "src"), { recursive: true }); + await writeFile(join(root, "src", "Cargo.toml"), CARGO_FIXTURE); return root; }; +// The real workspace manifest shape: comments, a lint table, and the crate +// version carried by [workspace.package] ([TDBIN-RS-PUBLISH]). +const CARGO_FIXTURE = `# workspace +[workspace] +resolver = "2" +members = ["src/*"] + +[workspace.package] +version = "0.1.0" +edition = "2021" + +[workspace.lints.clippy] +all = { level = "deny", priority = -1 } +`; + +const cargoVersion = async (root: string) => { + const text = await readFile(join(root, "src", "Cargo.toml"), "utf8"); + const { parse } = await import("smol-toml"); + const doc = parse(text) as { workspace: { package: { version: string }; members: string[] } }; // safety: fixture shape + return { version: doc.workspace.package.version, members: doc.workspace.members, text }; +}; + const readJson = async (root: string, rel: string): Promise => JSON.parse(await readFile(join(root, rel), "utf8")) as unknown; @@ -72,6 +96,11 @@ describe("[SWR-VERSION-BUILD-STAMPING] stamp-version.mjs", () => { }; // safety: fixture shape written by this test expect(manifest.product.version).toBe("9.9.9-rc.1"); expect(manifest.components[0]?.expectedVersion).toBe("9.9.9-rc.1"); + const cargo = await cargoVersion(root); + expect(cargo.version).toBe("9.9.9-rc.1"); + expect(cargo.members).toEqual(["src/*"]); + expect(cargo.text).toContain("priority = -1"); + expect(stdout).toContain("[stamp] src/Cargo.toml: workspace.package.version=9.9.9-rc.1"); }); it("--dry-run lists every carrier but changes nothing", async () => { @@ -87,6 +116,17 @@ describe("[SWR-VERSION-BUILD-STAMPING] stamp-version.mjs", () => { product: { version: string }; }; // safety: fixture shape written by this test expect(manifest.product.version).toBe("0.1.0"); + expect(stdout).toContain("src/Cargo.toml"); + expect((await cargoVersion(root)).text).toBe(CARGO_FIXTURE); + // Without --root the script must default to the real repo root (release.yml + // invokes it that way), not src/ — which would resolve src/src/... carriers. + const repoRoot = fileURLToPath(new URL("../../../", import.meta.url)).replace(/\/$/, ""); + const dflt = await run("node", [SCRIPT, "--version", "2.0.0", "--dry-run"]); + expect(dflt.stdout).toContain(`stamping 2.0.0 into ${repoRoot}\n`); + for (const rel of PKG_RELS) { + expect(dflt.stdout).toContain(`${rel}: version=2.0.0`); + } + expect(dflt.stdout).toContain("src/Cargo.toml: workspace.package.version=2.0.0"); }); it("rejects a non-semver version with exit 1", async () => { diff --git a/packages/cli/test/typeshed.e2e.test.ts b/src/cli/test/typeshed.e2e.test.ts similarity index 100% rename from packages/cli/test/typeshed.e2e.test.ts rename to src/cli/test/typeshed.e2e.test.ts diff --git a/packages/cli/tsconfig.build.json b/src/cli/tsconfig.build.json similarity index 100% rename from packages/cli/tsconfig.build.json rename to src/cli/tsconfig.build.json diff --git a/packages/cli/tsconfig.json b/src/cli/tsconfig.json similarity index 100% rename from packages/cli/tsconfig.json rename to src/cli/tsconfig.json diff --git a/packages/cli/vitest.config.ts b/src/cli/vitest.config.ts similarity index 53% rename from packages/cli/vitest.config.ts rename to src/cli/vitest.config.ts index 53fef4a..2db841a 100644 --- a/packages/cli/vitest.config.ts +++ b/src/cli/vitest.config.ts @@ -1,7 +1,7 @@ -import { createVitestConfig } from "../../scripts/vitest-config-base"; +import { createVitestConfig } from "../scripts/vitest-config-base"; export default createVitestConfig({ configDir: __dirname, - project: "packages/cli", + project: "src/cli", exclude: ["src/bin.ts", "src/typeshed-bin.ts"], }); diff --git a/eslint.config.mjs b/src/eslint.config.mjs similarity index 94% rename from eslint.config.mjs rename to src/eslint.config.mjs index 8bd9398..3b7f744 100644 --- a/eslint.config.mjs +++ b/src/eslint.config.mjs @@ -41,6 +41,10 @@ export default tseslint.config( ignores: [ "out/", "dist/", + "target/", + "**/.eleventy-out/", + "**/.typedoc-out/", + "**/test-results/", "**/*.d.ts", "node_modules/", "coverage/", diff --git a/rustfmt.toml b/src/rustfmt.toml similarity index 100% rename from rustfmt.toml rename to src/rustfmt.toml diff --git a/scripts/generate_logo.py b/src/scripts/generate_logo.py similarity index 98% rename from scripts/generate_logo.py rename to src/scripts/generate_logo.py index c1433ea..9daacc0 100644 --- a/scripts/generate_logo.py +++ b/src/scripts/generate_logo.py @@ -8,8 +8,8 @@ - Sharp, "engineered" geometry Outputs: - packages/vscode/icons/icon.png (normal, 512x512, full background) - packages/vscode/icons/icon-flat.png (flat, 512x512, transparent background) + src/vscode/icons/icon.png (normal, 512x512, full background) + src/vscode/icons/icon-flat.png (flat, 512x512, transparent background) """ from __future__ import annotations diff --git a/pyproject.toml b/src/scripts/pyproject.toml similarity index 100% rename from pyproject.toml rename to src/scripts/pyproject.toml diff --git a/scripts/ratchet-coverage.mjs b/src/scripts/ratchet-coverage.mjs similarity index 98% rename from scripts/ratchet-coverage.mjs rename to src/scripts/ratchet-coverage.mjs index add6f32..c759e85 100644 --- a/scripts/ratchet-coverage.mjs +++ b/src/scripts/ratchet-coverage.mjs @@ -8,7 +8,7 @@ import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; const HERE = dirname(fileURLToPath(import.meta.url)); -const REPO_ROOT = resolve(HERE, ".."); +const REPO_ROOT = resolve(HERE, "../.."); const THRESHOLDS_FILE = resolve(REPO_ROOT, "coverage-thresholds.json"); const METRICS = { diff --git a/scripts/stamp-version.mjs b/src/scripts/stamp-version.mjs similarity index 71% rename from scripts/stamp-version.mjs rename to src/scripts/stamp-version.mjs index feaf09a..380945e 100644 --- a/scripts/stamp-version.mjs +++ b/src/scripts/stamp-version.mjs @@ -3,26 +3,29 @@ // carrier from a tag (or bare version) using structured JSON parsing — never sed. // Release stamps the runner working tree only; nothing is committed or pushed. // Usage: -// node scripts/stamp-version.mjs --tag v1.2.3 [--root DIR] [--dry-run] -// node scripts/stamp-version.mjs --version 1.2.3 [--root DIR] [--dry-run] -// Carriers: packages/*/package.json (version + typediagram-core dependency refs) -// and shipwright.json (product.version + every component expectedVersion). +// node src/scripts/stamp-version.mjs --tag v1.2.3 [--root DIR] [--dry-run] +// node src/scripts/stamp-version.mjs --version 1.2.3 [--root DIR] [--dry-run] +// Carriers: src/*/package.json (version + typediagram-core dependency refs), +// shipwright.json (product.version + every component expectedVersion), and the +// src/Cargo.toml [workspace.package].version that every published crate +// inherits ([TDBIN-RS-PUBLISH]) — parsed and re-serialised with smol-toml. // package-lock.json is refreshed afterwards via `npm install --package-lock-only`. import { readFileSync, writeFileSync } from "node:fs"; +import { parse as parseToml, stringify as stringifyToml } from "smol-toml"; import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; const HERE = dirname(fileURLToPath(import.meta.url)); -const DEFAULT_ROOT = resolve(HERE, ".."); +const DEFAULT_ROOT = resolve(HERE, "../.."); const SEMVER = /^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$/; const PACKAGE_FILES = [ - "packages/typediagram/package.json", - "packages/cli/package.json", - "packages/vscode/package.json", - "packages/web/package.json", + "src/typediagram/package.json", + "src/cli/package.json", + "src/vscode/package.json", + "src/web/package.json", ]; const parseCliArgs = (argv) => { @@ -71,6 +74,16 @@ const stampManifest = (root, version, dryRun) => { } }; +const stampCargo = (root, version, dryRun) => { + const path = resolve(root, "src/Cargo.toml"); + const doc = parseToml(readFileSync(path, "utf8")); + doc.workspace.package.version = version; + console.log(`[stamp] src/Cargo.toml: workspace.package.version=${version}`); + if (!dryRun) { + writeFileSync(path, `${stringifyToml(doc)}\n`); + } +}; + const opts = parseCliArgs(process.argv.slice(2)); if (opts.version === null || !SEMVER.test(opts.version)) { console.error(`[stamp] FAIL: --tag/--version must be semver MAJOR.MINOR.PATCH[-PRERELEASE], got "${opts.version}"`); @@ -81,4 +94,5 @@ for (const rel of PACKAGE_FILES) { stampPackage(opts.root, rel, opts.version, opts.dryRun); } stampManifest(opts.root, opts.version, opts.dryRun); +stampCargo(opts.root, opts.version, opts.dryRun); console.log("[stamp] done"); diff --git a/scripts/tdbin-bench-report.mjs b/src/scripts/tdbin/tdbin-bench-report.mjs similarity index 85% rename from scripts/tdbin-bench-report.mjs rename to src/scripts/tdbin/tdbin-bench-report.mjs index fc8e432..1264e0f 100644 --- a/scripts/tdbin-bench-report.mjs +++ b/src/scripts/tdbin/tdbin-bench-report.mjs @@ -6,9 +6,9 @@ import { join } from "node:path"; import { format, resolveConfig } from "prettier"; const root = process.cwd(); -const target = process.env.CARGO_TARGET_DIR ?? join(root, "target"); -const reportPath = join(root, "docs/reports/tdbin-bench-report.md"); -const dataPath = join(root, "docs/reports/tdbin-bench-data.json"); +const target = process.env.CARGO_TARGET_DIR ?? join(root, "src/target"); +const reportPath = join(root, "docs/research/reports/tdbin-bench-report.md"); +const dataPath = join(root, "docs/research/reports/tdbin-bench-data.json"); const prettierOptions = (await resolveConfig(dataPath)) ?? {}; const operations = [ "tdbin_encode_bare", @@ -23,7 +23,7 @@ const operations = [ "msgpack_decode", ]; -const run = (command, args) => execFileSync(command, args, { cwd: root, encoding: "utf8" }).trim(); +const run = (command, args) => execFileSync(command, args, { cwd: join(root, "src"), encoding: "utf8" }).trim(); const sizes = JSON.parse(run("cargo", ["run", "--quiet", "-p", "tdbin", "--release", "--example", "bench_data"])); const estimatePath = (fixture, operation) => @@ -53,8 +53,8 @@ const benchmarks = sizes.fixtures.flatMap((fixture) => const data = { format_version: 1, generated_at: new Date().toISOString(), - commands: ["cargo bench -p tdbin --bench gate -- --noplot", "node scripts/tdbin-bench-report.mjs"], - corpus_schemas: ["docs/benchmarks/tdbin-corpus.td", "docs/benchmarks/tdbin-corpus.proto"], + commands: ["cargo bench -p tdbin --bench gate -- --noplot", "node src/scripts/tdbin/tdbin-bench-report.mjs"], + corpus_schemas: ["docs/research/benchmarks/tdbin-corpus.td", "docs/research/benchmarks/tdbin-corpus.proto"], gate: { size_ratio_max: 1, encode_speed_ratio_min: 1.5, @@ -179,7 +179,7 @@ const stressPassCount = stressResults.filter((row) => row.pass).length; const releaseVerdict = corpusPassCount === corpusResults.length ? "PASS" : "FAIL"; const report = `# TDBIN Benchmark Report -> GENERATED FILE. Source: \`scripts/tdbin-bench-report.mjs\` and \`docs/reports/tdbin-bench-data.json\`. +> GENERATED FILE. Source: \`src/scripts/tdbin/tdbin-bench-report.mjs\` and \`docs/research/reports/tdbin-bench-data.json\`. > Every value and verdict is computed from machine-readable Criterion and encoder output. No benchmark result is entered manually. Generated: ${data.generated_at} @@ -192,7 +192,7 @@ Raw data SHA-256: \`${digest}\` Qualifying modes: ${releaseResults.map((row) => "`" + row.fixture + "` = " + row.mode).join(", ")}. -The release gate ([TDBIN-BENCH-GATE]) requires, for every corpus entry — the committed realistic schemas in \`docs/benchmarks/tdbin-corpus.{td,proto}\` (record-heavy document, union-heavy event stream, list-heavy dataset) — that at least one self-describing production wire mode (framed, or packed framed; the frame's PACKED flag makes the two interchangeable to every decoder) beats Protobuf on size and by ${data.gate.encode_speed_ratio_min.toFixed(2)}x on both encode and decode simultaneously. Both modes are always measured and published below. Stress rows (marked) are reported against the identical bar; the tiny single-message rows carry a fixed 12-byte frame plus pointer-per-string overhead that no fixed-layout format recovers at sub-100-byte payloads (research §2.2), so they are not corpus entries. +The release gate ([TDBIN-BENCH-GATE]) requires, for every corpus entry — the committed realistic schemas in \`docs/research/benchmarks/tdbin-corpus.{td,proto}\` (record-heavy document, union-heavy event stream, list-heavy dataset) — that at least one self-describing production wire mode (framed, or packed framed; the frame's PACKED flag makes the two interchangeable to every decoder) beats Protobuf on size and by ${data.gate.encode_speed_ratio_min.toFixed(2)}x on both encode and decode simultaneously. Both modes are always measured and published below. Stress rows (marked) are reported against the identical bar; the tiny single-message rows carry a fixed 12-byte frame plus pointer-per-string overhead that no fixed-layout format recovers at sub-100-byte payloads (research §2.2), so they are not corpus entries. ## Size and Speed @@ -307,9 +307,9 @@ const mainRows = sizes.fixtures const website = `# TDBIN Benchmarks -TDBIN is typeDiagram's compact binary codec for algebraic data types, measured here against **Protocol Buffers** and **MessagePack**. Every number below is data-derived — produced by [\`scripts/tdbin-bench-report.mjs\`](${repo}/${ref}/scripts/tdbin-bench-report.mjs) from Criterion timings and exact encoder output — and regenerates on each benchmark run. +TDBIN is typeDiagram's compact binary codec for algebraic data types, measured here against **Protocol Buffers** and **MessagePack**. Every number below is data-derived — produced by [\`src/scripts/tdbin/tdbin-bench-report.mjs\`](${repo}/${ref}/src/scripts/tdbin/tdbin-bench-report.mjs) from Criterion timings and exact encoder output — and regenerates on each benchmark run. -> **Scope: these figures are for the Rust implementation only.** Both the encoded sizes and the speeds are measured against the Rust \`tdbin\` codec crate ([\`crates/tdbin\`](${repo}/${ref}/crates/tdbin)), the Rust \`prost\` Protobuf encoder, and the Rust \`rmp-serde\` MessagePack encoder. The TDBIN **wire format** and its byte sizes are language-neutral, but serialize/deserialize **speeds** depend on each language's implementation — typeDiagram's other codec targets, and other Protobuf/MessagePack libraries, will differ, sometimes substantially. +> **Scope: these figures are for the Rust implementation only.** Both the encoded sizes and the speeds are measured against the Rust \`tdbin\` codec crate ([\`src/tdbin\`](${repo}/${ref}/src/tdbin)), the Rust \`prost\` Protobuf encoder, and the Rust \`rmp-serde\` MessagePack encoder. The TDBIN **wire format** and its byte sizes are language-neutral, but serialize/deserialize **speeds** depend on each language's implementation — typeDiagram's other codec targets, and other Protobuf/MessagePack libraries, will differ, sometimes substantially. ## Size and Speed @@ -327,12 +327,12 @@ ${factLines.join("\n")} ## Methodology -- **Rust implementations.** Every timing is for a Rust codec: typeDiagram's [\`tdbin\`](${repo}/${ref}/crates/tdbin) crate, Protobuf via \`prost\`, and MessagePack via \`rmp-serde\`. Encoded sizes are a property of the wire format and hold across languages; speeds do not — typeDiagram's other language targets and other Protobuf/MessagePack libraries will produce different timings. -- **Same values, three encoders.** Every test builds one logical value and feeds the identical value to the typeDiagram codec, to a hand-written Protobuf mirror (\`prost\`), and — via \`serde\` derives on that same mirror — to MessagePack (\`rmp-serde\`). No format receives a different input. See the fixtures in [\`crates/tdbin/tests/support/bench_corpus.rs\`](${repo}/${ref}/crates/tdbin/tests/support/bench_corpus.rs). +- **Rust implementations.** Every timing is for a Rust codec: typeDiagram's [\`tdbin\`](${repo}/${ref}/src/tdbin) crate, Protobuf via \`prost\`, and MessagePack via \`rmp-serde\`. Encoded sizes are a property of the wire format and hold across languages; speeds do not — typeDiagram's other language targets and other Protobuf/MessagePack libraries will produce different timings. +- **Same values, three encoders.** Every test builds one logical value and feeds the identical value to the typeDiagram codec, to a hand-written Protobuf mirror (\`prost\`), and — via \`serde\` derives on that same mirror — to MessagePack (\`rmp-serde\`). No format receives a different input. See the fixtures in [\`src/tdbin/tests/support/bench_corpus.rs\`](${repo}/${ref}/src/tdbin/tests/support/bench_corpus.rs). - **Self-describing modes only.** typeDiagram *framed*, Protobuf, and MessagePack *struct-as-map* all carry enough structure to be decoded without an external schema, so the comparison is like-for-like. -- **Sizes are exact byte counts** emitted by each encoder (see [\`crates/tdbin/examples/bench_data.rs\`](${repo}/${ref}/crates/tdbin/examples/bench_data.rs)) — not estimates. -- **Timings are Criterion medians** over ${data.benchmarks[0]?.sample_count ?? 50} samples per operation; each measured value flows through \`black_box\` so the optimizer cannot elide the work. The benchmark harness is [\`crates/tdbin/benches/gate.rs\`](${repo}/${ref}/crates/tdbin/benches/gate.rs). -- **Corpus schemas** are committed at [\`docs/benchmarks/tdbin-corpus.td\`](${repo}/${ref}/docs/benchmarks/tdbin-corpus.td) and [\`docs/benchmarks/tdbin-corpus.proto\`](${repo}/${ref}/docs/benchmarks/tdbin-corpus.proto). +- **Sizes are exact byte counts** emitted by each encoder (see [\`src/tdbin/examples/bench_data.rs\`](${repo}/${ref}/src/tdbin/examples/bench_data.rs)) — not estimates. +- **Timings are Criterion medians** over ${data.benchmarks[0]?.sample_count ?? 50} samples per operation; each measured value flows through \`black_box\` so the optimizer cannot elide the work. The benchmark harness is [\`src/tdbin/benches/gate.rs\`](${repo}/${ref}/src/tdbin/benches/gate.rs). +- **Corpus schemas** are committed at [\`docs/research/benchmarks/tdbin-corpus.td\`](${repo}/${ref}/docs/research/benchmarks/tdbin-corpus.td) and [\`docs/research/benchmarks/tdbin-corpus.proto\`](${repo}/${ref}/docs/research/benchmarks/tdbin-corpus.proto). ## Test machine diff --git a/src/scripts/tdbin/tdbin-regen-fixtures.mjs b/src/scripts/tdbin/tdbin-regen-fixtures.mjs new file mode 100644 index 0000000..550328d --- /dev/null +++ b/src/scripts/tdbin/tdbin-regen-fixtures.mjs @@ -0,0 +1,171 @@ +// Regenerates the four committed GENERATED tdbin crate modules from their +// single-source `.td` schemas, then reformats the crate. Run from the repo +// root after any rust-tdbin codegen change: +// +// node src/scripts/tdbin/tdbin-regen-fixtures.mjs +// +// The vitest drift guards (rust-tdbin.test.ts, rust-tdbin-corpus.test.ts) +// read the SAME schema files, so committed modules and pinned expectations +// can never disagree about the source of truth. +import { execFileSync } from "node:child_process"; +import { readFileSync, writeFileSync } from "node:fs"; +import { join } from "node:path"; + +const root = process.cwd(); +const run = (command, args) => execFileSync(command, args, { cwd: root, stdio: "inherit" }); + +run("npm", ["run", "-w", "typediagram-core", "build"]); + +const dist = join(root, "src/typediagram/dist"); +const { parse } = await import(join(dist, "parser/index.js")); +const { buildModel } = await import(join(dist, "model/index.js")); +const { generateRustModule } = await import(join(dist, "converters/rust-tdbin.js")); + +const fail = (context, error) => { + console.error(`tdbin-regen-fixtures: ${context}`, error); + process.exit(1); +}; + +const generate = (tdPath, layout) => { + const source = readFileSync(join(root, tdPath), "utf8"); + const parsed = parse(source); + if (!parsed.ok) { + fail(`parse ${tdPath}`, parsed.error); + } + const model = buildModel(parsed.value); + if (!model.ok) { + fail(`model ${tdPath}`, model.error); + } + const generated = generateRustModule(model.value, { layout }); + if (!generated.ok) { + fail(`generate ${tdPath} (layout ${layout})`, generated.error); + } + return generated.value; +}; + +const MARKER_V1 = "// <<>>"; +const MARKER_V2 = "// <<>>"; + +const FIXTURES = [ + { + out: "src/tdbin/tests/generated/mod.rs", + td: "src/typediagram/test/converters/fixtures/person.td", + layout: 1, + marker: MARKER_V1, + header: `//! [TDBIN-TEST-ROUNDTRIP] typeDiagram ADT + TDBIN codec, GENERATED by +//! \`src/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`) +//! from the fixed Person-shaped schema in +//! \`src/typediagram/test/converters/fixtures/person.td\`. \`roundtrip.rs\`, +//! \`frame.rs\` and \`golden.rs\` exercise these types so the end-to-end proof — +//! typeDiagram ADT -> binary -> typeDiagram ADT — runs under \`cargo test\`. +//! The \`rust-tdbin.test.ts\` vitest suite pins the emitted text and fails if +//! this file drifts from codegen; regenerate with +//! \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\` rather than hand-editing. +`, + }, + { + out: "src/tdbin/tests/generated_opt/mod.rs", + td: "src/typediagram/test/converters/fixtures/measurement.td", + layout: 1, + marker: MARKER_V1, + header: `//! [TDBIN-PRIM-OPTION] GENERATED \`Option\` fixture (1-bit presence +//! flags in the shared bool bitset + natural-width value slots), emitted by +//! \`src/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`) +//! from \`src/typediagram/test/converters/fixtures/measurement.td\`. +//! Included only by \`roundtrip.rs\`; kept separate from the shared Person +//! fixture so the framing/golden test binaries do not carry an unused type +//! (\`-D dead-code\`). Regenerate with \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\` +//! rather than hand-editing. +`, + }, + { + out: "src/tdbin/tests/generated_shapes/mod.rs", + td: "src/typediagram/test/converters/fixtures/shapes.td", + layout: 1, + marker: MARKER_V1, + header: `//! [TDBIN-UNION-STRUCT] GENERATED struct-form / multi-field tuple union +//! variant fixture (#61), emitted by +//! \`src/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`) +//! from \`src/typediagram/test/converters/fixtures/shapes.td\`. Included +//! only by \`variants.rs\`. Regenerate with +//! \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\` rather than hand-editing. +`, + }, + { + out: "src/tdbin/tests/generated_reports/mod.rs", + td: "src/typediagram/test/converters/fixtures/reports.td", + layout: 1, + marker: MARKER_V1, + header: `//! [TDBIN-TS-LIST] GENERATED list-form fixture, emitted by +//! \`src/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`) +//! from \`src/typediagram/test/converters/fixtures/reports.td\`. Included +//! only by \`cross_lang.rs\`, which pins the Rust bytes the TypeScript codec +//! must reproduce. Regenerate with \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\`. +`, + }, + { + out: "src/tdbin/tests/generated_widths/mod.rs", + td: "src/typediagram/test/converters/fixtures/widths.td", + layout: 1, + marker: MARKER_V1, + header: `//! [TDBIN-WIDTH-RANGE] GENERATED width-refined integer + Path fixture (#85), +//! emitted by \`src/typediagram/src/converters/rust-tdbin.ts\` +//! (\`generateRustModule\`) from +//! \`src/typediagram/test/converters/fixtures/widths.td\`. Included only +//! by \`widths.rs\`. Regenerate with \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\`. +`, + }, + { + out: "src/tdbin/tests/generated_corpus/mod.rs", + td: "docs/research/benchmarks/tdbin-corpus.td", + layout: 2, + marker: MARKER_V2, + header: `//! [TDBIN-BENCH-CORPUS] typeDiagram ADT + TDBIN columnar codec (layout major +//! 2), GENERATED by \`src/typediagram/src/converters/rust-tdbin.ts\` +//! (\`generateRustModule(model, { layout: 2 })\`) from +//! \`docs/research/benchmarks/tdbin-corpus.td\`. The benchmark support fixtures and the +//! \`golden_columnar.rs\` vectors consume these types. The +//! \`rust-tdbin-corpus.test.ts\` vitest suite pins the emitted text and fails if +//! this file drifts from codegen; regenerate with +//! \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\` rather than hand-editing. +`, + }, + { + out: "src/tdbin/tests/generated_batches/mod.rs", + td: "src/typediagram/test/converters/fixtures/batches.td", + layout: 2, + marker: MARKER_V2, + header: `//! [TDBIN-BENCH-CORPUS] typeDiagram ADT + TDBIN columnar codec (layout major +//! 2), GENERATED by \`src/typediagram/src/converters/rust-tdbin.ts\` +//! (\`generateRustModule(model, { layout: 2 })\`) from the Person/PersonBatch/ +//! ContactBatch schema in +//! \`src/typediagram/test/converters/fixtures/batches.td\`. The benchmark +//! support fixtures consume these types. The \`rust-tdbin-corpus.test.ts\` +//! vitest suite pins the emitted text and fails if this file drifts from +//! codegen; regenerate with \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\` rather +//! than hand-editing. +`, + }, + { + out: "src/tdbin/tests/generated_names/mod.rs", + td: "src/typediagram/test/converters/fixtures/names.td", + layout: 2, + marker: MARKER_V2, + header: `//! [TDBIN-CODEGEN-LOCALS] GENERATED name-collision fixture: fields and +//! variants named after the codec's own identifiers (\`w\`, \`r\`, \`at\`, +//! \`count\`, \`items\`, \`rows\`, \`i\`, \`tags\`, …), emitted by +//! \`src/typediagram/src/converters/rust-tdbin.ts\` (\`generateRustModule\`, +//! layout 2) from \`src/typediagram/test/converters/fixtures/names.td\`. +//! Compiling and round-tripping it under \`cargo test\` proves no shadowing. +//! Regenerate with \`node src/scripts/tdbin/tdbin-regen-fixtures.mjs\`. +`, + }, +]; + +for (const fixture of FIXTURES) { + const body = generate(fixture.td, fixture.layout); + writeFileSync(join(root, fixture.out), `${fixture.header}\n${fixture.marker}\n${body}`); + console.log(`regenerated ${fixture.out} (layout ${fixture.layout})`); +} + +run("cargo", ["fmt", "--manifest-path", "src/Cargo.toml", "-p", "tdbin"]); diff --git a/scripts/tdbin-spec-trace.mjs b/src/scripts/tdbin/tdbin-spec-trace.mjs similarity index 91% rename from scripts/tdbin-spec-trace.mjs rename to src/scripts/tdbin/tdbin-spec-trace.mjs index 5ea4599..ca8b0d3 100644 --- a/scripts/tdbin-spec-trace.mjs +++ b/src/scripts/tdbin/tdbin-spec-trace.mjs @@ -21,8 +21,8 @@ const grepPaths = (id, paths) => { } }; -const codePaths = ["crates/tdbin/src", "packages/typediagram/src"]; -const testPaths = ["crates/tdbin/tests", "crates/tdbin/benches", "packages/typediagram/test"]; +const codePaths = ["src/tdbin/src", "src/typediagram/src"]; +const testPaths = ["src/tdbin/tests", "src/tdbin/benches", "src/typediagram/test"]; const bareIds = [...ids].map((id) => id.slice(1, -1)); const isHeading = (bare) => bareIds.some((other) => other.startsWith(`${bare}-`)); diff --git a/scripts/tsconfig.json b/src/scripts/tsconfig.json similarity index 100% rename from scripts/tsconfig.json rename to src/scripts/tsconfig.json diff --git a/scripts/vitest-config-base.ts b/src/scripts/vitest-config-base.ts similarity index 86% rename from scripts/vitest-config-base.ts rename to src/scripts/vitest-config-base.ts index 3d96fd2..1d2b172 100644 --- a/scripts/vitest-config-base.ts +++ b/src/scripts/vitest-config-base.ts @@ -21,7 +21,7 @@ export interface VitestConfigOptions { /** Absolute path of the calling package (pass `__dirname`). */ readonly configDir: string; /** - * coverage-thresholds.json project key (e.g. "packages/cli"). Omit when the + * coverage-thresholds.json project key (e.g. "src/cli"). Omit when the * package enforces coverage elsewhere (web merges vitest + Playwright in * scripts/merge-coverage.ts, so it must not set vitest thresholds here). */ @@ -49,8 +49,10 @@ export const createVitestConfig = (options: VitestConfigOptions) => { provider: "v8", reporter: ["text", "html", "json-summary", ...(options.extraReporters ?? [])], ...(options.reportsDirectory === undefined ? {} : { reportsDirectory: options.reportsDirectory }), - include: ["src/**/*.ts"], - exclude: ["src/**/*.d.ts", ...(options.exclude ?? [])], + // Anchored to the package dir: packages live under the repo's src/, so a + // bare "src/**" glob would also match each package's test/ helpers. + include: [resolve(options.configDir, "src/**/*.ts")], + exclude: ["**/*.d.ts", ...(options.exclude ?? []).map((glob) => resolve(options.configDir, glob))], ...(thresholds === undefined ? {} : { thresholds }), }, }, diff --git a/crates/tdbin/Cargo.toml b/src/tdbin/Cargo.toml similarity index 78% rename from crates/tdbin/Cargo.toml rename to src/tdbin/Cargo.toml index edca41c..42baa55 100644 --- a/crates/tdbin/Cargo.toml +++ b/src/tdbin/Cargo.toml @@ -3,12 +3,17 @@ # `thiserror`/`tracing` wiring lands with the logging pass ([TDBIN-RS-LOG]). [package] name = "tdbin" -version = "0.0.0" +version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true description = "TDBIN v0: compact binary codec runtime for typeDiagram algebraic data types." -publish = false +readme = "README.md" +keywords = ["typediagram", "serialization", "binary", "codec", "adt"] +categories = ["encoding"] +# [TDBIN-RS-PUBLISH] published to crates.io by the release workflow; ship only +# the runtime — tests, fixtures, benches, and the fuzz harness stay in the repo. +include = ["src/**/*.rs", "Cargo.toml", "README.md"] [lints] workspace = true diff --git a/src/tdbin/README.md b/src/tdbin/README.md new file mode 100644 index 0000000..bc57dfd --- /dev/null +++ b/src/tdbin/README.md @@ -0,0 +1,29 @@ +# tdbin + +The Rust runtime for **TDBIN**, the compact binary wire format for +[typeDiagram](https://typediagram.dev) algebraic data types. It has no +dependencies. + +You don't write codecs by hand: `typediagram encode schema.td` generates your +Rust types together with their `impl tdbin::Struct`, and this crate encodes, +decodes, frames, packs, and verifies them. + +```toml +[dependencies] +tdbin = "0.14" +``` + +```rust +use tdbin::TdBin; + +let bytes = person.to_packed_framed_bytes_checked()?; +let back = Person::from_framed_bytes(&bytes)?; +``` + +Decoding is safe on untrusted input: malformed bytes return a typed +`DecodeError` and never panic. Framed messages carry the schema's layout hash, +so a reader built against a different schema version rejects the message +instead of misreading it. + +See the [TDBIN guide](https://typediagram.dev/docs/tdbin.html) and the +[wire-format specification](https://typediagram.dev/docs/tdbin-wire-format.html). diff --git a/crates/tdbin/benches/gate.rs b/src/tdbin/benches/gate.rs similarity index 100% rename from crates/tdbin/benches/gate.rs rename to src/tdbin/benches/gate.rs diff --git a/crates/tdbin/examples/bench.rs b/src/tdbin/examples/bench.rs similarity index 100% rename from crates/tdbin/examples/bench.rs rename to src/tdbin/examples/bench.rs diff --git a/crates/tdbin/examples/bench_data.rs b/src/tdbin/examples/bench_data.rs similarity index 97% rename from crates/tdbin/examples/bench_data.rs rename to src/tdbin/examples/bench_data.rs index 8dcf6e9..e161772 100644 --- a/crates/tdbin/examples/bench_data.rs +++ b/src/tdbin/examples/bench_data.rs @@ -41,7 +41,7 @@ where )) } -/// Emit all size rows consumed by `scripts/tdbin-bench-report.mjs`. +/// Emit all size rows consumed by `src/scripts/tdbin/tdbin-bench-report.mjs`. fn main() -> Result<(), BoxError> { let rows = [ fixture( diff --git a/crates/tdbin/examples/profile.rs b/src/tdbin/examples/profile.rs similarity index 100% rename from crates/tdbin/examples/profile.rs rename to src/tdbin/examples/profile.rs diff --git a/crates/tdbin/fuzz/.gitignore b/src/tdbin/fuzz/.gitignore similarity index 100% rename from crates/tdbin/fuzz/.gitignore rename to src/tdbin/fuzz/.gitignore diff --git a/crates/tdbin/fuzz/Cargo.lock b/src/tdbin/fuzz/Cargo.lock similarity index 100% rename from crates/tdbin/fuzz/Cargo.lock rename to src/tdbin/fuzz/Cargo.lock diff --git a/crates/tdbin/fuzz/Cargo.toml b/src/tdbin/fuzz/Cargo.toml similarity index 100% rename from crates/tdbin/fuzz/Cargo.toml rename to src/tdbin/fuzz/Cargo.toml diff --git a/crates/tdbin/fuzz/fuzz_targets/decode.rs b/src/tdbin/fuzz/fuzz_targets/decode.rs similarity index 100% rename from crates/tdbin/fuzz/fuzz_targets/decode.rs rename to src/tdbin/fuzz/fuzz_targets/decode.rs diff --git a/crates/tdbin/src/column.rs b/src/tdbin/src/column.rs similarity index 99% rename from crates/tdbin/src/column.rs rename to src/tdbin/src/column.rs index 81a3be5..3325624 100644 --- a/crates/tdbin/src/column.rs +++ b/src/tdbin/src/column.rs @@ -257,7 +257,7 @@ impl Writer { let bytes = count.checked_mul(4).ok_or(EncodeError::LimitExceeded)?; let start = self.reserve(bytes.div_ceil(WORD_BYTES))?; let dst = self.bytes_mut(start, bytes)?; - for (chunk, value) in dst.chunks_exact_mut(4).zip(values) { + for (chunk, value) in dst.as_chunks_mut::<4>().0.iter_mut().zip(values) { chunk.copy_from_slice(&value.to_le_bytes()); } self.set_list_ptr(ptr_word, start, ELEM_FOUR_BYTES, count) @@ -388,7 +388,7 @@ impl Writer { .ok_or(EncodeError::LimitExceeded)?; let start = self.reserve(bytes.div_ceil(8))?; let dst = self.bytes_mut(start, bytes)?; - for (chunk, len) in dst.chunks_exact_mut(2).zip(lengths) { + for (chunk, len) in dst.as_chunks_mut::<2>().0.iter_mut().zip(lengths) { chunk.copy_from_slice(&u16::try_from(*len).unwrap_or(0).to_le_bytes()); } self.set_list_ptr( diff --git a/crates/tdbin/src/column_read.rs b/src/tdbin/src/column_read.rs similarity index 99% rename from crates/tdbin/src/column_read.rs rename to src/tdbin/src/column_read.rs index d2ea793..0fa0b5e 100644 --- a/crates/tdbin/src/column_read.rs +++ b/src/tdbin/src/column_read.rs @@ -269,7 +269,7 @@ impl<'a> Reader<'a> { } /// Borrow and charge a raw fixed-width list body. - fn borrow_raw( + pub(crate) fn borrow_raw( &self, ptr_word: usize, offset: i64, @@ -462,8 +462,11 @@ impl<'a> Reader<'a> { .get(start_byte..end_byte) .ok_or(DecodeError::PointerOutOfBounds { word_index: start })?; Ok(src - .chunks_exact(4) - .map(|chunk| u32::from_le_bytes(<[u8; 4]>::try_from(chunk).unwrap_or([0; 4]))) + .as_chunks::<4>() + .0 + .iter() + .copied() + .map(u32::from_le_bytes) .collect()) } } diff --git a/crates/tdbin/src/error.rs b/src/tdbin/src/error.rs similarity index 93% rename from crates/tdbin/src/error.rs rename to src/tdbin/src/error.rs index 888468e..240617b 100644 --- a/crates/tdbin/src/error.rs +++ b/src/tdbin/src/error.rs @@ -15,6 +15,9 @@ pub enum EncodeError { /// A relative pointer offset did not fit the signed 30-bit field /// ([TDBIN-PTR-STRUCT]). OffsetOutOfRange, + /// A `Path` field was not valid UTF-8, so it has no `String` wire form + /// ([TDBIN-WIDTH-PATH]). + NonUtf8Path, } impl fmt::Display for EncodeError { @@ -23,6 +26,7 @@ impl fmt::Display for EncodeError { Self::BadLength => "body length is not word-aligned", Self::LimitExceeded => "value exceeds a TDBIN wire-format limit", Self::OffsetOutOfRange => "pointer offset does not fit the signed 30-bit field", + Self::NonUtf8Path => "path is not valid UTF-8", }; f.write_str(msg) } @@ -92,6 +96,9 @@ pub enum DecodeError { UnexpectedNull, /// The root pointer was null. NullRoot, + /// A width-refined integer held a value outside its declared range + /// ([TDBIN-WIDTH-RANGE]). + ValueOutOfRange, } impl fmt::Display for DecodeError { @@ -126,6 +133,7 @@ impl fmt::Display for DecodeError { } Self::UnexpectedNull => f.write_str("required pointer field was null"), Self::NullRoot => f.write_str("root pointer was null"), + Self::ValueOutOfRange => f.write_str("integer is outside its declared width"), } } } diff --git a/crates/tdbin/src/frame.rs b/src/tdbin/src/frame.rs similarity index 100% rename from crates/tdbin/src/frame.rs rename to src/tdbin/src/frame.rs diff --git a/crates/tdbin/src/intblock.rs b/src/tdbin/src/intblock.rs similarity index 100% rename from crates/tdbin/src/intblock.rs rename to src/tdbin/src/intblock.rs diff --git a/crates/tdbin/src/layout.rs b/src/tdbin/src/layout.rs similarity index 100% rename from crates/tdbin/src/layout.rs rename to src/tdbin/src/layout.rs diff --git a/crates/tdbin/src/lib.rs b/src/tdbin/src/lib.rs similarity index 99% rename from crates/tdbin/src/lib.rs rename to src/tdbin/src/lib.rs index 3148b6d..31c671c 100644 --- a/crates/tdbin/src/lib.rs +++ b/src/tdbin/src/lib.rs @@ -26,6 +26,7 @@ mod reader; mod reader_lists; pub mod reflect; mod verify; +mod width_lists; mod writer; mod writer_lists; diff --git a/crates/tdbin/src/pack.rs b/src/tdbin/src/pack.rs similarity index 100% rename from crates/tdbin/src/pack.rs rename to src/tdbin/src/pack.rs diff --git a/crates/tdbin/src/pointer.rs b/src/tdbin/src/pointer.rs similarity index 100% rename from crates/tdbin/src/pointer.rs rename to src/tdbin/src/pointer.rs diff --git a/crates/tdbin/src/reader.rs b/src/tdbin/src/reader.rs similarity index 100% rename from crates/tdbin/src/reader.rs rename to src/tdbin/src/reader.rs diff --git a/crates/tdbin/src/reader_lists.rs b/src/tdbin/src/reader_lists.rs similarity index 98% rename from crates/tdbin/src/reader_lists.rs rename to src/tdbin/src/reader_lists.rs index 4950556..07ee8e0 100644 --- a/crates/tdbin/src/reader_lists.rs +++ b/src/tdbin/src/reader_lists.rs @@ -247,8 +247,11 @@ impl<'a> Reader<'a> { self.charge(len)?; let bytes = self.word_body_bytes(start, len)?; Ok(bytes - .chunks_exact(WORD_BYTES) - .map(|chunk| convert(word_array(chunk))) + .as_chunks::() + .0 + .iter() + .copied() + .map(convert) .collect()) } @@ -416,11 +419,6 @@ fn append_bool_word(out: &mut Vec, word: u64, count: usize) { out.extend((0..take).map(|bit| word.wrapping_shr(bit) & 1 != 0)); } -/// Convert an exact 8-byte chunk to an array (total for `chunks_exact` output). -fn word_array(chunk: &[u8]) -> [u8; WORD_BYTES] { - <[u8; WORD_BYTES]>::try_from(chunk).unwrap_or([0; WORD_BYTES]) -} - impl CompositeList { /// Absolute word index of element `i`. pub(crate) fn elem_at(self, i: usize) -> Result { diff --git a/crates/tdbin/src/reflect.rs b/src/tdbin/src/reflect.rs similarity index 100% rename from crates/tdbin/src/reflect.rs rename to src/tdbin/src/reflect.rs diff --git a/src/tdbin/src/scalar.rs b/src/tdbin/src/scalar.rs new file mode 100644 index 0000000..714fe2c --- /dev/null +++ b/src/tdbin/src/scalar.rs @@ -0,0 +1,145 @@ +//! Scalar <-> word bit conversions for data-section fields ([TDBIN-PRIM-MAP]). +//! Pure reinterpretation — no arithmetic, no `as` casts. Generated ADT code +//! calls these to fill and read scalar slots. + +use crate::error::{DecodeError, EncodeError}; + +/// Encode a `bool` as a data word (low bit). +#[must_use] +pub fn bool_bits(value: bool) -> u64 { + u64::from(value) +} + +/// Decode a `bool` from a data word. +#[must_use] +pub fn bool_from(word: u64) -> bool { + (word & 1) == 1 +} + +/// Encode an `i64` as its little-endian bit pattern. +#[must_use] +pub fn i64_bits(value: i64) -> u64 { + u64::from_le_bytes(value.to_le_bytes()) +} + +/// Decode an `i64` from its little-endian bit pattern. +#[must_use] +pub fn i64_from(word: u64) -> i64 { + i64::from_le_bytes(word.to_le_bytes()) +} + +/// Encode an `f64` as its IEEE-754 bit pattern. +#[must_use] +pub fn f64_bits(value: f64) -> u64 { + value.to_bits() +} + +/// Decode an `f64` from its IEEE-754 bit pattern. +#[must_use] +pub fn f64_from(word: u64) -> f64 { + f64::from_bits(word) +} + +/// Split a 16-byte semantic scalar into two little-endian words. +#[must_use] +pub const fn bytes16_words(bytes: &[u8; 16]) -> (u64, u64) { + let [b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15] = *bytes; + ( + u64::from_le_bytes([b0, b1, b2, b3, b4, b5, b6, b7]), + u64::from_le_bytes([b8, b9, b10, b11, b12, b13, b14, b15]), + ) +} + +/// Join two little-endian words into a 16-byte semantic scalar. +#[must_use] +pub const fn bytes16_from_words(first: u64, second: u64) -> [u8; 16] { + let [a0, a1, a2, a3, a4, a5, a6, a7] = first.to_le_bytes(); + let [b0, b1, b2, b3, b4, b5, b6, b7] = second.to_le_bytes(); + [ + a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, b3, b4, b5, b6, b7, + ] +} + +// [TDBIN-WIDTH-RANGE] Width-refined integers occupy one data word like `Int`; +// signed widths store the i64 bit pattern, unsigned widths the raw value. Encode +// is lossless by construction; decode narrows and fails typed, never truncates. + +/// Encode an `i32` as the bit pattern of the equal `i64`. +#[must_use] +pub fn i32_bits(value: i32) -> u64 { + i64_bits(i64::from(value)) +} + +/// Decode an `i32`, rejecting words outside its range. +/// +/// # Errors +/// Returns [`DecodeError::ValueOutOfRange`] when the word does not fit. +pub fn i32_from(word: u64) -> Result { + i32::try_from(i64_from(word)).map_err(|_| DecodeError::ValueOutOfRange) +} + +/// Emit the `*_bits` / checked `*_from` pair for one unsigned width. +macro_rules! unsigned_width { + ($bits:ident, $from:ident, $t:ty) => { + #[doc = concat!("Encode a `", stringify!($t), "` as its unsigned value.")] + #[must_use] + pub fn $bits(value: $t) -> u64 { + u64::from(value) + } + + #[doc = concat!("Decode a `", stringify!($t), "`, rejecting words outside its range.")] + /// + /// # Errors + /// Returns [`DecodeError::ValueOutOfRange`] when the word does not fit. + pub fn $from(word: u64) -> Result<$t, DecodeError> { + <$t>::try_from(word).map_err(|_| DecodeError::ValueOutOfRange) + } + }; +} + +unsigned_width!(u8_bits, u8_from, u8); +unsigned_width!(u16_bits, u16_from, u16); +unsigned_width!(u32_bits, u32_from, u32); + +/// Encode a `u64` (identity: the word is the value). +#[must_use] +pub fn u64_bits(value: u64) -> u64 { + value +} + +/// Decode a `u64` (identity). +#[must_use] +pub fn u64_from(word: u64) -> u64 { + word +} + +/// Encode a `usize` as a `u64`. Every supported target has `usize` ≤ 64 bits, +/// so the conversion is exact. +#[must_use] +pub fn usize_bits(value: usize) -> u64 { + u64::try_from(value).unwrap_or(u64::MAX) +} + +/// Decode a `usize`, rejecting words this target cannot address. +/// +/// # Errors +/// Returns [`DecodeError::ValueOutOfRange`] when the word does not fit. +pub fn usize_from(word: u64) -> Result { + usize::try_from(word).map_err(|_| DecodeError::ValueOutOfRange) +} + +/// [TDBIN-WIDTH-PATH] A `Path` is a UTF-8 `String` on the wire. +/// +/// # Errors +/// Returns [`EncodeError::NonUtf8Path`] when the path is not valid UTF-8. +pub fn path_str(path: &std::path::Path) -> Result<&str, EncodeError> { + path.to_str().ok_or(EncodeError::NonUtf8Path) +} + +/// Owned form of [`path_str`], for `List`. +/// +/// # Errors +/// Returns [`EncodeError::NonUtf8Path`] when the path is not valid UTF-8. +pub fn path_string(path: &std::path::Path) -> Result { + path_str(path).map(str::to_owned) +} diff --git a/crates/tdbin/src/verify.rs b/src/tdbin/src/verify.rs similarity index 100% rename from crates/tdbin/src/verify.rs rename to src/tdbin/src/verify.rs diff --git a/src/tdbin/src/width_lists.rs b/src/tdbin/src/width_lists.rs new file mode 100644 index 0000000..517f6cb --- /dev/null +++ b/src/tdbin/src/width_lists.rs @@ -0,0 +1,170 @@ +//! [TDBIN-WIDTH-LIST] Width-refined integer lists use the element codes the +//! wire format reserves for them ([TDBIN-PTR-LIST]): `List` is elem 3 +//! (2 bytes), `List` / `List` are elem 4 (4 bytes), all little-endian. +//! `List` reuses the byte list and `List` the word list; `List` +//! is a word list with checked narrowing on decode. + +use crate::error::{DecodeError, EncodeError}; +use crate::layout::WORD_BYTES; +use crate::pointer::{ELEM_EIGHT_BYTES, ELEM_FOUR_BYTES, ELEM_TWO_BYTES}; +use crate::reader::Reader; +use crate::scalar; +use crate::writer::Writer; + +impl Writer { + /// Append a fixed-width little-endian list body and patch its pointer. + fn write_le_list( + &mut self, + ptr_word: usize, + values: &[T], + elem: u8, + le: impl Fn(T) -> [u8; N], + ) -> Result<(), EncodeError> { + let bytes = values + .len() + .checked_mul(N) + .ok_or(EncodeError::LimitExceeded)?; + let start = self.reserve(bytes.div_ceil(WORD_BYTES))?; + let dst = self.bytes_mut(start, bytes)?; + for (chunk, value) in dst.as_chunks_mut::().0.iter_mut().zip(values) { + chunk.copy_from_slice(&le(*value)); + } + self.set_list_ptr(ptr_word, start, elem, values.len()) + } + + /// Write an optional `List` into pointer `slot`. + /// + /// # Errors + /// Returns [`EncodeError`] if the message exceeds a wire-format limit. + pub fn u16_list( + &mut self, + at: usize, + data_words: u16, + slot: u16, + value: Option<&[u16]>, + ) -> Result<(), EncodeError> { + self.write_list_slot(at, data_words, slot, value, |w, ptr, v| { + w.write_le_list(ptr, v, ELEM_TWO_BYTES, u16::to_le_bytes) + }) + } + + /// Write an optional `List` into pointer `slot`. + /// + /// # Errors + /// Returns [`EncodeError`] if the message exceeds a wire-format limit. + pub fn u32_list( + &mut self, + at: usize, + data_words: u16, + slot: u16, + value: Option<&[u32]>, + ) -> Result<(), EncodeError> { + self.write_list_slot(at, data_words, slot, value, |w, ptr, v| { + w.write_le_list(ptr, v, ELEM_FOUR_BYTES, u32::to_le_bytes) + }) + } + + /// Write an optional `List` into pointer `slot`. + /// + /// # Errors + /// Returns [`EncodeError`] if the message exceeds a wire-format limit. + pub fn i32_list( + &mut self, + at: usize, + data_words: u16, + slot: u16, + value: Option<&[i32]>, + ) -> Result<(), EncodeError> { + self.write_list_slot(at, data_words, slot, value, |w, ptr, v| { + w.write_le_list(ptr, v, ELEM_FOUR_BYTES, i32::to_le_bytes) + }) + } + + /// Write an optional `List` into pointer `slot` as 8-byte words. + /// + /// # Errors + /// Returns [`EncodeError`] if the message exceeds a wire-format limit. + pub fn usize_list( + &mut self, + at: usize, + data_words: u16, + slot: u16, + value: Option<&[usize]>, + ) -> Result<(), EncodeError> { + self.write_list_slot(at, data_words, slot, value, |w, ptr, v| { + w.write_le_list(ptr, v, ELEM_EIGHT_BYTES, |x| { + scalar::usize_bits(x).to_le_bytes() + }) + }) + } +} + +impl Reader<'_> { + /// Read a fixed-width little-endian list body. + fn read_le_list( + &self, + at: usize, + slot: u16, + elem: u8, + from: impl Fn([u8; N]) -> T, + ) -> Result>, DecodeError> { + self.read_list(at, slot, elem, |r, ptr, offset, count| { + let raw = r.borrow_raw(ptr, offset, count, N)?; + Ok(raw.as_chunks::().0.iter().copied().map(&from).collect()) + }) + } + + /// Read an optional `List` from pointer `slot`. + /// + /// # Errors + /// Returns [`DecodeError`] on malformed input. + pub fn u16_list( + &self, + at: usize, + _data_words: u16, + slot: u16, + ) -> Result>, DecodeError> { + self.read_le_list(at, slot, ELEM_TWO_BYTES, u16::from_le_bytes) + } + + /// Read an optional `List` from pointer `slot`. + /// + /// # Errors + /// Returns [`DecodeError`] on malformed input. + pub fn u32_list( + &self, + at: usize, + _data_words: u16, + slot: u16, + ) -> Result>, DecodeError> { + self.read_le_list(at, slot, ELEM_FOUR_BYTES, u32::from_le_bytes) + } + + /// Read an optional `List` from pointer `slot`. + /// + /// # Errors + /// Returns [`DecodeError`] on malformed input. + pub fn i32_list( + &self, + at: usize, + _data_words: u16, + slot: u16, + ) -> Result>, DecodeError> { + self.read_le_list(at, slot, ELEM_FOUR_BYTES, i32::from_le_bytes) + } + + /// Read an optional `List` from pointer `slot`, narrowing each word. + /// + /// # Errors + /// Returns [`DecodeError::ValueOutOfRange`] for a word this target cannot address. + pub fn usize_list( + &self, + at: usize, + _data_words: u16, + slot: u16, + ) -> Result>, DecodeError> { + self.read_le_list(at, slot, ELEM_EIGHT_BYTES, u64::from_le_bytes)? + .map(|words| words.into_iter().map(scalar::usize_from).collect()) + .transpose() + } +} diff --git a/crates/tdbin/src/writer.rs b/src/tdbin/src/writer.rs similarity index 99% rename from crates/tdbin/src/writer.rs rename to src/tdbin/src/writer.rs index ed1f810..8c6c403 100644 --- a/crates/tdbin/src/writer.rs +++ b/src/tdbin/src/writer.rs @@ -329,7 +329,7 @@ impl Writer { .body .get_mut(byte_start..) .ok_or(EncodeError::LimitExceeded)?; - let mut words = dst.chunks_exact_mut(WORD_BYTES); + let mut words = dst.as_chunks_mut::().0.iter_mut(); let (mut acc, mut filled) = (0_u64, 0_u32); for value in values { acc |= u64::from(value).wrapping_shl(filled); @@ -363,7 +363,7 @@ impl Writer { /// Write one packed bit word into the next reserved 8-byte chunk. fn flush_bit_word( - words: &mut core::slice::ChunksExactMut<'_, u8>, + words: &mut core::slice::IterMut<'_, [u8; WORD_BYTES]>, acc: u64, ) -> Result<(), EncodeError> { words diff --git a/crates/tdbin/src/writer_lists.rs b/src/tdbin/src/writer_lists.rs similarity index 97% rename from crates/tdbin/src/writer_lists.rs rename to src/tdbin/src/writer_lists.rs index 87f8cb2..e33fcdc 100644 --- a/crates/tdbin/src/writer_lists.rs +++ b/src/tdbin/src/writer_lists.rs @@ -16,7 +16,7 @@ impl Writer { /// Resolve pointer `slot`, writing the null pointer for `None` and otherwise /// delegating to `write_some` with the resolved pointer word. Every public /// `*_list` method shares this null-vs-body framing ([TDBIN-LIST-ELEM]). - fn write_list_slot( + pub(crate) fn write_list_slot( &mut self, at: usize, data_words: u16, @@ -205,7 +205,7 @@ impl Writer { .checked_mul(WORD_BYTES) .ok_or(EncodeError::LimitExceeded)?; let dst = self.bytes_mut(start, len)?; - for (chunk, value) in dst.chunks_exact_mut(WORD_BYTES).zip(values) { + for (chunk, value) in dst.as_chunks_mut::().0.iter_mut().zip(values) { chunk.copy_from_slice(&value.to_le_bytes()); } self.set_list_ptr(ptr_word, start, ELEM_EIGHT_BYTES, count) @@ -265,7 +265,11 @@ impl Writer { .checked_mul(WORD_BYTES) .ok_or(EncodeError::LimitExceeded)?; let first = start.checked_add(1).ok_or(EncodeError::LimitExceeded)?; - let body = self.bytes_mut(first, len)?.chunks_exact_mut(WORD_BYTES * 2); + let body = self + .bytes_mut(first, len)? + .as_chunks_mut::<{ WORD_BYTES * 2 }>() + .0 + .iter_mut(); for (chunk, (lo, hi)) in body.zip(values.iter().copied()) { write_pair(chunk, lo, hi); } diff --git a/crates/tdbin/tests/columns.rs b/src/tdbin/tests/columns.rs similarity index 99% rename from crates/tdbin/tests/columns.rs rename to src/tdbin/tests/columns.rs index aa3fbb8..a699362 100644 --- a/crates/tdbin/tests/columns.rs +++ b/src/tdbin/tests/columns.rs @@ -623,8 +623,8 @@ fn unknown_union_tag_is_a_typed_error() { /// so find the last 0x01 byte whose word is otherwise zero. fn find_tag_offset(bytes: &[u8]) -> usize { let mut offset = 0; - for (index, chunk) in bytes.chunks_exact(8).enumerate() { - let word = u64::from_le_bytes(<[u8; 8]>::try_from(chunk).unwrap_or_default()); + for (index, chunk) in bytes.as_chunks::<8>().0.iter().enumerate() { + let word = u64::from_le_bytes(*chunk); if word == 1 { offset = index.wrapping_mul(8); } diff --git a/src/tdbin/tests/cross_lang.rs b/src/tdbin/tests/cross_lang.rs new file mode 100644 index 0000000..6440221 --- /dev/null +++ b/src/tdbin/tests/cross_lang.rs @@ -0,0 +1,62 @@ +//! [TDBIN-TS-LIST] [TDBIN-TEST-GOLDEN] Cross-language byte identity: the Rust +//! codec generated from `reports.td` must produce EXACTLY the bytes committed +//! in `golden/report_lists.hex`; the TypeScript suite +//! (`typescript-tdbin.test.ts`) asserts its generated codec produces the same +//! file byte for byte. One value covers every layout-1 `List` form. + +/// The codegen-emitted list fixture. +mod generated_reports; + +use generated_reports::{Level, Report, Tag}; +use std::fmt::Write as _; +use tdbin::{Struct, TdBin}; + +type TestResult = Result<(), Box>; + +const GOLDEN: &str = include_str!("golden/report_lists.hex"); + +/// The shared value; `typescript-tdbin.test.ts` builds the identical one. +fn report() -> Report { + Report { + flags: vec![true, false, true, true, false, false, false, false, true], + counts: vec![0, -1, i64::MAX, i64::MIN], + ratios: vec![0.5, -0.0, f64::INFINITY, 1e-300], + names: vec![String::new(), "α".to_owned(), "two words".to_owned()], + blobs: vec![vec![], vec![0, 255, 7]], + tags: vec![ + Tag { + key: "a".to_owned(), + weight: 1.5, + }, + Tag { + key: String::new(), + weight: -2.0, + }, + ], + levels: vec![Level::High, Level::Low, Level::High], + maybe_counts: Some(vec![42]), + maybe_tags: Some(vec![]), + maybe_levels: None, + title: "golden".to_owned(), + } +} + +fn hex(bytes: &[u8]) -> Result { + bytes.iter().try_fold(String::new(), |mut out, byte| { + write!(out, "{byte:02x}")?; + Ok(out) + }) +} + +#[test] +fn rust_list_bytes_match_the_cross_language_golden() -> TestResult { + let value = report(); + let bytes = value.to_packed_framed_bytes_checked()?; + assert_eq!(hex(&bytes)?, GOLDEN.trim()); + assert_eq!(Report::from_framed_bytes(&bytes)?, value); + assert_eq!( + Report::from_framed_bytes_with_hash(&bytes, Report::LAYOUT_HASH)?, + value + ); + Ok(()) +} diff --git a/crates/tdbin/tests/evolution.rs b/src/tdbin/tests/evolution.rs similarity index 100% rename from crates/tdbin/tests/evolution.rs rename to src/tdbin/tests/evolution.rs diff --git a/crates/tdbin/tests/frame.rs b/src/tdbin/tests/frame.rs similarity index 100% rename from crates/tdbin/tests/frame.rs rename to src/tdbin/tests/frame.rs diff --git a/crates/tdbin/tests/fuzz_decode.rs b/src/tdbin/tests/fuzz_decode.rs similarity index 100% rename from crates/tdbin/tests/fuzz_decode.rs rename to src/tdbin/tests/fuzz_decode.rs diff --git a/crates/tdbin/tests/generated/mod.rs b/src/tdbin/tests/generated/mod.rs similarity index 80% rename from crates/tdbin/tests/generated/mod.rs rename to src/tdbin/tests/generated/mod.rs index cc9565b..73093e0 100644 --- a/crates/tdbin/tests/generated/mod.rs +++ b/src/tdbin/tests/generated/mod.rs @@ -1,12 +1,12 @@ //! [TDBIN-TEST-ROUNDTRIP] typeDiagram ADT + TDBIN codec, GENERATED by -//! `packages/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`) +//! `src/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`) //! from the fixed Person-shaped schema in -//! `packages/typediagram/test/converters/fixtures/person.td`. `roundtrip.rs`, +//! `src/typediagram/test/converters/fixtures/person.td`. `roundtrip.rs`, //! `frame.rs` and `golden.rs` exercise these types so the end-to-end proof — //! typeDiagram ADT -> binary -> typeDiagram ADT — runs under `cargo test`. //! The `rust-tdbin.test.ts` vitest suite pins the emitted text and fails if //! this file drifts from codegen; regenerate with -//! `node scripts/tdbin-regen-fixtures.mjs` rather than hand-editing. +//! `node src/scripts/tdbin/tdbin-regen-fixtures.mjs` rather than hand-editing. // <<>> /// The `Address` record. @@ -74,9 +74,12 @@ impl tdbin::Struct for Address { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let street = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let zip = tdbin::scalar::i64_from(r.scalar(at, 0)?); - Ok(Self { street, zip }) + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + Ok(Self { + street: f0, + zip: f1, + }) } } @@ -91,8 +94,8 @@ impl tdbin::Struct for EmailContact { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let addr = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - Ok(Self { addr }) + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + Ok(Self { addr: f0 }) } } @@ -108,9 +111,12 @@ impl tdbin::Struct for PhoneContact { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let number = tdbin::scalar::i64_from(r.scalar(at, 0)?); - let country = tdbin::scalar::i64_from(r.scalar(at, 1)?); - Ok(Self { number, country }) + let f0 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 1)?); + Ok(Self { + number: f0, + country: f1, + }) } } @@ -173,23 +179,23 @@ impl tdbin::Struct for Person { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let name = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let age = tdbin::scalar::i64_from(r.scalar(at, 0)?); - let active = r.bool_bit(at, 1, 0)?; - let score = tdbin::scalar::f64_from(r.scalar(at, 2)?); - let address = r.child::
(at, Self::DATA_WORDS, 1)?; - let nickname = r.string(at, Self::DATA_WORDS, 2)?; - let contact = r + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f2 = r.bool_bit(at, 1, 0)?; + let f3 = tdbin::scalar::f64_from(r.scalar(at, 2)?); + let f4 = r.child::
(at, Self::DATA_WORDS, 1)?; + let f5 = r.string(at, Self::DATA_WORDS, 2)?; + let f6 = r .child::(at, Self::DATA_WORDS, 3)? .unwrap_or_default(); Ok(Self { - name, - age, - active, - score, - address, - nickname, - contact, + name: f0, + age: f1, + active: f2, + score: f3, + address: f4, + nickname: f5, + contact: f6, }) } } diff --git a/crates/tdbin/tests/generated_batches/mod.rs b/src/tdbin/tests/generated_batches/mod.rs similarity index 74% rename from crates/tdbin/tests/generated_batches/mod.rs rename to src/tdbin/tests/generated_batches/mod.rs index a18c55d..b64897d 100644 --- a/crates/tdbin/tests/generated_batches/mod.rs +++ b/src/tdbin/tests/generated_batches/mod.rs @@ -1,11 +1,11 @@ //! [TDBIN-BENCH-CORPUS] typeDiagram ADT + TDBIN columnar codec (layout major -//! 2), GENERATED by `packages/typediagram/src/converters/rust-tdbin.ts` +//! 2), GENERATED by `src/typediagram/src/converters/rust-tdbin.ts` //! (`generateRustModule(model, { layout: 2 })`) from the Person/PersonBatch/ //! ContactBatch schema in -//! `packages/typediagram/test/converters/fixtures/batches.td`. The benchmark +//! `src/typediagram/test/converters/fixtures/batches.td`. The benchmark //! support fixtures consume these types. The `rust-tdbin-corpus.test.ts` //! vitest suite pins the emitted text and fails if this file drifts from -//! codegen; regenerate with `node scripts/tdbin-regen-fixtures.mjs` rather +//! codegen; regenerate with `node src/scripts/tdbin/tdbin-regen-fixtures.mjs` rather //! than hand-editing. // <<>> @@ -93,23 +93,23 @@ impl tdbin::Struct for Person { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let name = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let age = tdbin::scalar::i64_from(r.scalar(at, 0)?); - let active = r.bool_bit(at, 1, 0)?; - let score = tdbin::scalar::f64_from(r.scalar(at, 2)?); - let address = r.child::
(at, Self::DATA_WORDS, 1)?; - let nickname = r.string(at, Self::DATA_WORDS, 2)?; - let contact = r + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f2 = r.bool_bit(at, 1, 0)?; + let f3 = tdbin::scalar::f64_from(r.scalar(at, 2)?); + let f4 = r.child::
(at, Self::DATA_WORDS, 1)?; + let f5 = r.string(at, Self::DATA_WORDS, 2)?; + let f6 = r .child::(at, Self::DATA_WORDS, 3)? .unwrap_or_default(); Ok(Self { - name, - age, - active, - score, - address, - nickname, - contact, + name: f0, + age: f1, + active: f2, + score: f3, + address: f4, + nickname: f5, + contact: f6, }) } } @@ -145,11 +145,11 @@ impl tdbin::ColumnGroup for Person { count, items.clone().map(|row| row.address.is_some()), )?; - let address: Vec<&Address> = items + let address_some: Vec<&Address> = items .clone() .filter_map(|row| row.address.as_ref()) .collect(); - w.dense_group(at, 1, 6, address.len(), address.iter().copied())?; + w.dense_group(at, 1, 6, address_some.len(), address_some.iter().copied())?; w.bit_column( at, 1, @@ -176,35 +176,35 @@ impl tdbin::ColumnGroup for Person { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut name = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let age = r.i64_block_column(at, 2, count)?; - let active = r.bit_column(at, 3, count)?; - let score = r.f64_column(at, 4, count)?; - let address_valid = r.bit_column(at, 5, count)?; - let address_count = address_valid.iter().filter(|present| **present).count(); - let mut address = r.dense_group::
(at, 6, address_count)?.into_iter(); - let nickname_valid = r.bit_column(at, 7, count)?; - let nickname_values = r.var_column(at, 8, 9, count)?.into_strings()?; - let mut nickname = nickname_valid + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let f1 = r.i64_block_column(at, 2, count)?; + let f2 = r.bit_column(at, 3, count)?; + let f3 = r.f64_column(at, 4, count)?; + let f4_valid = r.bit_column(at, 5, count)?; + let f4_count = f4_valid.iter().filter(|present| **present).count(); + let mut f4 = r.dense_group::
(at, 6, f4_count)?.into_iter(); + let f5_valid = r.bit_column(at, 7, count)?; + let f5_values = r.var_column(at, 8, 9, count)?.into_strings()?; + let mut f5 = f5_valid .into_iter() - .zip(nickname_values) + .zip(f5_values) .map(|(valid, value)| valid.then_some(value)); - let mut contact = r.dense_group::(at, 10, count)?.into_iter(); + let mut f6 = r.dense_group::(at, 10, count)?.into_iter(); let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - name: name.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - age: age.get(i).copied().unwrap_or_default(), - active: active.get(i).copied().unwrap_or_default(), - score: score.get(i).copied().unwrap_or_default(), - address: address_valid + name: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + age: f1.get(i).copied().unwrap_or_default(), + active: f2.get(i).copied().unwrap_or_default(), + score: f3.get(i).copied().unwrap_or_default(), + address: f4_valid .get(i) .copied() .unwrap_or_default() - .then(|| address.next().ok_or(tdbin::DecodeError::MalformedColumn)) + .then(|| f4.next().ok_or(tdbin::DecodeError::MalformedColumn)) .transpose()?, - nickname: nickname.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - contact: contact.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + nickname: f5.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + contact: f6.next().ok_or(tdbin::DecodeError::MalformedColumn)?, }); } Ok(rows) @@ -223,9 +223,12 @@ impl tdbin::Struct for Address { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let street = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let zip = tdbin::scalar::i64_from(r.scalar(at, 0)?); - Ok(Self { street, zip }) + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + Ok(Self { + street: f0, + zip: f1, + }) } } @@ -259,13 +262,13 @@ impl tdbin::ColumnGroup for Address { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut street = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let zip = r.i64_block_column(at, 2, count)?; + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let f1 = r.i64_block_column(at, 2, count)?; let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - street: street.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - zip: zip.get(i).copied().unwrap_or_default(), + street: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + zip: f1.get(i).copied().unwrap_or_default(), }); } Ok(rows) @@ -337,22 +340,22 @@ impl tdbin::ColumnGroup for Contact { Self::Phone(_) => 1_u8, }), )?; - let email: Vec<&EmailContact> = items + let v0: Vec<&EmailContact> = items .clone() .filter_map(|row| match row { Self::Email(payload) => Some(payload), Self::Phone(_) => None, }) .collect(); - w.dense_group(at, 1, 1, email.len(), email.iter().copied())?; - let phone: Vec<&PhoneContact> = items + w.dense_group(at, 1, 1, v0.len(), v0.iter().copied())?; + let v1: Vec<&PhoneContact> = items .clone() .filter_map(|row| match row { Self::Phone(payload) => Some(payload), Self::Email(_) => None, }) .collect(); - w.dense_group(at, 1, 2, phone.len(), phone.iter().copied())?; + w.dense_group(at, 1, 2, v1.len(), v1.iter().copied())?; Ok(()) } @@ -362,19 +365,15 @@ impl tdbin::ColumnGroup for Contact { count: usize, ) -> Result, tdbin::DecodeError> { let tags = r.byte_column(at, 0, count)?; - let email_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::(); - let mut email = r - .dense_group::(at, 1, email_count)? - .into_iter(); - let phone_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::(); - let mut phone = r - .dense_group::(at, 2, phone_count)? - .into_iter(); + let v0_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::(); + let mut v0 = r.dense_group::(at, 1, v0_count)?.into_iter(); + let v1_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::(); + let mut v1 = r.dense_group::(at, 2, v1_count)?.into_iter(); let mut rows = Vec::with_capacity(count); for tag in tags { rows.push(match tag { - 0 => Self::Email(email.next().ok_or(tdbin::DecodeError::MalformedColumn)?), - 1 => Self::Phone(phone.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 0 => Self::Email(v0.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 1 => Self::Phone(v1.next().ok_or(tdbin::DecodeError::MalformedColumn)?), ordinal => { return Err(tdbin::DecodeError::UnknownVariant { ordinal: u64::from(ordinal), @@ -397,8 +396,8 @@ impl tdbin::Struct for EmailContact { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let addr = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - Ok(Self { addr }) + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + Ok(Self { addr: f0 }) } } @@ -431,11 +430,11 @@ impl tdbin::ColumnGroup for EmailContact { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut addr = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); let mut rows = Vec::with_capacity(count); for _ in 0..count { rows.push(Self { - addr: addr.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + addr: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, }); } Ok(rows) @@ -454,9 +453,12 @@ impl tdbin::Struct for PhoneContact { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let number = tdbin::scalar::i64_from(r.scalar(at, 0)?); - let country = tdbin::scalar::i64_from(r.scalar(at, 1)?); - Ok(Self { number, country }) + let f0 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 1)?); + Ok(Self { + number: f0, + country: f1, + }) } } @@ -483,13 +485,13 @@ impl tdbin::ColumnGroup for PhoneContact { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let number = r.i64_block_column(at, 0, count)?; - let country = r.i64_block_column(at, 1, count)?; + let f0 = r.i64_block_column(at, 0, count)?; + let f1 = r.i64_block_column(at, 1, count)?; let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - number: number.get(i).copied().unwrap_or_default(), - country: country.get(i).copied().unwrap_or_default(), + number: f0.get(i).copied().unwrap_or_default(), + country: f1.get(i).copied().unwrap_or_default(), }); } Ok(rows) @@ -507,10 +509,10 @@ impl tdbin::Struct for PersonBatch { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let people = r + let f0 = r .column_list::(at, Self::DATA_WORDS, 0)? .unwrap_or_default(); - Ok(Self { people }) + Ok(Self { people: f0 }) } } @@ -525,9 +527,9 @@ impl tdbin::Struct for ContactBatch { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let contacts = r + let f0 = r .column_list::(at, Self::DATA_WORDS, 0)? .unwrap_or_default(); - Ok(Self { contacts }) + Ok(Self { contacts: f0 }) } } diff --git a/crates/tdbin/tests/generated_corpus/mod.rs b/src/tdbin/tests/generated_corpus/mod.rs similarity index 71% rename from crates/tdbin/tests/generated_corpus/mod.rs rename to src/tdbin/tests/generated_corpus/mod.rs index 35791d4..bc99f6a 100644 --- a/crates/tdbin/tests/generated_corpus/mod.rs +++ b/src/tdbin/tests/generated_corpus/mod.rs @@ -1,11 +1,11 @@ //! [TDBIN-BENCH-CORPUS] typeDiagram ADT + TDBIN columnar codec (layout major -//! 2), GENERATED by `packages/typediagram/src/converters/rust-tdbin.ts` +//! 2), GENERATED by `src/typediagram/src/converters/rust-tdbin.ts` //! (`generateRustModule(model, { layout: 2 })`) from -//! `docs/benchmarks/tdbin-corpus.td`. The benchmark support fixtures and the +//! `docs/research/benchmarks/tdbin-corpus.td`. The benchmark support fixtures and the //! `golden_columnar.rs` vectors consume these types. The //! `rust-tdbin-corpus.test.ts` vitest suite pins the emitted text and fails if //! this file drifts from codegen; regenerate with -//! `node scripts/tdbin-regen-fixtures.mjs` rather than hand-editing. +//! `node src/scripts/tdbin/tdbin-regen-fixtures.mjs` rather than hand-editing. // <<>> /// The `BenchDocument` record. @@ -215,29 +215,29 @@ impl tdbin::Struct for BenchDocument { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let title = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - let revision = tdbin::scalar::i64_from(r.scalar(at, 0)?); - let nodes = r + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + let f2 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f3 = r .column_list::(at, Self::DATA_WORDS, 2)? .unwrap_or_default(); - let edges = r + let f4 = r .column_list::(at, Self::DATA_WORDS, 3)? .unwrap_or_default(); - let styles = r + let f5 = r .column_list::(at, Self::DATA_WORDS, 4)? .unwrap_or_default(); - let metadata = r + let f6 = r .column_list::(at, Self::DATA_WORDS, 5)? .unwrap_or_default(); Ok(Self { - id, - title, - revision, - nodes, - edges, - styles, - metadata, + id: f0, + title: f1, + revision: f2, + nodes: f3, + edges: f4, + styles: f5, + metadata: f6, }) } } @@ -261,28 +261,28 @@ impl tdbin::Struct for BenchNode { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let label = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - let x = tdbin::scalar::f64_from(r.scalar(at, 0)?); - let y = tdbin::scalar::f64_from(r.scalar(at, 1)?); - let width = tdbin::scalar::f64_from(r.scalar(at, 2)?); - let height = tdbin::scalar::f64_from(r.scalar(at, 3)?); - let selected = r.bool_bit(at, 4, 0)?; - let locked = r.bool_bit(at, 4, 1)?; - let tags = match r.var_list(at, Self::DATA_WORDS, 2, 3)? { + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + let f2 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f3 = tdbin::scalar::f64_from(r.scalar(at, 1)?); + let f4 = tdbin::scalar::f64_from(r.scalar(at, 2)?); + let f5 = tdbin::scalar::f64_from(r.scalar(at, 3)?); + let f6 = r.bool_bit(at, 4, 0)?; + let f7 = r.bool_bit(at, 4, 1)?; + let f8 = match r.var_list(at, Self::DATA_WORDS, 2, 3)? { Some(column) => column.into_strings()?, None => Vec::new(), }; Ok(Self { - id, - label, - x, - y, - width, - height, - selected, - locked, - tags, + id: f0, + label: f1, + x: f2, + y: f3, + width: f4, + height: f5, + selected: f6, + locked: f7, + tags: f8, }) } } @@ -352,35 +352,35 @@ impl tdbin::ColumnGroup for BenchNode { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut label = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); - let x = r.f64_column(at, 4, count)?; - let y = r.f64_column(at, 5, count)?; - let width = r.f64_column(at, 6, count)?; - let height = r.f64_column(at, 7, count)?; - let selected = r.bit_column(at, 8, count)?; - let locked = r.bit_column(at, 9, count)?; - let tags_counts = r.len_column(at, 10, count)?; - let tags_total = tdbin::column_total(&tags_counts)?; - let mut tags = r - .var_column(at, 11, 12, tags_total)? + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); + let f2 = r.f64_column(at, 4, count)?; + let f3 = r.f64_column(at, 5, count)?; + let f4 = r.f64_column(at, 6, count)?; + let f5 = r.f64_column(at, 7, count)?; + let f6 = r.bit_column(at, 8, count)?; + let f7 = r.bit_column(at, 9, count)?; + let f8_counts = r.len_column(at, 10, count)?; + let f8_total = tdbin::column_total(&f8_counts)?; + let mut f8 = r + .var_column(at, 11, 12, f8_total)? .into_strings()? .into_iter(); let mut rows = Vec::with_capacity(count); for i in 0..count { - let tags_take = usize::try_from(tags_counts.get(i).copied().unwrap_or(0)) + let f8_take = usize::try_from(f8_counts.get(i).copied().unwrap_or(0)) .map_err(|_| tdbin::DecodeError::LimitExceeded)?; rows.push(Self { - id: id.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - label: label.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - x: x.get(i).copied().unwrap_or_default(), - y: y.get(i).copied().unwrap_or_default(), - width: width.get(i).copied().unwrap_or_default(), - height: height.get(i).copied().unwrap_or_default(), - selected: selected.get(i).copied().unwrap_or_default(), - locked: locked.get(i).copied().unwrap_or_default(), - tags: (0..tags_take) - .map(|_| tags.next().ok_or(tdbin::DecodeError::MalformedColumn)) + id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + label: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + x: f2.get(i).copied().unwrap_or_default(), + y: f3.get(i).copied().unwrap_or_default(), + width: f4.get(i).copied().unwrap_or_default(), + height: f5.get(i).copied().unwrap_or_default(), + selected: f6.get(i).copied().unwrap_or_default(), + locked: f7.get(i).copied().unwrap_or_default(), + tags: (0..f8_take) + .map(|_| f8.next().ok_or(tdbin::DecodeError::MalformedColumn)) .collect::, _>>()?, }); } @@ -404,19 +404,19 @@ impl tdbin::Struct for BenchEdge { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let from = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - let to = r.string(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); - let label = r.string(at, Self::DATA_WORDS, 3)?; - let weight = tdbin::scalar::f64_from(r.scalar(at, 0)?); - let directed = r.bool_bit(at, 1, 0)?; + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + let f2 = r.string(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); + let f3 = r.string(at, Self::DATA_WORDS, 3)?; + let f4 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f5 = r.bool_bit(at, 1, 0)?; Ok(Self { - id, - from, - to, - label, - weight, - directed, + id: f0, + from: f1, + to: f2, + label: f3, + weight: f4, + directed: f5, }) } } @@ -485,26 +485,26 @@ impl tdbin::ColumnGroup for BenchEdge { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut from = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); - let mut to = r.var_column(at, 4, 5, count)?.into_strings()?.into_iter(); - let label_valid = r.bit_column(at, 6, count)?; - let label_values = r.var_column(at, 7, 8, count)?.into_strings()?; - let mut label = label_valid + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); + let mut f2 = r.var_column(at, 4, 5, count)?.into_strings()?.into_iter(); + let f3_valid = r.bit_column(at, 6, count)?; + let f3_values = r.var_column(at, 7, 8, count)?.into_strings()?; + let mut f3 = f3_valid .into_iter() - .zip(label_values) + .zip(f3_values) .map(|(valid, value)| valid.then_some(value)); - let weight = r.f64_column(at, 9, count)?; - let directed = r.bit_column(at, 10, count)?; + let f4 = r.f64_column(at, 9, count)?; + let f5 = r.bit_column(at, 10, count)?; let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - id: id.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - from: from.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - to: to.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - label: label.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - weight: weight.get(i).copied().unwrap_or_default(), - directed: directed.get(i).copied().unwrap_or_default(), + id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + from: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + to: f2.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + label: f3.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + weight: f4.get(i).copied().unwrap_or_default(), + directed: f5.get(i).copied().unwrap_or_default(), }); } Ok(rows) @@ -526,17 +526,17 @@ impl tdbin::Struct for BenchStyle { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let selector = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let fill = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - let stroke = r.string(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); - let stroke_width = tdbin::scalar::f64_from(r.scalar(at, 0)?); - let rounded = r.bool_bit(at, 1, 0)?; + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + let f2 = r.string(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); + let f3 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f4 = r.bool_bit(at, 1, 0)?; Ok(Self { - selector, - fill, - stroke, - stroke_width, - rounded, + selector: f0, + fill: f1, + stroke: f2, + stroke_width: f3, + rounded: f4, }) } } @@ -588,19 +588,19 @@ impl tdbin::ColumnGroup for BenchStyle { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut selector = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut fill = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); - let mut stroke = r.var_column(at, 4, 5, count)?.into_strings()?.into_iter(); - let stroke_width = r.f64_column(at, 6, count)?; - let rounded = r.bit_column(at, 7, count)?; + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); + let mut f2 = r.var_column(at, 4, 5, count)?.into_strings()?.into_iter(); + let f3 = r.f64_column(at, 6, count)?; + let f4 = r.bit_column(at, 7, count)?; let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - selector: selector.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - fill: fill.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - stroke: stroke.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - stroke_width: stroke_width.get(i).copied().unwrap_or_default(), - rounded: rounded.get(i).copied().unwrap_or_default(), + selector: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + fill: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + stroke: f2.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + stroke_width: f3.get(i).copied().unwrap_or_default(), + rounded: f4.get(i).copied().unwrap_or_default(), }); } Ok(rows) @@ -619,9 +619,9 @@ impl tdbin::Struct for BenchMeta { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let key = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let value = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - Ok(Self { key, value }) + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + Ok(Self { key: f0, value: f1 }) } } @@ -662,13 +662,13 @@ impl tdbin::ColumnGroup for BenchMeta { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut key = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut value = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); let mut rows = Vec::with_capacity(count); for _ in 0..count { rows.push(Self { - key: key.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - value: value.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + key: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + value: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, }); } Ok(rows) @@ -776,7 +776,7 @@ impl tdbin::ColumnGroup for BenchEvent { Self::Heartbeat => 5_u8, }), )?; - let node_created: Vec<&BenchNodeCreated> = items + let v0: Vec<&BenchNodeCreated> = items .clone() .filter_map(|row| match row { Self::NodeCreated(payload) => Some(payload), @@ -787,8 +787,8 @@ impl tdbin::ColumnGroup for BenchEvent { | Self::Heartbeat => None, }) .collect(); - w.dense_group(at, 1, 1, node_created.len(), node_created.iter().copied())?; - let node_moved: Vec<&BenchNodeMoved> = items + w.dense_group(at, 1, 1, v0.len(), v0.iter().copied())?; + let v1: Vec<&BenchNodeMoved> = items .clone() .filter_map(|row| match row { Self::NodeMoved(payload) => Some(payload), @@ -799,8 +799,8 @@ impl tdbin::ColumnGroup for BenchEvent { | Self::Heartbeat => None, }) .collect(); - w.dense_group(at, 1, 2, node_moved.len(), node_moved.iter().copied())?; - let edge_added: Vec<&BenchEdgeAdded> = items + w.dense_group(at, 1, 2, v1.len(), v1.iter().copied())?; + let v2: Vec<&BenchEdgeAdded> = items .clone() .filter_map(|row| match row { Self::EdgeAdded(payload) => Some(payload), @@ -811,8 +811,8 @@ impl tdbin::ColumnGroup for BenchEvent { | Self::Heartbeat => None, }) .collect(); - w.dense_group(at, 1, 3, edge_added.len(), edge_added.iter().copied())?; - let selection_changed: Vec<&BenchSelectionChanged> = items + w.dense_group(at, 1, 3, v2.len(), v2.iter().copied())?; + let v3: Vec<&BenchSelectionChanged> = items .clone() .filter_map(|row| match row { Self::SelectionChanged(payload) => Some(payload), @@ -823,14 +823,8 @@ impl tdbin::ColumnGroup for BenchEvent { | Self::Heartbeat => None, }) .collect(); - w.dense_group( - at, - 1, - 4, - selection_changed.len(), - selection_changed.iter().copied(), - )?; - let view_changed: Vec<&BenchViewChanged> = items + w.dense_group(at, 1, 4, v3.len(), v3.iter().copied())?; + let v4: Vec<&BenchViewChanged> = items .clone() .filter_map(|row| match row { Self::ViewChanged(payload) => Some(payload), @@ -841,7 +835,7 @@ impl tdbin::ColumnGroup for BenchEvent { | Self::Heartbeat => None, }) .collect(); - w.dense_group(at, 1, 5, view_changed.len(), view_changed.iter().copied())?; + w.dense_group(at, 1, 5, v4.len(), v4.iter().copied())?; Ok(()) } @@ -851,54 +845,34 @@ impl tdbin::ColumnGroup for BenchEvent { count: usize, ) -> Result, tdbin::DecodeError> { let tags = r.byte_column(at, 0, count)?; - let node_created_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::(); - let mut node_created = r - .dense_group::(at, 1, node_created_count)? + let v0_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::(); + let mut v0 = r + .dense_group::(at, 1, v0_count)? .into_iter(); - let node_moved_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::(); - let mut node_moved = r - .dense_group::(at, 2, node_moved_count)? + let v1_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::(); + let mut v1 = r + .dense_group::(at, 2, v1_count)? .into_iter(); - let edge_added_count = tags.iter().map(|tag| usize::from(*tag == 2)).sum::(); - let mut edge_added = r - .dense_group::(at, 3, edge_added_count)? + let v2_count = tags.iter().map(|tag| usize::from(*tag == 2)).sum::(); + let mut v2 = r + .dense_group::(at, 3, v2_count)? .into_iter(); - let selection_changed_count = tags.iter().map(|tag| usize::from(*tag == 3)).sum::(); - let mut selection_changed = r - .dense_group::(at, 4, selection_changed_count)? + let v3_count = tags.iter().map(|tag| usize::from(*tag == 3)).sum::(); + let mut v3 = r + .dense_group::(at, 4, v3_count)? .into_iter(); - let view_changed_count = tags.iter().map(|tag| usize::from(*tag == 4)).sum::(); - let mut view_changed = r - .dense_group::(at, 5, view_changed_count)? + let v4_count = tags.iter().map(|tag| usize::from(*tag == 4)).sum::(); + let mut v4 = r + .dense_group::(at, 5, v4_count)? .into_iter(); let mut rows = Vec::with_capacity(count); for tag in tags { rows.push(match tag { - 0 => Self::NodeCreated( - node_created - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - ), - 1 => Self::NodeMoved( - node_moved - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - ), - 2 => Self::EdgeAdded( - edge_added - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - ), - 3 => Self::SelectionChanged( - selection_changed - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - ), - 4 => Self::ViewChanged( - view_changed - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - ), + 0 => Self::NodeCreated(v0.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 1 => Self::NodeMoved(v1.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 2 => Self::EdgeAdded(v2.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 3 => Self::SelectionChanged(v3.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 4 => Self::ViewChanged(v4.next().ok_or(tdbin::DecodeError::MalformedColumn)?), 5 => Self::Heartbeat, ordinal => { return Err(tdbin::DecodeError::UnknownVariant { @@ -922,10 +896,10 @@ impl tdbin::Struct for BenchEventBatch { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let events = r + let f0 = r .column_list::(at, Self::DATA_WORDS, 0)? .unwrap_or_default(); - Ok(Self { events }) + Ok(Self { events: f0 }) } } @@ -941,11 +915,14 @@ impl tdbin::Struct for BenchNodeCreated { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let document_id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let node = r + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r .child::(at, Self::DATA_WORDS, 1)? .unwrap_or_default(); - Ok(Self { document_id, node }) + Ok(Self { + document_id: f0, + node: f1, + }) } } @@ -979,15 +956,13 @@ impl tdbin::ColumnGroup for BenchNodeCreated { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut document_id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut node = r.dense_group::(at, 2, count)?.into_iter(); + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.dense_group::(at, 2, count)?.into_iter(); let mut rows = Vec::with_capacity(count); for _ in 0..count { rows.push(Self { - document_id: document_id - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - node: node.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + document_id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + node: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, }); } Ok(rows) @@ -1008,15 +983,15 @@ impl tdbin::Struct for BenchNodeMoved { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let document_id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let node_id = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - let x = tdbin::scalar::f64_from(r.scalar(at, 0)?); - let y = tdbin::scalar::f64_from(r.scalar(at, 1)?); + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.string(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + let f2 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f3 = tdbin::scalar::f64_from(r.scalar(at, 1)?); Ok(Self { - document_id, - node_id, - x, - y, + document_id: f0, + node_id: f1, + x: f2, + y: f3, }) } } @@ -1060,19 +1035,17 @@ impl tdbin::ColumnGroup for BenchNodeMoved { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut document_id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut node_id = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); - let x = r.f64_column(at, 4, count)?; - let y = r.f64_column(at, 5, count)?; + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.var_column(at, 2, 3, count)?.into_strings()?.into_iter(); + let f2 = r.f64_column(at, 4, count)?; + let f3 = r.f64_column(at, 5, count)?; let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - document_id: document_id - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - node_id: node_id.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - x: x.get(i).copied().unwrap_or_default(), - y: y.get(i).copied().unwrap_or_default(), + document_id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + node_id: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + x: f2.get(i).copied().unwrap_or_default(), + y: f3.get(i).copied().unwrap_or_default(), }); } Ok(rows) @@ -1091,11 +1064,14 @@ impl tdbin::Struct for BenchEdgeAdded { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let document_id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let edge = r + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r .child::(at, Self::DATA_WORDS, 1)? .unwrap_or_default(); - Ok(Self { document_id, edge }) + Ok(Self { + document_id: f0, + edge: f1, + }) } } @@ -1129,15 +1105,13 @@ impl tdbin::ColumnGroup for BenchEdgeAdded { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut document_id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let mut edge = r.dense_group::(at, 2, count)?.into_iter(); + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let mut f1 = r.dense_group::(at, 2, count)?.into_iter(); let mut rows = Vec::with_capacity(count); for _ in 0..count { rows.push(Self { - document_id: document_id - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - edge: edge.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + document_id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + edge: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, }); } Ok(rows) @@ -1157,19 +1131,19 @@ impl tdbin::Struct for BenchSelectionChanged { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let document_id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let node_ids = match r.var_list(at, Self::DATA_WORDS, 1, 2)? { + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = match r.var_list(at, Self::DATA_WORDS, 1, 2)? { Some(column) => column.into_strings()?, None => Vec::new(), }; - let edge_ids = match r.var_list(at, Self::DATA_WORDS, 3, 4)? { + let f2 = match r.var_list(at, Self::DATA_WORDS, 3, 4)? { Some(column) => column.into_strings()?, None => Vec::new(), }; Ok(Self { - document_id, - node_ids, - edge_ids, + document_id: f0, + node_ids: f1, + edge_ids: f2, }) } } @@ -1247,34 +1221,32 @@ impl tdbin::ColumnGroup for BenchSelectionChanged { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut document_id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let node_ids_counts = r.len_column(at, 2, count)?; - let node_ids_total = tdbin::column_total(&node_ids_counts)?; - let mut node_ids = r - .var_column(at, 3, 4, node_ids_total)? + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let f1_counts = r.len_column(at, 2, count)?; + let f1_total = tdbin::column_total(&f1_counts)?; + let mut f1 = r + .var_column(at, 3, 4, f1_total)? .into_strings()? .into_iter(); - let edge_ids_counts = r.len_column(at, 5, count)?; - let edge_ids_total = tdbin::column_total(&edge_ids_counts)?; - let mut edge_ids = r - .var_column(at, 6, 7, edge_ids_total)? + let f2_counts = r.len_column(at, 5, count)?; + let f2_total = tdbin::column_total(&f2_counts)?; + let mut f2 = r + .var_column(at, 6, 7, f2_total)? .into_strings()? .into_iter(); let mut rows = Vec::with_capacity(count); for i in 0..count { - let node_ids_take = usize::try_from(node_ids_counts.get(i).copied().unwrap_or(0)) + let f1_take = usize::try_from(f1_counts.get(i).copied().unwrap_or(0)) .map_err(|_| tdbin::DecodeError::LimitExceeded)?; - let edge_ids_take = usize::try_from(edge_ids_counts.get(i).copied().unwrap_or(0)) + let f2_take = usize::try_from(f2_counts.get(i).copied().unwrap_or(0)) .map_err(|_| tdbin::DecodeError::LimitExceeded)?; rows.push(Self { - document_id: document_id - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - node_ids: (0..node_ids_take) - .map(|_| node_ids.next().ok_or(tdbin::DecodeError::MalformedColumn)) + document_id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + node_ids: (0..f1_take) + .map(|_| f1.next().ok_or(tdbin::DecodeError::MalformedColumn)) .collect::, _>>()?, - edge_ids: (0..edge_ids_take) - .map(|_| edge_ids.next().ok_or(tdbin::DecodeError::MalformedColumn)) + edge_ids: (0..f2_take) + .map(|_| f2.next().ok_or(tdbin::DecodeError::MalformedColumn)) .collect::, _>>()?, }); } @@ -1296,15 +1268,15 @@ impl tdbin::Struct for BenchViewChanged { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let document_id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let zoom = tdbin::scalar::f64_from(r.scalar(at, 0)?); - let offset_x = tdbin::scalar::f64_from(r.scalar(at, 1)?); - let offset_y = tdbin::scalar::f64_from(r.scalar(at, 2)?); + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f2 = tdbin::scalar::f64_from(r.scalar(at, 1)?); + let f3 = tdbin::scalar::f64_from(r.scalar(at, 2)?); Ok(Self { - document_id, - zoom, - offset_x, - offset_y, + document_id: f0, + zoom: f1, + offset_x: f2, + offset_y: f3, }) } } @@ -1341,19 +1313,17 @@ impl tdbin::ColumnGroup for BenchViewChanged { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut document_id = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let zoom = r.f64_column(at, 2, count)?; - let offset_x = r.f64_column(at, 3, count)?; - let offset_y = r.f64_column(at, 4, count)?; + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let f1 = r.f64_column(at, 2, count)?; + let f2 = r.f64_column(at, 3, count)?; + let f3 = r.f64_column(at, 4, count)?; let mut rows = Vec::with_capacity(count); for i in 0..count { rows.push(Self { - document_id: document_id - .next() - .ok_or(tdbin::DecodeError::MalformedColumn)?, - zoom: zoom.get(i).copied().unwrap_or_default(), - offset_x: offset_x.get(i).copied().unwrap_or_default(), - offset_y: offset_y.get(i).copied().unwrap_or_default(), + document_id: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + zoom: f1.get(i).copied().unwrap_or_default(), + offset_x: f2.get(i).copied().unwrap_or_default(), + offset_y: f3.get(i).copied().unwrap_or_default(), }); } Ok(rows) @@ -1377,28 +1347,28 @@ impl tdbin::Struct for BenchMetricBatch { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let batch_id = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let started_at_epoch_ms = tdbin::scalar::i64_from(r.scalar(at, 0)?); - let sample_ids = r + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f2 = r .i64_block_list(at, Self::DATA_WORDS, 1)? .unwrap_or_default(); - let valid = r.bool_list(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); - let latency_ms = r.f64_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default(); - let payloads = match r.var_list(at, Self::DATA_WORDS, 4, 5)? { + let f3 = r.bool_list(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); + let f4 = r.f64_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default(); + let f5 = match r.var_list(at, Self::DATA_WORDS, 4, 5)? { Some(column) => column.into_byte_vecs()?, None => Vec::new(), }; - let columns = r + let f6 = r .column_list::(at, Self::DATA_WORDS, 6)? .unwrap_or_default(); Ok(Self { - batch_id, - started_at_epoch_ms, - sample_ids, - valid, - latency_ms, - payloads, - columns, + batch_id: f0, + started_at_epoch_ms: f1, + sample_ids: f2, + valid: f3, + latency_ms: f4, + payloads: f5, + columns: f6, }) } } @@ -1415,9 +1385,12 @@ impl tdbin::Struct for BenchMetricColumn { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let name = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let values = r.f64_list(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); - Ok(Self { name, values }) + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.f64_list(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + Ok(Self { + name: f0, + values: f1, + }) } } @@ -1468,18 +1441,18 @@ impl tdbin::ColumnGroup for BenchMetricColumn { at: usize, count: usize, ) -> Result, tdbin::DecodeError> { - let mut name = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); - let values_counts = r.len_column(at, 2, count)?; - let values_total = tdbin::column_total(&values_counts)?; - let mut values = r.f64_column(at, 3, values_total)?.into_iter(); + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let f1_counts = r.len_column(at, 2, count)?; + let f1_total = tdbin::column_total(&f1_counts)?; + let mut f1 = r.f64_column(at, 3, f1_total)?.into_iter(); let mut rows = Vec::with_capacity(count); for i in 0..count { - let values_take = usize::try_from(values_counts.get(i).copied().unwrap_or(0)) + let f1_take = usize::try_from(f1_counts.get(i).copied().unwrap_or(0)) .map_err(|_| tdbin::DecodeError::LimitExceeded)?; rows.push(Self { - name: name.next().ok_or(tdbin::DecodeError::MalformedColumn)?, - values: (0..values_take) - .map(|_| values.next().ok_or(tdbin::DecodeError::MalformedColumn)) + name: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + values: (0..f1_take) + .map(|_| f1.next().ok_or(tdbin::DecodeError::MalformedColumn)) .collect::, _>>()?, }); } diff --git a/src/tdbin/tests/generated_names/mod.rs b/src/tdbin/tests/generated_names/mod.rs new file mode 100644 index 0000000..b93180c --- /dev/null +++ b/src/tdbin/tests/generated_names/mod.rs @@ -0,0 +1,562 @@ +//! [TDBIN-CODEGEN-LOCALS] GENERATED name-collision fixture: fields and +//! variants named after the codec's own identifiers (`w`, `r`, `at`, +//! `count`, `items`, `rows`, `i`, `tags`, …), emitted by +//! `src/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`, +//! layout 2) from `src/typediagram/test/converters/fixtures/names.td`. +//! Compiling and round-tripping it under `cargo test` proves no shadowing. +//! Regenerate with `node src/scripts/tdbin/tdbin-regen-fixtures.mjs`. + +// <<>> +/// The `Inner` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct Inner { + /// The `at` field. + pub at: i64, + /// The `r` field. + pub r: String, +} + +/// The `Pick` union. +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +pub enum Pick { + /// The `W` variant. + W(Inner), + /// The `Items` variant. + Items(Inner), + /// The `Tags` variant. + Tags, + /// The `Count` variant. + Count(Inner), +} + +/// The `Names` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct Names { + /// The `value` field. + pub value: String, + /// The `writer` field. + pub writer: i64, + /// The `reader` field. + pub reader: i64, + /// The `tdbin` field. + pub tdbin: i64, + /// The `ok` field. + pub ok: bool, + /// The `w` field. + pub w: i64, + /// The `at` field. + pub at: i64, + /// The `r` field. + pub r: i64, + /// The `count` field. + pub count: i64, + /// The `i` field. + pub i: bool, + /// The `items` field. + pub items: Option, + /// The `rows` field. + pub rows: Vec, + /// The `tags` field. + pub tags: Vec, + /// The `x` field. + pub x: Option, + /// The `xPresent` field. + #[serde(rename = "xPresent")] + pub x_present: Option, + /// The `pick` field. + pub pick: Pick, +} + +/// The `NamesBatch` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct NamesBatch { + /// The `names` field. + pub names: Vec, + /// The `picks` field. + pub picks: Vec, +} + +impl tdbin::Struct for Inner { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0x9fed_05a1_1076_a099; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::i64_bits(self.at))?; + w.string(at, Self::DATA_WORDS, 0, Some(&self.r))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f1 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + Ok(Self { at: f0, r: f1 }) + } +} + +impl tdbin::ColumnGroup for Inner { + const COLUMNS: u16 = 3; + + fn write_group<'v, I>( + items: I, + count: usize, + w: &mut tdbin::Writer, + at: usize, + ) -> Result<(), tdbin::EncodeError> + where + I: Iterator + Clone, + Self: 'v, + { + w.i64_block_column(at, 1, 0, count, items.clone().map(|row| row.at))?; + w.var_column( + at, + 1, + 1, + 2, + count, + items.clone().map(|row| row.r.as_bytes()), + )?; + Ok(()) + } + + fn read_group( + r: &tdbin::Reader<'_>, + at: usize, + count: usize, + ) -> Result, tdbin::DecodeError> { + let f0 = r.i64_block_column(at, 0, count)?; + let mut f1 = r.var_column(at, 1, 2, count)?.into_strings()?.into_iter(); + let mut rows = Vec::with_capacity(count); + for i in 0..count { + rows.push(Self { + at: f0.get(i).copied().unwrap_or_default(), + r: f1.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + }); + } + Ok(rows) + } +} + +impl Default for Pick { + fn default() -> Self { + Self::W(Inner::default()) + } +} + +impl tdbin::Struct for Pick { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0x34ca_378b_c921_8786; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + match self { + Self::W(payload) => { + w.scalar(at, 0, 0)?; + w.child(at, Self::DATA_WORDS, 0, Some(payload)) + } + Self::Items(payload) => { + w.scalar(at, 0, 1)?; + w.child(at, Self::DATA_WORDS, 0, Some(payload)) + } + Self::Tags => { + w.scalar(at, 0, 2)?; + Ok(()) + } + Self::Count(payload) => { + w.scalar(at, 0, 3)?; + w.child(at, Self::DATA_WORDS, 0, Some(payload)) + } + } + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + match r.scalar(at, 0)? { + 0 => Ok(Self::W( + r.child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(), + )), + 1 => Ok(Self::Items( + r.child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(), + )), + 2 => { + r.require_null_pointer(at, 0)?; + Ok(Self::Tags) + } + 3 => Ok(Self::Count( + r.child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(), + )), + ordinal => { + r.verify_struct_slots(at)?; + Err(tdbin::DecodeError::UnknownVariant { ordinal }) + } + } + } +} + +impl tdbin::ColumnGroup for Pick { + const COLUMNS: u16 = 4; + + fn write_group<'v, I>( + items: I, + count: usize, + w: &mut tdbin::Writer, + at: usize, + ) -> Result<(), tdbin::EncodeError> + where + I: Iterator + Clone, + Self: 'v, + { + w.byte_column( + at, + 1, + 0, + count, + items.clone().map(|row| match row { + Self::W(_) => 0_u8, + Self::Items(_) => 1_u8, + Self::Tags => 2_u8, + Self::Count(_) => 3_u8, + }), + )?; + let v0: Vec<&Inner> = items + .clone() + .filter_map(|row| match row { + Self::W(payload) => Some(payload), + Self::Items(_) | Self::Tags | Self::Count(_) => None, + }) + .collect(); + w.dense_group(at, 1, 1, v0.len(), v0.iter().copied())?; + let v1: Vec<&Inner> = items + .clone() + .filter_map(|row| match row { + Self::Items(payload) => Some(payload), + Self::W(_) | Self::Tags | Self::Count(_) => None, + }) + .collect(); + w.dense_group(at, 1, 2, v1.len(), v1.iter().copied())?; + let v3: Vec<&Inner> = items + .clone() + .filter_map(|row| match row { + Self::Count(payload) => Some(payload), + Self::W(_) | Self::Items(_) | Self::Tags => None, + }) + .collect(); + w.dense_group(at, 1, 3, v3.len(), v3.iter().copied())?; + Ok(()) + } + + fn read_group( + r: &tdbin::Reader<'_>, + at: usize, + count: usize, + ) -> Result, tdbin::DecodeError> { + let tags = r.byte_column(at, 0, count)?; + let v0_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::(); + let mut v0 = r.dense_group::(at, 1, v0_count)?.into_iter(); + let v1_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::(); + let mut v1 = r.dense_group::(at, 2, v1_count)?.into_iter(); + let v3_count = tags.iter().map(|tag| usize::from(*tag == 3)).sum::(); + let mut v3 = r.dense_group::(at, 3, v3_count)?.into_iter(); + let mut rows = Vec::with_capacity(count); + for tag in tags { + rows.push(match tag { + 0 => Self::W(v0.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 1 => Self::Items(v1.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + 2 => Self::Tags, + 3 => Self::Count(v3.next().ok_or(tdbin::DecodeError::MalformedColumn)?), + ordinal => { + return Err(tdbin::DecodeError::UnknownVariant { + ordinal: u64::from(ordinal), + }); + } + }); + } + Ok(rows) + } +} + +impl tdbin::Struct for Names { + const DATA_WORDS: u16 = 10; + const PTR_WORDS: u16 = 6; + const LAYOUT_HASH: u64 = 0xab27_d651_ddfe_54a4; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.string(at, Self::DATA_WORDS, 0, Some(&self.value))?; + w.scalar(at, 0, tdbin::scalar::i64_bits(self.writer))?; + w.scalar(at, 1, tdbin::scalar::i64_bits(self.reader))?; + w.scalar(at, 2, tdbin::scalar::i64_bits(self.tdbin))?; + w.bool_bit(at, 3, 0, self.ok)?; + w.scalar(at, 4, tdbin::scalar::i64_bits(self.w))?; + w.scalar(at, 5, tdbin::scalar::i64_bits(self.at))?; + w.scalar(at, 6, tdbin::scalar::i64_bits(self.r))?; + w.scalar(at, 7, tdbin::scalar::i64_bits(self.count))?; + w.bool_bit(at, 3, 1, self.i)?; + w.child(at, Self::DATA_WORDS, 1, self.items.as_ref())?; + w.column_list(at, Self::DATA_WORDS, 2, Some(&self.rows))?; + w.string_var_list(at, Self::DATA_WORDS, 3, 4, Some(&self.tags))?; + w.bool_bit(at, 3, 2, self.x.is_some())?; + w.scalar(at, 8, self.x.map_or(0, tdbin::scalar::i64_bits))?; + w.bool_bit(at, 3, 3, self.x_present.is_some())?; + w.scalar(at, 9, self.x_present.map_or(0, tdbin::scalar::i64_bits))?; + w.child(at, Self::DATA_WORDS, 5, Some(&self.pick))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f2 = tdbin::scalar::i64_from(r.scalar(at, 1)?); + let f3 = tdbin::scalar::i64_from(r.scalar(at, 2)?); + let f4 = r.bool_bit(at, 3, 0)?; + let f5 = tdbin::scalar::i64_from(r.scalar(at, 4)?); + let f6 = tdbin::scalar::i64_from(r.scalar(at, 5)?); + let f7 = tdbin::scalar::i64_from(r.scalar(at, 6)?); + let f8 = tdbin::scalar::i64_from(r.scalar(at, 7)?); + let f9 = r.bool_bit(at, 3, 1)?; + let f10 = r.child::(at, Self::DATA_WORDS, 1)?; + let f11 = r + .column_list::(at, Self::DATA_WORDS, 2)? + .unwrap_or_default(); + let f12 = match r.var_list(at, Self::DATA_WORDS, 3, 4)? { + Some(column) => column.into_strings()?, + None => Vec::new(), + }; + let f13_present = r.bool_bit(at, 3, 2)?; + let f13_value = tdbin::scalar::i64_from(r.scalar(at, 8)?); + let f13 = f13_present.then_some(f13_value); + let f14_present = r.bool_bit(at, 3, 3)?; + let f14_value = tdbin::scalar::i64_from(r.scalar(at, 9)?); + let f14 = f14_present.then_some(f14_value); + let f15 = r + .child::(at, Self::DATA_WORDS, 5)? + .unwrap_or_default(); + Ok(Self { + value: f0, + writer: f1, + reader: f2, + tdbin: f3, + ok: f4, + w: f5, + at: f6, + r: f7, + count: f8, + i: f9, + items: f10, + rows: f11, + tags: f12, + x: f13, + x_present: f14, + pick: f15, + }) + } +} + +impl tdbin::ColumnGroup for Names { + const COLUMNS: u16 = 23; + + fn write_group<'v, I>( + items: I, + count: usize, + w: &mut tdbin::Writer, + at: usize, + ) -> Result<(), tdbin::EncodeError> + where + I: Iterator + Clone, + Self: 'v, + { + w.var_column( + at, + 1, + 0, + 1, + count, + items.clone().map(|row| row.value.as_bytes()), + )?; + w.i64_block_column(at, 1, 2, count, items.clone().map(|row| row.writer))?; + w.i64_block_column(at, 1, 3, count, items.clone().map(|row| row.reader))?; + w.i64_block_column(at, 1, 4, count, items.clone().map(|row| row.tdbin))?; + w.bit_column(at, 1, 5, count, items.clone().map(|row| row.ok))?; + w.i64_block_column(at, 1, 6, count, items.clone().map(|row| row.w))?; + w.i64_block_column(at, 1, 7, count, items.clone().map(|row| row.at))?; + w.i64_block_column(at, 1, 8, count, items.clone().map(|row| row.r))?; + w.i64_block_column(at, 1, 9, count, items.clone().map(|row| row.count))?; + w.bit_column(at, 1, 10, count, items.clone().map(|row| row.i))?; + w.bit_column( + at, + 1, + 11, + count, + items.clone().map(|row| row.items.is_some()), + )?; + let items_some: Vec<&Inner> = items.clone().filter_map(|row| row.items.as_ref()).collect(); + w.dense_group(at, 1, 12, items_some.len(), items_some.iter().copied())?; + let rows_counts = items + .clone() + .map(|row| u32::try_from(row.rows.len())) + .collect::, _>>() + .map_err(|_| tdbin::EncodeError::LimitExceeded)?; + w.len_column(at, 1, 13, &rows_counts)?; + let rows_total = items + .clone() + .map(|row| row.rows.len()) + .try_fold(0_usize, usize::checked_add) + .ok_or(tdbin::EncodeError::LimitExceeded)?; + w.dense_group( + at, + 1, + 14, + rows_total, + items.clone().flat_map(|row| row.rows.iter()), + )?; + let tags_counts = items + .clone() + .map(|row| u32::try_from(row.tags.len())) + .collect::, _>>() + .map_err(|_| tdbin::EncodeError::LimitExceeded)?; + w.len_column(at, 1, 15, &tags_counts)?; + let tags_total = items + .clone() + .map(|row| row.tags.len()) + .try_fold(0_usize, usize::checked_add) + .ok_or(tdbin::EncodeError::LimitExceeded)?; + w.var_column( + at, + 1, + 16, + 17, + tags_total, + items + .clone() + .flat_map(|row| row.tags.iter()) + .map(String::as_bytes), + )?; + w.bit_column(at, 1, 18, count, items.clone().map(|row| row.x.is_some()))?; + w.i64_column( + at, + 1, + 19, + count, + items.clone().map(|row| row.x.unwrap_or_default()), + )?; + w.bit_column( + at, + 1, + 20, + count, + items.clone().map(|row| row.x_present.is_some()), + )?; + w.i64_column( + at, + 1, + 21, + count, + items.clone().map(|row| row.x_present.unwrap_or_default()), + )?; + w.dense_group(at, 1, 22, count, items.clone().map(|row| &row.pick))?; + Ok(()) + } + + fn read_group( + r: &tdbin::Reader<'_>, + at: usize, + count: usize, + ) -> Result, tdbin::DecodeError> { + let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter(); + let f1 = r.i64_block_column(at, 2, count)?; + let f2 = r.i64_block_column(at, 3, count)?; + let f3 = r.i64_block_column(at, 4, count)?; + let f4 = r.bit_column(at, 5, count)?; + let f5 = r.i64_block_column(at, 6, count)?; + let f6 = r.i64_block_column(at, 7, count)?; + let f7 = r.i64_block_column(at, 8, count)?; + let f8 = r.i64_block_column(at, 9, count)?; + let f9 = r.bit_column(at, 10, count)?; + let f10_valid = r.bit_column(at, 11, count)?; + let f10_count = f10_valid.iter().filter(|present| **present).count(); + let mut f10 = r.dense_group::(at, 12, f10_count)?.into_iter(); + let f11_counts = r.len_column(at, 13, count)?; + let f11_total = tdbin::column_total(&f11_counts)?; + let mut f11 = r.dense_group::(at, 14, f11_total)?.into_iter(); + let f12_counts = r.len_column(at, 15, count)?; + let f12_total = tdbin::column_total(&f12_counts)?; + let mut f12 = r + .var_column(at, 16, 17, f12_total)? + .into_strings()? + .into_iter(); + let f13_valid = r.bit_column(at, 18, count)?; + let f13_values = r.i64_column(at, 19, count)?; + let mut f13 = f13_valid + .into_iter() + .zip(f13_values) + .map(|(valid, value)| valid.then_some(value)); + let f14_valid = r.bit_column(at, 20, count)?; + let f14_values = r.i64_column(at, 21, count)?; + let mut f14 = f14_valid + .into_iter() + .zip(f14_values) + .map(|(valid, value)| valid.then_some(value)); + let mut f15 = r.dense_group::(at, 22, count)?.into_iter(); + let mut rows = Vec::with_capacity(count); + for i in 0..count { + let f11_take = usize::try_from(f11_counts.get(i).copied().unwrap_or(0)) + .map_err(|_| tdbin::DecodeError::LimitExceeded)?; + let f12_take = usize::try_from(f12_counts.get(i).copied().unwrap_or(0)) + .map_err(|_| tdbin::DecodeError::LimitExceeded)?; + rows.push(Self { + value: f0.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + writer: f1.get(i).copied().unwrap_or_default(), + reader: f2.get(i).copied().unwrap_or_default(), + tdbin: f3.get(i).copied().unwrap_or_default(), + ok: f4.get(i).copied().unwrap_or_default(), + w: f5.get(i).copied().unwrap_or_default(), + at: f6.get(i).copied().unwrap_or_default(), + r: f7.get(i).copied().unwrap_or_default(), + count: f8.get(i).copied().unwrap_or_default(), + i: f9.get(i).copied().unwrap_or_default(), + items: f10_valid + .get(i) + .copied() + .unwrap_or_default() + .then(|| f10.next().ok_or(tdbin::DecodeError::MalformedColumn)) + .transpose()?, + rows: (0..f11_take) + .map(|_| f11.next().ok_or(tdbin::DecodeError::MalformedColumn)) + .collect::, _>>()?, + tags: (0..f12_take) + .map(|_| f12.next().ok_or(tdbin::DecodeError::MalformedColumn)) + .collect::, _>>()?, + x: f13.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + x_present: f14.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + pick: f15.next().ok_or(tdbin::DecodeError::MalformedColumn)?, + }); + } + Ok(rows) + } +} + +impl tdbin::Struct for NamesBatch { + const DATA_WORDS: u16 = 0; + const PTR_WORDS: u16 = 2; + const LAYOUT_HASH: u64 = 0xea6e_8824_8f17_2da7; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.column_list(at, Self::DATA_WORDS, 0, Some(&self.names))?; + w.column_list(at, Self::DATA_WORDS, 1, Some(&self.picks))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = r + .column_list::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(); + let f1 = r + .column_list::(at, Self::DATA_WORDS, 1)? + .unwrap_or_default(); + Ok(Self { + names: f0, + picks: f1, + }) + } +} diff --git a/crates/tdbin/tests/generated_opt/mod.rs b/src/tdbin/tests/generated_opt/mod.rs similarity index 63% rename from crates/tdbin/tests/generated_opt/mod.rs rename to src/tdbin/tests/generated_opt/mod.rs index 5baba8e..98596c2 100644 --- a/crates/tdbin/tests/generated_opt/mod.rs +++ b/src/tdbin/tests/generated_opt/mod.rs @@ -1,10 +1,10 @@ //! [TDBIN-PRIM-OPTION] GENERATED `Option` fixture (1-bit presence //! flags in the shared bool bitset + natural-width value slots), emitted by -//! `packages/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`) -//! from `packages/typediagram/test/converters/fixtures/measurement.td`. +//! `src/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`) +//! from `src/typediagram/test/converters/fixtures/measurement.td`. //! Included only by `roundtrip.rs`; kept separate from the shared Person //! fixture so the framing/golden test binaries do not carry an unused type -//! (`-D dead-code`). Regenerate with `node scripts/tdbin-regen-fixtures.mjs` +//! (`-D dead-code`). Regenerate with `node src/scripts/tdbin/tdbin-regen-fixtures.mjs` //! rather than hand-editing. // <<>> @@ -38,21 +38,21 @@ impl tdbin::Struct for Measurement { } fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { - let label = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); - let count_present = r.bool_bit(at, 0, 0)?; - let count_value = tdbin::scalar::i64_from(r.scalar(at, 1)?); - let count = count_present.then_some(count_value); - let flagged_present = r.bool_bit(at, 0, 1)?; - let flagged_value = r.bool_bit(at, 0, 2)?; - let flagged = flagged_present.then_some(flagged_value); - let ratio_present = r.bool_bit(at, 0, 3)?; - let ratio_value = tdbin::scalar::f64_from(r.scalar(at, 2)?); - let ratio = ratio_present.then_some(ratio_value); + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1_present = r.bool_bit(at, 0, 0)?; + let f1_value = tdbin::scalar::i64_from(r.scalar(at, 1)?); + let f1 = f1_present.then_some(f1_value); + let f2_present = r.bool_bit(at, 0, 1)?; + let f2_value = r.bool_bit(at, 0, 2)?; + let f2 = f2_present.then_some(f2_value); + let f3_present = r.bool_bit(at, 0, 3)?; + let f3_value = tdbin::scalar::f64_from(r.scalar(at, 2)?); + let f3 = f3_present.then_some(f3_value); Ok(Self { - label, - count, - flagged, - ratio, + label: f0, + count: f1, + flagged: f2, + ratio: f3, }) } } diff --git a/src/tdbin/tests/generated_reports/mod.rs b/src/tdbin/tests/generated_reports/mod.rs new file mode 100644 index 0000000..bf9aa91 --- /dev/null +++ b/src/tdbin/tests/generated_reports/mod.rs @@ -0,0 +1,204 @@ +//! [TDBIN-TS-LIST] GENERATED list-form fixture, emitted by +//! `src/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`) +//! from `src/typediagram/test/converters/fixtures/reports.td`. Included +//! only by `cross_lang.rs`, which pins the Rust bytes the TypeScript codec +//! must reproduce. Regenerate with `node src/scripts/tdbin/tdbin-regen-fixtures.mjs`. + +// <<>> +/// The `Level` union. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub enum Level { + /// The `Low` variant. + #[default] + Low, + /// The `High` variant. + High, +} + +/// The `Tag` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct Tag { + /// The `key` field. + pub key: String, + /// The `weight` field. + pub weight: f64, +} + +/// The `Report` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct Report { + /// The `flags` field. + pub flags: Vec, + /// The `counts` field. + pub counts: Vec, + /// The `ratios` field. + pub ratios: Vec, + /// The `names` field. + pub names: Vec, + /// The `blobs` field. + pub blobs: Vec>, + /// The `tags` field. + pub tags: Vec, + /// The `levels` field. + pub levels: Vec, + /// The `maybeCounts` field. + #[serde(rename = "maybeCounts")] + pub maybe_counts: Option>, + /// The `maybeTags` field. + #[serde(rename = "maybeTags")] + pub maybe_tags: Option>, + /// The `maybeLevels` field. + #[serde(rename = "maybeLevels")] + pub maybe_levels: Option>, + /// The `title` field. + pub title: String, +} + +impl tdbin::Struct for Level { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 0; + const LAYOUT_HASH: u64 = 0x582c_4ff8_0720_682e; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + match self { + Self::Low => { + w.scalar(at, 0, 0)?; + Ok(()) + } + Self::High => { + w.scalar(at, 0, 1)?; + Ok(()) + } + } + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + match r.scalar(at, 0)? { + 0 => { + r.require_null_pointer(at, 0)?; + Ok(Self::Low) + } + 1 => { + r.require_null_pointer(at, 0)?; + Ok(Self::High) + } + ordinal => { + r.verify_struct_slots(at)?; + Err(tdbin::DecodeError::UnknownVariant { ordinal }) + } + } + } +} + +impl tdbin::Struct for Tag { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0x2916_dedf_9e69_bc95; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.string(at, Self::DATA_WORDS, 0, Some(&self.key))?; + w.scalar(at, 0, tdbin::scalar::f64_bits(self.weight))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + Ok(Self { + key: f0, + weight: f1, + }) + } +} + +impl tdbin::Struct for Report { + const DATA_WORDS: u16 = 0; + const PTR_WORDS: u16 = 11; + const LAYOUT_HASH: u64 = 0xd392_610f_b8ba_9cb7; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.bool_list(at, Self::DATA_WORDS, 0, Some(&self.flags))?; + w.i64_list(at, Self::DATA_WORDS, 1, Some(&self.counts))?; + w.f64_list(at, Self::DATA_WORDS, 2, Some(&self.ratios))?; + w.string_list(at, Self::DATA_WORDS, 3, Some(&self.names))?; + w.bytes_list(at, Self::DATA_WORDS, 4, Some(&self.blobs))?; + w.child_list(at, Self::DATA_WORDS, 5, Some(&self.tags))?; + let levels_ordinals = self + .levels + .iter() + .map(|value| match value { + Level::Low => 0u8, + Level::High => 1u8, + }) + .collect::>(); + w.byte_list(at, Self::DATA_WORDS, 6, Some(&levels_ordinals))?; + w.i64_list(at, Self::DATA_WORDS, 7, self.maybe_counts.as_deref())?; + w.child_list(at, Self::DATA_WORDS, 8, self.maybe_tags.as_deref())?; + let maybe_levels_ordinals = self.maybe_levels.as_ref().map(|values| { + values + .iter() + .map(|value| match value { + Level::Low => 0u8, + Level::High => 1u8, + }) + .collect::>() + }); + w.byte_list(at, Self::DATA_WORDS, 9, maybe_levels_ordinals.as_deref())?; + w.string(at, Self::DATA_WORDS, 10, Some(&self.title))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = r.bool_list(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r.i64_list(at, Self::DATA_WORDS, 1)?.unwrap_or_default(); + let f2 = r.f64_list(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); + let f3 = r.string_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default(); + let f4 = r.bytes_list(at, Self::DATA_WORDS, 4)?.unwrap_or_default(); + let f5 = r + .child_list::(at, Self::DATA_WORDS, 5)? + .unwrap_or_default(); + let f6 = r + .byte_list(at, Self::DATA_WORDS, 6)? + .unwrap_or_default() + .into_iter() + .map(|ordinal| match ordinal { + 0 => Ok(Level::Low), + 1 => Ok(Level::High), + ordinal => Err(tdbin::DecodeError::UnknownVariant { + ordinal: u64::from(ordinal), + }), + }) + .collect::, _>>()?; + let f7 = r.i64_list(at, Self::DATA_WORDS, 7)?; + let f8 = r.child_list::(at, Self::DATA_WORDS, 8)?; + let f9 = match r.byte_list(at, Self::DATA_WORDS, 9)? { + Some(values) => Some( + values + .into_iter() + .map(|ordinal| match ordinal { + 0 => Ok(Level::Low), + 1 => Ok(Level::High), + ordinal => Err(tdbin::DecodeError::UnknownVariant { + ordinal: u64::from(ordinal), + }), + }) + .collect::, _>>()?, + ), + None => None, + }; + let f10 = r.string(at, Self::DATA_WORDS, 10)?.unwrap_or_default(); + Ok(Self { + flags: f0, + counts: f1, + ratios: f2, + names: f3, + blobs: f4, + tags: f5, + levels: f6, + maybe_counts: f7, + maybe_tags: f8, + maybe_levels: f9, + title: f10, + }) + } +} diff --git a/src/tdbin/tests/generated_shapes/mod.rs b/src/tdbin/tests/generated_shapes/mod.rs new file mode 100644 index 0000000..f9c3906 --- /dev/null +++ b/src/tdbin/tests/generated_shapes/mod.rs @@ -0,0 +1,297 @@ +//! [TDBIN-UNION-STRUCT] GENERATED struct-form / multi-field tuple union +//! variant fixture (#61), emitted by +//! `src/typediagram/src/converters/rust-tdbin.ts` (`generateRustModule`) +//! from `src/typediagram/test/converters/fixtures/shapes.td`. Included +//! only by `variants.rs`. Regenerate with +//! `node src/scripts/tdbin/tdbin-regen-fixtures.mjs` rather than hand-editing. + +// <<>> +/// The `Point` record. +#[derive(Debug, Clone, PartialEq, Default)] +pub struct Point { + /// The `x` field. + pub x: f64, + /// The `y` field. + pub y: f64, +} + +/// The `Shape` union. +#[derive(Debug, Clone, PartialEq)] +pub enum Shape { + /// The `Circle` variant. + Circle { radius: f64, label: String }, + /// The `Rect` variant. + Rect { w: f64, h: f64, corner: Point }, + /// The `Pair` variant. + Pair(i64, String), + /// The `Tagged` variant. + Tagged(Point), + /// The `Empty` variant. + Empty, +} + +/// The `Canvas` record. +#[derive(Debug, Clone, PartialEq, Default)] +pub struct Canvas { + /// The `name` field. + pub name: String, + /// The `shape` field. + pub shape: Shape, + /// The `backup` field. + pub backup: Option, +} + +/// The `ShapeCircleTdbinPayload` record. +#[derive(Debug, Clone, PartialEq, Default)] +pub struct ShapeCircleTdbinPayload { + /// The `radius` field. + pub radius: f64, + /// The `label` field. + pub label: String, +} + +/// The `ShapeRectTdbinPayload` record. +#[derive(Debug, Clone, PartialEq, Default)] +pub struct ShapeRectTdbinPayload { + /// The `w` field. + pub w: f64, + /// The `h` field. + pub h: f64, + /// The `corner` field. + pub corner: Point, +} + +/// The `ShapePairTdbinPayload` record. +#[derive(Debug, Clone, PartialEq, Default)] +pub struct ShapePairTdbinPayload { + /// The `v0` field. + pub v0: i64, + /// The `v1` field. + pub v1: String, +} + +impl tdbin::Struct for Point { + const DATA_WORDS: u16 = 2; + const PTR_WORDS: u16 = 0; + const LAYOUT_HASH: u64 = 0xec16_976d_1ca9_f214; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::f64_bits(self.x))?; + w.scalar(at, 1, tdbin::scalar::f64_bits(self.y))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f1 = tdbin::scalar::f64_from(r.scalar(at, 1)?); + Ok(Self { x: f0, y: f1 }) + } +} + +impl Default for Shape { + fn default() -> Self { + { + let payload = ShapeCircleTdbinPayload::default(); + Self::Circle { + radius: payload.radius, + label: payload.label, + } + } + } +} + +impl tdbin::Struct for Shape { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0xe89c_a02c_2d7f_1ddf; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + match self { + Self::Circle { + radius: f0, + label: f1, + } => { + w.scalar(at, 0, 0)?; + w.child( + at, + Self::DATA_WORDS, + 0, + Some(&ShapeCircleTdbinPayload { + radius: *f0, + label: f1.clone(), + }), + ) + } + Self::Rect { + w: f0, + h: f1, + corner: f2, + } => { + w.scalar(at, 0, 1)?; + w.child( + at, + Self::DATA_WORDS, + 0, + Some(&ShapeRectTdbinPayload { + w: *f0, + h: *f1, + corner: f2.clone(), + }), + ) + } + Self::Pair(f0, f1) => { + w.scalar(at, 0, 2)?; + w.child( + at, + Self::DATA_WORDS, + 0, + Some(&ShapePairTdbinPayload { + v0: *f0, + v1: f1.clone(), + }), + ) + } + Self::Tagged(payload) => { + w.scalar(at, 0, 3)?; + w.child(at, Self::DATA_WORDS, 0, Some(payload)) + } + Self::Empty => { + w.scalar(at, 0, 4)?; + Ok(()) + } + } + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + match r.scalar(at, 0)? { + 0 => { + let payload = r + .child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(); + Ok(Self::Circle { + radius: payload.radius, + label: payload.label, + }) + } + 1 => { + let payload = r + .child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(); + Ok(Self::Rect { + w: payload.w, + h: payload.h, + corner: payload.corner, + }) + } + 2 => { + let payload = r + .child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(); + Ok(Self::Pair(payload.v0, payload.v1)) + } + 3 => Ok(Self::Tagged( + r.child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(), + )), + 4 => { + r.require_null_pointer(at, 0)?; + Ok(Self::Empty) + } + ordinal => { + r.verify_struct_slots(at)?; + Err(tdbin::DecodeError::UnknownVariant { ordinal }) + } + } + } +} + +impl tdbin::Struct for Canvas { + const DATA_WORDS: u16 = 0; + const PTR_WORDS: u16 = 3; + const LAYOUT_HASH: u64 = 0x7af5_ca4f_32b1_2af0; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.string(at, Self::DATA_WORDS, 0, Some(&self.name))?; + w.child(at, Self::DATA_WORDS, 1, Some(&self.shape))?; + w.child(at, Self::DATA_WORDS, 2, self.backup.as_ref())?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + let f1 = r + .child::(at, Self::DATA_WORDS, 1)? + .unwrap_or_default(); + let f2 = r.child::(at, Self::DATA_WORDS, 2)?; + Ok(Self { + name: f0, + shape: f1, + backup: f2, + }) + } +} + +impl tdbin::Struct for ShapeCircleTdbinPayload { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0x25a8_f1a2_4449_715d; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::f64_bits(self.radius))?; + w.string(at, Self::DATA_WORDS, 0, Some(&self.label))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f1 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + Ok(Self { + radius: f0, + label: f1, + }) + } +} + +impl tdbin::Struct for ShapeRectTdbinPayload { + const DATA_WORDS: u16 = 2; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0x2ca2_5295_c1ff_139e; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::f64_bits(self.w))?; + w.scalar(at, 1, tdbin::scalar::f64_bits(self.h))?; + w.child(at, Self::DATA_WORDS, 0, Some(&self.corner))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::f64_from(r.scalar(at, 0)?); + let f1 = tdbin::scalar::f64_from(r.scalar(at, 1)?); + let f2 = r + .child::(at, Self::DATA_WORDS, 0)? + .unwrap_or_default(); + Ok(Self { + w: f0, + h: f1, + corner: f2, + }) + } +} + +impl tdbin::Struct for ShapePairTdbinPayload { + const DATA_WORDS: u16 = 1; + const PTR_WORDS: u16 = 1; + const LAYOUT_HASH: u64 = 0x3ce1_1b39_b3cf_1066; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::i64_bits(self.v0))?; + w.string(at, Self::DATA_WORDS, 0, Some(&self.v1))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f1 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + Ok(Self { v0: f0, v1: f1 }) + } +} diff --git a/src/tdbin/tests/generated_widths/mod.rs b/src/tdbin/tests/generated_widths/mod.rs new file mode 100644 index 0000000..886e26f --- /dev/null +++ b/src/tdbin/tests/generated_widths/mod.rs @@ -0,0 +1,224 @@ +//! [TDBIN-WIDTH-RANGE] GENERATED width-refined integer + Path fixture (#85), +//! emitted by `src/typediagram/src/converters/rust-tdbin.ts` +//! (`generateRustModule`) from +//! `src/typediagram/test/converters/fixtures/widths.td`. Included only +//! by `widths.rs`. Regenerate with `node src/scripts/tdbin/tdbin-regen-fixtures.mjs`. + +// <<>> +/// The `Stats` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct Stats { + /// The `delta` field. + pub delta: i32, + /// The `flags` field. + pub flags: u8, + /// The `port` field. + pub port: u16, + /// The `hits` field. + pub hits: u32, + /// The `hash` field. + pub hash: u64, + /// The `count` field. + pub count: usize, + /// The `file` field. + pub file: std::path::PathBuf, + /// The `maybeHash` field. + #[serde(rename = "maybeHash")] + pub maybe_hash: Option, + /// The `maybePort` field. + #[serde(rename = "maybePort")] + pub maybe_port: Option, + /// The `maybeFile` field. + #[serde(rename = "maybeFile")] + pub maybe_file: Option, + /// The `deltas` field. + pub deltas: Vec, + /// The `bytes` field. + pub bytes: Vec, + /// The `ports` field. + pub ports: Vec, + /// The `hitsList` field. + #[serde(rename = "hitsList")] + pub hits_list: Vec, + /// The `hashes` field. + pub hashes: Vec, + /// The `sizes` field. + pub sizes: Vec, + /// The `files` field. + pub files: Vec, + /// The `maybeSizes` field. + #[serde(rename = "maybeSizes")] + pub maybe_sizes: Option>, + /// The `maybeFiles` field. + #[serde(rename = "maybeFiles")] + pub maybe_files: Option>, +} + +/// The `StatsRaw` record. +#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StatsRaw { + /// The `delta` field. + pub delta: i64, + /// The `flags` field. + pub flags: u64, + /// The `port` field. + pub port: u64, + /// The `hits` field. + pub hits: u64, + /// The `hash` field. + pub hash: u64, + /// The `count` field. + pub count: u64, +} + +impl tdbin::Struct for Stats { + const DATA_WORDS: u16 = 9; + const PTR_WORDS: u16 = 11; + const LAYOUT_HASH: u64 = 0x6b91_e78c_b16a_568b; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::i32_bits(self.delta))?; + w.scalar(at, 1, tdbin::scalar::u8_bits(self.flags))?; + w.scalar(at, 2, tdbin::scalar::u16_bits(self.port))?; + w.scalar(at, 3, tdbin::scalar::u32_bits(self.hits))?; + w.scalar(at, 4, tdbin::scalar::u64_bits(self.hash))?; + w.scalar(at, 5, tdbin::scalar::usize_bits(self.count))?; + w.string( + at, + Self::DATA_WORDS, + 0, + Some(tdbin::scalar::path_str(&self.file)?), + )?; + w.bool_bit(at, 6, 0, self.maybe_hash.is_some())?; + w.scalar(at, 7, self.maybe_hash.map_or(0, tdbin::scalar::u64_bits))?; + w.bool_bit(at, 6, 1, self.maybe_port.is_some())?; + w.scalar(at, 8, self.maybe_port.map_or(0, tdbin::scalar::u16_bits))?; + w.string( + at, + Self::DATA_WORDS, + 1, + self.maybe_file + .as_deref() + .map(tdbin::scalar::path_str) + .transpose()?, + )?; + w.i32_list(at, Self::DATA_WORDS, 2, Some(&self.deltas))?; + w.byte_list(at, Self::DATA_WORDS, 3, Some(&self.bytes))?; + w.u16_list(at, Self::DATA_WORDS, 4, Some(&self.ports))?; + w.u32_list(at, Self::DATA_WORDS, 5, Some(&self.hits_list))?; + w.word_list(at, Self::DATA_WORDS, 6, Some(&self.hashes))?; + w.usize_list(at, Self::DATA_WORDS, 7, Some(&self.sizes))?; + let files_strings = self + .files + .iter() + .map(|path| tdbin::scalar::path_string(path)) + .collect::, _>>()?; + w.string_list(at, Self::DATA_WORDS, 8, Some(&files_strings))?; + w.usize_list(at, Self::DATA_WORDS, 9, self.maybe_sizes.as_deref())?; + let maybe_files_strings = self + .maybe_files + .as_ref() + .map(|values| { + values + .iter() + .map(|path| tdbin::scalar::path_string(path)) + .collect::, _>>() + }) + .transpose()?; + w.string_list(at, Self::DATA_WORDS, 10, maybe_files_strings.as_deref())?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::i32_from(r.scalar(at, 0)?)?; + let f1 = tdbin::scalar::u8_from(r.scalar(at, 1)?)?; + let f2 = tdbin::scalar::u16_from(r.scalar(at, 2)?)?; + let f3 = tdbin::scalar::u32_from(r.scalar(at, 3)?)?; + let f4 = tdbin::scalar::u64_from(r.scalar(at, 4)?); + let f5 = tdbin::scalar::usize_from(r.scalar(at, 5)?)?; + let f6 = r + .string(at, Self::DATA_WORDS, 0)? + .map_or_else(std::path::PathBuf::new, std::path::PathBuf::from); + let f7_present = r.bool_bit(at, 6, 0)?; + let f7_value = tdbin::scalar::u64_from(r.scalar(at, 7)?); + let f7 = f7_present.then_some(f7_value); + let f8_present = r.bool_bit(at, 6, 1)?; + let f8_value = tdbin::scalar::u16_from(r.scalar(at, 8)?)?; + let f8 = f8_present.then_some(f8_value); + let f9 = r + .string(at, Self::DATA_WORDS, 1)? + .map(std::path::PathBuf::from); + let f10 = r.i32_list(at, Self::DATA_WORDS, 2)?.unwrap_or_default(); + let f11 = r.byte_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default(); + let f12 = r.u16_list(at, Self::DATA_WORDS, 4)?.unwrap_or_default(); + let f13 = r.u32_list(at, Self::DATA_WORDS, 5)?.unwrap_or_default(); + let f14 = r.word_list(at, Self::DATA_WORDS, 6)?.unwrap_or_default(); + let f15 = r.usize_list(at, Self::DATA_WORDS, 7)?.unwrap_or_default(); + let f16 = r + .string_list(at, Self::DATA_WORDS, 8)? + .map_or_else(Vec::new, |values| { + values.into_iter().map(std::path::PathBuf::from).collect() + }); + let f17 = r.usize_list(at, Self::DATA_WORDS, 9)?; + let f18 = r.string_list(at, Self::DATA_WORDS, 10)?.map(|values| { + values + .into_iter() + .map(std::path::PathBuf::from) + .collect::>() + }); + Ok(Self { + delta: f0, + flags: f1, + port: f2, + hits: f3, + hash: f4, + count: f5, + file: f6, + maybe_hash: f7, + maybe_port: f8, + maybe_file: f9, + deltas: f10, + bytes: f11, + ports: f12, + hits_list: f13, + hashes: f14, + sizes: f15, + files: f16, + maybe_sizes: f17, + maybe_files: f18, + }) + } +} + +impl tdbin::Struct for StatsRaw { + const DATA_WORDS: u16 = 6; + const PTR_WORDS: u16 = 0; + const LAYOUT_HASH: u64 = 0x50f8_105f_77c8_c4ca; + + fn write_struct(&self, w: &mut tdbin::Writer, at: usize) -> Result<(), tdbin::EncodeError> { + w.scalar(at, 0, tdbin::scalar::i64_bits(self.delta))?; + w.scalar(at, 1, tdbin::scalar::u64_bits(self.flags))?; + w.scalar(at, 2, tdbin::scalar::u64_bits(self.port))?; + w.scalar(at, 3, tdbin::scalar::u64_bits(self.hits))?; + w.scalar(at, 4, tdbin::scalar::u64_bits(self.hash))?; + w.scalar(at, 5, tdbin::scalar::u64_bits(self.count))?; + Ok(()) + } + + fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result { + let f0 = tdbin::scalar::i64_from(r.scalar(at, 0)?); + let f1 = tdbin::scalar::u64_from(r.scalar(at, 1)?); + let f2 = tdbin::scalar::u64_from(r.scalar(at, 2)?); + let f3 = tdbin::scalar::u64_from(r.scalar(at, 3)?); + let f4 = tdbin::scalar::u64_from(r.scalar(at, 4)?); + let f5 = tdbin::scalar::u64_from(r.scalar(at, 5)?); + Ok(Self { + delta: f0, + flags: f1, + port: f2, + hits: f3, + hash: f4, + count: f5, + }) + } +} diff --git a/crates/tdbin/tests/golden.rs b/src/tdbin/tests/golden.rs similarity index 100% rename from crates/tdbin/tests/golden.rs rename to src/tdbin/tests/golden.rs diff --git a/src/tdbin/tests/golden/report_lists.hex b/src/tdbin/tests/golden/report_lists.hex new file mode 100644 index 0000000..fdcfb11 --- /dev/null +++ b/src/tdbin/tests/golden/report_lists.hex @@ -0,0 +1 @@ +54444231010300008e000000b79cbab80f6192d3400b11294911292511352511411e115516115d2711711a11710d1171070000116d32030d010000ffffffffffffffffff01ffffffffffffff7f8080c0e03f8080c0f07fff59f3f8c21f6ea5010011090211051211054a03ceb1ff74776f20776f726400017311050211011a06ff0751080101c0f83f11090a80c01105020161050101012a5001013f676f6c64656e diff --git a/src/tdbin/tests/golden/widths.hex b/src/tdbin/tests/golden/widths.hex new file mode 100644 index 0000000..af53c77 --- /dev/null +++ b/src/tdbin/tests/golden/widths.hex @@ -0,0 +1 @@ +5444423101030000a30000008b566ab18ce7916b50090bf880ffffffff01ff03ffff0fffffffffffffffffffffffffff01ffffffffffff1f000101000111299a11314211312411351a11351b113514113515113915113d161149050000ff2f746d702fceb12f017265706f72742e6a07736f6eff72656c2f7061746800f880fffffffff0ffffff7f0601ff3401ffff1fffffffff07ffffffffffffffffff0000007fffffffffffff1f010311050a11051a016107622f63 diff --git a/crates/tdbin/tests/golden_columnar.rs b/src/tdbin/tests/golden_columnar.rs similarity index 100% rename from crates/tdbin/tests/golden_columnar.rs rename to src/tdbin/tests/golden_columnar.rs diff --git a/crates/tdbin/tests/lists.rs b/src/tdbin/tests/lists.rs similarity index 100% rename from crates/tdbin/tests/lists.rs rename to src/tdbin/tests/lists.rs diff --git a/src/tdbin/tests/names.rs b/src/tdbin/tests/names.rs new file mode 100644 index 0000000..c18c2de --- /dev/null +++ b/src/tdbin/tests/names.rs @@ -0,0 +1,74 @@ +//! [TDBIN-CODEGEN-LOCALS] Generated codecs whose fields and variants reuse the +//! codec's own identifiers (`w`, `r`, `at`, `count`, `items`, `rows`, `i`, +//! `tags`) compile and round-trip through both the struct (layout 1 pointer) +//! path and the columnar (layout 2 column group) path. + +/// The codegen-emitted name-collision fixture. +mod generated_names; + +use generated_names::{Inner, Names, NamesBatch, Pick}; +use tdbin::TdBin; + +type TestResult = Result<(), Box>; + +fn inner(at: i64, r: &str) -> Inner { + Inner { + at, + r: r.to_owned(), + } +} + +fn names(seed: i64) -> Names { + Names { + value: format!("v{seed}"), + writer: seed, + reader: seed.wrapping_neg(), + tdbin: seed.wrapping_mul(3), + ok: seed % 2 == 0, + w: seed.wrapping_add(1), + at: seed.wrapping_add(2), + r: seed.wrapping_add(3), + count: seed.wrapping_add(4), + i: seed % 2 == 1, + items: (seed % 2 == 0).then(|| inner(seed, "items")), + rows: vec![inner(1, "a"), inner(seed, "b")], + tags: vec!["t".to_owned(), format!("{seed}")], + x: Some(seed), + x_present: (seed % 3 == 0).then_some(seed.wrapping_neg()), + pick: match seed % 4 { + 0 => Pick::W(inner(seed, "w")), + 1 => Pick::Items(inner(seed, "it")), + 2 => Pick::Tags, + _ => Pick::Count(inner(seed, "c")), + }, + } +} + +#[test] +fn colliding_names_round_trip_through_struct_and_column_codecs() -> TestResult { + for seed in 0..8 { + let single = names(seed); + let bytes = single.to_bytes()?; + assert_eq!(Names::from_bytes(&bytes)?, single); + assert_eq!(Names::from_bytes(&bytes)?.to_bytes()?, bytes); + } + let batch = NamesBatch { + names: (0..8).map(names).collect(), + picks: vec![ + Pick::Tags, + Pick::W(inner(1, "w")), + Pick::Count(inner(2, "c")), + Pick::Items(inner(3, "i")), + ], + }; + let bytes = batch.to_bytes()?; + let decoded = NamesBatch::from_bytes(&bytes)?; + assert_eq!(decoded, batch); + assert_eq!(decoded.names.len(), 8); + assert_eq!(decoded.names.get(3).map(|n| n.x_present), Some(Some(-3))); + assert_eq!( + NamesBatch::from_bytes(&NamesBatch::default().to_bytes()?)?, + NamesBatch::default() + ); + Ok(()) +} diff --git a/crates/tdbin/tests/pack.rs b/src/tdbin/tests/pack.rs similarity index 100% rename from crates/tdbin/tests/pack.rs rename to src/tdbin/tests/pack.rs diff --git a/crates/tdbin/tests/packing.rs b/src/tdbin/tests/packing.rs similarity index 100% rename from crates/tdbin/tests/packing.rs rename to src/tdbin/tests/packing.rs diff --git a/crates/tdbin/tests/reflect.rs b/src/tdbin/tests/reflect.rs similarity index 100% rename from crates/tdbin/tests/reflect.rs rename to src/tdbin/tests/reflect.rs diff --git a/crates/tdbin/tests/roundtrip.rs b/src/tdbin/tests/roundtrip.rs similarity index 100% rename from crates/tdbin/tests/roundtrip.rs rename to src/tdbin/tests/roundtrip.rs diff --git a/crates/tdbin/tests/size_gate.rs b/src/tdbin/tests/size_gate.rs similarity index 100% rename from crates/tdbin/tests/size_gate.rs rename to src/tdbin/tests/size_gate.rs diff --git a/crates/tdbin/tests/support/batch_corpus.rs b/src/tdbin/tests/support/batch_corpus.rs similarity index 100% rename from crates/tdbin/tests/support/batch_corpus.rs rename to src/tdbin/tests/support/batch_corpus.rs diff --git a/crates/tdbin/tests/support/bench_corpus.rs b/src/tdbin/tests/support/bench_corpus.rs similarity index 99% rename from crates/tdbin/tests/support/bench_corpus.rs rename to src/tdbin/tests/support/bench_corpus.rs index 85f538d..772c3d6 100644 --- a/crates/tdbin/tests/support/bench_corpus.rs +++ b/src/tdbin/tests/support/bench_corpus.rs @@ -4,7 +4,7 @@ //! benchmark example, and the Criterion benchmark target. /// The codegen-emitted columnar (layout 2) corpus ADT types and codecs, -/// generated from `docs/benchmarks/tdbin-corpus.td`. +/// generated from `docs/research/benchmarks/tdbin-corpus.td`. #[path = "../generated_corpus/mod.rs"] pub mod generated_corpus; diff --git a/crates/tdbin/tests/support/document_corpus.rs b/src/tdbin/tests/support/document_corpus.rs similarity index 100% rename from crates/tdbin/tests/support/document_corpus.rs rename to src/tdbin/tests/support/document_corpus.rs diff --git a/crates/tdbin/tests/support/event_corpus.rs b/src/tdbin/tests/support/event_corpus.rs similarity index 100% rename from crates/tdbin/tests/support/event_corpus.rs rename to src/tdbin/tests/support/event_corpus.rs diff --git a/crates/tdbin/tests/support/hexvectors.rs b/src/tdbin/tests/support/hexvectors.rs similarity index 100% rename from crates/tdbin/tests/support/hexvectors.rs rename to src/tdbin/tests/support/hexvectors.rs diff --git a/crates/tdbin/tests/support/persons.rs b/src/tdbin/tests/support/persons.rs similarity index 100% rename from crates/tdbin/tests/support/persons.rs rename to src/tdbin/tests/support/persons.rs diff --git a/src/tdbin/tests/variants.rs b/src/tdbin/tests/variants.rs new file mode 100644 index 0000000..e478c95 --- /dev/null +++ b/src/tdbin/tests/variants.rs @@ -0,0 +1,69 @@ +//! [TDBIN-UNION-STRUCT] (#61) Struct-form and multi-field tuple union variants +//! round-trip through GENERATED codecs: discriminant in data word 0, payload as +//! a pointer to a struct laid out by [TDBIN-REC-ALLOC]. Every variant is +//! exercised as both a required and an optional field, bare and framed. + +/// The codegen-emitted struct-form variant fixture. +mod generated_shapes; + +use generated_shapes::{Canvas, Point, Shape}; +use tdbin::{DecodeError, Struct, TdBin}; + +type TestResult = Result<(), Box>; + +fn shapes() -> Vec { + vec![ + Shape::Circle { + radius: 2.5, + label: "sun".to_owned(), + }, + Shape::Rect { + w: -1.0, + h: 1e9, + corner: Point { x: 0.5, y: -0.5 }, + }, + Shape::Pair(i64::MIN, "pair".to_owned()), + Shape::Tagged(Point { x: 3.0, y: 4.0 }), + Shape::Empty, + ] +} + +#[test] +fn struct_form_variants_round_trip_bare_framed_and_optional() -> TestResult { + let all = shapes(); + for shape in &all { + for backup in std::iter::once(None).chain(all.iter().cloned().map(Some)) { + let canvas = Canvas { + name: format!("{shape:?}"), + shape: shape.clone(), + backup, + }; + let bytes = canvas.to_bytes()?; + assert_eq!(Canvas::from_bytes(&bytes)?, canvas); + assert_eq!(Canvas::from_bytes(&bytes)?.to_bytes()?, bytes); + let framed = canvas.to_packed_framed_bytes_checked()?; + assert_eq!(Canvas::from_framed_bytes(&framed)?, canvas); + } + assert_eq!(Shape::from_bytes(&shape.to_bytes()?)?, *shape); + } + let circle = Shape::Circle { + radius: 0.0, + label: String::new(), + }; + assert_eq!(Shape::default(), circle); + assert_ne!( + circle.to_bytes()?, + Shape::Rect { + w: 0.0, + h: 0.0, + corner: Point::default() + } + .to_bytes()? + ); + let wrong = Canvas::default().to_framed_bytes(Some(Shape::LAYOUT_HASH))?; + assert!(matches!( + Canvas::from_framed_bytes(&wrong), + Err(DecodeError::HashMismatch { .. }) + )); + Ok(()) +} diff --git a/crates/tdbin/tests/verification.rs b/src/tdbin/tests/verification.rs similarity index 100% rename from crates/tdbin/tests/verification.rs rename to src/tdbin/tests/verification.rs diff --git a/src/tdbin/tests/widths.rs b/src/tdbin/tests/widths.rs new file mode 100644 index 0000000..c068ff2 --- /dev/null +++ b/src/tdbin/tests/widths.rs @@ -0,0 +1,144 @@ +//! [TDBIN-WIDTH-RANGE] [TDBIN-WIDTH-LIST] [TDBIN-WIDTH-PATH] (#85) Generated +//! width-refined integers and `Path` round-trip at their extremes, reject +//! out-of-range words with a typed error instead of truncating, and use the +//! reserved 2- and 4-byte list element widths. + +/// The codegen-emitted width fixture. +mod generated_widths; + +use std::fmt::Write as _; +use std::path::PathBuf; + +use generated_widths::{Stats, StatsRaw}; +use tdbin::{DecodeError, TdBin}; + +type TestResult = Result<(), Box>; + +fn extremes() -> Stats { + Stats { + delta: i32::MIN, + flags: u8::MAX, + port: u16::MAX, + hits: u32::MAX, + hash: u64::MAX, + count: usize::MAX, + file: PathBuf::from("/tmp/α/report.json"), + maybe_hash: Some(0), + maybe_port: None, + maybe_file: Some(PathBuf::from("rel/path")), + deltas: vec![i32::MIN, -1, 0, i32::MAX], + bytes: vec![0, 1, 255], + ports: vec![0, 1, u16::MAX], + hits_list: vec![u32::MAX, 7], + hashes: vec![u64::MAX, 0], + sizes: vec![usize::MAX, 3], + files: vec![PathBuf::from("a"), PathBuf::from("b/c")], + maybe_sizes: Some(vec![]), + maybe_files: None, + } +} + +#[test] +fn width_types_round_trip_at_extremes_and_reject_out_of_range() -> TestResult { + let value = extremes(); + let bytes = value.to_bytes()?; + assert_eq!(Stats::from_bytes(&bytes)?, value); + assert_eq!(Stats::from_bytes(&bytes)?.to_bytes()?, bytes); + let framed = value.to_packed_framed_bytes_checked()?; + assert_eq!(Stats::from_framed_bytes(&framed)?, value); + assert_eq!( + Stats::from_bytes(&Stats::default().to_bytes()?)?, + Stats::default() + ); + + // 2-byte U16 list: three elements fit one padded word after the pointer. + let short = Stats { + ports: vec![1, 2, 3], + ..Stats::default() + }; + let wide = Stats { + hashes: vec![1, 2, 3], + ..Stats::default() + }; + assert!(short.to_bytes()?.len() < wide.to_bytes()?.len()); + + let in_range = StatsRaw { + delta: i64::from(i32::MAX), + flags: 255, + port: 65_535, + hits: u64::from(u32::MAX), + hash: 9, + count: 10, + }; + let narrowed = Stats::from_bytes(&in_range.to_bytes()?)?; + assert_eq!( + (narrowed.delta, narrowed.flags, narrowed.port, narrowed.hits), + (i32::MAX, 255, 65_535, u32::MAX) + ); + for raw in [ + StatsRaw { + delta: i64::from(i32::MAX) + 1, + ..in_range.clone() + }, + StatsRaw { + delta: i64::from(i32::MIN) - 1, + ..in_range.clone() + }, + StatsRaw { + flags: 256, + ..in_range.clone() + }, + StatsRaw { + port: 65_536, + ..in_range.clone() + }, + StatsRaw { + hits: u64::from(u32::MAX) + 1, + ..in_range.clone() + }, + ] { + assert_eq!( + Stats::from_bytes(&raw.to_bytes()?), + Err(DecodeError::ValueOutOfRange) + ); + } + Ok(()) +} + +#[cfg(unix)] +#[test] +fn non_utf8_paths_fail_encode_typed() { + use std::ffi::OsStr; + use std::os::unix::ffi::OsStrExt; + let bad = Stats { + file: PathBuf::from(OsStr::from_bytes(&[0x66, 0xff])), + ..Stats::default() + }; + assert_eq!(bad.to_bytes(), Err(tdbin::EncodeError::NonUtf8Path)); + let bad_list = Stats { + files: vec![PathBuf::from(OsStr::from_bytes(&[0xfe]))], + ..Stats::default() + }; + assert_eq!(bad_list.to_bytes(), Err(tdbin::EncodeError::NonUtf8Path)); +} + +/// The shared Rust ↔ TypeScript golden value (`typescript-tdbin.test.ts` +/// builds the identical one; `Size` stays within JS safe integers). +const SAFE: usize = 9_007_199_254_740_991; + +#[test] +fn width_bytes_match_the_cross_language_golden() -> TestResult { + let value = Stats { + count: SAFE, + sizes: vec![SAFE, 3], + ..extremes() + }; + let bytes = value.to_packed_framed_bytes_checked()?; + let hex = bytes.iter().try_fold(String::new(), |mut out, byte| { + write!(out, "{byte:02x}")?; + Ok::<_, std::fmt::Error>(out) + })?; + assert_eq!(hex, include_str!("golden/widths.hex").trim()); + assert_eq!(Stats::from_framed_bytes(&bytes)?, value); + Ok(()) +} diff --git a/packages/typediagram/.gitignore b/src/typediagram/.gitignore similarity index 100% rename from packages/typediagram/.gitignore rename to src/typediagram/.gitignore diff --git a/packages/typediagram/LICENSE b/src/typediagram/LICENSE similarity index 100% rename from packages/typediagram/LICENSE rename to src/typediagram/LICENSE diff --git a/packages/typediagram/README.md b/src/typediagram/README.md similarity index 100% rename from packages/typediagram/README.md rename to src/typediagram/README.md diff --git a/packages/typediagram/package-lock.json b/src/typediagram/package-lock.json similarity index 100% rename from packages/typediagram/package-lock.json rename to src/typediagram/package-lock.json diff --git a/packages/typediagram/package.json b/src/typediagram/package.json similarity index 78% rename from packages/typediagram/package.json rename to src/typediagram/package.json index 0e8a734..ca30035 100644 --- a/packages/typediagram/package.json +++ b/src/typediagram/package.json @@ -6,11 +6,12 @@ "repository": { "type": "git", "url": "git+https://github.com/Nimblesite/typeDiagram.git", - "directory": "packages/typediagram" + "directory": "src/typediagram" }, "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", + "sideEffects": false, "exports": { ".": { "types": "./dist/index.d.ts", @@ -51,6 +52,22 @@ "./tdbin": { "types": "./dist/tdbin/index.d.ts", "import": "./dist/tdbin/index.js" + }, + "./converters/osprey": { + "types": "./dist/converters/osprey.d.ts", + "import": "./dist/converters/osprey.js" + }, + "./converters/swift": { + "types": "./dist/converters/swift.d.ts", + "import": "./dist/converters/swift.js" + }, + "./converters/shared-layout": { + "types": "./dist/converters/shared-layout.d.ts", + "import": "./dist/converters/shared-layout.js" + }, + "./converters/shared-c": { + "types": "./dist/converters/shared-c.d.ts", + "import": "./dist/converters/shared-c.js" } }, "files": [ @@ -78,6 +95,6 @@ "happy-dom": "^20.10.6", "typescript": "^7.0.2", "typescript-compiler": "npm:typescript@6.0.3", - "vitest": "^4.1.10" + "vitest": "^4.1.12" } } diff --git a/packages/typediagram/scripts/bundle-size.mjs b/src/typediagram/scripts/bundle-size.mjs similarity index 89% rename from packages/typediagram/scripts/bundle-size.mjs rename to src/typediagram/scripts/bundle-size.mjs index 9520167..09242da 100644 --- a/packages/typediagram/scripts/bundle-size.mjs +++ b/src/typediagram/scripts/bundle-size.mjs @@ -10,13 +10,15 @@ // codegen unknown-type validation [MODEL-CODEGEN-UNKNOWN] measure ~81 KB, // so that budget was 84 KB. The Typeshed AST adapter, function declarations, // and emitters add ~8 KB; @lezer/python remains an external runtime engine. +// Width-refined integers + Path [MODEL-WIDTH] across all 12 converters and the +// TS tdbin width/list/struct-variant codegen measure ~95 KB, so the budget is 96 KB. import { build } from "esbuild"; import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; const here = dirname(fileURLToPath(import.meta.url)); const entry = resolve(here, "..", "src", "index.ts"); -const BUDGET_KB = 93; +const BUDGET_KB = 96; const result = await build({ entryPoints: [entry], diff --git a/packages/typediagram/scripts/check-banned-deps.mjs b/src/typediagram/scripts/check-banned-deps.mjs similarity index 100% rename from packages/typediagram/scripts/check-banned-deps.mjs rename to src/typediagram/scripts/check-banned-deps.mjs diff --git a/packages/typediagram/scripts/typeshed-corpus.mjs b/src/typediagram/scripts/typeshed-corpus.mjs similarity index 100% rename from packages/typediagram/scripts/typeshed-corpus.mjs rename to src/typediagram/scripts/typeshed-corpus.mjs diff --git a/packages/typediagram/src/converters/brace-lang.ts b/src/typediagram/src/converters/brace-lang.ts similarity index 96% rename from packages/typediagram/src/converters/brace-lang.ts rename to src/typediagram/src/converters/brace-lang.ts index 851ccc6..f44c0db 100644 --- a/packages/typediagram/src/converters/brace-lang.ts +++ b/src/typediagram/src/converters/brace-lang.ts @@ -37,9 +37,9 @@ export const splitTopLevelCommas = (s: string): string[] => { let start = 0; for (let i = 0; i < s.length; i++) { const c = s.charAt(i); - if (c === "<") { + if (c === "<" || c === "(" || c === "{") { depth += 1; - } else if (c === ">") { + } else if (c === ">" || c === ")" || c === "}") { depth -= 1; } else if (c === "," && depth === 0) { parts.push(s.slice(start, i).trim()); diff --git a/packages/typediagram/src/converters/csharp.ts b/src/typediagram/src/converters/csharp.ts similarity index 82% rename from packages/typediagram/src/converters/csharp.ts rename to src/typediagram/src/converters/csharp.ts index 0375c3f..9e90584 100644 --- a/packages/typediagram/src/converters/csharp.ts +++ b/src/typediagram/src/converters/csharp.ts @@ -8,7 +8,7 @@ // Option <-> T?. Alias <-> `using X = Y;`. import type { Diagnostic } from "../parser/diagnostics.js"; import { type Result, err } from "../result.js"; -import { type Model, type ResolvedTypeRef } from "../model/types.js"; +import { visibleDataDeclsForTarget, type Model, type ResolvedTypeRef } from "../model/types.js"; import { ModelBuilder, record, union, alias } from "../model/builder.js"; import type { Converter } from "./types.js"; import { emitDecls } from "./emit-decls.js"; @@ -26,6 +26,13 @@ import { makeConsumedTracker, orderBySource, scanAll, scanBraceBlocks } from "./ const TD_TO_CS: Record = { Bool: "bool", Int: "int", + I32: "int", + U8: "byte", + U16: "ushort", + U32: "uint", + U64: "ulong", + Size: "ulong", + Path: "string", Float: "double", String: "string", Bytes: "byte[]", @@ -86,6 +93,12 @@ const mapCsType = (t: string): string => { }; // `using Email = System.String;` or `using Email = string;` +const aliasOrderMarker = (name: string) => `// typeDiagram alias-order: ${name}\n`; +const aliasOffset = (source: string, name: string, offset: number) => { + const marker = source.indexOf(aliasOrderMarker(name)); + return marker < 0 ? offset : marker; +}; + const USING_ALIAS_RE = /using\s+(\w+)\s*=\s*([^;]+);/g; // Primary-constructor record: `public sealed record ChatRequest(string Message, ...);` @@ -179,7 +192,7 @@ const fromCSharp = (source: string): Result => { /* v8 ignore next 3 — regex guarantees both captures */ return name === undefined || target === undefined ? null - : { kind: "alias", name, target: target.trim(), offset: m.index }; + : { kind: "alias", name, target: target.trim(), offset: aliasOffset(source, name, m.index) }; }), ]; @@ -226,34 +239,36 @@ const fromCSharp = (source: string): Result => { // ── To C# ── -const mapTdToCs = (t: ResolvedTypeRef): string => { +const mapTdToCs = (t: ResolvedTypeRef, integerWidth: 32 | 64): string => { if (isOption(t) && t.args.length === 1) { const inner = t.args[0]; if (inner !== undefined) { - return `${mapTdToCs(inner)}?`; + return `${mapTdToCs(inner, integerWidth)}?`; } } - const name = mapBuiltinName(t, TD_TO_CS); - return t.args.length === 0 ? name : `${name}<${t.args.map(mapTdToCs).join(", ")}>`; + const name = mapBuiltinName(t, { ...TD_TO_CS, Int: integerWidth === 64 ? "long" : "int" }); + return t.args.length === 0 ? name : `${name}<${t.args.map((arg) => mapTdToCs(arg, integerWidth)).join(", ")}>`; }; const emitRecord = ( name: string, fields: readonly { name: string; type: ResolvedTypeRef }[], - generics: string[] + generics: string[], + mapType: (type: ResolvedTypeRef) => string ): string[] => { const genericsStr = formatGenericsDecl(generics); if (fields.length === 0) { return [`public sealed record ${name}${genericsStr}();`]; } - const params = fields.map((f) => `${mapTdToCs(f.type)} ${f.name}`).join(", "); + const params = fields.map((f) => `${mapType(f.type)} ${f.name}`).join(", "); return [`public sealed record ${name}${genericsStr}(${params});`]; }; const emitUnion = ( name: string, variants: readonly { name: string; fields: readonly { name: string; type: ResolvedTypeRef }[] }[], - generics: string[] + generics: string[], + mapType: (type: ResolvedTypeRef) => string ): string[] => { const genericsStr = formatGenericsDecl(generics); const allEmpty = variants.every((v) => v.fields.length === 0); @@ -271,7 +286,7 @@ const emitUnion = ( if (v.fields.length === 0) { lines.push(` public sealed record ${v.name} : ${name}${genericsStr};`); } else { - const params = v.fields.map((f) => `${mapTdToCs(f.type)} ${f.name}`).join(", "); + const params = v.fields.map((f) => `${mapType(f.type)} ${f.name}`).join(", "); lines.push(` public sealed record ${v.name}(${params}) : ${name}${genericsStr};`); } if (idx < variants.length - 1) { @@ -282,26 +297,27 @@ const emitUnion = ( return lines; }; -const emitAlias = (name: string, target: ResolvedTypeRef): string => { - // `using Email = string;` style. System.String-prefixed primitives read - // cleaner unqualified, so emit the mapped C# name directly. - return `using ${name} = ${mapTdToCs(target)};`; -}; - -// Emit decls in their original model order. `using X = Y;` is valid at file -// scope wherever it appears, so keeping aliases in source order preserves -// round-trip order at the cost of the more idiomatic "usings-at-top" layout. -const toCSharp = (model: Model): string => - emitDecls( +// C# requires every using directive before the first declaration. +const toCSharp = (model: Model, opts?: Parameters[1]): string => { + const width = opts !== undefined && "integerWidth" in opts && opts.integerWidth === 64 ? 64 : 32; + const mapType = (type: ResolvedTypeRef) => mapTdToCs(type, width); + const aliases = visibleDataDeclsForTarget(model.decls, "csharp") + .filter((decl) => decl.kind === "alias") + .map( + (decl) => + `using ${decl.name} = ${decl.target.resolution.kind === "primitive" && decl.target.name === "Uuid" ? "System.Guid" : mapType(decl.target)};` + ); + return emitDecls( model, "csharp", { - record: (d) => emitRecord(d.name, d.fields, d.generics), - union: (d) => emitUnion(d.name, d.variants, d.generics), - alias: (d) => [emitAlias(d.name, d.target)], + record: (d) => emitRecord(d.name, d.fields, d.generics, mapType), + union: (d) => emitUnion(d.name, d.variants, d.generics, mapType), + alias: (d) => [aliasOrderMarker(d.name).trimEnd()], }, - { prelude: ["#nullable enable", ""] } + { prelude: ["#nullable enable", "using System;", "using System.Collections.Generic;", ...aliases, ""] } ); +}; export const csharp: Converter = { language: "csharp", diff --git a/packages/typediagram/src/converters/dart.ts b/src/typediagram/src/converters/dart.ts similarity index 85% rename from packages/typediagram/src/converters/dart.ts rename to src/typediagram/src/converters/dart.ts index f3a28da..e7f98c7 100644 --- a/packages/typediagram/src/converters/dart.ts +++ b/src/typediagram/src/converters/dart.ts @@ -26,6 +26,13 @@ import { makeConsumedTracker, orderBySource, scanAll, scanBraceBlocks } from "./ const TD_TO_DART: Record = { Bool: "bool", Int: "int", + I32: "int", + U8: "int", + U16: "int", + U32: "int", + U64: "int", + Size: "int", + Path: "String", Float: "double", String: "String", Bytes: "List", @@ -115,7 +122,33 @@ const parseDartFields = (body: string) => { return fields; }; +const dartDiag = (message: string): Diagnostic => ({ severity: "error", message, line: 0, col: 0, length: 0 }); + +/** Dart function types (`void Function(String)`) have no typeDiagram form. */ +const functionTypeDiags = (owner: string, fields: ReadonlyArray<{ name: string; type: string }>): Diagnostic[] => + fields + .filter((f) => f.type.includes("Function(")) + .map((f) => dartDiag(`Dart function type '${f.type}' in ${owner}.${f.name} has no typeDiagram equivalent`)); + +/** [CONV-DART-RECORD] `typedef X = ({String a, int? b});` → record fields, or + * diagnostics for positional fields / function types (never invalid .td). */ +const recordTypedefFields = (name: string, target: string) => { + const inner = target.slice(1, target.lastIndexOf(")")).trim(); + const named = inner.startsWith("{") && inner.endsWith("}"); + const fields = named + ? splitTopLevelCommas(inner.slice(1, -1)).map((part) => { + const cut = part.search(/\s\w+$/); + return { name: part.slice(cut + 1).trim(), type: part.slice(0, cut).trim() }; + }) + : []; + const diags = named + ? functionTypeDiags(name, fields) + : [dartDiag(`Dart record '${name}' has positional fields; only named record fields map to typeDiagram`)]; + return { fields: fields.map((f) => ({ name: f.name, type: mapDartType(f.type) })), diags }; +}; + const fromDart = (source: string): Result => { + const diagnostics: Diagnostic[] = []; const builder = new ModelBuilder(); let found = false; @@ -222,13 +255,21 @@ const fromDart = (source: string): Result => { builder.add(union(p.name, variants)); continue; } - // alias + if (p.target.startsWith("(")) { + const rec = recordTypedefFields(p.name, p.target); + diagnostics.push(...rec.diags); + builder.add(record(p.name, resolveFieldTypes(rec.fields), p.generics)); + continue; + } + diagnostics.push(...functionTypeDiags(p.name, [{ name: "target", type: p.target }])); builder.add(alias(p.name, parseTypeRef(mapDartType(p.target)), p.generics)); } - return found - ? builder.build() - : err([{ severity: "error", message: "No Dart type definitions found", line: 0, col: 0, length: 0 }]); + return diagnostics.length > 0 + ? err(diagnostics) + : found + ? builder.build() + : err([{ severity: "error", message: "No Dart type definitions found", line: 0, col: 0, length: 0 }]); }; // ── To Dart ── diff --git a/packages/typediagram/src/converters/emit-decls.ts b/src/typediagram/src/converters/emit-decls.ts similarity index 96% rename from packages/typediagram/src/converters/emit-decls.ts rename to src/typediagram/src/converters/emit-decls.ts index ae42443..93c5c87 100644 --- a/packages/typediagram/src/converters/emit-decls.ts +++ b/src/typediagram/src/converters/emit-decls.ts @@ -12,7 +12,6 @@ import { type ResolvedUnion, visibleDataDeclsForTarget, } from "../model/types.js"; -import type { Language } from "./types.js"; /** Per-decl emitters. Each returns the source lines for one declaration. */ export interface DeclEmitters { @@ -37,7 +36,7 @@ const emitOne = (d: Model["decls"][number], emit: DeclEmitters): string[] => */ export const emitDecls = ( model: Model, - language: Language, + language: string, emit: DeclEmitters, options: EmitDeclsOptions = {} ): string => { diff --git a/packages/typediagram/src/converters/fsharp.ts b/src/typediagram/src/converters/fsharp.ts similarity index 98% rename from packages/typediagram/src/converters/fsharp.ts rename to src/typediagram/src/converters/fsharp.ts index c2639e4..32b34e3 100644 --- a/packages/typediagram/src/converters/fsharp.ts +++ b/src/typediagram/src/converters/fsharp.ts @@ -12,6 +12,13 @@ import { parseFields, scanAll } from "./scan-decls.js"; const TD_TO_FS: Record = { Bool: "bool", Int: "int", + I32: "int", + U8: "byte", + U16: "uint16", + U32: "uint32", + U64: "uint64", + Size: "uint64", + Path: "string", Float: "float", String: "string", Bytes: "byte[]", diff --git a/packages/typediagram/src/converters/go.ts b/src/typediagram/src/converters/go.ts similarity index 99% rename from packages/typediagram/src/converters/go.ts rename to src/typediagram/src/converters/go.ts index 72c1aad..4e3d94f 100644 --- a/packages/typediagram/src/converters/go.ts +++ b/src/typediagram/src/converters/go.ts @@ -20,6 +20,13 @@ import { orderBySource, parseFields, scanAll, scanBraceBlocks } from "./scan-dec const TD_TO_GO: Record = { Bool: "bool", Int: "int64", + I32: "int32", + U8: "uint8", + U16: "uint16", + U32: "uint32", + U64: "uint64", + Size: "uint", + Path: "string", Float: "float64", String: "string", Bytes: "[]byte", diff --git a/packages/typediagram/src/converters/index.ts b/src/typediagram/src/converters/index.ts similarity index 100% rename from packages/typediagram/src/converters/index.ts rename to src/typediagram/src/converters/index.ts diff --git a/src/typediagram/src/converters/osprey.ts b/src/typediagram/src/converters/osprey.ts new file mode 100644 index 0000000..7a66061 --- /dev/null +++ b/src/typediagram/src/converters/osprey.ts @@ -0,0 +1,124 @@ +// [CONV-OSPREY] One-way model emission; no parser or shared-memory ABI is implied. +import { + visibleDeclsForTarget, + walkDeclRefs, + type Model, + type ResolvedDecl, + type ResolvedTypeRef, +} from "../model/types.js"; +import type { Diagnostic } from "../parser/diagnostics.js"; +import { err, ok, type Result } from "../result.js"; +import { emitDecls, type DeclEmitters } from "./emit-decls.js"; +import { mapBuiltinName } from "./parse-typeref.js"; + +const PRIMITIVES: Readonly> = { + Int: "int", + I32: "int", + U8: "int", + U16: "int", + U32: "int", + U64: "int", + Size: "int", + Path: "string", + Float: "float", + Bool: "bool", + String: "string", + Unit: "unit", + Uuid: "string", + List: "List", + Option: "Option", + Result: "Result", +}; + +// Osprey ML keyword spellings; reject rather than silently rename schema members. +const RESERVED = new Set( + "mut true false match type extern spawn effect perform handle handler resume mask instance in await yield send recv select import namespace module signature export opaque state as do".split( + " " + ) +); + +const typeName = (type: ResolvedTypeRef): string => { + const name = mapBuiltinName(type, PRIMITIVES); + return type.args.length === 0 ? name : `${name}<${type.args.map(typeName).join(", ")}>`; +}; + +const header = (decl: { name: string; generics: string[] }): string => + `type ${[decl.name, ...decl.generics].join(" ")} =`; + +const memberNames = (decl: ResolvedDecl) => + decl.kind === "record" + ? decl.fields.map((field) => field.name) + : decl.kind === "union" + ? decl.variants.flatMap((variant) => [variant.name, ...variant.fields.map((field) => field.name)]) + : []; + +const declarationErrors = (decl: ResolvedDecl) => [ + ...(decl.kind === "function" || + (decl.kind === "record" && decl.fields.length === 0) || + (decl.kind === "union" && decl.variants.length === 0) + ? [`osprey: unsupported declaration '${decl.name}'`] + : []), + ...[decl.name, ...decl.generics, ...memberNames(decl)] + .filter((name) => RESERVED.has(name)) + .map((name) => `osprey: reserved identifier '${name}'`), +]; + +const referenceErrors = (decl: ResolvedDecl) => { + const messages: string[] = []; + walkDeclRefs(decl, (type) => { + const arity = type.name === "Result" ? 2 : type.name === "List" || type.name === "Option" ? 1 : 0; + const builtin = type.resolution.kind === "external" || type.resolution.kind === "primitive"; + messages.push( + ...(builtin && (PRIMITIVES[type.name] === undefined || type.args.length !== arity) + ? [`osprey: unsupported type '${type.name}'`] + : []) + ); + }); + return messages; +}; + +const constructorErrors = (decls: readonly ResolvedDecl[]) => { + const seen = new Set([...Object.keys(PRIMITIVES), ...decls.map((decl) => decl.name)]); + return decls + .flatMap((decl) => (decl.kind === "union" ? decl.variants : [])) + .flatMap((variant) => { + const errors = seen.has(variant.name) ? [`osprey: constructor collision '${variant.name}'`] : []; + seen.add(variant.name); + return errors; + }); +}; + +const unsupported = (model: Model): Diagnostic[] => { + const decls = visibleDeclsForTarget(model.decls, "osprey"); + const messages = new Set([ + ...constructorErrors(decls), + ...decls.flatMap(declarationErrors), + ...decls.flatMap(referenceErrors), + ]); + return [...messages].map((message) => ({ severity: "error", message, line: 0, col: 0, length: 0 })); +}; + +const EMITTERS: DeclEmitters = { + record: (decl) => [header(decl), ...decl.fields.map((field) => ` ${field.name} : ${typeName(field.type)}`)], + union: (decl) => [ + header(decl), + ...decl.variants.flatMap((variant) => [ + ` ${variant.name}`, + ...variant.fields.map((field) => ` ${field.name} : ${typeName(field.type)}`), + ]), + ], + alias: (decl) => [`${header(decl)} ${typeName(decl.target)}`], +}; + +/** Emit Osprey ML model declarations, refusing types without a defined mapping. */ +export const generateOspreyModule = (model: Model): Result => { + const diagnostics = unsupported(model); + return diagnostics.length > 0 + ? err(diagnostics) + : ok( + emitDecls(model, "osprey", EMITTERS, { + prelude: ["// Generated from typeDiagram [CONV-OSPREY]."], + trimTrailing: true, + }) + ); +}; diff --git a/packages/typediagram/src/converters/parse-typeref.ts b/src/typediagram/src/converters/parse-typeref.ts similarity index 100% rename from packages/typediagram/src/converters/parse-typeref.ts rename to src/typediagram/src/converters/parse-typeref.ts diff --git a/packages/typediagram/src/converters/php.ts b/src/typediagram/src/converters/php.ts similarity index 99% rename from packages/typediagram/src/converters/php.ts rename to src/typediagram/src/converters/php.ts index 333d126..2074c62 100644 --- a/packages/typediagram/src/converters/php.ts +++ b/src/typediagram/src/converters/php.ts @@ -9,6 +9,13 @@ import { mapBuiltinName, parseTypeRef } from "./parse-typeref.js"; const TD_TO_PHP_SCALAR: Record = { Bool: "bool", Int: "int", + I32: "int", + U8: "int", + U16: "int", + U32: "int", + U64: "int", + Size: "int", + Path: "string", Float: "float", String: "string", Bytes: "string", diff --git a/packages/typediagram/src/converters/protobuf.ts b/src/typediagram/src/converters/protobuf.ts similarity index 99% rename from packages/typediagram/src/converters/protobuf.ts rename to src/typediagram/src/converters/protobuf.ts index 197c322..ec0600f 100644 --- a/packages/typediagram/src/converters/protobuf.ts +++ b/src/typediagram/src/converters/protobuf.ts @@ -38,6 +38,13 @@ import { makeConsumedTracker, orderBySource, scanAll, scanBraceBlocks } from "./ const TD_TO_PROTO: Record = { Bool: "bool", Int: "int64", + I32: "int32", + U8: "uint32", + U16: "uint32", + U32: "uint32", + U64: "uint64", + Size: "uint64", + Path: "string", Float: "double", String: "string", Bytes: "bytes", diff --git a/packages/typediagram/src/converters/python.ts b/src/typediagram/src/converters/python.ts similarity index 99% rename from packages/typediagram/src/converters/python.ts rename to src/typediagram/src/converters/python.ts index e8499a3..40106bc 100644 --- a/packages/typediagram/src/converters/python.ts +++ b/src/typediagram/src/converters/python.ts @@ -35,6 +35,13 @@ import { orderBySource, parseFields, scanAll } from "./scan-decls.js"; const TD_TO_PY: Record = { Bool: "bool", Int: "int", + I32: "int", + U8: "int", + U16: "int", + U32: "int", + U64: "int", + Size: "int", + Path: "str", Float: "float", String: "str", Bytes: "bytes", diff --git a/packages/typediagram/src/converters/rust-tdbin-columnar.ts b/src/typediagram/src/converters/rust-tdbin-columnar.ts similarity index 93% rename from packages/typediagram/src/converters/rust-tdbin-columnar.ts rename to src/typediagram/src/converters/rust-tdbin-columnar.ts index d711c3e..3e06b7a 100644 --- a/packages/typediagram/src/converters/rust-tdbin-columnar.ts +++ b/src/typediagram/src/converters/rust-tdbin-columnar.ts @@ -113,7 +113,7 @@ const recordColumns = (decls: readonly ResolvedDecl[], rec: ResolvedRecord): Res const columns = columnPlans(decls, rec); return isFieldError(columns) ? err(diag(columns.error)) - : ok(columns.map((c) => ({ ...c, read: readColumn(c.name, c.slot, c.plan) }))); + : ok(columns.map((c, i) => ({ ...c, read: readColumn(`f${String(i)}`, c.slot, c.plan) }))); }; const recordReadBody = (columns: RecordColumn[]): string[] => { @@ -148,7 +148,8 @@ const emitRecordGroup = (decls: readonly ResolvedDecl[], rec: ResolvedRecord): R type UnionVariant = UnionPlan["variants"][number]; -/** A union variant with its allocated payload slot and snake_case local name. */ +/** [TDBIN-CODEGEN-LOCALS] A union variant with its allocated payload slot and positional local name + * (`v0`, `v0_count`): variant-derived names could shadow `w`/`r`/`at`/`items`. */ export interface UnionColumn extends UnionVariant { slot: number; local: string; @@ -158,18 +159,16 @@ type PayloadColumn = UnionColumn & { payload: Exclude v.payload !== null; -const snake = (name: string): string => name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase(); - /** Column slots a variant's payload occupies ([TDBIN-COL-UNION]). */ export const payloadSlots = (v: UnionVariant): number => (v.payload === null ? 0 : v.payload.kind === "child" ? 1 : 2); /** Per-variant payload column slots, allocated after the tag column at slot 0. */ export const unionColumns = (plan: UnionPlan): UnionColumn[] => { let slot = 1; - return plan.variants.map((v) => { + return plan.variants.map((v, i) => { const at = slot; slot = slot + payloadSlots(v); - return { ...v, slot: at, local: snake(v.name) }; + return { ...v, slot: at, local: `v${String(i)}` }; }); }; @@ -253,6 +252,14 @@ const emitUnionGroup = (u: ResolvedUnion): Result => { if (!plan.ok) { return plan; } + const inline = plan.value.variants.find((v) => v.payload?.kind === "inline"); + if (inline !== undefined) { + return err( + diag( + `tdbin: union '${u.name}' variant '${inline.name}' has a struct-form payload, which layout 2 column groups do not support yet; use layout 1 [TDBIN-UNION-STRUCT]` + ) + ); + } const variants = unionColumns(plan.value); const columns = 1 + variants.reduce((sum, v) => sum + payloadSlots(v), 0); return ok(groupImpl(u.name, columns, unionWriteBody(variants), unionReadBody(variants))); diff --git a/packages/typediagram/src/converters/rust-tdbin-columns.ts b/src/typediagram/src/converters/rust-tdbin-columns.ts similarity index 98% rename from packages/typediagram/src/converters/rust-tdbin-columns.ts rename to src/typediagram/src/converters/rust-tdbin-columns.ts index e2bd7d9..3202b81 100644 --- a/packages/typediagram/src/converters/rust-tdbin-columns.ts +++ b/src/typediagram/src/converters/rust-tdbin-columns.ts @@ -211,8 +211,9 @@ const writeNested = (f: string, k: number, p: NestedPlan): string[] => [ * single materialized ref vector — never a second full-list scan. */ const writeOptGroup = (f: string, k: number, p: Extract): string[] => [ validityLine(f, k), - `${W}let ${f}: Vec<&${p.rustType}> = items.clone().filter_map(|row| row.${f}.as_ref()).collect();`, - `${W}w.dense_group(at, 1, ${rsNumber(k + 1)}, ${f}.len(), ${f}.iter().copied())?;`, + // `_some` suffix: a bare field-named local could shadow `items`/`w`/`at`/`count`. + `${W}let ${f}_some: Vec<&${p.rustType}> = items.clone().filter_map(|row| row.${f}.as_ref()).collect();`, + `${W}w.dense_group(at, 1, ${rsNumber(k + 1)}, ${f}_some.len(), ${f}_some.iter().copied())?;`, ]; const writeOptColumn = ( diff --git a/packages/typediagram/src/converters/rust-tdbin-fields.ts b/src/typediagram/src/converters/rust-tdbin-fields.ts similarity index 78% rename from packages/typediagram/src/converters/rust-tdbin-fields.ts rename to src/typediagram/src/converters/rust-tdbin-fields.ts index c16e07c..3e46e6e 100644 --- a/packages/typediagram/src/converters/rust-tdbin-fields.ts +++ b/src/typediagram/src/converters/rust-tdbin-fields.ts @@ -15,6 +15,7 @@ import { type RecordPlan, rsNumber, type UnionPlan, + type VariantPlan, } from "./rust-tdbin-plan.js"; export const bytes16Source = (semantic: Bytes16Semantic, value: string): string => @@ -30,6 +31,19 @@ const dateTimeFromBits = (word: string): string => dateTimeResult(`tdbin::scalar const listSource = (self: string, optional: boolean): string => (optional ? `${self}.as_deref()` : `Some(&${self})`); +/** [TDBIN-WIDTH-PATH] `List` is a `List` on the wire; a non-UTF-8 + * path fails the encode with `NonUtf8Path`. */ +const writePathList = (name: string, self: string, slot: number, optional: boolean): string => { + const strings = (source: string): string => + `${source}.iter().map(|path| tdbin::scalar::path_string(path)).collect::, _>>()`; + return [ + optional + ? ` let ${name}_strings = ${self}.as_ref().map(|values| { ${strings("values")} }).transpose()?;` + : ` let ${name}_strings = ${strings(self)}?;`, + ` w.string_list(at, Self::DATA_WORDS, ${rsNumber(slot)}, ${optional ? `${name}_strings.as_deref()` : `Some(&${name}_strings)`})?;`, + ].join("\n"); +}; + const collectWordList = (source: string, map: string): string => `${source}.iter().map(${map}).collect::>()`; const writeDateTimeList = (name: string, self: string, slot: number, optional: boolean): string => { @@ -63,7 +77,7 @@ const writeBytes16List = ( }; const enumOrdinalArm = (rustType: string, name: string, ordinal: number): string => - ` &${rustType}::${name} => ${rsNumber(ordinal)}u8,`; + ` ${rustType}::${name} => ${rsNumber(ordinal)}u8,`; const writeEnumList = ( name: string, @@ -100,6 +114,8 @@ const writeList = (name: string, p: Extract): strin return writeBytes16List(name, self, p.list, p.slot, p.optional); case "string": return ` w.string_list(at, Self::DATA_WORDS, ${rsNumber(p.slot)}, ${listSource(self, p.optional)})?;`; + case "path": + return writePathList(name, self, p.slot, p.optional); case "bytes": return ` w.bytes_list(at, Self::DATA_WORDS, ${rsNumber(p.slot)}, ${listSource(self, p.optional)})?;`; case "child": @@ -162,6 +178,8 @@ export const writeField = (name: string, p: FieldPlan): string => { return writeOptBytes16(name, p); case "string": return ` w.string(at, Self::DATA_WORDS, ${rsNumber(p.slot)}, ${p.optional ? `${self}.as_deref()` : `Some(&${self})`})?;`; + case "path": + return ` w.string(at, Self::DATA_WORDS, ${rsNumber(p.slot)}, ${p.optional ? `${self}.as_deref().map(tdbin::scalar::path_str).transpose()?` : `Some(tdbin::scalar::path_str(&${self})?)`})?;`; case "bytes": return ` w.bytes(at, Self::DATA_WORDS, ${rsNumber(p.slot)}, ${p.optional ? `${self}.as_deref()` : `Some(&${self})`})?;`; case "child": @@ -251,6 +269,8 @@ const readList = (name: string, p: Extract): string return readBytes16List(name, p.list, p.slot, p.optional); case "string": return ` let ${name} = r.string_list(at, Self::DATA_WORDS, ${rsNumber(p.slot)})${readTail(p.optional)};`; + case "path": + return ` let ${name} = r.string_list(at, Self::DATA_WORDS, ${rsNumber(p.slot)})?${p.optional ? ".map(|values| { values.into_iter().map(std::path::PathBuf::from).collect::>() })" : ".map_or_else(Vec::new, |values| { values.into_iter().map(std::path::PathBuf::from).collect() })"};`; case "bytes": return ` let ${name} = r.bytes_list(at, Self::DATA_WORDS, ${rsNumber(p.slot)})${readTail(p.optional)};`; case "child": @@ -266,7 +286,7 @@ const readPresenceBit = (name: string, p: { presenceSlot: number; presenceBit: n const readOptScalar = (name: string, p: Extract): string => [ readPresenceBit(name, p), - ` let ${name}_value = tdbin::scalar::${p.from}(r.scalar(at, ${rsNumber(p.valueSlot)})?);`, + ` let ${name}_value = tdbin::scalar::${p.from}(r.scalar(at, ${rsNumber(p.valueSlot)})?)${p.fallible === true ? "?" : ""};`, ` let ${name} = ${name}_present.then_some(${name}_value);`, ].join("\n"); @@ -298,7 +318,7 @@ const readVarList = (name: string, p: Extract): export const readField = (name: string, p: FieldPlan): string => { switch (p.kind) { case "scalar": - return ` let ${name} = tdbin::scalar::${p.from}(r.scalar(at, ${rsNumber(p.slot)})?);`; + return ` let ${name} = tdbin::scalar::${p.from}(r.scalar(at, ${rsNumber(p.slot)})?)${p.fallible === true ? "?" : ""};`; case "boolBit": return ` let ${name} = r.bool_bit(at, ${rsNumber(p.slot)}, ${rsNumber(p.bit)})?;`; case "dateTime": @@ -318,6 +338,8 @@ export const readField = (name: string, p: FieldPlan): string => { return readOptBytes16(name, p); case "string": return ` let ${name} = r.string(at, Self::DATA_WORDS, ${rsNumber(p.slot)})${readTail(p.optional)};`; + case "path": + return ` let ${name} = r.string(at, Self::DATA_WORDS, ${rsNumber(p.slot)})?${p.optional ? ".map(std::path::PathBuf::from)" : ".map_or_else(std::path::PathBuf::new, std::path::PathBuf::from)"};`; case "bytes": return ` let ${name} = r.bytes(at, Self::DATA_WORDS, ${rsNumber(p.slot)})${readTail(p.optional)};`; case "child": @@ -344,36 +366,77 @@ export const emitRecordCodec = (rec: ResolvedRecord, plan: RecordPlan, layoutHas ` }`, ``, ` fn read_struct(r: &tdbin::Reader<'_>, at: usize) -> Result {`, - ...plan.fields.map((f) => readField(f.name, f.plan)), - ` Ok(Self { ${plan.fields.map((f) => f.name).join(", ")} })`, + // Positional locals (`f0`, `f0_present`, …): a field named `r`/`at` would + // otherwise shadow the reader params mid-decode ([TDBIN-CODEGEN-LOCALS]). + ...plan.fields.map((f, i) => readField(`f${String(i)}`, f.plan)), + ` Ok(Self { ${plan.fields.map((f, i) => `${f.name}: f${String(i)}`).join(", ")} })`, ` }`, `}`, ].join("\n"); // Variants are constructed inside `impl tdbin::Struct for `, so they are // spelled `Self::Variant` (clippy `use_self`, denied under pedantic). -const writeVariantArm = (v: UnionPlan["variants"][number]): string => { - const head = ` Self::${v.name}`; - if (v.payload === null) { - return `${head} => {\n w.scalar(at, 0, ${rsNumber(v.ordinal)})?;\n Ok(())\n }`; - } - const call = - v.payload.kind === "child" - ? `w.child(at, Self::DATA_WORDS, 0, Some(payload))` - : `w.string(at, Self::DATA_WORDS, 0, Some(payload))`; - return `${head}(payload) => {\n w.scalar(at, 0, ${rsNumber(v.ordinal)})?;\n ${call}\n }`; +type VariantArm = UnionPlan["variants"][number]; +type InlinePayload = Extract; + +/** Bindings are positional (`f0`, `f1`, …) so a field named `w`/`r`/`at` + * never shadows the codec's writer, reader or offset ([TDBIN-UNION-STRUCT]). */ +const inlinePattern = (name: string, p: InlinePayload): string => { + const binds = p.fields.map((_, i) => `f${rsNumber(i)}`); + return p.tuple + ? `Self::${name}(${binds.join(", ")})` + : `Self::${name} { ${p.fields.map((f, i) => `${f.name}: ${binds[i] ?? ""}`).join(", ")} }`; +}; + +const inlineFromPayload = (name: string, p: InlinePayload): string => + p.tuple + ? `Self::${name}(${p.fields.map((f) => `payload.${f.payload}`).join(", ")})` + : `Self::${name} { ${p.fields.map((f) => `${f.name}: payload.${f.payload}`).join(", ")} }`; + +/** `ShapeRectTdbinPayload { w: *f0, corner: f2.clone(), … }` built from the arm bindings. */ +const inlineToPayload = (p: InlinePayload): string => + `${p.rustType} { ${p.fields.map((f, i) => `${f.payload}: ${f.copy ? `*f${rsNumber(i)}` : `f${rsNumber(i)}.clone()`}`).join(", ")} }`; + +const variantWrite = (v: VariantArm): { pattern: string; call: string } => { + const disc = `w.scalar(at, 0, ${rsNumber(v.ordinal)})?;`; + const p = v.payload; + return p === null + ? { pattern: `Self::${v.name}`, call: `${disc}\n Ok(())` } + : p.kind === "inline" + ? { + pattern: inlinePattern(v.name, p), + call: `${disc}\n w.child(at, Self::DATA_WORDS, 0, Some(&${inlineToPayload(p)}))`, + } + : { + pattern: `Self::${v.name}(payload)`, + call: `${disc}\n ${p.kind === "child" ? "w.child" : "w.string"}(at, Self::DATA_WORDS, 0, Some(payload))`, + }; +}; + +// Variants are constructed inside `impl tdbin::Struct for `, so they are +// spelled `Self::Variant` (clippy `use_self`, denied under pedantic). +const writeVariantArm = (v: VariantArm): string => { + const { pattern, call } = variantWrite(v); + return ` ${pattern} => {\n ${call}\n }`; }; -const readVariantArm = (v: UnionPlan["variants"][number]): string => { - if (v.payload === null) { +const readVariantArm = (v: VariantArm): string => { + const p = v.payload; + if (p === null) { return ` ${rsNumber(v.ordinal)} => { r.require_null_pointer(at, 0)?; Ok(Self::${v.name}) },`; } + if (p.kind === "inline") { + return ` ${rsNumber(v.ordinal)} => { + let payload = r.child::<${p.rustType}>(at, Self::DATA_WORDS, 0)?.unwrap_or_default(); + Ok(${inlineFromPayload(v.name, p)}) + },`; + } const read = - v.payload.kind === "child" - ? `r.child::<${v.payload.rustType}>(at, Self::DATA_WORDS, 0)?.unwrap_or_default()` + p.kind === "child" + ? `r.child::<${p.rustType}>(at, Self::DATA_WORDS, 0)?.unwrap_or_default()` : `r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default()`; return ` ${rsNumber(v.ordinal)} => Ok(Self::${v.name}(${read})),`; }; @@ -410,12 +473,16 @@ export const emitUnionCodec = (u: ResolvedUnion, plan: UnionPlan, layoutHash: st `}`, ].join("\n"); -const defaultVariant = (v: UnionPlan["variants"][number]): string => - v.payload === null +const defaultVariant = (v: VariantArm): string => { + const p = v.payload; + return p === null ? `Self::${v.name}` - : v.payload.kind === "child" - ? `Self::${v.name}(${v.payload.rustType}::default())` - : `Self::${v.name}(String::default())`; + : p.kind === "inline" + ? `{\n let payload = ${p.rustType}::default();\n ${inlineFromPayload(v.name, p)}\n }` + : p.kind === "child" + ? `Self::${v.name}(${p.rustType}::default())` + : `Self::${v.name}(String::default())`; +}; /** Unions default to their FIRST variant so required union fields can decode a * null pointer as the schema default ([TDBIN-PTR-NULL], [TDBIN-REC-SHORT]). */ @@ -424,6 +491,11 @@ export const emitUnionDefault = (u: ResolvedUnion, plan: UnionPlan): Result (bits === "i64_bits" ? "i64" : "f64"); +/** `i64_bits` → `i64`, `u16_bits` → `u16`, … ([TDBIN-WIDTH-RANGE] widths hash distinctly). */ +const scalarKind = (bits: string): string => bits.slice(0, -"_bits".length); + +/** List element token per flat list method; `byte_list`/`word_list` carry U8/U64. */ +const FLAT_ELEM: Record = { byte_list: "u8", word_list: "u64" }; +const flatElem = (method: string): string => FLAT_ELEM[method] ?? method.slice(0, -"_list".length); const semanticKind = (semantic: "Uuid" | "Decimal"): string => (semantic === "Uuid" ? "uuid" : "dec"); @@ -113,7 +119,7 @@ const plannedRefNames = (planned: Planned): string[] => planned.kind === "record" ? planned.plan.fields.flatMap((f) => fieldRefNames(f.plan)) : planned.plan.variants.flatMap((v) => - v.payload !== null && v.payload.kind === "child" ? [v.payload.rustType] : [] + v.payload !== null && v.payload.kind !== "string" ? [v.payload.rustType] : [] ); const planOf = (decls: readonly ResolvedDecl[], d: ResolvedDecl, layout: Layout): Result => { @@ -162,7 +168,7 @@ const listElem = (ctx: ManifestCtx, list: ListPlan): Result => { - const ctx: ManifestCtx = { decls, layout, indices: new Map(), order: [] }; + const ctx: ManifestCtx = { decls: withVariantRecords(decls), layout, indices: new Map(), order: [] }; const walked = discover(ctx, root.name); if (!walked.ok) { return walked; diff --git a/packages/typediagram/src/converters/rust-tdbin-plan.ts b/src/typediagram/src/converters/rust-tdbin-plan.ts similarity index 81% rename from packages/typediagram/src/converters/rust-tdbin-plan.ts rename to src/typediagram/src/converters/rust-tdbin-plan.ts index 9cb8814..9309e56 100644 --- a/packages/typediagram/src/converters/rust-tdbin-plan.ts +++ b/src/typediagram/src/converters/rust-tdbin-plan.ts @@ -13,6 +13,7 @@ import { } from "../model/types.js"; import { printTypeRef } from "./parse-typeref.js"; import { mapTdToRs } from "./rust.js"; +import { isInlineVariant, isTupleVariant, payloadFieldName, variantPayloadName } from "./tdbin-variant-records.js"; import { err, ok, type Result } from "../result.js"; import { allocateAlignedPair, @@ -29,22 +30,49 @@ export type Layout = 1 | 2; /** Word scalars stored raw in the data section, with their codec fns. Bool is * NOT here: direct and optional Bools are bit-allocated ([TDBIN-WIRE-WORD]). */ -const SCALARS: Record = { +/** One-word scalars. `fallible` decodes narrow with a typed range check + * ([TDBIN-WIDTH-RANGE]), so the read appends `?`. */ +export interface ScalarCodec { + bits: string; + from: string; + fallible?: boolean; +} + +const SCALARS: Record = { Int: { bits: "i64_bits", from: "i64_from" }, Float: { bits: "f64_bits", from: "f64_from" }, + I32: { bits: "i32_bits", from: "i32_from", fallible: true }, + U8: { bits: "u8_bits", from: "u8_from", fallible: true }, + U16: { bits: "u16_bits", from: "u16_from", fallible: true }, + U32: { bits: "u32_bits", from: "u32_from", fallible: true }, + U64: { bits: "u64_bits", from: "u64_from" }, + Size: { bits: "usize_bits", from: "usize_from", fallible: true }, +}; + +/** [TDBIN-WIDTH-LIST] list method per one-word scalar element. */ +const FLAT_LIST: Record = { + Int: "i64_list", + Float: "f64_list", + I32: "i32_list", + U8: "byte_list", + U16: "u16_list", + U32: "u32_list", + U64: "word_list", + Size: "usize_list", }; /** How a record field is laid out on the wire. */ export type FieldPlan = - | { kind: "scalar"; slot: number; bits: string; from: string } + | ({ kind: "scalar"; slot: number } & ScalarCodec) | { kind: "boolBit"; slot: number; bit: number } | { kind: "dateTime"; slot: number } | { kind: "bytes16"; slot: number; semantic: Bytes16Semantic } - | { kind: "optScalar"; presenceSlot: number; presenceBit: number; valueSlot: number; bits: string; from: string } + | ({ kind: "optScalar"; presenceSlot: number; presenceBit: number; valueSlot: number } & ScalarCodec) | { kind: "optBool"; presenceSlot: number; presenceBit: number; valueSlot: number; valueBit: number } | { kind: "optDateTime"; presenceSlot: number; presenceBit: number; valueSlot: number } | { kind: "optBytes16"; presenceSlot: number; presenceBit: number; valueSlot: number; semantic: Bytes16Semantic } | { kind: "string"; slot: number; optional: boolean } + | { kind: "path"; slot: number; optional: boolean } | { kind: "bytes"; slot: number; optional: boolean } | { kind: "child"; slot: number; optional: boolean; rustType: string } | { kind: "list"; slot: number; optional: boolean; list: ListPlan } @@ -53,11 +81,12 @@ export type FieldPlan = export type ListPlan = | { kind: "bool" } - | { kind: "flat"; method: "i64_list" | "f64_list" } + | { kind: "flat"; method: string } | { kind: "intBlock" } | { kind: "dateTime" } | { kind: "bytes16"; semantic: Bytes16Semantic } | { kind: "string" } + | { kind: "path" } | { kind: "bytes" } | { kind: "child"; rustType: string } | { kind: "enum"; rustType: string; variants: string[] }; @@ -74,7 +103,20 @@ export interface RecordPlan { } /** A union variant's payload placement (all share pointer slot 0). */ -export type VariantPlan = null | { kind: "child"; rustType: string } | { kind: "string" }; +export type VariantPlan = + | null + | { kind: "child"; rustType: string } + | { kind: "string" } + /** [TDBIN-UNION-STRUCT] several fields → pointer to a synthetic payload record. */ + | { kind: "inline"; rustType: string; fields: InlineField[]; tuple: boolean }; + +/** One struct-form variant field: its ADT name, payload-record name, and + * whether the Rust type is `Copy` (deref instead of clone; clippy `clone_on_copy`). */ +export interface InlineField { + name: string; + payload: string; + copy: boolean; +} /** A fully-classified union. */ export interface UnionPlan { @@ -132,14 +174,16 @@ const pointerInner = ( ): FieldPlan | FieldError | null => isPrim(t, "String") ? { kind: "string", slot, optional } - : isPrim(t, "Bytes") - ? { kind: "bytes", slot, optional } - : isDeclared(t) - ? { kind: "child", slot, optional, rustType: mapTdToRs(t) } - : null; + : isPrim(t, "Path") + ? { kind: "path", slot, optional } + : isPrim(t, "Bytes") + ? { kind: "bytes", slot, optional } + : isDeclared(t) + ? { kind: "child", slot, optional, rustType: mapTdToRs(t) } + : null; /** The one-word scalar codec for a bare primitive (Bool/Int/Float), else undefined. */ -export const scalarOf = (t: ResolvedTypeRef): { bits: string; from: string } | undefined => +export const scalarOf = (t: ResolvedTypeRef): ScalarCodec | undefined => t.args.length === 0 && t.resolution.kind === "primitive" ? SCALARS[t.name] : undefined; const isSemanticName = (name: string): name is SemanticScalar => @@ -211,8 +255,8 @@ const childListPlan = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): List return null; }; -const flatListMethod = (t: ResolvedTypeRef): "i64_list" | "f64_list" | undefined => - isPrim(t, "Int") ? "i64_list" : isPrim(t, "Float") ? "f64_list" : undefined; +const flatListMethod = (t: ResolvedTypeRef): string | undefined => + t.args.length === 0 && t.resolution.kind === "primitive" ? FLAT_LIST[t.name] : undefined; const listPlanFor = (decls: readonly ResolvedDecl[], inner: ResolvedTypeRef): ListPlan | FieldError | null => { const flat = flatListMethod(inner); @@ -234,6 +278,9 @@ const listPlanFor = (decls: readonly ResolvedDecl[], inner: ResolvedTypeRef): Li if (isPrim(inner, "String")) { return { kind: "string" }; } + if (isPrim(inner, "Path")) { + return { kind: "path" }; + } if (isPrim(inner, "Bytes")) { return { kind: "bytes" }; } @@ -339,8 +386,7 @@ const classifyOption = ( presenceSlot: presence.slot, presenceBit: presence.bit, valueSlot: allocateWord(cursor), - bits: innerScalar.bits, - from: innerScalar.from, + ...innerScalar, }; } const plan = pointerInner(decls, inner, cursor.ptrSlot, true); @@ -366,7 +412,7 @@ const classifyField = ( } const scalar = scalarOf(t); if (scalar !== undefined) { - return { kind: "scalar", slot: allocateWord(cursor), bits: scalar.bits, from: scalar.from }; + return { kind: "scalar", slot: allocateWord(cursor), ...scalar }; } const optionInner = optionInnerOf(t); if (optionInner !== undefined) { @@ -403,19 +449,33 @@ export const classifyRecord = ( return ok({ dataWords: cursor.dataSlot, ptrWords: cursor.ptrSlot, fields }); }; -const classifyVariant = (v: ResolvedVariant): Result => { +const isCopy = (t: ResolvedTypeRef): boolean => { + const inner = optionInnerOf(t); + return scalarOf(t) !== undefined || semanticOf(t) !== undefined || (inner !== undefined && isCopy(inner)); +}; + +const classifyVariant = (u: ResolvedUnion, v: ResolvedVariant): Result => { if (v.fields.length === 0) { return ok(null); } - const single = variantPayloadType(v); - if (single === undefined) { - return err(diag(`tdbin: variant '${v.name}' must be bare or a single tuple field in v0`)); + if (isInlineVariant(v)) { + return ok({ + kind: "inline", + rustType: variantPayloadName(u, v), + fields: v.fields.map((f, i) => ({ name: f.name, payload: payloadFieldName(v, i), copy: isCopy(f.type) })), + tuple: isTupleVariant(v), + }); } - return isDeclared(single) + const single = variantPayloadType(v); + return single !== undefined && isDeclared(single) ? ok({ kind: "child", rustType: mapTdToRs(single) }) - : isPrim(single, "String") + : single !== undefined && isPrim(single, "String") ? ok({ kind: "string" }) - : err(diag(`tdbin: variant '${v.name}' payload '${printTypeRef(single)}' unsupported in v0`)); + : err( + diag( + `tdbin: variant '${v.name}' payload '${v.fields.map((f) => printTypeRef(f.type)).join(", ")}' unsupported in v0` + ) + ); }; /** The single tuple payload type of a variant, if it has exactly that shape. */ @@ -425,7 +485,7 @@ export const variantPayloadType = (v: ResolvedVariant): ResolvedTypeRef | undefi export const classifyUnion = (u: ResolvedUnion): Result => { const variants: UnionPlan["variants"] = []; for (const [ordinal, v] of u.variants.entries()) { - const payload = classifyVariant(v); + const payload = classifyVariant(u, v); if (!payload.ok) { return payload; } diff --git a/packages/typediagram/src/converters/rust-tdbin.ts b/src/typediagram/src/converters/rust-tdbin.ts similarity index 78% rename from packages/typediagram/src/converters/rust-tdbin.ts rename to src/typediagram/src/converters/rust-tdbin.ts index 8f6c220..e38ea9e 100644 --- a/packages/typediagram/src/converters/rust-tdbin.ts +++ b/src/typediagram/src/converters/rust-tdbin.ts @@ -11,12 +11,13 @@ // the layout manifest/hash in rust-tdbin-hash.ts. import type { Diagnostic } from "../parser/diagnostics.js"; import { type Model, type ResolvedDataDecl, type ResolvedDecl, visibleDataDeclsForTarget } from "../model/types.js"; -import { emitRustDecl } from "./rust.js"; +import { emitRustDecl, moduleNeedsSerde, rustNamedDecls } from "./rust.js"; import { err, ok, type Result } from "../result.js"; import { classifyRecord, classifyUnion, diag, type Layout } from "./rust-tdbin-plan.js"; import { emitRecordCodec, emitUnionCodec, emitUnionDefault } from "./rust-tdbin-fields.js"; import { columnarReachable, emitColumnGroup } from "./rust-tdbin-columnar.js"; import { fnv1a64, layoutHashLiteral, layoutManifest } from "./rust-tdbin-hash.js"; +import { variantRecords, withVariantRecords } from "./tdbin-variant-records.js"; /** Codec generation options. */ export interface RustCodecOptions { @@ -80,7 +81,8 @@ const unionBlocks = (ctx: EmitCtx, d: Extract): return dflt; } const hash = hashLiteralFor(ctx, d); - return hash.ok ? appendGroup(ctx, d, [dflt.value, emitUnionCodec(d, plan.value, hash.value)]) : hash; + const blocks = [dflt.value, emitUnionCodec(d, plan.value, hash.ok ? hash.value : "")].filter((b) => b !== ""); + return hash.ok ? appendGroup(ctx, d, blocks) : hash; }; const declBlocks = (ctx: EmitCtx, d: ResolvedDecl): Result => { @@ -98,11 +100,13 @@ const declBlocks = (ctx: EmitCtx, d: ResolvedDecl): Result => { const layout: Layout = options?.layout ?? 1; - const visible = visibleDataDeclsForTarget(model.decls, "rust"); + // [CONV-RUST-IDIOM] codecs bind the snake_case identifiers the ADT declares. + const decls = withVariantRecords(rustNamedDecls(model.decls)); + const visible = withVariantRecords(rustNamedDecls(visibleDataDeclsForTarget(model.decls, "rust"))); const ctx: EmitCtx = { - decls: model.decls, + decls, layout, - columnar: layout === 2 ? columnarReachable(model.decls, visible) : new Set(), + columnar: layout === 2 ? columnarReachable(decls, visible) : new Set(), frozenManifest: options?.frozenManifest, }; const blocks: string[] = []; @@ -116,21 +120,14 @@ export const emitRustCodec = (model: Model, options?: RustCodecOptions): Result< return ok(blocks.join("\n\n")); }; -/** Records derive `Default` so required pointer fields can decode null as the - * schema default ([TDBIN-PTR-NULL]); unions get a generated `impl Default`. */ -const deriveFor = (d: ResolvedDataDecl): string => - d.kind === "record" - ? "#[derive(Debug, Clone, PartialEq, Default)]\n" - : d.kind === "union" - ? "#[derive(Debug, Clone, PartialEq)]\n" - : ""; +/** Emit one ADT type: doc comment, shared derives (records add `Default` so + * required pointer fields can decode null as the schema default + * [TDBIN-PTR-NULL]; unions get a generated `impl Default`), then the body. */ +const derivesDefault = (d: ResolvedDataDecl): boolean => + d.kind === "record" || (d.kind === "union" && d.variants[0]?.fields.length === 0); -/** Emit one ADT type with its doc comment first, then the derive, then the body - * (from the shared Rust converter) — the order rustc/clippy expect. */ -const emitTypeWithDocs = (d: ResolvedDataDecl): string => { - const [doc, ...rest] = emitRustDecl(d, true); - return `${doc ?? ""}\n${deriveFor(d)}${rest.join("\n")}`; -}; +const emitTypeWithDocs = (d: ResolvedDataDecl, serde: boolean): string => + emitRustDecl(d, true, derivesDefault(d) ? ["Default"] : [], serde).join("\n"); /** Emit a self-contained Rust module: derived ADT types (from the existing * Rust converter) plus their TDBIN codec — deny-all-clean (doc comments, @@ -141,6 +138,11 @@ export const generateRustModule = (model: Model, options?: RustCodecOptions): Re if (!codec.ok) { return codec; } - const types = visibleDataDeclsForTarget(model.decls, "rust").map(emitTypeWithDocs).join("\n"); + // [TDBIN-UNION-STRUCT] synthetic payload records ship beside the ADT so the + // struct-form variant codec has a concrete `tdbin::Struct` to point at. + const visible = visibleDataDeclsForTarget(model.decls, "rust"); + const all = [...visible, ...variantRecords(rustNamedDecls(visible))]; + const serde = moduleNeedsSerde(all); + const types = all.map((d) => emitTypeWithDocs(d, serde)).join("\n"); return ok(`${types}\n${codec.value}\n`); }; diff --git a/packages/typediagram/src/converters/rust.ts b/src/typediagram/src/converters/rust.ts similarity index 69% rename from packages/typediagram/src/converters/rust.ts rename to src/typediagram/src/converters/rust.ts index 0f5e569..9a3425b 100644 --- a/packages/typediagram/src/converters/rust.ts +++ b/src/typediagram/src/converters/rust.ts @@ -6,6 +6,7 @@ import { isTupleVariantFields, type Model, type ResolvedDataDecl, + type ResolvedDecl, type ResolvedField, type ResolvedTypeRef, type ResolvedVariant, @@ -20,6 +21,13 @@ import { mapBuiltinName, parseTypeRef, splitGenericArgs } from "./parse-typeref. const TD_TO_RS: Record = { Bool: "bool", Int: "i64", + I32: "i32", + U8: "u8", + U16: "u16", + U32: "u32", + U64: "u64", + Size: "usize", + Path: "std::path::PathBuf", Float: "f64", String: "String", Bytes: "Vec", @@ -36,12 +44,15 @@ const RS_TO_TD: Record = { bool: "Bool", i8: "Int", i16: "Int", - i32: "Int", + i32: "I32", i64: "Int", - u8: "Int", - u16: "Int", - u32: "Int", - u64: "Int", + u8: "U8", + u16: "U16", + u32: "U32", + u64: "U64", + usize: "Size", + PathBuf: "Path", + "std::path::PathBuf": "Path", f32: "Float", f64: "Float", String: "String", @@ -133,6 +144,15 @@ const splitRsFieldList = (body: string): string[] => { return last.length > 0 ? [...parts, last] : parts; }; +const RENAME_MARK = '#[serde(rename = "'; + +/** The schema name a `#[serde(rename = "…")]` attribute preserves ([CONV-RUST-IDIOM]). */ +const serdeRename = (chunk: string): string | undefined => { + const at = chunk.indexOf(RENAME_MARK); + const start = at + RENAME_MARK.length; + return at === -1 ? undefined : chunk.slice(start, chunk.indexOf('"', start)); +}; + const parseRsFields = (body: string) => splitRsFieldList(body) .map((l) => l.trim()) @@ -146,7 +166,7 @@ const parseRsFields = (body: string) => if (name === undefined || type === undefined) { return null; } - return { name, type: mapRsType(type.replace(/,$/, "").trim()) }; + return { name: serdeRename(l) ?? name, type: mapRsType(type.replace(/,$/, "").trim()) }; }) .filter((f): f is { name: string; type: string } => f !== null); @@ -282,26 +302,80 @@ export const mapTdToRs = (t: ResolvedTypeRef): string => { * only when `docs` is requested so generated code satisfies `missing_docs`. */ const rustDoc = (indent: string, name: string, kind: string): string => `${indent}/// The \`${name}\` ${kind}.`; +/** [CONV-RUST-IDIOM] snake_case for a Rust field (`isHTTPServer` → `is_http_server`). */ +export const rustFieldName = (name: string): string => + name + .replace(/([a-z0-9])([A-Z])/g, "$1_$2") + .replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2") + .toLowerCase(); + +/** `decls` with every record / struct-variant field renamed to its Rust name, so + * codecs planned over them bind the same identifiers the ADT declares. */ +export const rustNamedDecls = (decls: readonly ResolvedDecl[]): ResolvedDecl[] => { + const rename = (fields: ResolvedField[]): ResolvedField[] => + isTupleVariantFields(fields) ? fields : fields.map((f) => ({ ...f, name: rustFieldName(f.name) })); + return decls.map((d) => + d.kind === "record" + ? { ...d, fields: rename(d.fields) } + : d.kind === "union" + ? { ...d, variants: d.variants.map((v) => ({ ...v, fields: rename(v.fields) })) } + : d + ); +}; + +const renameAttr = (f: ResolvedField): string => + rustFieldName(f.name) === f.name ? "" : `#[serde(rename = "${f.name}")]`; + +const needsSerde = (d: ResolvedDataDecl): boolean => + d.kind === "record" + ? d.fields.some((f) => renameAttr(f) !== "") + : d.kind === "union" && + (d.untagged === true || + d.variants.some((v) => !isTupleVariantFields(v.fields) && v.fields.some((f) => renameAttr(f) !== ""))); + +/** Serde derives are module-wide: a type deriving `Serialize` needs every + * type it contains to derive it too, so one serde attribute anywhere in the + * emitted module turns them on for all of its types. */ +export const moduleNeedsSerde = (decls: readonly ResolvedDataDecl[]): boolean => decls.some(needsSerde); + +const deriveLine = (d: ResolvedDataDecl, extra: readonly string[], serde: boolean): string[] => + d.kind === "alias" + ? [] + : [ + `#[derive(${["Debug", "Clone", "PartialEq", ...extra, ...(serde ? ["serde::Serialize", "serde::Deserialize"] : [])].join(", ")})]`, + ]; + const emitRustVariant = (v: ResolvedVariant, docs: boolean): string => { + const structField = (f: ResolvedField): string => + `${renameAttr(f) === "" ? "" : `${renameAttr(f)} `}${rustFieldName(f.name)}: ${mapTdToRs(f.type)}`; const body = v.fields.length === 0 ? ` ${formatVariantName(v.name, v.discriminant)},` : isTupleVariantFields(v.fields) ? ` ${v.name}(${v.fields.map((f) => mapTdToRs(f.type)).join(", ")}),` - : ` ${v.name} { ${v.fields.map((f) => `${f.name}: ${mapTdToRs(f.type)}`).join(", ")} },`; + : ` ${v.name} { ${v.fields.map(structField).join(", ")} },`; return docs ? `${rustDoc(" ", v.name, "variant")}\n${body}` : body; }; -/** [CONV-RUST-DECL] Emit one Rust type declaration (no derives). Shared by the - * type converter and the TDBIN codec generator so neither duplicates it. With - * `docs`, prepends `///` comments so the output is `missing_docs`-clean. */ -export const emitRustDecl = (d: ResolvedDataDecl, docs = false): string[] => { +/** [CONV-RUST-DECL] [CONV-RUST-IDIOM] Emit one Rust type declaration: derives + * (`Debug, Clone, PartialEq`, plus `extraDerives`, plus serde when the + * module needs a serde attribute — see `moduleNeedsSerde`), snake_case fields with `#[serde(rename)]` preserving + * the schema name. Shared by the type converter and the TDBIN codec generator. + * With `docs`, prepends `///` comments so the output is `missing_docs`-clean. */ +export const emitRustDecl = ( + d: ResolvedDataDecl, + docs = false, + extraDerives: readonly string[] = [], + serde = needsSerde(d) +): string[] => { const genericsStr = d.generics.length > 0 ? `<${d.generics.join(", ")}>` : ""; - const lead = docs ? [rustDoc("", d.name, d.kind)] : []; + const lead = [...(docs ? [rustDoc("", d.name, d.kind)] : []), ...deriveLine(d, extraDerives, serde)]; const field = (f: ResolvedField): string => - docs - ? `${rustDoc(" ", f.name, "field")}\n pub ${f.name}: ${mapTdToRs(f.type)},` - : ` pub ${f.name}: ${mapTdToRs(f.type)},`; + [ + ...(docs ? [rustDoc(" ", f.name, "field")] : []), + ...(renameAttr(f) === "" ? [] : [` ${renameAttr(f)}`]), + ` pub ${rustFieldName(f.name)}: ${mapTdToRs(f.type)},`, + ].join("\n"); if (d.kind === "record") { return [...lead, `pub struct ${d.name}${genericsStr} {`, ...d.fields.map(field), "}", ""]; } @@ -311,7 +385,13 @@ export const emitRustDecl = (d: ResolvedDataDecl, docs = false): string[] => { ...lead, ...header, `pub enum ${d.name}${genericsStr} {`, - ...d.variants.map((v) => emitRustVariant(v, docs)), + ...d.variants.map((v, i) => { + const line = emitRustVariant(v, docs); + // [TDBIN-PTR-NULL] a derived `Default` on an enum names its first variant. + return i === 0 && extraDerives.includes("Default") + ? line.replace(` ${v.name}`, ` #[default]\n ${v.name}`) + : line; + }), "}", "", ]; @@ -319,10 +399,11 @@ export const emitRustDecl = (d: ResolvedDataDecl, docs = false): string[] => { return [...lead, `pub type ${d.name}${genericsStr} = ${mapTdToRs(d.target)};`, ""]; }; -const toRust = (model: Model): string => - visibleDataDeclsForTarget(model.decls, "rust") - .flatMap((d) => emitRustDecl(d)) - .join("\n"); +const toRust = (model: Model): string => { + const decls = visibleDataDeclsForTarget(model.decls, "rust"); + const serde = moduleNeedsSerde(decls); + return decls.flatMap((d) => emitRustDecl(d, false, [], serde)).join("\n"); +}; export const rust: Converter = { language: "rust", diff --git a/packages/typediagram/src/converters/scan-decls.ts b/src/typediagram/src/converters/scan-decls.ts similarity index 100% rename from packages/typediagram/src/converters/scan-decls.ts rename to src/typediagram/src/converters/scan-decls.ts diff --git a/src/typediagram/src/converters/shared-c.ts b/src/typediagram/src/converters/shared-c.ts new file mode 100644 index 0000000..c69f72b --- /dev/null +++ b/src/typediagram/src/converters/shared-c.ts @@ -0,0 +1,108 @@ +// [CONV-SHARED-C] Constants-only C profile emitted from generateSharedLayout — never recomputes layouts. +import type { Model } from "../model/types.js"; +import type { Diagnostic } from "../parser/diagnostics.js"; +import { err, ok, type Result } from "../result.js"; +import { generateSharedLayout } from "./shared-layout.js"; + +const IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/; +type SharedManifest = Extract>, { ok: true }>["value"]; +type LayoutDecl = SharedManifest["declarations"][number]; +type LayoutField = NonNullable[number]; +type LayoutVariant = NonNullable[number]; + +const failure = (message: string) => + err([{ severity: "error", message: `shared-c: ${message}`, line: 0, col: 0, length: 0 }]); + +/** Parser identifiers are already `[A-Za-z_][A-Za-z0-9_]*`; this guards hand-built models from injecting C. */ +const badIdentifier = (kind: string, name: string) => + IDENTIFIER.exec(name)?.[0] === name ? undefined : `invalid C identifier for ${kind} '${name}'`; + +const validateIdentifiers = (manifest: SharedManifest): Result => { + const bad = [ + ...manifest.declarations.map((decl) => badIdentifier("declaration", decl.name)), + ...manifest.declarations.flatMap((decl) => [ + ...(decl.fields ?? []).map((field) => badIdentifier(`field of '${decl.name}'`, field.name)), + ...(decl.variants ?? []).flatMap((variant) => [ + badIdentifier(`variant of '${decl.name}'`, variant.name), + ...variant.fields.map((field) => badIdentifier(`field of '${decl.name}.${variant.name}'`, field.name)), + ]), + ]), + ].find((message) => message !== undefined); + return bad === undefined ? ok(true) : failure(bad); +}; + +const fieldMacros = (owner: string, field: LayoutField) => [ + `#define TD_${owner}_${field.name}_OFFSET ${String(field.offset)}`, + `#define TD_${owner}_${field.name}_BYTES ${String(field.bytes)}`, +]; + +const variantMacros = (decl: string, variant: LayoutVariant) => [ + `#define TD_${decl}_${variant.name}_TAG ${String(variant.tag)}`, + ...variant.fields.flatMap((field) => fieldMacros(`${decl}_${variant.name}`, field)), +]; + +const declarationLines = (decl: LayoutDecl): Result => + decl.bytes === 0 + ? failure(`zero-size declaration '${decl.name}' cannot be emitted`) + : ok([ + `TD_SHARED_STORAGE(${decl.name}, ${String(decl.bytes)});`, + ...(decl.fields ?? []).flatMap((field) => fieldMacros(decl.name, field)), + ...(decl.variants ?? []).flatMap((variant) => variantMacros(decl.name, variant)), + ]); + +const prologue = (manifest: SharedManifest) => [ + "// Generated by typeDiagram shared-memory profile. Constants only: no pointers, accessors, codec, or view validation.", + "#ifndef TD_SHARED_H", + "#define TD_SHARED_H", + "#include ", + `#define TD_SHARED_FINGERPRINT "${manifest.fingerprint}"`, + `#define TD_SHARED_POINTER_BYTES ${String(manifest.pointerBytes)}`, + `#define TD_SHARED_ABI_MAJOR ${String(manifest.abiMajor)}`, + "#define TD_SHARED_STORAGE(name, byte_count) \\", + ` typedef struct { _Alignas(${String(manifest.alignment)}) unsigned char bytes[byte_count]; } td_##name; \\`, + ` _Static_assert(sizeof(td_##name) == (byte_count) && _Alignof(td_##name) == ${String(manifest.alignment)}, #name " size/alignment")`, +]; + +const symbols = (decl: LayoutDecl) => [ + `td_${decl.name}`, + ...(decl.fields ?? []).flatMap((f) => [`TD_${decl.name}_${f.name}_OFFSET`, `TD_${decl.name}_${f.name}_BYTES`]), + ...(decl.variants ?? []).flatMap((v) => [ + `TD_${decl.name}_${v.name}_TAG`, + ...v.fields.flatMap((f) => [ + `TD_${decl.name}_${v.name}_${f.name}_OFFSET`, + `TD_${decl.name}_${v.name}_${f.name}_BYTES`, + ]), + ]), +]; +const validateSymbols = (manifest: SharedManifest, names?: readonly string[]) => { + const identifiers = validateIdentifiers(manifest); + if (!identifiers.ok) { + return identifiers; + } + const all = manifest.declarations.flatMap(symbols); + if (new Set(all).size !== all.length) { + return failure("C symbol collision after name composition"); + } + const missing = names?.find((name) => !manifest.declarations.some((d) => d.name === name)); + return missing === undefined ? ok(true) : failure(`unknown declaration '${missing}'`); +}; +const emitHeader = (manifest: SharedManifest, names?: readonly string[]) => { + const lines: string[] = prologue(manifest); + for (const decl of manifest.declarations.filter((d) => names === undefined || names.includes(d.name))) { + const body = declarationLines(decl); + if (!body.ok) { + return body; + } + lines.push(...body.value); + } + return ok([...lines, "", "#undef TD_SHARED_STORAGE", "#endif"].join("\n")); +}; +/** Emit C storage/constants from the complete layout identity, optionally selecting declarations. */ +export const generateSharedC = async (model: Model, pointerBytes: number, names?: readonly string[]) => { + const layout = await generateSharedLayout(model, pointerBytes); + if (!layout.ok) { + return layout; + } + const valid = validateSymbols(layout.value, names); + return valid.ok ? emitHeader(layout.value, names) : valid; +}; diff --git a/src/typediagram/src/converters/shared-layout.ts b/src/typediagram/src/converters/shared-layout.ts new file mode 100644 index 0000000..23b2649 --- /dev/null +++ b/src/typediagram/src/converters/shared-layout.ts @@ -0,0 +1,248 @@ +// [CONV-SHARED-LAYOUT] Exact shared-memory layout, never a tdbin wire layout. +import type { Model, ResolvedDecl, ResolvedField, ResolvedTypeRef } from "../model/types.js"; +import type { Diagnostic } from "../parser/diagnostics.js"; +import { err, ok, type Result } from "../result.js"; +import { printTypeRef } from "./parse-typeref.js"; + +const WORD = 8; +const REFERENCE_BYTES = 40; +const INLINE_LIMIT = 64; +const RECORD_LIMIT = 65536; +const SCALARS: Readonly> = { Int: WORD, Float: WORD, Bool: WORD, Uuid: 16, Unit: 0 }; +interface Shape { + readonly type: string; + readonly storage: string; + readonly bytes: number; + readonly inline: boolean; + readonly value?: Shape; +} +interface Field extends Shape { + readonly name: string; + readonly offset: number; +} +interface Variant { + readonly name: string; + readonly tag: number; + readonly fields: readonly Field[]; +} +interface Declaration { + readonly name: string; + readonly kind: string; + readonly bytes: number; + readonly inline: boolean; + readonly fields?: readonly Field[]; + readonly variants?: readonly Variant[]; + readonly target?: Shape; +} +interface Context { + readonly decls: ReadonlyMap; + readonly layouts: Map; +} +const failure = (message: string) => + err([{ severity: "error", message: `shared-layout: ${message}`, line: 0, col: 0, length: 0 }]); +const reference = (type: string): Shape => ({ type, storage: "reference", bytes: REFERENCE_BYTES, inline: false }); + +const fieldsLayout = ( + ctx: Context, + fields: readonly ResolvedField[], + path: readonly string[], + start = 0 +): Result => { + const result: Field[] = []; + let offset = start; + for (const field of fields) { + const shape = shapeOf(ctx, field.type, path); + if (!shape.ok) { + return shape; + } + result.push({ name: field.name, offset, ...shape.value }); + offset += shape.value.bytes; + if (offset > RECORD_LIMIT) { + return failure("record exceeds 64 KiB"); + } + } + return ok(result); +}; +const endOf = (fields: readonly Field[], start = 0) => + fields.reduce((end, field) => Math.max(end, field.offset + field.bytes), start); + +const recordLayout = ( + ctx: Context, + decl: Extract, + path: readonly string[] +): Result => { + const fields = fieldsLayout(ctx, decl.fields, path); + if (!fields.ok) { + return fields; + } + const bytes = Math.max(WORD, endOf(fields.value)); + return ok({ + name: decl.name, + kind: "record", + bytes, + inline: bytes <= INLINE_LIMIT && fields.value.every((field) => field.inline), + fields: fields.value, + }); +}; + +const unionLayout = ( + ctx: Context, + decl: Extract, + path: readonly string[] +): Result => { + const variants: Variant[] = []; + let bytes = WORD; + for (const variant of decl.variants) { + const fields = fieldsLayout(ctx, variant.fields, path, WORD); + if (!fields.ok) { + return fields; + } + variants.push({ name: variant.name, tag: variants.length, fields: fields.value }); + bytes = Math.max(bytes, endOf(fields.value, WORD)); + } + return variants.length === 0 + ? failure(`empty union '${decl.name}'`) + : ok({ + name: decl.name, + kind: "union", + bytes, + inline: bytes <= INLINE_LIMIT && variants.every((variant) => variant.fields.every((field) => field.inline)), + variants, + }); +}; + +const declarationLayout = ( + ctx: Context, + decl: ResolvedDecl, + path: readonly string[] +): Result => { + const cached = ctx.layouts.get(decl.name); + if (cached !== undefined) { + return ok(cached); + } + if (decl.generics.length > 0 || decl.kind === "function") { + return failure(`unsupported declaration '${decl.name}'`); + } + const next = [...path, decl.name]; + const layout = + decl.kind === "record" + ? recordLayout(ctx, decl, next) + : decl.kind === "union" + ? unionLayout(ctx, decl, next) + : aliasLayout(ctx, decl, next); + if (layout.ok) { + ctx.layouts.set(decl.name, layout.value); + } + return layout; +}; +const aliasLayout = ( + ctx: Context, + decl: Extract, + path: readonly string[] +): Result => { + const target = shapeOf(ctx, decl.target, path); + return target.ok + ? ok({ + name: decl.name, + kind: "alias", + bytes: target.value.bytes, + inline: target.value.inline, + target: target.value, + }) + : target; +}; + +const declaredShape = (ctx: Context, type: ResolvedTypeRef, path: readonly string[]): Result => { + const decl = ctx.decls.get(type.name); + if (decl === undefined || type.args.length > 0) { + return failure(`unknown or generic type '${type.name}'`); + } + if (path.includes(decl.name)) { + // Aliases stay transparent through record cycles; alias-only cycles hit the traversal bound. + const target = decl.kind === "alias" ? shapeOf(ctx, decl.target, [...path, decl.name]) : ok(reference(type.name)); + return target.ok ? ok({ ...target.value, type: type.name }) : target; + } + const layout = declarationLayout(ctx, decl, path); + if (!layout.ok) { + return layout; + } + if (layout.value.target !== undefined) { + return ok({ ...layout.value.target, type: type.name }); + } + return ok( + layout.value.inline + ? { type: type.name, storage: "inline", bytes: layout.value.bytes, inline: true } + : reference(type.name) + ); +}; + +const shapeOf = (ctx: Context, type: ResolvedTypeRef, path: readonly string[]): Result => { + if (path.length > 64) { + return failure("type traversal exceeds 64 levels"); + } + if (type.resolution.kind === "declared") { + return declaredShape(ctx, type, path); + } + const bytes = SCALARS[type.name]; + if (bytes !== undefined && type.args.length === 0) { + return ok({ type: type.name, storage: "scalar", bytes, inline: true }); + } + if ((type.name === "String" || type.name === "Bytes") && type.args.length === 0) { + return ok({ type: type.name, storage: "bytes", bytes: REFERENCE_BYTES + WORD, inline: false }); + } + const inner = type.args[0]; + return inner !== undefined && type.args.length === 1 && (type.name === "Option" || type.name === "List") + ? containerShape(ctx, type, inner, path) + : failure(`unsupported type '${printTypeRef(type)}'`); +}; +const containerShape = ( + ctx: Context, + type: ResolvedTypeRef, + inner: ResolvedTypeRef, + path: readonly string[] +): Result => { + const value = shapeOf(ctx, inner, [...path, type.name]); + if (!value.ok) { + return value; + } + return ok({ + type: printTypeRef(type), + storage: type.name === "List" ? "list" : "optional", + bytes: type.name === "List" ? REFERENCE_BYTES + WORD : WORD + value.value.bytes, + inline: type.name === "Option" && value.value.inline, + value: value.value, + }); +}; + +/** Build the exact manifest and SHA-256 identity for a shared-memory profile. */ +export const generateSharedLayout = async (model: Model, pointerBytes: number) => { + if (pointerBytes !== 4 && pointerBytes !== 8) { + return failure("unsupported pointer profile"); + } + const ctx: Context = { decls: new Map(model.decls.map((decl) => [decl.name, decl])), layouts: new Map() }; + for (const decl of [...model.decls].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))) { + const layout = declarationLayout(ctx, decl, []); + if (!layout.ok) { + return layout; + } + } + const manifest = { + abiMajor: 1, + endian: "little", + alignment: WORD, + pointerBytes, + referenceBytes: REFERENCE_BYTES, + inlineLimit: INLINE_LIMIT, + declarations: [...ctx.layouts.values()].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)), + } as const; + return fingerprint(manifest); +}; +const fingerprint = async (manifest: T) => { + try { + const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(manifest))); + const hash = Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join(""); + return ok({ ...manifest, fingerprint: hash }); + } catch { + return failure("SHA-256 unavailable"); + } +}; diff --git a/src/typediagram/src/converters/swift.ts b/src/typediagram/src/converters/swift.ts new file mode 100644 index 0000000..564d31d --- /dev/null +++ b/src/typediagram/src/converters/swift.ts @@ -0,0 +1,102 @@ +// [CONV-SWIFT] Logical models only: native shared-memory views have a separate ABI. +import { visibleDeclsForTarget, walkDeclRefs, type Model, type ResolvedTypeRef } from "../model/types.js"; +import type { Diagnostic } from "../parser/diagnostics.js"; +import { err, ok, type Result } from "../result.js"; +import { emitDecls, type DeclEmitters } from "./emit-decls.js"; + +const PRIMITIVES: Readonly> = { + Int: "Int64", + I32: "Int32", + U8: "UInt8", + U16: "UInt16", + U32: "UInt32", + U64: "UInt64", + Size: "UInt", + Path: "String", + Float: "Double", + Bool: "Bool", + String: "String", + Unit: "Void", + Uuid: "UUID", +}; +const identifier = (name: string) => `\`${name}\``; +const typeName = (type: ResolvedTypeRef): string => { + const builtin = type.resolution.kind === "primitive" || type.resolution.kind === "external"; + const inner = type.args[0]; + return builtin && inner !== undefined && type.name === "List" + ? `[${typeName(inner)}]` + : builtin && inner !== undefined && type.name === "Option" + ? `${typeName(inner)}?` + : builtin + ? (PRIMITIVES[type.name] ?? identifier(type.name)) + : identifier(type.name); +}; + +const hasCycle = (model: Model, name: string, path = new Set(), done = new Set()): boolean => { + if (path.has(name)) { + return true; + } + if (done.has(name)) { + return false; + } + path.add(name); + const cyclic = model.edges + .filter((edge) => edge.sourceDeclName === name) + .some((edge) => hasCycle(model, edge.targetDeclName, path, done)); + path.delete(name); + done.add(name); + return cyclic; +}; + +const unsupported = (model: Model): Diagnostic[] => { + const messages = new Set(); + for (const decl of visibleDeclsForTarget(model.decls, "swift")) { + if (decl.kind === "function" || decl.generics.length > 0 || hasCycle(model, decl.name)) { + messages.add(`swift: unsupported declaration '${decl.name}'`); + } + walkDeclRefs(decl, (type) => { + const builtin = type.resolution.kind === "primitive" || type.resolution.kind === "external"; + const container = type.name === "List" || type.name === "Option"; + if ( + builtin && + (container ? type.args.length !== 1 : PRIMITIVES[type.name] === undefined || type.args.length !== 0) + ) { + messages.add(`swift: unsupported type '${type.name}'`); + } + }); + } + return [...messages].map((message) => ({ severity: "error", message, line: 0, col: 0, length: 0 })); +}; + +const EMITTERS: DeclEmitters = { + record: (decl) => [ + `public struct ${identifier(decl.name)} {`, + ...decl.fields.map((field) => ` public let ${identifier(field.name)}: ${typeName(field.type)}`), + ` public init(${decl.fields.map((field) => `${identifier(field.name)}: ${typeName(field.type)}`).join(", ")}) {`, + ...decl.fields.map((field) => ` self.${identifier(field.name)} = ${identifier(field.name)}`), + " }", + "}", + ], + union: (decl) => [ + `public enum ${identifier(decl.name)} {`, + ...decl.variants.map((variant) => { + const fields = variant.fields.map((field) => `${identifier(field.name)}: ${typeName(field.type)}`).join(", "); + return ` case ${identifier(variant.name)}${fields.length > 0 ? `(${fields})` : ""}`; + }), + "}", + ], + alias: (decl) => [`public typealias ${identifier(decl.name)} = ${typeName(decl.target)}`], +}; + +/** Generate monomorphic Swift model declarations; no binary layout is promised. */ +export const generateSwiftModule = (model: Model): Result => { + const diagnostics = unsupported(model); + return diagnostics.length > 0 + ? err(diagnostics) + : ok( + emitDecls(model, "swift", EMITTERS, { + prelude: ["// Generated from typeDiagram [CONV-SWIFT].", "import Foundation"], + trimTrailing: true, + }) + ); +}; diff --git a/packages/typediagram/src/converters/tdbin-alloc.ts b/src/typediagram/src/converters/tdbin-alloc.ts similarity index 100% rename from packages/typediagram/src/converters/tdbin-alloc.ts rename to src/typediagram/src/converters/tdbin-alloc.ts diff --git a/src/typediagram/src/converters/tdbin-variant-records.ts b/src/typediagram/src/converters/tdbin-variant-records.ts new file mode 100644 index 0000000..955728f --- /dev/null +++ b/src/typediagram/src/converters/tdbin-variant-records.ts @@ -0,0 +1,48 @@ +// [TDBIN-UNION-STRUCT] Struct-form (`Circle { radius: Float }`) and +// multi-field tuple (`Pair(Int, String)`) union variants carry their payload +// exactly like a single-child variant: discriminant in data word 0, pointer +// slot 0 → a struct laid out by the normal [TDBIN-REC-ALLOC] rules. The Rust, +// TypeScript and manifest/hash code all plan that struct through ONE synthetic +// record per variant, so the three agree on the layout by construction while +// the user-facing ADT (and its JSON shape) stays untouched. +import { + isTupleVariantFields, + type ResolvedDecl, + type ResolvedRecord, + type ResolvedUnion, + type ResolvedVariant, +} from "../model/types.js"; + +/** Name of the synthetic payload record for `variant` of `union`. */ +export const variantPayloadName = (union: ResolvedUnion, variant: ResolvedVariant): string => + `${union.name}${variant.name}TdbinPayload`; + +/** True when the variant's payload is several fields rather than one tuple value. */ +export const isInlineVariant = (variant: ResolvedVariant): boolean => + variant.fields.length > 1 || (variant.fields.length === 1 && !isTupleVariantFields(variant.fields)); + +/** True when the variant uses tuple syntax (`_0`, `_1`, …). */ +export const isTupleVariant = (variant: ResolvedVariant): boolean => isTupleVariantFields(variant.fields); + +/** Payload-record field name: struct-form keeps the variant's field name; + * tuple position `i` becomes `v{i}` (`_0` is not a lint-clean Rust binding). */ +export const payloadFieldName = (variant: ResolvedVariant, index: number): string => + isTupleVariant(variant) ? `v${String(index)}` : (variant.fields[index]?.name ?? `v${String(index)}`); + +const payloadRecords = (union: ResolvedUnion): ResolvedRecord[] => + union.variants.filter(isInlineVariant).map((variant) => ({ + kind: "record", + name: variantPayloadName(union, variant), + generics: [], + fields: variant.fields.map((field, index) => ({ name: payloadFieldName(variant, index), type: field.type })), + })); + +/** Every synthetic payload record the model's monomorphic unions need. */ +export const variantRecords = (decls: readonly ResolvedDecl[]): ResolvedRecord[] => + decls.flatMap((d) => (d.kind === "union" && d.generics.length === 0 ? payloadRecords(d) : [])); + +/** `decls` plus its synthetic payload records (idempotent), for layout planning and manifests. */ +export const withVariantRecords = (decls: readonly ResolvedDecl[]): ResolvedDecl[] => { + const names = new Set(decls.map((d) => d.name)); + return [...decls, ...variantRecords(decls).filter((r) => !names.has(r.name))]; +}; diff --git a/packages/typediagram/src/converters/types.ts b/src/typediagram/src/converters/types.ts similarity index 67% rename from packages/typediagram/src/converters/types.ts rename to src/typediagram/src/converters/types.ts index d5f788c..94c8777 100644 --- a/packages/typediagram/src/converters/types.ts +++ b/src/typediagram/src/converters/types.ts @@ -11,10 +11,18 @@ export interface PythonOpts { } export interface CSharpOpts { + /** Use 64-bit integers for native identity/counter models. */ + readonly integerWidth?: 32 | 64; readonly namespace?: string; } +/** Emit bigint integer types; this does not generate runtime range checks or codecs. */ +export interface TypeScriptOpts { + readonly integerType?: "number" | "bigint"; +} + export interface ConverterOpts { + readonly typescript?: TypeScriptOpts; readonly python?: PythonOpts; readonly csharp?: CSharpOpts; } @@ -24,5 +32,5 @@ export interface Converter { /** Parse language source into a typeDiagram Model. */ fromSource(source: string): Result; /** Emit language source from a typeDiagram Model. */ - toSource(model: Model, opts?: PythonOpts | CSharpOpts): string; + toSource(model: Model, opts?: PythonOpts | CSharpOpts | TypeScriptOpts): string; } diff --git a/packages/typediagram/src/converters/typescript-tdbin-defaults.ts b/src/typediagram/src/converters/typescript-tdbin-defaults.ts similarity index 61% rename from packages/typediagram/src/converters/typescript-tdbin-defaults.ts rename to src/typediagram/src/converters/typescript-tdbin-defaults.ts index eed6bb0..8db9e2e 100644 --- a/packages/typediagram/src/converters/typescript-tdbin-defaults.ts +++ b/src/typediagram/src/converters/typescript-tdbin-defaults.ts @@ -16,7 +16,20 @@ export type FieldPlan = | { kind: "optBool"; presenceSlot: number; presenceBit: number; valueSlot: number; valueBit: number } | { kind: "string"; slot: number; optional: boolean } | { kind: "bytes"; slot: number; optional: boolean } - | { kind: "child"; slot: number; optional: boolean; typeName: string }; + | { kind: "child"; slot: number; optional: boolean; typeName: string } + | { kind: "list"; slot: number; optional: boolean; list: TsListPlan } + | { kind: "width"; slot: number; width: TsWidth } + | { kind: "optWidth"; presenceSlot: number; presenceBit: number; valueSlot: number; width: TsWidth }; + +/** [TDBIN-WIDTH-RANGE] runtime width kind; `u64` is a bigint, the rest numbers. */ +export type TsWidth = "i32" | "u8" | "u16" | "u32" | "u64" | "size"; + +/** [TDBIN-TS-LIST] element encodings, one per Rust layout-1 list form. */ +export type TsListPlan = + | { readonly kind: "bool" | "int" | "float" | "string" | "bytes" } + | { readonly kind: "child"; readonly typeName: string } + | { readonly kind: "enum"; readonly variants: readonly string[] } + | { readonly kind: "width"; readonly width: TsWidth }; export interface RecordPlan { readonly dataWords: number; @@ -24,7 +37,21 @@ export interface RecordPlan { readonly fields: readonly { readonly name: string; readonly plan: FieldPlan }[]; } -export type VariantPlan = null | { readonly kind: "child"; readonly typeName: string } | { readonly kind: "string" }; +export type VariantPlan = + | null + | { readonly kind: "child"; readonly typeName: string } + | { readonly kind: "string" } + /** [TDBIN-UNION-STRUCT] struct-form / multi-field tuple payload record. */ + | { readonly kind: "inline"; readonly typeName: string; readonly fields: readonly InlineField[] }; + +export interface InlineField { + readonly name: string; + readonly payload: string; +} + +/** `{ kind: "Rect", w: src.w, _0: src.v0 }`: a variant value from a payload record. */ +export const inlineVariantValue = (variant: string, fields: readonly InlineField[], src: string): string => + `{ kind: "${variant}", ${fields.map((f) => `${f.name}: ${src}.${f.payload}`).join(", ")} }`; export interface UnionPlan { readonly ptrWords: number; @@ -40,29 +67,41 @@ export type PointerPlan = Extract; export const diag = (message: string): Diagnostic[] => [{ severity: "error", message, line: 0, col: 0, length: 0 }]; export const pointerDefault = (plan: PointerPlan): string => - plan.kind === "string" ? `""` : plan.kind === "bytes" ? "new Uint8Array(0)" : `default${plan.typeName}()`; - -const fieldDefault = (plan: FieldPlan): string => { + plan.kind === "string" + ? `""` + : plan.kind === "bytes" + ? "new Uint8Array(0)" + : plan.kind === "list" + ? "[]" + : `default${plan.typeName}()`; + +const fieldDefault = (plan: FieldPlan, integerZero: string): string => { switch (plan.kind) { case "int": + return integerZero; case "float": return "0"; case "bool": return "false"; + case "width": + return plan.width === "u64" ? "0n" : "0"; case "optInt": case "optFloat": case "optBool": + case "optWidth": return "undefined"; default: return plan.optional ? "undefined" : pointerDefault(plan); } }; -export const variantPayloadDefault = (payload: NonNullable): string => +export const variantPayloadDefault = (payload: Exclude): string => payload.kind === "string" ? `""` : `default${payload.typeName}()`; -const emitRecordDefault = (record: ResolvedRecord, plan: RecordPlan): string => { - const fields = plan.fields.map(({ name, plan: fieldPlan }) => `${name}: ${fieldDefault(fieldPlan)}`).join(", "); +const emitRecordDefault = (record: ResolvedRecord, plan: RecordPlan, integerZero: string): string => { + const fields = plan.fields + .map(({ name, plan: fieldPlan }) => `${name}: ${fieldDefault(fieldPlan, integerZero)}`) + .join(", "); return `const default${record.name} = (): ${record.name} => (${fields === "" ? "{}" : `{ ${fields} }`});`; }; @@ -74,7 +113,9 @@ const emitUnionDefault = (union: ResolvedUnion, plan: UnionPlan): Result (${value});`); }; @@ -85,7 +126,7 @@ const requiredChildNames = (plan: RecordPlan): string[] => const childPayloadNames = (plan: UnionPlan): string[] => plan.variants.flatMap((variant) => - variant.payload !== null && variant.payload.kind === "child" ? [variant.payload.typeName] : [] + variant.payload !== null && variant.payload.kind !== "string" ? [variant.payload.typeName] : [] ); const codecDefaultRefs = (plan: DeclPlan): string[] => @@ -93,7 +134,11 @@ const codecDefaultRefs = (plan: DeclPlan): string[] => const defaultDeps = (plan: DeclPlan): string[] => { const payload = plan.kind === "union" ? plan.plan.variants[0]?.payload : undefined; - return plan.kind === "record" ? requiredChildNames(plan.plan) : payload?.kind === "child" ? [payload.typeName] : []; + return plan.kind === "record" + ? requiredChildNames(plan.plan) + : payload !== undefined && payload !== null && payload.kind !== "string" + ? [payload.typeName] + : []; }; const findDefaultCycle = ( @@ -114,12 +159,14 @@ const findDefaultCycle = ( return null; }; -const emitDefaultFactory = (plan: DeclPlan): Result => - plan.kind === "record" ? ok(emitRecordDefault(plan.decl, plan.plan)) : emitUnionDefault(plan.decl, plan.plan); +const emitDefaultFactory = (plan: DeclPlan, integerZero: string): Result => + plan.kind === "record" + ? ok(emitRecordDefault(plan.decl, plan.plan, integerZero)) + : emitUnionDefault(plan.decl, plan.plan); /** Emit `default()` factories for every type reachable from a required * child slot, rejecting non-terminating (recursive) defaults loudly. */ -export const emitDefaultFactories = (plans: readonly DeclPlan[]): Result => { +export const emitDefaultFactories = (plans: readonly DeclPlan[], integerZero = "0"): Result => { const byName: ReadonlyMap = new Map(plans.map((plan) => [plan.decl.name, plan])); const needed = new Set(plans.flatMap(codecDefaultRefs)); const blocks: string[] = []; @@ -131,7 +178,7 @@ export const emitDefaultFactories = (plans: readonly DeclPlan[]): Result` / `Option>` fields for the TypeScript TDBIN +// generator. Each element form uses the SAME wire encoding as the Rust layout-1 +// emitter (rust-tdbin-plan.ts `listPlanFor`), so bytes and layout hashes match: +// Bool → bit list, Int/Float → word list, String/Bytes → pointer list, +// record/union → composite list, all-bare union → one ordinal byte each. +import type { ResolvedDecl, ResolvedTypeRef } from "../model/types.js"; +import type { TsListPlan } from "./typescript-tdbin-defaults.js"; +import { widthListRead, widthListWrite, widthOf } from "./typescript-tdbin-widths.js"; + +type ListField = { slot: number; optional: boolean; list: TsListPlan }; + +const isPrim = (t: ResolvedTypeRef, name: string): boolean => + t.name === name && t.resolution.kind === "primitive" && t.args.length === 0; + +const PRIMS = { Bool: "bool", Int: "int", Float: "float", String: "string", Path: "string", Bytes: "bytes" } as const; + +const primList = (t: ResolvedTypeRef): TsListPlan | null => { + const hit = Object.entries(PRIMS).find(([name]) => isPrim(t, name)); + const width = widthOf(t); + return hit !== undefined ? { kind: hit[1] } : width !== undefined ? { kind: "width", width } : null; +}; + +const declList = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): TsListPlan | null => { + const resolution = t.resolution; + const decl = resolution.kind === "declared" ? decls.find((d) => d.name === resolution.declName) : undefined; + return decl?.kind === "union" && decl.variants.every((v) => v.fields.length === 0) + ? { kind: "enum", variants: decl.variants.map((v) => v.name) } + : (decl?.kind === "record" && decl.fields.length > 0) || decl?.kind === "union" + ? { kind: "child", typeName: decl.name } + : null; +}; + +/** The list plan for `List` (or `null` when `t` is not a supported list). */ +export const listPlanOf = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): TsListPlan | null => { + const inner = t.name === "List" && t.args.length === 1 ? t.args[0] : undefined; + return inner === undefined ? null : (primList(inner) ?? declList(decls, inner)); +}; + +const names = (list: Extract): string => JSON.stringify(list.variants); + +const at = (codec: string, slot: number): string => `writer, at, ${codec}.dataWords, ${String(slot)}`; + +/** Write lines; the final binding is `${field}` (a write Result). */ +export const writeListLines = (codec: string, field: string, v: string, plan: ListField): string[] => { + const orNull = (expr: string): string => (plan.optional ? `${v} === undefined ? null : ${expr}` : expr); + const target = at(codec, plan.slot); + switch (plan.list.kind) { + case "bool": + return [` const ${field} = tdbin.writer.boolList(${target}, ${plan.optional ? `${v} ?? null` : v});`]; + case "int": + return [ + ` const ${field}Words = ${plan.optional ? `${v} === undefined ? ok(null) : ` : ""}tdbin.list.i64Words(${v});`, + ` if (!${field}Words.ok) return ${field}Words;`, + ` const ${field} = tdbin.writer.wordList(${target}, ${field}Words.value);`, + ]; + case "float": + return [` const ${field} = tdbin.writer.wordList(${target}, ${orNull(`${v}.map(tdbin.scalar.f64Bits)`)});`]; + case "string": + case "bytes": + return [ + ` const ${field} = tdbin.writer.${plan.list.kind}List(${target}, ${plan.optional ? `${v} ?? null` : v});`, + ]; + case "child": + return [ + ` const ${field} = tdbin.writer.childList(${target}, ${plan.list.typeName}Codec, ${plan.optional ? `${v} ?? null` : v});`, + ]; + case "enum": + return [ + ` const ${field} = tdbin.writer.byteList(${target}, ${orNull(`tdbin.list.enumOrdinals(${v}, ${names(plan.list)})`)});`, + ]; + case "width": + return [` const ${field} = ${widthListWrite(target, plan.list.width, plan.optional ? `${v} ?? null` : v)};`]; + } +}; + +const READERS = { bool: "boolList", int: "wordList", float: "wordList", string: "stringList", bytes: "bytesList" }; + +/** Read lines; the bindings to ok-guard are returned by `listResultNames`. */ +export const readListLines = (codec: string, field: string, plan: ListField): string[] => { + const src = `reader, at, ${codec}.dataWords, ${String(plan.slot)}`; + return plan.list.kind === "width" + ? [` const ${field} = ${widthListRead(src, plan.list.width)};`] + : plan.list.kind === "child" + ? [` const ${field} = tdbin.reader.childList(${src}, ${plan.list.typeName}Codec);`] + : plan.list.kind === "enum" + ? [ + ` const ${field}Raw = tdbin.reader.byteList(${src});`, + ` const ${field} = ${field}Raw.ok && ${field}Raw.value !== null ? tdbin.list.enumValues(${field}Raw.value, ${names(plan.list)}) : ok(null);`, + ] + : [` const ${field} = tdbin.reader.${READERS[plan.list.kind]}(${src});`]; +}; + +export const listResultNames = (field: string, plan: ListField): string[] => + plan.list.kind === "enum" ? [`${field}Raw`, field] : [field]; + +/** The decoded field value: elements converted, null → `[]` or `undefined`. */ +export const listValue = (field: string, plan: ListField, integer: (word: string) => string): string => { + const fallback = plan.optional ? "undefined" : "[]"; + const mapped = + plan.list.kind === "int" + ? `.map((word) => ${integer("word")})` + : plan.list.kind === "float" + ? ".map(tdbin.scalar.f64From)" + : ""; + return `${field}.value${mapped === "" ? "" : `?${mapped}`} ?? ${fallback}`; +}; diff --git a/src/typediagram/src/converters/typescript-tdbin-plan.ts b/src/typediagram/src/converters/typescript-tdbin-plan.ts new file mode 100644 index 0000000..d72b723 --- /dev/null +++ b/src/typediagram/src/converters/typescript-tdbin-plan.ts @@ -0,0 +1,179 @@ +// [CONV-TS-TDBIN] Field/record/union layout planning for the TypeScript TDBIN +// generator. Shares the Rust emitter's allocator (tdbin-alloc.ts) so both bake +// identical slot/bit numbers ([TDBIN-REC-ALLOC]). +import type { Diagnostic } from "../parser/diagnostics.js"; +import type { ResolvedDecl, ResolvedRecord, ResolvedTypeRef, ResolvedUnion, ResolvedVariant } from "../model/types.js"; +import { type Result, err, ok } from "../result.js"; +import { printTypeRef } from "./parse-typeref.js"; +import { allocateBit, allocatePtr, allocateWord, type LayoutCursor, newLayoutCursor } from "./tdbin-alloc.js"; +import { isInlineVariant, payloadFieldName, variantPayloadName } from "./tdbin-variant-records.js"; +import { + diag, + type FieldPlan, + type RecordPlan, + type UnionPlan, + type VariantPlan, +} from "./typescript-tdbin-defaults.js"; +import { listPlanOf } from "./typescript-tdbin-lists.js"; +import { widthOf } from "./typescript-tdbin-widths.js"; + +const isPrim = (t: ResolvedTypeRef, name: string): boolean => + t.name === name && t.resolution.kind === "primitive" && t.args.length === 0; + +const declaredRecord = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): ResolvedRecord | undefined => { + if (t.resolution.kind !== "declared") { + return undefined; + } + const { declName } = t.resolution; + return decls.find((d): d is ResolvedRecord => d.kind === "record" && d.name === declName); +}; + +const declaredUnion = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): ResolvedUnion | undefined => { + if (t.resolution.kind !== "declared") { + return undefined; + } + const { declName } = t.resolution; + return decls.find((d): d is ResolvedUnion => d.kind === "union" && d.name === declName); +}; + +const allocateBool = (cursor: LayoutCursor): FieldPlan => { + const { slot, bit } = allocateBit(cursor); + return { kind: "bool", slot, bit }; +}; + +/** `Option` takes a 1-bit presence flag in the shared bool bitset plus + * a natural-width value slot ([TDBIN-PRIM-OPTION]) — the SAME allocator the + * Rust emitter uses, so both emitters bake identical slot/bit numbers. */ +const allocateOptScalar = (inner: ResolvedTypeRef, cursor: LayoutCursor): FieldPlan | null => { + if (isPrim(inner, "Bool")) { + const presence = allocateBit(cursor); + const value = allocateBit(cursor); + return { + kind: "optBool", + presenceSlot: presence.slot, + presenceBit: presence.bit, + valueSlot: value.slot, + valueBit: value.bit, + }; + } + const width = widthOf(inner); + if (width !== undefined) { + const presence = allocateBit(cursor); + return { + kind: "optWidth", + presenceSlot: presence.slot, + presenceBit: presence.bit, + valueSlot: allocateWord(cursor), + width, + }; + } + if (!isPrim(inner, "Int") && !isPrim(inner, "Float")) { + return null; + } + const presence = allocateBit(cursor); + return { + kind: isPrim(inner, "Int") ? "optInt" : "optFloat", + presenceSlot: presence.slot, + presenceBit: presence.bit, + valueSlot: allocateWord(cursor), + }; +}; + +const pointerField = ( + decls: readonly ResolvedDecl[], + t: ResolvedTypeRef, + slot: number, + optional: boolean +): FieldPlan | null => { + const list = listPlanOf(decls, t); + return list !== null ? { kind: "list", slot, optional, list } : scalarPointer(decls, t, slot, optional); +}; + +const scalarPointer = ( + decls: readonly ResolvedDecl[], + t: ResolvedTypeRef, + slot: number, + optional: boolean +): FieldPlan | null => + isPrim(t, "String") || isPrim(t, "Path") + ? { kind: "string", slot, optional } + : isPrim(t, "Bytes") + ? { kind: "bytes", slot, optional } + : declaredRecord(decls, t) !== undefined || declaredUnion(decls, t) !== undefined + ? { kind: "child", slot, optional, typeName: t.resolution.kind === "declared" ? t.resolution.declName : t.name } + : null; + +const classifyField = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef, cursor: LayoutCursor): FieldPlan | null => { + if (isPrim(t, "Bool")) { + return allocateBool(cursor); + } + if (isPrim(t, "Int") || isPrim(t, "Float")) { + return { kind: isPrim(t, "Int") ? "int" : "float", slot: allocateWord(cursor) }; + } + const width = widthOf(t); + if (width !== undefined) { + return { kind: "width", slot: allocateWord(cursor), width }; + } + const optionInner = t.name === "Option" && t.args.length === 1 ? t.args[0] : undefined; + const optScalar = optionInner === undefined ? null : allocateOptScalar(optionInner, cursor); + if (optScalar !== null) { + return optScalar; + } + const optional = optionInner === undefined ? null : pointerField(decls, optionInner, cursor.ptrSlot, true); + const required = optionInner === undefined ? pointerField(decls, t, cursor.ptrSlot, false) : optional; + if (required !== null) { + allocatePtr(cursor); + } + return required; +}; + +export const classifyRecord = ( + decls: readonly ResolvedDecl[], + rec: ResolvedRecord +): Result => { + const cursor = newLayoutCursor(); + const fields: Array<{ name: string; plan: FieldPlan }> = []; + for (const field of rec.fields) { + const plan = classifyField(decls, field.type, cursor); + if (plan === null) { + return err(diag(`tdbin-ts: unsupported field type '${printTypeRef(field.type)}' in ${rec.name}.${field.name}`)); + } + fields.push({ name: field.name, plan }); + } + return ok({ dataWords: cursor.dataSlot, ptrWords: cursor.ptrSlot, fields }); +}; + +const classifyVariant = (union: ResolvedUnion, variant: ResolvedVariant): Result => { + if (variant.fields.length === 0) { + return ok(null); + } + if (isInlineVariant(variant)) { + return ok({ + kind: "inline", + typeName: variantPayloadName(union, variant), + fields: variant.fields.map((f, i) => ({ name: f.name, payload: payloadFieldName(variant, i) })), + }); + } + const single = variant.fields[0]?.type; + return single?.resolution.kind === "declared" + ? ok({ kind: "child", typeName: single.resolution.declName }) + : single !== undefined && isPrim(single, "String") + ? ok({ kind: "string" }) + : err( + diag( + `tdbin-ts: variant '${variant.name}' payload '${single === undefined ? "?" : printTypeRef(single)}' unsupported in v0` + ) + ); +}; + +export const classifyUnion = (union: ResolvedUnion): Result => { + const variants: Array<{ name: string; ordinal: number; payload: VariantPlan }> = []; + for (const [ordinal, variant] of union.variants.entries()) { + const payload = classifyVariant(union, variant); + if (!payload.ok) { + return payload; + } + variants.push({ name: variant.name, ordinal, payload: payload.value }); + } + return ok({ ptrWords: variants.some((variant) => variant.payload !== null) ? 1 : 0, variants }); +}; diff --git a/src/typediagram/src/converters/typescript-tdbin-widths.ts b/src/typediagram/src/converters/typescript-tdbin-widths.ts new file mode 100644 index 0000000..5c3d83c --- /dev/null +++ b/src/typediagram/src/converters/typescript-tdbin-widths.ts @@ -0,0 +1,61 @@ +// [TDBIN-WIDTH-RANGE] Width-refined integer fields for the TypeScript TDBIN +// generator. Allocation mirrors the Rust emitter (one data word; `Option` +// = presence bit + value word), so layouts and hashes match; the runtime +// `tdbin.width` range-checks every value on encode and decode. +import type { ResolvedTypeRef } from "../model/types.js"; +import type { FieldPlan, TsWidth } from "./typescript-tdbin-defaults.js"; + +const WIDTHS: Readonly> = { + I32: "i32", + U8: "u8", + U16: "u16", + U32: "u32", + U64: "u64", + Size: "size", +}; + +/** The runtime width kind for a bare width primitive, else undefined. */ +export const widthOf = (t: ResolvedTypeRef): TsWidth | undefined => + t.resolution.kind === "primitive" && t.args.length === 0 ? WIDTHS[t.name] : undefined; + +type WidthPlan = Extract; + +const kindArg = (width: TsWidth): string => `"${width}"`; + +const read = (width: TsWidth, slot: number): string => + width === "u64" + ? `tdbin.width.readU64(reader, at, ${String(slot)})` + : `tdbin.width.readNumber(reader, at, ${String(slot)}, ${kindArg(width)})`; + +/** Write lines reading `src`; the final binding is `${field}`. */ +export const writeWidthLines = (field: string, src: string, plan: WidthPlan): string[] => + plan.kind === "width" + ? [ + ` const ${field} = tdbin.width.writeScalar(writer, at, ${String(plan.slot)}, ${kindArg(plan.width)}, ${src});`, + ] + : [ + ` const ${field}Present = tdbin.writer.boolBit(writer, at, ${String(plan.presenceSlot)}, ${String(plan.presenceBit)}, ${src} !== undefined);`, + ` if (!${field}Present.ok) return ${field}Present;`, + ` const ${field} = tdbin.width.writeScalar(writer, at, ${String(plan.valueSlot)}, ${kindArg(plan.width)}, ${src} ?? ${plan.width === "u64" ? "0n" : "0"});`, + ]; + +export const readWidthLines = (field: string, plan: WidthPlan): string[] => + plan.kind === "width" + ? [` const ${field}Word = ${read(plan.width, plan.slot)};`] + : [ + ` const ${field}Present = tdbin.reader.boolBit(reader, at, ${String(plan.presenceSlot)}, ${String(plan.presenceBit)});`, + ` const ${field}Word = ${read(plan.width, plan.valueSlot)};`, + ]; + +export const widthResultNames = (field: string, plan: WidthPlan): string[] => + plan.kind === "width" ? [`${field}Word`] : [`${field}Present`, `${field}Word`]; + +export const widthValue = (field: string, plan: WidthPlan): string => + plan.kind === "width" ? `${field}Word.value` : `${field}Present.value ? ${field}Word.value : undefined`; + +/** `List` write/read expressions for the list emitter. */ +export const widthListWrite = (target: string, width: TsWidth, source: string): string => + `tdbin.width.writeList(${target}, ${kindArg(width)}, ${source})`; + +export const widthListRead = (src: string, width: TsWidth): string => + width === "u64" ? `tdbin.width.readU64List(${src})` : `tdbin.width.readNumberList(${src}, ${kindArg(width)})`; diff --git a/packages/typediagram/src/converters/typescript-tdbin.ts b/src/typediagram/src/converters/typescript-tdbin.ts similarity index 52% rename from packages/typediagram/src/converters/typescript-tdbin.ts rename to src/typediagram/src/converters/typescript-tdbin.ts index 99a75df..7533710 100644 --- a/packages/typediagram/src/converters/typescript-tdbin.ts +++ b/src/typediagram/src/converters/typescript-tdbin.ts @@ -1,21 +1,20 @@ // [CONV-TS-TDBIN] Generate TypeScript TDBIN codecs that target -// `packages/typediagram/src/tdbin`. Like the Rust generator, this bakes the +// `src/typediagram/src/tdbin`. Like the Rust generator, this bakes the // schema layout into typed codec objects instead of using reflective values on // the hot path ([TDBIN-FUTURE-TS], [TDBIN-REC-ALLOC]). import type { Diagnostic } from "../parser/diagnostics.js"; import { - isTupleVariantFields, type Model, type ResolvedDecl, type ResolvedRecord, - type ResolvedTypeRef, type ResolvedUnion, - type ResolvedVariant, visibleDeclsForTarget, } from "../model/types.js"; import { type Result, err, ok } from "../result.js"; -import { printTypeRef } from "./parse-typeref.js"; -import { allocateBit, allocatePtr, allocateWord, type LayoutCursor, newLayoutCursor } from "./tdbin-alloc.js"; +import { fnv1a64, layoutManifest } from "./rust-tdbin-hash.js"; +import { classifyRecord, classifyUnion } from "./typescript-tdbin-plan.js"; +import { listResultNames, listValue, readListLines, writeListLines } from "./typescript-tdbin-lists.js"; +import { readWidthLines, widthResultNames, widthValue, writeWidthLines } from "./typescript-tdbin-widths.js"; import { type DeclPlan, diag, @@ -24,148 +23,32 @@ import { pointerDefault, type RecordPlan, type UnionPlan, + inlineVariantValue, variantPayloadDefault, - type VariantPlan, } from "./typescript-tdbin-defaults.js"; +import { withVariantRecords } from "./tdbin-variant-records.js"; +import type { TypeScriptOpts } from "./types.js"; import { typescript } from "./typescript.js"; const tsNum = (value: number): string => String(value); -const isPrim = (t: ResolvedTypeRef, name: string): boolean => - t.name === name && t.resolution.kind === "primitive" && t.args.length === 0; - -const declaredRecord = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): ResolvedRecord | undefined => { - if (t.resolution.kind !== "declared") { - return undefined; - } - const { declName } = t.resolution; - return decls.find((d): d is ResolvedRecord => d.kind === "record" && d.name === declName); -}; - -const declaredUnion = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef): ResolvedUnion | undefined => { - if (t.resolution.kind !== "declared") { - return undefined; - } - const { declName } = t.resolution; - return decls.find((d): d is ResolvedUnion => d.kind === "union" && d.name === declName); -}; - -const allocateBool = (cursor: LayoutCursor): FieldPlan => { - const { slot, bit } = allocateBit(cursor); - return { kind: "bool", slot, bit }; -}; - -/** `Option` takes a 1-bit presence flag in the shared bool bitset plus - * a natural-width value slot ([TDBIN-PRIM-OPTION]) — the SAME allocator the - * Rust emitter uses, so both emitters bake identical slot/bit numbers. */ -const allocateOptScalar = (inner: ResolvedTypeRef, cursor: LayoutCursor): FieldPlan | null => { - if (isPrim(inner, "Bool")) { - const presence = allocateBit(cursor); - const value = allocateBit(cursor); - return { - kind: "optBool", - presenceSlot: presence.slot, - presenceBit: presence.bit, - valueSlot: value.slot, - valueBit: value.bit, - }; - } - if (!isPrim(inner, "Int") && !isPrim(inner, "Float")) { - return null; - } - const presence = allocateBit(cursor); - return { - kind: isPrim(inner, "Int") ? "optInt" : "optFloat", - presenceSlot: presence.slot, - presenceBit: presence.bit, - valueSlot: allocateWord(cursor), - }; -}; - -const pointerField = ( - decls: readonly ResolvedDecl[], - t: ResolvedTypeRef, - slot: number, - optional: boolean -): FieldPlan | null => - isPrim(t, "String") - ? { kind: "string", slot, optional } - : isPrim(t, "Bytes") - ? { kind: "bytes", slot, optional } - : declaredRecord(decls, t) !== undefined || declaredUnion(decls, t) !== undefined - ? { kind: "child", slot, optional, typeName: t.resolution.kind === "declared" ? t.resolution.declName : t.name } - : null; - -const classifyField = (decls: readonly ResolvedDecl[], t: ResolvedTypeRef, cursor: LayoutCursor): FieldPlan | null => { - if (isPrim(t, "Bool")) { - return allocateBool(cursor); - } - if (isPrim(t, "Int") || isPrim(t, "Float")) { - return { kind: isPrim(t, "Int") ? "int" : "float", slot: allocateWord(cursor) }; - } - const optionInner = t.name === "Option" && t.args.length === 1 ? t.args[0] : undefined; - const optScalar = optionInner === undefined ? null : allocateOptScalar(optionInner, cursor); - if (optScalar !== null) { - return optScalar; - } - const optional = optionInner === undefined ? null : pointerField(decls, optionInner, cursor.ptrSlot, true); - const required = optionInner === undefined ? pointerField(decls, t, cursor.ptrSlot, false) : optional; - if (required !== null) { - allocatePtr(cursor); - } - return required; -}; - -const classifyRecord = (decls: readonly ResolvedDecl[], rec: ResolvedRecord): Result => { - const cursor = newLayoutCursor(); - const fields: Array<{ name: string; plan: FieldPlan }> = []; - for (const field of rec.fields) { - const plan = classifyField(decls, field.type, cursor); - if (plan === null) { - return err(diag(`tdbin-ts: unsupported field type '${printTypeRef(field.type)}' in ${rec.name}.${field.name}`)); - } - fields.push({ name: field.name, plan }); - } - return ok({ dataWords: cursor.dataSlot, ptrWords: cursor.ptrSlot, fields }); -}; - -const classifyVariant = (variant: ResolvedVariant): Result => { - if (variant.fields.length === 0) { - return ok(null); - } - const single = - variant.fields.length === 1 && isTupleVariantFields(variant.fields) ? variant.fields[0]?.type : undefined; - if (single === undefined) { - return err(diag(`tdbin-ts: variant '${variant.name}' must be bare or a single tuple field in v0`)); - } - return single.resolution.kind === "declared" - ? ok({ kind: "child", typeName: single.resolution.declName }) - : isPrim(single, "String") - ? ok({ kind: "string" }) - : err(diag(`tdbin-ts: variant '${variant.name}' payload '${printTypeRef(single)}' unsupported in v0`)); -}; - -const classifyUnion = (union: ResolvedUnion): Result => { - const variants: Array<{ name: string; ordinal: number; payload: VariantPlan }> = []; - for (const [ordinal, variant] of union.variants.entries()) { - const payload = classifyVariant(variant); - if (!payload.ok) { - return payload; - } - variants.push({ name: variant.name, ordinal, payload: payload.value }); - } - return ok({ ptrWords: variants.some((variant) => variant.payload !== null) ? 1 : 0, variants }); -}; - /** Write the 1-bit presence flag; absent values write zero lanes ([TDBIN-ENC-ZERO]). */ -const writePresenceLines = (field: string, plan: { presenceSlot: number; presenceBit: number }): string[] => [ - ` const ${field}Present = tdbin.writer.boolBit(writer, at, ${tsNum(plan.presenceSlot)}, ${tsNum(plan.presenceBit)}, value.${field} !== undefined);`, +const writePresenceLines = ( + field: string, + src: string, + plan: { presenceSlot: number; presenceBit: number } +): string[] => [ + ` const ${field}Present = tdbin.writer.boolBit(writer, at, ${tsNum(plan.presenceSlot)}, ${tsNum(plan.presenceBit)}, ${src} !== undefined);`, ` if (!${field}Present.ok) return ${field}Present;`, ]; -const emitWriteField = (codec: string, field: string, plan: FieldPlan): string[] => { - const value = `value.${field}`; +const emitWriteField = (codec: string, field: string, value: string, plan: FieldPlan): string[] => { switch (plan.kind) { + case "width": + case "optWidth": + return writeWidthLines(field, value, plan); + case "list": + return writeListLines(codec, field, value, plan); case "int": return [ ` const ${field}Bits = tdbin.scalar.i64Bits(${value});`, @@ -182,19 +65,19 @@ const emitWriteField = (codec: string, field: string, plan: FieldPlan): string[] ]; case "optInt": return [ - ...writePresenceLines(field, plan), + ...writePresenceLines(field, value, plan), ` const ${field}Bits = tdbin.scalar.i64Bits(${value} ?? 0);`, ` if (!${field}Bits.ok) return ${field}Bits;`, ` const ${field} = tdbin.writer.scalar(writer, at, ${tsNum(plan.valueSlot)}, ${field}Bits.value);`, ]; case "optFloat": return [ - ...writePresenceLines(field, plan), + ...writePresenceLines(field, value, plan), ` const ${field} = tdbin.writer.scalar(writer, at, ${tsNum(plan.valueSlot)}, tdbin.scalar.f64Bits(${value} ?? 0));`, ]; case "optBool": return [ - ...writePresenceLines(field, plan), + ...writePresenceLines(field, value, plan), ` const ${field} = tdbin.writer.boolBit(writer, at, ${tsNum(plan.valueSlot)}, ${tsNum(plan.valueBit)}, ${value} ?? false);`, ]; case "string": @@ -214,6 +97,11 @@ const emitWriteField = (codec: string, field: string, plan: FieldPlan): string[] const emitReadField = (codec: string, field: string, plan: FieldPlan): string[] => { switch (plan.kind) { + case "width": + case "optWidth": + return readWidthLines(field, plan); + case "list": + return readListLines(codec, field, plan); case "int": return [` const ${field}Word = tdbin.reader.scalar(reader, at, ${tsNum(plan.slot)});`]; case "float": @@ -245,6 +133,11 @@ const emitReadField = (codec: string, field: string, plan: FieldPlan): string[] /** READ-path result bindings the ok-guards must check, in emission order. */ const fieldResultNames = (field: string, plan: FieldPlan): string[] => { switch (plan.kind) { + case "width": + case "optWidth": + return widthResultNames(field, plan); + case "list": + return listResultNames(field, plan); case "int": case "float": return [`${field}Word`]; @@ -258,14 +151,22 @@ const fieldResultNames = (field: string, plan: FieldPlan): string[] => { } }; -const fieldValue = (field: string, plan: FieldPlan): string => { +const fieldValue = (field: string, plan: FieldPlan, options: TypeScriptOpts): string => { + const toInt = (word: string): string => + options.integerType === "bigint" ? `BigInt.asIntN(64, ${word})` : `tdbin.scalar.i64From(${word})`; + const integer = toInt(`${field}Word.value`); switch (plan.kind) { + case "width": + case "optWidth": + return widthValue(field, plan); + case "list": + return listValue(field, plan, toInt); case "int": - return `tdbin.scalar.i64From(${field}Word.value)`; + return integer; case "float": return `tdbin.scalar.f64From(${field}Word.value)`; case "optInt": - return `${field}Present.value ? tdbin.scalar.i64From(${field}Word.value) : undefined`; + return `${field}Present.value ? ${integer} : undefined`; case "optFloat": return `${field}Present.value ? tdbin.scalar.f64From(${field}Word.value) : undefined`; case "optBool": @@ -279,18 +180,22 @@ const fieldValue = (field: string, plan: FieldPlan): string => { } }; -const emitRecordCodec = (record: ResolvedRecord, plan: RecordPlan): string => { +const emitRecordCodec = (record: ResolvedRecord, plan: RecordPlan, hash: bigint, options: TypeScriptOpts): string => { const codec = `${record.name}Codec`; - // Write results always bind to the plain field name; `fieldResultName` is the - // READ-path binding (`${field}Word` for scalars) and must not guard writes. - const writeLines = plan.fields.flatMap(({ name, plan: fieldPlan }) => [ - ...emitWriteField(codec, name, fieldPlan), - ` if (!${name}.ok) return ${name};`, + // Locals are positional (`f0`, `f0Word`, …), never the field name: a field + // called `value`, `writer`, `at`, `tdbin` or a reserved word would otherwise + // shadow the codec's parameters/imports or fail to parse ([TDBIN-CODEGEN-LOCALS]). + // Write results bind to the plain local; `fieldResultNames` lists READ-path bindings. + const local = (i: number): string => `f${String(i)}`; + const writeLines = plan.fields.flatMap(({ name, plan: fieldPlan }, i) => [ + ...emitWriteField(codec, local(i), `value.${name}`, fieldPlan), + ` if (!${local(i)}.ok) return ${local(i)};`, ]); - const readLines = plan.fields.flatMap(({ name, plan: fieldPlan }) => emitReadField(codec, name, fieldPlan)); - const resultNames = plan.fields.flatMap(({ name, plan: fieldPlan }) => fieldResultNames(name, fieldPlan)); + const readLines = plan.fields.flatMap(({ plan: fieldPlan }, i) => emitReadField(codec, local(i), fieldPlan)); + const resultNames = plan.fields.flatMap(({ plan: fieldPlan }, i) => fieldResultNames(local(i), fieldPlan)); return [ `export const ${codec}: tdbin.StructCodec<${record.name}> = {`, + hashLine(hash), ` dataWords: ${tsNum(plan.dataWords)},`, ` ptrWords: ${tsNum(plan.ptrWords)},`, ` write: (writer, at, value) => {`, @@ -300,44 +205,52 @@ const emitRecordCodec = (record: ResolvedRecord, plan: RecordPlan): string => { ` read: (reader, at) => {`, ...readLines, ...resultNames.map((name) => ` if (!${name}.ok) return ${name};`), - ` return ok({ ${plan.fields.map(({ name, plan: fieldPlan }) => `${name}: ${fieldValue(name, fieldPlan)}`).join(", ")} });`, + ` return ok({ ${plan.fields.map(({ name, plan: fieldPlan }, i) => `${name}: ${fieldValue(local(i), fieldPlan, options)}`).join(", ")} });`, ` },`, `};`, ].join("\n"); }; const writeVariantPayload = (union: string, variant: UnionPlan["variants"][number]): string => { - if (variant.payload === null) { + const p = variant.payload; + if (p === null) { return ` return disc;`; } + const at = `writer, at, ${union}Codec.dataWords, 0`; const payload = - variant.payload.kind === "child" - ? `tdbin.writer.child(writer, at, ${union}Codec.dataWords, 0, ${variant.payload.typeName}Codec, value._0)` - : `tdbin.writer.string(writer, at, ${union}Codec.dataWords, 0, value._0)`; + p.kind === "inline" + ? `tdbin.writer.child(${at}, ${p.typeName}Codec, { ${p.fields.map((f) => `${f.payload}: value.${f.name}`).join(", ")} })` + : p.kind === "child" + ? `tdbin.writer.child(${at}, ${p.typeName}Codec, value._0)` + : `tdbin.writer.string(${at}, value._0)`; return ` return disc.ok ? ${payload} : disc;`; }; const readVariantPayload = (union: string, variant: UnionPlan["variants"][number]): string[] => { - if (variant.payload === null) { + const p = variant.payload; + if (p === null) { return [ ` const inactive = tdbin.reader.requireNullPointer(reader, at, 0);`, ` return inactive.ok ? ok({ kind: "${variant.name}" }) : inactive;`, ]; } - const payload = - variant.payload.kind === "child" - ? `tdbin.reader.child(reader, at, ${union}Codec.dataWords, 0, ${variant.payload.typeName}Codec)` - : `tdbin.reader.string(reader, at, ${union}Codec.dataWords, 0)`; + const at = `reader, at, ${union}Codec.dataWords, 0`; + const read = p.kind === "string" ? `tdbin.reader.string(${at})` : `tdbin.reader.child(${at}, ${p.typeName}Codec)`; + const value = + p.kind === "inline" + ? inlineVariantValue(variant.name, p.fields, `(payload.value ?? default${p.typeName}())`) + : `{ kind: "${variant.name}", _0: payload.value ?? ${variantPayloadDefault(p)} }`; return [ - ` const payload = ${payload};`, + ` const payload = ${read};`, ` if (!payload.ok) return payload;`, - ` return ok({ kind: "${variant.name}", _0: payload.value ?? ${variantPayloadDefault(variant.payload)} });`, + ` return ok(${value});`, ]; }; -const emitUnionCodec = (union: ResolvedUnion, plan: UnionPlan): string => +const emitUnionCodec = (union: ResolvedUnion, plan: UnionPlan, hash: bigint): string => [ `export const ${union.name}Codec: tdbin.StructCodec<${union.name}> = {`, + hashLine(hash), ` dataWords: 1,`, ` ptrWords: ${tsNum(plan.ptrWords)},`, ` write: (writer, at, value) => {`, @@ -365,6 +278,27 @@ const emitUnionCodec = (union: ResolvedUnion, plan: UnionPlan): string => `};`, ].join("\n"); +/** `layoutHash` property: the SAME canonical manifest + FNV-1a 64 the Rust + * emitter pins as `LAYOUT_HASH`, so both languages advertise one identity + * per compatibility major ([TDBIN-SCHEMA-HASH], [TDBIN-SCHEMA-CANON]). */ +const hashLine = (hash: bigint): string => ` layoutHash: 0x${hash.toString(16).padStart(16, "0")}n,`; + +const layoutHashFor = (decls: readonly ResolvedDecl[], decl: ResolvedDecl): Result => { + const manifest = layoutManifest(decls, decl, 1); + return manifest.ok ? ok(fnv1a64(manifest.value)) : manifest; +}; + +const emitCodec = (decls: readonly ResolvedDecl[], plan: DeclPlan, options: TypeScriptOpts) => { + const hash = layoutHashFor(decls, plan.decl); + return !hash.ok + ? hash + : ok( + plan.kind === "record" + ? emitRecordCodec(plan.decl, plan.plan, hash.value, options) + : emitUnionCodec(plan.decl, plan.plan, hash.value) + ); +}; + const planDecl = (decls: readonly ResolvedDecl[], decl: ResolvedDecl): Result => { if (decl.generics.length > 0) { return err(diag(`tdbin-ts: generic decl '${decl.name}' must be monomorphized before codec generation`)); @@ -382,8 +316,9 @@ const planDecl = (decls: readonly ResolvedDecl[], decl: ResolvedDecl): Result => { const plans: DeclPlan[] = []; - for (const decl of visibleDeclsForTarget(model.decls, "typescript")) { - const planned = planDecl(model.decls, decl); + const decls = withVariantRecords(model.decls); + for (const decl of withVariantRecords(visibleDeclsForTarget(model.decls, "typescript"))) { + const planned = planDecl(decls, decl); if (!planned.ok) { return planned; } @@ -392,32 +327,37 @@ const planDecls = (model: Model): Result => { return ok(plans); }; -export const emitTypeScriptCodec = (model: Model): Result => { +export const emitTypeScriptCodec = (model: Model, options: TypeScriptOpts = {}): Result => { const plans = planDecls(model); if (!plans.ok) { return plans; } - const defaults = emitDefaultFactories(plans.value); + const defaults = emitDefaultFactories(plans.value, options.integerType === "bigint" ? "0n" : "0"); if (!defaults.ok) { return defaults; } - const codecs = plans.value.map((plan) => - plan.kind === "record" ? emitRecordCodec(plan.decl, plan.plan) : emitUnionCodec(plan.decl, plan.plan) - ); + const codecs: string[] = []; + for (const plan of plans.value) { + const codec = emitCodec(model.decls, plan, options); + if (!codec.ok) { + return codec; + } + codecs.push(codec.value); + } return ok([...defaults.value, ...codecs].join("\n\n")); }; -export const generateTypeScriptModule = (model: Model): Result => { - const codec = emitTypeScriptCodec(model); +export const generateTypeScriptModule = (model: Model, options: TypeScriptOpts = {}): Result => { + const codec = emitTypeScriptCodec(model, options); if (!codec.ok) { return codec; } return ok( [ - `import { ok } from "typediagram-core";`, + `import { ok } from "typediagram-core/tdbin";`, `import * as tdbin from "typediagram-core/tdbin";`, ``, - typescript.toSource(model), + typescript.toSource({ ...model, decls: withVariantRecords(model.decls) }, options), codec.value, ``, ].join("\n") diff --git a/packages/typediagram/src/converters/typescript.ts b/src/typediagram/src/converters/typescript.ts similarity index 87% rename from packages/typediagram/src/converters/typescript.ts rename to src/typediagram/src/converters/typescript.ts index 32f3c22..18329a3 100644 --- a/packages/typediagram/src/converters/typescript.ts +++ b/src/typediagram/src/converters/typescript.ts @@ -30,6 +30,13 @@ import { mapBuiltinName, parseTypeRef, splitGenericArgs } from "./parse-typeref. const TD_TO_TS: Record = { Bool: "boolean", Int: "number", + I32: "number", + U8: "number", + U16: "number", + U32: "number", + U64: "bigint", + Size: "number", + Path: "string", Float: "number", String: "string", Bytes: "Uint8Array", @@ -44,6 +51,7 @@ const TD_TO_TS: Record = { const TS_TO_TD: Record = { boolean: "Bool", number: "Int", + bigint: "Int", string: "String", void: "Unit", Uint8Array: "Bytes", @@ -252,32 +260,34 @@ const fromTypeScript = (source: string): Result => { // ── To TypeScript ── -const mapTdToTs = (t: ResolvedTypeRef): string => { +const mapTdToTs = (t: ResolvedTypeRef, integerType: "number" | "bigint"): string => { // Option -> T | undefined. If T is itself a union type this could become // `A | B | undefined`, which parses back via the `T | undefined` rule below // as `Option` — still lossless for the round-trip of Option. if (t.name === "Option" && t.args.length === 1 && t.args[0] !== undefined) { - return `${mapTdToTs(t.args[0])} | undefined`; + return `${mapTdToTs(t.args[0], integerType)} | undefined`; } - const name = mapBuiltinName(t, TD_TO_TS); - return t.args.length === 0 ? name : `${name}<${t.args.map(mapTdToTs).join(", ")}>`; + const name = mapBuiltinName(t, { ...TD_TO_TS, Int: integerType }); + return t.args.length === 0 ? name : `${name}<${t.args.map((arg) => mapTdToTs(arg, integerType)).join(", ")}>`; }; -const mapUntaggedVariantToTs = (variant: ResolvedVariant): string => { +const mapUntaggedVariantToTs = (variant: ResolvedVariant, mapType: (type: ResolvedTypeRef) => string): string => { if (variant.fields.length === 0) { return "undefined"; } if (isTupleVariantFields(variant.fields)) { if (variant.fields.length === 1) { const [field] = variant.fields; - return field === undefined ? "undefined" : mapTdToTs(field.type); + return field === undefined ? "undefined" : mapType(field.type); } - return `[${variant.fields.map((field) => mapTdToTs(field.type)).join(", ")}]`; + return `[${variant.fields.map((field) => mapType(field.type)).join(", ")}]`; } - return `{ ${variant.fields.map((field) => `${field.name}: ${mapTdToTs(field.type)}`).join("; ")} }`; + return `{ ${variant.fields.map((field) => `${field.name}: ${mapType(field.type)}`).join("; ")} }`; }; -const toTypeScript = (model: Model): string => { +const toTypeScript = (model: Model, opts?: Parameters[1]): string => { + const integerType = opts !== undefined && "integerType" in opts ? (opts.integerType ?? "number") : "number"; + const mapType = (type: ResolvedTypeRef) => mapTdToTs(type, integerType); const lines: string[] = []; const decls = visibleDataDeclsForTarget(model.decls, "typescript"); @@ -287,22 +297,22 @@ const toTypeScript = (model: Model): string => { if (d.kind === "record") { lines.push(`export interface ${d.name}${genericsStr} {`); for (const f of d.fields) { - lines.push(` ${f.name}: ${mapTdToTs(f.type)};`); + lines.push(` ${f.name}: ${mapType(f.type)};`); } lines.push("}", ""); } else if (d.kind === "union") { const variants = d.untagged === true - ? d.variants.map(mapUntaggedVariantToTs) + ? d.variants.map((variant) => mapUntaggedVariantToTs(variant, mapType)) : d.variants.map((v) => { if (v.fields.length === 0) { return `{ kind: "${v.name}" }`; } - return `{ kind: "${v.name}"; ${v.fields.map((f) => `${f.name}: ${mapTdToTs(f.type)}`).join("; ")} }`; + return `{ kind: "${v.name}"; ${v.fields.map((f) => `${f.name}: ${mapType(f.type)}`).join("; ")} }`; }); lines.push(`export type ${d.name}${genericsStr} =`, ` | ${variants.join("\n | ")};`, ""); } else { - lines.push(`export type ${d.name}${genericsStr} = ${mapTdToTs(d.target)};`, ""); + lines.push(`export type ${d.name}${genericsStr} = ${mapType(d.target)};`, ""); } } diff --git a/packages/typediagram/src/converters/typeshed-decls.ts b/src/typediagram/src/converters/typeshed-decls.ts similarity index 100% rename from packages/typediagram/src/converters/typeshed-decls.ts rename to src/typediagram/src/converters/typeshed-decls.ts diff --git a/packages/typediagram/src/converters/typeshed-tree.ts b/src/typediagram/src/converters/typeshed-tree.ts similarity index 100% rename from packages/typediagram/src/converters/typeshed-tree.ts rename to src/typediagram/src/converters/typeshed-tree.ts diff --git a/packages/typediagram/src/converters/typeshed-type-ref.ts b/src/typediagram/src/converters/typeshed-type-ref.ts similarity index 100% rename from packages/typediagram/src/converters/typeshed-type-ref.ts rename to src/typediagram/src/converters/typeshed-type-ref.ts diff --git a/packages/typediagram/src/converters/typeshed.ts b/src/typediagram/src/converters/typeshed.ts similarity index 97% rename from packages/typediagram/src/converters/typeshed.ts rename to src/typediagram/src/converters/typeshed.ts index 4d0e084..6c647fb 100644 --- a/packages/typediagram/src/converters/typeshed.ts +++ b/src/typediagram/src/converters/typeshed.ts @@ -12,6 +12,13 @@ export interface TypeshedConverter extends Converter { const TD_TO_PYI: Readonly> = { Bool: "bool", Int: "int", + I32: "int", + U8: "int", + U16: "int", + U32: "int", + U64: "int", + Size: "int", + Path: "str", Float: "float", String: "str", Bytes: "bytes", diff --git a/packages/typediagram/src/editor/controls.ts b/src/typediagram/src/editor/controls.ts similarity index 100% rename from packages/typediagram/src/editor/controls.ts rename to src/typediagram/src/editor/controls.ts diff --git a/packages/typediagram/src/editor/effects.ts b/src/typediagram/src/editor/effects.ts similarity index 100% rename from packages/typediagram/src/editor/effects.ts rename to src/typediagram/src/editor/effects.ts diff --git a/packages/typediagram/src/editor/index.ts b/src/typediagram/src/editor/index.ts similarity index 100% rename from packages/typediagram/src/editor/index.ts rename to src/typediagram/src/editor/index.ts diff --git a/packages/typediagram/src/editor/inspector.ts b/src/typediagram/src/editor/inspector.ts similarity index 77% rename from packages/typediagram/src/editor/inspector.ts rename to src/typediagram/src/editor/inspector.ts index 81b519b..5aeb207 100644 --- a/packages/typediagram/src/editor/inspector.ts +++ b/src/typediagram/src/editor/inspector.ts @@ -8,7 +8,7 @@ import { type EditorFailure, } from "./source-editor.js"; import { closeIcon, type CanvasChrome } from "./controls.js"; -import { runWhen } from "./effects.js"; +import { runWhen, runWhenDefined } from "./effects.js"; import type { VisualEditorOptions } from "./visual-editor.js"; export type EditorRow = { name: string; type: string }; @@ -46,7 +46,9 @@ const field = (labelText: string, value: string, onChange: (value: string) => vo const label = document.createElement("span"); const input = document.createElement("input"); label.textContent = labelText; - input.value = value; + // defaultValue = the rendered model value, so `value !== defaultValue` marks + // uncommitted or rejected text ([EDITOR-INSPECTOR-PENDING]). + input.defaultValue = value; input.setAttribute("data-td-interactive", "true"); input.addEventListener("change", () => { onChange(input.value); @@ -142,7 +144,35 @@ const appendDeleteButton = ( chrome.inspectorBody.appendChild(button); }; +type PendingInput = { index: number; value: string; focused: boolean }; + +const inspectorInputs = (chrome: CanvasChrome) => [...chrome.inspectorBody.querySelectorAll("input")]; + +/** [EDITOR-INSPECTOR-PENDING] Inputs of the shown node holding text the model does not + * (typed, rejected, or awaiting an async re-render), so a refresh never wipes them. */ +const pendingInputs = (chrome: CanvasChrome, nodeName: string): PendingInput[] => + chrome.inspectorBody.dataset["tdNode"] === nodeName + ? inspectorInputs(chrome).flatMap((input, index) => + input.value !== input.defaultValue + ? [{ index, value: input.value, focused: document.activeElement === input }] + : [] + ) + : []; + +const restorePending = (chrome: CanvasChrome, pending: PendingInput[]) => { + const inputs = inspectorInputs(chrome); + pending.forEach(({ index, value, focused }) => { + runWhenDefined(inputs[index], (input) => { + input.value = value; + runWhen(focused, () => { + input.focus(); + }); + }); + }); +}; + export const renderInspector = (node: EditorNode, chrome: CanvasChrome, options: VisualEditorOptions) => { + const pending = pendingInputs(chrome, node.name); const mutate = (result: Result) => { applyMutation(result, options, chrome); }; @@ -156,5 +186,7 @@ export const renderInspector = (node: EditorNode, chrome: CanvasChrome, options: ); appendAddButton(node, chrome, options, mutate); appendDeleteButton(node, chrome, options, mutate); + chrome.inspectorBody.dataset["tdNode"] = node.name; + restorePending(chrome, pending); chrome.inspector.hidden = false; }; diff --git a/packages/typediagram/src/editor/source-editor.ts b/src/typediagram/src/editor/source-editor.ts similarity index 100% rename from packages/typediagram/src/editor/source-editor.ts rename to src/typediagram/src/editor/source-editor.ts diff --git a/packages/typediagram/src/editor/styles.ts b/src/typediagram/src/editor/styles.ts similarity index 100% rename from packages/typediagram/src/editor/styles.ts rename to src/typediagram/src/editor/styles.ts diff --git a/packages/typediagram/src/editor/viewport.ts b/src/typediagram/src/editor/viewport.ts similarity index 100% rename from packages/typediagram/src/editor/viewport.ts rename to src/typediagram/src/editor/viewport.ts diff --git a/packages/typediagram/src/editor/visual-editor.ts b/src/typediagram/src/editor/visual-editor.ts similarity index 100% rename from packages/typediagram/src/editor/visual-editor.ts rename to src/typediagram/src/editor/visual-editor.ts diff --git a/packages/typediagram/src/index.ts b/src/typediagram/src/index.ts similarity index 100% rename from packages/typediagram/src/index.ts rename to src/typediagram/src/index.ts diff --git a/packages/typediagram/src/integrations/markdown.ts b/src/typediagram/src/integrations/markdown.ts similarity index 100% rename from packages/typediagram/src/integrations/markdown.ts rename to src/typediagram/src/integrations/markdown.ts diff --git a/packages/typediagram/src/layout/elk.ts b/src/typediagram/src/layout/elk.ts similarity index 100% rename from packages/typediagram/src/layout/elk.ts rename to src/typediagram/src/layout/elk.ts diff --git a/packages/typediagram/src/layout/index.ts b/src/typediagram/src/layout/index.ts similarity index 100% rename from packages/typediagram/src/layout/index.ts rename to src/typediagram/src/layout/index.ts diff --git a/packages/typediagram/src/layout/measure.ts b/src/typediagram/src/layout/measure.ts similarity index 100% rename from packages/typediagram/src/layout/measure.ts rename to src/typediagram/src/layout/measure.ts diff --git a/packages/typediagram/src/layout/types.ts b/src/typediagram/src/layout/types.ts similarity index 100% rename from packages/typediagram/src/layout/types.ts rename to src/typediagram/src/layout/types.ts diff --git a/packages/typediagram/src/markdown.ts b/src/typediagram/src/markdown.ts similarity index 100% rename from packages/typediagram/src/markdown.ts rename to src/typediagram/src/markdown.ts diff --git a/packages/typediagram/src/model/build.ts b/src/typediagram/src/model/build.ts similarity index 100% rename from packages/typediagram/src/model/build.ts rename to src/typediagram/src/model/build.ts diff --git a/packages/typediagram/src/model/builder.ts b/src/typediagram/src/model/builder.ts similarity index 100% rename from packages/typediagram/src/model/builder.ts rename to src/typediagram/src/model/builder.ts diff --git a/packages/typediagram/src/model/edges.ts b/src/typediagram/src/model/edges.ts similarity index 100% rename from packages/typediagram/src/model/edges.ts rename to src/typediagram/src/model/edges.ts diff --git a/packages/typediagram/src/model/index.ts b/src/typediagram/src/model/index.ts similarity index 100% rename from packages/typediagram/src/model/index.ts rename to src/typediagram/src/model/index.ts diff --git a/packages/typediagram/src/model/json.ts b/src/typediagram/src/model/json.ts similarity index 100% rename from packages/typediagram/src/model/json.ts rename to src/typediagram/src/model/json.ts diff --git a/packages/typediagram/src/model/print.ts b/src/typediagram/src/model/print.ts similarity index 100% rename from packages/typediagram/src/model/print.ts rename to src/typediagram/src/model/print.ts diff --git a/packages/typediagram/src/model/types.ts b/src/typediagram/src/model/types.ts similarity index 97% rename from packages/typediagram/src/model/types.ts rename to src/typediagram/src/model/types.ts index b5cb551..e163a90 100644 --- a/packages/typediagram/src/model/types.ts +++ b/src/typediagram/src/model/types.ts @@ -10,6 +10,14 @@ export const PRIMITIVES: ReadonlySet = new Set([ "DateTime", "Uuid", "Decimal", + // [MODEL-WIDTH] width-refined integers + Path (#85, [TDBIN-FUTURE-WIDTH-TYPES]). + "I32", + "U8", + "U16", + "U32", + "U64", + "Size", + "Path", ]); /** [MODEL-CODEGEN-UNKNOWN] Builtin names converters understand beyond PRIMITIVES. */ diff --git a/packages/typediagram/src/model/validate.ts b/src/typediagram/src/model/validate.ts similarity index 100% rename from packages/typediagram/src/model/validate.ts rename to src/typediagram/src/model/validate.ts diff --git a/packages/typediagram/src/parser/ast.ts b/src/typediagram/src/parser/ast.ts similarity index 100% rename from packages/typediagram/src/parser/ast.ts rename to src/typediagram/src/parser/ast.ts diff --git a/packages/typediagram/src/parser/diagnostics.ts b/src/typediagram/src/parser/diagnostics.ts similarity index 100% rename from packages/typediagram/src/parser/diagnostics.ts rename to src/typediagram/src/parser/diagnostics.ts diff --git a/packages/typediagram/src/parser/function.ts b/src/typediagram/src/parser/function.ts similarity index 100% rename from packages/typediagram/src/parser/function.ts rename to src/typediagram/src/parser/function.ts diff --git a/packages/typediagram/src/parser/index.ts b/src/typediagram/src/parser/index.ts similarity index 100% rename from packages/typediagram/src/parser/index.ts rename to src/typediagram/src/parser/index.ts diff --git a/packages/typediagram/src/parser/lexer.ts b/src/typediagram/src/parser/lexer.ts similarity index 100% rename from packages/typediagram/src/parser/lexer.ts rename to src/typediagram/src/parser/lexer.ts diff --git a/packages/typediagram/src/parser/parse-common.ts b/src/typediagram/src/parser/parse-common.ts similarity index 100% rename from packages/typediagram/src/parser/parse-common.ts rename to src/typediagram/src/parser/parse-common.ts diff --git a/packages/typediagram/src/parser/parser.ts b/src/typediagram/src/parser/parser.ts similarity index 100% rename from packages/typediagram/src/parser/parser.ts rename to src/typediagram/src/parser/parser.ts diff --git a/packages/typediagram/src/render-svg/hooks.ts b/src/typediagram/src/render-svg/hooks.ts similarity index 100% rename from packages/typediagram/src/render-svg/hooks.ts rename to src/typediagram/src/render-svg/hooks.ts diff --git a/packages/typediagram/src/render-svg/index.ts b/src/typediagram/src/render-svg/index.ts similarity index 100% rename from packages/typediagram/src/render-svg/index.ts rename to src/typediagram/src/render-svg/index.ts diff --git a/packages/typediagram/src/render-svg/render.ts b/src/typediagram/src/render-svg/render.ts similarity index 100% rename from packages/typediagram/src/render-svg/render.ts rename to src/typediagram/src/render-svg/render.ts diff --git a/packages/typediagram/src/render-svg/svg-tag.ts b/src/typediagram/src/render-svg/svg-tag.ts similarity index 100% rename from packages/typediagram/src/render-svg/svg-tag.ts rename to src/typediagram/src/render-svg/svg-tag.ts diff --git a/packages/typediagram/src/render-svg/theme.ts b/src/typediagram/src/render-svg/theme.ts similarity index 100% rename from packages/typediagram/src/render-svg/theme.ts rename to src/typediagram/src/render-svg/theme.ts diff --git a/packages/typediagram/src/result.ts b/src/typediagram/src/result.ts similarity index 100% rename from packages/typediagram/src/result.ts rename to src/typediagram/src/result.ts diff --git a/packages/typediagram/src/sample.ts b/src/typediagram/src/sample.ts similarity index 100% rename from packages/typediagram/src/sample.ts rename to src/typediagram/src/sample.ts diff --git a/packages/typediagram/src/tdbin/error.ts b/src/typediagram/src/tdbin/error.ts similarity index 93% rename from packages/typediagram/src/tdbin/error.ts rename to src/typediagram/src/tdbin/error.ts index 12530e9..6e02d2c 100644 --- a/packages/typediagram/src/tdbin/error.ts +++ b/src/typediagram/src/tdbin/error.ts @@ -8,6 +8,8 @@ const MESSAGES: Record = { ReservedBits: "frame reserved bits or fields were nonzero", LengthMismatch: "frame body length does not match available bytes", HashMismatch: "frame schema hash does not match the expected layout hash", + BadBase64: "framed payload text is not valid base64", + ValueOutOfRange: "integer is outside its declared width", PackedTruncated: "packed body ended mid-element", PointerOutOfBounds: "pointer references an out-of-bounds word", ReservedPointerKind: "pointer used a reserved kind", diff --git a/packages/typediagram/src/tdbin/frame.ts b/src/typediagram/src/tdbin/frame.ts similarity index 100% rename from packages/typediagram/src/tdbin/frame.ts rename to src/typediagram/src/tdbin/frame.ts diff --git a/src/typediagram/src/tdbin/index.ts b/src/typediagram/src/tdbin/index.ts new file mode 100644 index 0000000..d0a6c50 --- /dev/null +++ b/src/typediagram/src/tdbin/index.ts @@ -0,0 +1,140 @@ +import { ok, type Result } from "../result.js"; +import { tdbinErr } from "./error.js"; +import { decodeFrame, encodeFrame, encodePackedFrame, looksFramed, unpackFrameBody } from "./frame.js"; +import { message as readMessage } from "./reader.js"; +import type { StructCodec, TdbinError } from "./types.js"; +import { message as writeMessage } from "./writer.js"; + +export { err, ok, type Result } from "../result.js"; +export type { FrameMessage, Reader, StructCodec, TdbinError, TdbinErrorCode, Writer } from "./types.js"; +export * as frame from "./frame.js"; +export * as list from "./list.js"; +export * as pack from "./pack.js"; +export * as pointer from "./pointer.js"; +export * as reader from "./reader.js"; +export * as scalar from "./word.js"; +export * as width from "./width.js"; +export * as writer from "./writer.js"; +export const readerError = tdbinErr; + +export const encode = (codec: StructCodec, value: T): Result => + writeMessage(codec, value); + +export const decode = (codec: StructCodec, bytes: Uint8Array): Result => readMessage(codec, bytes); + +const pinnedHash = (codec: StructCodec): bigint | null => codec.layoutHash ?? null; + +/** Frame-level hash guard ([TDBIN-SCHEMA-HASH]): an explicit `expected` hash is + * required outright; otherwise an advertised hash must not contradict the + * codec's pinned hash. Mirrors the Rust runtime's `decode_framed`. */ +const checkHash = ( + codec: StructCodec, + got: bigint | null, + expected: bigint | null +): Result => { + const pinned = pinnedHash(codec); + const want = expected ?? (got === null ? null : pinned); + return want === null || got === want ? ok(undefined) : tdbinErr("HashMismatch", { expectedHash: want, gotHash: got }); +}; + +const decodeFrameWith = ( + codec: StructCodec, + bytes: Uint8Array, + expected: bigint | null +): Result => { + const framed = decodeFrame(bytes); + if (!framed.ok) { + return framed; + } + const hashed = checkHash(codec, framed.value.schemaHash, expected); + const body = hashed.ok ? unpackFrameBody(framed.value) : hashed; + return body.ok ? decode(codec, body.value) : body; +}; + +/** Encode a framed message advertising `schemaHash` (default: the codec's pinned hash). */ +export const encodeFramed = ( + codec: StructCodec, + value: T, + schemaHash: bigint | null = pinnedHash(codec) +): Result => { + const body = encode(codec, value); + return body.ok ? encodeFrame(body.value, { schemaHash }) : body; +}; + +/** Encode a packed framed message advertising `schemaHash` (default: the codec's pinned hash). */ +export const encodePackedFramed = ( + codec: StructCodec, + value: T, + schemaHash: bigint | null = pinnedHash(codec) +): Result => { + const body = encode(codec, value); + return body.ok ? encodePackedFrame(body.value, schemaHash) : body; +}; + +/** Decode a REQUIRED frame whose hash must equal `expectedHash` (default: the + * codec's pinned hash). A missing or different hash is `HashMismatch` — the + * typed wire-mismatch signal ([TDBIN-SCHEMA-HASH]). */ +export const decodeFramed = ( + codec: StructCodec, + bytes: Uint8Array, + expectedHash: bigint | null = pinnedHash(codec) +): Result => decodeFrameWith(codec, bytes, expectedHash); + +/** Decode framed or raw bytes; a framed hash must agree with `expectedHash` or the pinned hash. */ +export const decodeAuto = ( + codec: StructCodec, + bytes: Uint8Array, + expectedHash: bigint | null = null +): Result => (looksFramed(bytes) ? decodeFrameWith(codec, bytes, expectedHash) : decode(codec, bytes)); + +/** Packed framed message as base64 text, for payloads that ride inside JSON + * (e.g. a JSON-RPC/LSP envelope) ([TDBIN-FRAME-BASE64]). */ +export const encodeFramedBase64 = (codec: StructCodec, value: T): Result => { + const framed = encodePackedFramed(codec, value); + return framed.ok ? ok(toBase64(framed.value)) : framed; +}; + +/** Inverse of {@link encodeFramedBase64}: `BadBase64`, `BadMagic`, `HashMismatch`… as typed errors. */ +export const decodeFramedBase64 = (codec: StructCodec, text: string): Result => { + const bytes = fromBase64(text); + return bytes.ok ? decodeFramed(codec, bytes.value) : bytes; +}; + +const BASE64_CHUNK = 0x8000; + +export const toBase64 = (bytes: Uint8Array): string => { + const parts: string[] = []; + for (let offset = 0; offset < bytes.length; offset += BASE64_CHUNK) { + parts.push(String.fromCharCode(...bytes.subarray(offset, offset + BASE64_CHUNK))); + } + return btoa(parts.join("")); +}; + +export const fromBase64 = (text: string): Result => { + try { + const binary = atob(text); + return ok(Uint8Array.from(binary, (char) => char.charCodeAt(0))); + } catch { + return tdbinErr("BadBase64"); + } +}; + +export const fromHex = (hex: string): Result => { + if (hex.length % 2 !== 0) { + return tdbinErr("BadLength"); + } + const bytes: number[] = []; + for (let offset = 0; offset < hex.length; offset += 2) { + const byte = Number.parseInt(hex.slice(offset, offset + 2), 16); + if (!Number.isInteger(byte)) { + return tdbinErr("BadLength"); + } + bytes.push(byte); + } + return ok(Uint8Array.from(bytes)); +}; + +export const toHex = (bytes: Uint8Array): string => + Array.from(bytes) + .map((byte) => byte.toString(16).padStart(2, "0")) + .join(""); diff --git a/src/typediagram/src/tdbin/list.ts b/src/typediagram/src/tdbin/list.ts new file mode 100644 index 0000000..ec66965 --- /dev/null +++ b/src/typediagram/src/tdbin/list.ts @@ -0,0 +1,40 @@ +// [TDBIN-TS-LIST] Element conversions the generated TypeScript list codecs +// share, so generated modules stay small: `List` words with range checks, +// and `List` as one ordinal byte per element ([TDBIN-LIST-ELEM]). +import { ok, type Result } from "../result.js"; +import { tdbinErr } from "./error.js"; +import type { TdbinError } from "./types.js"; +import { i64Bits } from "./word.js"; + +/** `List` → i64 words; any value outside the i64 domain is `LimitExceeded`. */ +export const i64Words = (values: readonly (number | bigint)[]): Result => { + const words: bigint[] = []; + for (const value of values) { + const bits = i64Bits(value); + if (!bits.ok) { + return bits; + } + words.push(bits.value); + } + return ok(words); +}; + +/** `List` → declaration ordinals, one byte each. */ +export const enumOrdinals = (values: readonly { readonly kind: string }[], names: readonly string[]): Uint8Array => + Uint8Array.from(values, (value) => names.indexOf(value.kind)); + +/** Ordinal bytes → enum values; an ordinal with no variant is `UnknownVariant`. */ +export const enumValues = ( + bytes: Uint8Array, + names: readonly K[] +): Result<{ kind: K }[], TdbinError> => { + const values: { kind: K }[] = []; + for (const ordinal of bytes) { + const kind = names[ordinal]; + if (kind === undefined) { + return tdbinErr("UnknownVariant", { ordinal: BigInt(ordinal) }); + } + values.push({ kind }); + } + return ok(values); +}; diff --git a/packages/typediagram/src/tdbin/pack.ts b/src/typediagram/src/tdbin/pack.ts similarity index 100% rename from packages/typediagram/src/tdbin/pack.ts rename to src/typediagram/src/tdbin/pack.ts diff --git a/packages/typediagram/src/tdbin/pointer.ts b/src/typediagram/src/tdbin/pointer.ts similarity index 100% rename from packages/typediagram/src/tdbin/pointer.ts rename to src/typediagram/src/tdbin/pointer.ts diff --git a/packages/typediagram/src/tdbin/reader.ts b/src/typediagram/src/tdbin/reader.ts similarity index 97% rename from packages/typediagram/src/tdbin/reader.ts rename to src/typediagram/src/tdbin/reader.ts index 703c60f..07556fa 100644 --- a/packages/typediagram/src/tdbin/reader.ts +++ b/src/typediagram/src/tdbin/reader.ts @@ -72,6 +72,18 @@ export const bytes = ( export const byteList = bytes; +/** [TDBIN-WIDTH-LIST] Raw list body bytes for element code `elem` of `width` + * bytes per element (bounds and budget already enforced by verification). */ +export const rawList = ( + reader: Reader, + at: number, + _dataWords: number, + slot: number, + elem: number, + width: number +): Result => + readList(reader, at, slot, elem, (r, ptrWord, offset, count) => readListBytes(r, ptrWord, offset, count * width)); + export const boolList = ( reader: Reader, at: number, diff --git a/packages/typediagram/src/tdbin/types.ts b/src/typediagram/src/tdbin/types.ts similarity index 88% rename from packages/typediagram/src/tdbin/types.ts rename to src/typediagram/src/tdbin/types.ts index e7c1eb2..b8732cf 100644 --- a/packages/typediagram/src/tdbin/types.ts +++ b/src/typediagram/src/tdbin/types.ts @@ -7,6 +7,8 @@ export type TdbinErrorCode = | "ReservedBits" | "LengthMismatch" | "HashMismatch" + | "BadBase64" + | "ValueOutOfRange" | "PackedTruncated" | "PointerOutOfBounds" | "ReservedPointerKind" @@ -32,6 +34,9 @@ export interface TdbinError { } export interface StructCodec { + /** Compatibility-major layout hash pinned by the generator ([TDBIN-SCHEMA-HASH]); + * framed encodes advertise it and framed decodes require it. */ + readonly layoutHash?: bigint; readonly dataWords: number; readonly ptrWords: number; readonly write: (writer: Writer, at: number, value: T) => Result; diff --git a/packages/typediagram/src/tdbin/verify.ts b/src/typediagram/src/tdbin/verify.ts similarity index 100% rename from packages/typediagram/src/tdbin/verify.ts rename to src/typediagram/src/tdbin/verify.ts diff --git a/src/typediagram/src/tdbin/width.ts b/src/typediagram/src/tdbin/width.ts new file mode 100644 index 0000000..6046380 --- /dev/null +++ b/src/typediagram/src/tdbin/width.ts @@ -0,0 +1,141 @@ +// [TDBIN-WIDTH-RANGE] [TDBIN-WIDTH-LIST] Width-refined integers for generated +// TypeScript codecs, byte-identical to the Rust runtime: one data word per +// scalar (signed = i64 bit pattern, unsigned = raw value), and lists in the +// reserved 1/2/4/8-byte element widths. JavaScript numbers are unbounded, so +// encode AND decode range-check; out of range is `ValueOutOfRange`, never a +// truncation. `U64` is a lossless `bigint`; `Size` is limited to safe integers. +import { ok, type Result } from "../result.js"; +import { tdbinErr } from "./error.js"; +import * as reader from "./reader.js"; +import type { Reader, TdbinError, Writer } from "./types.js"; +import * as writer from "./writer.js"; + +export type NumberWidth = "i32" | "u8" | "u16" | "u32" | "size"; + +interface Spec { + readonly min: bigint; + readonly max: bigint; + readonly signed: boolean; + readonly elem: number; + readonly bytes: number; +} + +const SPECS: Record = { + i32: { min: -(2n ** 31n), max: 2n ** 31n - 1n, signed: true, elem: 4, bytes: 4 }, + u8: { min: 0n, max: 255n, signed: false, elem: 2, bytes: 1 }, + u16: { min: 0n, max: 65535n, signed: false, elem: 3, bytes: 2 }, + u32: { min: 0n, max: 2n ** 32n - 1n, signed: false, elem: 4, bytes: 4 }, + size: { min: 0n, max: BigInt(Number.MAX_SAFE_INTEGER), signed: false, elem: 5, bytes: 8 }, + u64: { min: 0n, max: 2n ** 64n - 1n, signed: false, elem: 5, bytes: 8 }, +}; + +const checked = (spec: Spec, value: number | bigint): Result => + (typeof value === "bigint" || Number.isInteger(value)) && BigInt(value) >= spec.min && BigInt(value) <= spec.max + ? ok(BigInt(value)) + : tdbinErr("ValueOutOfRange"); + +const wordOf = (spec: Spec, value: bigint): bigint => BigInt.asUintN(64, value); + +const valueOf = (spec: Spec, word: bigint): Result => + checked(spec, spec.signed ? BigInt.asIntN(64, word) : word); + +/** Write one width scalar into data word `slot`. */ +export const writeScalar = ( + w: Writer, + at: number, + slot: number, + kind: NumberWidth | "u64", + value: number | bigint +): Result => { + const spec = SPECS[kind]; + const v = checked(spec, value); + return v.ok ? writer.scalar(w, at, slot, wordOf(spec, v.value)) : v; +}; + +/** Read one `number` width scalar from data word `slot`. */ +export const readNumber = (r: Reader, at: number, slot: number, kind: NumberWidth): Result => { + const word = reader.scalar(r, at, slot); + const v = word.ok ? valueOf(SPECS[kind], word.value) : word; + return v.ok ? ok(Number(v.value)) : v; +}; + +/** Read one `U64` scalar (lossless bigint). */ +export const readU64 = (r: Reader, at: number, slot: number): Result => reader.scalar(r, at, slot); + +const encodeList = (spec: Spec, values: readonly (number | bigint)[]): Result => { + const out = new Uint8Array(values.length * spec.bytes); + const view = new DataView(out.buffer); + for (const [index, value] of values.entries()) { + const v = checked(spec, value); + if (!v.ok) { + return v; + } + const word = wordOf(spec, v.value); + for (let byte = 0; byte < spec.bytes; byte += 1) { + view.setUint8(index * spec.bytes + byte, Number((word >> BigInt(byte * 8)) & 0xffn)); + } + } + return ok(out); +}; + +const decodeList = (spec: Spec, data: Uint8Array): Result => { + const values: bigint[] = []; + for (let offset = 0; offset < data.length; offset += spec.bytes) { + let raw = 0n; + for (let byte = spec.bytes - 1; byte >= 0; byte -= 1) { + raw = (raw << 8n) | BigInt(data[offset + byte] ?? 0); + } + const v = valueOf(spec, spec.signed ? BigInt.asIntN(spec.bytes * 8, raw) : raw); + if (!v.ok) { + return v; + } + values.push(v.value); + } + return ok(values); +}; + +/** Write a width list (or null) into pointer `slot`. */ +export const writeList = ( + w: Writer, + at: number, + dataWords: number, + slot: number, + kind: NumberWidth | "u64", + values: readonly (number | bigint)[] | null +): Result => { + const spec = SPECS[kind]; + const data = values === null ? ok(null) : encodeList(spec, values); + return data.ok ? writer.rawList(w, at, dataWords, slot, spec.elem, values?.length ?? 0, data.value) : data; +}; + +const readRaw = ( + r: Reader, + at: number, + dataWords: number, + slot: number, + kind: NumberWidth | "u64" +): Result => { + const spec = SPECS[kind]; + const raw = reader.rawList(r, at, dataWords, slot, spec.elem, spec.bytes); + return !raw.ok ? raw : raw.value === null ? ok(null) : decodeList(spec, raw.value); +}; + +/** Read a `number` width list from pointer `slot` (null when absent). */ +export const readNumberList = ( + r: Reader, + at: number, + dataWords: number, + slot: number, + kind: NumberWidth +): Result => { + const values = readRaw(r, at, dataWords, slot, kind); + return values.ok ? ok(values.value?.map(Number) ?? null) : values; +}; + +/** Read a `List` from pointer `slot` (null when absent). */ +export const readU64List = ( + r: Reader, + at: number, + dataWords: number, + slot: number +): Result => readRaw(r, at, dataWords, slot, "u64"); diff --git a/packages/typediagram/src/tdbin/word.ts b/src/typediagram/src/tdbin/word.ts similarity index 89% rename from packages/typediagram/src/tdbin/word.ts rename to src/typediagram/src/tdbin/word.ts index ac67bdc..8505242 100644 --- a/packages/typediagram/src/tdbin/word.ts +++ b/src/typediagram/src/tdbin/word.ts @@ -6,8 +6,8 @@ export const WORD_BYTES = 8; export const WORD_BITS = WORD_BYTES * 8; const SCRATCH = new ArrayBuffer(WORD_BYTES); const SCRATCH_VIEW = new DataView(SCRATCH); -const MAX_SAFE_I64 = 9_007_199_254_740_991; -const MIN_SAFE_I64 = -MAX_SAFE_I64; +const MIN_I64 = -(1n << 63n); +const MAX_I64 = (1n << 63n) - 1n; export const readWord = (bytes: Uint8Array, view: DataView, idx: number): Result => { const start = idx * WORD_BYTES; @@ -33,8 +33,9 @@ export const wordsToBytes = (words: readonly bigint[]): Uint8Array => { return out; }; -export const i64Bits = (value: number): Result => - Number.isSafeInteger(value) && value >= MIN_SAFE_I64 && value <= MAX_SAFE_I64 +// [CONV-TS-EXACT-INTEGERS] Reject overflow before converting to wire bits. +export const i64Bits = (value: number | bigint): Result => + (typeof value === "bigint" || Number.isSafeInteger(value)) && value >= MIN_I64 && value <= MAX_I64 ? ok(BigInt.asUintN(64, BigInt(value))) : tdbinErr("LimitExceeded"); diff --git a/packages/typediagram/src/tdbin/writer.ts b/src/typediagram/src/tdbin/writer.ts similarity index 94% rename from packages/typediagram/src/tdbin/writer.ts rename to src/typediagram/src/tdbin/writer.ts index 68df256..9136186 100644 --- a/packages/typediagram/src/tdbin/writer.ts +++ b/src/typediagram/src/tdbin/writer.ts @@ -79,6 +79,26 @@ export const boolList = ( export const byteList = bytes; +/** [TDBIN-WIDTH-LIST] Raw little-endian list body of `count` elements with + * element code `elem` (2/3/4/5 = 1/2/4/8 bytes each). */ +export const rawList = ( + writer: Writer, + at: number, + dataWords: number, + slot: number, + elem: number, + count: number, + data: Uint8Array | null +): Result => { + const ptrWord = ptrIndex(at, dataWords, slot); + if (data === null) { + return setWord(writer, ptrWord, 0n); + } + const start = reserve(writer, Math.ceil(data.length / WORD_BYTES)); + const packed = start.ok ? packBytes(writer, start.value, data) : start; + return start.ok && packed.ok ? setListPtr(writer, ptrWord, start.value, elem, count) : packed; +}; + export const wordList = ( writer: Writer, at: number, diff --git a/packages/typediagram/src/variant.ts b/src/typediagram/src/variant.ts similarity index 100% rename from packages/typediagram/src/variant.ts rename to src/typediagram/src/variant.ts diff --git a/packages/typediagram/test/__snapshots__/render.test.ts.snap b/src/typediagram/test/__snapshots__/render.test.ts.snap similarity index 100% rename from packages/typediagram/test/__snapshots__/render.test.ts.snap rename to src/typediagram/test/__snapshots__/render.test.ts.snap diff --git a/src/typediagram/test/adt-completeness.test.ts b/src/typediagram/test/adt-completeness.test.ts new file mode 100644 index 0000000..b98632c --- /dev/null +++ b/src/typediagram/test/adt-completeness.test.ts @@ -0,0 +1,169 @@ +// [TD-ADT-COMPLETENESS] Runs the real checker over the encoding proved in +// docs/research/proofs/AdtCompleteness.lean: random ADT signatures are printed as +// typeDiagram, parsed, resolved for code generation and decoded back exactly. +import { describe, expect, it } from "vitest"; +import { parse } from "../src/parser/index.js"; +import type { Diagram, TypeRef } from "../src/parser/index.js"; +import { buildModel, validateForCodegen } from "../src/model/index.js"; +import { unwrap } from "./helpers.js"; + +type Ty = { var: string; args: Ty[] } | { con: string; args: Ty[] }; +interface Data { + name: string; + params: string[]; + ctors: { name: string; args: Ty[] }[]; +} + +const CASES = 400; + +const rng = (seed: number) => () => { + seed = (seed * 1103515245 + 12345) % 2 ** 31; + return seed / 2 ** 31; +}; + +// Well-kinded generation: constructors get their declared arity; parameter +// parameters `a0`, `a1` have kind * and `f` has kind * -> *. +type Kinds = Map; +const BUILTINS: Kinds = new Map([ + ["Int", 0], + ["String", 0], + ["Bool", 0], + ["List", 1], + ["Option", 1], + ["Map", 2], +]); +const pick = (r: () => number, xs: T[]): T => xs[Math.floor(r() * xs.length)] as T; + +function genTy(r: () => number, ps: string[], cs: Kinds, depth: number): Ty { + const kind = (p: string): number => (p === "f" ? 1 : 0); + const vars = ps.filter((p) => depth > 0 || kind(p) === 0); + const cons = [...cs].filter(([, k]) => depth > 0 || k === 0); + const useVar = vars.length > 0 && r() < 0.4; + const [head, arity] = useVar ? ((v: string): [string, number] => [v, kind(v)])(pick(r, vars)) : pick(r, cons); + const args = Array.from({ length: arity }, () => genTy(r, ps, cs, depth - 1)); + return useVar ? { var: head, args } : { con: head, args }; +} + +function genSig(r: () => number, n: number): Data[] { + const heads = Array.from({ length: 1 + Math.floor(r() * 4) }, (_, i) => ({ + name: `T${String(n)}x${String(i)}`, + params: Array.from({ length: Math.floor(r() * 4) }, (_p, j) => ["a0", "a1", "f"][j] ?? ""), + })); + const cs: Kinds = new Map([...BUILTINS, ...heads.map((h): [string, number] => [h.name, h.params.length])]); + return heads.map(({ name, params }, i) => ({ + name, + params, + ctors: Array.from({ length: Math.floor(r() * 5) }, (_, k) => ({ + name: `C${String(i)}y${String(k)}`, + args: Array.from({ length: Math.floor(r() * 4) }, () => genTy(r, params, cs, 3)), + })), + })); +} + +const printTy = (t: Ty): string => { + const head = "var" in t ? t.var : t.con; + return t.args.length === 0 ? head : `${head}<${t.args.map(printTy).join(", ")}>`; +}; + +// Three concrete syntaxes for one variant; the proof says all mean posFields. +function printCtor(c: Data["ctors"][number], style: number): string { + if (c.args.length === 0) { + return c.name; + } + return style % 2 === 0 + ? `${c.name}(${c.args.map(printTy).join(", ")})` + : `${c.name} { ${c.args.map((t, i) => `_${String(i)}: ${printTy(t)}`).join(", ")} }`; +} + +const encode = (s: Data[]): string => + s + .map((d, i) => { + const gs = d.params.length === 0 ? "" : `<${d.params.join(", ")}>`; + return `union ${d.name}${gs} {\n${d.ctors.map((c, k) => ` ${printCtor(c, i + k)}`).join("\n")}\n}`; + }) + .join("\n"); + +const decTy = (ps: string[], t: TypeRef): Ty => { + const args = t.args.map((a) => decTy(ps, a)); + return ps.includes(t.name) ? { var: t.name, args } : { con: t.name, args }; +}; + +const decode = (g: Diagram): Data[] => + g.decls.map((d) => { + if (d.kind !== "union") { + throw new Error(`unexpected ${d.kind}`); + } + return { + name: d.name, + params: [...d.generics], + ctors: d.variants.map((v) => ({ name: v.name, args: v.fields.map((f) => decTy(d.generics, f.type)) })), + }; + }); + +function check(sig: Data[]): void { + const ast = unwrap(parse(encode(sig))); + expect(decode(ast)).toEqual(sig); + const model = unwrap(buildModel(ast)); + expect(validateForCodegen(model, "rust")).toEqual([]); + expect(validateForCodegen(model, "typescript")).toEqual([]); +} + +const A: Ty = { var: "A", args: [] }; +const con = (c: string, ...args: Ty[]): Ty => ({ con: c, args }); + +describe("[TD-ADT-COMPLETENESS] every ADT signature round-trips through the checker", () => { + it("encodes each ADT former: empty, unit, sum, product, recursion, nesting, higher kinds", () => { + check([{ name: "Void", params: [], ctors: [] }]); + check([{ name: "One", params: [], ctors: [{ name: "MkOne", args: [] }] }]); + check([ + { name: "Pair", params: ["A"], ctors: [{ name: "MkPair", args: [A, A] }] }, + { + name: "Nest", + params: ["A"], + ctors: [ + { name: "Nil", args: [] }, + { name: "Cons", args: [A, con("Nest", con("Pair", A))] }, + ], + }, + ]); + check([ + { name: "Tree", params: ["A"], ctors: [{ name: "Node", args: [A, con("Forest", A)] }] }, + { + name: "Forest", + params: ["A"], + ctors: [ + { name: "Leaf", args: [] }, + { name: "More", args: [con("Tree", A), con("Forest", A)] }, + ], + }, + ]); + check([ + { + name: "Fix", + params: ["F"], + ctors: [{ name: "In", args: [{ var: "F", args: [con("Fix", { var: "F", args: [] })] }] }], + }, + ]); + check([ + { + name: "Phantom", + params: ["A", "B"], + ctors: [{ name: "P", args: [con("Map", con("String"), con("List", A))] }], + }, + ]); + }); + + it(`round-trips ${String(CASES)} random signatures through parse, resolve and decode`, () => { + const r = rng(20261115); + for (let n = 0; n < CASES; n++) { + check(genSig(r, n)); + } + }); + + it("is not vacuous: an undeclared constructor fails code-generation resolution", () => { + const model = unwrap(buildModel(unwrap(parse("union Bad { MkBad(Missing) }")))); + expect(validateForCodegen(model, "rust").length).toBeGreaterThan(0); + const ast = unwrap(parse("union X { A(Int) }")); + expect(decode(ast)).not.toEqual([{ name: "X", params: [], ctors: [{ name: "A", args: [con("String")] }] }]); + }); +}); diff --git a/packages/typediagram/test/converters/brace-lang.test.ts b/src/typediagram/test/converters/brace-lang.test.ts similarity index 100% rename from packages/typediagram/test/converters/brace-lang.test.ts rename to src/typediagram/test/converters/brace-lang.test.ts diff --git a/packages/typediagram/test/converters/csharp.test.ts b/src/typediagram/test/converters/csharp.test.ts similarity index 91% rename from packages/typediagram/test/converters/csharp.test.ts rename to src/typediagram/test/converters/csharp.test.ts index 974e975..5087ef4 100644 --- a/packages/typediagram/test/converters/csharp.test.ts +++ b/src/typediagram/test/converters/csharp.test.ts @@ -382,3 +382,23 @@ describe("[CONV-CS-RT] C# round-trip TD -> C# -> TD", () => { expectLosslessRoundTrip(csharp); }); }); + +// [CONV-CS-INTEGER-WIDTH] Native identities must retain all signed 64 bits. +describe("native C# model emission", () => { + it("emits 64-bit nested integers and puts late aliases before declarations", () => { + const td = `type Owner { serial: Int counts: List previous: Option } + alias AllocationId = Int + alias App = Uuid + union Delivery { Empty {} Accepted { identity: AllocationId sequence: Int } }`; + const source = toSourceFromTd(csharp, td, { integerWidth: 64 }); + expect(source).toContain("using App = System.Guid;"); + expect(source).toContain("long serial"); + expect(source).toContain("List counts"); + expect(source).toContain("long? previous"); + expect(source).toContain("using AllocationId = long;"); + expect(source).toContain("Accepted(AllocationId identity, long sequence)"); + expect(source.indexOf("using AllocationId")).toBeLessThan(source.indexOf("public sealed record Owner")); + expect(recordFields(modelFromSource(csharp, source), "Owner")[0]?.type.name).toBe("Int"); + expect(toSourceFromTd(csharp, td)).toContain("int serial"); + }); +}); diff --git a/packages/typediagram/test/converters/dart.test.ts b/src/typediagram/test/converters/dart.test.ts similarity index 78% rename from packages/typediagram/test/converters/dart.test.ts rename to src/typediagram/test/converters/dart.test.ts index 2ef3d4d..693f5ab 100644 --- a/packages/typediagram/test/converters/dart.test.ts +++ b/src/typediagram/test/converters/dart.test.ts @@ -1,6 +1,8 @@ // [CONV-DART-TEST] Dart converter integration tests. import { describe, expect, it } from "vitest"; import { dart } from "../../src/converters/index.js"; +import { printTypeRef } from "../../src/converters/parse-typeref.js"; +import { printSource } from "../../src/model/index.js"; import { aliasTargetName, expectFieldTypes, @@ -10,6 +12,7 @@ import { recordFields, toSourceFromTd, unionVariants, + unwrap, } from "./helpers.js"; describe("[CONV-DART-FROM] Dart -> typeDiagram", () => { @@ -185,3 +188,30 @@ final class Circle implements Shape { expect(variants[0]?.name).toBe("Circle"); }); }); + +describe("[CONV-DART-RECORD] Dart record typedefs -> typeDiagram (#77)", () => { + it("maps named records to records and rejects function types and positional records with every diagnostic", () => { + const model = unwrap( + dart.fromSource(`typedef SessionData = ({String draft, String phase}); +typedef WorkspaceState = ({Map sessions, Set contextFiles, int? retries}); +typedef Pair = ({T first, List rest}); +typedef Email = String;`) + ); + expect(recordFields(model, "SessionData").map((f) => f.name)).toEqual(["draft", "phase"]); + expect(recordFields(model, "WorkspaceState").map((f) => printTypeRef(f.type))).toEqual([ + "Map", + "List", + "Option", + ]); + expect(recordFields(model, "Pair").map((f) => printTypeRef(f.type))).toEqual(["T", "List"]); + expect(printSource(model)).toContain("alias Email = String"); + const bad = dart.fromSource(`typedef Actions = ({void Function(String) editDraft, int count}); +typedef Point = (int, int); +typedef Callback = void Function();`); + expect(bad.ok ? [] : bad.error.map((d) => d.message)).toEqual([ + "Dart function type 'void Function(String)' in Actions.editDraft has no typeDiagram equivalent", + "Dart record 'Point' has positional fields; only named record fields map to typeDiagram", + "Dart function type 'void Function()' in Callback.target has no typeDiagram equivalent", + ]); + }); +}); diff --git a/packages/typediagram/test/converters/fixtures/batches.td b/src/typediagram/test/converters/fixtures/batches.td similarity index 100% rename from packages/typediagram/test/converters/fixtures/batches.td rename to src/typediagram/test/converters/fixtures/batches.td diff --git a/packages/typediagram/test/converters/fixtures/measurement.td b/src/typediagram/test/converters/fixtures/measurement.td similarity index 100% rename from packages/typediagram/test/converters/fixtures/measurement.td rename to src/typediagram/test/converters/fixtures/measurement.td diff --git a/src/typediagram/test/converters/fixtures/names.td b/src/typediagram/test/converters/fixtures/names.td new file mode 100644 index 0000000..f239942 --- /dev/null +++ b/src/typediagram/test/converters/fixtures/names.td @@ -0,0 +1,39 @@ +# [TDBIN-CODEGEN-LOCALS] Field and variant names that collide with the +# generated codecs' own identifiers: Rust `w`/`r`/`at`/`count`/`items`/`rows`/ +# `i`/`tags`, TypeScript `value`/`writer`/`reader`/`tdbin`/`ok`, and helper +# suffixes (`x` next to `xPresent`). Codegen must never let them shadow. +type Inner { + at: Int + r: String +} + +union Pick { + W(Inner) + Items(Inner) + Tags + Count(Inner) +} + +type Names { + value: String + writer: Int + reader: Int + tdbin: Int + ok: Bool + w: Int + at: Int + r: Int + count: Int + i: Bool + items: Option + rows: List + tags: List + x: Option + xPresent: Option + pick: Pick +} + +type NamesBatch { + names: List + picks: List +} diff --git a/packages/typediagram/test/converters/fixtures/person.td b/src/typediagram/test/converters/fixtures/person.td similarity index 100% rename from packages/typediagram/test/converters/fixtures/person.td rename to src/typediagram/test/converters/fixtures/person.td diff --git a/src/typediagram/test/converters/fixtures/reports.td b/src/typediagram/test/converters/fixtures/reports.td new file mode 100644 index 0000000..d3877d3 --- /dev/null +++ b/src/typediagram/test/converters/fixtures/reports.td @@ -0,0 +1,21 @@ +union Level { + Low + High +} +type Tag { + key: String + weight: Float +} +type Report { + flags: List + counts: List + ratios: List + names: List + blobs: List + tags: List + levels: List + maybeCounts: Option> + maybeTags: Option> + maybeLevels: Option> + title: String +} diff --git a/src/typediagram/test/converters/fixtures/shapes.td b/src/typediagram/test/converters/fixtures/shapes.td new file mode 100644 index 0000000..92553f5 --- /dev/null +++ b/src/typediagram/test/converters/fixtures/shapes.td @@ -0,0 +1,23 @@ +type Point { + x: Float + y: Float +} +union Shape { + Circle { + radius: Float + label: String + } + Rect { + w: Float + h: Float + corner: Point + } + Pair(Int, String) + Tagged(Point) + Empty +} +type Canvas { + name: String + shape: Shape + backup: Option +} diff --git a/src/typediagram/test/converters/fixtures/widths.td b/src/typediagram/test/converters/fixtures/widths.td new file mode 100644 index 0000000..cc585aa --- /dev/null +++ b/src/typediagram/test/converters/fixtures/widths.td @@ -0,0 +1,29 @@ +type Stats { + delta: I32 + flags: U8 + port: U16 + hits: U32 + hash: U64 + count: Size + file: Path + maybeHash: Option + maybePort: Option + maybeFile: Option + deltas: List + bytes: List + ports: List + hitsList: List + hashes: List + sizes: List + files: List + maybeSizes: Option> + maybeFiles: Option> +} +type StatsRaw { + delta: Int + flags: U64 + port: U64 + hits: U64 + hash: U64 + count: U64 +} diff --git a/packages/typediagram/test/converters/fsharp.test.ts b/src/typediagram/test/converters/fsharp.test.ts similarity index 100% rename from packages/typediagram/test/converters/fsharp.test.ts rename to src/typediagram/test/converters/fsharp.test.ts diff --git a/packages/typediagram/test/converters/go.test.ts b/src/typediagram/test/converters/go.test.ts similarity index 100% rename from packages/typediagram/test/converters/go.test.ts rename to src/typediagram/test/converters/go.test.ts diff --git a/packages/typediagram/test/converters/helpers.ts b/src/typediagram/test/converters/helpers.ts similarity index 80% rename from packages/typediagram/test/converters/helpers.ts rename to src/typediagram/test/converters/helpers.ts index feadf86..b5e4f09 100644 --- a/packages/typediagram/test/converters/helpers.ts +++ b/src/typediagram/test/converters/helpers.ts @@ -1,5 +1,7 @@ // [CONV-TEST-HELPERS] Shared test utilities for converter tests. import { readFileSync } from "node:fs"; +import { runInNewContext } from "node:vm"; +import * as ts from "typescript-compiler"; import { fileURLToPath } from "node:url"; import { expect } from "vitest"; import { generateRustModule, type RustCodecOptions } from "../../src/converters/rust-tdbin.js"; @@ -9,6 +11,8 @@ import { buildModel, printSource } from "../../src/model/index.js"; import type { CSharpOpts, PythonOpts } from "../../src/converters/types.js"; import type { Model, ResolvedField, ResolvedVariant } from "../../src/model/types.js"; import { parse } from "../../src/parser/index.js"; +import { ok } from "../../src/result.js"; +import * as tdbin from "../../src/tdbin/index.js"; import { HOME_PAGE_SAMPLE } from "../../src/sample.js"; // Re-export the canonical Result-unwrap and TD->Model helpers from the shared // root test helpers so there is a single implementation. @@ -110,3 +114,24 @@ export function expectLosslessRoundTrip(converter: Converter, source: string = H expect(roundTripTd).toBe(source); } + +// Executes generated codec source for behavior tests: the emitted TypeScript is +// transpiled with the real compiler (never regex on code) and evaluated against +// the real runtime, exactly as a consumer module would run it. The host-realm +// Uint8Array is injected so generated defaults share the test realm. +export const instantiateCodecs = (source: string): Record => { + const js = ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 }, + }).outputText; + const moduleExports: Record = {}; + runInNewContext(js, { exports: moduleExports, tdbin, ok, Uint8Array }); + return moduleExports; +}; + +export const codecFor = (source: string, name: string): tdbin.StructCodec => { + const generated = instantiateCodecs(source)[name]; + expect(generated).toBeDefined(); + // Safe: the generator declares every exported `${Type}Codec` as + // tdbin.StructCodec, pinned by the text assertions in this file. + return generated as tdbin.StructCodec; +}; diff --git a/src/typediagram/test/converters/osprey.test.ts b/src/typediagram/test/converters/osprey.test.ts new file mode 100644 index 0000000..05602f3 --- /dev/null +++ b/src/typediagram/test/converters/osprey.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from "vitest"; +import { generateOspreyModule } from "../../src/converters/osprey.js"; +import { modelFromTd, unwrap } from "./helpers.js"; + +// [CONV-OSPREY] Generate app-side models from the same bridge schema. +describe("Osprey model generation", () => { + it("emits aliases, generic records, union fields and nested optional lists", () => { + expect(generateOspreyModule).toBeTypeOf("function"); + const source = unwrap( + generateOspreyModule( + modelFromTd(` + alias Id = Int + type Box { value: T } + type Node { id: Id title: String selected: Bool children: List parent: Option weight: Float } + union Event { Idle {} Selected { id: Id } Batch { nodes: List } } + `) + ) + ); + expect(source).toContain("type Id = int"); + expect(source).toContain("type Box T =\n value : T"); + expect(source).toContain("children : List"); + expect(source).toContain("parent : Option"); + expect(source).toContain("selected : bool"); + expect(source).toContain("weight : float"); + expect(source).toContain( + "type Event =\n Idle\n Selected\n id : Id\n Batch\n nodes : List" + ); + for (const schema of [ + "union First { Same {} } union Second { Same {} }", + "union Role { List {} }", + "type Name { value: Int } union Tag { Name {} }", + ]) { + expect(generateOspreyModule(modelFromTd(schema))).toMatchObject({ ok: false }); + } + for (const field of ["instance", "state", "do"]) { + expect(generateOspreyModule(modelFromTd(`type Bad { ${field}: Int }`))).toMatchObject({ ok: false }); + } + for (const primitive of ["Bytes", "DateTime", "Decimal"]) { + expect(generateOspreyModule(modelFromTd(`type Unsupported { value: ${primitive} }`))).toMatchObject({ + ok: false, + }); + } + }); +}); diff --git a/packages/typediagram/test/converters/php.test.ts b/src/typediagram/test/converters/php.test.ts similarity index 100% rename from packages/typediagram/test/converters/php.test.ts rename to src/typediagram/test/converters/php.test.ts diff --git a/packages/typediagram/test/converters/protobuf.test.ts b/src/typediagram/test/converters/protobuf.test.ts similarity index 100% rename from packages/typediagram/test/converters/protobuf.test.ts rename to src/typediagram/test/converters/protobuf.test.ts diff --git a/packages/typediagram/test/converters/python.test.ts b/src/typediagram/test/converters/python.test.ts similarity index 100% rename from packages/typediagram/test/converters/python.test.ts rename to src/typediagram/test/converters/python.test.ts diff --git a/packages/typediagram/test/converters/rust-tdbin-corpus.test.ts b/src/typediagram/test/converters/rust-tdbin-corpus.test.ts similarity index 63% rename from packages/typediagram/test/converters/rust-tdbin-corpus.test.ts rename to src/typediagram/test/converters/rust-tdbin-corpus.test.ts index 6728eb0..17bac02 100644 --- a/packages/typediagram/test/converters/rust-tdbin-corpus.test.ts +++ b/src/typediagram/test/converters/rust-tdbin-corpus.test.ts @@ -9,21 +9,21 @@ import { fileURLToPath } from "node:url"; import { describe, it } from "vitest"; import { expectRustModuleReproduces } from "./helpers.js"; -// The EXACT schema committed to crates/tdbin/tests/generated_batches/mod.rs; -// scripts/tdbin-regen-fixtures.mjs reads this SAME file, so drift guard and +// The EXACT schema committed to src/tdbin/tests/generated_batches/mod.rs; +// src/scripts/tdbin/tdbin-regen-fixtures.mjs reads this SAME file, so drift guard and // regeneration can never disagree about the source of truth. const BATCHES_TD = readFileSync(fileURLToPath(new URL("fixtures/batches.td", import.meta.url)), "utf8"); describe("[CONV-RUST-TDBIN] layout-2 corpus drift guards vs the committed crate modules", () => { - it("reproduces generated_corpus/mod.rs from docs/benchmarks/tdbin-corpus.td", () => { + it("reproduces generated_corpus/mod.rs from docs/research/benchmarks/tdbin-corpus.td", () => { const corpusTd = readFileSync( - fileURLToPath(new URL("../../../../docs/benchmarks/tdbin-corpus.td", import.meta.url)), + fileURLToPath(new URL("../../../../docs/research/benchmarks/tdbin-corpus.td", import.meta.url)), "utf8" ); - expectRustModuleReproduces(corpusTd, "../../../../crates/tdbin/tests/generated_corpus/mod.rs", { layout: 2 }); + expectRustModuleReproduces(corpusTd, "../../../../src/tdbin/tests/generated_corpus/mod.rs", { layout: 2 }); }); it("reproduces generated_batches/mod.rs from the inline PersonBatch/ContactBatch schema", () => { - expectRustModuleReproduces(BATCHES_TD, "../../../../crates/tdbin/tests/generated_batches/mod.rs", { layout: 2 }); + expectRustModuleReproduces(BATCHES_TD, "../../../../src/tdbin/tests/generated_batches/mod.rs", { layout: 2 }); }); }); diff --git a/packages/typediagram/test/converters/rust-tdbin.test.ts b/src/typediagram/test/converters/rust-tdbin.test.ts similarity index 73% rename from packages/typediagram/test/converters/rust-tdbin.test.ts rename to src/typediagram/test/converters/rust-tdbin.test.ts index 18e8c0c..11c446d 100644 --- a/packages/typediagram/test/converters/rust-tdbin.test.ts +++ b/src/typediagram/test/converters/rust-tdbin.test.ts @@ -2,7 +2,7 @@ // typeDiagram Model into `impl tdbin::Struct` blocks (the serialization half of // "typeDiagram ADT <-> binary"). These pin the emitted layout/structure, prove // every unsupported shape fails loudly, and drift-guard the committed crate -// fixture `crates/tdbin/tests/generated/mod.rs` against fresh codegen. +// fixture `src/tdbin/tests/generated/mod.rs` against fresh codegen. import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; @@ -19,12 +19,12 @@ const codecFor = (td: string): string => unwrap(emitRustCodec(modelFor(td))); const fixtureTd = (name: string): string => readFileSync(fileURLToPath(new URL(`fixtures/${name}`, import.meta.url)), "utf8"); -// The exact schema committed to crates/tdbin/tests/generated/mod.rs: the -// structural assertions, the drift guard, and scripts/tdbin-regen-fixtures.mjs +// The exact schema committed to src/tdbin/tests/generated/mod.rs: the +// structural assertions, the drift guard, and src/scripts/tdbin/tdbin-regen-fixtures.mjs // all read this ONE fixture file. const PERSON_TD = fixtureTd("person.td"); -// The Option fixture committed to crates/tdbin/tests/generated_opt/mod.rs. +// The Option fixture committed to src/tdbin/tests/generated_opt/mod.rs. const MEASUREMENT_TD = fixtureTd("measurement.td"); describe("[CONV-RUST-TDBIN] record + union codec structure", () => { @@ -42,8 +42,8 @@ describe("[CONV-RUST-TDBIN] record + union codec structure", () => { expect(code).toContain("w.scalar(at, 0, tdbin::scalar::i64_bits(self.age))?;"); expect(code).toContain("w.bool_bit(at, 1, 0, self.active)?;"); expect(code).toContain("w.scalar(at, 2, tdbin::scalar::f64_bits(self.score))?;"); - expect(code).toContain("let age = tdbin::scalar::i64_from(r.scalar(at, 0)?);"); - expect(code).toContain("let active = r.bool_bit(at, 1, 0)?;"); + expect(code).toContain("let f1 = tdbin::scalar::i64_from(r.scalar(at, 0)?);"); + expect(code).toContain("let f2 = r.bool_bit(at, 1, 0)?;"); }); it("distinguishes required vs optional pointer fields on read and write", () => { @@ -51,17 +51,17 @@ describe("[CONV-RUST-TDBIN] record + union codec structure", () => { // Required String: write Some(&..), read decodes null as the schema // default ([TDBIN-PTR-NULL], [TDBIN-REC-SHORT]). expect(code).toContain("w.string(at, Self::DATA_WORDS, 0, Some(&self.name))?;"); - expect(code).toContain("let name = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); + expect(code).toContain("let f0 = r.string(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); expect(code).not.toContain("UnexpectedNull"); // Optional String: write as_deref(), read keeps the Option. expect(code).toContain("w.string(at, Self::DATA_WORDS, 2, self.nickname.as_deref())?;"); - expect(code).toContain("let nickname = r.string(at, Self::DATA_WORDS, 2)?;"); + expect(code).toContain("let f5 = r.string(at, Self::DATA_WORDS, 2)?;"); // Optional child record: write as_ref(), read keeps the Option. expect(code).toContain("w.child(at, Self::DATA_WORDS, 1, self.address.as_ref())?;"); - expect(code).toContain("let address = r.child::
(at, Self::DATA_WORDS, 1)?;"); + expect(code).toContain("let f4 = r.child::
(at, Self::DATA_WORDS, 1)?;"); // Required child union: write Some(&..), read defaults null. expect(code).toContain("w.child(at, Self::DATA_WORDS, 3, Some(&self.contact))?;"); - expect(code).toContain("let contact = r.child::(at, Self::DATA_WORDS, 3)?.unwrap_or_default();"); + expect(code).toContain("let f6 = r.child::(at, Self::DATA_WORDS, 3)?.unwrap_or_default();"); }); it("emits union discriminant arms as Self:: with a slot-verified UnknownVariant fallback and a first-variant Default", () => { @@ -98,9 +98,9 @@ describe("[CONV-RUST-TDBIN] record + union codec structure", () => { it("routes Bytes and Option through the pointer section", () => { const code = codecFor(`type Blob {\n avatar: Bytes\n thumb: Option\n}`); expect(code).toContain("w.bytes(at, Self::DATA_WORDS, 0, Some(&self.avatar))?;"); - expect(code).toContain("let avatar = r.bytes(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); + expect(code).toContain("let f0 = r.bytes(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); expect(code).toContain("w.bytes(at, Self::DATA_WORDS, 1, self.thumb.as_deref())?;"); - expect(code).toContain("let thumb = r.bytes(at, Self::DATA_WORDS, 1)?;"); + expect(code).toContain("let f1 = r.bytes(at, Self::DATA_WORDS, 1)?;"); }); it("packs direct Bool fields into reusable bitset words", () => { @@ -112,7 +112,7 @@ describe("[CONV-RUST-TDBIN] record + union codec structure", () => { expect(code).toContain("w.scalar(at, 1, tdbin::scalar::i64_bits(self.count))?;"); expect(code).toContain("w.bool_bit(at, 0, 1, self.b)?;"); expect(code).toContain("w.bool_bit(at, 0, 2, self.c)?;"); - expect(code).toContain("let b = r.bool_bit(at, 0, 1)?;"); + expect(code).toContain("let f2 = r.bool_bit(at, 0, 1)?;"); }); it("emits string-payload, bare, and all-bare union arms", () => { @@ -136,7 +136,15 @@ describe("[CONV-RUST-TDBIN] record + union codec structure", () => { expect(code).toContain( "impl Default for Msg {\n fn default() -> Self {\n Self::Mail(E::default())\n }\n}" ); - expect(code).toContain("impl Default for Color {\n fn default() -> Self {\n Self::Red\n }\n}"); + // A bare first variant is derived (clippy `derivable_impls`), not hand-written. + expect(code).not.toContain("impl Default for Color"); + const module = unwrap( + generateRustModule(unwrap(buildModel(unwrap(parse(`union Color {\n Red\n Green\n}\ntype P {\n c: Color\n}`))))) + ); + expect(module).toContain( + "#[derive(Debug, Clone, PartialEq, Default)]\npub enum Color {\n /// The `Red` variant.\n #[default]\n Red," + ); + expect(module).not.toContain("impl Default for Color"); // A String-payload first variant defaults to the empty string. expect(code).toContain( "impl Default for Note {\n fn default() -> Self {\n Self::Text(String::default())\n }\n}" @@ -161,13 +169,13 @@ describe("[CONV-RUST-TDBIN] Option presence + value slots", () => { expect(code).toContain("w.bool_bit(at, 0, 3, self.ratio.is_some())?;"); expect(code).toContain("w.scalar(at, 2, self.ratio.map_or(0, tdbin::scalar::f64_bits))?;"); // Read: the presence bit gates then_some over the decoded value. - expect(code).toContain("let count_present = r.bool_bit(at, 0, 0)?;"); - expect(code).toContain("let count_value = tdbin::scalar::i64_from(r.scalar(at, 1)?);"); - expect(code).toContain("let count = count_present.then_some(count_value);"); - expect(code).toContain("let flagged_value = r.bool_bit(at, 0, 2)?;"); - expect(code).toContain("let flagged = flagged_present.then_some(flagged_value);"); - expect(code).toContain("let ratio_value = tdbin::scalar::f64_from(r.scalar(at, 2)?);"); - expect(code).toContain("let ratio = ratio_present.then_some(ratio_value);"); + expect(code).toContain("let f1_present = r.bool_bit(at, 0, 0)?;"); + expect(code).toContain("let f1_value = tdbin::scalar::i64_from(r.scalar(at, 1)?);"); + expect(code).toContain("let f1 = f1_present.then_some(f1_value);"); + expect(code).toContain("let f2_value = r.bool_bit(at, 0, 2)?;"); + expect(code).toContain("let f2 = f2_present.then_some(f2_value);"); + expect(code).toContain("let f3_value = tdbin::scalar::f64_from(r.scalar(at, 2)?);"); + expect(code).toContain("let f3 = f3_present.then_some(f3_value);"); expect(code).not.toContain("u64::from(self.count.is_some())"); }); }); @@ -183,12 +191,12 @@ describe("[CONV-RUST-TDBIN] semantic scalar byte layouts", () => { expect(code).toMatch( /impl tdbin::Struct for Audit \{\n[ ]{4}const DATA_WORDS: u16 = 10;\n[ ]{4}const PTR_WORDS: u16 = 0;/ ); - expect(code).toContain("tdbin::scalar::i64_bits(self.createdAt.timestamp_micros())"); - expect(code).toContain("w.bool_bit(at, 1, 0, self.expiresAt.is_some())?;"); + expect(code).toContain("tdbin::scalar::i64_bits(self.created_at.timestamp_micros())"); + expect(code).toContain("w.bool_bit(at, 1, 0, self.expires_at.is_some())?;"); expect(code).toContain( - "w.scalar(at, 2, self.expiresAt.as_ref().map_or(0, |value| tdbin::scalar::i64_bits(value.timestamp_micros())))?;" + "w.scalar(at, 2, self.expires_at.as_ref().map_or(0, |value| tdbin::scalar::i64_bits(value.timestamp_micros())))?;" ); - expect(code).toContain("let expiresAt_present = r.bool_bit(at, 1, 0)?;"); + expect(code).toContain("let f1_present = r.bool_bit(at, 1, 0)?;"); expect(code).toContain("let id_words = tdbin::scalar::bytes16_words(self.id.as_bytes());"); expect(code).toContain("w.scalar(at, 3, id_words.0)?;"); expect(code).toContain("let amount_words = tdbin::scalar::bytes16_words(&self.amount.serialize());"); @@ -199,7 +207,7 @@ describe("[CONV-RUST-TDBIN] semantic scalar byte layouts", () => { expect(code).toContain("w.bool_bit(at, 1, 1, parent_words.is_some())?;"); expect(code).toContain("w.scalar(at, 8, parent_lo)?;"); expect(code).toContain("w.scalar(at, 9, parent_hi)?;"); - expect(code).toContain("let parent_present = r.bool_bit(at, 1, 1)?;"); + expect(code).toContain("let f4_present = r.bool_bit(at, 1, 1)?;"); expect(code).toContain("chrono::DateTime::::from_timestamp_micros"); expect(code).toContain("uuid::Uuid::from_bytes(tdbin::scalar::bytes16_from_words"); expect(code).toContain("rust_decimal::Decimal::deserialize(tdbin::scalar::bytes16_from_words"); @@ -224,20 +232,21 @@ describe("[CONV-RUST-TDBIN] list codecs", () => { expect(code).toContain("w.bytes_list(at, Self::DATA_WORDS, 3, Some(&self.blobs))?;"); expect(code).toContain("w.child_list(at, Self::DATA_WORDS, 4, Some(&self.points))?;"); expect(code).toContain("w.bytes16_list(at, Self::DATA_WORDS, 5, Some(&ids_words))?;"); - expect(code).toContain("&Color::Red => 0u8,"); + expect(code).toContain(" Color::Red => 0u8,"); + expect(code).not.toContain("&Color::Red"); expect(code).toContain("w.byte_list(at, Self::DATA_WORDS, 6, Some(&colors_ordinals))?;"); - expect(code).toContain("w.i64_list(at, Self::DATA_WORDS, 7, self.maybeScores.as_deref())?;"); + expect(code).toContain("w.i64_list(at, Self::DATA_WORDS, 7, self.maybe_scores.as_deref())?;"); expect(code).not.toContain("maybeScores_words"); - expect(code).toContain("let flags = r.bool_list(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); - expect(code).toContain("let scores = r.i64_list(at, Self::DATA_WORDS, 1)?.unwrap_or_default();"); - expect(code).toContain("let ratios = r.f64_list(at, Self::DATA_WORDS, 8)?.unwrap_or_default();"); - expect(code).toContain("let tags = r.string_list(at, Self::DATA_WORDS, 2)?.unwrap_or_default();"); - expect(code).toContain("let blobs = r.bytes_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default();"); - expect(code).toContain("let points = r.child_list::(at, Self::DATA_WORDS, 4)?.unwrap_or_default();"); - expect(code).toContain("let ids = r.bytes16_list(at, Self::DATA_WORDS, 5)?.unwrap_or_default()"); + expect(code).toContain("let f0 = r.bool_list(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); + expect(code).toContain("let f1 = r.i64_list(at, Self::DATA_WORDS, 1)?.unwrap_or_default();"); + expect(code).toContain("let f8 = r.f64_list(at, Self::DATA_WORDS, 8)?.unwrap_or_default();"); + expect(code).toContain("let f2 = r.string_list(at, Self::DATA_WORDS, 2)?.unwrap_or_default();"); + expect(code).toContain("let f3 = r.bytes_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default();"); + expect(code).toContain("let f4 = r.child_list::(at, Self::DATA_WORDS, 4)?.unwrap_or_default();"); + expect(code).toContain("let f5 = r.bytes16_list(at, Self::DATA_WORDS, 5)?.unwrap_or_default()"); expect(code).toContain("0 => Ok(Color::Red),"); expect(code).toContain("ordinal => Err(tdbin::DecodeError::UnknownVariant { ordinal: u64::from(ordinal) })"); - expect(code).toContain("let maybeScores = r.i64_list(at, Self::DATA_WORDS, 7)?;"); + expect(code).toContain("let f7 = r.i64_list(at, Self::DATA_WORDS, 7)?;"); }); it("emits optional DateTime, bytes16, and enum list branches", () => { @@ -254,10 +263,10 @@ describe("[CONV-RUST-TDBIN] list codecs", () => { expect(code).toContain("w.bytes16_list(at, Self::DATA_WORDS, 1, ids_words.as_deref())?;"); expect(code).toContain("let colors_ordinals = self.colors.as_ref().map(|values| values.iter().map"); expect(code).toContain("w.byte_list(at, Self::DATA_WORDS, 2, colors_ordinals.as_deref())?;"); - expect(code).toContain("let history = match r.word_list(at, Self::DATA_WORDS, 0)? {"); + expect(code).toContain("let f0 = match r.word_list(at, Self::DATA_WORDS, 0)? {"); expect(code).toContain("Some(values) => Some(values.into_iter().map(|word| chrono::DateTime"); - expect(code).toContain("let ids = r.bytes16_list(at, Self::DATA_WORDS, 1)?.map"); - expect(code).toContain("let colors = match r.byte_list(at, Self::DATA_WORDS, 2)? {"); + expect(code).toContain("let f1 = r.bytes16_list(at, Self::DATA_WORDS, 1)?.map"); + expect(code).toContain("let f2 = match r.byte_list(at, Self::DATA_WORDS, 2)? {"); }); it("uses composite lists for mixed unions", () => { @@ -265,7 +274,7 @@ describe("[CONV-RUST-TDBIN] list codecs", () => { `type Payload {\n label: String\n}\nunion Event {\n Seen(Payload)\n Empty\n}\ntype Stream {\n events: List\n}` ); expect(code).toContain("w.child_list(at, Self::DATA_WORDS, 0, Some(&self.events))?;"); - expect(code).toContain("let events = r.child_list::(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); + expect(code).toContain("let f0 = r.child_list::(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); }); it("rejects List when one-byte ordinals would overflow", () => { @@ -316,13 +325,13 @@ describe("[CONV-RUST-TDBIN] fails loudly on unsupported shapes (no placeholders) it("emits Option with null reserved for None", () => { const code = unwrap(emitRustCodec(modelFor(`type Empty {\n}\ntype Holder {\n maybe: Option\n}`))); expect(code).toContain("w.child(at, Self::DATA_WORDS, 0, self.maybe.as_ref())?;"); - expect(code).toContain("let maybe = r.child::(at, Self::DATA_WORDS, 0)?;"); + expect(code).toContain("let f0 = r.child::(at, Self::DATA_WORDS, 0)?;"); }); it("emits required empty-record child pointers with the non-null marker", () => { const code = unwrap(emitRustCodec(modelFor(`type Empty {\n}\ntype Holder {\n value: Empty\n}`))); expect(code).toContain("w.child(at, Self::DATA_WORDS, 0, Some(&self.value))?;"); - expect(code).toContain("let value = r.child::(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); + expect(code).toContain("let f0 = r.child::(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); }); it("rejects List before composite count would lose element identity", () => { @@ -336,9 +345,12 @@ describe("[CONV-RUST-TDBIN] fails loudly on unsupported shapes (no placeholders) expectErrorMessages(r, ["must be monomorphized"]); }); - it("rejects a variant that is neither bare nor a single tuple field", () => { - const r = emitRustCodec(modelFor(`union U {\n Multi(Int, String)\n}`)); - expectErrorMessages(r, ["bare or a single tuple field"]); + it("encodes multi-field variants as payload records but rejects unencodable payload fields [TDBIN-UNION-STRUCT]", () => { + const multi = unwrap(emitRustCodec(modelFor(`union U {\n Multi(Int, String)\n}`))); + expect(multi).toContain("Self::Multi(f0, f1) => {"); + expect(multi).toContain("impl tdbin::Struct for UMultiTdbinPayload {"); + const r = emitRustCodec(modelFor(`union U {\n Bad {\n m: Map\n }\n}`)); + expectErrorMessages(r, ["unsupported field type 'Map' in UBadTdbinPayload.m"]); }); it("rejects a variant payload that has no v0 wire encoding", () => { @@ -394,11 +406,11 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", /impl tdbin::Struct for Batch \{\n[ ]{4}const DATA_WORDS: u16 = 0;\n[ ]{4}const PTR_WORDS: u16 = 5;/ ); expect(code).toContain("w.column_list(at, Self::DATA_WORDS, 0, Some(&self.rows))?;"); - expect(code).toContain("let rows = r.column_list::(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); + expect(code).toContain("let f0 = r.column_list::(at, Self::DATA_WORDS, 0)?.unwrap_or_default();"); expect(code).toContain("w.string_var_list(at, Self::DATA_WORDS, 1, 2, Some(&self.labels))?;"); expect(code).toContain( [ - " let labels = match r.var_list(at, Self::DATA_WORDS, 1, 2)? {", + " let f1 = match r.var_list(at, Self::DATA_WORDS, 1, 2)? {", " Some(column) => column.into_strings()?,", " None => Vec::new(),", " };", @@ -407,9 +419,9 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", // List fields become frame-of-reference delta blocks at layout 2 // ([TDBIN-COL-INTBLOCK]); empty round-trips as null like var lists. expect(code).toContain("w.i64_block_list(at, Self::DATA_WORDS, 3, Some(&self.nums))?;"); - expect(code).toContain("let nums = r.i64_block_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default();"); + expect(code).toContain("let f2 = r.i64_block_list(at, Self::DATA_WORDS, 3)?.unwrap_or_default();"); expect(code).toContain("w.opt_column_list(at, Self::DATA_WORDS, 4, self.extra.as_deref())?;"); - expect(code).toContain("let extra = r.column_list::(at, Self::DATA_WORDS, 4)?;"); + expect(code).toContain("let f3 = r.column_list::(at, Self::DATA_WORDS, 4)?;"); // Row group plan ([TDBIN-COL-PLAN]): title 0-1, active 2, age 3, score 4, // nickname 5-7, detail 8-9, kind 10, tags 11-13 -> 14 columns. expect(code).toContain("impl tdbin::ColumnGroup for Row {\n const COLUMNS: u16 = 14;"); @@ -425,8 +437,10 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", // Option: validity bits then a DENSE child group, partitioned // ONCE into a ref vector whose len replaces a second counting pass. expect(code).toContain("w.bit_column(at, 1, 8, count, items.clone().map(|row| row.detail.is_some()))?;"); - expect(code).toContain("let detail: Vec<&Detail> = items.clone().filter_map(|row| row.detail.as_ref()).collect();"); - expect(code).toContain("w.dense_group(at, 1, 9, detail.len(), detail.iter().copied())?;"); + expect(code).toContain( + "let detail_some: Vec<&Detail> = items.clone().filter_map(|row| row.detail.as_ref()).collect();" + ); + expect(code).toContain("w.dense_group(at, 1, 9, detail_some.len(), detail_some.iter().copied())?;"); expect(code).not.toContain("let detail_count = items.clone().filter(|row| row.detail.is_some()).count();"); // Union field: one dense union group aligned to every row. expect(code).toContain("w.dense_group(at, 1, 10, count, items.clone().map(|row| &row.kind))?;"); @@ -443,30 +457,30 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", ); // Row reads: aligned columns index by row, dense/var columns consume // exactly-counted iterators, nested lists take per-row slices. - expect(code).toContain("let mut title = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter();"); - expect(code).toContain("let active = r.bit_column(at, 2, count)?;"); - expect(code).toContain("active: active.get(i).copied().unwrap_or_default(),"); - expect(code).toContain("let age = r.i64_block_column(at, 3, count)?;"); - expect(code).toContain("let score = r.f64_column(at, 4, count)?;"); - expect(code).toContain("let nickname_valid = r.bit_column(at, 5, count)?;"); - expect(code).toContain("let nickname_values = r.var_column(at, 6, 7, count)?.into_strings()?;"); + expect(code).toContain("let mut f0 = r.var_column(at, 0, 1, count)?.into_strings()?.into_iter();"); + expect(code).toContain("let f1 = r.bit_column(at, 2, count)?;"); + expect(code).toContain("active: f1.get(i).copied().unwrap_or_default(),"); + expect(code).toContain("let f2 = r.i64_block_column(at, 3, count)?;"); + expect(code).toContain("let f3 = r.f64_column(at, 4, count)?;"); + expect(code).toContain("let f4_valid = r.bit_column(at, 5, count)?;"); + expect(code).toContain("let f4_values = r.var_column(at, 6, 7, count)?.into_strings()?;"); expect(code).toContain( - "let mut nickname = nickname_valid.into_iter().zip(nickname_values).map(|(valid, value)| valid.then_some(value));" + "let mut f4 = f4_valid.into_iter().zip(f4_values).map(|(valid, value)| valid.then_some(value));" ); - expect(code).toContain("let detail_count = detail_valid.iter().filter(|present| **present).count();"); - expect(code).toContain("let mut detail = r.dense_group::(at, 9, detail_count)?.into_iter();"); + expect(code).toContain("let f5_count = f5_valid.iter().filter(|present| **present).count();"); + expect(code).toContain("let mut f5 = r.dense_group::(at, 9, f5_count)?.into_iter();"); expect(code).toContain( - "detail: detail_valid.get(i).copied().unwrap_or_default().then(|| detail.next().ok_or(tdbin::DecodeError::MalformedColumn)).transpose()?," + "detail: f5_valid.get(i).copied().unwrap_or_default().then(|| f5.next().ok_or(tdbin::DecodeError::MalformedColumn)).transpose()?," ); - expect(code).toContain("let mut kind = r.dense_group::(at, 10, count)?.into_iter();"); - expect(code).toContain("let tags_counts = r.len_column(at, 11, count)?;"); - expect(code).toContain("let tags_total = tdbin::column_total(&tags_counts)?;"); - expect(code).toContain("let mut tags = r.var_column(at, 12, 13, tags_total)?.into_strings()?.into_iter();"); + expect(code).toContain("let mut f6 = r.dense_group::(at, 10, count)?.into_iter();"); + expect(code).toContain("let f7_counts = r.len_column(at, 11, count)?;"); + expect(code).toContain("let f7_total = tdbin::column_total(&f7_counts)?;"); + expect(code).toContain("let mut f7 = r.var_column(at, 12, 13, f7_total)?.into_strings()?.into_iter();"); expect(code).toContain( - "let tags_take = usize::try_from(tags_counts.get(i).copied().unwrap_or(0)).map_err(|_| tdbin::DecodeError::LimitExceeded)?;" + "let f7_take = usize::try_from(f7_counts.get(i).copied().unwrap_or(0)).map_err(|_| tdbin::DecodeError::LimitExceeded)?;" ); expect(code).toContain( - "tags: (0..tags_take).map(|_| tags.next().ok_or(tdbin::DecodeError::MalformedColumn)).collect::, _>>()?," + "tags: (0..f7_take).map(|_| f7.next().ok_or(tdbin::DecodeError::MalformedColumn)).collect::, _>>()?," ); // Transitively reached groups: Detail via Option + union payload, // Extra via the second union payload ([TDBIN-COL-PLAN] closure). @@ -488,22 +502,22 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", // re-scan of the full item list, no separate matches! counting pass). expect(code).toContain( [ - " let basic: Vec<&Detail> = items.clone().filter_map(|row| match row {", + " let v0: Vec<&Detail> = items.clone().filter_map(|row| match row {", " Self::Basic(payload) => Some(payload),", " Self::Extended(_) | Self::Bare => None,", " }).collect();", - " w.dense_group(at, 1, 1, basic.len(), basic.iter().copied())?;", + " w.dense_group(at, 1, 1, v0.len(), v0.iter().copied())?;", ].join("\n") ); expect(code).not.toContain("matches!(row, Self::Basic(_))"); expect(code).toContain("let tags = r.byte_column(at, 0, count)?;"); // Tag histograms sum bit-matches instead of the naive bytecount pattern. - expect(code).toContain("let basic_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::();"); - expect(code).toContain("let extended_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::();"); + expect(code).toContain("let v0_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::();"); + expect(code).toContain("let v1_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::();"); expect(code).not.toContain(".filter(|tag| **tag == 0).count()"); - expect(code).toContain("let mut basic = r.dense_group::(at, 1, basic_count)?.into_iter();"); - expect(code).toContain("let mut extended = r.dense_group::(at, 2, extended_count)?.into_iter();"); - expect(code).toContain("0 => Self::Basic(basic.next().ok_or(tdbin::DecodeError::MalformedColumn)?),"); + expect(code).toContain("let mut v0 = r.dense_group::(at, 1, v0_count)?.into_iter();"); + expect(code).toContain("let mut v1 = r.dense_group::(at, 2, v1_count)?.into_iter();"); + expect(code).toContain("0 => Self::Basic(v0.next().ok_or(tdbin::DecodeError::MalformedColumn)?),"); expect(code).toContain("2 => Self::Bare,"); // Columnar unknown tags fail typed WITHOUT re-verifying slots (every // column was already visited by the reads above the tag loop). @@ -530,22 +544,22 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", expect(code).toContain("impl tdbin::ColumnGroup for Sensor {\n const COLUMNS: u16 = 35;"); // Bytes var column and Option with zero-length absent lanes. expect(code).toContain("w.var_column(at, 1, 0, 1, count, items.clone().map(|row| row.raw.as_slice()))?;"); - expect(code).toContain("let mut raw = r.var_column(at, 0, 1, count)?.into_byte_vecs()?.into_iter();"); + expect(code).toContain("let mut f0 = r.var_column(at, 0, 1, count)?.into_byte_vecs()?.into_iter();"); expect(code).toContain( "w.var_column(at, 1, 14, 15, count, items.clone().map(|row| row.thumb.as_deref().unwrap_or_default()))?;" ); - expect(code).toContain("let thumb_values = r.var_column(at, 14, 15, count)?.into_byte_vecs()?;"); + expect(code).toContain("let f8_values = r.var_column(at, 14, 15, count)?.into_byte_vecs()?;"); // DateTime: i64 micros column, per-row checked conversion. expect(code).toContain("w.i64_column(at, 1, 2, count, items.clone().map(|row| row.seen.timestamp_micros()))?;"); expect(code).toContain( - "seen: chrono::DateTime::::from_timestamp_micros(seen.get(i).copied().unwrap_or_default()).ok_or(tdbin::DecodeError::LimitExceeded)?," + "seen: chrono::DateTime::::from_timestamp_micros(f1.get(i).copied().unwrap_or_default()).ok_or(tdbin::DecodeError::LimitExceeded)?," ); // Uuid/Decimal: 16-byte columns converted per row. expect(code).toContain( "w.bytes16_column(at, 1, 3, count, items.clone().map(|row| tdbin::scalar::bytes16_words(row.id.as_bytes())))?;" ); expect(code).toContain( - "let id = r.bytes16_column(at, 3, count)?.into_iter().map(|(lo, hi)| uuid::Uuid::from_bytes(tdbin::scalar::bytes16_from_words(lo, hi))).collect::>();" + "let f2 = r.bytes16_column(at, 3, count)?.into_iter().map(|(lo, hi)| uuid::Uuid::from_bytes(tdbin::scalar::bytes16_from_words(lo, hi))).collect::>();" ); expect(code).toContain( "w.bytes16_column(at, 1, 4, count, items.clone().map(|row| tdbin::scalar::bytes16_words(&row.amount.serialize())))?;" @@ -556,14 +570,14 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", expect(code).toContain("w.i64_column(at, 1, 8, count, items.clone().map(|row| row.hits.unwrap_or_default()))?;"); expect(code).toContain("w.f64_column(at, 1, 10, count, items.clone().map(|row| row.ratio.unwrap_or_default()))?;"); expect(code).toContain( - "let mut hits = hits_valid.into_iter().zip(hits_values).map(|(valid, value)| valid.then_some(value));" + "let mut f5 = f5_valid.into_iter().zip(f5_values).map(|(valid, value)| valid.then_some(value));" ); // Option: absent lanes write zero micros, present lanes convert. expect(code).toContain( "w.i64_column(at, 1, 12, count, items.clone().map(|row| row.expires.map_or(0, |value| value.timestamp_micros())))?;" ); expect(code).toContain( - "let expires_rows = expires_valid.into_iter().zip(expires_values).map(|(valid, value)| valid.then(|| chrono::DateTime::::from_timestamp_micros(value).ok_or(tdbin::DecodeError::LimitExceeded)).transpose()).collect::, _>>()?;" + "let f7_rows = f7_valid.into_iter().zip(f7_values).map(|(valid, value)| valid.then(|| chrono::DateTime::::from_timestamp_micros(value).ok_or(tdbin::DecodeError::LimitExceeded)).transpose()).collect::, _>>()?;" ); // Required record and union fields: full-count dense groups. expect(code).toContain("w.dense_group(at, 1, 16, count, items.clone().map(|row| &row.item))?;"); @@ -572,7 +586,7 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", expect(code).toContain( "w.bit_column(at, 1, 19, bits_total, items.clone().flat_map(|row| row.bits.iter()).copied())?;" ); - expect(code).toContain("let mut bits = r.bit_column(at, 19, bits_total)?.into_iter();"); + expect(code).toContain("let mut f11 = r.bit_column(at, 19, f11_total)?.into_iter();"); expect(code).toContain( "w.i64_block_column(at, 1, 21, nums_total, items.clone().flat_map(|row| row.nums.iter()).copied())?;" ); @@ -583,13 +597,13 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", "w.i64_column(at, 1, 25, stamps_total, items.clone().flat_map(|row| row.stamps.iter()).map(chrono::DateTime::timestamp_micros))?;" ); expect(code).toContain( - "let stamps_flat = r.i64_column(at, 25, stamps_total)?.into_iter().map(|value| chrono::DateTime::::from_timestamp_micros(value).ok_or(tdbin::DecodeError::LimitExceeded)).collect::, _>>()?;" + "let f14_flat = r.i64_column(at, 25, f14_total)?.into_iter().map(|value| chrono::DateTime::::from_timestamp_micros(value).ok_or(tdbin::DecodeError::LimitExceeded)).collect::, _>>()?;" ); expect(code).toContain( "w.bytes16_column(at, 1, 27, ids_total, items.clone().flat_map(|row| row.ids.iter()).map(|value| tdbin::scalar::bytes16_words(value.as_bytes())))?;" ); expect(code).toContain( - "let ids_flat = r.bytes16_column(at, 27, ids_total)?.into_iter().map(|(lo, hi)| uuid::Uuid::from_bytes(tdbin::scalar::bytes16_from_words(lo, hi))).collect::>();" + "let f15_flat = r.bytes16_column(at, 27, f15_total)?.into_iter().map(|(lo, hi)| uuid::Uuid::from_bytes(tdbin::scalar::bytes16_from_words(lo, hi))).collect::>();" ); expect(code).toContain( "w.bytes16_column(at, 1, 29, amounts_total, items.clone().flat_map(|row| row.amounts.iter()).map(|value| tdbin::scalar::bytes16_words(&value.serialize())))?;" @@ -598,24 +612,24 @@ describe("[CONV-RUST-TDBIN] layout major 2 columnar lists ([TDBIN-COL-POLICY])", expect(code).toContain( "w.var_column(at, 1, 31, 32, blobs_total, items.clone().flat_map(|row| row.blobs.iter()).map(Vec::as_slice))?;" ); - expect(code).toContain("let mut blobs = r.var_column(at, 31, 32, blobs_total)?.into_byte_vecs()?.into_iter();"); + expect(code).toContain("let mut f17 = r.var_column(at, 31, 32, f17_total)?.into_byte_vecs()?.into_iter();"); // Nested record list: dense group over the flattened total. expect(code).toContain("w.dense_group(at, 1, 34, parts_total, items.clone().flat_map(|row| row.parts.iter()))?;"); - expect(code).toContain("let mut parts = r.dense_group::(at, 34, parts_total)?.into_iter();"); + expect(code).toContain("let mut f18 = r.dense_group::(at, 34, f18_total)?.into_iter();"); // String-payload union variant: a dense var column pair ([TDBIN-COL-UNION]). expect(code).toContain("impl tdbin::ColumnGroup for Note {\n const COLUMNS: u16 = 3;"); expect(code).toContain( [ - " let text: Vec<&String> = items.clone().filter_map(|row| match row {", + " let v0: Vec<&String> = items.clone().filter_map(|row| match row {", " Self::Text(payload) => Some(payload),", " Self::Zero => None,", " }).collect();", - " w.var_column(at, 1, 1, 2, text.len(), text.iter().copied().map(String::as_bytes))?;", + " w.var_column(at, 1, 1, 2, v0.len(), v0.iter().copied().map(String::as_bytes))?;", ].join("\n") ); - expect(code).toContain("let text_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::();"); - expect(code).toContain("let mut text = r.var_column(at, 1, 2, text_count)?.into_strings()?.into_iter();"); - expect(code).toContain("0 => Self::Text(text.next().ok_or(tdbin::DecodeError::MalformedColumn)?),"); + expect(code).toContain("let v0_count = tags.iter().map(|tag| usize::from(*tag == 0)).sum::();"); + expect(code).toContain("let mut v0 = r.var_column(at, 1, 2, v0_count)?.into_strings()?.into_iter();"); + expect(code).toContain("0 => Self::Text(v0.next().ok_or(tdbin::DecodeError::MalformedColumn)?),"); expect(code).toContain("1 => Self::Zero,"); // A group whose rows never index by position loops without a row index. expect(code).toContain("impl tdbin::ColumnGroup for Item {\n const COLUMNS: u16 = 2;"); @@ -755,10 +769,63 @@ describe("[CONV-RUST-TDBIN] layout manifests and LAYOUT_HASH ([TDBIN-SCHEMA-HASH describe("[CONV-RUST-TDBIN] drift guard vs the committed crate fixtures", () => { it("reproduces generated/mod.rs (Person fixture)", () => { - expectRustModuleReproduces(PERSON_TD, "../../../../crates/tdbin/tests/generated/mod.rs"); + expectRustModuleReproduces(PERSON_TD, "../../../../src/tdbin/tests/generated/mod.rs"); }); it("reproduces generated_opt/mod.rs (Option Measurement fixture)", () => { - expectRustModuleReproduces(MEASUREMENT_TD, "../../../../crates/tdbin/tests/generated_opt/mod.rs"); + expectRustModuleReproduces(MEASUREMENT_TD, "../../../../src/tdbin/tests/generated_opt/mod.rs"); + }); + + it("reproduces generated_widths/mod.rs; width types hash distinctly and reject layout 2 [TDBIN-WIDTH-RANGE] #85", () => { + const widthsTd = readFileSync(fileURLToPath(new URL("./fixtures/widths.td", import.meta.url)), "utf8"); + expectRustModuleReproduces(widthsTd, "../../../../src/tdbin/tests/generated_widths/mod.rs"); + const { decls } = unwrap(buildModel(unwrap(parse(widthsTd)))); + const stats = decls.find((d) => d.name === "Stats"); + const manifest = stats === undefined ? "" : unwrap(layoutManifest(decls, stats, 1)); + expect(manifest).toBe( + "tdbin-layout v1 major=1\n0:record d=9 p=11 [i32@w0;u8@w1;u16@w2;u32@w3;u64@w4;usize@w5;str@p0;opt(bit@w6.0,u64@w7);opt(bit@w6.1,u16@w8);str?@p1;list(i32)@p2;list(u8)@p3;list(u16)@p4;list(u32)@p5;list(u64)@p6;list(usize)@p7;list(str)@p8;list(usize)?@p9;list(str)?@p10]" + ); + const intOnly = unwrap(buildModel(unwrap(parse("type Stats {\n delta: Int\n}")))); + const i32Only = unwrap(buildModel(unwrap(parse("type Stats {\n delta: I32\n}")))); + const hashOf = (m: typeof intOnly) => { + const root = m.decls[0]; + return root === undefined ? 0n : fnv1a64(unwrap(layoutManifest(m.decls, root, 1))); + }; + expect(hashOf(intOnly)).not.toBe(hashOf(i32Only)); + const code = unwrap(emitRustCodec(unwrap(buildModel(unwrap(parse(widthsTd)))))); + expect(code).toContain("let f0 = tdbin::scalar::i32_from(r.scalar(at, 0)?)?;"); + expect(code).toContain("let f4 = tdbin::scalar::u64_from(r.scalar(at, 4)?);"); + expect(code).toContain("w.u16_list(at, Self::DATA_WORDS, 4, Some(&self.ports))?;"); + expect(code).toContain("w.string(at, Self::DATA_WORDS, 0, Some(tdbin::scalar::path_str(&self.file)?))?;"); + const columnar = generateRustModule( + unwrap(buildModel(unwrap(parse(`${widthsTd}\ntype Batch {\n rows: List\n}`)))), + { layout: 2 } + ); + expect(columnar.ok ? "" : (columnar.error[0]?.message ?? "")).toContain("has no columnar encoding under layout 2"); + }); + + it("reproduces generated_shapes/mod.rs and gates struct-form variants by layout [TDBIN-UNION-STRUCT] #61", () => { + const shapesTd = readFileSync(fileURLToPath(new URL("./fixtures/shapes.td", import.meta.url)), "utf8"); + expectRustModuleReproduces(shapesTd, "../../../../src/tdbin/tests/generated_shapes/mod.rs"); + const module = unwrap(generateRustModule(unwrap(buildModel(unwrap(parse(shapesTd)))))); + expect(module).toContain("pub struct ShapeRectTdbinPayload {"); + expect(module).toContain("pub struct ShapePairTdbinPayload {\n /// The `v0` field.\n pub v0: i64,"); + expect(module).toContain("Some(&ShapeRectTdbinPayload { w: *f0, h: *f1, corner: f2.clone() })"); + expect(module).toContain("Ok(Self::Pair(payload.v0, payload.v1))"); + expect(module).toContain("let payload = ShapeCircleTdbinPayload::default();"); + const { decls } = unwrap(buildModel(unwrap(parse(shapesTd)))); + const shape = decls.find((d) => d.name === "Shape"); + expect(shape?.kind).toBe("union"); + const manifest = shape === undefined ? "" : unwrap(layoutManifest(decls, shape, 1)); + expect(manifest).toBe( + "tdbin-layout v1 major=1\n0:union d=1 p=1 [ref1@p0;ref2@p0;ref4@p0;ref3@p0;unit]\n1:record d=1 p=1 [f64@w0;str@p0]\n2:record d=2 p=1 [f64@w0;f64@w1;ref3@p0]\n3:record d=2 p=0 [f64@w0;f64@w1]\n4:record d=1 p=1 [i64@w0;str@p0]" + ); + const columnar = generateRustModule( + unwrap(buildModel(unwrap(parse(`${shapesTd}\ntype Batch {\n rows: List\n}`)))), + { layout: 2 } + ); + expect(columnar.ok ? "" : (columnar.error[0]?.message ?? "")).toContain( + "variant 'Circle' has a struct-form payload, which layout 2 column groups do not support yet" + ); }); }); diff --git a/packages/typediagram/test/converters/rust.test.ts b/src/typediagram/test/converters/rust.test.ts similarity index 72% rename from packages/typediagram/test/converters/rust.test.ts rename to src/typediagram/test/converters/rust.test.ts index 9538e10..f2a67e1 100644 --- a/packages/typediagram/test/converters/rust.test.ts +++ b/src/typediagram/test/converters/rust.test.ts @@ -1,6 +1,9 @@ // [CONV-RUST-TEST] Rust converter integration tests. import { describe, expect, it } from "vitest"; import { rust } from "../../src/converters/index.js"; +import { generateRustModule } from "../../src/converters/rust-tdbin.js"; +import { buildModel } from "../../src/model/index.js"; +import { parse } from "../../src/parser/index.js"; import { printSource } from "../../src/model/index.js"; import { aliasTargetName, @@ -111,8 +114,8 @@ impl Processor for ChatRequest { active: "Bool", score: "Float", count: "Int", - tiny: "Int", - medium: "Int", + tiny: "U8", + medium: "I32", }); // ToolResult — 5 fields, f32 maps to Float @@ -281,3 +284,76 @@ describe("[CONV-RUST-RT] Rust round-trip TD -> Rust -> TD", () => { expectLosslessRoundTrip(rust); }); }); + +describe("[CONV-RUST-IDIOM] lint-clean Rust output (#71)", () => { + it("emits snake_case fields with serde renames, derives, and round-trips camelCase schemas", () => { + const td = `type RawParam { + name: String + typeText: Option + isNamed: Bool + isHTTPServer: Bool + defaultValue: Option +} + +union DeclKind { + Class + Enum +} + +union Event { + Moved { + deltaX: Float + y: Float + } + Named(String) +} + +type Plain { + snake_case: Int +}`; + const output = toSourceFromTd(rust, td); + expect(output).toContain( + "#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]\npub struct RawParam {" + ); + expect(output).toContain(' #[serde(rename = "typeText")]\n pub type_text: Option,'); + expect(output).toContain(' #[serde(rename = "isNamed")]\n pub is_named: bool,'); + expect(output).toContain(' #[serde(rename = "isHTTPServer")]\n pub is_http_server: bool,'); + expect(output).toContain(' #[serde(rename = "defaultValue")]\n pub default_value: Option,'); + expect(output).toContain(" pub name: String,"); + expect(output).not.toContain("typeText:"); + expect(output).toContain( + "#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]\npub enum DeclKind {" + ); + expect(output).toContain( + '#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]\npub enum Event {\n Moved { #[serde(rename = "deltaX")] delta_x: f64, y: f64 },' + ); + expect(output).toContain( + "#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]\npub struct Plain {\n pub snake_case: i64," + ); + expect(toSourceFromTd(rust, "type Plain {\n snake_case: Int\n}")).toContain( + "#[derive(Debug, Clone, PartialEq)]\npub struct Plain {" + ); + const back = unwrap(rust.fromSource(output)); + expect(recordFields(back, "RawParam").map((f) => f.name)).toEqual([ + "name", + "typeText", + "isNamed", + "isHTTPServer", + "defaultValue", + ]); + expect(unionVariants(back, "Event")[0]?.fields.map((f) => f.name)).toEqual(["deltaX", "y"]); + expect(recordFields(back, "Plain").map((f) => f.name)).toEqual(["snake_case"]); + const module = unwrap(generateRustModule(unwrap(buildModel(unwrap(parse(td)))))); + expect(module).toContain( + "#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)]\npub struct RawParam {" + ); + expect(module).toContain("w.string(at, Self::DATA_WORDS, 1, self.type_text.as_deref())?;"); + expect(module).toContain( + "Ok(Self { name: f0, type_text: f1, is_named: f2, is_http_server: f3, default_value: f4 })" + ); + expect(module).toContain("Self::Moved { delta_x: f0, y: f1 } => {"); + expect(module).toContain( + "pub struct EventMovedTdbinPayload {\n /// The `delta_x` field.\n pub delta_x: f64," + ); + }); +}); diff --git a/packages/typediagram/test/converters/samples.test.ts b/src/typediagram/test/converters/samples.test.ts similarity index 100% rename from packages/typediagram/test/converters/samples.test.ts rename to src/typediagram/test/converters/samples.test.ts diff --git a/packages/typediagram/test/converters/scalars.test.ts b/src/typediagram/test/converters/scalars.test.ts similarity index 98% rename from packages/typediagram/test/converters/scalars.test.ts rename to src/typediagram/test/converters/scalars.test.ts index 5df8bb3..4dcdc09 100644 --- a/packages/typediagram/test/converters/scalars.test.ts +++ b/src/typediagram/test/converters/scalars.test.ts @@ -61,7 +61,7 @@ const EMIT_CASES: EmitCase[] = [ { lang: "rust", snippets: [ - "pub createdAt: chrono::DateTime", + '#[serde(rename = "createdAt")]\n pub created_at: chrono::DateTime', "pub id: uuid::Uuid", "pub amount: rust_decimal::Decimal", "Vec>", diff --git a/src/typediagram/test/converters/shared-layout.test.ts b/src/typediagram/test/converters/shared-layout.test.ts new file mode 100644 index 0000000..253c747 --- /dev/null +++ b/src/typediagram/test/converters/shared-layout.test.ts @@ -0,0 +1,178 @@ +import { describe, expect, it } from "vitest"; +import { generateSharedC } from "../../src/converters/shared-c.js"; +import { generateSharedLayout } from "../../src/converters/shared-layout.js"; +import { expectErrorMessages, modelFromTd, unwrap } from "./helpers.js"; + +// [CONV-SHARED-LAYOUT] Shared offsets are independent of wire codecs/object layouts. +describe("shared memory layout", () => { + it("lays out inline identities, dynamic references, optional values and union tags", async () => { + expect(generateSharedLayout).toBeTypeOf("function"); + const schema = `alias Instance = Uuid + alias Label = String + type Caption { text: Label } + type Owner { app: Instance serial: Int } + type Ref { app: Instance slot: Int generation: Int offset: Int } + type Lease { owner: Owner reference: Ref } + type Node { label: String children: List active: Bool owner: Owner } + union Event { Empty {} Count { value: Int } NodeValue { value: Node } } + type Request { previous: Option event: Event }`; + const layout = unwrap(await generateSharedLayout(modelFromTd(schema), 8)); + expect(layout.declarations.find((decl) => decl.name === "Owner")).toMatchObject({ bytes: 24, inline: true }); + expect(layout.declarations.find((decl) => decl.name === "Ref")).toMatchObject({ bytes: 40, inline: true }); + expect(layout.declarations.find((decl) => decl.name === "Lease")).toMatchObject({ bytes: 64, inline: true }); + expect(layout.declarations.find((decl) => decl.name === "Node")).toMatchObject({ + bytes: 128, + inline: false, + fields: [ + { name: "label", offset: 0, bytes: 48 }, + { name: "children", offset: 48, bytes: 48 }, + { name: "active", offset: 96, bytes: 8 }, + { name: "owner", offset: 104, bytes: 24 }, + ], + }); + expect(layout.declarations.find((decl) => decl.name === "Event")).toMatchObject({ + bytes: 48, + inline: false, + variants: [ + { name: "Empty", tag: 0 }, + { name: "Count", tag: 1 }, + { name: "NodeValue", tag: 2 }, + ], + }); + expect(layout.declarations.find((decl) => decl.name === "Request")).toMatchObject({ bytes: 72 }); + expect(layout.declarations.find((decl) => decl.name === "Caption")).toMatchObject({ + bytes: 48, + fields: [{ name: "text", bytes: 48, storage: "bytes" }], + }); + expect(layout.fingerprint).toMatch(/^[a-f0-9]{64}$/); + expect(unwrap(await generateSharedLayout(modelFromTd(schema + "\n"), 8)).fingerprint).toBe(layout.fingerprint); + expect(unwrap(await generateSharedLayout(modelFromTd(schema), 4)).fingerprint).not.toBe(layout.fingerprint); + expect( + unwrap(await generateSharedLayout(modelFromTd(schema.replace("serial:", "counter:")), 8)).fingerprint + ).not.toBe(layout.fingerprint); + expect(await generateSharedLayout(modelFromTd("type Bad { value: Map }"), 8)).toMatchObject({ + ok: false, + }); + }); + it("caps inline copying and makes recursive declaration order irrelevant", async () => { + for (const cyclic of ["alias A = A", "alias A = B\nalias B = A", "alias A = Option"]) { + expect(await generateSharedLayout(modelFromTd(cyclic), 8)).toMatchObject({ ok: false }); + } + const declarations = [ + "type Large { a: Int b: Int c: Int d: Int e: Int f: Int g: Int h: Int i: Int }", + "alias LargeAlias = Large", + "type Holder { value: LargeAlias next: Option }", + "alias Link = Node", + "type Node { next: Option }", + "type Left { right: Right }", + "type Right { left: Left }", + ]; + const layout = unwrap(await generateSharedLayout(modelFromTd(declarations.join("\n")), 8)); + expect(await generateSharedLayout(modelFromTd("type Valid { value: Int }"), 16)).toMatchObject({ + ok: false, + }); + expect(layout).toMatchObject({ abiMajor: 1, endian: "little", alignment: 8, inlineLimit: 64 }); + expect(layout.declarations.find((decl) => decl.name === "Node")).toMatchObject({ + bytes: 48, + inline: false, + fields: [{ name: "next", bytes: 48, storage: "optional", value: { bytes: 40, storage: "reference" } }], + }); + expect(layout.declarations.find((decl) => decl.name === "Large")).toMatchObject({ bytes: 72, inline: false }); + expect(layout.declarations.find((decl) => decl.name === "Holder")).toMatchObject({ + bytes: 88, + fields: [ + { name: "value", bytes: 40, storage: "reference" }, + { name: "next", bytes: 48, storage: "optional" }, + ], + }); + expect(unwrap(await generateSharedLayout(modelFromTd(declarations.reverse().join("\n")), 8))).toEqual(layout); + }); +}); + +// [CONV-SHARED-C] The C profile reuses generateSharedLayout verbatim and emits constants only. +describe("shared memory C profile", () => { + const schema = `alias Instance = Uuid + type Owner { app: Instance serial: Int } + type Ref { app: Instance slot: Int } + type Lease { owner: Owner reference: Ref } + type Node { label: String children: List } + union Event { Empty {} Count { value: Int } NodeValue { value: Node } } + type Request { previous: Option event: Event }`; + + it("emits guard, fingerprint, profile macros, typedefs, asserts and offset constants", async () => { + const model = modelFromTd(schema); + const c = unwrap(await generateSharedC(model, 8)); + expect(c).toContain("#ifndef TD_SHARED_H\n#define TD_SHARED_H"); + expect(c).toContain("#include "); + expect(c).toContain(`#define TD_SHARED_FINGERPRINT "${unwrap(await generateSharedLayout(model, 8)).fingerprint}"`); + expect(c).toContain("#define TD_SHARED_POINTER_BYTES 8"); + expect(c).toContain("#define TD_SHARED_ABI_MAJOR 1"); + expect(c.trim().endsWith("#endif")).toBe(true); + expect(c).toContain("TD_SHARED_STORAGE(Owner, 24);"); + expect(c).toContain("sizeof(td_##name) == (byte_count)"); + expect(c).toContain("_Alignof(td_##name) == 8"); + expect(c).toContain("TD_SHARED_STORAGE(Lease, 48);"); + expect(c).toContain("#define TD_Lease_owner_OFFSET 0"); + expect(c).toContain("#define TD_Lease_owner_BYTES 24"); + expect(c).toContain("#define TD_Lease_reference_OFFSET 24"); + expect(c).toContain("#define TD_Request_previous_OFFSET 0"); + expect(c).toContain("#define TD_Request_previous_BYTES 32"); + expect(c).toContain("#define TD_Request_event_BYTES 40"); + expect(c).toContain("#define TD_Event_Empty_TAG 0"); + expect(c).toContain("#define TD_Event_Count_TAG 1"); + expect(c).toContain("#define TD_Event_NodeValue_TAG 2"); + expect(c).toContain("#define TD_Event_Count_value_OFFSET 8"); + expect(c).toContain("#define TD_Event_Count_value_BYTES 8"); + expect(c).toContain("#define TD_Event_NodeValue_value_OFFSET 8"); + expect(c).toContain("#define TD_Event_NodeValue_value_BYTES 40"); + expect(c).toContain("TD_SHARED_STORAGE(Node, 96);"); + // Constants only: deterministic output, no pointers, accessors, codec, or view validation. + expect(unwrap(await generateSharedC(model, 8))).toBe(c); + expect(c).not.toContain("*"); + expect(unwrap(await generateSharedC(modelFromTd(schema), 4))).toContain("#define TD_SHARED_POINTER_BYTES 4"); + }); + + it("passes generator errors through unchanged and rejects zero sizes and injectable identifiers", async () => { + expectErrorMessages(await generateSharedC(modelFromTd("alias A = A"), 8), ["shared-layout:"]); + expectErrorMessages(await generateSharedC(modelFromTd("type Bad { value: Map }"), 8), [ + "shared-layout:", + ]); + expectErrorMessages(await generateSharedC(modelFromTd(schema), 16), ["unsupported pointer profile"]); + expectErrorMessages(await generateSharedC(modelFromTd("alias Nothing = Unit"), 8), [ + "zero-size declaration 'Nothing'", + ]); + const solo = modelFromTd("type Solo { a: Int }"); + const poisonDecl = { ...solo, decls: solo.decls.map((d) => (d.name === "Solo" ? { ...d, name: "Solo };" } : d)) }; + expectErrorMessages(await generateSharedC(poisonDecl, 8), ["invalid C identifier", "Solo"]); + const poisonField = { + ...solo, + decls: solo.decls.map((d) => + d.kind === "record" ? { ...d, fields: d.fields.map((f) => ({ ...f, name: "a\n#define EVIL 1" })) } : d + ), + }; + expectErrorMessages(await generateSharedC(poisonField, 8), ["invalid C identifier", "a"]); + const events = modelFromTd("union Event { Count { value: Int } }"); + const poisonVariant = { + ...events, + decls: events.decls.map((d) => + d.kind === "union" ? { ...d, variants: d.variants.map((v) => ({ ...v, name: "Count)" })) } : d + ), + }; + expectErrorMessages(await generateSharedC(poisonVariant, 8), ["invalid C identifier", "Count)"]); + }); + + it("rejects colliding C symbols and emits selected declarations with the complete fingerprint", async () => { + const collision = modelFromTd("type A_B { c: Int }\ntype A { B_c: Int }"); + expectErrorMessages(await generateSharedC(collision, 8), ["C symbol collision"]); + const model = modelFromTd(schema); + const selected = unwrap(await generateSharedC(model, 8, ["Owner", "Lease"])); + expect(selected).toContain("TD_SHARED_STORAGE(Owner,"); + expect(selected).toContain("TD_SHARED_STORAGE(Lease,"); + expect(selected).not.toContain("TD_SHARED_STORAGE(Node,"); + expect(selected).toContain(unwrap(await generateSharedLayout(model, 8)).fingerprint); + expectErrorMessages(await generateSharedC(model, 8, ["Missing"]), ["unknown declaration"]); + const solo = modelFromTd("type Solo { a: Int }"); + const newline = { ...solo, decls: solo.decls.map((d) => ({ ...d, name: d.name + "\n" })) }; + expectErrorMessages(await generateSharedC(newline, 8), ["invalid C identifier"]); + }); +}); diff --git a/src/typediagram/test/converters/swift.test.ts b/src/typediagram/test/converters/swift.test.ts new file mode 100644 index 0000000..fa01b3f --- /dev/null +++ b/src/typediagram/test/converters/swift.test.ts @@ -0,0 +1,37 @@ +import { describe, expect, it } from "vitest"; +import { generateSwiftModule } from "../../src/converters/swift.js"; +import { modelFromTd, unwrap } from "./helpers.js"; + +// [CONV-SWIFT] Logical native-host models; fixed ABI views are separate. +describe("Swift model generation", () => { + it("emits native fields, aliases, optional arrays and named enum payloads", () => { + expect(generateSwiftModule).toBeTypeOf("function"); + const source = unwrap( + generateSwiftModule( + modelFromTd(` + alias Id = Int + type Owner { id: Id appInstance: Uuid } + type Frame { owner: Owner label: String enabled: Bool weight: Float children: List selection: Option } + union Action { Empty {} Select { id: Id } Replace { frame: Frame } } + `) + ) + ); + expect(source).toContain("import Foundation"); + expect(source).toContain("public init(`id`: `Id`, `appInstance`: UUID)"); + expect(source).toContain("self.`appInstance` = `appInstance`"); + expect(source).toContain("public typealias `Id` = Int64"); + expect(source).toContain("public let `appInstance`: UUID"); + expect(source).toContain("public let `weight`: Double"); + expect(source).toContain("public let `children`: [`Owner`]"); + expect(source).toContain("public let `selection`: `Id`?"); + expect(source).toContain("case `Select`(`id`: `Id`)"); + expect(source).toContain("case `Empty`"); + expect(generateSwiftModule(modelFromTd("type Cycle { next: Option }"))).toMatchObject({ + ok: false, + }); + expect(generateSwiftModule(modelFromTd("type Generic { value: T }"))).toMatchObject({ ok: false }); + expect(generateSwiftModule(modelFromTd("type Bad { payload: Map }"))).toMatchObject({ + ok: false, + }); + }); +}); diff --git a/src/typediagram/test/converters/tdbin-locals.test.ts b/src/typediagram/test/converters/tdbin-locals.test.ts new file mode 100644 index 0000000..7fde757 --- /dev/null +++ b/src/typediagram/test/converters/tdbin-locals.test.ts @@ -0,0 +1,128 @@ +// [TDBIN-CODEGEN-LOCALS] Fields and variants named after the generated codecs' +// own identifiers must never shadow them. TypeScript codecs bind positional +// locals (`f0`, `f0Word`, …) so `value`/`writer`/`reader`/`at`/`tdbin`/`ok` and +// suffix pairs (`x` + `xPresent`) are safe; Rust decoders bind `f0`… so `r`/`at` +// survive, and column groups use `v0`/`f0` locals so `w`/`items`/`count`/`tags` +// survive. The committed `generated_names` crate module compiles and +// round-trips under `cargo test` (src/tdbin/tests/names.rs). +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { describe, expect, it } from "vitest"; +import { emitRustCodec } from "../../src/converters/rust-tdbin.js"; +import { emitTypeScriptCodec } from "../../src/converters/typescript-tdbin.js"; +import * as tdbin from "../../src/tdbin/index.js"; +import { codecFor, expectRustModuleReproduces, modelFromTd, unwrap } from "./helpers.js"; + +const NAMES_TD = readFileSync(fileURLToPath(new URL("fixtures/names.td", import.meta.url)), "utf8"); + +interface Inner { + readonly at: number; + readonly r: string; +} +type Pick = + | { readonly kind: "W"; readonly _0: Inner } + | { readonly kind: "Items"; readonly _0: Inner } + | { readonly kind: "Tags" } + | { readonly kind: "Count"; readonly _0: Inner }; +interface Names { + readonly value: string; + readonly writer: number; + readonly reader: number; + readonly tdbin: number; + readonly ok: boolean; + readonly w: number; + readonly at: number; + readonly r: number; + readonly count: number; + readonly i: boolean; + readonly items: Inner | undefined; + readonly rows: readonly Inner[]; + readonly tags: readonly string[]; + readonly x: number | undefined; + readonly xPresent: number | undefined; + readonly pick: Pick; +} + +const names = (seed: number): Names => ({ + value: `v${String(seed)}`, + writer: seed, + reader: 0 - seed, + tdbin: seed * 3, + ok: seed % 2 === 0, + w: seed + 1, + at: seed + 2, + r: seed + 3, + count: seed + 4, + i: seed % 2 === 1, + items: seed % 2 === 0 ? { at: seed, r: "items" } : undefined, + rows: [ + { at: 1, r: "a" }, + { at: seed, r: "b" }, + ], + tags: ["t", String(seed)], + x: seed, + xPresent: seed % 3 === 0 ? 0 - seed : undefined, + pick: [ + { kind: "W", _0: { at: seed, r: "w" } } as const, + { kind: "Items", _0: { at: seed, r: "it" } } as const, + { kind: "Tags" } as const, + { kind: "Count", _0: { at: seed, r: "c" } } as const, + ][seed % 4] ?? { kind: "Tags" }, +}); + +describe("[TDBIN-CODEGEN-LOCALS] codec locals never shadow params, imports, or each other", () => { + it("round-trips TypeScript codecs for colliding field names and pins positional locals", () => { + const source = unwrap(emitTypeScriptCodec(modelFromTd(NAMES_TD))); + const namesCodec = codecFor(source, "NamesCodec"); + const pickCodec = codecFor(source, "PickCodec"); + for (let seed = 0; seed < 8; seed++) { + const value = names(seed); + const bytes = unwrap(tdbin.encode(namesCodec, value)); + expect(unwrap(tdbin.decode(namesCodec, bytes))).toEqual(value); + expect(unwrap(tdbin.encode(namesCodec, unwrap(tdbin.decode(namesCodec, bytes))))).toEqual(bytes); + expect(unwrap(tdbin.decode(pickCodec, unwrap(tdbin.encode(pickCodec, value.pick))))).toEqual(value.pick); + } + expect(source).toContain("const f0 = tdbin.writer.string(writer, at, NamesCodec.dataWords, 0, value.value);"); + expect(source).toContain("const f3Bits = tdbin.scalar.i64Bits(value.tdbin);"); + expect(source).toContain("const f13Present = tdbin.writer.boolBit("); + expect(source).toContain("const f14Present = tdbin.writer.boolBit("); + expect(source).toContain('value: f0.value ?? ""'); + expect(source).toContain("xPresent: f14Present.value ? tdbin.scalar.i64From(f14Word.value) : undefined"); + expect(source).not.toContain("const value ="); + expect(source).not.toContain("const writer ="); + expect(source).not.toContain("const tdbin ="); + expect(source).not.toContain("const ok ="); + }); + + it("emits Rust struct and column-group codecs with positional locals at layouts 1 and 2", () => { + const model = modelFromTd(NAMES_TD); + const layout1 = unwrap(emitRustCodec(model)); + expect(layout1).toContain("let f5 = tdbin::scalar::i64_from(r.scalar(at, 4)?);"); + expect(layout1).toContain("w: f5, at: f6, r: f7, count: f8, i: f9"); + expect(layout1).toContain("let f13_present = r.bool_bit(at,"); + expect(layout1).toContain("let f14_present = r.bool_bit(at,"); + for (const shadow of ["let r =", "let at =", "let w =", "let count =", "let items", "let tags =", "let value ="]) { + expect(layout1).not.toContain(shadow); + } + const layout2 = unwrap(emitRustCodec(model, { layout: 2 })); + expect(layout2).toContain( + "let items_some: Vec<&Inner> = items.clone().filter_map(|row| row.items.as_ref()).collect();" + ); + expect(layout2).toContain("let v0: Vec<&Inner> = items.clone().filter_map(|row| match row {"); + expect(layout2).toContain("let v1_count = tags.iter().map(|tag| usize::from(*tag == 1)).sum::();"); + expect(layout2).toContain("0 => Self::W(v0.next().ok_or(tdbin::DecodeError::MalformedColumn)?),"); + expect(layout2).toContain("count: f8.get(i).copied().unwrap_or_default(),"); + for (const shadow of [ + "let r =", + "let at =", + "let w:", + "let mut count", + "let items:", + "let mut items", + "let mut rows =", + ]) { + expect(layout2.replaceAll("let mut rows = Vec::with_capacity(count);", "")).not.toContain(shadow); + } + expectRustModuleReproduces(NAMES_TD, "../../../../src/tdbin/tests/generated_names/mod.rs", { layout: 2 }); + }); +}); diff --git a/packages/typediagram/test/converters/typeref.test.ts b/src/typediagram/test/converters/typeref.test.ts similarity index 100% rename from packages/typediagram/test/converters/typeref.test.ts rename to src/typediagram/test/converters/typeref.test.ts diff --git a/src/typediagram/test/converters/typescript-tdbin.test.ts b/src/typediagram/test/converters/typescript-tdbin.test.ts new file mode 100644 index 0000000..abe4a52 --- /dev/null +++ b/src/typediagram/test/converters/typescript-tdbin.test.ts @@ -0,0 +1,795 @@ +// [CONV-TS-TDBIN] Pins the TypeScript TDBIN code generator: it emits typed +// StructCodec objects over the runtime in `src/tdbin`, with layout baked into +// the generated code ([TDBIN-FUTURE-TS], [TDBIN-REC-ALLOC]). +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { describe, expect, it } from "vitest"; +import { emitRustCodec } from "../../src/converters/rust-tdbin.js"; +import { emitTypeScriptCodec, generateTypeScriptModule } from "../../src/converters/typescript-tdbin.js"; +import { buildModel } from "../../src/model/index.js"; +import { parse } from "../../src/parser/index.js"; +import { ok } from "../../src/result.js"; +import type { Model } from "../../src/model/types.js"; +import * as tdbin from "../../src/tdbin/index.js"; +import { codecFor, expectErrorMessages, instantiateCodecs, unwrap } from "./helpers.js"; + +const PERSON_TD = `type Address { + street: String + zip: Int +} +type EmailContact { + addr: String +} +type PhoneContact { + number: Int + country: Int +} +union Contact { + Email(EmailContact) + Phone(PhoneContact) +} +type Person { + name: String + age: Int + active: Bool + score: Float + address: Option
+ nickname: Option + contact: Contact +}`; + +const modelFor = (td: string): Model => unwrap(buildModel(unwrap(parse(td)))); + +interface Sensor { + readonly id: number; +} + +interface Measurement { + readonly label: string; + readonly count: number; + readonly ratio: number; + readonly enabled: boolean; + readonly unit: string | undefined; + readonly sensor: Sensor; +} + +const MEASUREMENT_TD = `type Sensor { + id: Int +} +type Measurement { + label: String + count: Int + ratio: Float + enabled: Bool + unit: Option + sensor: Sensor +}`; + +type WriterSignal = { readonly kind: "Idle" } | { readonly kind: "Note"; readonly _0: string }; + +interface WriterPacket { + readonly name: string | undefined; + readonly data: Uint8Array | undefined; + readonly contact: WriterSignal | undefined; +} + +interface IdleInfo { + readonly reason: string; +} + +type ReaderSignal = { readonly kind: "Idle"; readonly _0: IdleInfo } | { readonly kind: "Note"; readonly _0: string }; + +interface ReaderPacket { + readonly name: string; + readonly data: Uint8Array; + readonly contact: ReaderSignal; +} + +// Same wire layout as NULL_READER_TD (ptr slots 0..2, union disc + 1 ptr slot), +// but every pointer field is optional so nulls can actually be written. +const NULL_WRITER_TD = `type Packet { + name: Option + data: Option + contact: Option +} +union Signal { + Idle + Note(String) +}`; + +const NULL_READER_TD = `type Packet { + name: String + data: Bytes + contact: Signal +} +union Signal { + Idle(IdleInfo) + Note(String) +} +type IdleInfo { + reason: String +}`; + +describe("[CONV-TS-TDBIN] TypeScript codec generator", () => { + it("preserves exact integers in generated records, optional fields and child defaults", () => { + const model = modelFor("type Counter { count: Int maybe: Option ratio: Float }\ntype Root { child: Counter }"); + const code = unwrap(emitTypeScriptCodec(model, { integerType: "bigint" })); + const codec = codecFor<{ count: bigint; maybe: bigint | undefined; ratio: number }>(code, "CounterCodec"); + for (const count of [-(1n << 63n), 9007199254740992n, 9007199254740993n, (1n << 63n) - 1n]) { + for (const maybe of [undefined, 0n, count]) { + const value = { count, maybe, ratio: 1.25 }; + expect(tdbin.decode(codec, unwrap(tdbin.encode(codec, value)))).toEqual(ok(value)); + expect(tdbin.decodeAuto(codec, unwrap(tdbin.encodePackedFramed(codec, value, 7n)), 7n)).toEqual(ok(value)); + } + } + expect(tdbin.encode(codec, { count: 1n << 63n, maybe: undefined, ratio: 0 })).toMatchObject({ + ok: false, + error: { code: "LimitExceeded" }, + }); + const root = codecFor<{ child: { count: bigint; maybe: bigint | undefined; ratio: number } }>(code, "RootCodec"); + const nullChild = tdbin.scalar.wordsToBytes([1n << 48n, 0n]); + expect(tdbin.decode(root, nullChild)).toEqual(ok({ child: { count: 0n, maybe: undefined, ratio: 0 } })); + const moduleText = unwrap(generateTypeScriptModule(model, { integerType: "bigint" })); + expect(moduleText).toContain("count: bigint;"); + expect(moduleText).toContain("BigInt.asIntN(64, f0Word.value)"); + expect(moduleText).toContain("count: 0n"); + const ordinary = codecFor<{ count: number; maybe: number | undefined; ratio: number }>( + unwrap(emitTypeScriptCodec(model)), + "CounterCodec" + ); + const value = { count: 42, maybe: 0, ratio: 1.25 }; + expect(unwrap(tdbin.encode(ordinary, value))).toEqual( + unwrap(tdbin.encode(codec, { ...value, count: 42n, maybe: 0n })) + ); + }); + + it("emits slot-addressed record codecs over the TypeScript runtime", () => { + const code = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); + expect(code).toContain("export const PersonCodec: tdbin.StructCodec"); + expect(code).toContain("dataWords: 3"); + expect(code).toContain("ptrWords: 4"); + expect(code).toContain("tdbin.writer.string(writer, at, PersonCodec.dataWords, 0, value.name)"); + expect(code).toContain("const f1Bits = tdbin.scalar.i64Bits(value.age);"); + expect(code).toContain("if (!f1.ok) return f1;"); + expect(code).toContain("tdbin.writer.boolBit(writer, at, 1, 0, value.active)"); + expect(code).toContain( + "tdbin.writer.child(writer, at, PersonCodec.dataWords, 1, AddressCodec, value.address ?? null)" + ); + expect(code).toContain("const f3Word = tdbin.reader.scalar(reader, at, 2);"); + expect(code).toContain("age: tdbin.scalar.i64From(f1Word.value)"); + expect(code).toContain("address: f4.value ?? undefined"); + expect(code).toContain('name: f0.value ?? ""'); + expect(code).toContain("contact: f6.value ?? defaultContact()"); + expect(code).not.toContain('tdbin.readerError("UnexpectedNull")'); + }); + + it("emits union discriminant arms and null-payload defaults", () => { + const code = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); + expect(code).toContain("export const ContactCodec: tdbin.StructCodec"); + expect(code).toContain('case "Email": {'); + expect(code).toContain("const disc = tdbin.writer.scalar(writer, at, 0, 0n);"); + expect(code).toContain("tdbin.writer.child(writer, at, ContactCodec.dataWords, 0, EmailContactCodec, value._0)"); + expect(code).toContain("case 1n: {"); + expect(code).toContain('return ok({ kind: "Phone", _0: payload.value ?? defaultPhoneContact() });'); + expect(code).toContain('return tdbin.readerError("UnknownVariant", { ordinal: ordinal.value });'); + }); + + it("generates a self-contained module with type declarations and runtime imports", () => { + const moduleText = unwrap(generateTypeScriptModule(modelFor(PERSON_TD))); + expect(moduleText).toContain('import * as tdbin from "typediagram-core/tdbin";'); + expect(moduleText).toContain('import { ok } from "typediagram-core/tdbin";'); + expect(moduleText).not.toContain('from "typediagram-core";'); + expect(moduleText).toContain("export interface Person"); + expect(moduleText).toContain('export type Contact =\n | { kind: "Email"; _0: EmailContact }'); + expect(moduleText).toContain("const defaultContact = "); + expect(moduleText).toContain("export const PersonCodec"); + }); + + it("rejects unsupported shapes loudly", () => { + const result = emitTypeScriptCodec(modelFor("type R {\n items: Map\n}")); + expectErrorMessages(result, ["unsupported field type 'Map'"]); + const moduleResult = generateTypeScriptModule(modelFor("type R {\n items: List>\n}")); + expectErrorMessages(moduleResult, ["unsupported field type 'List>'"]); + const semantic = emitTypeScriptCodec(modelFor("type R {\n at: List\n}")); + expectErrorMessages(semantic, ["unsupported field type 'List'"]); + }); + + it("emits bytes, optional bytes, bare variants, and string-payload variants", () => { + const code = unwrap( + emitTypeScriptCodec( + modelFor(`type Blob { + raw: Bytes + maybe: Option +} +union Notice { + Empty + Text(String) +}`) + ) + ); + expect(code).toContain("tdbin.writer.bytes(writer, at, BlobCodec.dataWords, 0, value.raw)"); + expect(code).toContain("tdbin.writer.bytes(writer, at, BlobCodec.dataWords, 1, value.maybe ?? null)"); + expect(code).toContain("raw: f0.value ?? new Uint8Array(0)"); + expect(code).toContain("maybe: f1.value ?? undefined"); + expect(code).toContain("const inactive = tdbin.reader.requireNullPointer(reader, at, 0);"); + expect(code).toContain('return inactive.ok ? ok({ kind: "Empty" }) : inactive;'); + expect(code).toContain("tdbin.writer.string(writer, at, NoticeCodec.dataWords, 0, value._0)"); + expect(code).toContain("tdbin.reader.string(reader, at, NoticeCodec.dataWords, 0)"); + expect(code).toContain('return ok({ kind: "Text", _0: payload.value ?? "" });'); + }); + + it("rejects unsupported generic and variant shapes", () => { + const generic = emitTypeScriptCodec(modelFor("type Box {\n value: T\n}")); + const multi = emitTypeScriptCodec( + modelFor("union Bad {\n Both(Int, String)\n Map {\n m: Map\n }\n}") + ); + const payload = emitTypeScriptCodec(modelFor("union Bad {\n Count(Int)\n}")); + expect(generic.ok ? "" : generic.error[0]?.message).toContain("must be monomorphized"); + expect(multi.ok ? "" : multi.error[0]?.message).toContain( + "unsupported field type 'Map' in BadMapTdbinPayload.m" + ); + expect(payload.ok ? "" : payload.error[0]?.message).toContain("payload 'Int' unsupported"); + }); + + it("emits empty records using the runtime's non-null zero-size marker", () => { + const code = unwrap(emitTypeScriptCodec(modelFor("alias Id = String\ntype Empty {}"))); + expect(code).toContain("export const EmptyCodec"); + expect(code).toContain("dataWords: 0"); + expect(code).toContain("ptrWords: 0"); + expect(code).not.toContain("IdCodec"); + }); + + it("decodes required null pointers to per-type schema defaults [TDBIN-PTR-NULL]", () => { + const person = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); + expect(person).toContain('const defaultEmailContact = (): EmailContact => ({ addr: "" });'); + expect(person).toContain("const defaultPhoneContact = (): PhoneContact => ({ number: 0, country: 0 });"); + expect(person).toContain('const defaultContact = (): Contact => ({ kind: "Email", _0: defaultEmailContact() });'); + expect(person).not.toContain("const defaultAddress"); + expect(person).not.toContain("const defaultPerson"); + expect(person.indexOf("const defaultEmailContact")).toBeLessThan(person.indexOf("export const AddressCodec")); + const chain = unwrap( + emitTypeScriptCodec( + modelFor("type Leaf {\n tag: String\n}\ntype Mid {\n leaf: Leaf\n}\ntype Root {\n mid: Mid\n}") + ) + ); + expect(chain).toContain('const defaultLeaf = (): Leaf => ({ tag: "" });'); + expect(chain).toContain("const defaultMid = (): Mid => ({ leaf: defaultLeaf() });"); + expect(chain).toContain("mid: f0.value ?? defaultMid()"); + const blob = unwrap( + emitTypeScriptCodec( + modelFor( + "type Blob {\n raw: Bytes\n flag: Bool\n ratio: Float\n maybe: Option\n}\ntype Wrap {\n blob: Blob\n}" + ) + ) + ); + expect(blob).toContain( + "const defaultBlob = (): Blob => ({ raw: new Uint8Array(0), flag: false, ratio: 0, maybe: undefined });" + ); + expect(blob).toContain("blob: f0.value ?? defaultBlob()"); + const emptyRec = unwrap(emitTypeScriptCodec(modelFor("type Empty {}\ntype Holder {\n e: Empty\n}"))); + expect(emptyRec).toContain("const defaultEmpty = (): Empty => ({});"); + expect(emptyRec).toContain("e: f0.value ?? defaultEmpty()"); + const bareFirst = unwrap( + emitTypeScriptCodec(modelFor("union Notice {\n Empty\n Text(String)\n}\ntype Holder {\n notice: Notice\n}")) + ); + expect(bareFirst).toContain('const defaultNotice = (): Notice => ({ kind: "Empty" });'); + expect(bareFirst).toContain("notice: f0.value ?? defaultNotice()"); + const stringFirst = unwrap( + emitTypeScriptCodec(modelFor("union Label {\n Text(String)\n}\ntype Tag {\n label: Label\n}")) + ); + expect(stringFirst).toContain('const defaultLabel = (): Label => ({ kind: "Text", _0: "" });'); + }); + + it("rejects defaults that cannot terminate: recursive and empty-union required fields", () => { + const selfRecursive = emitTypeScriptCodec(modelFor("type Node {\n next: Node\n}")); + expect(selfRecursive.ok).toBe(false); + expect(selfRecursive.ok ? "" : selfRecursive.error[0]?.message).toContain( + "cannot derive [TDBIN-PTR-NULL] default for recursive type 'Node' (Node -> Node)" + ); + const mutual = emitTypeScriptCodec(modelFor("union Tree {\n Node(Branch)\n}\ntype Branch {\n left: Tree\n}")); + expect(mutual.ok).toBe(false); + expect(mutual.ok ? "" : mutual.error[0]?.message).toContain("recursive type 'Tree' (Tree -> Branch -> Tree)"); + const optionBreaksCycle = unwrap( + emitTypeScriptCodec( + modelFor("type Node {\n next: Option\n label: Node2\n}\ntype Node2 {\n tag: String\n}") + ) + ); + expect(optionBreaksCycle).toContain('const defaultNode2 = (): Node2 => ({ tag: "" });'); + expect(optionBreaksCycle).not.toContain("const defaultNode = "); + const emptyUnion = emitTypeScriptCodec(modelFor("union Never {}\ntype Holder {\n n: Never\n}")); + expect(emptyUnion.ok).toBe(false); + expect(emptyUnion.ok ? "" : emptyUnion.error[0]?.message).toContain( + "union 'Never' has no variants; cannot derive its [TDBIN-PTR-NULL] default" + ); + }); + + it("emits 1-bit presence flags plus natural-width value slots for Option [TDBIN-PRIM-OPTION]", () => { + const code = unwrap( + emitTypeScriptCodec( + modelFor( + "type Reading {\n label: String\n count: Option\n flagged: Option\n ratio: Option\n}" + ) + ) + ); + // Bitset word 0: count-presence bit 0, flagged-presence bit 1, + // flagged-VALUE bit 2, ratio-presence bit 3; count value w1, ratio w2. + expect(code).toContain("dataWords: 3"); + expect(code).toContain("tdbin.writer.boolBit(writer, at, 0, 0, value.count !== undefined)"); + expect(code).toContain("const f1Bits = tdbin.scalar.i64Bits(value.count ?? 0);"); + expect(code).toContain("const f1 = tdbin.writer.scalar(writer, at, 1, f1Bits.value);"); + expect(code).toContain("tdbin.writer.boolBit(writer, at, 0, 1, value.flagged !== undefined)"); + expect(code).toContain("const f2 = tdbin.writer.boolBit(writer, at, 0, 2, value.flagged ?? false);"); + expect(code).toContain("tdbin.writer.boolBit(writer, at, 0, 3, value.ratio !== undefined)"); + expect(code).toContain("const f3 = tdbin.writer.scalar(writer, at, 2, tdbin.scalar.f64Bits(value.ratio ?? 0));"); + expect(code).toContain("const f1Present = tdbin.reader.boolBit(reader, at, 0, 0);"); + expect(code).toContain("const f1Word = tdbin.reader.scalar(reader, at, 1);"); + expect(code).toContain("count: f1Present.value ? tdbin.scalar.i64From(f1Word.value) : undefined"); + expect(code).toContain("const f2Value = tdbin.reader.boolBit(reader, at, 0, 2);"); + expect(code).toContain("flagged: f2Present.value ? f2Value.value : undefined"); + expect(code).toContain("ratio: f3Present.value ? tdbin.scalar.f64From(f3Word.value) : undefined"); + expect(code).toContain("if (!f1Present.ok) return f1Present;"); + }); + + it("bakes the SAME slot/bit numbers as the Rust emitter (cross-language layout parity)", () => { + // Mixed Bool and Option fields exercise the shared first-fit bit + // allocator: a w0.0, b presence w0.1 + value w1, c presence w0.2 + value + // w0.3, d w0.4, e presence w0.5 + value w2, f w3 -> 4 data words. + const PARITY_TD = + "type Mixed {\n a: Bool\n b: Option\n c: Option\n d: Bool\n e: Option\n f: Int\n}"; + const rust = unwrap(emitRustCodec(modelFor(PARITY_TD))); + const tsCode = unwrap(emitTypeScriptCodec(modelFor(PARITY_TD))); + expect(rust).toContain("const DATA_WORDS: u16 = 4;"); + expect(tsCode).toContain("dataWords: 4"); + expect(rust).toContain("w.bool_bit(at, 0, 0, self.a)?;"); + expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 0, value.a)"); + expect(rust).toContain("w.bool_bit(at, 0, 1, self.b.is_some())?;"); + expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 1, value.b !== undefined)"); + expect(rust).toContain("w.scalar(at, 1, self.b.map_or(0, tdbin::scalar::i64_bits))?;"); + expect(tsCode).toContain("tdbin.writer.scalar(writer, at, 1, f1Bits.value)"); + expect(rust).toContain("w.bool_bit(at, 0, 2, self.c.is_some())?;"); + expect(rust).toContain("w.bool_bit(at, 0, 3, self.c.unwrap_or_default())?;"); + expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 2, value.c !== undefined)"); + expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 3, value.c ?? false)"); + expect(rust).toContain("w.bool_bit(at, 0, 4, self.d)?;"); + expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 4, value.d)"); + expect(rust).toContain("w.bool_bit(at, 0, 5, self.e.is_some())?;"); + expect(rust).toContain("w.scalar(at, 2, self.e.map_or(0, tdbin::scalar::f64_bits))?;"); + expect(tsCode).toContain("tdbin.writer.boolBit(writer, at, 0, 5, value.e !== undefined)"); + expect(tsCode).toContain("tdbin.writer.scalar(writer, at, 2, tdbin.scalar.f64Bits(value.e ?? 0))"); + expect(rust).toContain("w.scalar(at, 3, tdbin::scalar::i64_bits(self.f))?;"); + expect(tsCode).toContain("const f5 = tdbin.writer.scalar(writer, at, 3, f5Bits.value);"); + }); + + it("executes generated Option codecs: present and absent round-trips [TDBIN-PRIM-OPTION]", () => { + interface Reading { + readonly label: string; + readonly count: number | undefined; + readonly flagged: boolean | undefined; + readonly ratio: number | undefined; + } + const readingCodec = codecFor( + unwrap( + emitTypeScriptCodec( + modelFor( + "type Reading {\n label: String\n count: Option\n flagged: Option\n ratio: Option\n}" + ) + ) + ), + "ReadingCodec" + ); + const full: Reading = { label: "t", count: -5, flagged: true, ratio: 0.25 }; + expect(unwrap(tdbin.decode(readingCodec, unwrap(tdbin.encode(readingCodec, full))))).toEqual(full); + // A present-but-default value must stay Some (presence bit, not sentinel). + const zeroes: Reading = { label: "", count: 0, flagged: false, ratio: 0 }; + expect(unwrap(tdbin.decode(readingCodec, unwrap(tdbin.encode(readingCodec, zeroes))))).toEqual(zeroes); + const absent: Reading = { label: "n", count: undefined, flagged: undefined, ratio: undefined }; + expect(unwrap(tdbin.decode(readingCodec, unwrap(tdbin.encode(readingCodec, absent))))).toEqual(absent); + const encodedFull = unwrap(tdbin.encode(readingCodec, full)); + const encodedAbsent = unwrap(tdbin.encode(readingCodec, absent)); + expect(Buffer.from(encodedFull).equals(Buffer.from(encodedAbsent))).toBe(false); + }); + + it("executes generated codecs: scalar writes, round-trips, and null-to-default decodes [TDBIN-PTR-NULL]", () => { + const measurementCodec = codecFor( + unwrap(emitTypeScriptCodec(modelFor(MEASUREMENT_TD))), + "MeasurementCodec" + ); + const full: Measurement = { label: "temp", count: -42, ratio: 2.5, enabled: true, unit: "C", sensor: { id: 7 } }; + expect(unwrap(tdbin.decode(measurementCodec, unwrap(tdbin.encode(measurementCodec, full))))).toEqual(full); + const sparse: Measurement = { + label: "", + count: Number.MAX_SAFE_INTEGER, + ratio: -0.125, + enabled: false, + unit: undefined, + sensor: { id: 0 }, + }; + expect(unwrap(tdbin.decode(measurementCodec, unwrap(tdbin.encode(measurementCodec, sparse))))).toEqual(sparse); + const writerCodec = codecFor(unwrap(emitTypeScriptCodec(modelFor(NULL_WRITER_TD))), "PacketCodec"); + const readerCodec = codecFor(unwrap(emitTypeScriptCodec(modelFor(NULL_READER_TD))), "PacketCodec"); + const nulls = unwrap(tdbin.encode(writerCodec, { name: undefined, data: undefined, contact: undefined })); + expect(unwrap(tdbin.decode(readerCodec, nulls))).toEqual({ + name: "", + data: new Uint8Array(0), + contact: { kind: "Idle", _0: { reason: "" } }, + }); + const bareArm = unwrap( + tdbin.encode(writerCodec, { name: "ping", data: new Uint8Array([9, 8]), contact: { kind: "Idle" } }) + ); + expect(unwrap(tdbin.decode(readerCodec, bareArm))).toEqual({ + name: "ping", + data: new Uint8Array([9, 8]), + contact: { kind: "Idle", _0: { reason: "" } }, + }); + const present = unwrap( + tdbin.encode(writerCodec, { name: "n", data: new Uint8Array([1]), contact: { kind: "Note", _0: "hi" } }) + ); + expect(unwrap(tdbin.decode(readerCodec, present))).toEqual({ + name: "n", + data: new Uint8Array([1]), + contact: { kind: "Note", _0: "hi" }, + }); + }); + + it("pins Rust-identical layout hashes and guards framed + base64 decodes [TDBIN-SCHEMA-HASH] [TDBIN-FRAME-BASE64]", () => { + interface Person { + readonly name: string; + readonly age: number; + readonly active: boolean; + readonly score: number; + readonly address: { readonly street: string; readonly zip: number } | undefined; + readonly nickname: string | undefined; + readonly contact: { readonly kind: "Email"; readonly _0: { readonly addr: string } }; + } + const tsSource = unwrap(emitTypeScriptCodec(modelFor(PERSON_TD))); + const rust = unwrap(emitRustCodec(modelFor(PERSON_TD))); + const codecs = instantiateCodecs(tsSource); + const rustHashes = rust + .split("\n") + .filter((line) => line.includes("const LAYOUT_HASH: u64 = ")) + .map((line) => BigInt(line.slice(line.indexOf("0x"), line.lastIndexOf(";")).replaceAll("_", ""))); + const tsHashes = ["Address", "EmailContact", "PhoneContact", "Contact", "Person"].map( + (name) => codecFor(tsSource, `${name}Codec`).layoutHash + ); + expect(rustHashes).toHaveLength(5); + expect(tsHashes).toEqual(rustHashes); + expect(new Set(tsHashes).size).toBe(5); + expect(tsHashes.every((hash) => hash !== undefined && hash !== 0n)).toBe(true); + expect(Object.keys(codecs)).toContain("PersonCodec"); + const personCodec = codecFor(tsSource, "PersonCodec"); + const pinned = personCodec.layoutHash ?? 0n; + const person: Person = { + name: "Ada", + age: -9_007_199_254_740_991, + active: true, + score: 1.5, + address: { street: "1 Loop", zip: 3000 }, + nickname: undefined, + contact: { kind: "Email", _0: { addr: "a@b.c" } }, + }; + const framed = unwrap(tdbin.encodeFramed(personCodec, person)); + expect(unwrap(tdbin.frame.decodeFrame(framed)).schemaHash).toBe(pinned); + expect(unwrap(tdbin.decodeFramed(personCodec, framed))).toEqual(person); + expect(unwrap(tdbin.decodeAuto(personCodec, framed))).toEqual(person); + const packed = unwrap(tdbin.encodePackedFramed(personCodec, person)); + expect(unwrap(tdbin.frame.decodeFrame(packed)).packed).toBe(true); + expect(unwrap(tdbin.decodeFramed(personCodec, packed))).toEqual(person); + const wrongHash = unwrap(tdbin.encodeFramed(personCodec, person, pinned ^ 1n)); + const mismatch = tdbin.decodeFramed(personCodec, wrongHash); + expect(mismatch.ok ? null : mismatch.error).toMatchObject({ + code: "HashMismatch", + expectedHash: pinned, + gotHash: pinned ^ 1n, + }); + expect(tdbin.decodeAuto(personCodec, wrongHash).ok).toBe(false); + const hashless = unwrap(tdbin.encodeFramed(personCodec, person, null)); + const missing = tdbin.decodeFramed(personCodec, hashless); + expect(missing.ok ? null : missing.error).toMatchObject({ code: "HashMismatch", gotHash: null }); + expect(unwrap(tdbin.decodeAuto(personCodec, hashless))).toEqual(person); + expect(unwrap(tdbin.decodeFramed(personCodec, hashless, null))).toEqual(person); + expect(unwrap(tdbin.decodeAuto(personCodec, unwrap(tdbin.encode(personCodec, person))))).toEqual(person); + const text = unwrap(tdbin.encodeFramedBase64(personCodec, person)); + expect(text).toBe(tdbin.toBase64(packed)); + expect(Buffer.from(text, "base64").equals(Buffer.from(packed))).toBe(true); + expect(unwrap(tdbin.decodeFramedBase64(personCodec, text))).toEqual(person); + const errorCode = (result: { ok: boolean; error?: { code: string } }) => result.error?.code; + expect(errorCode(tdbin.decodeFramedBase64(personCodec, "not base64!"))).toBe("BadBase64"); + expect(errorCode(tdbin.decodeFramedBase64(personCodec, Buffer.from("XXXX0000000000").toString("base64")))).toBe( + "BadMagic" + ); + expect(errorCode(tdbin.decodeFramedBase64(personCodec, tdbin.toBase64(wrongHash)))).toBe("HashMismatch"); + expect(errorCode(tdbin.decodeFramedBase64(personCodec, ""))).toBe("LengthMismatch"); + const big = new Uint8Array(70_000).map((_, index) => index % 251); + expect(Buffer.from(unwrap(tdbin.fromBase64(tdbin.toBase64(big)))).equals(Buffer.from(big))).toBe(true); + expect(tdbin.toBase64(big)).toBe(Buffer.from(big).toString("base64")); + }); + + it("round-trips struct-form and multi-field tuple union variants with Rust-identical hashes [TDBIN-UNION-STRUCT] #61", () => { + type Point = { readonly x: number; readonly y: number }; + type Shape = + | { readonly kind: "Circle"; readonly radius: number; readonly label: string } + | { readonly kind: "Rect"; readonly w: number; readonly h: number; readonly corner: Point } + | { readonly kind: "Pair"; readonly _0: number; readonly _1: string } + | { readonly kind: "Tagged"; readonly _0: Point } + | { readonly kind: "Empty" }; + interface Canvas { + readonly name: string; + readonly shape: Shape; + readonly backup: Shape | undefined; + } + const td = readFileSync(fileURLToPath(new URL("./fixtures/shapes.td", import.meta.url)), "utf8"); + const tsSource = unwrap(emitTypeScriptCodec(modelFor(td))); + const rust = unwrap(emitRustCodec(modelFor(td))); + const canvasCodec = codecFor(tsSource, "CanvasCodec"); + const shapeCodec = codecFor(tsSource, "ShapeCodec"); + expect(shapeCodec.ptrWords).toBe(1); + const rustHash = (type: string) => { + const block = rust.slice(rust.indexOf(`impl tdbin::Struct for ${type} {`)); + const line = block.slice( + block.indexOf("LAYOUT_HASH: u64 = ") + 19, + block.indexOf(";", block.indexOf("LAYOUT_HASH")) + ); + return BigInt(line.replaceAll("_", "")); + }; + expect(canvasCodec.layoutHash).toBe(rustHash("Canvas")); + expect(shapeCodec.layoutHash).toBe(rustHash("Shape")); + expect(rust).toContain("Self::Rect { w: f0, h: f1, corner: f2 } => {"); + expect(rust).toContain("Self::Pair(f0, f1) => {"); + const shapes: Shape[] = [ + { kind: "Circle", radius: 2.5, label: "sun" }, + { kind: "Rect", w: -1, h: 1e9, corner: { x: 0.5, y: -0.5 } }, + { kind: "Pair", _0: -9_007_199_254_740_991, _1: "pair" }, + { kind: "Tagged", _0: { x: 3, y: 4 } }, + { kind: "Empty" }, + ]; + for (const shape of shapes) { + for (const backup of [undefined, ...shapes]) { + const canvas: Canvas = { name: shape.kind, shape, backup }; + expect(unwrap(tdbin.decode(canvasCodec, unwrap(tdbin.encode(canvasCodec, canvas))))).toEqual(canvas); + expect( + unwrap(tdbin.decodeFramedBase64(canvasCodec, unwrap(tdbin.encodeFramedBase64(canvasCodec, canvas)))) + ).toEqual(canvas); + } + expect(unwrap(tdbin.decode(shapeCodec, unwrap(tdbin.encode(shapeCodec, shape))))).toEqual(shape); + } + const zeroCircle = unwrap(tdbin.encode(shapeCodec, { kind: "Circle", radius: 0, label: "" })); + const zeroRect = unwrap(tdbin.encode(shapeCodec, { kind: "Rect", w: 0, h: 0, corner: { x: 0, y: 0 } })); + expect(Buffer.from(zeroCircle).equals(Buffer.from(zeroRect))).toBe(false); + const NULL_SHAPE_TD = + "type Canvas {\n name: String\n shape: Option\n backup: Option\n}\ntype Point {\n x: Float\n y: Float\n}"; + const nullWriter = codecFor<{ name: string; shape: undefined; backup: undefined }>( + unwrap(emitTypeScriptCodec(modelFor(NULL_SHAPE_TD))), + "CanvasCodec" + ); + const nulls = unwrap(tdbin.encode(nullWriter, { name: "n", shape: undefined, backup: undefined })); + expect(unwrap(tdbin.decode(canvasCodec, nulls))).toEqual({ + name: "n", + shape: { kind: "Circle", radius: 0, label: "" }, + backup: undefined, + }); + }); + + it("round-trips every List form and Option> with Rust-identical hashes [TDBIN-TS-LIST] #62", () => { + const td = `union Level { + Low + High +} +type Tag { + key: String + weight: Float +} +type Report { + flags: List + counts: List + ratios: List + names: List + blobs: List + tags: List + levels: List + maybeCounts: Option> + maybeTags: Option> + maybeLevels: Option> + title: String +}`; + type Level = { readonly kind: "Low" } | { readonly kind: "High" }; + interface Report { + readonly flags: boolean[]; + readonly counts: number[]; + readonly ratios: number[]; + readonly names: string[]; + readonly blobs: Uint8Array[]; + readonly tags: { readonly key: string; readonly weight: number }[]; + readonly levels: Level[]; + readonly maybeCounts: number[] | undefined; + readonly maybeTags: { readonly key: string; readonly weight: number }[] | undefined; + readonly maybeLevels: Level[] | undefined; + readonly title: string; + } + const tsSource = unwrap(emitTypeScriptCodec(modelFor(td))); + const rust = unwrap(emitRustCodec(modelFor(td))); + const reportCodec = codecFor(tsSource, "ReportCodec"); + const rustBlock = rust.slice(rust.indexOf("impl tdbin::Struct for Report {")); + const rustHash = BigInt( + rustBlock + .slice(rustBlock.indexOf("LAYOUT_HASH: u64 = ") + 19, rustBlock.indexOf(";", rustBlock.indexOf("LAYOUT_HASH"))) + .replaceAll("_", "") + ); + expect(reportCodec.layoutHash).toBe(rustHash); + expect(reportCodec.ptrWords).toBe(11); + expect(reportCodec.dataWords).toBe(0); + const full: Report = { + flags: [true, false, true, true, false, false, false, false, true], + counts: [0, -1, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER], + ratios: [0.5, -0, Number.POSITIVE_INFINITY, 1e-300], + names: ["", "α", "two words"], + blobs: [new Uint8Array([]), new Uint8Array([0, 255, 7])], + tags: [ + { key: "a", weight: 1.5 }, + { key: "", weight: -2 }, + ], + levels: [{ kind: "High" }, { kind: "Low" }, { kind: "High" }], + maybeCounts: [42], + maybeTags: [], + maybeLevels: [{ kind: "Low" }], + title: "full", + }; + expect(unwrap(tdbin.decode(reportCodec, unwrap(tdbin.encode(reportCodec, full))))).toEqual(full); + const empty: Report = { + flags: [], + counts: [], + ratios: [], + names: [], + blobs: [], + tags: [], + levels: [], + maybeCounts: undefined, + maybeTags: undefined, + maybeLevels: undefined, + title: "", + }; + expect(unwrap(tdbin.decode(reportCodec, unwrap(tdbin.encode(reportCodec, empty))))).toEqual(empty); + expect(unwrap(tdbin.decodeFramedBase64(reportCodec, unwrap(tdbin.encodeFramedBase64(reportCodec, full))))).toEqual( + full + ); + const tooBig = tdbin.encode(reportCodec, { ...full, counts: [2 ** 60] }); + expect(tooBig.ok ? "" : tooBig.error.code).toBe("LimitExceeded"); + const shortWriter = codecFor>( + unwrap(emitTypeScriptCodec(modelFor("type Report {\n}"))), + "ReportCodec" + ); + expect(unwrap(tdbin.decode(reportCodec, unwrap(tdbin.encode(shortWriter, {}))))).toEqual({ + ...empty, + title: "", + }); + const bigSource = unwrap(emitTypeScriptCodec(modelFor(td), { integerType: "bigint" })); + const bigCodec = codecFor<{ counts: bigint[] }>(bigSource, "ReportCodec"); + const huge = { ...full, counts: [-(2n ** 63n), 2n ** 63n - 1n], maybeCounts: [0n] }; + expect(unwrap(tdbin.decode(bigCodec, unwrap(tdbin.encode(bigCodec, huge))))).toEqual(huge); + const rawLevels = td.replace("levels: List", "levels: Bytes"); + const rawCodec = codecFor( + unwrap(emitTypeScriptCodec(modelFor(rawLevels))), + "ReportCodec" + ); + const unknown = tdbin.decode( + reportCodec, + unwrap(tdbin.encode(rawCodec, { ...full, levels: new Uint8Array([1, 9]) })) + ); + expect(unknown.ok ? null : unknown.error).toMatchObject({ code: "UnknownVariant", ordinal: 9n }); + const known = tdbin.decode( + reportCodec, + unwrap(tdbin.encode(rawCodec, { ...full, levels: new Uint8Array([1, 0]) })) + ); + expect(unwrap(known).levels).toEqual([{ kind: "High" }, { kind: "Low" }]); + }); + + it("reproduces the Rust golden bytes for every List form byte for byte [TDBIN-TS-LIST] [TDBIN-TEST-GOLDEN] #85", () => { + const fixture = (rel: string) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), "utf8"); + const golden = fixture("../../../../src/tdbin/tests/golden/report_lists.hex").trim(); + const codec = codecFor>( + unwrap(emitTypeScriptCodec(modelFor(fixture("./fixtures/reports.td")), { integerType: "bigint" })), + "ReportCodec" + ); + const value = { + flags: [true, false, true, true, false, false, false, false, true], + counts: [0n, -1n, 2n ** 63n - 1n, -(2n ** 63n)], + ratios: [0.5, -0, Number.POSITIVE_INFINITY, 1e-300], + names: ["", "α", "two words"], + blobs: [new Uint8Array([]), new Uint8Array([0, 255, 7])], + tags: [ + { key: "a", weight: 1.5 }, + { key: "", weight: -2 }, + ], + levels: [{ kind: "High" }, { kind: "Low" }, { kind: "High" }], + maybeCounts: [42n], + maybeTags: [], + maybeLevels: undefined, + title: "golden", + }; + const bytes = unwrap(tdbin.encodePackedFramed(codec, value)); + expect(tdbin.toHex(bytes)).toBe(golden); + expect(unwrap(tdbin.decodeFramed(codec, unwrap(tdbin.fromHex(golden))))).toEqual(value); + expect(unwrap(tdbin.frame.decodeFrame(bytes)).schemaHash).toBe(codec.layoutHash); + }); + + it("encodes width-refined integers and Path with range checks and Rust-identical bytes [TDBIN-WIDTH-RANGE] #85", () => { + const fixture = (rel: string) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), "utf8"); + const td = fixture("./fixtures/widths.td"); + const tsSource = unwrap(emitTypeScriptCodec(modelFor(td))); + const rust = unwrap(emitRustCodec(modelFor(td))); + const statsCodec = codecFor>(tsSource, "StatsCodec"); + const rawCodec = codecFor>(tsSource, "StatsRawCodec"); + const rustHash = (type: string) => { + const block = rust.slice(rust.indexOf(`impl tdbin::Struct for ${type} {`)); + const start = block.indexOf("LAYOUT_HASH: u64 = ") + 19; + return BigInt(block.slice(start, block.indexOf(";", start)).replaceAll("_", "")); + }; + expect(statsCodec.layoutHash).toBe(rustHash("Stats")); + expect(rawCodec.layoutHash).toBe(rustHash("StatsRaw")); + const golden = fixture("../../../../src/tdbin/tests/golden/widths.hex").trim(); + const value = { + delta: -(2 ** 31), + flags: 255, + port: 65535, + hits: 2 ** 32 - 1, + hash: 2n ** 64n - 1n, + count: Number.MAX_SAFE_INTEGER, + file: "/tmp/α/report.json", + maybeHash: 0n, + maybePort: undefined, + maybeFile: "rel/path", + deltas: [-(2 ** 31), -1, 0, 2 ** 31 - 1], + bytes: [0, 1, 255], + ports: [0, 1, 65535], + hitsList: [2 ** 32 - 1, 7], + hashes: [2n ** 64n - 1n, 0n], + sizes: [Number.MAX_SAFE_INTEGER, 3], + files: ["a", "b/c"], + maybeSizes: [], + maybeFiles: undefined, + }; + const bytes = unwrap(tdbin.encodePackedFramed(statsCodec, value)); + expect(tdbin.toHex(bytes)).toBe(golden); + expect(unwrap(tdbin.decodeFramed(statsCodec, bytes))).toEqual(value); + const code = (r: { ok: boolean; error?: { code: string } }) => r.error?.code; + for (const bad of [ + { delta: 2 ** 31 }, + { delta: -(2 ** 31) - 1 }, + { flags: 256 }, + { flags: -1 }, + { port: 65536 }, + { hits: 2 ** 32 }, + { hits: 1.5 }, + { hash: -1n }, + { hash: 2n ** 64n }, + { count: -1 }, + { count: 2 ** 53 }, + { ports: [65536] }, + { deltas: [2 ** 31] }, + { bytes: [256] }, + { hashes: [-1n] }, + { sizes: [-1] }, + { maybePort: 70000 }, + ]) { + expect( + code(tdbin.encode(statsCodec, { ...value, ...bad })), + JSON.stringify(bad, (_k, v: unknown) => (typeof v === "bigint" ? String(v) : v)) + ).toBe("ValueOutOfRange"); + } + const raw = { delta: 0n, flags: 0n, port: 0n, hits: 0n, hash: 0n, count: 0n }; + for (const over of [ + { delta: 2n ** 31n }, + { flags: 256n }, + { port: 65536n }, + { hits: 2n ** 32n }, + { count: 2n ** 53n }, + ]) { + expect(code(tdbin.decode(statsCodec, unwrap(tdbin.encode(rawCodec, { ...raw, ...over }))))).toBe( + "ValueOutOfRange" + ); + } + const inRange = unwrap( + tdbin.decode(statsCodec, unwrap(tdbin.encode(rawCodec, { ...raw, delta: -5n, port: 65535n }))) + ); + expect([inRange.delta, inRange.port, inRange.file, inRange.files]).toEqual([-5, 65535, "", []]); + }); +}); diff --git a/packages/typediagram/test/converters/typescript.test.ts b/src/typediagram/test/converters/typescript.test.ts similarity index 91% rename from packages/typediagram/test/converters/typescript.test.ts rename to src/typediagram/test/converters/typescript.test.ts index 32a1129..b5c73b9 100644 --- a/packages/typediagram/test/converters/typescript.test.ts +++ b/src/typediagram/test/converters/typescript.test.ts @@ -6,6 +6,7 @@ import { expectLosslessRoundTrip, findDecl, modelFromSource, + modelFromTd, recordFields, toSourceFromTd, unionVariants, @@ -418,3 +419,36 @@ describe("[CONV-TS-RT] TypeScript round-trip TD -> TS -> TD", () => { expectLosslessRoundTrip(typescript); }); }); + +describe("[CONV-TS-EXACT-INTEGERS] bridge identity generation", () => { + it("preserves integer identity types across aliases, containers and union payloads", () => { + const model = modelFromTd(`typeDiagram +alias Sequence = Int +type Lease { serial: Int previous: Option samples: List values: Map elapsed: Float } +union Outcome { Accepted { sequence: Int } Empty {} } +untagged union Payload { Counter(Int) Pair(Int, Float) Named { serial: Int } } +`); + const output = typescript.toSource(model, { integerType: "bigint" }); + for (const fragment of [ + "export type Sequence = bigint;", + "serial: bigint", + "previous: bigint | undefined", + "samples: Array", + "values: Map", + "elapsed: number", + "sequence: bigint", + "| bigint", + "[bigint, number]", + ]) { + expect(output).toContain(fragment); + } + const roundTrip = modelFromSource(typescript, output); + expectFieldTypes(recordFields(roundTrip, "Lease"), { + serial: "Int", + previous: "Option", + samples: "List", + values: "Map", + }); + expect(typescript.toSource(model)).toContain("export type Sequence = number;"); + }); +}); diff --git a/packages/typediagram/test/converters/typeshed.test.ts b/src/typediagram/test/converters/typeshed.test.ts similarity index 100% rename from packages/typediagram/test/converters/typeshed.test.ts rename to src/typediagram/test/converters/typeshed.test.ts diff --git a/src/typediagram/test/converters/width-scalars.test.ts b/src/typediagram/test/converters/width-scalars.test.ts new file mode 100644 index 0000000..25e728b --- /dev/null +++ b/src/typediagram/test/converters/width-scalars.test.ts @@ -0,0 +1,102 @@ +// [MODEL-WIDTH] [TDBIN-FUTURE-WIDTH-TYPES] (#85) Width-refined integers and the +// Path scalar: every converter emits its closest native type, codegen +// validation accepts them, and Rust reads them back precisely. +import { describe, expect, it } from "vitest"; +import { byLanguage, rust } from "../../src/converters/index.js"; +import type { Language } from "../../src/converters/index.js"; +import { generateOspreyModule } from "../../src/converters/osprey.js"; +import { generateSwiftModule } from "../../src/converters/swift.js"; +import { buildModel, validateForCodegen } from "../../src/model/index.js"; +import { parse } from "../../src/parser/index.js"; +import { recordFields, unwrap } from "./helpers.js"; + +const WIDTH_TD = `type Stats { + delta: I32 + flags: U8 + port: U16 + hits: U32 + hash: U64 + count: Size + file: Path + maybeHash: Option + sizes: List + bytes: List +}`; + +const EXPECTED: Record = { + typescript: [ + "delta: number", + "flags: number", + "port: number", + "hits: number", + "hash: bigint", + "count: number", + "file: string", + "maybeHash: bigint | undefined", + "sizes: Array", + ], + python: ["delta: int", "hash: int", "count: int", "file: str", "sizes: list[int]"], + typeshed: ["delta: int", "hash: int", "file: str"], + rust: [ + "pub delta: i32,", + "pub flags: u8,", + "pub port: u16,", + "pub hits: u32,", + "pub hash: u64,", + "pub count: usize,", + "pub file: std::path::PathBuf,", + "pub maybe_hash: Option,", + "pub sizes: Vec,", + "pub bytes: Vec,", + ], + go: ["int32", "uint8", "uint16", "uint32", "uint64", "uint", "file string"], + csharp: ["int delta", "byte flags", "ushort port", "uint hits", "ulong hash", "ulong count", "string file"], + fsharp: [ + "delta: int", + "flags: byte", + "port: uint16", + "hits: uint32", + "hash: uint64", + "count: uint64", + "file: string", + ], + dart: ["final int delta;", "final int hash;", "final String file;"], + protobuf: ["int32 delta", "uint32 flags", "uint32 port", "uint32 hits", "uint64 hash", "uint64 count", "string file"], + php: ["int $delta", "int $hash", "string $file"], +}; + +describe("[MODEL-WIDTH] width-refined integers and Path across converters (#85)", () => { + it("validates, emits native types in every language, and imports Rust widths precisely", () => { + const model = unwrap(buildModel(unwrap(parse(WIDTH_TD)))); + for (const language of Object.keys(EXPECTED) as Language[]) { + expect(validateForCodegen(model, language)).toEqual([]); + const source = byLanguage[language].toSource(model); + for (const snippet of EXPECTED[language]) { + expect(source, `${language}: ${snippet}`).toContain(snippet); + } + expect(source).not.toMatch(/\bU64\b|\bU32\b|\bSize\b|\bPath\b/); + } + const swift = unwrap(generateSwiftModule(model)); + for (const snippet of ["Int32", "UInt8", "UInt16", "UInt32", "UInt64", "UInt", "String"]) { + expect(swift).toContain(snippet); + } + expect(unwrap(generateOspreyModule(model))).not.toContain("U64"); + const back = unwrap( + rust.fromSource( + "pub struct Stats {\n pub a: i32,\n pub b: u8,\n pub c: u16,\n pub d: u32,\n pub e: u64,\n pub f: usize,\n pub g: std::path::PathBuf,\n pub h: PathBuf,\n pub i: i64,\n pub j: i16,\n}\n" + ) + ); + expect(recordFields(back, "Stats").map((f) => f.type.name)).toEqual([ + "I32", + "U8", + "U16", + "U32", + "U64", + "Size", + "Path", + "Path", + "Int", + "Int", + ]); + }); +}); diff --git a/packages/typediagram/test/edge-cases.test.ts b/src/typediagram/test/edge-cases.test.ts similarity index 100% rename from packages/typediagram/test/edge-cases.test.ts rename to src/typediagram/test/edge-cases.test.ts diff --git a/packages/typediagram/test/editor.test.ts b/src/typediagram/test/editor.test.ts similarity index 100% rename from packages/typediagram/test/editor.test.ts rename to src/typediagram/test/editor.test.ts diff --git a/packages/typediagram/test/elk-errors.test.ts b/src/typediagram/test/elk-errors.test.ts similarity index 100% rename from packages/typediagram/test/elk-errors.test.ts rename to src/typediagram/test/elk-errors.test.ts diff --git a/packages/typediagram/test/elk-project.test.ts b/src/typediagram/test/elk-project.test.ts similarity index 100% rename from packages/typediagram/test/elk-project.test.ts rename to src/typediagram/test/elk-project.test.ts diff --git a/packages/typediagram/test/elk-throw.test.ts b/src/typediagram/test/elk-throw.test.ts similarity index 100% rename from packages/typediagram/test/elk-throw.test.ts rename to src/typediagram/test/elk-throw.test.ts diff --git a/packages/typediagram/test/fixtures.ts b/src/typediagram/test/fixtures.ts similarity index 100% rename from packages/typediagram/test/fixtures.ts rename to src/typediagram/test/fixtures.ts diff --git a/packages/typediagram/test/function.integration.test.ts b/src/typediagram/test/function.integration.test.ts similarity index 100% rename from packages/typediagram/test/function.integration.test.ts rename to src/typediagram/test/function.integration.test.ts diff --git a/packages/typediagram/test/helpers.ts b/src/typediagram/test/helpers.ts similarity index 100% rename from packages/typediagram/test/helpers.ts rename to src/typediagram/test/helpers.ts diff --git a/packages/typediagram/test/index.test.ts b/src/typediagram/test/index.test.ts similarity index 100% rename from packages/typediagram/test/index.test.ts rename to src/typediagram/test/index.test.ts diff --git a/packages/typediagram/test/layout.test.ts b/src/typediagram/test/layout.test.ts similarity index 100% rename from packages/typediagram/test/layout.test.ts rename to src/typediagram/test/layout.test.ts diff --git a/packages/typediagram/test/lexer.test.ts b/src/typediagram/test/lexer.test.ts similarity index 100% rename from packages/typediagram/test/lexer.test.ts rename to src/typediagram/test/lexer.test.ts diff --git a/packages/typediagram/test/markdown.test.ts b/src/typediagram/test/markdown.test.ts similarity index 100% rename from packages/typediagram/test/markdown.test.ts rename to src/typediagram/test/markdown.test.ts diff --git a/packages/typediagram/test/model.test.ts b/src/typediagram/test/model.test.ts similarity index 100% rename from packages/typediagram/test/model.test.ts rename to src/typediagram/test/model.test.ts diff --git a/packages/typediagram/test/parser.test.ts b/src/typediagram/test/parser.test.ts similarity index 100% rename from packages/typediagram/test/parser.test.ts rename to src/typediagram/test/parser.test.ts diff --git a/packages/typediagram/test/render-hooks.test.ts b/src/typediagram/test/render-hooks.test.ts similarity index 100% rename from packages/typediagram/test/render-hooks.test.ts rename to src/typediagram/test/render-hooks.test.ts diff --git a/packages/typediagram/test/render.test.ts b/src/typediagram/test/render.test.ts similarity index 100% rename from packages/typediagram/test/render.test.ts rename to src/typediagram/test/render.test.ts diff --git a/packages/typediagram/test/result.test.ts b/src/typediagram/test/result.test.ts similarity index 100% rename from packages/typediagram/test/result.test.ts rename to src/typediagram/test/result.test.ts diff --git a/packages/typediagram/test/run-scenarios.ts b/src/typediagram/test/run-scenarios.ts similarity index 100% rename from packages/typediagram/test/run-scenarios.ts rename to src/typediagram/test/run-scenarios.ts diff --git a/packages/typediagram/test/scenarios.ts b/src/typediagram/test/scenarios.ts similarity index 100% rename from packages/typediagram/test/scenarios.ts rename to src/typediagram/test/scenarios.ts diff --git a/packages/typediagram/test/sync-render-cold.test.ts b/src/typediagram/test/sync-render-cold.test.ts similarity index 100% rename from packages/typediagram/test/sync-render-cold.test.ts rename to src/typediagram/test/sync-render-cold.test.ts diff --git a/packages/typediagram/test/sync-render.test.ts b/src/typediagram/test/sync-render.test.ts similarity index 100% rename from packages/typediagram/test/sync-render.test.ts rename to src/typediagram/test/sync-render.test.ts diff --git a/packages/typediagram/test/tdbin/golden.test.ts b/src/typediagram/test/tdbin/golden.test.ts similarity index 84% rename from packages/typediagram/test/tdbin/golden.test.ts rename to src/typediagram/test/tdbin/golden.test.ts index 818a35c..a82457e 100644 --- a/packages/typediagram/test/tdbin/golden.test.ts +++ b/src/typediagram/test/tdbin/golden.test.ts @@ -229,6 +229,47 @@ const assertGolden = (codec: StructCodec, value: T, hex: string) => { }; describe("[TDBIN-FUTURE-TS] TypeScript runtime golden conformance", () => { + // [CONV-TS-EXACT-INTEGERS] Full-width identities must survive the real wire runtime. + it("roundtrips exact signed bigint boundaries through framed and packed messages", () => { + const codec: StructCodec = { + dataWords: 1, + ptrWords: 0, + write: (writer, at, value) => { + const bits = tdbin.scalar.i64Bits(value); + return bits.ok ? tdbin.writer.scalar(writer, at, 0, bits.value) : bits; + }, + read: (reader, at) => { + const word = tdbin.reader.scalar(reader, at, 0); + return word.ok ? ok(BigInt.asIntN(64, word.value)) : word; + }, + }; + expect(tdbin.scalar.i64Bits(-0)).toEqual(ok(0n)); + expect(tdbin.scalar.i64Bits(Number.MIN_SAFE_INTEGER)).toEqual( + ok(BigInt.asUintN(64, BigInt(Number.MIN_SAFE_INTEGER))) + ); + expect(tdbin.scalar.i64Bits(Number.MAX_SAFE_INTEGER)).toEqual(ok(BigInt(Number.MAX_SAFE_INTEGER))); + const values = [ + -(1n << 63n), + -9007199254740993n, + -1n, + 0n, + 1n, + 9007199254740992n, + 9007199254740993n, + (1n << 63n) - 1n, + ]; + for (const value of values) { + expect(tdbin.decodeAuto(codec, expectOk(tdbin.encodeFramed(codec, value, 42n)), 42n)).toEqual(ok(value)); + expect(tdbin.decodeAuto(codec, expectOk(tdbin.encodePackedFramed(codec, value, 42n)), 42n)).toEqual(ok(value)); + } + for (const value of [-(1n << 63n) - 1n, 1n << 63n, 1n << 100n]) { + expect(tdbin.encode(codec, value)).toMatchObject({ ok: false, error: { code: "LimitExceeded" } }); + } + for (const value of [NaN, Infinity, -Infinity, 0.5, Number.MAX_SAFE_INTEGER + 1, Number.MIN_SAFE_INTEGER - 1]) { + expect(tdbin.scalar.i64Bits(value)).toMatchObject({ ok: false, error: { code: "LimitExceeded" } }); + } + }); + it("matches the Rust Person and Contact frozen golden vectors byte-for-byte", () => { assertGolden(PersonCodec, PERSON_FULL.value, PERSON_FULL.hex); assertGolden(PersonCodec, PERSON_MINIMAL.value, PERSON_MINIMAL.hex); diff --git a/packages/typediagram/test/tdbin/helpers.ts b/src/typediagram/test/tdbin/helpers.ts similarity index 100% rename from packages/typediagram/test/tdbin/helpers.ts rename to src/typediagram/test/tdbin/helpers.ts diff --git a/packages/typediagram/test/tdbin/runtime.test.ts b/src/typediagram/test/tdbin/runtime.test.ts similarity index 100% rename from packages/typediagram/test/tdbin/runtime.test.ts rename to src/typediagram/test/tdbin/runtime.test.ts diff --git a/packages/typediagram/test/visual-editor.test.ts b/src/typediagram/test/visual-editor.test.ts similarity index 95% rename from packages/typediagram/test/visual-editor.test.ts rename to src/typediagram/test/visual-editor.test.ts index a59fe35..c78d49b 100644 --- a/packages/typediagram/test/visual-editor.test.ts +++ b/src/typediagram/test/visual-editor.test.ts @@ -249,6 +249,22 @@ describe("[EDITOR-CANVAS] shared web and VS Code interaction runtime", () => { typeInput.value = "List<"; typeInput.dispatchEvent(new Event("change")); expect(bare.querySelector(".td-editor-toast")?.hidden).toBe(false); + // [EDITOR-INSPECTOR-PENDING] An async re-render (the host echoing a source + // change) must not wipe rejected or uncommitted text, nor steal focus. + typeInput.focus(); + const rowInputs = () => bare.querySelectorAll(".td-inspector-row input"); + const modelName = rowInputs().item(0).value; + editor.setContent(await render(source)); + expect(rowInputs().item(1)).not.toBe(typeInput); + expect(rowInputs().item(1).value).toBe("List<"); + expect(document.activeElement).toBe(rowInputs().item(1)); + expect(rowInputs().item(0).value).toBe(modelName); + rowInputs().item(1).value = "Option"; + rowInputs().item(1).dispatchEvent(new Event("change")); + expect(source).toContain(`${modelName}: Option`); + editor.setContent(await render(source)); + expect(rowInputs().item(1).value).toBe("Option"); + expect(rowInputs().item(1).defaultValue).toBe("Option"); bare.dispatchEvent(new PointerEvent("pointercancel", { bubbles: true })); editor.setContent("
bad source
"); diff --git a/packages/typediagram/tsconfig.build.json b/src/typediagram/tsconfig.build.json similarity index 100% rename from packages/typediagram/tsconfig.build.json rename to src/typediagram/tsconfig.build.json diff --git a/packages/typediagram/tsconfig.json b/src/typediagram/tsconfig.json similarity index 100% rename from packages/typediagram/tsconfig.json rename to src/typediagram/tsconfig.json diff --git a/packages/typediagram/vitest.config.ts b/src/typediagram/vitest.config.ts similarity index 73% rename from packages/typediagram/vitest.config.ts rename to src/typediagram/vitest.config.ts index 0ea8122..776b64c 100644 --- a/packages/typediagram/vitest.config.ts +++ b/src/typediagram/vitest.config.ts @@ -1,8 +1,8 @@ -import { createVitestConfig } from "../../scripts/vitest-config-base"; +import { createVitestConfig } from "../scripts/vitest-config-base"; export default createVitestConfig({ configDir: __dirname, - project: "packages/typediagram", + project: "src/typediagram", extraTestOptions: { snapshotFormat: { printBasicPrototype: false }, resolveSnapshotPath: (testPath: string, snapExt: string) => diff --git a/packages/vscode/.vscodeignore b/src/vscode/.vscodeignore similarity index 100% rename from packages/vscode/.vscodeignore rename to src/vscode/.vscodeignore diff --git a/packages/vscode/LICENSE b/src/vscode/LICENSE similarity index 100% rename from packages/vscode/LICENSE rename to src/vscode/LICENSE diff --git a/packages/vscode/README.md b/src/vscode/README.md similarity index 100% rename from packages/vscode/README.md rename to src/vscode/README.md diff --git a/packages/vscode/esbuild.mjs b/src/vscode/esbuild.mjs similarity index 100% rename from packages/vscode/esbuild.mjs rename to src/vscode/esbuild.mjs diff --git a/packages/vscode/examples/sample.td b/src/vscode/examples/sample.td similarity index 100% rename from packages/vscode/examples/sample.td rename to src/vscode/examples/sample.td diff --git a/packages/vscode/examples/spec.md b/src/vscode/examples/spec.md similarity index 100% rename from packages/vscode/examples/spec.md rename to src/vscode/examples/spec.md diff --git a/packages/vscode/icons/icon-flat.png b/src/vscode/icons/icon-flat.png similarity index 100% rename from packages/vscode/icons/icon-flat.png rename to src/vscode/icons/icon-flat.png diff --git a/packages/vscode/icons/icon.png b/src/vscode/icons/icon.png similarity index 100% rename from packages/vscode/icons/icon.png rename to src/vscode/icons/icon.png diff --git a/packages/vscode/language-configuration.json b/src/vscode/language-configuration.json similarity index 100% rename from packages/vscode/language-configuration.json rename to src/vscode/language-configuration.json diff --git a/packages/vscode/package-vsix.mjs b/src/vscode/package-vsix.mjs similarity index 100% rename from packages/vscode/package-vsix.mjs rename to src/vscode/package-vsix.mjs diff --git a/packages/vscode/package.json b/src/vscode/package.json similarity index 98% rename from packages/vscode/package.json rename to src/vscode/package.json index 4bca33f..968749b 100644 --- a/packages/vscode/package.json +++ b/src/vscode/package.json @@ -11,7 +11,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Nimblesite/typeDiagram.git", - "directory": "packages/vscode" + "directory": "src/vscode" }, "categories": [ "Programming Languages", @@ -158,7 +158,7 @@ "package": "node package-vsix.mjs" }, "dependencies": { - "markdown-it": "^14.3.0", + "markdown-it": "^14.3.3", "typediagram-core": "0.0.0-dev" }, "devDependencies": { @@ -173,7 +173,7 @@ "pdfkit": "^0.19.1", "svg-to-pdfkit": "^0.1.8", "typescript": "^7.0.2", - "vitest": "^4.1.10", + "vitest": "^4.1.12", "vscode-oniguruma": "^2.0.1", "vscode-textmate": "^9.1.0" } diff --git a/packages/vscode/src/export-pdf.ts b/src/vscode/src/export-pdf.ts similarity index 100% rename from packages/vscode/src/export-pdf.ts rename to src/vscode/src/export-pdf.ts diff --git a/packages/vscode/src/extension.ts b/src/vscode/src/extension.ts similarity index 100% rename from packages/vscode/src/extension.ts rename to src/vscode/src/extension.ts diff --git a/packages/vscode/src/logger.ts b/src/vscode/src/logger.ts similarity index 100% rename from packages/vscode/src/logger.ts rename to src/vscode/src/logger.ts diff --git a/packages/vscode/src/markdown-it-plugin.ts b/src/vscode/src/markdown-it-plugin.ts similarity index 100% rename from packages/vscode/src/markdown-it-plugin.ts rename to src/vscode/src/markdown-it-plugin.ts diff --git a/packages/vscode/src/preview-panel.ts b/src/vscode/src/preview-panel.ts similarity index 100% rename from packages/vscode/src/preview-panel.ts rename to src/vscode/src/preview-panel.ts diff --git a/packages/vscode/src/webview-html.ts b/src/vscode/src/webview-html.ts similarity index 100% rename from packages/vscode/src/webview-html.ts rename to src/vscode/src/webview-html.ts diff --git a/packages/vscode/src/webview/interaction-protocol.ts b/src/vscode/src/webview/interaction-protocol.ts similarity index 100% rename from packages/vscode/src/webview/interaction-protocol.ts rename to src/vscode/src/webview/interaction-protocol.ts diff --git a/packages/vscode/src/webview/interaction-test.ts b/src/vscode/src/webview/interaction-test.ts similarity index 100% rename from packages/vscode/src/webview/interaction-test.ts rename to src/vscode/src/webview/interaction-test.ts diff --git a/packages/vscode/src/webview/main.ts b/src/vscode/src/webview/main.ts similarity index 100% rename from packages/vscode/src/webview/main.ts rename to src/vscode/src/webview/main.ts diff --git a/packages/vscode/src/webview/vscode.d.ts b/src/vscode/src/webview/vscode.d.ts similarity index 100% rename from packages/vscode/src/webview/vscode.d.ts rename to src/vscode/src/webview/vscode.d.ts diff --git a/packages/vscode/syntaxes/typediagram.markdown-injection.tmLanguage.json b/src/vscode/syntaxes/typediagram.markdown-injection.tmLanguage.json similarity index 100% rename from packages/vscode/syntaxes/typediagram.markdown-injection.tmLanguage.json rename to src/vscode/syntaxes/typediagram.markdown-injection.tmLanguage.json diff --git a/packages/vscode/syntaxes/typediagram.tmLanguage.json b/src/vscode/syntaxes/typediagram.tmLanguage.json similarity index 100% rename from packages/vscode/syntaxes/typediagram.tmLanguage.json rename to src/vscode/syntaxes/typediagram.tmLanguage.json diff --git a/packages/vscode/test-grammar.mjs b/src/vscode/test-grammar.mjs similarity index 100% rename from packages/vscode/test-grammar.mjs rename to src/vscode/test-grammar.mjs diff --git a/packages/vscode/test/electron/harness/extension.cjs b/src/vscode/test/electron/harness/extension.cjs similarity index 100% rename from packages/vscode/test/electron/harness/extension.cjs rename to src/vscode/test/electron/harness/extension.cjs diff --git a/packages/vscode/test/electron/harness/package.json b/src/vscode/test/electron/harness/package.json similarity index 100% rename from packages/vscode/test/electron/harness/package.json rename to src/vscode/test/electron/harness/package.json diff --git a/packages/vscode/test/electron/macos-launcher.sh b/src/vscode/test/electron/macos-launcher.sh similarity index 100% rename from packages/vscode/test/electron/macos-launcher.sh rename to src/vscode/test/electron/macos-launcher.sh diff --git a/packages/vscode/test/electron/runner.mjs b/src/vscode/test/electron/runner.mjs similarity index 96% rename from packages/vscode/test/electron/runner.mjs rename to src/vscode/test/electron/runner.mjs index fbccd3b..3e69950 100644 --- a/packages/vscode/test/electron/runner.mjs +++ b/src/vscode/test/electron/runner.mjs @@ -1,6 +1,6 @@ // [VSCODE-E2E-ELECTRON] Runner: launches a real VS Code via @vscode/test-electron, // installs the locally-built VSIX, and executes the test suite under Mocha inside -// the extension host. Invoked by `npm run -w packages/vscode test:electron`. +// the extension host. Invoked by `npm run -w src/vscode test:electron`. // Kept as plain ESM (.mjs) so we don't need a TS runtime step for the launcher. import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; @@ -25,7 +25,7 @@ const EXTENSIONS_PATH = resolve(PROFILE_PATH, "extensions"); function findLatestVsix() { const files = readdirSync(REPO_ROOT).filter((f) => /^typediagram-.*\.vsix$/.test(f)); if (files.length === 0) { - throw new Error("no .vsix found in repo root — run `npm run -w packages/vscode package` first"); + throw new Error("no .vsix found in repo root — run `npm run -w src/vscode package` first"); } const artifacts = files.map((file) => resolve(REPO_ROOT, file)); return artifacts.sort((left, right) => statSync(right).mtimeMs - statSync(left).mtimeMs)[0]; @@ -79,7 +79,7 @@ function installVsix(vscodeExecutablePath, configuredCli, appPath, vsixPath) { async function main() { checkPlatform(); runNpm(["run", "-w", "typediagram-core", "build"], "core build failed"); - runNpm(["run", "-w", "packages/vscode", "package"], "VSIX packaging failed"); + runNpm(["run", "-w", "src/vscode", "package"], "VSIX packaging failed"); const vsixPath = findLatestVsix(); const extensionTestsPath = resolve(__dirname, "suite/index.cjs"); diff --git a/packages/vscode/test/electron/suite/extension.spec.cjs b/src/vscode/test/electron/suite/extension.spec.cjs similarity index 100% rename from packages/vscode/test/electron/suite/extension.spec.cjs rename to src/vscode/test/electron/suite/extension.spec.cjs diff --git a/packages/vscode/test/electron/suite/index.cjs b/src/vscode/test/electron/suite/index.cjs similarity index 100% rename from packages/vscode/test/electron/suite/index.cjs rename to src/vscode/test/electron/suite/index.cjs diff --git a/packages/vscode/test/export-pdf-physical.test.ts b/src/vscode/test/export-pdf-physical.test.ts similarity index 100% rename from packages/vscode/test/export-pdf-physical.test.ts rename to src/vscode/test/export-pdf-physical.test.ts diff --git a/packages/vscode/test/export-pdf.test.ts b/src/vscode/test/export-pdf.test.ts similarity index 98% rename from packages/vscode/test/export-pdf.test.ts rename to src/vscode/test/export-pdf.test.ts index 34406ad..30d431a 100644 --- a/packages/vscode/test/export-pdf.test.ts +++ b/src/vscode/test/export-pdf.test.ts @@ -118,9 +118,9 @@ function makeDeps(overrides: TestDepsOverrides = {}): { } const SAMPLE_URI = { - path: "/repo/packages/vscode/examples/spec.md", + path: "/repo/src/vscode/examples/spec.md", scheme: "file", - toString: () => "file:///repo/packages/vscode/examples/spec.md", + toString: () => "file:///repo/src/vscode/examples/spec.md", } as unknown as vscodeTypes.Uri; // --------------------------------------------------------------------------- @@ -382,7 +382,7 @@ describe("[PDF-SAVE] siblingPdfPath + writeNextToSource", () => { const { deps, spies } = makeDeps(); const buf = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]); const result = await writeNextToSource(buf, SAMPLE_URI, deps); - expect(result.path).toBe("/repo/packages/vscode/examples/spec.pdf"); + expect(result.path).toBe("/repo/src/vscode/examples/spec.pdf"); expect(spies.writeFile).toHaveBeenCalledTimes(1); expect(spies.writeFile.mock.calls[0]?.[1]).toBe(buf); }); @@ -422,7 +422,7 @@ describe("exportPdf composer", () => { expect(spies.printToPDF).toHaveBeenCalledTimes(1); expect(spies.writeFile).toHaveBeenCalledTimes(1); const writtenUri = spies.writeFile.mock.calls[0]?.[0] as { path: string }; - expect(writtenUri.path).toBe("/repo/packages/vscode/examples/spec.pdf"); + expect(writtenUri.path).toBe("/repo/src/vscode/examples/spec.pdf"); const writtenBuf = spies.writeFile.mock.calls[0]?.[1] as Uint8Array; expect(new TextDecoder().decode(writtenBuf.slice(0, 5))).toBe(PDF_MAGIC); await new Promise((r) => setTimeout(r, 0)); diff --git a/packages/vscode/test/extension.test.ts b/src/vscode/test/extension.test.ts similarity index 100% rename from packages/vscode/test/extension.test.ts rename to src/vscode/test/extension.test.ts diff --git a/packages/vscode/test/fixtures/markdown.tmLanguage.json b/src/vscode/test/fixtures/markdown.tmLanguage.json similarity index 100% rename from packages/vscode/test/fixtures/markdown.tmLanguage.json rename to src/vscode/test/fixtures/markdown.tmLanguage.json diff --git a/packages/vscode/test/grammar-injection.test.ts b/src/vscode/test/grammar-injection.test.ts similarity index 100% rename from packages/vscode/test/grammar-injection.test.ts rename to src/vscode/test/grammar-injection.test.ts diff --git a/packages/vscode/test/helpers.ts b/src/vscode/test/helpers.ts similarity index 100% rename from packages/vscode/test/helpers.ts rename to src/vscode/test/helpers.ts diff --git a/packages/vscode/test/logger.test.ts b/src/vscode/test/logger.test.ts similarity index 100% rename from packages/vscode/test/logger.test.ts rename to src/vscode/test/logger.test.ts diff --git a/packages/vscode/test/markdown-it-plugin-cold.test.ts b/src/vscode/test/markdown-it-plugin-cold.test.ts similarity index 100% rename from packages/vscode/test/markdown-it-plugin-cold.test.ts rename to src/vscode/test/markdown-it-plugin-cold.test.ts diff --git a/packages/vscode/test/markdown-it-plugin.test.ts b/src/vscode/test/markdown-it-plugin.test.ts similarity index 100% rename from packages/vscode/test/markdown-it-plugin.test.ts rename to src/vscode/test/markdown-it-plugin.test.ts diff --git a/packages/vscode/test/vscode-mock.ts b/src/vscode/test/vscode-mock.ts similarity index 100% rename from packages/vscode/test/vscode-mock.ts rename to src/vscode/test/vscode-mock.ts diff --git a/packages/vscode/test/vsix-contributes.test.ts b/src/vscode/test/vsix-contributes.test.ts similarity index 100% rename from packages/vscode/test/vsix-contributes.test.ts rename to src/vscode/test/vsix-contributes.test.ts diff --git a/packages/vscode/test/vsix-package.test.ts b/src/vscode/test/vsix-package.test.ts similarity index 97% rename from packages/vscode/test/vsix-package.test.ts rename to src/vscode/test/vsix-package.test.ts index ee2f7bf..3076c9c 100644 --- a/packages/vscode/test/vsix-package.test.ts +++ b/src/vscode/test/vsix-package.test.ts @@ -20,7 +20,7 @@ const RUN_E2E = process.env["TYPEDIAGRAM_E2E"] === "1"; const SUITE = RUN_E2E ? describe : describe.skip; function buildVsix(): string { - const result = spawnSync("npm", ["run", "-w", "packages/vscode", "package"], { + const result = spawnSync("npm", ["run", "-w", "src/vscode", "package"], { cwd: REPO, encoding: "utf8", stdio: "pipe", diff --git a/packages/vscode/test/webview-html.test.ts b/src/vscode/test/webview-html.test.ts similarity index 100% rename from packages/vscode/test/webview-html.test.ts rename to src/vscode/test/webview-html.test.ts diff --git a/packages/vscode/themes/typediagram-dark.json b/src/vscode/themes/typediagram-dark.json similarity index 100% rename from packages/vscode/themes/typediagram-dark.json rename to src/vscode/themes/typediagram-dark.json diff --git a/packages/vscode/themes/typediagram-light.json b/src/vscode/themes/typediagram-light.json similarity index 100% rename from packages/vscode/themes/typediagram-light.json rename to src/vscode/themes/typediagram-light.json diff --git a/packages/vscode/tsconfig.build.json b/src/vscode/tsconfig.build.json similarity index 100% rename from packages/vscode/tsconfig.build.json rename to src/vscode/tsconfig.build.json diff --git a/packages/vscode/tsconfig.json b/src/vscode/tsconfig.json similarity index 100% rename from packages/vscode/tsconfig.json rename to src/vscode/tsconfig.json diff --git a/packages/vscode/tsconfig.webview.json b/src/vscode/tsconfig.webview.json similarity index 100% rename from packages/vscode/tsconfig.webview.json rename to src/vscode/tsconfig.webview.json diff --git a/src/vscode/vitest.config.ts b/src/vscode/vitest.config.ts new file mode 100644 index 0000000..7efd7ac --- /dev/null +++ b/src/vscode/vitest.config.ts @@ -0,0 +1,7 @@ +import { createVitestConfig } from "../scripts/vitest-config-base"; + +export default createVitestConfig({ + configDir: __dirname, + project: "src/vscode", + exclude: ["src/webview/**"], +}); diff --git a/packages/web/README.md b/src/web/README.md similarity index 100% rename from packages/web/README.md rename to src/web/README.md diff --git a/packages/web/e2e/converter.spec.ts b/src/web/e2e/converter.spec.ts similarity index 100% rename from packages/web/e2e/converter.spec.ts rename to src/web/e2e/converter.spec.ts diff --git a/packages/web/e2e/docs.spec.ts b/src/web/e2e/docs.spec.ts similarity index 100% rename from packages/web/e2e/docs.spec.ts rename to src/web/e2e/docs.spec.ts diff --git a/packages/web/e2e/editor-zoom.spec.ts b/src/web/e2e/editor-zoom.spec.ts similarity index 100% rename from packages/web/e2e/editor-zoom.spec.ts rename to src/web/e2e/editor-zoom.spec.ts diff --git a/packages/web/e2e/harness.ts b/src/web/e2e/harness.ts similarity index 100% rename from packages/web/e2e/harness.ts rename to src/web/e2e/harness.ts diff --git a/packages/web/e2e/playground.spec.ts b/src/web/e2e/playground.spec.ts similarity index 100% rename from packages/web/e2e/playground.spec.ts rename to src/web/e2e/playground.spec.ts diff --git a/packages/web/e2e/splitter.spec.ts b/src/web/e2e/splitter.spec.ts similarity index 100% rename from packages/web/e2e/splitter.spec.ts rename to src/web/e2e/splitter.spec.ts diff --git a/packages/web/e2e/support/coverage-fixture.ts b/src/web/e2e/support/coverage-fixture.ts similarity index 66% rename from packages/web/e2e/support/coverage-fixture.ts rename to src/web/e2e/support/coverage-fixture.ts index c0b63b5..971a20c 100644 --- a/packages/web/e2e/support/coverage-fixture.ts +++ b/src/web/e2e/support/coverage-fixture.ts @@ -4,12 +4,27 @@ import { test as base } from "@playwright/test"; import MCR from "monocart-coverage-reports"; import type { CoverageReportOptions } from "monocart-coverage-reports"; +import { dirname, relative, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const WEB_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "../.."); +const ASSETS_DIR = resolve(WEB_DIR, "dist/assets"); + +// MCR resolves a sourcemap's relative sources ("../../src/x.ts") against the +// cwd, not the map's own dir, then strips "..": under the repo's src/ tree that +// collapses web's src/x.ts to "x.ts". Re-anchor them to dist/assets so every +// source path is web-package-relative ("src/x.ts"). +const anchorSource = (filePath: string, info: Record) => + typeof info["url"] === "string" && info["url"].startsWith("../") + ? relative(WEB_DIR, resolve(ASSETS_DIR, info["url"])) + : filePath; export const coverageOptions: CoverageReportOptions = { outputDir: "coverage/playwright", reports: [["v8"], ["console-summary"], ["json-summary"], ["lcov"], ["json"]], cleanCache: false, sourceMap: true, + sourcePath: anchorSource, entryFilter: (entry: { url: string }): boolean => entry.url.includes("/assets/"), sourceFilter: (sourcePath: string): boolean => sourcePath.startsWith("src/") && !sourcePath.endsWith(".d.ts"), // Disable per-add report emission; only globalTeardown writes the report. diff --git a/packages/web/e2e/support/global-teardown.ts b/src/web/e2e/support/global-teardown.ts similarity index 100% rename from packages/web/e2e/support/global-teardown.ts rename to src/web/e2e/support/global-teardown.ts diff --git a/packages/web/e2e/support/harness-page.ts b/src/web/e2e/support/harness-page.ts similarity index 100% rename from packages/web/e2e/support/harness-page.ts rename to src/web/e2e/support/harness-page.ts diff --git a/packages/web/e2e/viewport.spec.ts b/src/web/e2e/viewport.spec.ts similarity index 100% rename from packages/web/e2e/viewport.spec.ts rename to src/web/e2e/viewport.spec.ts diff --git a/packages/web/e2e/visual-editor.spec.ts b/src/web/e2e/visual-editor.spec.ts similarity index 100% rename from packages/web/e2e/visual-editor.spec.ts rename to src/web/e2e/visual-editor.spec.ts diff --git a/packages/web/e2e/zoom-controls.spec.ts b/src/web/e2e/zoom-controls.spec.ts similarity index 100% rename from packages/web/e2e/zoom-controls.spec.ts rename to src/web/e2e/zoom-controls.spec.ts diff --git a/packages/web/eleventy.config.mjs b/src/web/eleventy.config.mjs similarity index 100% rename from packages/web/eleventy.config.mjs rename to src/web/eleventy.config.mjs diff --git a/packages/web/eleventy/_data/docs.ts b/src/web/eleventy/_data/docs.ts similarity index 100% rename from packages/web/eleventy/_data/docs.ts rename to src/web/eleventy/_data/docs.ts diff --git a/packages/web/eleventy/_data/sharedIntro.ts b/src/web/eleventy/_data/sharedIntro.ts similarity index 100% rename from packages/web/eleventy/_data/sharedIntro.ts rename to src/web/eleventy/_data/sharedIntro.ts diff --git a/packages/web/eleventy/_includes/base.njk b/src/web/eleventy/_includes/base.njk similarity index 100% rename from packages/web/eleventy/_includes/base.njk rename to src/web/eleventy/_includes/base.njk diff --git a/packages/web/eleventy/_includes/docs-nav-groups.njk b/src/web/eleventy/_includes/docs-nav-groups.njk similarity index 100% rename from packages/web/eleventy/_includes/docs-nav-groups.njk rename to src/web/eleventy/_includes/docs-nav-groups.njk diff --git a/packages/web/eleventy/_includes/docs.njk b/src/web/eleventy/_includes/docs.njk similarity index 100% rename from packages/web/eleventy/_includes/docs.njk rename to src/web/eleventy/_includes/docs.njk diff --git a/packages/web/eleventy/_includes/footer.njk b/src/web/eleventy/_includes/footer.njk similarity index 100% rename from packages/web/eleventy/_includes/footer.njk rename to src/web/eleventy/_includes/footer.njk diff --git a/packages/web/eleventy/_includes/intro.njk b/src/web/eleventy/_includes/intro.njk similarity index 100% rename from packages/web/eleventy/_includes/intro.njk rename to src/web/eleventy/_includes/intro.njk diff --git a/packages/web/eleventy/_includes/nav.njk b/src/web/eleventy/_includes/nav.njk similarity index 100% rename from packages/web/eleventy/_includes/nav.njk rename to src/web/eleventy/_includes/nav.njk diff --git a/packages/web/eleventy/_includes/post.njk b/src/web/eleventy/_includes/post.njk similarity index 100% rename from packages/web/eleventy/_includes/post.njk rename to src/web/eleventy/_includes/post.njk diff --git a/packages/web/eleventy/blog/blog.11tydata.js b/src/web/eleventy/blog/blog.11tydata.js similarity index 100% rename from packages/web/eleventy/blog/blog.11tydata.js rename to src/web/eleventy/blog/blog.11tydata.js diff --git a/packages/web/eleventy/blog/datetime-uuid-decimal-scalars.md b/src/web/eleventy/blog/datetime-uuid-decimal-scalars.md similarity index 100% rename from packages/web/eleventy/blog/datetime-uuid-decimal-scalars.md rename to src/web/eleventy/blog/datetime-uuid-decimal-scalars.md diff --git a/packages/web/eleventy/blog/index.njk b/src/web/eleventy/blog/index.njk similarity index 100% rename from packages/web/eleventy/blog/index.njk rename to src/web/eleventy/blog/index.njk diff --git a/packages/web/eleventy/blog/rust-tooling-single-source-of-truth.md b/src/web/eleventy/blog/rust-tooling-single-source-of-truth.md similarity index 100% rename from packages/web/eleventy/blog/rust-tooling-single-source-of-truth.md rename to src/web/eleventy/blog/rust-tooling-single-source-of-truth.md diff --git a/packages/web/eleventy/blog/welcome.md b/src/web/eleventy/blog/welcome.md similarity index 100% rename from packages/web/eleventy/blog/welcome.md rename to src/web/eleventy/blog/welcome.md diff --git a/packages/web/eleventy/converter.njk b/src/web/eleventy/converter.njk similarity index 100% rename from packages/web/eleventy/converter.njk rename to src/web/eleventy/converter.njk diff --git a/packages/web/eleventy/docs-index.njk b/src/web/eleventy/docs-index.njk similarity index 100% rename from packages/web/eleventy/docs-index.njk rename to src/web/eleventy/docs-index.njk diff --git a/packages/web/eleventy/docs.njk b/src/web/eleventy/docs.njk similarity index 100% rename from packages/web/eleventy/docs.njk rename to src/web/eleventy/docs.njk diff --git a/packages/web/eleventy/harness.njk b/src/web/eleventy/harness.njk similarity index 100% rename from packages/web/eleventy/harness.njk rename to src/web/eleventy/harness.njk diff --git a/packages/web/eleventy/index.njk b/src/web/eleventy/index.njk similarity index 100% rename from packages/web/eleventy/index.njk rename to src/web/eleventy/index.njk diff --git a/packages/web/eleventy/markedInstance.ts b/src/web/eleventy/markedInstance.ts similarity index 100% rename from packages/web/eleventy/markedInstance.ts rename to src/web/eleventy/markedInstance.ts diff --git a/packages/web/eleventy/sitemap.njk b/src/web/eleventy/sitemap.njk similarity index 100% rename from packages/web/eleventy/sitemap.njk rename to src/web/eleventy/sitemap.njk diff --git a/packages/web/package.json b/src/web/package.json similarity index 95% rename from packages/web/package.json rename to src/web/package.json index 637e78d..11a921b 100644 --- a/packages/web/package.json +++ b/src/web/package.json @@ -28,7 +28,7 @@ "@11ty/eleventy": "^3.1.6", "@playwright/test": "^1.61.1", "@types/prismjs": "^1.26.6", - "concurrently": "^10.0.3", + "concurrently": "^10.0.6", "happy-dom": "^20.10.6", "monocart-coverage-reports": "^2.12.12", "prismjs": "^1.30.0", @@ -36,7 +36,7 @@ "typedoc": "^0.28.20", "typedoc-plugin-markdown": "^4.12.0", "typescript": "^7.0.2", - "vite": "^8.1.4", - "vitest": "^4.1.10" + "vite": "^8.3.5", + "vitest": "^4.1.12" } } diff --git a/packages/web/playwright.config.ts b/src/web/playwright.config.ts similarity index 100% rename from packages/web/playwright.config.ts rename to src/web/playwright.config.ts diff --git a/packages/web/public/CNAME b/src/web/public/CNAME similarity index 100% rename from packages/web/public/CNAME rename to src/web/public/CNAME diff --git a/packages/web/public/favicon.svg b/src/web/public/favicon.svg similarity index 100% rename from packages/web/public/favicon.svg rename to src/web/public/favicon.svg diff --git a/packages/web/public/robots.txt b/src/web/public/robots.txt similarity index 100% rename from packages/web/public/robots.txt rename to src/web/public/robots.txt diff --git a/packages/web/public/vscode-screenshot.png b/src/web/public/vscode-screenshot.png similarity index 100% rename from packages/web/public/vscode-screenshot.png rename to src/web/public/vscode-screenshot.png diff --git a/packages/web/scripts/merge-coverage.ts b/src/web/scripts/merge-coverage.ts similarity index 98% rename from packages/web/scripts/merge-coverage.ts rename to src/web/scripts/merge-coverage.ts index 78859df..3224ed0 100644 --- a/packages/web/scripts/merge-coverage.ts +++ b/src/web/scripts/merge-coverage.ts @@ -212,9 +212,9 @@ const loadThresholds = (): Thresholds => { const raw = JSON.parse(readFileSync(resolve(CWD, "../../coverage-thresholds.json"), "utf8")) as { projects: Record; }; - const t = raw.projects["packages/web"]; + const t = raw.projects["src/web"]; if (t === undefined) { - throw new Error("[MERGE-COV] packages/web missing in coverage-thresholds.json"); + throw new Error("[MERGE-COV] src/web missing in coverage-thresholds.json"); } return t; }; diff --git a/packages/web/src/converter-highlight.ts b/src/web/src/converter-highlight.ts similarity index 100% rename from packages/web/src/converter-highlight.ts rename to src/web/src/converter-highlight.ts diff --git a/packages/web/src/converter-main.ts b/src/web/src/converter-main.ts similarity index 100% rename from packages/web/src/converter-main.ts rename to src/web/src/converter-main.ts diff --git a/packages/web/src/converter-render.ts b/src/web/src/converter-render.ts similarity index 100% rename from packages/web/src/converter-render.ts rename to src/web/src/converter-render.ts diff --git a/packages/web/src/converter.ts b/src/web/src/converter.ts similarity index 100% rename from packages/web/src/converter.ts rename to src/web/src/converter.ts diff --git a/packages/web/src/debounce.ts b/src/web/src/debounce.ts similarity index 100% rename from packages/web/src/debounce.ts rename to src/web/src/debounce.ts diff --git a/packages/web/src/editor-zoom.ts b/src/web/src/editor-zoom.ts similarity index 100% rename from packages/web/src/editor-zoom.ts rename to src/web/src/editor-zoom.ts diff --git a/packages/web/src/eval-hooks.ts b/src/web/src/eval-hooks.ts similarity index 100% rename from packages/web/src/eval-hooks.ts rename to src/web/src/eval-hooks.ts diff --git a/packages/web/src/highlight-engine.ts b/src/web/src/highlight-engine.ts similarity index 100% rename from packages/web/src/highlight-engine.ts rename to src/web/src/highlight-engine.ts diff --git a/packages/web/src/highlight-js.ts b/src/web/src/highlight-js.ts similarity index 100% rename from packages/web/src/highlight-js.ts rename to src/web/src/highlight-js.ts diff --git a/packages/web/src/highlight.ts b/src/web/src/highlight.ts similarity index 91% rename from packages/web/src/highlight.ts rename to src/web/src/highlight.ts index c83e115..ed65762 100644 --- a/packages/web/src/highlight.ts +++ b/src/web/src/highlight.ts @@ -1,5 +1,5 @@ // [WEB-HIGHLIGHT] Regex-based syntax highlighter for typeDiagram. -// Mirrors the TextMate grammar scopes from packages/vscode/syntaxes/typediagram.tmLanguage.json. +// Mirrors the TextMate grammar scopes from src/vscode/syntaxes/typediagram.tmLanguage.json. // Returns HTML with wrapping tokens. import { type Rule, runHighlight, initHighlightOverlay } from "./highlight-engine.js"; diff --git a/packages/web/src/hook-presets.ts b/src/web/src/hook-presets.ts similarity index 100% rename from packages/web/src/hook-presets.ts rename to src/web/src/hook-presets.ts diff --git a/packages/web/src/main.ts b/src/web/src/main.ts similarity index 100% rename from packages/web/src/main.ts rename to src/web/src/main.ts diff --git a/packages/web/src/playground.ts b/src/web/src/playground.ts similarity index 100% rename from packages/web/src/playground.ts rename to src/web/src/playground.ts diff --git a/packages/web/src/render-pane.ts b/src/web/src/render-pane.ts similarity index 100% rename from packages/web/src/render-pane.ts rename to src/web/src/render-pane.ts diff --git a/packages/web/src/splitter.ts b/src/web/src/splitter.ts similarity index 100% rename from packages/web/src/splitter.ts rename to src/web/src/splitter.ts diff --git a/packages/web/src/styles.css b/src/web/src/styles.css similarity index 100% rename from packages/web/src/styles.css rename to src/web/src/styles.css diff --git a/packages/web/src/viewport.ts b/src/web/src/viewport.ts similarity index 100% rename from packages/web/src/viewport.ts rename to src/web/src/viewport.ts diff --git a/packages/web/src/zoom-controls.ts b/src/web/src/zoom-controls.ts similarity index 100% rename from packages/web/src/zoom-controls.ts rename to src/web/src/zoom-controls.ts diff --git a/packages/web/test/__snapshots__/alias-chain.svg b/src/web/test/__snapshots__/alias-chain.svg similarity index 100% rename from packages/web/test/__snapshots__/alias-chain.svg rename to src/web/test/__snapshots__/alias-chain.svg diff --git a/packages/web/test/__snapshots__/all-external.svg b/src/web/test/__snapshots__/all-external.svg similarity index 100% rename from packages/web/test/__snapshots__/all-external.svg rename to src/web/test/__snapshots__/all-external.svg diff --git a/packages/web/test/__snapshots__/all-primitives.svg b/src/web/test/__snapshots__/all-primitives.svg similarity index 100% rename from packages/web/test/__snapshots__/all-primitives.svg rename to src/web/test/__snapshots__/all-primitives.svg diff --git a/packages/web/test/__snapshots__/chat-model-render.test.svg b/src/web/test/__snapshots__/chat-model-render.test.svg similarity index 100% rename from packages/web/test/__snapshots__/chat-model-render.test.svg rename to src/web/test/__snapshots__/chat-model-render.test.svg diff --git a/packages/web/test/__snapshots__/deep-generics.svg b/src/web/test/__snapshots__/deep-generics.svg similarity index 100% rename from packages/web/test/__snapshots__/deep-generics.svg rename to src/web/test/__snapshots__/deep-generics.svg diff --git a/packages/web/test/__snapshots__/empty-diagram.svg b/src/web/test/__snapshots__/empty-diagram.svg similarity index 100% rename from packages/web/test/__snapshots__/empty-diagram.svg rename to src/web/test/__snapshots__/empty-diagram.svg diff --git a/packages/web/test/__snapshots__/long-names.svg b/src/web/test/__snapshots__/long-names.svg similarity index 100% rename from packages/web/test/__snapshots__/long-names.svg rename to src/web/test/__snapshots__/long-names.svg diff --git a/packages/web/test/__snapshots__/many-nodes.svg b/src/web/test/__snapshots__/many-nodes.svg similarity index 100% rename from packages/web/test/__snapshots__/many-nodes.svg rename to src/web/test/__snapshots__/many-nodes.svg diff --git a/packages/web/test/__snapshots__/mixed-union.svg b/src/web/test/__snapshots__/mixed-union.svg similarity index 100% rename from packages/web/test/__snapshots__/mixed-union.svg rename to src/web/test/__snapshots__/mixed-union.svg diff --git a/packages/web/test/__snapshots__/multi-generics.svg b/src/web/test/__snapshots__/multi-generics.svg similarity index 100% rename from packages/web/test/__snapshots__/multi-generics.svg rename to src/web/test/__snapshots__/multi-generics.svg diff --git a/packages/web/test/__snapshots__/self-ref.svg b/src/web/test/__snapshots__/self-ref.svg similarity index 100% rename from packages/web/test/__snapshots__/self-ref.svg rename to src/web/test/__snapshots__/self-ref.svg diff --git a/packages/web/test/__snapshots__/single-alias.svg b/src/web/test/__snapshots__/single-alias.svg similarity index 100% rename from packages/web/test/__snapshots__/single-alias.svg rename to src/web/test/__snapshots__/single-alias.svg diff --git a/packages/web/test/__snapshots__/single-record.svg b/src/web/test/__snapshots__/single-record.svg similarity index 100% rename from packages/web/test/__snapshots__/single-record.svg rename to src/web/test/__snapshots__/single-record.svg diff --git a/packages/web/test/__snapshots__/single-union.svg b/src/web/test/__snapshots__/single-union.svg similarity index 100% rename from packages/web/test/__snapshots__/single-union.svg rename to src/web/test/__snapshots__/single-union.svg diff --git a/packages/web/test/__snapshots__/small-example.svg b/src/web/test/__snapshots__/small-example.svg similarity index 100% rename from packages/web/test/__snapshots__/small-example.svg rename to src/web/test/__snapshots__/small-example.svg diff --git a/packages/web/test/__snapshots__/union-refs-union.svg b/src/web/test/__snapshots__/union-refs-union.svg similarity index 100% rename from packages/web/test/__snapshots__/union-refs-union.svg rename to src/web/test/__snapshots__/union-refs-union.svg diff --git a/packages/web/test/converter-highlight.test.ts b/src/web/test/converter-highlight.test.ts similarity index 100% rename from packages/web/test/converter-highlight.test.ts rename to src/web/test/converter-highlight.test.ts diff --git a/packages/web/test/converter-render.test.ts b/src/web/test/converter-render.test.ts similarity index 100% rename from packages/web/test/converter-render.test.ts rename to src/web/test/converter-render.test.ts diff --git a/packages/web/test/debounce.test.ts b/src/web/test/debounce.test.ts similarity index 100% rename from packages/web/test/debounce.test.ts rename to src/web/test/debounce.test.ts diff --git a/packages/web/test/docs-syntax-highlight.test.ts b/src/web/test/docs-syntax-highlight.test.ts similarity index 100% rename from packages/web/test/docs-syntax-highlight.test.ts rename to src/web/test/docs-syntax-highlight.test.ts diff --git a/packages/web/test/eval-hooks.test.ts b/src/web/test/eval-hooks.test.ts similarity index 100% rename from packages/web/test/eval-hooks.test.ts rename to src/web/test/eval-hooks.test.ts diff --git a/packages/web/test/highlight.test.ts b/src/web/test/highlight.test.ts similarity index 100% rename from packages/web/test/highlight.test.ts rename to src/web/test/highlight.test.ts diff --git a/packages/web/test/hook-presets.test.ts b/src/web/test/hook-presets.test.ts similarity index 100% rename from packages/web/test/hook-presets.test.ts rename to src/web/test/hook-presets.test.ts diff --git a/packages/web/test/render-pane.test.ts b/src/web/test/render-pane.test.ts similarity index 100% rename from packages/web/test/render-pane.test.ts rename to src/web/test/render-pane.test.ts diff --git a/packages/web/test/snapshot-scenarios.test.ts b/src/web/test/snapshot-scenarios.test.ts similarity index 100% rename from packages/web/test/snapshot-scenarios.test.ts rename to src/web/test/snapshot-scenarios.test.ts diff --git a/packages/web/tsconfig.build.json b/src/web/tsconfig.build.json similarity index 100% rename from packages/web/tsconfig.build.json rename to src/web/tsconfig.build.json diff --git a/packages/web/tsconfig.e2e.json b/src/web/tsconfig.e2e.json similarity index 100% rename from packages/web/tsconfig.e2e.json rename to src/web/tsconfig.e2e.json diff --git a/packages/web/tsconfig.json b/src/web/tsconfig.json similarity index 100% rename from packages/web/tsconfig.json rename to src/web/tsconfig.json diff --git a/packages/web/typedoc.json b/src/web/typedoc.json similarity index 100% rename from packages/web/typedoc.json rename to src/web/typedoc.json diff --git a/packages/web/vite-plugin-copy-eleventy.ts b/src/web/vite-plugin-copy-eleventy.ts similarity index 100% rename from packages/web/vite-plugin-copy-eleventy.ts rename to src/web/vite-plugin-copy-eleventy.ts diff --git a/packages/web/vite.config.ts b/src/web/vite.config.ts similarity index 100% rename from packages/web/vite.config.ts rename to src/web/vite.config.ts diff --git a/packages/web/vitest.config.ts b/src/web/vitest.config.ts similarity index 90% rename from packages/web/vitest.config.ts rename to src/web/vitest.config.ts index 1d1d064..114fa81 100644 --- a/packages/web/vitest.config.ts +++ b/src/web/vitest.config.ts @@ -5,7 +5,7 @@ // Coverage threshold enforcement is intentionally moved to // scripts/merge-coverage.ts, which merges this summary with Playwright's — // so no `project` (thresholds) key is passed here. -import { createVitestConfig } from "../../scripts/vitest-config-base"; +import { createVitestConfig } from "../scripts/vitest-config-base"; export default createVitestConfig({ configDir: __dirname,