{{ message }}
Repository navigation
Commit 7c1d02f
fix(cloud-sync): drop CLI flag hints from library messages (#579)
* fix(cloud-sync): drop CLI flag hints from library messages
publishApp and syncWorkspace told library callers to pass CLI flags
(--no-sync-root, --prune, --url) or named them (--path, --all-files).
Callers have no flags; they need syncRoot: false, prune: true or baseUrl.
The library now ends those messages before the hint and marks the
condition in a field instead:
- PublishError (and PublishMirrorError) carry an optional
PublishErrorCode: 'sync-root-unusable' | 'project-not-in-sync-root'.
- The kept-deleted-files warning event carries code 'deleted-files-kept'.
- The pruned and missing-in-cloud outcome details no longer mention
--prune.
- The --path, --all-files and --url wording becomes neutral.
`deepnote publish` and `deepnote sync` add the same hints back, so their
stdout, stderr and -o json output are unchanged except for the three
neutral strings (target path, working-file transfer limit, API URL).
Closes #578
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
* feat(cloud-sync): return structured option hints for the CLI to translate
Alongside the codes, the library now says which option resolves each
condition, as an OptionHint ({ option: 'syncRoot', value: false } or
{ option: 'prune', value: true }):
- PublishError.hint, derived from its code
- the deleted-files-kept warning event
- the missing-in-cloud outcome kept because prune is off
The CLI maps a hint to its flag in one place (cliFlagFor) and builds the
same messages as before from it. `deepnote sync` no longer infers the
--prune hint from its own option, and drops the hint from the outcomes
it prints, so `-o json` output is unchanged.
* refactor(cloud-sync): type the publish hints per error code
PUBLISH_ERROR_HINTS is `as const satisfies`, PublishError.hint is the
exact PublishErrorHint (exported), cliFlagFor returns the literal flag
for the hint's option, and the CLI's publish sentences take the flag of
their own code. Output is unchanged.
Trim code comments that restated the code.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
* docs: drop stale and restating option-hint comments
ProjectSyncOutcome is no longer the `-o json` shape: the CLI strips
`hint` and folds its flag into `detail`. The keptDeletedFilesHint doc
spoke of several hints for one sentence. The other three comments
restated the code or the OptionHint and PublishErrorHint contracts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
* refactor(cloud-sync): type sync hints as prune-only and correct hint docs
The deleted-files-kept warning is now its own SyncEvent member with a
required prune hint, and ProjectSyncOutcome.hint is the prune hint
only. A syncRoot hint on either carrier no longer compiles, so the CLI
drops its `event.hint` guard and the test for a warning with a code but
no hint, a shape the library cannot emit.
Correct the docs that overstated behavior: pruning a missing-in-cloud
project whose path a live project reuses only drops its manifest record;
pushing an edited kept file raises a working-files-changed conflict
rather than restoring it; PublishMirrorError is rethrown only while the
folder is resolved and reported as mirror-incomplete while updating it.
Drop comments that restated the code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
* test(cli): drop sync test rows that only echo mocked library messages
The large.bin outcome row and the different-workspace refusal row passed a
copy of the reworded library message through the mocked syncWorkspace and
expected it back, so they could not catch the library returning to the old
flag wording; the cloud-sync tests cover that. The existing 'boom' and
'an Error' rows already cover pass-through, and the large.bin row gave
it.each a second test named "renders a 'error' outcome as its progress line".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
* test(cloud-sync): assert the full different-workspace refusal message
rejects.toThrow('<string>') passes whenever the thrown message contains the
string, so a flag hint appended to the refusal (for example "Pass --url to
fix.") went unnoticed. toThrow(new Error(...)) requires the exact message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
* Small fixes
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>1 parent 60b744f commit 7c1d02f
15 files changed
Lines changed: 501 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
30 | 45 | | |
31 | 46 | | |
32 | 47 | | |
| |||
102 | 117 | | |
103 | 118 | | |
104 | 119 | | |
105 | | - | |
| 120 | + | |
106 | 121 | | |
107 | 122 | | |
108 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
| 297 | + | |
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
314 | 347 | | |
315 | 348 | | |
316 | 349 | | |
| |||
340 | 373 | | |
341 | 374 | | |
342 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
343 | 397 | | |
344 | 398 | | |
345 | 399 | | |
| |||
538 | 592 | | |
539 | 593 | | |
540 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
541 | 684 | | |
542 | 685 | | |
543 | 686 | | |
| |||

0 commit comments