@stacksjs/buddy 0.70.98 → 0.70.100
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/commands/dev.js +7 -9
- package/package.json +1 -1
package/dist/commands/dev.js
CHANGED
|
@@ -187,7 +187,7 @@ export function dev(buddy) {
|
|
|
187
187
|
onUnknownSubcommand(buddy, "dev");
|
|
188
188
|
}
|
|
189
189
|
export async function startDevelopmentServer(_options, _startTime) {
|
|
190
|
-
const options = _options, startedAt = _startTime, appUrl = process.env.APP_URL, nativeMode = options.native === !0, proxyManagedExternally = process.env.STACKS_PROXY_MANAGED === "1", frontendPort = Number(process.env.PORT) || 3000, apiPort = Number(process.env.PORT_API) || 3008, docsPort = Number(process.env.PORT_DOCS) || 3006, dashboardPort = Number(process.env.PORT_ADMIN) || 3002, includeDashboard = process.env.STACKS_DEV_DASHBOARD === "1", appLooksCustom = !nativeMode && appUrl && appUrl !== "localhost" && !appUrl.includes("localhost:"), domain = appLooksCustom ? appUrl.replace(/^https?:\/\//, "") : null, hasCustomDomain = appLooksCustom && !proxyManagedExternally, dashboardDomain = domain ? `dashboard.${domain}` : null, frontendUrl = domain ? `https://${domain}` : `http://localhost:${frontendPort}`, apiUrl = domain ? `https://${domain}/api` : `http://localhost:${apiPort}`, docsUrl = domain ? `https://${domain}/docs` : `http://localhost:${docsPort}`, dashboardUrl = dashboardDomain ? `https://${dashboardDomain}` : `http://localhost:${dashboardPort}`, managedPorts = [
|
|
190
|
+
const options = _options, startedAt = _startTime, appUrl = process.env.APP_URL, nativeMode = options.native === !0, proxyManagedExternally = process.env.STACKS_PROXY_MANAGED === "1", frontendPort = Number(process.env.PORT) || 3000, apiPort = Number(process.env.PORT_API) || 3008, docsPort = Number(process.env.PORT_DOCS) || 3006, dashboardPort = Number(process.env.PORT_ADMIN) || 3002, includeDashboard = process.env.STACKS_DEV_DASHBOARD === "1", appLooksCustom = !nativeMode && appUrl && appUrl !== "localhost" && !appUrl.includes("localhost:"), domain = appLooksCustom ? appUrl.replace(/^https?:\/\//, "") : null, isLocalDevTld = (host) => host === "localhost" || host.endsWith(".localhost") || host.endsWith(".test") || host.endsWith(".invalid"), domainIsPublic = Boolean(domain) && process.env.STACKS_DEV_ALLOW_PUBLIC_DOMAIN !== "1" && !isLocalDevTld(domain) && (await dns.resolve4(domain).catch(() => [])).some((address) => !address.startsWith("127.")), hasCustomDomain = appLooksCustom && !proxyManagedExternally && !domainIsPublic, dashboardDomain = domain ? `dashboard.${domain}` : null, frontendUrl = domain ? `https://${domain}` : `http://localhost:${frontendPort}`, apiUrl = domain ? `https://${domain}/api` : `http://localhost:${apiPort}`, docsUrl = domain ? `https://${domain}/docs` : `http://localhost:${docsPort}`, dashboardUrl = dashboardDomain ? `https://${dashboardDomain}` : `http://localhost:${dashboardPort}`, managedPorts = [
|
|
191
191
|
frontendPort,
|
|
192
192
|
apiPort,
|
|
193
193
|
docsPort,
|
|
@@ -354,23 +354,21 @@ function printDevReadyBanner(input) {
|
|
|
354
354
|
domain,
|
|
355
355
|
dashboardPort,
|
|
356
356
|
dashboardDomain
|
|
357
|
-
} = input, verbose = options.verbose ?? !1,
|
|
357
|
+
} = input, verbose = options.verbose ?? !1, useProxy = hasCustomDomain && proxyReachable, feUrl = `http://localhost:${frontendPort}`, apUrl = `http://localhost:${apiPort}`, dcUrl = `http://localhost:${docsPort}`, dbUrl = `http://localhost:${dashboardPort}`, blogUrl = `${feUrl}/blog`;
|
|
358
358
|
console.log();
|
|
359
359
|
console.log(` ${green("\u279C")} ${bold("Frontend")}: ${cyan(feUrl)}`);
|
|
360
|
-
if (showLocalUrls && useProxy)
|
|
361
|
-
console.log(` ${dim("\u279C")} ${dim("Local")}: ${dim(`http://localhost:${frontendPort}`)}`);
|
|
362
360
|
if (nativeMode)
|
|
363
361
|
console.log(` ${green("\u279C")} ${bold("Native")}: ${cyan(`Craft \u2192 http://localhost:${frontendPort}`)}`);
|
|
364
362
|
console.log(` ${green("\u279C")} ${bold("API")}: ${cyan(apUrl)}`);
|
|
365
|
-
if (showLocalUrls && useProxy)
|
|
366
|
-
console.log(` ${dim("\u279C")} ${dim("Local API")}: ${dim(`http://localhost:${apiPort}`)}`);
|
|
367
363
|
console.log(` ${green("\u279C")} ${bold("Docs")}: ${cyan(dcUrl)}`);
|
|
368
|
-
if (showLocalUrls && useProxy)
|
|
369
|
-
console.log(` ${dim("\u279C")} ${dim("Local docs")}: ${dim(`http://localhost:${docsPort}`)}`);
|
|
370
364
|
if (blogIsConfigured())
|
|
371
365
|
console.log(` ${green("\u279C")} ${bold("Blog")}: ${cyan(blogUrl)}`);
|
|
372
366
|
if (includeDashboard)
|
|
373
|
-
console.log(` ${green("\u279C")} ${bold("Dashboard")}: ${cyan(
|
|
367
|
+
console.log(` ${green("\u279C")} ${bold("Dashboard")}: ${cyan(dbUrl)}`);
|
|
368
|
+
if (useProxy && domain)
|
|
369
|
+
console.log(` ${dim("\u279C")} ${dim("Proxy")}: ${dim(`${frontendUrl} (local HTTPS via rpx)`)}`);
|
|
370
|
+
if (useProxy && includeDashboard && dashboardDomain)
|
|
371
|
+
console.log(` ${dim("\u279C")} ${dim("Proxy")}: ${dim(`${dashboardUrl} (local HTTPS via rpx)`)}`);
|
|
374
372
|
if (isComingSoonMode()) {
|
|
375
373
|
console.log();
|
|
376
374
|
console.log(` ${yellow("\u25CF")} ${bold(yellow("Coming soon mode"))} ${dim("\u2014 visitors see the holding page; bypass with the coming-soon secret.")}`);
|