Merge branch 'canary' into fix/tweak-processor-template

This commit is contained in:
Mauricio Siu
2025-03-11 00:29:26 -06:00
committed by GitHub
2 changed files with 10 additions and 6 deletions

View File

@@ -186,7 +186,7 @@ export const ShowProjects = () => {
target="_blank" target="_blank"
href={`${domain.https ? "https" : "http"}://${domain.host}${domain.path}`} href={`${domain.https ? "https" : "http"}://${domain.host}${domain.path}`}
> >
<span>{domain.host}</span> <span className="truncate">{domain.host}</span>
<ExternalLinkIcon className="size-4 shrink-0" /> <ExternalLinkIcon className="size-4 shrink-0" />
</Link> </Link>
</DropdownMenuItem> </DropdownMenuItem>
@@ -222,7 +222,7 @@ export const ShowProjects = () => {
target="_blank" target="_blank"
href={`${domain.https ? "https" : "http"}://${domain.host}${domain.path}`} href={`${domain.https ? "https" : "http"}://${domain.host}${domain.path}`}
> >
<span>{domain.host}</span> <span className="truncate">{domain.host}</span>
<ExternalLinkIcon className="size-4 shrink-0" /> <ExternalLinkIcon className="size-4 shrink-0" />
</Link> </Link>
</DropdownMenuItem> </DropdownMenuItem>

View File

@@ -175,7 +175,9 @@ export function processDomains(
variables: Record<string, string>, variables: Record<string, string>,
schema: Schema, schema: Schema,
): Template["domains"] { ): Template["domains"] {
return template.config.domains.map((domain: DomainConfig) => ({ if (!template?.config?.domains) return [];
return template?.config?.domains?.map((domain: DomainConfig) => ({
...domain, ...domain,
host: domain.host host: domain.host
? processValue(domain.host, variables, schema) ? processValue(domain.host, variables, schema)
@@ -191,7 +193,9 @@ export function processEnvVars(
variables: Record<string, string>, variables: Record<string, string>,
schema: Schema, schema: Schema,
): Template["envs"] { ): Template["envs"] {
return Object.entries(template.config.env).map( if (!template?.config?.env) return [];
return Object.entries(template?.config?.env).map(
([key, value]: [string, string]) => { ([key, value]: [string, string]) => {
const processedValue = processValue(value, variables, schema); const processedValue = processValue(value, variables, schema);
return `${key}=${processedValue}`; return `${key}=${processedValue}`;
@@ -207,9 +211,9 @@ export function processMounts(
variables: Record<string, string>, variables: Record<string, string>,
schema: Schema, schema: Schema,
): Template["mounts"] { ): Template["mounts"] {
if (!template.config.mounts) return []; if (!template?.config?.mounts) return [];
return template.config.mounts.map((mount: MountConfig) => ({ return template?.config?.mounts?.map((mount: MountConfig) => ({
filePath: processValue(mount.filePath, variables, schema), filePath: processValue(mount.filePath, variables, schema),
content: processValue(mount.content, variables, schema), content: processValue(mount.content, variables, schema),
})); }));