create-bw-app 0.15.0 → 0.16.0
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/package.json +1 -1
- package/src/generator.mjs +35 -22
- package/template/base/config/brand.ts +29 -0
package/package.json
CHANGED
package/src/generator.mjs
CHANGED
|
@@ -305,6 +305,35 @@ function createPlatformBrandConfigFile({ slug, brandValues }) {
|
|
|
305
305
|
` supportEmail: ${JSON.stringify(brandValues.supportEmail)},`,
|
|
306
306
|
"};",
|
|
307
307
|
"",
|
|
308
|
+
"export type StarterShellLogo = {",
|
|
309
|
+
" src: string;",
|
|
310
|
+
" width: number;",
|
|
311
|
+
" height: number;",
|
|
312
|
+
"};",
|
|
313
|
+
"",
|
|
314
|
+
"export type StarterShellBrand = {",
|
|
315
|
+
" href: string;",
|
|
316
|
+
" ariaLabel: string;",
|
|
317
|
+
" alt: string;",
|
|
318
|
+
" collapsedLogo: StarterShellLogo;",
|
|
319
|
+
" lightLogo: StarterShellLogo;",
|
|
320
|
+
" darkLogo: StarterShellLogo;",
|
|
321
|
+
"};",
|
|
322
|
+
"",
|
|
323
|
+
"/**",
|
|
324
|
+
" * Shell brand marks. This file is written once when the app is scaffolded and",
|
|
325
|
+
" * is never regenerated, so swapping in client artwork here survives",
|
|
326
|
+
" * `create-bw-app update` — unlike editing config/shell.ts.",
|
|
327
|
+
" */",
|
|
328
|
+
"export const starterShellBrand: StarterShellBrand = {",
|
|
329
|
+
' href: "/",',
|
|
330
|
+
" ariaLabel: `${starterBrandConfig.companyName} public site`,",
|
|
331
|
+
" alt: starterBrandConfig.companyName,",
|
|
332
|
+
' collapsedLogo: { src: "/brand/logo-mark.svg", width: 48, height: 48 },',
|
|
333
|
+
' lightLogo: { src: "/brand/logo-light.svg", width: 176, height: 44 },',
|
|
334
|
+
' darkLogo: { src: "/brand/logo-dark.svg", width: 176, height: 44 },',
|
|
335
|
+
"};",
|
|
336
|
+
"",
|
|
308
337
|
].join("\n");
|
|
309
338
|
}
|
|
310
339
|
|
|
@@ -904,7 +933,7 @@ export function createShellConfig(selectedModules) {
|
|
|
904
933
|
" type ShellModuleRegistration,",
|
|
905
934
|
'} from "@brightweblabs/app-shell";',
|
|
906
935
|
...importLines,
|
|
907
|
-
'import {
|
|
936
|
+
'import { starterShellBrand } from "./brand";',
|
|
908
937
|
'import { getEnabledStarterModules } from "./modules";',
|
|
909
938
|
'import { additionalShellModules, shellRegistrationOverrides } from "./shell.overrides";',
|
|
910
939
|
"",
|
|
@@ -936,31 +965,15 @@ export function createShellConfig(selectedModules) {
|
|
|
936
965
|
" shellRegistrationOverrides,",
|
|
937
966
|
" );",
|
|
938
967
|
" const shellRegistration: ClientAppShellRegistration<ShellContextualAction> = {",
|
|
939
|
-
" brand
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
" alt: starterBrandConfig.companyName,",
|
|
943
|
-
" collapsedLogo: {",
|
|
944
|
-
' src: "/brand/logo-mark.svg",',
|
|
945
|
-
" width: 48,",
|
|
946
|
-
" height: 48,",
|
|
947
|
-
" },",
|
|
948
|
-
" lightLogo: {",
|
|
949
|
-
' src: "/brand/logo-light.svg",',
|
|
950
|
-
" width: 176,",
|
|
951
|
-
" height: 44,",
|
|
952
|
-
" },",
|
|
953
|
-
" darkLogo: {",
|
|
954
|
-
' src: "/brand/logo-dark.svg",',
|
|
955
|
-
" width: 176,",
|
|
956
|
-
" height: 44,",
|
|
957
|
-
" },",
|
|
958
|
-
" },",
|
|
968
|
+
" // Logos and the home href live in config/brand.ts, which is written once",
|
|
969
|
+
" // at scaffold time and never regenerated — so rebranding survives update.",
|
|
970
|
+
" brand: starterShellBrand,",
|
|
959
971
|
" toolsSection: {",
|
|
960
972
|
' key: "tools",',
|
|
961
973
|
' label: "Ferramentas",',
|
|
962
974
|
" icon: Wrench,",
|
|
963
|
-
|
|
975
|
+
" collapsedHref: additionalShellModules[0]?.navItems?.[0]?.href",
|
|
976
|
+
' ?? enabledModules.find((moduleConfig) => moduleConfig.routeHref)?.routeHref ?? "/",',
|
|
964
977
|
" },",
|
|
965
978
|
" modules,",
|
|
966
979
|
" };",
|
|
@@ -15,3 +15,32 @@ export const starterBrandConfig: StarterBrandConfig = {
|
|
|
15
15
|
contactEmail: "hello@example.com",
|
|
16
16
|
supportEmail: "support@example.com",
|
|
17
17
|
};
|
|
18
|
+
|
|
19
|
+
export type StarterShellLogo = {
|
|
20
|
+
src: string;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type StarterShellBrand = {
|
|
26
|
+
href: string;
|
|
27
|
+
ariaLabel: string;
|
|
28
|
+
alt: string;
|
|
29
|
+
collapsedLogo: StarterShellLogo;
|
|
30
|
+
lightLogo: StarterShellLogo;
|
|
31
|
+
darkLogo: StarterShellLogo;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Shell brand marks. This file is written once when the app is scaffolded and
|
|
36
|
+
* is never regenerated, so swapping in client artwork here survives
|
|
37
|
+
* `create-bw-app update` — unlike editing config/shell.ts.
|
|
38
|
+
*/
|
|
39
|
+
export const starterShellBrand: StarterShellBrand = {
|
|
40
|
+
href: "/",
|
|
41
|
+
ariaLabel: `${starterBrandConfig.companyName} public site`,
|
|
42
|
+
alt: starterBrandConfig.companyName,
|
|
43
|
+
collapsedLogo: { src: "/brand/logo-mark.svg", width: 48, height: 48 },
|
|
44
|
+
lightLogo: { src: "/brand/logo-light.svg", width: 176, height: 44 },
|
|
45
|
+
darkLogo: { src: "/brand/logo-dark.svg", width: 176, height: 44 },
|
|
46
|
+
};
|