create-whop-kit 0.6.2 → 0.6.4

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.
@@ -40,37 +40,42 @@ async function vercelLogin() {
40
40
  return ok;
41
41
  }
42
42
  async function vercelDeploy(projectDir) {
43
- p.log.step("Vercel: deploying to production (this may take a few minutes)...");
44
- console.log("");
45
- const ok = execInteractive("vercel deploy --prod --yes", projectDir);
46
- console.log("");
47
- if (!ok) {
48
- p.log.error("Vercel deployment failed. Check the output above for details.");
43
+ const s = p.spinner();
44
+ s.start("Vercel: deploying to production (this may take a few minutes)...");
45
+ const result = exec("vercel deploy --prod --yes", projectDir, 3e5);
46
+ if (!result.success) {
47
+ s.stop("Vercel deployment failed");
48
+ const errorOutput = result.stderr || result.stdout;
49
+ if (errorOutput) {
50
+ p.log.error("Build output:");
51
+ console.log(pc.dim(errorOutput.substring(0, 500)));
52
+ }
49
53
  return null;
50
54
  }
51
- const inspect = exec("vercel inspect --json", projectDir);
52
- if (inspect.success) {
53
- try {
54
- const data = JSON.parse(inspect.stdout);
55
- if (data.url) {
56
- const url = data.url.startsWith("https://") ? data.url : `https://${data.url}`;
57
- p.log.success(`Deployed to ${pc.cyan(url)}`);
58
- return url;
59
- }
60
- } catch {
55
+ const lines = result.stdout.split("\n");
56
+ let url = "";
57
+ for (const line of lines) {
58
+ const match = line.match(/https:\/\/[^\s\[\]]+\.vercel\.app/);
59
+ if (match) {
60
+ url = match[0];
61
+ if (!url.includes("-git-") && url.split("-").length < 5) break;
61
62
  }
62
63
  }
63
- const ls = exec("vercel ls --json 2>/dev/null | head -1", projectDir);
64
- if (ls.success) {
65
- const urlMatch = ls.stdout.match(/https:\/\/[^\s"]+\.vercel\.app/);
66
- if (urlMatch) {
67
- p.log.success(`Deployed to ${pc.cyan(urlMatch[0])}`);
68
- return urlMatch[0];
64
+ if (url) {
65
+ s.stop(`Deployed to ${pc.cyan(url)}`);
66
+ return url;
67
+ }
68
+ for (const line of lines) {
69
+ const match = line.match(/https:\/\/[^\s\[\]]+/);
70
+ if (match) {
71
+ url = match[0];
72
+ s.stop(`Deployed to ${pc.cyan(url)}`);
73
+ return url;
69
74
  }
70
75
  }
71
- p.log.warning("Could not determine deployment URL automatically.");
76
+ s.stop("Deployed but could not extract URL");
72
77
  const manual = await p.text({
73
- message: "Paste your Vercel deployment URL",
78
+ message: "Paste your Vercel production URL (shown in the output above)",
74
79
  placeholder: "https://your-app.vercel.app",
75
80
  validate: (v) => {
76
81
  if (!v?.startsWith("https://")) return "Must be a https:// URL";
@@ -664,6 +664,7 @@ var init_default = defineCommand({
664
664
  }
665
665
  initGit(projectDir);
666
666
  let deployResult = null;
667
+ let deployAttempted = false;
667
668
  if (!args["skip-deploy"] && !args["dry-run"]) {
668
669
  const shouldDeploy = isNonInteractive ? false : await (async () => {
669
670
  const result = await p5.confirm({
@@ -673,7 +674,8 @@ var init_default = defineCommand({
673
674
  return !isCancelled(result) && result;
674
675
  })();
675
676
  if (shouldDeploy) {
676
- const { runDeployPipeline } = await import("./deploy-2HX64HTI.js");
677
+ deployAttempted = true;
678
+ const { runDeployPipeline } = await import("./deploy-ATDZ322S.js");
677
679
  deployResult = await runDeployPipeline({
678
680
  projectDir,
679
681
  projectName,
@@ -684,6 +686,7 @@ var init_default = defineCommand({
684
686
  }
685
687
  }
686
688
  let summary = "";
689
+ const deployFailed = deployAttempted && !deployResult?.productionUrl;
687
690
  if (deployResult?.productionUrl) {
688
691
  if (dbUrl) summary += `${pc5.green("\u2713")} Database connected
689
692
  `;
@@ -704,6 +707,24 @@ var init_default = defineCommand({
704
707
  summary += ` ${pc5.bold("cd")} ${basename2(projectName)}
705
708
  `;
706
709
  summary += ` ${pc5.bold(`${pm} run dev`)} ${pc5.dim("# start local dev server")}`;
710
+ } else if (deployFailed) {
711
+ if (dbUrl) summary += `${pc5.green("\u2713")} Database configured
712
+ `;
713
+ summary += `${pc5.red("\u2717")} Vercel deployment failed
714
+ `;
715
+ summary += `
716
+ `;
717
+ summary += ` ${pc5.bold("To retry:")}
718
+ `;
719
+ summary += ` ${pc5.bold("cd")} ${basename2(projectName)}
720
+ `;
721
+ summary += ` ${pc5.bold("whop-kit deploy")} ${pc5.dim("# retry deploy + Whop setup")}
722
+ `;
723
+ summary += `
724
+ `;
725
+ summary += ` ${pc5.bold("Or develop locally:")}
726
+ `;
727
+ summary += ` ${pc5.bold(`${pm} run dev`)} ${pc5.dim("# start dev server at localhost:3000")}`;
707
728
  } else {
708
729
  if (dbUrl) summary += `${pc5.green("\u2713")} Database configured
709
730
  `;
@@ -729,8 +750,13 @@ var init_default = defineCommand({
729
750
  `;
730
751
  summary += ` ${pc5.dim(`Or run ${pc5.bold("whop-kit deploy")} to deploy + auto-configure.`)}`;
731
752
  }
732
- p5.note(summary, "Your app is ready");
733
- p5.outro(`${pc5.green("Happy building!")} ${pc5.dim("\u2014 whop-kit")}`);
753
+ if (deployFailed) {
754
+ p5.note(summary, pc5.yellow("Setup incomplete"));
755
+ p5.outro(`${pc5.yellow("Deploy failed.")} Run ${pc5.bold("whop-kit deploy")} to retry.`);
756
+ } else {
757
+ p5.note(summary, "Your app is ready");
758
+ p5.outro(`${pc5.green("Happy building!")} ${pc5.dim("\u2014 whop-kit")}`);
759
+ }
734
760
  }
735
761
  });
736
762
 
package/dist/cli-kit.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-HOQ5QQ2M.js";
10
10
  import {
11
11
  runDeployPipeline
12
- } from "./chunk-3USQ425V.js";
12
+ } from "./chunk-TPBUMYCP.js";
13
13
  import {
14
14
  detectPackageManager,
15
15
  exec
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runDeployPipeline
4
- } from "./chunk-3USQ425V.js";
4
+ } from "./chunk-TPBUMYCP.js";
5
5
  import "./chunk-42L7PRMT.js";
6
6
  export {
7
7
  runDeployPipeline
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-whop-kit",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Scaffold and manage Whop-powered apps with whop-kit",
5
5
  "type": "module",
6
6
  "license": "MIT",