Skip to content

Commit

Permalink
Spread public site config (#2297)
Browse files Browse the repository at this point in the history
Spread public site config options into the site config (instead of
leaving them in `public`)

---

Also: Add public values also to the private config.

Reason: You might need public values in the private config (e.g., here
https://github.com/vivid-planet/comet-starter/blob/a7ec7377ba5278a05e1ee7f45f4ee5926e95bf6b/api/src/app.module.ts#L82).
There is no reason why the public values shouldn't be available in the
private config.
  • Loading branch information
thomasdax98 authored Jul 19, 2024
1 parent de82d79 commit aa1ddee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/commands/site-configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ export const injectSiteConfigsCommand = new Command("inject-site-configs")
private: (siteConfigs: BaseSiteConfig[]): ExtractPrivateSiteConfig<BaseSiteConfig>[] =>
siteConfigs.map((siteConfig) =>
(({ public: publicVars, ...rest }) => ({
...publicVars,
...rest,
url: getUrlFromDomain(siteConfig.domains.preliminary ?? siteConfig.domains.main),
}))(siteConfig),
),
public: (siteConfigs: BaseSiteConfig[]): ExtractPublicSiteConfig<BaseSiteConfig>[] =>
siteConfigs.map((siteConfig) => ({
...siteConfig.public,
name: siteConfig.name,
domains: siteConfig.domains,
preloginEnabled: siteConfig.preloginEnabled || false,
public: siteConfig.public,
url: getUrlFromDomain(siteConfig.domains.preliminary ?? siteConfig.domains.main),
})),
};
Expand Down

0 comments on commit aa1ddee

Please sign in to comment.