feat: DrawIO export (CLI, Playground, round-trip) + cleanup#22
Conversation
- config/filenames: isLikeC4Config/isLikeC4NonJsonConfig return boolean (no unsound type predicates) - .cursor/ gitignored, removed from tracking; AGENTS.md note for contributors - pako + @types/pako in pnpm catalog; generators use catalog: - parse-drawio: computeContainerTitles v.parent === cont.id; self-closing tag trim; TODO roundtrip - drawio-demo-export-import.spec: timeout 20s for fromWorkspace/layoutedModel tests - logger: ViteLogger Omit hasErrorLogged - ci-validate-in-docker: NODE_ENV after install; pnpm 10.29.3; version comment - vitest: configDefaults.exclude merged - Nitpicks: Write-Output, null checks (documentation-provider), JSDoc (HoverProvider, browser, handler), useDrawioContextMenuActions/Monaco/LanguageClientSync simplifications, generate-drawio html=1/sort comments, generate-drawio.spec duplication note + plain mockViewModel, e2e dead branch + $.nothrow, .gitignore comments Co-authored-by: Cursor <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR consolidates cleanup and improvements across the codebase: removes cursor configuration documentation, updates gitignore patterns, simplifies type signatures for config functions, improves error logging in draw.io and language server components, standardizes dependency management via pnpm catalog, adds Logger type casting in Vite configurations, and updates CI scripts and test configurations. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
…es/pako Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
…I typecheck Co-authored-by: Cursor <[email protected]>
…portError, setLayoutedModelApi) Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Summary
This PR adds DrawIO (draw.io) export to LikeC4: export views to
.drawioXML (single or multi-file), with optional round-trip options (layout, stroke colors/widths, edge waypoints), CLI command, and Playground context menu integration. It also includes a cleanup pass: removal of build artifacts that were accidentally committed, and addressing CodeRabbit review (actionable fixes + nitpicks).Features
Export to DrawIO
generateDrawio,generateDrawioMultiproduce draw.io-compatible XML; optionalGenerateDrawioOptionsfor layout override, stroke colors/widths per node, edge waypoints, and round-trip comment blocks in source.// likec4.layout.viewId,// likec4.strokeColor,// likec4.strokeWidth,// likec4.edge.waypointsin.c4source;parseDrawioRoundtripCommentsreads them for re-export after editing in draw.io.likec4 export drawio <path> -o <outdir>with options--all-in-one,--roundtrip,--uncompressed,--project,--use-dot.getSourceContentfor round-trip when used outside the provider.Tests & E2E
generate-drawio.spec.ts,drawio-demo-export-import.spec.ts(cloud-system demo, element/edge counts, loadable XML). Timeouts increased forfromWorkspace/layoutedModeltests.pnpm test:playgroundfrom e2e/).Cleanup & CodeRabbit fixes
Build artifacts removal
.js/.d.tsand PR temp docs that had been added in a previous commit (git add -A). All were verified to match strict criteria (only artifacts)..gitignoreupdated:*.spec.js,*.test.js,apps/playground/src/**/*.js,packages/*/src/**/*.js,.cursor/, and comments on scope.Actionable (CodeRabbit)
isLikeC4Config/isLikeC4NonJsonConfigreturnbooleaninstead of type predicates (they only check basename; narrowing full path was unsound).git-push-remotes.mdcremoved from tracking. AGENTS.md notes that contributors may use.cursor/rules/locally and should not commit it.pakoand@types/pakoadded to pnpm workspace catalog;packages/generatorsusescatalog:.computeContainerTitles, title cells are created withparent="${containerId}"by the generator; parse logic now usesv.parent === cont.idinstead ofv.parent === cont.parent. Self-closing tag detection uses full trimmed open tag. TODO added for round-trip comment parser deduplication.ViteLoggertype now omits bothdebugandhasErrorLoggedso they are optional for Vite.NODE_ENV=productionmoved to afterpnpm installso devDependencies are installed; Corepack pnpm set to 10.29.3 (match.tool-versions); comment added for version sync.configDefaults.excludewith custom patterns so default exclusions are preserved.Nitpicks
ci-validate-in-docker.ps1usesWrite-Outputinstead ofWrite-Host.parseDeploymentNodeandparseDeployedInstance(aligned withparseElement).startLanguageServer, drawio handler (sequential export comment).useDrawioContextMenuActions— passonExportErrordirectly; comment on stabilizingviewStatesfor useMemo. Monaco: passsetLayoutedModelApidirectly. LanguageClientSync:logger.warnin catch blocks for layouted model / layout view failures.html=1;at end of vertex style; comments forgetDefaultStrokeWidthand node sort. generate-drawio.spec: Comment on duplication with drawio-test-utils;mockViewModelas plain function (novi.fn). e2e: Removed redundant$.nothrow = false; simplified assertion message (dead branch). .gitignore: Comments on glob scope and personal workflow files.Changesets
.changeset/(e.g. drawio-cli-roundtrip-e2e, drawio-roundtrip-options, drawio-import-postpack).Checklist
Summary by CodeRabbit
Bug Fixes
Documentation
Tests
Chores