create-whop-kit 1.0.0 → 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",
|
|
@@ -188,19 +192,21 @@ async function createGitHubRepo(projectDir, projectName) {
|
|
|
188
192
|
}
|
|
189
193
|
s = p2.spinner();
|
|
190
194
|
s.start("Pushing code to GitHub...");
|
|
195
|
+
const branchResult = exec("git branch --show-current", projectDir);
|
|
196
|
+
const branch = branchResult.success ? branchResult.stdout.trim() : "main";
|
|
191
197
|
let pushOk = false;
|
|
192
|
-
for (const delay of [0,
|
|
198
|
+
for (const delay of [0, 3e3, 7e3]) {
|
|
193
199
|
if (delay > 0) {
|
|
194
|
-
s.stop(`Waiting for GitHub to propagate
|
|
200
|
+
s.stop(`Waiting for GitHub to propagate...`);
|
|
195
201
|
await new Promise((r) => setTimeout(r, delay));
|
|
196
202
|
s = p2.spinner();
|
|
197
203
|
s.start("Pushing code to GitHub...");
|
|
198
204
|
}
|
|
199
|
-
pushOk = exec(
|
|
205
|
+
pushOk = exec(`git push -u origin ${branch}`, projectDir, 3e4).success;
|
|
200
206
|
if (pushOk) break;
|
|
201
207
|
}
|
|
202
208
|
if (!pushOk) {
|
|
203
|
-
s.stop(
|
|
209
|
+
s.stop(`Could not push (try manually: git push -u origin ${branch})`);
|
|
204
210
|
} else {
|
|
205
211
|
s.stop("Code pushed to GitHub");
|
|
206
212
|
}
|
package/dist/cli-create.js
CHANGED
|
@@ -346,6 +346,7 @@ function updatePackageName(projectDir, name) {
|
|
|
346
346
|
}
|
|
347
347
|
function initGit(projectDir) {
|
|
348
348
|
exec("git init", projectDir);
|
|
349
|
+
exec("git branch -m main", projectDir);
|
|
349
350
|
exec("git add -A", projectDir);
|
|
350
351
|
exec('git commit -m "initial: scaffolded with create-whop-kit"', projectDir);
|
|
351
352
|
}
|
|
@@ -683,7 +684,7 @@ var init_default = defineCommand({
|
|
|
683
684
|
});
|
|
684
685
|
if (!isCancelled(deployChoice) && deployChoice === "deploy") {
|
|
685
686
|
deployAttempted = true;
|
|
686
|
-
const { runDeployPipeline } = await import("./deploy-
|
|
687
|
+
const { runDeployPipeline } = await import("./deploy-SGJRYA53.js");
|
|
687
688
|
deployResult = await runDeployPipeline({
|
|
688
689
|
projectDir,
|
|
689
690
|
projectName,
|
package/dist/cli-kit.js
CHANGED