@wraps.dev/cli 2.21.4 → 2.21.5

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
@@ -33432,7 +33432,14 @@ init_events();
33432
33432
 
33433
33433
  // src/utils/selfhost/neon.ts
33434
33434
  init_esm_shims();
33435
- async function provisionNeonProject(apiKey, projectName, region = "aws-us-east-2") {
33435
+ async function provisionNeonProject(apiKey, projectName, options = {}) {
33436
+ const { region = "aws-us-east-2", orgId } = options;
33437
+ const projectPayload = {
33438
+ name: projectName,
33439
+ pg_version: 16,
33440
+ region_id: region
33441
+ };
33442
+ if (orgId) projectPayload.org_id = orgId;
33436
33443
  const response = await fetch("https://console.neon.tech/api/v2/projects", {
33437
33444
  method: "POST",
33438
33445
  headers: {
@@ -33440,13 +33447,7 @@ async function provisionNeonProject(apiKey, projectName, region = "aws-us-east-2
33440
33447
  "Content-Type": "application/json",
33441
33448
  Accept: "application/json"
33442
33449
  },
33443
- body: JSON.stringify({
33444
- project: {
33445
- name: projectName,
33446
- pg_version: 16,
33447
- region_id: region
33448
- }
33449
- })
33450
+ body: JSON.stringify({ project: projectPayload })
33450
33451
  });
33451
33452
  if (!response.ok) {
33452
33453
  const body = await response.json().catch(() => ({}));
@@ -33549,6 +33550,7 @@ async function selfhostDeploy(options) {
33549
33550
  }
33550
33551
  neonApiKey = neonApiKeyAnswer;
33551
33552
  }
33553
+ const neonOrgId = options.neonOrgId;
33552
33554
  let licenseKey = options.licenseKey;
33553
33555
  if (!licenseKey) {
33554
33556
  const licenseKeyAnswer = await clack43.text({
@@ -33584,9 +33586,10 @@ async function selfhostDeploy(options) {
33584
33586
  process.exit(0);
33585
33587
  }
33586
33588
  }
33589
+ const childStdio = isJsonMode() ? "pipe" : "inherit";
33587
33590
  await progress.execute("Building Wraps API", async () => {
33588
33591
  execSync2("pnpm --filter @wraps/api build", {
33589
- stdio: "inherit",
33592
+ stdio: childStdio,
33590
33593
  cwd: repoRoot
33591
33594
  });
33592
33595
  });
@@ -33594,14 +33597,15 @@ async function selfhostDeploy(options) {
33594
33597
  await progress.execute("Packaging Lambda", async () => {
33595
33598
  execSync2("/bin/sh -c 'zip -r ../lambda.zip .'", {
33596
33599
  cwd: join20(repoRoot, "apps/api/dist"),
33597
- stdio: "inherit"
33600
+ stdio: childStdio
33598
33601
  });
33599
33602
  });
33600
33603
  const neonProject = await progress.execute(
33601
33604
  "Provisioning Neon PostgreSQL database",
33602
33605
  async () => provisionNeonProject(
33603
33606
  neonApiKey,
33604
- buildNeonProjectName(identity.accountId, region)
33607
+ buildNeonProjectName(identity.accountId, region),
33608
+ { orgId: neonOrgId }
33605
33609
  )
33606
33610
  );
33607
33611
  progress.info(`Neon project created: ${pc46.cyan(neonProject.name)}`);
@@ -33636,7 +33640,7 @@ async function selfhostDeploy(options) {
33636
33640
  await saveConnectionMetadata(savedMetadata);
33637
33641
  await progress.execute("Running database migrations", async () => {
33638
33642
  execSync2("pnpm --filter @wraps/db db:migrate", {
33639
- stdio: "inherit",
33643
+ stdio: childStdio,
33640
33644
  cwd: repoRoot,
33641
33645
  env: {
33642
33646
  ...process.env,
@@ -33938,9 +33942,10 @@ async function selfhostUpgrade(options) {
33938
33942
  }
33939
33943
  const config2 = selfhostService.config;
33940
33944
  const stackName = selfhostService.pulumiStackName || `wraps-selfhost-${identity.accountId}-${region}`;
33945
+ const childStdio = isJsonMode() ? "pipe" : "inherit";
33941
33946
  await progress.execute("Building Wraps API", async () => {
33942
33947
  execSync3("pnpm --filter @wraps/api build", {
33943
- stdio: "inherit",
33948
+ stdio: childStdio,
33944
33949
  cwd: repoRoot2
33945
33950
  });
33946
33951
  });
@@ -33948,7 +33953,7 @@ async function selfhostUpgrade(options) {
33948
33953
  await progress.execute("Packaging Lambda", async () => {
33949
33954
  execSync3("/bin/sh -c 'zip -r ../lambda.zip .'", {
33950
33955
  cwd: join21(repoRoot2, "apps/api/dist"),
33951
- stdio: "inherit"
33956
+ stdio: childStdio
33952
33957
  });
33953
33958
  });
33954
33959
  const createStack = async () => {
@@ -41518,7 +41523,11 @@ var STRING_FLAGS = [
41518
41523
  "org",
41519
41524
  "subdomain",
41520
41525
  "tier",
41521
- "expires"
41526
+ "expires",
41527
+ "neon-api-key",
41528
+ "neon-org-id",
41529
+ "license-key",
41530
+ "app-url"
41522
41531
  ];
41523
41532
  var BOOLEAN_FLAGS = [
41524
41533
  "yes",
@@ -42540,9 +42549,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
42540
42549
  case "deploy":
42541
42550
  await selfhostDeploy({
42542
42551
  region: flags.region,
42543
- neonApiKey: flags["neon-api-key"],
42544
- licenseKey: flags["license-key"],
42545
- appUrl: flags["app-url"],
42552
+ neonApiKey: flags.neonApiKey,
42553
+ neonOrgId: flags.neonOrgId,
42554
+ licenseKey: flags.licenseKey,
42555
+ appUrl: flags.appUrl,
42546
42556
  yes: flags.yes,
42547
42557
  preview: flags.preview,
42548
42558
  json: flags.json