@wraps.dev/cli 1.1.2 → 1.1.3

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
@@ -598,7 +598,7 @@ To remove: wraps destroy --stack ${stackName}`,
598
598
  noStack: () => new WrapsError(
599
599
  "No Wraps infrastructure found in this AWS account",
600
600
  "NO_STACK",
601
- "Run: wraps init\nTo deploy new infrastructure",
601
+ "Run: wraps email init\nTo deploy new infrastructure",
602
602
  "https://wraps.dev/docs/cli/init"
603
603
  ),
604
604
  pulumiNotInstalled: () => new WrapsError(
@@ -3679,7 +3679,7 @@ async function config(options) {
3679
3679
  `No Wraps connection found for account ${pc3.cyan(identity.accountId)} in region ${pc3.cyan(region)}`
3680
3680
  );
3681
3681
  clack3.log.info(
3682
- `Use ${pc3.cyan("wraps init")} to create new infrastructure or ${pc3.cyan("wraps connect")} to connect existing.`
3682
+ `Use ${pc3.cyan("wraps email init")} to create new infrastructure or ${pc3.cyan("wraps email connect")} to connect existing.`
3683
3683
  );
3684
3684
  process.exit(1);
3685
3685
  }
@@ -4114,7 +4114,7 @@ async function connect(options) {
4114
4114
  if (scan.identities.length === 0) {
4115
4115
  clack5.log.warn("No SES identities found in this region.");
4116
4116
  clack5.log.info(
4117
- `Use ${pc5.cyan("wraps init")} to create new email infrastructure instead.`
4117
+ `Use ${pc5.cyan("wraps email init")} to create new email infrastructure instead.`
4118
4118
  );
4119
4119
  process.exit(0);
4120
4120
  }
@@ -4216,7 +4216,7 @@ async function connect(options) {
4216
4216
  clack5.log.warn("\nThe Pulumi stack is locked from a previous run.");
4217
4217
  clack5.log.info("To fix this, run:");
4218
4218
  clack5.log.info(` ${pc5.cyan("rm -rf ~/.wraps/pulumi/.pulumi/locks")}`);
4219
- clack5.log.info("\nThen try running wraps connect again.");
4219
+ clack5.log.info("\nThen try running wraps email connect again.");
4220
4220
  }
4221
4221
  throw new Error(`Pulumi deployment failed: ${error.message}`);
4222
4222
  }
@@ -4853,7 +4853,7 @@ ${pc7.yellow(pc7.bold("Configuration Warnings:"))}`);
4853
4853
  clack7.log.warn("\nThe Pulumi stack is locked from a previous run.");
4854
4854
  clack7.log.info("To fix this, run:");
4855
4855
  clack7.log.info(` ${pc7.cyan("rm -rf ~/.wraps/pulumi/.pulumi/locks")}`);
4856
- clack7.log.info("\nThen try running wraps init again.");
4856
+ clack7.log.info("\nThen try running wraps email init again.");
4857
4857
  }
4858
4858
  throw new Error(`Pulumi deployment failed: ${error.message}`);
4859
4859
  }
@@ -4938,7 +4938,7 @@ async function restore(options) {
4938
4938
  `No Wraps connection found for account ${pc8.cyan(identity.accountId)} in region ${pc8.cyan(region)}`
4939
4939
  );
4940
4940
  clack8.log.info(
4941
- `Use ${pc8.cyan("wraps init")} or ${pc8.cyan("wraps connect")} to create a connection first.`
4941
+ `Use ${pc8.cyan("wraps email init")} or ${pc8.cyan("wraps email connect")} to create a connection first.`
4942
4942
  );
4943
4943
  process.exit(1);
4944
4944
  }
@@ -5052,7 +5052,7 @@ async function upgrade(options) {
5052
5052
  `No Wraps connection found for account ${pc9.cyan(identity.accountId)} in region ${pc9.cyan(region)}`
5053
5053
  );
5054
5054
  clack9.log.info(
5055
- `Use ${pc9.cyan("wraps init")} to create new infrastructure or ${pc9.cyan("wraps connect")} to connect existing.`
5055
+ `Use ${pc9.cyan("wraps email init")} to create new infrastructure or ${pc9.cyan("wraps email connect")} to connect existing.`
5056
5056
  );
5057
5057
  process.exit(1);
5058
5058
  }
@@ -5367,7 +5367,7 @@ ${pc9.bold("Current Configuration:")}
5367
5367
  "No sending domain configured. You must configure a sending domain before adding a custom tracking domain."
5368
5368
  );
5369
5369
  clack9.log.info(
5370
- `Use ${pc9.cyan("wraps init")} to set up a sending domain first.`
5370
+ `Use ${pc9.cyan("wraps email init")} to set up a sending domain first.`
5371
5371
  );
5372
5372
  process.exit(1);
5373
5373
  }
@@ -7080,7 +7080,7 @@ async function dashboard(options) {
7080
7080
  progress.stop();
7081
7081
  clack10.log.error("No Wraps infrastructure found");
7082
7082
  console.log(
7083
- `\\nRun ${pc10.cyan("wraps init")} to deploy infrastructure first.\\n`
7083
+ `\\nRun ${pc10.cyan("wraps email init")} to deploy infrastructure first.\\n`
7084
7084
  );
7085
7085
  process.exit(1);
7086
7086
  }
@@ -7174,7 +7174,7 @@ async function destroy(options) {
7174
7174
  clack11.outro(pc11.green("All Wraps infrastructure has been removed"));
7175
7175
  console.log(
7176
7176
  `
7177
- Run ${pc11.cyan("wraps init")} to deploy infrastructure again.
7177
+ Run ${pc11.cyan("wraps email init")} to deploy infrastructure again.
7178
7178
  `
7179
7179
  );
7180
7180
  }
@@ -7203,9 +7203,11 @@ async function status(_options) {
7203
7203
  } catch (_error) {
7204
7204
  progress.stop();
7205
7205
  clack12.log.error("No Wraps infrastructure found");
7206
- console.log(`
7207
- Run ${pc12.cyan("wraps init")} to deploy infrastructure.
7208
- `);
7206
+ console.log(
7207
+ `
7208
+ Run ${pc12.cyan("wraps email init")} to deploy infrastructure.
7209
+ `
7210
+ );
7209
7211
  process.exit(1);
7210
7212
  }
7211
7213
  const domains = await listSESDomains(region);
@@ -7270,7 +7272,7 @@ function printCompletionScript() {
7270
7272
  console.log("# For now, here are the available commands:\n");
7271
7273
  console.log("# Commands:");
7272
7274
  console.log(
7273
- "# wraps init [--provider vercel|aws|railway|other] [--region <region>] [--domain <domain>]"
7275
+ "# wraps email init [--provider vercel|aws|railway|other] [--region <region>] [--domain <domain>]"
7274
7276
  );
7275
7277
  console.log("# wraps status [--account <account-id>]");
7276
7278
  console.log("# wraps completion\n");
@@ -7402,7 +7404,74 @@ args.options([
7402
7404
  var flags = args.parse(process.argv);
7403
7405
  var [primaryCommand, subCommand] = args.sub;
7404
7406
  if (!primaryCommand) {
7405
- showHelp();
7407
+ async function selectService() {
7408
+ clack13.intro(pc13.bold(`WRAPS CLI v${VERSION}`));
7409
+ console.log("Welcome! Let's get started deploying your infrastructure.\n");
7410
+ const service = await clack13.select({
7411
+ message: "Which service would you like to set up?",
7412
+ options: [
7413
+ {
7414
+ value: "email",
7415
+ label: "Email",
7416
+ hint: "AWS SES email infrastructure"
7417
+ },
7418
+ {
7419
+ value: "sms",
7420
+ label: "SMS",
7421
+ hint: "Coming soon - AWS End User Messaging"
7422
+ }
7423
+ ]
7424
+ });
7425
+ if (clack13.isCancel(service)) {
7426
+ clack13.cancel("Operation cancelled.");
7427
+ process.exit(0);
7428
+ }
7429
+ if (service === "sms") {
7430
+ clack13.log.warn("SMS infrastructure is coming soon!");
7431
+ console.log(
7432
+ `
7433
+ Check back soon or follow our progress at ${pc13.cyan("https://github.com/wraps-team/wraps")}
7434
+ `
7435
+ );
7436
+ process.exit(0);
7437
+ }
7438
+ const action = await clack13.select({
7439
+ message: "What would you like to do?",
7440
+ options: [
7441
+ {
7442
+ value: "init",
7443
+ label: "Deploy new infrastructure",
7444
+ hint: "Create new AWS SES infrastructure"
7445
+ },
7446
+ {
7447
+ value: "connect",
7448
+ label: "Connect existing infrastructure",
7449
+ hint: "Connect to existing AWS SES setup"
7450
+ }
7451
+ ]
7452
+ });
7453
+ if (clack13.isCancel(action)) {
7454
+ clack13.cancel("Operation cancelled.");
7455
+ process.exit(0);
7456
+ }
7457
+ if (action === "init") {
7458
+ await init({
7459
+ provider: flags.provider,
7460
+ region: flags.region,
7461
+ domain: flags.domain,
7462
+ preset: flags.preset,
7463
+ yes: flags.yes
7464
+ });
7465
+ } else {
7466
+ await connect({
7467
+ provider: flags.provider,
7468
+ region: flags.region,
7469
+ yes: flags.yes
7470
+ });
7471
+ }
7472
+ }
7473
+ selectService().catch(handleCLIError);
7474
+ process.exit(0);
7406
7475
  }
7407
7476
  async function run() {
7408
7477
  try {