create-vapi-app 0.1.0 → 0.1.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.
- package/README.md +2 -0
- package/dist/index.js +20 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { parseArgs } from "util";
|
|
|
4
4
|
// src/constants.ts
|
|
5
5
|
var GITOPS_REPO = "VapiAI/gitops";
|
|
6
6
|
var GITOPS_GIT_URL = `https://github.com/${GITOPS_REPO}.git`;
|
|
7
|
-
var GITOPS_REF = "
|
|
7
|
+
var GITOPS_REF = "a820577d972beaf23baa08f2d61838f2e407440e";
|
|
8
8
|
var DEFAULT_PROJECT_NAME = "my-vapi-gitops";
|
|
9
9
|
var API_KEYS_URL = "https://dashboard.vapi.ai/org/api-keys";
|
|
10
10
|
var SECRET_FLAG_RE = /^--(token|api-key|apikey|key|vapi-token)(=|$)/i;
|
|
@@ -232,6 +232,7 @@ function nextSteps({
|
|
|
232
232
|
org,
|
|
233
233
|
setup,
|
|
234
234
|
setupCode,
|
|
235
|
+
setupOrgs = [],
|
|
235
236
|
runId,
|
|
236
237
|
keyVarName,
|
|
237
238
|
skipInstall,
|
|
@@ -239,12 +240,14 @@ function nextSteps({
|
|
|
239
240
|
disableGit,
|
|
240
241
|
githubPushed
|
|
241
242
|
}) {
|
|
242
|
-
const orgArg = org ?? "<org>";
|
|
243
|
+
const orgArg = org ?? (setupOrgs.length === 1 ? setupOrgs[0] : void 0) ?? "<org>";
|
|
243
244
|
const lines = ["Next steps:", "", ` cd ${displayDir}`];
|
|
244
245
|
if (skipInstall) lines.push(" npm ci");
|
|
245
246
|
const setupRan = setup.mode !== "skip" && setupCode === 0;
|
|
246
247
|
const wizardFits = org === void 0 && (setup.mode === "wizard" || setup.mode === "skip" && (setup.reason === "skip-setup" || setup.reason === "skip-install"));
|
|
247
|
-
if (!setupRan) {
|
|
248
|
+
if (!setupRan && setupOrgs.length > 0) {
|
|
249
|
+
for (const setupOrg of setupOrgs) lines.push(` npm run pull -- ${setupOrg}`);
|
|
250
|
+
} else if (!setupRan) {
|
|
248
251
|
if (wizardFits) {
|
|
249
252
|
lines.push(` VAPI_GITOPS_RUN_ID=${runId} npm run setup`);
|
|
250
253
|
} else {
|
|
@@ -429,6 +432,18 @@ function setupDecide({ org, yes, tty, skipInstall, skipSetup, keyPresent }) {
|
|
|
429
432
|
return tty ? { mode: "wizard" } : { mode: "skip", reason: "not-interactive" };
|
|
430
433
|
}
|
|
431
434
|
|
|
435
|
+
// src/setupOrgsFind.ts
|
|
436
|
+
import { readdir as readdir3 } from "fs/promises";
|
|
437
|
+
import { join as join2 } from "path";
|
|
438
|
+
async function setupOrgsFind(dir) {
|
|
439
|
+
try {
|
|
440
|
+
const entries = await readdir3(join2(dir, "resources"), { withFileTypes: true });
|
|
441
|
+
return entries.filter((entry) => entry.isDirectory() && SLUG_RE.test(entry.name)).map((entry) => entry.name).sort();
|
|
442
|
+
} catch {
|
|
443
|
+
return [];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
432
447
|
// src/scaffold.ts
|
|
433
448
|
async function scaffold({ cliName, options, projectName, tty }) {
|
|
434
449
|
const dir = resolve2(projectName);
|
|
@@ -535,6 +550,7 @@ Created ${projectName} at ${dir}, but setup didn't finish.
|
|
|
535
550
|
org: options.org,
|
|
536
551
|
setup,
|
|
537
552
|
setupCode,
|
|
553
|
+
setupOrgs: setupCode ? await setupOrgsFind(dir) : [],
|
|
538
554
|
runId,
|
|
539
555
|
keyVarName: key?.varName,
|
|
540
556
|
skipInstall: options.skipInstall,
|
|
@@ -557,7 +573,7 @@ async function run(argv, { cliName }) {
|
|
|
557
573
|
return 0;
|
|
558
574
|
}
|
|
559
575
|
if (parsed.kind === "version") {
|
|
560
|
-
process.stdout.write(`${"0.1.
|
|
576
|
+
process.stdout.write(`${"0.1.2"}
|
|
561
577
|
`);
|
|
562
578
|
return 0;
|
|
563
579
|
}
|