betterstart-cli 0.0.101 → 0.0.103

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/README.md CHANGED
@@ -1,5 +1 @@
1
- # betterstart-cli
2
-
3
- Preset- and integration-based BetterStart Admin CLI.
4
-
5
- > **Warning:** This project is a work in progress. Expect bugs, breaking changes, and incomplete features.
1
+ > **Warning:** This project is a work in progress. Do not use.
@@ -1,8 +1,3 @@
1
- // Client-safe barrel: only types and server actions. Server-only modules are
2
- // imported by path — emitWebhookEvent from './dispatch' and
3
- // registerWebhookHooks from './register' — so client components can import
4
- // this barrel without pulling node:crypto into the bundle.
5
-
6
1
  export { createWebhook } from './create-webhook'
7
2
  export { deleteWebhook } from './delete-webhook'
8
3
  export { getWebhookDeliveries } from './get-webhook-deliveries'
@@ -1,6 +1,7 @@
1
1
  'use server'
2
2
 
3
3
  import type { SendTestWebhookResult } from './types'
4
+ import { recordWebhookDelivery } from '@admin/actions/webhooks/record-webhook-delivery'
4
5
  import { requireRole, UserRole } from '@admin/auth/middleware'
5
6
  import db from '@admin/db'
6
7
  import { webhooks } from '@admin/db/schema'
@@ -8,7 +9,6 @@ import { toActionError } from '@admin/utils/error/to-action-error'
8
9
  import { createWebhookEventId } from '@admin/utils/webhook/create-webhook-event-id'
9
10
  import { signWebhookPayload } from '@admin/utils/webhook/sign-webhook-payload'
10
11
  import { eq } from 'drizzle-orm'
11
- import { recordWebhookDelivery } from './dispatch'
12
12
 
13
13
  const TEST_REQUEST_TIMEOUT_MS = 10_000
14
14
 
package/dist/cli.js CHANGED
@@ -97,6 +97,7 @@ import * as p7 from "@clack/prompts";
97
97
  // constants/commands.ts
98
98
  var ADD_COMMAND = "add";
99
99
  var CREATE_COMMAND = "create";
100
+ var DEFAULT_DATABASE_PLAN = "free_v3";
100
101
  var GENERATE_COMMAND = "generate";
101
102
  var INIT_COMMAND = "init";
102
103
  var REMOVE_COMMAND = "remove";
@@ -591,7 +592,10 @@ function createInitCommand(runtime) {
591
592
  ).option("--deploy-provider <provider>", "Deploy provider: vercel, railway, or none").option(
592
593
  "--use-existing-resources",
593
594
  "Require database/storage credentials from existing project env files; never provision them"
594
- ).option("--database-plan <id>", "Neon plan id for a Vercel-provisioned database").option("--railway-workspace <id-or-name>", "Railway workspace for a new project").option("--railway-project <id-or-name>", "Existing Railway project to intentionally reuse").option("--railway-environment <id-or-name>", "Railway environment (default: production)").option("--railway-service <id-or-name>", "Railway app service (default: web)").option(
595
+ ).option(
596
+ "--database-plan <id>",
597
+ `Neon plan id for a Vercel-provisioned database (default: ${DEFAULT_DATABASE_PLAN})`
598
+ ).option("--railway-workspace <id-or-name>", "Railway workspace for a new project").option("--railway-project <id-or-name>", "Existing Railway project to intentionally reuse").option("--railway-environment <id-or-name>", "Railway environment (default: production)").option("--railway-service <id-or-name>", "Railway app service (default: web)").option(
595
599
  "--railway-bucket-region <region>",
596
600
  "Railway bucket region: sjc, iad, ams, or sin (default: iad)"
597
601
  ).option("--force", "Overwrite all existing Admin files (nuclear option)").addHelpText(
@@ -2742,7 +2746,7 @@ import * as p11 from "@clack/prompts";
2742
2746
  var NEXT_ADAPTER_DEPS = [
2743
2747
  "@hookform/resolvers",
2744
2748
  "@tanstack/react-query",
2745
- "@tanstack/react-table",
2749
+ "@tanstack/react-table@^8.21.3",
2746
2750
  "@tanstack/react-virtual",
2747
2751
  "better-auth",
2748
2752
  "class-variance-authority",
@@ -28170,23 +28174,17 @@ function neonFailureMessage(reason) {
28170
28174
  import * as p57 from "@clack/prompts";
28171
28175
  import pc14 from "picocolors";
28172
28176
 
28173
- // adapters/next/init/vercel/neon/connected-neon-add-args.ts
28174
- function connectedNeonAddArgs(options) {
28175
- const addArgs = ["integration", "add", "neon"];
28176
- if (options.plan) addArgs.push("--plan", options.plan);
28177
- return addArgs;
28178
- }
28179
-
28180
28177
  // adapters/next/init/vercel/neon/find-accept-terms-url.ts
28181
28178
  function findAcceptTermsUrl(line) {
28182
28179
  return ACCEPT_TERMS_URL_PATTERN.exec(line)?.[0];
28183
28180
  }
28184
28181
 
28185
28182
  // adapters/next/init/vercel/neon/neon-add-args.ts
28186
- function neonAddArgs(options) {
28187
- const addArgs = ["integration", "add", "neon", "--format", "json"];
28188
- if (options.plan) addArgs.push("--plan", options.plan);
28189
- return addArgs;
28183
+ function neonAddArgs(options, output) {
28184
+ const args = ["integration", "add", "neon"];
28185
+ if (output === "json") args.push("--format", "json");
28186
+ args.push("--plan", options.plan ?? DEFAULT_DATABASE_PLAN);
28187
+ return args;
28190
28188
  }
28191
28189
 
28192
28190
  // adapters/next/init/vercel/neon/read-neon-provision-info.ts
@@ -28212,7 +28210,7 @@ async function provisionNeonInteractive(runner, cwd, options) {
28212
28210
  eraseRows(termsNotice.rows);
28213
28211
  p57.log.step(termsNotice.text);
28214
28212
  };
28215
- const quiet = await runVercel(runner, neonAddArgs(options), {
28213
+ const quiet = await runVercel(runner, neonAddArgs(options, "json"), {
28216
28214
  cwd,
28217
28215
  mode: "capture",
28218
28216
  timeoutMs: PROVISION_TIMEOUT_MS,
@@ -28245,10 +28243,8 @@ ${pc14.dim(termsUrl)}`,
28245
28243
  return readNeonProvisionInfo(quiet.stdout);
28246
28244
  }
28247
28245
  quietSpinner.clear();
28248
- p57.log.info(
28249
- `Create your Neon database in the Vercel prompts below ${pc14.dim("(the Free plan is recommended).")}`
28250
- );
28251
- const add = await runVercel(runner, connectedNeonAddArgs(options), {
28246
+ p57.log.info("Create your Neon database in the Vercel prompts below");
28247
+ const add = await runVercel(runner, neonAddArgs(options, "interactive"), {
28252
28248
  cwd,
28253
28249
  mode: "inherit",
28254
28250
  timeoutMs: INTERACTIVE_PROVISION_TIMEOUT_MS,
@@ -28264,7 +28260,7 @@ ${pc14.dim(termsUrl)}`,
28264
28260
  async function provisionNeon(runner, cwd, options) {
28265
28261
  const provisionSpinner = spinner2();
28266
28262
  provisionSpinner.start("Creating your Neon database");
28267
- const add = await runVercel(runner, neonAddArgs(options), {
28263
+ const add = await runVercel(runner, neonAddArgs(options, "json"), {
28268
28264
  cwd,
28269
28265
  mode: "capture",
28270
28266
  timeoutMs: PROVISION_TIMEOUT_MS,
@@ -31804,6 +31800,10 @@ var TEMPLATE_REGISTRY = {
31804
31800
  relPath: "utils/webhook/sign-webhook-payload.ts",
31805
31801
  content: () => readTemplate("utils/webhook/sign-webhook-payload.ts")
31806
31802
  },
31803
+ "webhook-events-data": {
31804
+ relPath: "data/webhook-events.ts",
31805
+ content: () => readTemplate("data/webhook-events.ts")
31806
+ },
31807
31807
  "dev-mode-code-block-height-utils": {
31808
31808
  relPath: "utils/dev-mode/code-block-height.ts",
31809
31809
  content: () => readTemplate("utils/dev-mode/code-block-height.ts")
@@ -31836,7 +31836,7 @@ var TEMPLATE_REGISTRY = {
31836
31836
  "lifecycle-hooks-register": {
31837
31837
  relPath: "lib/lifecycle-hooks/register.ts",
31838
31838
  content: () => readTemplate("lib/lifecycle-hooks/register.ts"),
31839
- dependencies: ["webhooks-register-action"]
31839
+ dependencies: ["webhooks-register-webhook-hooks"]
31840
31840
  },
31841
31841
  "lifecycle-hooks-register-local": {
31842
31842
  relPath: "lib/lifecycle-hooks/register.local.ts",
@@ -32365,7 +32365,14 @@ var TEMPLATE_REGISTRY = {
32365
32365
  dependencies: [
32366
32366
  "webhooks-action-types",
32367
32367
  "internal-get-active-endpoints-action",
32368
- "webhooks-dispatch",
32368
+ "webhooks-deliver-to-endpoint",
32369
+ "webhooks-deliver-webhook-event",
32370
+ "webhooks-emit-webhook-event",
32371
+ "webhooks-entity-event-payload",
32372
+ "webhooks-prune-webhook-deliveries",
32373
+ "webhooks-read-webhook-subscriptions",
32374
+ "webhooks-record-webhook-delivery",
32375
+ "webhooks-register-webhook-hooks",
32369
32376
  "get-webhooks-action",
32370
32377
  "create-webhook-action",
32371
32378
  "update-webhook-action",
@@ -32374,8 +32381,7 @@ var TEMPLATE_REGISTRY = {
32374
32381
  "regenerate-webhook-secret-action",
32375
32382
  "get-webhook-subscriptions-action",
32376
32383
  "send-test-webhook-action",
32377
- "get-webhook-deliveries-action",
32378
- "webhooks-register-action"
32384
+ "get-webhook-deliveries-action"
32379
32385
  ]
32380
32386
  },
32381
32387
  "webhooks-action-types": {
@@ -32389,42 +32395,51 @@ var TEMPLATE_REGISTRY = {
32389
32395
  "webhooks-deliver-to-endpoint": {
32390
32396
  relPath: "lib/actions/webhooks/deliver-to-endpoint.ts",
32391
32397
  content: () => readTemplate("lib/actions/webhooks/deliver-to-endpoint.ts"),
32392
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32398
+ dependencies: [
32399
+ "internal-get-active-endpoints-action",
32400
+ "webhooks-record-webhook-delivery",
32401
+ "webhook-sign-webhook-payload"
32402
+ ]
32393
32403
  },
32394
32404
  "webhooks-deliver-webhook-event": {
32395
32405
  relPath: "lib/actions/webhooks/deliver-webhook-event.ts",
32396
32406
  content: () => readTemplate("lib/actions/webhooks/deliver-webhook-event.ts"),
32397
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32407
+ dependencies: ["webhooks-deliver-to-endpoint", "internal-get-active-endpoints-action"]
32398
32408
  },
32399
32409
  "webhooks-emit-webhook-event": {
32400
32410
  relPath: "lib/actions/webhooks/emit-webhook-event.ts",
32401
32411
  content: () => readTemplate("lib/actions/webhooks/emit-webhook-event.ts"),
32402
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32412
+ dependencies: ["webhooks-deliver-webhook-event", "webhook-create-webhook-event-id"]
32403
32413
  },
32404
32414
  "webhooks-entity-event-payload": {
32405
32415
  relPath: "lib/actions/webhooks/entity-event-payload.ts",
32406
32416
  content: () => readTemplate("lib/actions/webhooks/entity-event-payload.ts"),
32407
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32417
+ dependencies: ["lifecycle-hooks-types"]
32408
32418
  },
32409
32419
  "webhooks-prune-webhook-deliveries": {
32410
32420
  relPath: "lib/actions/webhooks/prune-webhook-deliveries.ts",
32411
- content: () => readTemplate("lib/actions/webhooks/prune-webhook-deliveries.ts"),
32412
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32421
+ content: () => readTemplate("lib/actions/webhooks/prune-webhook-deliveries.ts")
32413
32422
  },
32414
32423
  "webhooks-read-webhook-subscriptions": {
32415
32424
  relPath: "lib/actions/webhooks/read-webhook-subscriptions.ts",
32416
32425
  content: () => readTemplate("lib/actions/webhooks/read-webhook-subscriptions.ts"),
32417
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32426
+ dependencies: ["webhooks-action-types"]
32418
32427
  },
32419
32428
  "webhooks-record-webhook-delivery": {
32420
32429
  relPath: "lib/actions/webhooks/record-webhook-delivery.ts",
32421
32430
  content: () => readTemplate("lib/actions/webhooks/record-webhook-delivery.ts"),
32422
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32431
+ dependencies: ["webhooks-prune-webhook-deliveries"]
32423
32432
  },
32424
32433
  "webhooks-register-webhook-hooks": {
32425
32434
  relPath: "lib/actions/webhooks/register-webhook-hooks.ts",
32426
32435
  content: () => readTemplate("lib/actions/webhooks/register-webhook-hooks.ts"),
32427
- dependencies: ["webhook-signature", "internal-get-active-endpoints-action"]
32436
+ dependencies: [
32437
+ "lifecycle-hooks-types",
32438
+ "lifecycle-hooks-registry",
32439
+ "webhooks-emit-webhook-event",
32440
+ "webhooks-entity-event-payload",
32441
+ "webhook-events-data"
32442
+ ]
32428
32443
  },
32429
32444
  "get-webhooks-action": {
32430
32445
  relPath: "lib/actions/webhooks/get-webhooks.ts",
@@ -32434,7 +32449,7 @@ var TEMPLATE_REGISTRY = {
32434
32449
  "create-webhook-action": {
32435
32450
  relPath: "lib/actions/webhooks/create-webhook.ts",
32436
32451
  content: () => readTemplate("lib/actions/webhooks/create-webhook.ts"),
32437
- dependencies: ["webhooks-action-types", "webhook-signature"]
32452
+ dependencies: ["webhooks-action-types", "webhook-generate-webhook-secret"]
32438
32453
  },
32439
32454
  "update-webhook-action": {
32440
32455
  relPath: "lib/actions/webhooks/update-webhook.ts",
@@ -32454,17 +32469,22 @@ var TEMPLATE_REGISTRY = {
32454
32469
  "regenerate-webhook-secret-action": {
32455
32470
  relPath: "lib/actions/webhooks/regenerate-webhook-secret.ts",
32456
32471
  content: () => readTemplate("lib/actions/webhooks/regenerate-webhook-secret.ts"),
32457
- dependencies: ["webhooks-action-types", "webhook-signature"]
32472
+ dependencies: ["webhooks-action-types", "webhook-generate-webhook-secret"]
32458
32473
  },
32459
32474
  "get-webhook-subscriptions-action": {
32460
32475
  relPath: "lib/actions/webhooks/get-webhook-subscriptions.ts",
32461
32476
  content: () => readTemplate("lib/actions/webhooks/get-webhook-subscriptions.ts"),
32462
- dependencies: ["webhooks-action-types"]
32477
+ dependencies: ["webhooks-action-types", "webhooks-read-webhook-subscriptions"]
32463
32478
  },
32464
32479
  "send-test-webhook-action": {
32465
32480
  relPath: "lib/actions/webhooks/send-test-webhook.ts",
32466
32481
  content: () => readTemplate("lib/actions/webhooks/send-test-webhook.ts"),
32467
- dependencies: ["webhooks-action-types", "webhook-signature", "webhooks-dispatch"]
32482
+ dependencies: [
32483
+ "webhooks-action-types",
32484
+ "webhook-create-webhook-event-id",
32485
+ "webhook-sign-webhook-payload",
32486
+ "webhooks-record-webhook-delivery"
32487
+ ]
32468
32488
  },
32469
32489
  "get-webhook-deliveries-action": {
32470
32490
  relPath: "lib/actions/webhooks/get-webhook-deliveries.ts",