Repository navigation
feat(cloud-sync): add @deepnote/cloud-sync with sync manifest and path modules - #554
Conversation
…h modules Move the `.deepnote-sync.json` manifest and local path planning out of `packages/cli/src/utils/` into a new Node-only workspace package so other consumers (e.g. the VS Code extension) can import them. CLI behavior, flags, output and the manifest format (`version: 1`) are unchanged. - scaffold `packages/cloud-sync` following the `@deepnote/cloud` library package convention - `git mv` sync-manifest and sync-paths (and their tests) into the package - add a package-local `isErrnoENOENT` so the package does not depend on the CLI's `file-resolver` (which imports CLI output helpers) - point the CLI's imports, test mocks and dependency list at the package - register the package in AGENTS.md and CONTRIBUTING.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZwreo9KDxDk4VuSXgzmC2
|
@coderabbitai full review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
💤 Files with no reviewable changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe changes add the Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to No identified issue blocks merging. Publish 🚥 Pre-merge checks | ✅ 4 | ❌ 1 | ❓ 1❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 11 files. (5 skipped: 5 unsupported.) Full details: Updates DocsExplanation OSS documentation is updated. The PR adds
Warning Some tools did not complete. Review the errors below. 🔧 LanguageToolLanguageTool checks were skipped: reviews.tools.languagetool.enabled_only requires at least one selection in enabled_rules or enabled_categories. Select rules/categories, set enabled_only to false to use the default rules, or set enabled to false to disable LanguageTool. 🔧 Biome (2.5.14)packages/cli/package.jsonBiome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins. packages/cli/src/commands/publish.tsBiome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins. packages/cli/src/commands/sync.test.tsBiome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.
Comment |
✅ Action performedFull review finished. |
…oauth-cli Git merged the 22 commits from main without conflicts. One break it could not see: #554 moved packages/cli/src/utils/sync-paths.ts into @deepnote/cloud-sync, whose public index does not export sanitizePathSegment, so the token store's import no longer resolved. The token store now replaces the characters no file name may contain with its own one-line filter instead of exporting a sync helper from cloud-sync. Sync's other rules (trailing dots, reserved device names, length cap) do not apply to a name that always ends in -<digest>.json. The pinned on-disk names in token-store.test.ts are unchanged, including the one id with a character the filter rewrites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jie4G5Ukh3B8MjSjp9DPDn

Summary
Handling of the
.deepnote-sync.jsonmanifest and local path planning lived inpackages/cli/src/utils/, where no other package could import them. This adds a Node-only workspace package,@deepnote/cloud-sync(packages/cloud-sync/), that owns both modules;@deepnote/clinow imports them from it. It is the base for extracting the sync engine, app publishing and Streamlit registration, and gives other consumers (e.g. the VS Code extension) a public API for reading the sync manifest.CLI behavior is unchanged: no change to flags, output, exit codes or the manifest format (
version: 1).Changes
packages/cloud-sync:package.json,tsdown.config.ts,README.mdandsrc/index.ts, following the@deepnote/cloudlibrary-package convention. Depends on@deepnote/cloudandzod.git mv(history is preserved,git log --followworks):sync-manifest.ts,sync-paths.tsand their tests. The only edit to a moved file issync-manifest.tsimportingisErrnoENOENTfrom./fs-errors.src/fs-errors.ts: package-localisErrnoENOENT. The CLI'sfile-resolver.tsstays in the CLI because it imports the CLI's output helpers. Not exported fromindex.ts.src/index.tsexports exactly the symbols the CLI uses (11 fromsync-manifest, 5 fromsync-paths);emptySyncManifest,sanitizePathSegment,PROJECT_FILES_DIR_NAME,FolderPathSegmentandPlannableProjectstay module-internal.vi.mock/vi.importActualspecifiers incommands/sync.test.ts, theManifestFileRecordimport inutils/publish-mirror.test.ts, and the dependency inpackages/cli/package.json.AGENTS.mdandCONTRIBUTING.md; the package README documents the manifest read API as the supported way to detect and read synced folders.Verification
Run on this branch:
pnpm typecheck,pnpm biome:checkandpnpm prettier:checkexit 0.pnpm --filter @deepnote/cloud-sync run buildproducesdist/index.js,dist/index.cjsanddist/index.d.ts;pnpm --filter '@deepnote/cli...' run buildbuilds@deepnote/cloud-syncbefore@deepnote/cli.pnpm install --frozen-lockfileaccepts the lockfile.vitest run): 3373 passed, 3 failed. The 3 failures are inpackages/cli/src/commands/run.test.tsand fail identically onmainwithout this change. All 35 moved tests and everysync/publish-mirror/publishCLI test pass.packages/cloud-sync/src(non-test) has no import ofcommander,chalk,ora,@inquirer/prompts,dotenvor@deepnote/cli, and noprocess.orconsole.reference.Beyond the spec:
fs-errors.test.tsadds 8 tests for the new helper. I confirmed that a mutant requiringinstanceof Errorfails the plain-object case.pnpm-lock.yamlcontains only the newpackages/cloud-syncimporter and the CLI's link. A newer local pnpm also wanted to add unrelateddeprecated:lines to@yuku-*packages; I left those out.Before releasing
@deepnote/clipnpm publishrewritesworkspace:*to the exact sibling version, so@deepnote/cloud-syncmust be on npm before the first@deepnote/clirelease that includes this change:@deepnote/cloud-sync@0.1.0(needs release rights and thereleaseenvironment'sNPM_TOKEN).cd.ymlto finish;npm view @deepnote/cloud-sync@0.1.0 versionshould print0.1.0.@deepnote/clias usual.If the publish step fails with 403/404, the npm token lacks permission to create new packages in the
@deepnotescope and an npm organization owner needs to grant it.🤖 Generated with Claude Code
https://claude.ai/code/session_01NZwreo9KDxDk4VuSXgzmC2
Summary by CodeRabbit