betterstart-cli 0.0.35 → 0.0.37
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.js +95 -13
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3460,7 +3460,7 @@ function schemaManifestContainsMailchimpImports(cwd, config, schemaName) {
|
|
|
3460
3460
|
return false;
|
|
3461
3461
|
}
|
|
3462
3462
|
const content = fs14.readFileSync(fullPath, "utf-8");
|
|
3463
|
-
return markers.some((
|
|
3463
|
+
return markers.some((marker2) => content.includes(marker2));
|
|
3464
3464
|
});
|
|
3465
3465
|
}
|
|
3466
3466
|
function findBlockingIntegrationDependencies(cwd, config, integrationId) {
|
|
@@ -21834,21 +21834,80 @@ var GREEN_CHECK = "\x1B[32m\u2713\x1B[39m";
|
|
|
21834
21834
|
function restyleStepSubmitSymbols(text7) {
|
|
21835
21835
|
return text7.split(GREEN_STEP_SUBMIT).join(GREEN_CHECK);
|
|
21836
21836
|
}
|
|
21837
|
+
var ROW_ESCAPES = /\u001B\[(\d*)([ABEF])/g;
|
|
21838
|
+
function rowDelta(text7) {
|
|
21839
|
+
let delta = text7.split("\n").length - 1;
|
|
21840
|
+
for (const match of text7.matchAll(ROW_ESCAPES)) {
|
|
21841
|
+
const n = match[1] === "" ? 1 : Number(match[1]);
|
|
21842
|
+
delta += match[2] === "A" || match[2] === "F" ? -n : n;
|
|
21843
|
+
}
|
|
21844
|
+
return delta;
|
|
21845
|
+
}
|
|
21837
21846
|
var installed = false;
|
|
21847
|
+
var armed = false;
|
|
21848
|
+
var marker = null;
|
|
21849
|
+
var generation = 0;
|
|
21850
|
+
var rawStdoutWrite;
|
|
21838
21851
|
function installPromptCheckmarks() {
|
|
21839
21852
|
if (installed || !process.stdout.isTTY || process.env.CI === "true") return () => {
|
|
21840
21853
|
};
|
|
21841
21854
|
installed = true;
|
|
21842
|
-
const
|
|
21843
|
-
const
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21855
|
+
const unpatchedOut = process.stdout.write;
|
|
21856
|
+
const unpatchedErr = process.stderr.write;
|
|
21857
|
+
const writeOut = unpatchedOut.bind(process.stdout);
|
|
21858
|
+
const writeErr = unpatchedErr.bind(process.stderr);
|
|
21859
|
+
rawStdoutWrite = writeOut;
|
|
21860
|
+
process.stdout.write = ((chunk, encoding, callback) => {
|
|
21861
|
+
if (typeof chunk !== "string") return writeOut(chunk, encoding, callback);
|
|
21862
|
+
const idx = armed ? chunk.indexOf(GREEN_STEP_SUBMIT) : -1;
|
|
21863
|
+
if (idx === -1) {
|
|
21864
|
+
if (marker) marker.rowsAbove += rowDelta(chunk);
|
|
21865
|
+
return writeOut(restyleStepSubmitSymbols(chunk), encoding, callback);
|
|
21866
|
+
}
|
|
21867
|
+
armed = false;
|
|
21868
|
+
const rest = chunk.slice(idx + GREEN_STEP_SUBMIT.length);
|
|
21869
|
+
marker = { rowsAbove: rowDelta(rest) };
|
|
21870
|
+
return writeOut(
|
|
21871
|
+
restyleStepSubmitSymbols(chunk.slice(0, idx)) + GREEN_STEP_SUBMIT + restyleStepSubmitSymbols(rest),
|
|
21872
|
+
encoding,
|
|
21873
|
+
callback
|
|
21874
|
+
);
|
|
21875
|
+
});
|
|
21876
|
+
process.stderr.write = ((chunk, encoding, callback) => {
|
|
21877
|
+
if (typeof chunk === "string" && marker) marker.rowsAbove += rowDelta(chunk);
|
|
21878
|
+
return writeErr(chunk, encoding, callback);
|
|
21879
|
+
});
|
|
21849
21880
|
return () => {
|
|
21850
|
-
process.stdout.write =
|
|
21881
|
+
process.stdout.write = unpatchedOut;
|
|
21882
|
+
process.stderr.write = unpatchedErr;
|
|
21883
|
+
rawStdoutWrite = void 0;
|
|
21851
21884
|
installed = false;
|
|
21885
|
+
armed = false;
|
|
21886
|
+
marker = null;
|
|
21887
|
+
};
|
|
21888
|
+
}
|
|
21889
|
+
function deferNextPromptCheck() {
|
|
21890
|
+
if (!installed) return { confirm() {
|
|
21891
|
+
}, skip() {
|
|
21892
|
+
} };
|
|
21893
|
+
generation += 1;
|
|
21894
|
+
const token = generation;
|
|
21895
|
+
armed = true;
|
|
21896
|
+
marker = null;
|
|
21897
|
+
return {
|
|
21898
|
+
confirm() {
|
|
21899
|
+
if (token !== generation) return;
|
|
21900
|
+
armed = false;
|
|
21901
|
+
const rows = marker?.rowsAbove;
|
|
21902
|
+
marker = null;
|
|
21903
|
+
if (rows === void 0 || rows <= 0 || rows >= (process.stdout.rows ?? 24)) return;
|
|
21904
|
+
rawStdoutWrite?.(`\x1B[${rows}A\r${GREEN_CHECK}\x1B[${rows}B\r`);
|
|
21905
|
+
},
|
|
21906
|
+
skip() {
|
|
21907
|
+
if (token !== generation) return;
|
|
21908
|
+
armed = false;
|
|
21909
|
+
marker = null;
|
|
21910
|
+
}
|
|
21852
21911
|
};
|
|
21853
21912
|
}
|
|
21854
21913
|
|
|
@@ -22100,6 +22159,7 @@ async function promptPlugins(cwd, options = {}) {
|
|
|
22100
22159
|
overwriteKeys.add(key);
|
|
22101
22160
|
}
|
|
22102
22161
|
};
|
|
22162
|
+
const storageStep = deferNextPromptCheck();
|
|
22103
22163
|
const storage = await p11.select({
|
|
22104
22164
|
message: "Choose a file storage",
|
|
22105
22165
|
options: [
|
|
@@ -22125,6 +22185,7 @@ async function promptPlugins(cwd, options = {}) {
|
|
|
22125
22185
|
}
|
|
22126
22186
|
if (storage === "r2") {
|
|
22127
22187
|
mergeIntegrationConfig(await collectIntegrationConfig(cwd, ["r2"]));
|
|
22188
|
+
storageStep.confirm();
|
|
22128
22189
|
} else if (storage === "vercel-blob") {
|
|
22129
22190
|
const existingToken = readEnvVar(cwd, "BLOB_READ_WRITE_TOKEN")?.trim();
|
|
22130
22191
|
const flow = !existingToken && options.provisionVercelBlob ? await options.provisionVercelBlob() : void 0;
|
|
@@ -22136,6 +22197,8 @@ async function promptPlugins(cwd, options = {}) {
|
|
|
22136
22197
|
vars: [{ key: "BLOB_READ_WRITE_TOKEN", value: flow.token }]
|
|
22137
22198
|
});
|
|
22138
22199
|
overwriteKeys.add("BLOB_READ_WRITE_TOKEN");
|
|
22200
|
+
if (flow.usedTerminalFallback) storageStep.skip();
|
|
22201
|
+
else storageStep.confirm();
|
|
22139
22202
|
} else {
|
|
22140
22203
|
if (existingToken) {
|
|
22141
22204
|
p11.log.info("Using the existing Vercel Blob token from .env.local");
|
|
@@ -22143,7 +22206,11 @@ async function promptPlugins(cwd, options = {}) {
|
|
|
22143
22206
|
p11.log.info("Falling back to a manual Vercel Blob token.");
|
|
22144
22207
|
}
|
|
22145
22208
|
mergeIntegrationConfig(await collectIntegrationConfig(cwd, ["vercel-blob"]));
|
|
22209
|
+
if (flow) storageStep.skip();
|
|
22210
|
+
else storageStep.confirm();
|
|
22146
22211
|
}
|
|
22212
|
+
} else {
|
|
22213
|
+
storageStep.confirm();
|
|
22147
22214
|
}
|
|
22148
22215
|
const selectedPlugins = await p11.multiselect({
|
|
22149
22216
|
message: "Select presets",
|
|
@@ -24492,7 +24559,7 @@ async function provisionBlobStoreInteractive(runner, cwd, options) {
|
|
|
24492
24559
|
return { storeName: quiet.storeName, failure: "env-pull-empty" };
|
|
24493
24560
|
}
|
|
24494
24561
|
pullSpinner.clear();
|
|
24495
|
-
return { token, storeName: quiet.storeName };
|
|
24562
|
+
return { token, storeName: quiet.storeName, usedTerminalFallback: true };
|
|
24496
24563
|
}
|
|
24497
24564
|
async function provisionBlobStore(runner, cwd, options) {
|
|
24498
24565
|
const provisionSpinner = spinner2();
|
|
@@ -24869,7 +24936,8 @@ async function runVercelBlobFlow(options) {
|
|
|
24869
24936
|
return {
|
|
24870
24937
|
ok: true,
|
|
24871
24938
|
token: blob.token,
|
|
24872
|
-
blobStoreName: blob.storeName
|
|
24939
|
+
blobStoreName: blob.storeName,
|
|
24940
|
+
usedTerminalFallback: blob.usedTerminalFallback
|
|
24873
24941
|
};
|
|
24874
24942
|
} catch (error) {
|
|
24875
24943
|
p16.log.warn(
|
|
@@ -24905,7 +24973,9 @@ async function runVercelDeployFlow(options) {
|
|
|
24905
24973
|
} else {
|
|
24906
24974
|
envSpinner.clear();
|
|
24907
24975
|
}
|
|
24976
|
+
let printedWarnings = false;
|
|
24908
24977
|
for (const key of sync.failed) {
|
|
24978
|
+
printedWarnings = true;
|
|
24909
24979
|
p16.log.warn(
|
|
24910
24980
|
`Could not set ${pc6.cyan(key)} on Vercel \u2014 add it in the project's environment settings.`
|
|
24911
24981
|
);
|
|
@@ -24915,6 +24985,7 @@ async function runVercelDeployFlow(options) {
|
|
|
24915
24985
|
}
|
|
24916
24986
|
const packageGuard = guardProjectForDeploy(options.cwd);
|
|
24917
24987
|
for (const dep of packageGuard.localSpecDeps) {
|
|
24988
|
+
printedWarnings = true;
|
|
24918
24989
|
p16.log.warn(
|
|
24919
24990
|
`Dependency ${pc6.cyan(dep)} uses a local spec that cannot install on Vercel \u2014 the remote build may fail.`
|
|
24920
24991
|
);
|
|
@@ -24936,7 +25007,7 @@ async function runVercelDeployFlow(options) {
|
|
|
24936
25007
|
const linkedName = readLinkedProjectName(options.cwd);
|
|
24937
25008
|
const url = linkedName ? `https://${linkedName}.vercel.app` : deploy.url;
|
|
24938
25009
|
deploySpinner.stop(url ? `Deployed ${pc6.cyan(url)}` : "Deployed to Vercel");
|
|
24939
|
-
return { ok: true, url, syncedEnvKeys: sync.synced };
|
|
25010
|
+
return { ok: true, url, syncedEnvKeys: sync.synced, cleanScreen: !printedWarnings };
|
|
24940
25011
|
} catch (error) {
|
|
24941
25012
|
p16.log.warn(`Vercel deploy failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
24942
25013
|
printManualDeployHint();
|
|
@@ -25638,6 +25709,7 @@ async function runInitCommand(name, options) {
|
|
|
25638
25709
|
p17.log.info(`Using existing database URL from .env.local ${pc7.dim(`(${masked})`)}`);
|
|
25639
25710
|
databaseUrl = existingDbUrl;
|
|
25640
25711
|
} else {
|
|
25712
|
+
const databaseStep = deferNextPromptCheck();
|
|
25641
25713
|
const servicesResult = await promptServices({ allowVercel: options.vercel !== false });
|
|
25642
25714
|
if (servicesResult.provider === "vercel-cli") {
|
|
25643
25715
|
const flow = await runVercelNeonFlow({
|
|
@@ -25651,17 +25723,22 @@ async function runInitCommand(name, options) {
|
|
|
25651
25723
|
databaseUrl = flow.databaseUrl;
|
|
25652
25724
|
persistDatabaseUrl(cwd, databaseUrl);
|
|
25653
25725
|
dismissVercelSignedInNote = flow.dismissSignedInNote;
|
|
25726
|
+
if (flow.dismissSignedInNote) databaseStep.confirm();
|
|
25727
|
+
else databaseStep.skip();
|
|
25654
25728
|
} else if (flow.ok) {
|
|
25729
|
+
databaseStep.skip();
|
|
25655
25730
|
openBrowserVercelNeonResource(flow.dashboardUrl ?? flow.resourceUrl);
|
|
25656
25731
|
databaseUrl = await promptConnectionString();
|
|
25657
25732
|
persistDatabaseUrl(cwd, databaseUrl);
|
|
25658
25733
|
} else {
|
|
25734
|
+
databaseStep.skip();
|
|
25659
25735
|
p17.log.info("Falling back to a manual database connection string.");
|
|
25660
25736
|
openBrowserVercelNeon();
|
|
25661
25737
|
databaseUrl = await promptConnectionString();
|
|
25662
25738
|
}
|
|
25663
25739
|
} else {
|
|
25664
25740
|
databaseUrl = servicesResult.url;
|
|
25741
|
+
databaseStep.confirm();
|
|
25665
25742
|
}
|
|
25666
25743
|
}
|
|
25667
25744
|
const selectedPlugins = (() => {
|
|
@@ -26177,12 +26254,17 @@ Run manually: ${pc7.cyan(betterstartExecCommand(pm, "seed"))}`,
|
|
|
26177
26254
|
if (options.vercel !== false && !options.skipDeploy) {
|
|
26178
26255
|
const linkedVercelProject = Boolean(readLinkedProjectId(cwd));
|
|
26179
26256
|
if (!options.yes) {
|
|
26257
|
+
const deployStep = deferNextPromptCheck();
|
|
26180
26258
|
const deployNow = await p17.confirm({
|
|
26181
26259
|
message: "Deploy to Vercel now?",
|
|
26182
26260
|
initialValue: linkedVercelProject
|
|
26183
26261
|
});
|
|
26184
26262
|
if (!p17.isCancel(deployNow) && deployNow) {
|
|
26185
|
-
await runVercelDeployFlow({ cwd, projectName, env: process.env });
|
|
26263
|
+
const deployFlow = await runVercelDeployFlow({ cwd, projectName, env: process.env });
|
|
26264
|
+
if (deployFlow.ok && deployFlow.cleanScreen) deployStep.confirm();
|
|
26265
|
+
else deployStep.skip();
|
|
26266
|
+
} else {
|
|
26267
|
+
deployStep.confirm();
|
|
26186
26268
|
}
|
|
26187
26269
|
} else if (linkedVercelProject && process.env.VERCEL_TOKEN) {
|
|
26188
26270
|
const deployFlow = await runVercelDeployFlow({
|