@secondlayer/cli 5.4.0 → 5.4.2

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/cli.js CHANGED
@@ -32321,7 +32321,7 @@ var {
32321
32321
  // package.json
32322
32322
  var package_default = {
32323
32323
  name: "@secondlayer/cli",
32324
- version: "5.4.0",
32324
+ version: "5.4.2",
32325
32325
  description: "CLI for subgraphs and blockchain indexing on Stacks",
32326
32326
  type: "module",
32327
32327
  bin: {
@@ -32365,9 +32365,9 @@ var package_default = {
32365
32365
  "@inquirer/prompts": "^8.2.0",
32366
32366
  "@secondlayer/bundler": "^0.3.5",
32367
32367
  "@secondlayer/sdk": "^3.6.0",
32368
- "@secondlayer/shared": "^6.4.1",
32368
+ "@secondlayer/shared": "^6.4.2",
32369
32369
  "@secondlayer/stacks": "^2.2.0",
32370
- "@secondlayer/subgraphs": "^2.0.2",
32370
+ "@secondlayer/subgraphs": "^2.0.3",
32371
32371
  "@biomejs/js-api": "^0.7.0",
32372
32372
  "@biomejs/wasm-nodejs": "^1.9.0",
32373
32373
  esbuild: "^0.19.0",
@@ -33468,6 +33468,10 @@ async function resolveSubscriptionRef(client, ref) {
33468
33468
  detail: await client.subscriptions.get(nameMatches[0].id)
33469
33469
  };
33470
33470
  }
33471
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
33472
+ if (!UUID_RE.test(ref)) {
33473
+ throw new Error(`Subscription "${ref}" not found.`);
33474
+ }
33471
33475
  return {
33472
33476
  id: ref,
33473
33477
  detail: await client.subscriptions.get(ref)
@@ -35385,7 +35389,7 @@ Stopped watching.`);
35385
35389
  });
35386
35390
  await new Promise(() => {});
35387
35391
  });
35388
- subgraphs.command("deploy <file>").description("Deploy a subgraph definition file").option("--version <semver>", "Explicit version (default: auto-increment patch)").option("--start-block <n>", "Override the subgraph definition startBlock for this deploy").option("--dry-run", "Validate and preview deploy without writing changes").option("--preview", "Alias for --dry-run").option("--force", "Skip confirmation prompt for reindex operations").option("--strict", "Run `tsc --noEmit` against the handler before deploy (slower; catches TS type errors)").action(async (file, options2) => {
35392
+ subgraphs.command("deploy <file>").description("Deploy a subgraph definition file").option("--start-block <n>", "Override the subgraph definition startBlock for this deploy").option("--dry-run", "Validate and preview deploy without writing changes").option("--preview", "Alias for --dry-run").option("--force", "Skip confirmation prompt for reindex operations").option("--strict", "Run `tsc --noEmit` against the handler before deploy (slower; catches TS type errors)").action(async (file, options2) => {
35389
35393
  try {
35390
35394
  const absPath = resolve2(file);
35391
35395
  const config = await loadConfig();
@@ -35417,7 +35421,7 @@ Stopped watching.`);
35417
35421
  if (dryRun) {
35418
35422
  printSubgraphDeployPreview(createSubgraphDeployPreview({
35419
35423
  ...validated,
35420
- version: options2.version ?? validated.version
35424
+ version: validated.version
35421
35425
  }, {
35422
35426
  bundleBytes: Buffer.byteLength(handlerCode, "utf8")
35423
35427
  }), {
@@ -35429,7 +35433,7 @@ Stopped watching.`);
35429
35433
  }
35430
35434
  const result = await deploySubgraphApi({
35431
35435
  name: effectiveDef.name,
35432
- version: options2.version,
35436
+ version: undefined,
35433
35437
  description: effectiveDef.description,
35434
35438
  sources: effectiveDef.sources,
35435
35439
  schema: effectiveDef.schema,
@@ -35451,6 +35455,8 @@ Stopped watching.`);
35451
35455
  };
35452
35456
  if (result.action === "unchanged") {
35453
35457
  info(`Subgraph "${effectiveDef.name}" is up to date (v${result.version} — no changes)`);
35458
+ } else if (result.action === "handler_updated") {
35459
+ success(`Subgraph "${effectiveDef.name}" handler updated (v${result.version} — schema unchanged, no reindex needed)`);
35454
35460
  } else if (result.action === "created") {
35455
35461
  success(`Subgraph "${effectiveDef.name}" created → v${result.version}`);
35456
35462
  await printDeployFooter();
@@ -35493,7 +35499,7 @@ Stopped watching.`);
35493
35499
  if (dryRun) {
35494
35500
  printSubgraphDeployPreview(createSubgraphDeployPreview({
35495
35501
  ...validated,
35496
- version: options2.version ?? validated.version
35502
+ version: validated.version
35497
35503
  }), {
35498
35504
  network: config.network,
35499
35505
  file: absPath,
@@ -35505,11 +35511,13 @@ Stopped watching.`);
35505
35511
  const { getDb: getDb2, closeDb } = await import("@secondlayer/shared/db");
35506
35512
  const db = getDb2();
35507
35513
  const result = await deploySchema(db, effectiveDef, absPath, {
35508
- version: options2.version,
35514
+ version: undefined,
35509
35515
  forceReindex: startBlock !== undefined
35510
35516
  });
35511
35517
  if (result.action === "unchanged") {
35512
35518
  info(`Subgraph "${effectiveDef.name}" is up to date (v${result.version} — no changes)`);
35519
+ } else if (result.action === "handler_updated") {
35520
+ success(`Subgraph "${effectiveDef.name}" handler updated (v${result.version} — schema unchanged, no reindex needed)`);
35513
35521
  } else if (result.action === "created") {
35514
35522
  success(`Subgraph "${effectiveDef.name}" created → v${result.version}`);
35515
35523
  } else if (result.action === "reindexed") {
@@ -37096,5 +37104,5 @@ registerAccountCommand(program);
37096
37104
  registerBillingCommand(program);
37097
37105
  program.parse();
37098
37106
 
37099
- //# debugId=7D07B6242D81B6A564756E2164756E21
37107
+ //# debugId=ACD7C55C0D9222F164756E2164756E21
37100
37108
  //# sourceMappingURL=cli.js.map