@ts-cloud/core 0.7.24 → 0.7.26
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/index.js +21 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -22339,6 +22339,16 @@ function apexOf(domain) {
|
|
|
22339
22339
|
const parts = domain.split(".").filter(Boolean);
|
|
22340
22340
|
return parts.length <= 2 ? domain : parts.slice(-2).join(".");
|
|
22341
22341
|
}
|
|
22342
|
+
function dashboardHostFor(domain, ownedDomains) {
|
|
22343
|
+
const apex = apexOf(domain);
|
|
22344
|
+
if (apex === domain)
|
|
22345
|
+
return `dashboard.${apex}`;
|
|
22346
|
+
for (const owned of ownedDomains) {
|
|
22347
|
+
if (owned === apex)
|
|
22348
|
+
return `dashboard.${apex}`;
|
|
22349
|
+
}
|
|
22350
|
+
return `dashboard.${domain}`;
|
|
22351
|
+
}
|
|
22342
22352
|
function collectDomains(config, environment) {
|
|
22343
22353
|
const candidates = [];
|
|
22344
22354
|
const dnsDomain = config.infrastructure?.dns?.domain;
|
|
@@ -22361,21 +22371,23 @@ function collectDomains(config, environment) {
|
|
|
22361
22371
|
function resolveDashboardDomain(config, environment, explicit) {
|
|
22362
22372
|
if (explicit)
|
|
22363
22373
|
return explicit;
|
|
22364
|
-
const
|
|
22374
|
+
const domains = collectDomains(config, environment);
|
|
22375
|
+
const base = domains[0];
|
|
22365
22376
|
if (!base)
|
|
22366
22377
|
return null;
|
|
22367
|
-
return
|
|
22378
|
+
return dashboardHostFor(base, domains);
|
|
22368
22379
|
}
|
|
22369
22380
|
function resolveDashboardDomains(config, environment, explicit) {
|
|
22370
22381
|
if (explicit)
|
|
22371
22382
|
return [explicit];
|
|
22372
|
-
const
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22383
|
+
const domains = collectDomains(config, environment);
|
|
22384
|
+
const hosts = [];
|
|
22385
|
+
for (const d of domains) {
|
|
22386
|
+
const host = dashboardHostFor(d, domains);
|
|
22387
|
+
if (!hosts.includes(host))
|
|
22388
|
+
hosts.push(host);
|
|
22377
22389
|
}
|
|
22378
|
-
return
|
|
22390
|
+
return hosts;
|
|
22379
22391
|
}
|
|
22380
22392
|
function hasManagementDashboardSite(config) {
|
|
22381
22393
|
return Object.entries(config.sites ?? {}).some(([name, site]) => {
|
|
@@ -22409,6 +22421,7 @@ function resolveManagementDashboardSites(config, environment, opts) {
|
|
|
22409
22421
|
preStart: ["bun install --production --no-save"],
|
|
22410
22422
|
start: `bun ${DASHBOARD_ENTRY} dashboard:serve --box --host 127.0.0.1 --port ${port}`,
|
|
22411
22423
|
port,
|
|
22424
|
+
zeroDowntime: false,
|
|
22412
22425
|
sharedPaths: [DASHBOARD_STATE_DIR],
|
|
22413
22426
|
healthCheck: { path: "/login" },
|
|
22414
22427
|
ssl: { provider: "letsencrypt" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-cloud/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core CloudFormation generation library for ts-cloud",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.com>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ts-cloud/aws-types": "0.7.
|
|
34
|
+
"@ts-cloud/aws-types": "0.7.26"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"typescript": "^7.0.2"
|