Repository navigation
Migrate to monorepo - #215
Conversation
- auto updates imports - creates minimal package.json and tsconfig - does not compile
- auto update imports - creates minimal package.json and tsconfig - does not compile
- auto updates imports - creates minimal package.json and tsconfig - does not compile
- for dependency injection (next commit) so that core doesn't depend on app - Defines both interfaces in packages/core/src/types.ts and adds a barrel export in packages/core/src/index.ts - settings.ts re-exports from core.
- conflictDetector now accepts a GitOperations param instead of importing gitIntegration directly; - applyAutoResolutions requires settings explicitly; - semanticResolution imports MergeNBSettings from core types.
- Root tsconfig uses moduleResolution bundler and covers apps/ + packages/ - each package tsconfig extends root - package.json files add main/types fields.
- Corrects ../ depth in extension imports, fixes webServer/index.ts paths, - updates esbuild.js entry points to apps/ and packages/ locations.
- test utils that are shared across vscode and web infra
- update tooling to point at new output paths - move playwright and vscode tests to their respective (`packages/web/tests` and `apps/vscode-extension/tests/`) locations
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR reorganizes the repository into apps/packages/test-fixtures, extracts core/shared types/functions into Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant VSCode as VSCode Extension
participant Core as packages/core (conflictDetector)
participant Git as Git (repo)
participant WebSrv as Web Server
participant Playwright as Playwright / Web Client Test
VSCode->>Core: detectSemanticConflicts(filePath, { getThreeWayVersions, getCurrentBranch, getMergeBranch })
Core->>Git: getThreeWayVersions(filePath)
Git-->>Core: { base, current, incoming }
Core->>Git: getCurrentBranch(filePath)
Core-->>VSCode: NotebookSemanticConflict | null
VSCode->>WebSrv: start/getWebServer()
WebSrv-->>Playwright: serve conflict data (UnifiedConflictData)
Playwright->>VSCode: send ResolutionMessage (resolvedRows)
VSCode->>Core: applySemanticResolutionsFromRows(resolvedRows)
Core-->>VSCode: AutoResolveResult / updated notebook
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/web/client/src/components/ConflictResolver.tsx (1)
722-724:⚠️ Potential issue | 🟡 MinorOrphaned JSDoc comment at end of file.
The file ends with a JSDoc block (
/** Build merge rows from semantic conflict data. */) with no following function definition. This appears to be a leftover from removed or relocated code.🔧 Suggested fix
- -/** - * Build merge rows from semantic conflict data. - */🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/web/client/src/components/ConflictResolver.tsx` around lines 722 - 724, Remove the orphaned JSDoc comment at the end of ConflictResolver.tsx (the block that reads "Build merge rows from semantic conflict data.") or reattach it to the actual implementation of the merge-row builder (e.g., the buildMergeRows / buildMergeRowsFromSemanticConflicts function) if that function exists elsewhere; ensure the file no longer ends with a standalone JSDoc block so comments correctly describe the associated function or are removed.packages/web/tests/fixtures.ts (1)
160-166:⚠️ Potential issue | 🟠 MajorCorrect the extension URI path to reach the repository root.
path.resolve(__dirname, '../../..')from the compiled locationout/packages/web/tests/resolves toout/, not the repository root. Thedist/webdirectory is built at the repository root (see esbuild.js line 52), so this path is incorrect.Use
'../../../..'(4 levels) instead, matching the pattern inapps/vscode-extension/tests/testHarness.ts:209. The same issue affectspackages/web/tests/globalSetup.ts:20.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/web/tests/fixtures.ts` around lines 160 - 166, The extension URI passed to server.setExtensionUri in getWebServer usage is resolving to the wrong folder; change the path argument in the setExtensionUri call from path.resolve(__dirname, '../../..') to path.resolve(__dirname, '../../../..') so it points to the repository root (update the call in packages/web/tests/fixtures.ts where server.setExtensionUri is invoked, and apply the same fix to the analogous call in packages/web/tests/globalSetup.ts). Ensure you only update the string path component to add one more "../" so dist/web at repo root is targeted.
🧹 Nitpick comments (2)
packages/web/client/README.md (1)
1-1: Add trailing newline.Same as the server README—add a newline at end of file for POSIX compliance.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/web/client/README.md` at line 1, Add a single trailing newline character at the end of the packages/web/client README.md so the file ends with a newline for POSIX compliance; open README.md and ensure the last line "Frontend for all conflict resolution across apps" is followed by a newline character (save the file so the newline is present).packages/web/server/README.md (1)
1-1: Add trailing newline.POSIX convention expects files to end with a newline character to avoid issues with certain tools.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/web/server/README.md` at line 1, The README entry "WebSocket server for browser-app communication." is missing a trailing newline; open the file and ensure the final line ends with a single newline character (append '\n' at EOF) so the file conforms to POSIX convention and avoids tooling issues, then save/commit the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/semanticResolution.ts`:
- Around line 6-7: The ResolvedRow type is imported from the web/server module,
creating an unwanted web dependency; extract the ResolvedRow interface into the
core public types module (the core types file) and update imports so
semanticResolution.ts (and any web client/server copies) import ResolvedRow from
core instead; ensure functions that use it — BuildResolvedNotebookOptions,
getCellForSide, isConsistentTakeAllSelection, inferPreferredSide — keep their
signatures and are updated to reference the new core types export.
In `@packages/web/client/public/index.html`:
- Line 7: The preload link currently uses rel="preload" as="style" which will
fetch but not apply the font stylesheet; change the markup that creates the
preload link (the <link rel="preload" as="style" ...> element) to either add an
onload handler that sets its rel to "stylesheet" after loading (e.g.,
onload="this.rel='stylesheet'") or keep the preload and add a separate <link
rel="stylesheet" href="..."> for the same href so the stylesheet is actually
applied; update the same link element referenced in index.html accordingly.
In `@tsconfig.json`:
- Around line 16-22: The tsconfig.json "include" array is missing the
apps/**/*.tsx glob so .tsx files under apps/ won't be type-checked; update the
"include" entry for "apps" (the include array in tsconfig.json) to add
"apps/**/*.tsx" alongside "apps/**/*.ts" so both .ts and .tsx files in the apps
folder are included by the TypeScript compiler.
---
Outside diff comments:
In `@packages/web/client/src/components/ConflictResolver.tsx`:
- Around line 722-724: Remove the orphaned JSDoc comment at the end of
ConflictResolver.tsx (the block that reads "Build merge rows from semantic
conflict data.") or reattach it to the actual implementation of the merge-row
builder (e.g., the buildMergeRows / buildMergeRowsFromSemanticConflicts
function) if that function exists elsewhere; ensure the file no longer ends with
a standalone JSDoc block so comments correctly describe the associated function
or are removed.
In `@packages/web/tests/fixtures.ts`:
- Around line 160-166: The extension URI passed to server.setExtensionUri in
getWebServer usage is resolving to the wrong folder; change the path argument in
the setExtensionUri call from path.resolve(__dirname, '../../..') to
path.resolve(__dirname, '../../../..') so it points to the repository root
(update the call in packages/web/tests/fixtures.ts where server.setExtensionUri
is invoked, and apply the same fix to the analogous call in
packages/web/tests/globalSetup.ts). Ensure you only update the string path
component to add one more "../" so dist/web at repo root is targeted.
---
Nitpick comments:
In `@packages/web/client/README.md`:
- Line 1: Add a single trailing newline character at the end of the
packages/web/client README.md so the file ends with a newline for POSIX
compliance; open README.md and ensure the last line "Frontend for all conflict
resolution across apps" is followed by a newline character (save the file so the
newline is present).
In `@packages/web/server/README.md`:
- Line 1: The README entry "WebSocket server for browser-app communication." is
missing a trailing newline; open the file and ensure the final line ends with a
single newline character (append '\n' at EOF) so the file conforms to POSIX
convention and avoids tooling issues, then save/commit the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 61354b9f-27a1-458f-a11f-1bbfa9425f57
⛔ Files ignored due to path filters (1)
test-fixtures/logo.svgis excluded by!**/*.svg
📒 Files selected for processing (108)
AGENTS.mdREADME.mdapps/vscode-extension/extension.tsapps/vscode-extension/gitIntegration.tsapps/vscode-extension/package.jsonapps/vscode-extension/resolver.tsapps/vscode-extension/settings.tsapps/vscode-extension/tests/auUaPickOneRegression.test.tsapps/vscode-extension/tests/duUdPickOneRegression.test.tsapps/vscode-extension/tests/e2eResolution.test.tsapps/vscode-extension/tests/gitTestUtils.tsapps/vscode-extension/tests/logicRegression.test.tsapps/vscode-extension/tests/nbdimeGuard.test.tsapps/vscode-extension/tests/runIntegrationTest.tsapps/vscode-extension/tests/runNbdimeGuardTest.tsapps/vscode-extension/tests/settingsFile.tsapps/vscode-extension/tests/statusIndicatorsRegression.test.tsapps/vscode-extension/tests/testHarness.tsapps/vscode-extension/tests/unmergedStatusMatrix.test.tsapps/vscode-extension/tests/vscodeRegression.test.tsapps/vscode-extension/tsconfig.jsonapps/vscode-extension/typings/git.d.tsapps/vscode-extension/web/WebConflictPanel.tsesbuild.jspackage.jsonpackages/core/README.mdpackages/core/package.jsonpackages/core/src/cellMatcher.tspackages/core/src/conflictDetector.tspackages/core/src/index.tspackages/core/src/logger.tspackages/core/src/notebookParser.tspackages/core/src/notebookUtils.tspackages/core/src/positionUtils.tspackages/core/src/semanticResolution.tspackages/core/src/types.tspackages/core/src/types/katexAutoRender.d.tspackages/core/tsconfig.jsonpackages/web/client/README.mdpackages/web/client/package.jsonpackages/web/client/public/index.htmlpackages/web/client/src/components/App.tsxpackages/web/client/src/components/CellContent.tsxpackages/web/client/src/components/ConflictResolver.tsxpackages/web/client/src/components/MergeRow.tsxpackages/web/client/src/hooks/useWebSocket.tspackages/web/client/src/index.tsxpackages/web/client/src/store/resolverStore.tspackages/web/client/src/styles.tspackages/web/client/src/types.tspackages/web/client/src/utils/markdown.tspackages/web/client/src/utils/mergeRowBuilder.tspackages/web/client/src/utils/reorderUtils.tspackages/web/client/tsconfig.jsonpackages/web/server/README.mdpackages/web/server/package.jsonpackages/web/server/src/index.tspackages/web/server/src/webServer.tspackages/web/server/src/webTypes.tspackages/web/server/tsconfig.jsonpackages/web/tests/fixtures.tspackages/web/tests/globalSetup.tspackages/web/tests/globalTeardown.tspackages/web/tests/incomingNonConflictRegression.spec.tspackages/web/tests/perCellResolution.spec.tspackages/web/tests/rendermimeOutputs.spec.tspackages/web/tests/reorderUnmatch.spec.tspackages/web/tests/reorderUnmatchApplyDisk.spec.tspackages/web/tests/settingsMatrix.spec.tspackages/web/tests/syntaxHighlighting.spec.tspackages/web/tests/takeAllButtons.spec.tspackages/web/tests/undoRedoActions.spec.tspackages/web/tests/unmatchGuardNoReorder.spec.tsplaywright.config.tssrc/tests/README.mdtest-fixtures/02_Spectral_Hashing_and_OMS.ipynbtest-fixtures/02_base.ipynbtest-fixtures/02_current.ipynbtest-fixtures/02_incoming.ipynbtest-fixtures/03_base.ipynbtest-fixtures/03_current.ipynbtest-fixtures/03_incoming.ipynbtest-fixtures/04_base.ipynbtest-fixtures/04_current.ipynbtest-fixtures/04_incoming.ipynbtest-fixtures/05_mime_base.ipynbtest-fixtures/05_mime_current.ipynbtest-fixtures/05_mime_incoming.ipynbtest-fixtures/06_base.ipynbtest-fixtures/06_current.ipynbtest-fixtures/06_incoming.ipynbtest-fixtures/07_syntax_base.ipynbtest-fixtures/07_syntax_current.ipynbtest-fixtures/07_syntax_incoming.ipynbtest-fixtures/08_settings_base.ipynbtest-fixtures/08_settings_current.ipynbtest-fixtures/08_settings_incoming.ipynbtest-fixtures/09_reorder_base.ipynbtest-fixtures/09_reorder_current.ipynbtest-fixtures/09_reorder_incoming.ipynbtest-fixtures/demo_base.ipynbtest-fixtures/demo_current.ipynbtest-fixtures/demo_incoming.ipynbtest-fixtures/shared/integrationUtils.tstest-fixtures/shared/repoSetup.tstest-fixtures/shared/testHelpers.tstest-fixtures/shared/testRunnerShared.tstsconfig.json
💤 Files with no reviewable changes (2)
- packages/web/server/src/index.ts
- src/tests/README.md
- VSCode tests need this Let's compare the two build systems. old: "module": "commonjs" + "moduleResolution": "node" + "esModuleInterop": true new: "module": "ES2022" + "moduleResolution": "bundler" benefit: more accurate type checking, and how esbuild would actually resolve modules - including `exports` field in package.json drawback: tsconfig no longer doubles as a compile config for directly run node files.
94921d1 to
6886958
Compare
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- as opposed to simply fetching the resource Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Motivation
In order to create a git mergetool, AND have a codebase that follows DRY principles, creating a monorepo is somewhat necessary.
Solution
Refactor
core(algorithms/utilities),web/client(UI),web/server(WebSocket). Migrated VS Code extension toapps/vscode-extension.Tests
packages/web/testsandapps/vscode-extension/tests/) locations.Docs
Summary by CodeRabbit
Release Notes
Refactor
apps/vscode-extension/and web components intopackages/web/, with shared utilities inpackages/core/.Documentation