feat: DrawIO export (CLI, Playground, round-trip) + CodeRabbit fixes#25
feat: DrawIO export (CLI, Playground, round-trip) + CodeRabbit fixes#25
Conversation
…e color fallbacks, cellId range assert, exporting guard, parseStyle JSDoc, single-diagram no re-parse 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. |
📝 WalkthroughWalkthroughThis PR adds an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Comment |
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
New Features
Bug Fixes
Improvements