create-whop-kit 0.6.0 → 0.6.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/{chunk-GFM6IVTZ.js → chunk-42L7PRMT.js} +14 -8
- package/dist/{chunk-3LBG56BE.js → chunk-HOQ5QQ2M.js} +1 -1
- package/dist/{chunk-ZADKDGR4.js → chunk-NRG6LIOM.js} +44 -20
- package/dist/cli-create.js +19 -39
- package/dist/cli-kit.js +3 -3
- package/dist/{deploy-RDSYVJ3L.js → deploy-RKVUZYCU.js} +2 -2
- package/package.json +1 -1
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
// src/utils/exec.ts
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
|
-
function exec(cmd, cwd) {
|
|
5
|
+
function exec(cmd, cwd, timeoutMs = 12e4) {
|
|
6
6
|
try {
|
|
7
7
|
const stdout = execSync(cmd, {
|
|
8
8
|
cwd,
|
|
9
9
|
stdio: "pipe",
|
|
10
10
|
encoding: "utf-8",
|
|
11
|
-
timeout:
|
|
11
|
+
timeout: timeoutMs
|
|
12
12
|
}).trim();
|
|
13
|
-
return { stdout, success: true };
|
|
14
|
-
} catch {
|
|
15
|
-
|
|
13
|
+
return { stdout, stderr: "", success: true };
|
|
14
|
+
} catch (err) {
|
|
15
|
+
const e = err;
|
|
16
|
+
return {
|
|
17
|
+
stdout: e.stdout?.toString?.().trim() ?? "",
|
|
18
|
+
stderr: e.stderr?.toString?.().trim() ?? "",
|
|
19
|
+
success: false
|
|
20
|
+
};
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
23
|
function execInteractive(cmd, cwd) {
|
|
@@ -32,9 +37,10 @@ function execWithStdin(cmd, input, cwd) {
|
|
|
32
37
|
encoding: "utf-8",
|
|
33
38
|
timeout: 12e4
|
|
34
39
|
}).trim();
|
|
35
|
-
return { stdout, success: true };
|
|
36
|
-
} catch {
|
|
37
|
-
|
|
40
|
+
return { stdout, stderr: "", success: true };
|
|
41
|
+
} catch (err) {
|
|
42
|
+
const e = err;
|
|
43
|
+
return { stdout: "", stderr: e.stderr?.toString?.().trim() ?? "", success: false };
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
46
|
function hasCommand(cmd) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
execInteractive,
|
|
5
5
|
execWithStdin,
|
|
6
6
|
hasCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-42L7PRMT.js";
|
|
8
8
|
|
|
9
9
|
// src/deploy/index.ts
|
|
10
10
|
import * as p2 from "@clack/prompts";
|
|
@@ -33,29 +33,51 @@ function isVercelAuthenticated() {
|
|
|
33
33
|
return result.success;
|
|
34
34
|
}
|
|
35
35
|
async function vercelLogin() {
|
|
36
|
-
p.log.
|
|
36
|
+
p.log.step("Vercel: authenticating (opening browser)...");
|
|
37
37
|
console.log("");
|
|
38
38
|
const ok = execInteractive("vercel login");
|
|
39
39
|
console.log("");
|
|
40
40
|
return ok;
|
|
41
41
|
}
|
|
42
42
|
async function vercelDeploy(projectDir) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
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.");
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 {
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
|
-
|
|
58
|
-
|
|
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];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
p.log.warning("Could not determine deployment URL automatically.");
|
|
72
|
+
const manual = await p.text({
|
|
73
|
+
message: "Paste your Vercel deployment URL",
|
|
74
|
+
placeholder: "https://your-app.vercel.app",
|
|
75
|
+
validate: (v) => {
|
|
76
|
+
if (!v?.startsWith("https://")) return "Must be a https:// URL";
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
if (p.isCancel(manual)) return null;
|
|
80
|
+
return manual;
|
|
59
81
|
}
|
|
60
82
|
function vercelEnvSet(key, value, environment = "production", projectDir) {
|
|
61
83
|
const result = execWithStdin(
|
|
@@ -283,12 +305,14 @@ async function runDeployPipeline(options) {
|
|
|
283
305
|
} else {
|
|
284
306
|
s.stop(`${success.length} environment variables pushed`);
|
|
285
307
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
308
|
+
p2.log.step("Vercel: redeploying with full configuration...");
|
|
309
|
+
console.log("");
|
|
310
|
+
const redeployOk = execInteractive("vercel deploy --prod --yes", projectDir);
|
|
311
|
+
console.log("");
|
|
312
|
+
if (redeployOk) {
|
|
313
|
+
p2.log.success("Redeployed with full configuration");
|
|
290
314
|
} else {
|
|
291
|
-
|
|
315
|
+
p2.log.warning("Redeploy failed \u2014 env vars will apply on next deploy/push");
|
|
292
316
|
}
|
|
293
317
|
return {
|
|
294
318
|
productionUrl,
|
package/dist/cli-create.js
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
getTemplate,
|
|
7
7
|
installProviderSkills,
|
|
8
8
|
writeProjectContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HOQ5QQ2M.js";
|
|
10
10
|
import {
|
|
11
11
|
detectPackageManager,
|
|
12
12
|
exec,
|
|
13
13
|
execInteractive,
|
|
14
14
|
hasCommand
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-42L7PRMT.js";
|
|
16
16
|
|
|
17
17
|
// src/cli-create.ts
|
|
18
18
|
import { runMain } from "citty";
|
|
@@ -47,70 +47,50 @@ var neonProvider = {
|
|
|
47
47
|
},
|
|
48
48
|
async provision(projectName) {
|
|
49
49
|
const cli = hasCommand("neonctl") ? "neonctl" : "neon";
|
|
50
|
+
p.log.step("Neon: checking authentication...");
|
|
50
51
|
const whoami = exec(`${cli} me --output json`);
|
|
51
52
|
if (!whoami.success) {
|
|
52
|
-
p.log.info("
|
|
53
|
+
p.log.info("Opening browser for Neon authentication...");
|
|
53
54
|
console.log("");
|
|
54
55
|
const authOk = execInteractive(`${cli} auth`);
|
|
55
56
|
if (!authOk) {
|
|
56
|
-
p.log.error("
|
|
57
|
-
p.log.info(pc.bold(` ${cli} auth`));
|
|
57
|
+
p.log.error("Authentication failed. Run manually: " + pc.bold(`${cli} auth`));
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
60
|
console.log("");
|
|
61
61
|
}
|
|
62
|
-
p.log.
|
|
62
|
+
p.log.step(`Neon: creating project "${projectName}"...`);
|
|
63
63
|
console.log("");
|
|
64
64
|
const createOk = execInteractive(
|
|
65
65
|
`${cli} projects create --name "${projectName}" --set-context`
|
|
66
66
|
);
|
|
67
|
+
console.log("");
|
|
67
68
|
if (!createOk) {
|
|
68
|
-
p.log.error("Failed to create
|
|
69
|
+
p.log.error("Failed to create project. Try: https://console.neon.tech");
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
-
p.log.success("Neon project created");
|
|
72
|
+
p.log.step("Neon: getting connection string...");
|
|
73
73
|
let connString = "";
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
connString =
|
|
79
|
-
} catch {
|
|
80
|
-
connString = connResult.stdout.trim();
|
|
74
|
+
for (const flags of ["--prisma", ""]) {
|
|
75
|
+
if (connString) break;
|
|
76
|
+
const result = exec(`${cli} connection-string ${flags}`.trim(), void 0, 3e4);
|
|
77
|
+
if (result.success && result.stdout.startsWith("postgres")) {
|
|
78
|
+
connString = result.stdout.trim();
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
if (!connString) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
connString = fallback.stdout.trim();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (!connString) {
|
|
90
|
-
const raw = exec(`${cli} connection-string`);
|
|
91
|
-
if (raw.success && raw.stdout.startsWith("postgres")) {
|
|
92
|
-
connString = raw.stdout.trim();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (!connString) {
|
|
96
|
-
p.log.warning("Could not extract connection string automatically.");
|
|
97
|
-
console.log("");
|
|
98
|
-
execInteractive(`${cli} connection-string`);
|
|
99
|
-
console.log("");
|
|
82
|
+
p.log.warning("Could not retrieve connection string automatically.");
|
|
83
|
+
p.log.info("The connection URI was shown in the table above.");
|
|
100
84
|
const manual = await p.text({
|
|
101
|
-
message: "Paste the connection string
|
|
85
|
+
message: "Paste the connection string from the output above",
|
|
102
86
|
placeholder: "postgresql://...",
|
|
103
87
|
validate: (v) => {
|
|
104
|
-
if (!v?.startsWith("postgres")) return "Must
|
|
88
|
+
if (!v?.startsWith("postgres")) return "Must start with postgresql://";
|
|
105
89
|
}
|
|
106
90
|
});
|
|
107
91
|
if (p.isCancel(manual)) return null;
|
|
108
92
|
connString = manual;
|
|
109
93
|
}
|
|
110
|
-
if (!connString) {
|
|
111
|
-
p.log.error("Could not get connection string. Get it from: https://console.neon.tech");
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
94
|
return {
|
|
115
95
|
connectionString: connString,
|
|
116
96
|
provider: "neon"
|
|
@@ -693,7 +673,7 @@ var init_default = defineCommand({
|
|
|
693
673
|
return !isCancelled(result) && result;
|
|
694
674
|
})();
|
|
695
675
|
if (shouldDeploy) {
|
|
696
|
-
const { runDeployPipeline } = await import("./deploy-
|
|
676
|
+
const { runDeployPipeline } = await import("./deploy-RKVUZYCU.js");
|
|
697
677
|
deployResult = await runDeployPipeline({
|
|
698
678
|
projectDir,
|
|
699
679
|
projectName,
|
package/dist/cli-kit.js
CHANGED
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
addFeatureToManifest,
|
|
7
7
|
readManifest,
|
|
8
8
|
writeFeatureSkill
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HOQ5QQ2M.js";
|
|
10
10
|
import {
|
|
11
11
|
runDeployPipeline
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NRG6LIOM.js";
|
|
13
13
|
import {
|
|
14
14
|
detectPackageManager,
|
|
15
15
|
exec
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-42L7PRMT.js";
|
|
17
17
|
|
|
18
18
|
// src/cli-kit.ts
|
|
19
19
|
import { defineCommand as defineCommand8, runMain } from "citty";
|