create-whop-kit 0.5.0 → 0.5.1
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-create.js +6 -46
- package/package.json +1 -1
package/dist/cli-create.js
CHANGED
|
@@ -326,12 +326,6 @@ function validateDatabaseUrl(url) {
|
|
|
326
326
|
}
|
|
327
327
|
return void 0;
|
|
328
328
|
}
|
|
329
|
-
function validateWhopAppId(id) {
|
|
330
|
-
if (id && !id.startsWith("app_")) {
|
|
331
|
-
return 'Whop App IDs start with "app_"';
|
|
332
|
-
}
|
|
333
|
-
return void 0;
|
|
334
|
-
}
|
|
335
329
|
|
|
336
330
|
// src/utils/cleanup.ts
|
|
337
331
|
import { rmSync, existsSync as existsSync2 } from "fs";
|
|
@@ -597,39 +591,9 @@ var init_default = defineCommand({
|
|
|
597
591
|
}
|
|
598
592
|
dbUrl = result;
|
|
599
593
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
if (!isNonInteractive && !args.yes) {
|
|
604
|
-
const setupWhop = await p5.confirm({
|
|
605
|
-
message: "Configure Whop credentials now? (you can do this later via the setup wizard)",
|
|
606
|
-
initialValue: false
|
|
607
|
-
});
|
|
608
|
-
if (!isCancelled(setupWhop) && setupWhop) {
|
|
609
|
-
if (!appId) {
|
|
610
|
-
const result = await p5.text({
|
|
611
|
-
message: "Whop App ID",
|
|
612
|
-
placeholder: "app_xxxxxxxxx",
|
|
613
|
-
validate: (v) => v ? validateWhopAppId(v) : void 0
|
|
614
|
-
});
|
|
615
|
-
if (!isCancelled(result)) appId = result ?? "";
|
|
616
|
-
}
|
|
617
|
-
if (!apiKey) {
|
|
618
|
-
const result = await p5.text({
|
|
619
|
-
message: "Whop API Key",
|
|
620
|
-
placeholder: "apik_xxxxxxxxx (optional, press Enter to skip)"
|
|
621
|
-
});
|
|
622
|
-
if (!isCancelled(result)) apiKey = result ?? "";
|
|
623
|
-
}
|
|
624
|
-
if (!webhookSecret) {
|
|
625
|
-
const result = await p5.text({
|
|
626
|
-
message: "Whop Webhook Secret",
|
|
627
|
-
placeholder: "optional, press Enter to skip"
|
|
628
|
-
});
|
|
629
|
-
if (!isCancelled(result)) webhookSecret = result ?? "";
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
594
|
+
const appId = args["app-id"] ?? "";
|
|
595
|
+
const apiKey = args["api-key"] ?? "";
|
|
596
|
+
const webhookSecret = args["webhook-secret"] ?? "";
|
|
633
597
|
if (args["dry-run"]) {
|
|
634
598
|
p5.log.info(pc5.dim("Dry run \u2014 showing what would be created:\n"));
|
|
635
599
|
console.log(` ${pc5.bold("Project:")} ${projectName}`);
|
|
@@ -721,12 +685,6 @@ var init_default = defineCommand({
|
|
|
721
685
|
let summary = "";
|
|
722
686
|
if (configured.length > 0) {
|
|
723
687
|
summary += `${pc5.green("\u2713")} ${configured.join(", ")}
|
|
724
|
-
`;
|
|
725
|
-
}
|
|
726
|
-
if (missing.length > 0) {
|
|
727
|
-
summary += `${pc5.yellow("\u25CB")} Missing: ${missing.join(", ")}
|
|
728
|
-
`;
|
|
729
|
-
summary += ` ${pc5.dim("The setup wizard at http://localhost:3000 will guide you through it")}
|
|
730
688
|
`;
|
|
731
689
|
}
|
|
732
690
|
if (dbNote) {
|
|
@@ -745,7 +703,9 @@ var init_default = defineCommand({
|
|
|
745
703
|
`;
|
|
746
704
|
summary += `
|
|
747
705
|
`;
|
|
748
|
-
summary += ` ${pc5.dim("
|
|
706
|
+
summary += ` ${pc5.dim("Open http://localhost:3000 \u2014 the setup wizard will")}
|
|
707
|
+
`;
|
|
708
|
+
summary += ` ${pc5.dim("walk you through connecting your Whop app.")}`;
|
|
749
709
|
p5.note(summary, "Your app is ready");
|
|
750
710
|
p5.outro(`${pc5.green("Happy building!")} ${pc5.dim("\u2014 whop-kit")}`);
|
|
751
711
|
}
|