betterstart-cli 0.0.45 → 0.0.47
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 +37 -237
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3468,7 +3468,7 @@ function schemaManifestContainsMailchimpImports(cwd, config, schemaName) {
|
|
|
3468
3468
|
return false;
|
|
3469
3469
|
}
|
|
3470
3470
|
const content = fs14.readFileSync(fullPath, "utf-8");
|
|
3471
|
-
return markers.some((
|
|
3471
|
+
return markers.some((marker) => content.includes(marker));
|
|
3472
3472
|
});
|
|
3473
3473
|
}
|
|
3474
3474
|
function findBlockingIntegrationDependencies(cwd, config, integrationId) {
|
|
@@ -21868,80 +21868,20 @@ var GREEN_CHECK = "\x1B[32m\u2713\x1B[39m";
|
|
|
21868
21868
|
function restyleStepSubmitSymbols(text7) {
|
|
21869
21869
|
return text7.split(GREEN_STEP_SUBMIT).join(GREEN_CHECK);
|
|
21870
21870
|
}
|
|
21871
|
-
var ROW_ESCAPES = /\u001B\[(\d*)([ABEF])/g;
|
|
21872
|
-
function rowDelta(text7) {
|
|
21873
|
-
let delta = text7.split("\n").length - 1;
|
|
21874
|
-
for (const match of text7.matchAll(ROW_ESCAPES)) {
|
|
21875
|
-
const n = match[1] === "" ? 1 : Number(match[1]);
|
|
21876
|
-
delta += match[2] === "A" || match[2] === "F" ? -n : n;
|
|
21877
|
-
}
|
|
21878
|
-
return delta;
|
|
21879
|
-
}
|
|
21880
21871
|
var installed = false;
|
|
21881
|
-
var armed = false;
|
|
21882
|
-
var marker = null;
|
|
21883
|
-
var generation = 0;
|
|
21884
|
-
var rawStdoutWrite;
|
|
21885
21872
|
function installPromptCheckmarks() {
|
|
21886
21873
|
if (installed || !process.stdout.isTTY || process.env.CI === "true") return () => {
|
|
21887
21874
|
};
|
|
21888
21875
|
installed = true;
|
|
21889
|
-
const
|
|
21890
|
-
const
|
|
21891
|
-
const writeOut = unpatchedOut.bind(process.stdout);
|
|
21892
|
-
const writeErr = unpatchedErr.bind(process.stderr);
|
|
21893
|
-
rawStdoutWrite = writeOut;
|
|
21876
|
+
const unpatched = process.stdout.write;
|
|
21877
|
+
const write = unpatched.bind(process.stdout);
|
|
21894
21878
|
process.stdout.write = ((chunk, encoding, callback) => {
|
|
21895
|
-
if (typeof chunk !== "string") return
|
|
21896
|
-
|
|
21897
|
-
if (idx === -1) {
|
|
21898
|
-
if (marker) marker.rowsAbove += rowDelta(chunk);
|
|
21899
|
-
return writeOut(restyleStepSubmitSymbols(chunk), encoding, callback);
|
|
21900
|
-
}
|
|
21901
|
-
armed = false;
|
|
21902
|
-
const rest = chunk.slice(idx + GREEN_STEP_SUBMIT.length);
|
|
21903
|
-
marker = { rowsAbove: rowDelta(rest) };
|
|
21904
|
-
return writeOut(
|
|
21905
|
-
restyleStepSubmitSymbols(chunk.slice(0, idx)) + GREEN_STEP_SUBMIT + restyleStepSubmitSymbols(rest),
|
|
21906
|
-
encoding,
|
|
21907
|
-
callback
|
|
21908
|
-
);
|
|
21909
|
-
});
|
|
21910
|
-
process.stderr.write = ((chunk, encoding, callback) => {
|
|
21911
|
-
if (typeof chunk === "string" && marker) marker.rowsAbove += rowDelta(chunk);
|
|
21912
|
-
return writeErr(chunk, encoding, callback);
|
|
21879
|
+
if (typeof chunk !== "string") return write(chunk, encoding, callback);
|
|
21880
|
+
return write(restyleStepSubmitSymbols(chunk), encoding, callback);
|
|
21913
21881
|
});
|
|
21914
21882
|
return () => {
|
|
21915
|
-
process.stdout.write =
|
|
21916
|
-
process.stderr.write = unpatchedErr;
|
|
21917
|
-
rawStdoutWrite = void 0;
|
|
21883
|
+
process.stdout.write = unpatched;
|
|
21918
21884
|
installed = false;
|
|
21919
|
-
armed = false;
|
|
21920
|
-
marker = null;
|
|
21921
|
-
};
|
|
21922
|
-
}
|
|
21923
|
-
function deferNextPromptCheck() {
|
|
21924
|
-
if (!installed) return { confirm() {
|
|
21925
|
-
}, skip() {
|
|
21926
|
-
} };
|
|
21927
|
-
generation += 1;
|
|
21928
|
-
const token = generation;
|
|
21929
|
-
armed = true;
|
|
21930
|
-
marker = null;
|
|
21931
|
-
return {
|
|
21932
|
-
confirm() {
|
|
21933
|
-
if (token !== generation) return;
|
|
21934
|
-
armed = false;
|
|
21935
|
-
const rows = marker?.rowsAbove;
|
|
21936
|
-
marker = null;
|
|
21937
|
-
if (rows === void 0 || rows <= 0 || rows >= (process.stdout.rows ?? 24)) return;
|
|
21938
|
-
rawStdoutWrite?.(`\x1B[${rows}A\r${GREEN_CHECK}\x1B[${rows}B\r`);
|
|
21939
|
-
},
|
|
21940
|
-
skip() {
|
|
21941
|
-
if (token !== generation) return;
|
|
21942
|
-
armed = false;
|
|
21943
|
-
marker = null;
|
|
21944
|
-
}
|
|
21945
21885
|
};
|
|
21946
21886
|
}
|
|
21947
21887
|
|
|
@@ -22198,7 +22138,6 @@ async function promptPresets(cwd, options = {}) {
|
|
|
22198
22138
|
overwriteKeys.add(key);
|
|
22199
22139
|
}
|
|
22200
22140
|
};
|
|
22201
|
-
const storageStep = deferNextPromptCheck();
|
|
22202
22141
|
const storage = await p12.select({
|
|
22203
22142
|
message: "Choose a file storage",
|
|
22204
22143
|
options: [
|
|
@@ -22224,7 +22163,6 @@ async function promptPresets(cwd, options = {}) {
|
|
|
22224
22163
|
}
|
|
22225
22164
|
if (storage === "r2") {
|
|
22226
22165
|
mergeIntegrationConfig(await collectIntegrationConfig(cwd, ["r2"]));
|
|
22227
|
-
storageStep.confirm();
|
|
22228
22166
|
} else if (storage === "vercel-blob") {
|
|
22229
22167
|
const existingToken = readEnvVar(cwd, "BLOB_READ_WRITE_TOKEN")?.trim();
|
|
22230
22168
|
const flow = !existingToken && options.provisionVercelBlob ? await options.provisionVercelBlob() : void 0;
|
|
@@ -22235,8 +22173,6 @@ async function promptPresets(cwd, options = {}) {
|
|
|
22235
22173
|
vars: [{ key: "BLOB_READ_WRITE_TOKEN", value: flow.token }]
|
|
22236
22174
|
});
|
|
22237
22175
|
overwriteKeys.add("BLOB_READ_WRITE_TOKEN");
|
|
22238
|
-
if (flow.usedTerminalFallback) storageStep.skip();
|
|
22239
|
-
else storageStep.confirm();
|
|
22240
22176
|
} else if (flow) {
|
|
22241
22177
|
p12.log.warn(
|
|
22242
22178
|
"Continuing without a Blob token \u2014 add BLOB_READ_WRITE_TOKEN to .env.local from the store on vercel.com/dashboard/stores."
|
|
@@ -22245,7 +22181,6 @@ async function promptPresets(cwd, options = {}) {
|
|
|
22245
22181
|
header: "Storage (Vercel Blob)",
|
|
22246
22182
|
vars: [{ key: "BLOB_READ_WRITE_TOKEN", value: "" }]
|
|
22247
22183
|
});
|
|
22248
|
-
storageStep.skip();
|
|
22249
22184
|
} else {
|
|
22250
22185
|
if (existingToken) {
|
|
22251
22186
|
p12.log.info(
|
|
@@ -22256,10 +22191,7 @@ async function promptPresets(cwd, options = {}) {
|
|
|
22256
22191
|
);
|
|
22257
22192
|
}
|
|
22258
22193
|
mergeIntegrationConfig(await collectIntegrationConfig(cwd, ["vercel-blob"]));
|
|
22259
|
-
storageStep.confirm();
|
|
22260
22194
|
}
|
|
22261
|
-
} else {
|
|
22262
|
-
storageStep.confirm();
|
|
22263
22195
|
}
|
|
22264
22196
|
const selectedPresets = await p12.multiselect({
|
|
22265
22197
|
message: "Select presets",
|
|
@@ -24592,11 +24524,7 @@ async function provisionBlobStoreInteractive(runner, cwd, options) {
|
|
|
24592
24524
|
return { ...storeName && { storeName }, failure: "env-pull-empty" };
|
|
24593
24525
|
}
|
|
24594
24526
|
activeSpinner.clear();
|
|
24595
|
-
return {
|
|
24596
|
-
token,
|
|
24597
|
-
...storeName && { storeName },
|
|
24598
|
-
...terminalFallbackRan && { usedTerminalFallback: true }
|
|
24599
|
-
};
|
|
24527
|
+
return { token, ...storeName && { storeName } };
|
|
24600
24528
|
};
|
|
24601
24529
|
for (let attempt = 1; attempt <= MAX_STORE_NAME_ATTEMPTS; attempt++) {
|
|
24602
24530
|
const storeName = candidateStoreName(options.name, attempt);
|
|
@@ -24889,11 +24817,9 @@ import * as p16 from "@clack/prompts";
|
|
|
24889
24817
|
import pc5 from "picocolors";
|
|
24890
24818
|
var PROVISION_TIMEOUT_MS2 = 18e4;
|
|
24891
24819
|
var INTERACTIVE_PROVISION_TIMEOUT_MS2 = 6e5;
|
|
24892
|
-
var RESOURCE_CONNECT_TIMEOUT_MS = 6e4;
|
|
24893
|
-
var NEON_FREE_PLAN_ID = "free_v3";
|
|
24894
24820
|
async function provisionNeonInteractive(runner, cwd, options) {
|
|
24895
|
-
const
|
|
24896
|
-
|
|
24821
|
+
const quietSpinner = spinner2();
|
|
24822
|
+
quietSpinner.start("Creating your Neon database");
|
|
24897
24823
|
const quiet = await runVercel(runner, neonAddArgs(options), {
|
|
24898
24824
|
cwd,
|
|
24899
24825
|
mode: "capture",
|
|
@@ -24901,72 +24827,25 @@ async function provisionNeonInteractive(runner, cwd, options) {
|
|
|
24901
24827
|
env: options.env
|
|
24902
24828
|
});
|
|
24903
24829
|
if (quiet.success) {
|
|
24904
|
-
|
|
24830
|
+
quietSpinner.clear();
|
|
24905
24831
|
return readNeonProvisionInfo(quiet.stdout);
|
|
24906
24832
|
}
|
|
24907
|
-
|
|
24833
|
+
quietSpinner.clear();
|
|
24834
|
+
p16.log.info(
|
|
24835
|
+
`Create your Neon database in the Vercel prompts below ${pc5.dim(
|
|
24836
|
+
"(the Free plan is recommended)."
|
|
24837
|
+
)}`
|
|
24838
|
+
);
|
|
24908
24839
|
const add = await runVercel(runner, connectedNeonAddArgs(options), {
|
|
24909
24840
|
cwd,
|
|
24910
|
-
mode: "
|
|
24841
|
+
mode: "inherit",
|
|
24911
24842
|
timeoutMs: INTERACTIVE_PROVISION_TIMEOUT_MS2,
|
|
24912
|
-
env: options.env
|
|
24913
|
-
streamLineFilter: (line) => {
|
|
24914
|
-
if (!showNeonSetupLine(line)) return false;
|
|
24915
|
-
if (!promptsShown) {
|
|
24916
|
-
promptsShown = true;
|
|
24917
|
-
provisionSpinner.clear();
|
|
24918
|
-
p16.log.info(
|
|
24919
|
-
`Finish the Neon database setup in the Vercel prompts below ${pc5.dim(
|
|
24920
|
-
"(the Free plan is recommended)."
|
|
24921
|
-
)}`
|
|
24922
|
-
);
|
|
24923
|
-
}
|
|
24924
|
-
return true;
|
|
24925
|
-
}
|
|
24843
|
+
env: options.env
|
|
24926
24844
|
});
|
|
24927
|
-
if (!promptsShown) provisionSpinner.clear();
|
|
24928
24845
|
if (!add.success) {
|
|
24929
|
-
|
|
24930
|
-
${add.stderr}`.trim();
|
|
24931
|
-
return {
|
|
24932
|
-
failure: add.timedOut ? "timeout" : "provision-failed",
|
|
24933
|
-
// Lines the user already saw are not repeated as detail.
|
|
24934
|
-
detail: promptsShown ? void 0 : combined || void 0
|
|
24935
|
-
};
|
|
24846
|
+
return { failure: add.timedOut ? "timeout" : "provision-failed" };
|
|
24936
24847
|
}
|
|
24937
|
-
|
|
24938
|
-
${add.stderr}`);
|
|
24939
|
-
if (promptsShown) info.usedTerminalFallback = true;
|
|
24940
|
-
return info;
|
|
24941
|
-
}
|
|
24942
|
-
var NEON_SETUP_NOISE = [
|
|
24943
|
-
/^$/,
|
|
24944
|
-
/^Vercel CLI \d/,
|
|
24945
|
-
/^>? ?Installing .+ under /,
|
|
24946
|
-
/^Provisioning resource/,
|
|
24947
|
-
/^Retrieving project/,
|
|
24948
|
-
/^>? ?Success!/,
|
|
24949
|
-
/^>? ?Guide: Run/,
|
|
24950
|
-
/^>? ?Dashboard: https:\/\//,
|
|
24951
|
-
/successfully connected to/i,
|
|
24952
|
-
/^>? ?Overwriting existing \.env/,
|
|
24953
|
-
/^>? ?Downloading/,
|
|
24954
|
-
/^Changes:/,
|
|
24955
|
-
/^\+ [A-Z][A-Z0-9_]*/,
|
|
24956
|
-
/^[✓√] +(Updated|Created)/
|
|
24957
|
-
];
|
|
24958
|
-
function showNeonSetupLine(line) {
|
|
24959
|
-
return !NEON_SETUP_NOISE.some((pattern) => pattern.test(line));
|
|
24960
|
-
}
|
|
24961
|
-
function readNeonFallbackInfo(output) {
|
|
24962
|
-
const info = {};
|
|
24963
|
-
const provisioned = output.match(/successfully provisioned: (\S+)/i)?.[1];
|
|
24964
|
-
if (provisioned) info.resourceName = provisioned;
|
|
24965
|
-
const dashboard = output.match(/Dashboard: (https:\/\/\S+)/i)?.[1];
|
|
24966
|
-
if (dashboard) info.dashboardUrl = dashboard;
|
|
24967
|
-
if (/failed to connect/i.test(output)) info.connectedToProject = false;
|
|
24968
|
-
else if (/successfully connected to/i.test(output)) info.connectedToProject = true;
|
|
24969
|
-
return info;
|
|
24848
|
+
return { usedTerminalFallback: true };
|
|
24970
24849
|
}
|
|
24971
24850
|
async function provisionNeon(runner, cwd, options) {
|
|
24972
24851
|
const provisionSpinner = spinner2();
|
|
@@ -25002,57 +24881,17 @@ function readNeonProvisionInfo(stdout) {
|
|
|
25002
24881
|
const info = {};
|
|
25003
24882
|
if (meta.dashboardUrl) info.dashboardUrl = meta.dashboardUrl;
|
|
25004
24883
|
if (meta.ssoUrl?.resource) info.resourceUrl = meta.ssoUrl.resource;
|
|
25005
|
-
if (meta.resource?.name) info.resourceName = meta.resource.name;
|
|
25006
|
-
const connectWarning = (meta.warnings ?? []).some((warning) => /failed to connect/i.test(warning));
|
|
25007
|
-
if (meta.envPulled === false || connectWarning) info.connectedToProject = false;
|
|
25008
|
-
else if (meta.envPulled === true) info.connectedToProject = true;
|
|
25009
24884
|
return info;
|
|
25010
24885
|
}
|
|
25011
|
-
async function replaceNeonProjectConnection(runner, cwd, resourceName, env) {
|
|
25012
|
-
const list = await runVercel(runner, ["integration", "list", "--format", "json"], {
|
|
25013
|
-
cwd,
|
|
25014
|
-
mode: "capture",
|
|
25015
|
-
timeoutMs: RESOURCE_CONNECT_TIMEOUT_MS,
|
|
25016
|
-
env
|
|
25017
|
-
});
|
|
25018
|
-
if (list.success) {
|
|
25019
|
-
const payload = parseVercelJson(list.stdout);
|
|
25020
|
-
for (const resource of payload?.resources ?? []) {
|
|
25021
|
-
if (!resource.name || resource.name === resourceName) continue;
|
|
25022
|
-
if (resource.product && !/neon/i.test(resource.product)) continue;
|
|
25023
|
-
await runVercel(runner, ["integration-resource", "disconnect", resource.name, "--yes"], {
|
|
25024
|
-
cwd,
|
|
25025
|
-
mode: "capture",
|
|
25026
|
-
timeoutMs: RESOURCE_CONNECT_TIMEOUT_MS,
|
|
25027
|
-
env
|
|
25028
|
-
});
|
|
25029
|
-
}
|
|
25030
|
-
}
|
|
25031
|
-
const connect = await runVercel(
|
|
25032
|
-
runner,
|
|
25033
|
-
["integration-resource", "connect", resourceName, "--yes"],
|
|
25034
|
-
{
|
|
25035
|
-
cwd,
|
|
25036
|
-
mode: "capture",
|
|
25037
|
-
timeoutMs: RESOURCE_CONNECT_TIMEOUT_MS,
|
|
25038
|
-
env
|
|
25039
|
-
}
|
|
25040
|
-
);
|
|
25041
|
-
return connect.success;
|
|
25042
|
-
}
|
|
25043
24886
|
function neonAddArgs(options) {
|
|
25044
|
-
|
|
25045
|
-
|
|
25046
|
-
|
|
25047
|
-
"neon",
|
|
25048
|
-
"--format",
|
|
25049
|
-
"json",
|
|
25050
|
-
"--plan",
|
|
25051
|
-
options.plan ?? NEON_FREE_PLAN_ID
|
|
25052
|
-
];
|
|
24887
|
+
const addArgs = ["integration", "add", "neon", "--format", "json"];
|
|
24888
|
+
if (options.plan) addArgs.push("--plan", options.plan);
|
|
24889
|
+
return addArgs;
|
|
25053
24890
|
}
|
|
25054
24891
|
function connectedNeonAddArgs(options) {
|
|
25055
|
-
|
|
24892
|
+
const addArgs = ["integration", "add", "neon"];
|
|
24893
|
+
if (options.plan) addArgs.push("--plan", options.plan);
|
|
24894
|
+
return addArgs;
|
|
25056
24895
|
}
|
|
25057
24896
|
|
|
25058
24897
|
// adapters/next/init/vercel/flow.ts
|
|
@@ -25069,29 +24908,15 @@ async function runVercelNeonFlow(options) {
|
|
|
25069
24908
|
p17.log.warn(authFailureMessage(auth.reason));
|
|
25070
24909
|
return { ok: false };
|
|
25071
24910
|
}
|
|
25072
|
-
|
|
25073
|
-
const linkLinePrinted = await ensureLinkedProject(runner, options.cwd, options.projectName, env);
|
|
25074
|
-
const preExistingDbUrl = linkPreExisted ? await pullPreExistingDbUrl(runner, options.cwd, env) : void 0;
|
|
24911
|
+
await ensureLinkedProject(runner, options.cwd, options.projectName, env);
|
|
25075
24912
|
const neon = await provisionNeonForMode(runner, options);
|
|
25076
24913
|
if (neon.failure) {
|
|
25077
24914
|
p17.log.warn(neonFailureMessage(neon.failure));
|
|
25078
24915
|
if (neon.detail) p17.log.message(pc6.dim(neon.detail));
|
|
25079
24916
|
return { ok: false };
|
|
25080
24917
|
}
|
|
25081
|
-
|
|
25082
|
-
|
|
25083
|
-
connectSpinner.start("Connecting the database to your Vercel project");
|
|
25084
|
-
await replaceNeonProjectConnection(runner, options.cwd, neon.resourceName, env);
|
|
25085
|
-
connectSpinner.clear();
|
|
25086
|
-
}
|
|
25087
|
-
let databaseUrl = await pullNeonDatabaseUrl(runner, options.cwd, env);
|
|
25088
|
-
if (databaseUrl && databaseUrl === preExistingDbUrl) {
|
|
25089
|
-
databaseUrl = void 0;
|
|
25090
|
-
p17.log.warn(
|
|
25091
|
-
"The linked Vercel project still returns its previous DATABASE_URL \u2014 the new database could not be connected."
|
|
25092
|
-
);
|
|
25093
|
-
}
|
|
25094
|
-
const dismissSignedInNote = databaseUrl && auth.dismissNote && !neon.usedTerminalFallback ? () => auth.dismissNote?.({ linesBelow: linkLinePrinted ? 1 : 0 }) : void 0;
|
|
24918
|
+
const databaseUrl = await pullNeonDatabaseUrl(runner, options.cwd, env);
|
|
24919
|
+
const dismissSignedInNote = databaseUrl && auth.dismissNote && !neon.usedTerminalFallback ? () => auth.dismissNote?.({ linesBelow: 0 }) : void 0;
|
|
25095
24920
|
return {
|
|
25096
24921
|
ok: true,
|
|
25097
24922
|
databaseUrl,
|
|
@@ -25131,8 +24956,7 @@ async function runVercelBlobFlow(options) {
|
|
|
25131
24956
|
return {
|
|
25132
24957
|
ok: true,
|
|
25133
24958
|
token: blob.token,
|
|
25134
|
-
blobStoreName: blob.storeName
|
|
25135
|
-
usedTerminalFallback: blob.usedTerminalFallback
|
|
24959
|
+
blobStoreName: blob.storeName
|
|
25136
24960
|
};
|
|
25137
24961
|
} catch (error) {
|
|
25138
24962
|
p17.log.warn(
|
|
@@ -25168,9 +24992,7 @@ async function runVercelDeployFlow(options) {
|
|
|
25168
24992
|
} else {
|
|
25169
24993
|
envSpinner.clear();
|
|
25170
24994
|
}
|
|
25171
|
-
let printedWarnings = false;
|
|
25172
24995
|
for (const key of sync.failed) {
|
|
25173
|
-
printedWarnings = true;
|
|
25174
24996
|
p17.log.warn(
|
|
25175
24997
|
`Could not set ${pc6.cyan(key)} on Vercel \u2014 add it in the project's environment settings.`
|
|
25176
24998
|
);
|
|
@@ -25180,13 +25002,12 @@ async function runVercelDeployFlow(options) {
|
|
|
25180
25002
|
}
|
|
25181
25003
|
const packageGuard = guardProjectForDeploy(options.cwd);
|
|
25182
25004
|
for (const dep of packageGuard.localSpecDeps) {
|
|
25183
|
-
printedWarnings = true;
|
|
25184
25005
|
p17.log.warn(
|
|
25185
25006
|
`Dependency ${pc6.cyan(dep)} uses a local spec that cannot install on Vercel \u2014 the remote build may fail.`
|
|
25186
25007
|
);
|
|
25187
25008
|
}
|
|
25188
25009
|
const deploySpinner = spinner2();
|
|
25189
|
-
deploySpinner.start("Deploying to Vercel
|
|
25010
|
+
deploySpinner.start("Deploying to Vercel (this may take a few minutes)");
|
|
25190
25011
|
let deploy;
|
|
25191
25012
|
try {
|
|
25192
25013
|
deploy = await deployVercelProject(runner, options.cwd, env);
|
|
@@ -25202,7 +25023,7 @@ async function runVercelDeployFlow(options) {
|
|
|
25202
25023
|
const linkedName = readLinkedProjectName(options.cwd);
|
|
25203
25024
|
const url = linkedName ? `https://${linkedName}.vercel.app` : deploy.url;
|
|
25204
25025
|
deploySpinner.stop(url ? `Deployed ${pc6.cyan(url)}` : "Deployed to Vercel");
|
|
25205
|
-
return { ok: true, url, syncedEnvKeys: sync.synced
|
|
25026
|
+
return { ok: true, url, syncedEnvKeys: sync.synced };
|
|
25206
25027
|
} catch (error) {
|
|
25207
25028
|
p17.log.warn(`Vercel deploy failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
25208
25029
|
printManualDeployHint();
|
|
@@ -25215,21 +25036,11 @@ function printManualDeployHint() {
|
|
|
25215
25036
|
p17.log.info(`You can deploy manually: ${pc6.cyan("vercel deploy --prod")}`);
|
|
25216
25037
|
}
|
|
25217
25038
|
async function ensureLinkedProject(runner, cwd, projectName, env) {
|
|
25218
|
-
if (readLinkedProjectId(cwd)) return
|
|
25039
|
+
if (readLinkedProjectId(cwd)) return;
|
|
25219
25040
|
const projectSpinner = spinner2();
|
|
25220
25041
|
projectSpinner.start(`Creating a Vercel project ${pc6.cyan(projectName)}`);
|
|
25221
|
-
|
|
25222
|
-
projectSpinner.
|
|
25223
|
-
project2.linked ? `Linked Vercel project ${pc6.cyan(project2.name)}` : `Using Vercel project ${pc6.cyan(project2.name)}`
|
|
25224
|
-
);
|
|
25225
|
-
return true;
|
|
25226
|
-
}
|
|
25227
|
-
async function pullPreExistingDbUrl(runner, cwd, env) {
|
|
25228
|
-
const snapshotSpinner = spinner2();
|
|
25229
|
-
snapshotSpinner.start("Checking the linked Vercel project");
|
|
25230
|
-
const url = await pullVercelEnvValue(runner, cwd, readDbUrlFromDotenv, env);
|
|
25231
|
-
snapshotSpinner.clear();
|
|
25232
|
-
return url;
|
|
25042
|
+
await createVercelProject(runner, cwd, projectName, env);
|
|
25043
|
+
projectSpinner.clear();
|
|
25233
25044
|
}
|
|
25234
25045
|
async function pullNeonDatabaseUrl(runner, cwd, env) {
|
|
25235
25046
|
const neonSpinner = spinner2();
|
|
@@ -25900,7 +25711,6 @@ async function runInitCommand(name, options) {
|
|
|
25900
25711
|
p18.log.info(`Using the existing DATABASE_URL from .env.local ${pc7.dim(`(${masked})`)}`);
|
|
25901
25712
|
databaseUrl = existingDbUrl;
|
|
25902
25713
|
} else {
|
|
25903
|
-
const databaseStep = deferNextPromptCheck();
|
|
25904
25714
|
const servicesResult = await promptServices({ allowVercel: options.vercel !== false });
|
|
25905
25715
|
if (servicesResult.provider === "vercel-cli") {
|
|
25906
25716
|
const flow = await runVercelNeonFlow({
|
|
@@ -25914,22 +25724,17 @@ async function runInitCommand(name, options) {
|
|
|
25914
25724
|
databaseUrl = flow.databaseUrl;
|
|
25915
25725
|
persistDatabaseUrl(cwd, databaseUrl);
|
|
25916
25726
|
dismissVercelSignedInNote = flow.dismissSignedInNote;
|
|
25917
|
-
if (flow.dismissSignedInNote) databaseStep.confirm();
|
|
25918
|
-
else databaseStep.skip();
|
|
25919
25727
|
} else if (flow.ok) {
|
|
25920
|
-
databaseStep.skip();
|
|
25921
25728
|
openBrowserVercelNeonResource(flow.dashboardUrl ?? flow.resourceUrl);
|
|
25922
25729
|
databaseUrl = await promptConnectionString();
|
|
25923
25730
|
persistDatabaseUrl(cwd, databaseUrl);
|
|
25924
25731
|
} else {
|
|
25925
|
-
databaseStep.skip();
|
|
25926
25732
|
p18.log.info("Falling back to a manual database connection string.");
|
|
25927
25733
|
openBrowserVercelNeon();
|
|
25928
25734
|
databaseUrl = await promptConnectionString();
|
|
25929
25735
|
}
|
|
25930
25736
|
} else {
|
|
25931
25737
|
databaseUrl = servicesResult.url;
|
|
25932
|
-
databaseStep.confirm();
|
|
25933
25738
|
}
|
|
25934
25739
|
}
|
|
25935
25740
|
const selectedPresets = (() => {
|
|
@@ -26072,7 +25877,7 @@ async function runInitCommand(name, options) {
|
|
|
26072
25877
|
}
|
|
26073
25878
|
const coreDependencyPlan = getDependencyPlan([], [], project2.linter.type === "none");
|
|
26074
25879
|
const cliDependencyPlan = getCliDependencySyncPlan(cwd);
|
|
26075
|
-
s.start("Installing dependencies
|
|
25880
|
+
s.start("Installing dependencies (this may take a minute)");
|
|
26076
25881
|
const depsResult = await installDependenciesAsync({
|
|
26077
25882
|
cwd,
|
|
26078
25883
|
pm,
|
|
@@ -26375,17 +26180,12 @@ Run manually: ${pc7.cyan(betterstartExecCommand(pm, "seed"))}`,
|
|
|
26375
26180
|
if (options.vercel !== false && !options.skipDeploy) {
|
|
26376
26181
|
const linkedVercelProject = Boolean(readLinkedProjectId(cwd));
|
|
26377
26182
|
if (!options.yes) {
|
|
26378
|
-
const deployStep = deferNextPromptCheck();
|
|
26379
26183
|
const deployNow = await p18.confirm({
|
|
26380
26184
|
message: "Deploy to Vercel now?",
|
|
26381
26185
|
initialValue: linkedVercelProject
|
|
26382
26186
|
});
|
|
26383
26187
|
if (!p18.isCancel(deployNow) && deployNow) {
|
|
26384
|
-
|
|
26385
|
-
if (deployFlow.ok && deployFlow.cleanScreen) deployStep.confirm();
|
|
26386
|
-
else deployStep.skip();
|
|
26387
|
-
} else {
|
|
26388
|
-
deployStep.confirm();
|
|
26188
|
+
await runVercelDeployFlow({ cwd, projectName, env: process.env });
|
|
26389
26189
|
}
|
|
26390
26190
|
} else if (linkedVercelProject && process.env.VERCEL_TOKEN) {
|
|
26391
26191
|
const deployFlow = await runVercelDeployFlow({
|