feat(cloud-sync): add @deepnote/cloud-sync with sync manifest and path modules by tkislan · Pull Request #554 · deepnote/deepnote · GitHub
Skip to content

feat(cloud-sync): add @deepnote/cloud-sync with sync manifest and path modules - #554

Merged
tkislan merged 3 commits into
mainfrom
feat/cloud-sync-package
Oct 8, 2026
Merged

tkislan merged 3 commits into
mainfrom
feat/cloud-sync-package

Conversation

@tkislan

@tkislan tkislan commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Handling of the .deepnote-sync.json manifest and local path planning lived in packages/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/cli now 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

  • New package packages/cloud-sync: package.json, tsdown.config.ts, README.md and src/index.ts, following the @deepnote/cloud library-package convention. Depends on @deepnote/cloud and zod.
  • Moved with git mv (history is preserved, git log --follow works): sync-manifest.ts, sync-paths.ts and their tests. The only edit to a moved file is sync-manifest.ts importing isErrnoENOENT from ./fs-errors.
  • src/fs-errors.ts: package-local isErrnoENOENT. The CLI's file-resolver.ts stays in the CLI because it imports the CLI's output helpers. Not exported from index.ts.
  • src/index.ts exports exactly the symbols the CLI uses (11 from sync-manifest, 5 from sync-paths); emptySyncManifest, sanitizePathSegment, PROJECT_FILES_DIR_NAME, FolderPathSegment and PlannableProject stay module-internal.
  • CLI: imports, the vi.mock/vi.importActual specifiers in commands/sync.test.ts, the ManifestFileRecord import in utils/publish-mirror.test.ts, and the dependency in packages/cli/package.json.
  • Docs: package lists in AGENTS.md and CONTRIBUTING.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:check and pnpm prettier:check exit 0.
  • pnpm --filter @deepnote/cloud-sync run build produces dist/index.js, dist/index.cjs and dist/index.d.ts; pnpm --filter '@deepnote/cli...' run build builds @deepnote/cloud-sync before @deepnote/cli.
  • pnpm install --frozen-lockfile accepts the lockfile.
  • Tests (vitest run): 3373 passed, 3 failed. The 3 failures are in packages/cli/src/commands/run.test.ts and fail identically on main without this change. All 35 moved tests and every sync / publish-mirror / publish CLI test pass.
  • packages/cloud-sync/src (non-test) has no import of commander, chalk, ora, @inquirer/prompts, dotenv or @deepnote/cli, and no process. or console. reference.

Beyond the spec:

  • fs-errors.test.ts adds 8 tests for the new helper. I confirmed that a mutant requiring instanceof Error fails the plain-object case.
  • pnpm-lock.yaml contains only the new packages/cloud-sync importer and the CLI's link. A newer local pnpm also wanted to add unrelated deprecated: lines to @yuku-* packages; I left those out.

Before releasing @deepnote/cli

pnpm publish rewrites workspace:* to the exact sibling version, so @deepnote/cloud-sync must be on npm before the first @deepnote/cli release that includes this change:

  1. Publish a GitHub Release tagged @deepnote/cloud-sync@0.1.0 (needs release rights and the release environment's NPM_TOKEN).
  2. Wait for cd.yml to finish; npm view @deepnote/cloud-sync@0.1.0 version should print 0.1.0.
  3. Release @deepnote/cli as usual.

If the publish step fails with 403/404, the npm token lacks permission to create new packages in the @deepnote scope and an npm organization owner needs to grant it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZwreo9KDxDk4VuSXgzmC2

Summary by CodeRabbit

  • New Features
    • Added a reusable package for syncing local folders with Deepnote Cloud and publishing apps, now used by the CLI.
  • Documentation
    • Added package documentation covering installation, configuration, manifest tools, and local-path utilities.
    • Updated repository guides to include the new package.

…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
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

@tkislan

tkislan commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 44bc9eed-d1a4-4736-8f26-4cd0d8591deb
📥 Commits

Reviewing files that changed from the base of the PR and between f06b2c3 and 56647dc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • AGENTS.md
  • CONTRIBUTING.md
  • packages/cli/package.json
  • packages/cli/src/commands/publish.ts
  • packages/cli/src/commands/sync.test.ts
  • packages/cli/src/commands/sync.ts
  • packages/cli/src/utils/publish-mirror.test.ts
  • packages/cli/src/utils/publish-mirror.ts
  • packages/cli/src/utils/publish-streamlit-app.ts
  • packages/cloud-sync/README.md
  • packages/cloud-sync/package.json
  • packages/cloud-sync/src/fs-errors.test.ts
  • packages/cloud-sync/src/fs-errors.ts
  • packages/cloud-sync/src/index.ts
  • packages/cloud-sync/src/sync-manifest.test.ts
  • packages/cloud-sync/src/sync-manifest.ts
  • packages/cloud-sync/src/sync-paths.test.ts
  • packages/cloud-sync/src/sync-paths.ts
  • packages/cloud-sync/tsdown.config.ts
💤 Files with no reviewable changes (3)
  • packages/cloud-sync/src/sync-paths.test.ts
  • packages/cloud-sync/src/sync-manifest.test.ts
  • packages/cloud-sync/src/sync-paths.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • CONTRIBUTING.md
  • AGENTS.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The changes add the @deepnote/cloud-sync package, which exports sync-manifest and path utilities. The CLI now imports these utilities from the package. The package includes build configuration, documentation, and tests for its ENOENT predicate.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Suggested reviewers: jamesbhobbs

Merge Risk: ⚪ Minimal · up to 56647

No identified issue blocks merging. Publish @deepnote/cloud-sync before releasing the CLI that depends on it.

🚥 Pre-merge checks | ✅ 4 | ❌ 1 | ❓ 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
Updates Docs ❓ Inconclusive OSS documentation is updated. The PR adds packages/cloud-sync/README.md with installation, usage, API, and manifest guidance, and lists the package in AGENTS.md and CONTRIBUTING.md. The required… Confirm that the deepnote/deepnote-internal landing-page roadmap documents the new @deepnote/cloud-sync feature.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the @deepnote/cloud-sync package with sync manifest and path modules.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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 Docs

Explanation

OSS documentation is updated. The PR adds packages/cloud-sync/README.md with installation, usage, API, and manifest guidance, and lists the package in AGENTS.md and CONTRIBUTING.md. The required deepnote/deepnote-internal landing-page roadmap is outside the available checkout, so its update cannot be verified.

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 LanguageTool

LanguageTool 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.json

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

packages/cli/src/commands/publish.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

packages/cli/src/commands/sync.test.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

  • 10 others

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@tkislan
tkislan marked this pull request as ready for review October 7, 2026 20:10
@tkislan
tkislan requested a review from a team as a code owner October 7, 2026 20:10
@tkislan
tkislan merged commit d652474 into main Oct 8, 2026
22 checks passed
@tkislan
tkislan deleted the feat/cloud-sync-package branch October 8, 2026 07:50
@linear-code

linear-code Bot commented Oct 8, 2026

Copy link
Copy Markdown

tkislan added a commit that referenced this pull request Oct 22, 2026
…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
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.

2 participants