create-whop-kit 1.0.1 → 1.0.2
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.
|
@@ -56,7 +56,6 @@ function getVercelUser() {
|
|
|
56
56
|
}
|
|
57
57
|
async function vercelLogin() {
|
|
58
58
|
p.log.info("You'll be redirected to Vercel to sign in (or create an account).");
|
|
59
|
-
p.log.info(pc.dim("This is needed to deploy your app."));
|
|
60
59
|
console.log("");
|
|
61
60
|
const ok = execInteractive("vercel login");
|
|
62
61
|
console.log("");
|
|
@@ -70,52 +69,57 @@ async function vercelLink(projectDir) {
|
|
|
70
69
|
return ok;
|
|
71
70
|
}
|
|
72
71
|
async function vercelDeploy(projectDir) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (errorOutput) {
|
|
80
|
-
const trimmed = errorOutput.length > 600 ? "..." + errorOutput.slice(-600) : errorOutput;
|
|
81
|
-
p.log.error(pc.dim(trimmed));
|
|
82
|
-
}
|
|
72
|
+
p.log.step("Vercel: deploying to production...");
|
|
73
|
+
console.log("");
|
|
74
|
+
const ok = execInteractive("vercel deploy --prod --yes", projectDir);
|
|
75
|
+
console.log("");
|
|
76
|
+
if (!ok) {
|
|
77
|
+
p.log.error("Vercel deployment failed. Check the build output above.");
|
|
83
78
|
return null;
|
|
84
79
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
const s = p.spinner();
|
|
81
|
+
s.start("Getting deployment URL...");
|
|
82
|
+
const ls = exec("vercel ls --json", projectDir, 15e3);
|
|
83
|
+
if (ls.success) {
|
|
84
|
+
try {
|
|
85
|
+
const data = JSON.parse(ls.stdout);
|
|
86
|
+
const prod = Array.isArray(data) ? data.find((d) => d.target === "production") : null;
|
|
87
|
+
if (prod?.url) {
|
|
88
|
+
const url = `https://${prod.url}`;
|
|
89
|
+
s.stop(`Deployed to ${pc.cyan(url)}`);
|
|
90
|
+
return url;
|
|
93
91
|
}
|
|
92
|
+
} catch {
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (urls.length > 0) {
|
|
103
|
-
urls.sort((a, b) => a.length - b.length);
|
|
104
|
-
url = urls[0];
|
|
95
|
+
const inspect = exec("vercel inspect --json", projectDir, 15e3);
|
|
96
|
+
if (inspect.success) {
|
|
97
|
+
const urlMatch = inspect.stdout.match(/https:\/\/[^\s"]+\.vercel\.app/);
|
|
98
|
+
if (urlMatch) {
|
|
99
|
+
s.stop(`Deployed to ${pc.cyan(urlMatch[0])}`);
|
|
100
|
+
return urlMatch[0];
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
try {
|
|
104
|
+
const { readFileSync } = await import("fs");
|
|
105
|
+
const { join } = await import("path");
|
|
106
|
+
const projectJson = JSON.parse(
|
|
107
|
+
readFileSync(join(projectDir, ".vercel", "project.json"), "utf-8")
|
|
108
|
+
);
|
|
109
|
+
if (projectJson.projectId) {
|
|
110
|
+
const proj = exec(`vercel project inspect ${projectJson.projectId} --json`, projectDir, 15e3);
|
|
111
|
+
if (proj.success) {
|
|
112
|
+
const urlMatch = proj.stdout.match(/https:\/\/[^\s"]+\.vercel\.app/);
|
|
113
|
+
if (urlMatch) {
|
|
114
|
+
s.stop(`Deployed to ${pc.cyan(urlMatch[0])}`);
|
|
115
|
+
return urlMatch[0];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
116
118
|
}
|
|
119
|
+
} catch {
|
|
117
120
|
}
|
|
118
|
-
s.stop("Deployed
|
|
121
|
+
s.stop("Deployed (extracting URL...)");
|
|
122
|
+
p.log.info("The deployment URL was shown in the build output above.");
|
|
119
123
|
const manual = await p.text({
|
|
120
124
|
message: "Paste your Vercel production URL",
|
|
121
125
|
placeholder: "https://your-app.vercel.app",
|
package/dist/cli-create.js
CHANGED
|
@@ -684,7 +684,7 @@ var init_default = defineCommand({
|
|
|
684
684
|
});
|
|
685
685
|
if (!isCancelled(deployChoice) && deployChoice === "deploy") {
|
|
686
686
|
deployAttempted = true;
|
|
687
|
-
const { runDeployPipeline } = await import("./deploy-
|
|
687
|
+
const { runDeployPipeline } = await import("./deploy-SGJRYA53.js");
|
|
688
688
|
deployResult = await runDeployPipeline({
|
|
689
689
|
projectDir,
|
|
690
690
|
projectName,
|
package/dist/cli-kit.js
CHANGED