Skip to content

feat: establish generated v2 foundation#216

Closed
anand-testcompare wants to merge 7 commits into
mainfrom
feat/v2-clean-start-foundation
Closed

feat: establish generated v2 foundation#216
anand-testcompare wants to merge 7 commits into
mainfrom
feat/v2-clean-start-foundation

Conversation

@anand-testcompare

@anand-testcompare anand-testcompare commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an Nx/pnpm 11/TanStack Start v2 foundation with Cloudflare Worker build/deploy config
  • add generated diagram-core, diagram-renderer, diagram-studio-ui, sketchi-generators, diagram-agent-tools, diagram-exporter, and mcp-server packages
  • make diagram-core the canonical IntermediateFormat schema boundary, with the backend reusing that shared schema instead of carrying its own duplicate zod contract
  • add diagram-agent-tools as the host-neutral diagram tool catalog with MCP-shaped JSON schemas, descriptions, routing hints, and session-aware diagram_to_png input
  • add diagram-exporter as the host-neutral Excalidraw share/file parsing, safe output path, and Playwright-backed PNG export package
  • wire the OpenCode sketchi-diagram agent config/hints and standalone diagram_to_png flow to shared packages instead of duplicating tool names, Mermaid guardrails, and PNG export logic
  • add @sketchi/mcp-server as a generic NodeNext MCP stdio adapter over the shared catalog, with a default HTTP executor for Sketchi server-backed generation/edit APIs plus shared PNG export
  • keep host-owned visual grading explicit in the MCP executor contract instead of hiding partial behavior
  • generate flowchart and architecture diagram types through the local Nx generator with EJS templates and registry updates
  • add Storybook stories/tests for generated diagram/component surfaces, plus a test-storybook target that verifies indexed static stories
  • use TanStack Router search params, Query, Virtual, and Hotkeys in the app/workspace path instead of hand-rolled app-state wiring
  • add route-level proof that ?diagram= controls the selected diagram and catalog clicks update the TanStack Router search state
  • add a generated DiagramStatusStrip Studio component and a structure guard requiring component file, test, Storybook story, local export, and package export
  • add Nx-visible backend, MCP, and exporter dependency/typecheck wiring so affected graphs and focused package commands include their dependencies
  • fix composite TypeScript project-reference outputs so clean CI run-many -t typecheck,test,build runs do not race against missing dist/typecheck declarations
  • remove the stale Next/Vercel/Bun/Turbo web and CI surface so the TanStack/Cloudflare path is the active app path

Verification

  • pnpm install --frozen-lockfile
  • git diff --check
  • bun x ultracite fix
  • NX_DAEMON=false pnpm nx test diagram-exporter --skip-nx-cache (4 files, 14 tests)
  • NX_DAEMON=false pnpm nx typecheck diagram-exporter --skip-nx-cache
  • NX_DAEMON=false pnpm nx build diagram-exporter --skip-nx-cache
  • NX_DAEMON=false pnpm nx run diagram-exporter:typecheck-tsgo --skip-nx-cache
  • NX_DAEMON=false pnpm nx test diagram-agent-tools --skip-nx-cache (1 file, 4 tests)
  • NX_DAEMON=false pnpm nx test mcp-server --skip-nx-cache (2 files, 9 tests)
  • NX_DAEMON=false pnpm nx typecheck mcp-server --skip-nx-cache
  • NX_DAEMON=false pnpm nx build mcp-server --skip-nx-cache
  • NX_DAEMON=false pnpm nx run mcp-server:typecheck-tsgo --skip-nx-cache
  • timeout 2 node packages/mcp-server/dist/stdio.js </dev/null
  • cd packages/opencode-excalidraw && bun test (32 tests)
  • cd packages/opencode-excalidraw && bun x tsc -p tsconfig.ci.json --noEmit && bun run build
  • NX_DAEMON=false pnpm nx test web --skip-nx-cache (1 file, 2 tests)
  • NX_DAEMON=false pnpm nx typecheck web --skip-nx-cache
  • NX_DAEMON=false pnpm nx build web --skip-nx-cache
  • NX_DAEMON=false pnpm nx run web:typecheck-tsgo --skip-nx-cache
  • rm -rf packages/diagram-core/dist packages/diagram-renderer/dist packages/diagram-studio-ui/dist packages/diagram-agent-tools/dist packages/diagram-exporter/dist packages/mcp-server/dist apps/web/dist tools/sketchi-generators/dist && NX_DAEMON=false pnpm nx run-many -t typecheck,test,build --skip-nx-cache (10 projects)
  • NX_DAEMON=false pnpm nx run-many -t typecheck-tsgo --skip-nx-cache (7 projects)
  • NX_DAEMON=false pnpm nx test-storybook diagram-studio-ui --skip-nx-cache verified 7 source story files across 11 static Storybook stories
  • pnpm exec wrangler deploy --dry-run --config dist/server/wrangler.json
  • NX_DAEMON=false pnpm nx graph --affected --file=.memory/nx-affected-diagram-exporter.html
  • NX_DAEMON=false pnpm nx graph --affected --file=.memory/nx-affected-router-search.html
  • pnpm dev reached Vite ready on http://127.0.0.1:5174/; agent-browser smoke opened /?diagram=flowchart, saw the flowchart prompt, clicked Architecture, and verified the URL changed to /?diagram=architecture

Notes

  • The pnpm dev failure on old main happens because that branch stores catalog entries under package.json > workspaces.catalog; pnpm expects catalogs in pnpm-workspace.yaml. This v2 branch has the pnpm workspace file and pnpm dev starts cleanly.
  • diagram_grade remains host-owned because it depends on the OpenCode LLM client; diagram_to_png is now available in the generic MCP default executor through @sketchi/diagram-exporter.
  • The MCP stdio entrypoint is intentionally NodeNext-shaped and was runtime-smoked from built dist; this caught and fixed extensionless ESM imports before push.
  • The PR-only component-contract hardening was reverted in 2ecee2d; that work is moving to /home/anandpant/Development/shpitdev/sketchi-v2-lab.
  • Current pushed SHA: 2ecee2d.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant