@overscore/cli 0.13.6 → 0.13.8

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/dist/index.js CHANGED
@@ -176,7 +176,17 @@ async function apiRequest(method, urlPath, body, command) {
176
176
  }
177
177
  }
178
178
  if (!res.ok) {
179
- console.error(`\n Error: ${data.error || `HTTP ${res.status}`}\n`);
179
+ const errMsg = data.error || `HTTP ${res.status}`;
180
+ console.error(`\n Error: ${errMsg}\n`);
181
+ // The warehouse "no data connection" error is a common onboarding dead-end:
182
+ // a dataset-backed project has no BigQuery connection, but `query run`/`test`
183
+ // only hit BigQuery. Point the user at the path that actually works.
184
+ if (/no data connection/i.test(errMsg)) {
185
+ console.error(" This usually means one of two things:");
186
+ console.error(" • The project uses an uploaded dataset (not BigQuery). `query run`/`test` only hit");
187
+ console.error(" BigQuery — inspect dataset columns and sample rows with: npm run queries");
188
+ console.error(" • The project should use BigQuery but no warehouse is connected yet — connect it in the Hub.\n");
189
+ }
180
190
  process.exit(1);
181
191
  }
182
192
  return data;
@@ -268,6 +278,10 @@ const SOURCE_EXCLUDE = new Set([
268
278
  // this baseline exclusion protects the dashboard deploy path too, regardless of
269
279
  // whether a project has a .overscoreignore.
270
280
  "data",
281
+ // Vendored DuckDB runtime from a local-preview workaround (public/_runtime).
282
+ // Production serves /_runtime from the edge; shipping ~74MB of .wasm/.js would
283
+ // bloat the deploy. The built-files guard in deploy() also blocks it in dist/.
284
+ "_runtime",
271
285
  ]);
272
286
  const SECRET_FILE_EXTENSIONS = new Set([
273
287
  ".pem",
@@ -437,6 +451,30 @@ async function deploy() {
437
451
  }
438
452
  const builtFiles = collectFiles(distDir, "");
439
453
  console.log(` Found ${builtFiles.length} built files.`);
454
+ // Guard: a vendored DuckDB runtime (public/_runtime) gets copied into dist/ by
455
+ // Vite and would ship ~74MB of .wasm/.js that production already serves from the
456
+ // edge. This is a local-preview workaround that must never deploy. Fail closed
457
+ // unless explicitly overridden with --allow-runtime.
458
+ const runtimeFiles = builtFiles.filter((f) => f === "_runtime" || f.startsWith("_runtime/"));
459
+ if (runtimeFiles.length > 0 && !process.argv.includes("--allow-runtime")) {
460
+ let bytes = 0;
461
+ for (const f of runtimeFiles) {
462
+ try {
463
+ bytes += fs.statSync(path.join(distDir, f)).size;
464
+ }
465
+ catch {
466
+ // ignore unreadable entries when sizing
467
+ }
468
+ }
469
+ const mb = (bytes / (1024 * 1024)).toFixed(1);
470
+ console.error(`\n Deploy aborted: dist/_runtime contains ${runtimeFiles.length} file(s) (${mb}MB).`);
471
+ console.error(" This is a vendored DuckDB runtime, usually from a public/_runtime local-preview");
472
+ console.error(" workaround. Production serves /_runtime from the edge, so shipping it just bloats");
473
+ console.error(" the deploy.");
474
+ console.error("\n Fix: rm -rf public/_runtime (then deploy again)");
475
+ console.error(" Or pass --allow-runtime to deploy it anyway.\n");
476
+ process.exit(1);
477
+ }
440
478
  // Collect source files (skipped entirely with --no-source). Source is saved
441
479
  // for versioning/restore; symlinks and secrets are always excluded.
442
480
  const noSource = process.argv.includes("--no-source");
@@ -300,7 +300,8 @@ export async function templatePush(slugArg) {
300
300
  const sourceCount = sourceFiles.length;
301
301
  const listingUrl = data.detail_url
302
302
  ? `${HUB_URL}${data.detail_url}`
303
- : `${HUB_URL}/explore/${slug.replace("_", "/")}`;
303
+ : // Mirror the hub's templateExploreUrl: /u/{handle}/{slug} (first `_` only).
304
+ `${HUB_URL}/u/${slug.replace("_", "/")}`;
304
305
  console.log(`
305
306
  Pushed successfully!
306
307
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overscore/cli",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "description": "CLI for deploying Overscore dashboards and publishing analyses",
5
5
  "bin": {
6
6
  "overscore": "dist/index.js"