betterstart-cli 0.0.71 → 0.0.73
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 +24 -7
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -23390,7 +23390,11 @@ var ENV_SYNC_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
|
23390
23390
|
function buildRailwayProviderOverrides(options) {
|
|
23391
23391
|
const overrides = {};
|
|
23392
23392
|
if (options.databaseServiceName) {
|
|
23393
|
-
|
|
23393
|
+
const resource = options.databaseServiceName;
|
|
23394
|
+
overrides.DATABASE_URL = `\${{${resource}.DATABASE_URL}}`;
|
|
23395
|
+
if (options.buildCommand?.trim()) {
|
|
23396
|
+
overrides.RAILPACK_BUILD_CMD = `DATABASE_URL='\${{${resource}.DATABASE_PUBLIC_URL}}' ${options.buildCommand}`;
|
|
23397
|
+
}
|
|
23394
23398
|
}
|
|
23395
23399
|
if (options.bucketResourceName) {
|
|
23396
23400
|
const resource = options.bucketResourceName;
|
|
@@ -23537,13 +23541,14 @@ ${list.stderr}`) ?? `Could not list Railway domains for ${service.name}.`
|
|
|
23537
23541
|
return create.success ? firstDomainUrl(parseRailwayJson(create.stdout)) : void 0;
|
|
23538
23542
|
}
|
|
23539
23543
|
function deploymentLine(line) {
|
|
23544
|
+
let message = line;
|
|
23540
23545
|
try {
|
|
23541
23546
|
const parsed = JSON.parse(line);
|
|
23542
|
-
const
|
|
23543
|
-
if (typeof
|
|
23547
|
+
const jsonMessage = parsed.message ?? parsed.status;
|
|
23548
|
+
if (typeof jsonMessage === "string") message = jsonMessage;
|
|
23544
23549
|
} catch {
|
|
23545
23550
|
}
|
|
23546
|
-
return
|
|
23551
|
+
return /^\.+$/.test(message) ? void 0 : message.slice(0, 140);
|
|
23547
23552
|
}
|
|
23548
23553
|
async function readFailedDeploymentLogs(session, cwd, service) {
|
|
23549
23554
|
const logs = await runRailway(
|
|
@@ -23582,13 +23587,22 @@ async function runRailwayDeployFlow(options) {
|
|
|
23582
23587
|
service,
|
|
23583
23588
|
options.session.env
|
|
23584
23589
|
);
|
|
23590
|
+
const url = await ensureRailwayDomain(options.session, options.cwd, service);
|
|
23591
|
+
if (!url) {
|
|
23592
|
+
throw new Error("Railway could not create a public domain required for Better Auth.");
|
|
23593
|
+
}
|
|
23594
|
+
const providerOverrides = {
|
|
23595
|
+
...options.providerOverrides,
|
|
23596
|
+
BETTERSTART_AUTH_URL: url,
|
|
23597
|
+
NEXT_PUBLIC_BETTERSTART_AUTH_URL: url
|
|
23598
|
+
};
|
|
23585
23599
|
const envSpinner = spinner2();
|
|
23586
23600
|
envSpinner.start("Syncing environment variables to Railway");
|
|
23587
23601
|
const sync = await syncRailwayServiceEnv(
|
|
23588
23602
|
options.session,
|
|
23589
23603
|
options.cwd,
|
|
23590
23604
|
service,
|
|
23591
|
-
|
|
23605
|
+
providerOverrides
|
|
23592
23606
|
);
|
|
23593
23607
|
envSpinner.clear();
|
|
23594
23608
|
for (const key of sync.failed) {
|
|
@@ -23637,7 +23651,10 @@ async function runRailwayDeployFlow(options) {
|
|
|
23637
23651
|
mode: "capture",
|
|
23638
23652
|
timeoutMs: DEPLOY_TIMEOUT_MS,
|
|
23639
23653
|
env: options.session.env,
|
|
23640
|
-
onOutputLine: (line) =>
|
|
23654
|
+
onOutputLine: (line) => {
|
|
23655
|
+
const message = deploymentLine(line);
|
|
23656
|
+
if (message) deploySpinner.message(message);
|
|
23657
|
+
}
|
|
23641
23658
|
}
|
|
23642
23659
|
);
|
|
23643
23660
|
} finally {
|
|
@@ -23654,7 +23671,6 @@ async function runRailwayDeployFlow(options) {
|
|
|
23654
23671
|
${deploy.stderr}`) ?? deploy.errorMessage
|
|
23655
23672
|
};
|
|
23656
23673
|
}
|
|
23657
|
-
const url = await ensureRailwayDomain(options.session, options.cwd, service);
|
|
23658
23674
|
deploySpinner.stop(url ? `Deployed ${pc3.cyan(url)}` : "Deployed to Railway");
|
|
23659
23675
|
return { ok: true, url, service, syncedEnvKeys: sync.synced };
|
|
23660
23676
|
} catch (error) {
|
|
@@ -27826,6 +27842,7 @@ Run manually: ${pc9.cyan(betterstartExecCommand(pm, "seed"))}`,
|
|
|
27826
27842
|
service: options.railwayService,
|
|
27827
27843
|
providerOverrides: buildRailwayProviderOverrides({
|
|
27828
27844
|
databaseServiceName: railwayDatabaseServiceName,
|
|
27845
|
+
buildCommand: runCommand(detectPackageManager(cwd), "build"),
|
|
27829
27846
|
bucketResourceName: railwayBucketResourceName,
|
|
27830
27847
|
bucketUrlStyle: railwayBucketUrlStyle
|
|
27831
27848
|
})
|