create-whop-kit 0.9.2 → 0.9.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.
|
@@ -167,33 +167,45 @@ async function ghLogin() {
|
|
|
167
167
|
return ok;
|
|
168
168
|
}
|
|
169
169
|
async function createGitHubRepo(projectDir, projectName) {
|
|
170
|
-
|
|
170
|
+
let s = p2.spinner();
|
|
171
171
|
s.start("Creating private GitHub repository...");
|
|
172
|
-
const
|
|
173
|
-
`gh repo create ${projectName} --private --source
|
|
172
|
+
const createResult = exec(
|
|
173
|
+
`gh repo create ${projectName} --private --source=.`,
|
|
174
174
|
projectDir,
|
|
175
175
|
6e4
|
|
176
176
|
);
|
|
177
|
-
if (!
|
|
178
|
-
|
|
179
|
-
const stderr = result.stderr || result.stdout;
|
|
177
|
+
if (!createResult.success) {
|
|
178
|
+
const stderr = createResult.stderr || createResult.stdout;
|
|
180
179
|
if (stderr.includes("already exists")) {
|
|
181
|
-
|
|
180
|
+
s.stop(`Repository "${projectName}" already exists`);
|
|
182
181
|
exec(`git remote add origin https://github.com/$(gh api user --jq .login)/${projectName}.git`, projectDir);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
182
|
+
} else {
|
|
183
|
+
s.stop("Could not create GitHub repo");
|
|
184
|
+
if (stderr) p2.log.error(pc2.dim(stderr.substring(0, 200)));
|
|
185
|
+
return null;
|
|
188
186
|
}
|
|
189
|
-
|
|
187
|
+
} else {
|
|
188
|
+
s.stop("GitHub repo created");
|
|
189
|
+
}
|
|
190
|
+
s = p2.spinner();
|
|
191
|
+
s.start("Pushing code to GitHub...");
|
|
192
|
+
let pushOk = exec("git push -u origin main", projectDir, 3e4).success;
|
|
193
|
+
if (!pushOk) {
|
|
194
|
+
s.stop("Push failed, retrying...");
|
|
195
|
+
await new Promise((r) => setTimeout(r, 3e3));
|
|
196
|
+
s = p2.spinner();
|
|
197
|
+
s.start("Retrying push...");
|
|
198
|
+
pushOk = exec("git push -u origin main", projectDir, 3e4).success;
|
|
199
|
+
}
|
|
200
|
+
if (!pushOk) {
|
|
201
|
+
s.stop("Could not push (push manually with: git push -u origin main)");
|
|
202
|
+
} else {
|
|
203
|
+
s.stop("Code pushed to GitHub");
|
|
190
204
|
}
|
|
191
205
|
const repoUrl = exec("gh repo view --json url --jq .url", projectDir);
|
|
192
|
-
if (repoUrl.success) {
|
|
193
|
-
s.stop(`GitHub repo created: ${pc2.cyan(repoUrl.stdout.trim())}`);
|
|
206
|
+
if (repoUrl.success && repoUrl.stdout.trim()) {
|
|
194
207
|
return repoUrl.stdout.trim();
|
|
195
208
|
}
|
|
196
|
-
s.stop("GitHub repo created");
|
|
197
209
|
return `https://github.com/${projectName}`;
|
|
198
210
|
}
|
|
199
211
|
function getGitHubOrgs() {
|
package/dist/cli-create.js
CHANGED
|
@@ -666,16 +666,24 @@ var init_default = defineCommand({
|
|
|
666
666
|
let deployResult = null;
|
|
667
667
|
let deployAttempted = false;
|
|
668
668
|
if (!args["skip-deploy"] && !args["dry-run"]) {
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
669
|
+
const deployChoice = isNonInteractive ? "local" : await p5.select({
|
|
670
|
+
message: "What would you like to do next?",
|
|
671
|
+
options: [
|
|
672
|
+
{
|
|
673
|
+
value: "deploy",
|
|
674
|
+
label: "Deploy to GitHub + Vercel + connect Whop (recommended)",
|
|
675
|
+
hint: "Private repo, auto-deploy on push, OAuth + webhooks configured"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
value: "local",
|
|
679
|
+
label: "Develop locally first",
|
|
680
|
+
hint: "Run on localhost:3000, deploy later with whop-kit deploy"
|
|
681
|
+
}
|
|
682
|
+
]
|
|
683
|
+
});
|
|
684
|
+
if (!isCancelled(deployChoice) && deployChoice === "deploy") {
|
|
677
685
|
deployAttempted = true;
|
|
678
|
-
const { runDeployPipeline } = await import("./deploy-
|
|
686
|
+
const { runDeployPipeline } = await import("./deploy-RKFHMMX4.js");
|
|
679
687
|
deployResult = await runDeployPipeline({
|
|
680
688
|
projectDir,
|
|
681
689
|
projectName,
|
package/dist/cli-kit.js
CHANGED