@cardstack/boxel-cli 0.3.0-unstable.58 → 0.3.0-unstable.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardstack/boxel-cli",
3
- "version": "0.3.0-unstable.58",
3
+ "version": "0.3.0-unstable.87",
4
4
  "license": "MIT",
5
5
  "description": "CLI tools for Boxel workspace management",
6
6
  "main": "./dist/index.js",
@@ -58,8 +58,8 @@
58
58
  "ts-node": "^10.9.1",
59
59
  "vite": "^6.3.2",
60
60
  "vitest": "^2.1.9",
61
- "@cardstack/local-types": "0.0.0",
62
61
  "@cardstack/postgres": "0.0.0",
62
+ "@cardstack/local-types": "0.0.0",
63
63
  "@cardstack/runtime-common": "1.0.0"
64
64
  },
65
65
  "publishConfig": {
@@ -51,6 +51,11 @@ class RealmSyncer extends RealmSyncBase {
51
51
  remoteDeletedFiles: string[] = [];
52
52
  localDeletedFiles: string[] = [];
53
53
  skippedConflicts: string[] = [];
54
+ // Top-level message from a failed /_atomic batch (e.g. "Atomic upload
55
+ // failed: 500 Internal Server Error"). Surfaced in `SyncResult.error`
56
+ // so callers don't have to scrape stderr to learn why the batch
57
+ // failed.
58
+ uploadFatalMessage?: string;
54
59
 
55
60
  constructor(
56
61
  private syncOptions: BiSyncOptions,
@@ -320,7 +325,24 @@ class RealmSyncer extends RealmSyncBase {
320
325
  this.pushedFiles.push(...result.succeeded);
321
326
  if (result.error) {
322
327
  this.hasError = true;
323
- console.error(result.error.message);
328
+ // Fold the per-file titles into the surfaced message so
329
+ // SyncResult.error carries the server's JSON:API error
330
+ // payload (e.g. "Write Error"), not just the HTTP status
331
+ // line. Distinct titles only — repeated identical titles
332
+ // (the common case for a top-level write failure) would
333
+ // otherwise produce noisy duplicates. The summary line is
334
+ // re-echoed by registerSyncCommand at the end of the run
335
+ // via `Error: ${result.error}`, so we no longer also emit
336
+ // the standalone status line inline — that would duplicate
337
+ // it in CLI output. The per-file loop stays because it
338
+ // carries path-level detail the summary aggregates away.
339
+ let titles = Array.from(
340
+ new Set(result.error.perFile.map((e) => e.title)),
341
+ );
342
+ this.uploadFatalMessage =
343
+ titles.length > 0
344
+ ? `${result.error.message} (${titles.join('; ')})`
345
+ : result.error.message;
324
346
  for (const entry of result.error.perFile) {
325
347
  console.error(` ${entry.path}: ${entry.title}`);
326
348
  }
@@ -679,7 +701,11 @@ function buildSyncErrorMessage(syncer: RealmSyncer): string {
679
701
  `${syncer.skippedConflicts.length} conflicts skipped`,
680
702
  ].join(', ');
681
703
 
682
- return `Sync completed with errors. ${summary}.`;
704
+ let base = `Sync completed with errors. ${summary}.`;
705
+ if (syncer.uploadFatalMessage) {
706
+ return `${base} ${syncer.uploadFatalMessage}`;
707
+ }
708
+ return base;
683
709
  }
684
710
  function emptyResult(partial: Pick<SyncResult, 'error'>): SyncResult {
685
711
  return {