@secondlayer/cli 5.4.7 → 5.4.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/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.7",
32324
+ version: "5.4.8",
32325
32325
  description: "CLI for subgraphs and blockchain indexing on Stacks",
32326
32326
  type: "module",
32327
32327
  bin: {
@@ -33203,18 +33203,20 @@ async function createSubscription(name, opts) {
33203
33203
  }
33204
33204
  const eventName = `${subgraph}.${table}.created`;
33205
33205
  const targetDir = resolve(process.cwd(), name);
33206
- if (existsSync(targetDir)) {
33207
- error(`Directory already exists: ${relative(process.cwd(), targetDir)}`);
33208
- process.exit(1);
33206
+ if (!opts.noScaffold) {
33207
+ if (existsSync(targetDir)) {
33208
+ error(`Directory already exists: ${relative(process.cwd(), targetDir)}`);
33209
+ process.exit(1);
33210
+ }
33211
+ const tplRoot = templatesRoot();
33212
+ const tplDir = join4(tplRoot, runtime);
33213
+ info(`Scaffolding ${blue(runtime)} template at ${blue(targetDir)}`);
33214
+ copyTemplate(tplDir, targetDir, {
33215
+ NAME: name,
33216
+ EVENT_NAME: eventName,
33217
+ TASK_ID: `${subgraph}-${table}`
33218
+ });
33209
33219
  }
33210
- const tplRoot = templatesRoot();
33211
- const tplDir = join4(tplRoot, runtime);
33212
- info(`Scaffolding ${blue(runtime)} template at ${blue(targetDir)}`);
33213
- copyTemplate(tplDir, targetDir, {
33214
- NAME: name,
33215
- EVENT_NAME: eventName,
33216
- TASK_ID: `${subgraph}-${table}`
33217
- });
33218
33220
  let signingSecret = null;
33219
33221
  let provisioningFailed = false;
33220
33222
  if (!opts.skipApi) {
@@ -33250,7 +33252,7 @@ async function createSubscription(name, opts) {
33250
33252
  subscriptionStatus = created?.status;
33251
33253
  } catch {}
33252
33254
  }
33253
- if (signingSecret) {
33255
+ if (signingSecret && !opts.noScaffold) {
33254
33256
  const envTarget = join4(targetDir, ".env");
33255
33257
  const envExample = join4(targetDir, ".env.example");
33256
33258
  if (existsSync(envExample) && !existsSync(envTarget)) {
@@ -33266,6 +33268,8 @@ SIGNING_SECRET=${signingSecret}
33266
33268
  `);
33267
33269
  }
33268
33270
  success(`Signing secret written to ${relative(process.cwd(), envTarget)}`);
33271
+ } else if (signingSecret && opts.noScaffold) {
33272
+ info(`Signing secret (store securely): ${signingSecret}`);
33269
33273
  }
33270
33274
  console.log();
33271
33275
  if (provisioningFailed) {
@@ -33283,10 +33287,12 @@ SIGNING_SECRET=${signingSecret}
33283
33287
  const pausedLine = subscriptionStatus === "paused" ? `Subscription is paused. Resume:
33284
33288
  sl subscriptions resume ${name}
33285
33289
  ` : "";
33286
- success(`Done. Next:
33287
- ${dashboardLine}${pausedLine}cd ${name}
33290
+ const runHint = opts.noScaffold ? `View deliveries:
33291
+ sl subscriptions get ${name}` : `cd ${name}
33288
33292
  bun install
33289
- bun run dev`);
33293
+ bun run dev`;
33294
+ success(`Done. Next:
33295
+ ${dashboardLine}${pausedLine}${runHint}`);
33290
33296
  }
33291
33297
  function resolveSubscriptionClientConfig(opts, env = process.env, resolved) {
33292
33298
  const needsResolvedKey = !opts.serviceKey && !env.SL_SERVICE_KEY;
@@ -33321,7 +33327,7 @@ async function getSubscriptionClient(opts) {
33321
33327
  }
33322
33328
  function registerCreateCommand(program2) {
33323
33329
  const create = program2.command("create").description("Scaffold new resources (subscription receivers, etc.)");
33324
- create.command("subscription <name>").description("Scaffold a subscription receiver for a runtime").option("-r, --runtime <runtime>", "inngest | trigger | cloudflare | node").option("-s, --subgraph <name>", "Subgraph to subscribe to").option("-t, --table <name>", "Table to subscribe to").option("-u, --url <url>", "Webhook URL").option("--auth-token <token>", "Bearer token for receiver API auth").option("--filter <kv...>", "Filter as key=value (supports .eq/.neq/.gt/.gte/.lt/.lte suffixes)").option("--service-key <key>", "SL_SERVICE_KEY override").option("--base-url <url>", "SL_API_URL override").option("--skip-api", "Copy template only, don't call the API").action(async (name, options) => {
33330
+ create.command("subscription <name>").description("Scaffold a subscription receiver for a runtime").option("-r, --runtime <runtime>", "inngest | trigger | cloudflare | node").option("-s, --subgraph <name>", "Subgraph to subscribe to").option("-t, --table <name>", "Table to subscribe to").option("-u, --url <url>", "Webhook URL").option("--auth-token <token>", "Bearer token for receiver API auth").option("--filter <kv...>", "Filter as key=value (supports .eq/.neq/.gt/.gte/.lt/.lte suffixes)").option("--service-key <key>", "SL_SERVICE_KEY override").option("--base-url <url>", "SL_API_URL override").option("--skip-api", "Copy template only, don't call the API").option("--no-scaffold", "Skip the local runtime template directory (webhook-only setups)").action(async (name, options) => {
33325
33331
  await createSubscription(name, options);
33326
33332
  });
33327
33333
  }
@@ -37135,5 +37141,5 @@ registerAccountCommand(program);
37135
37141
  registerBillingCommand(program);
37136
37142
  program.parse();
37137
37143
 
37138
- //# debugId=3A9945EA76A81FFE64756E2164756E21
37144
+ //# debugId=3BA90AE1697DB54C64756E2164756E21
37139
37145
  //# sourceMappingURL=cli.js.map