create-bw-app 0.14.1 → 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/constants.mjs +10 -10
- package/src/generator.mjs +41 -23
- package/template/base/app/api/cron/keepalive/route.ts +2 -0
- package/template/base/config/brand.ts +29 -0
- package/template/base/config/env.ts +7 -0
- package/template/base/config/shell.overrides.ts +29 -1
- package/template/modules/projects/app/(shell)/account/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/[projectId]/loading.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/[projectId]/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/loading.tsx +1 -0
- package/template/modules/projects/app/(shell)/account/projetos/page.tsx +1 -0
package/package.json
CHANGED
package/src/constants.mjs
CHANGED
|
@@ -162,16 +162,16 @@ export const PLATFORM_STARTER_FILES = [
|
|
|
162
162
|
];
|
|
163
163
|
|
|
164
164
|
export const APP_DEPENDENCY_DEFAULTS = {
|
|
165
|
-
"@brightweblabs/app-shell": "^0.6.
|
|
166
|
-
"@brightweblabs/core-auth": "^0.
|
|
167
|
-
"@brightweblabs/infra": "^0.
|
|
168
|
-
"@brightweblabs/module-admin": "^0.5.
|
|
169
|
-
"@brightweblabs/module-crm": "^0.8.
|
|
170
|
-
"@brightweblabs/module-marketing": "^0.2.
|
|
171
|
-
"@brightweblabs/module-orgs": "^0.3.
|
|
172
|
-
"@brightweblabs/module-projects": "^0.
|
|
173
|
-
"@brightweblabs/theme": "^0.
|
|
174
|
-
"@brightweblabs/ui": "^1.1.
|
|
165
|
+
"@brightweblabs/app-shell": "^0.6.2",
|
|
166
|
+
"@brightweblabs/core-auth": "^0.7.0",
|
|
167
|
+
"@brightweblabs/infra": "^0.4.0",
|
|
168
|
+
"@brightweblabs/module-admin": "^0.5.5",
|
|
169
|
+
"@brightweblabs/module-crm": "^0.8.5",
|
|
170
|
+
"@brightweblabs/module-marketing": "^0.2.4",
|
|
171
|
+
"@brightweblabs/module-orgs": "^0.3.5",
|
|
172
|
+
"@brightweblabs/module-projects": "^0.7.0",
|
|
173
|
+
"@brightweblabs/theme": "^0.5.0",
|
|
174
|
+
"@brightweblabs/ui": "^1.1.1",
|
|
175
175
|
"geist": "1.7.2",
|
|
176
176
|
"lucide-react": "^1.8.0",
|
|
177
177
|
"next": "^16.0.0",
|
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,9 +933,9 @@ 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
|
-
'import { shellRegistrationOverrides } from "./shell.overrides";',
|
|
938
|
+
'import { additionalShellModules, shellRegistrationOverrides } from "./shell.overrides";',
|
|
910
939
|
"",
|
|
911
940
|
"const dashboardModuleRegistration: ShellModuleRegistration<ShellContextualAction> = {",
|
|
912
941
|
' key: "dashboard",',
|
|
@@ -921,6 +950,11 @@ export function createShellConfig(selectedModules) {
|
|
|
921
950
|
"",
|
|
922
951
|
...registrationLines,
|
|
923
952
|
"",
|
|
953
|
+
" // App-owned surfaces. Declared in config/shell.overrides.ts because",
|
|
954
|
+
" // applyShellRegistrationOverrides can only transform existing",
|
|
955
|
+
" // registrations, and this file is regenerated by create-bw-app update.",
|
|
956
|
+
" registrations.push(...additionalShellModules);",
|
|
957
|
+
"",
|
|
924
958
|
" return registrations;",
|
|
925
959
|
"}",
|
|
926
960
|
"",
|
|
@@ -931,31 +965,15 @@ export function createShellConfig(selectedModules) {
|
|
|
931
965
|
" shellRegistrationOverrides,",
|
|
932
966
|
" );",
|
|
933
967
|
" const shellRegistration: ClientAppShellRegistration<ShellContextualAction> = {",
|
|
934
|
-
" brand
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
" alt: starterBrandConfig.companyName,",
|
|
938
|
-
" collapsedLogo: {",
|
|
939
|
-
' src: "/brand/logo-mark.svg",',
|
|
940
|
-
" width: 48,",
|
|
941
|
-
" height: 48,",
|
|
942
|
-
" },",
|
|
943
|
-
" lightLogo: {",
|
|
944
|
-
' src: "/brand/logo-light.svg",',
|
|
945
|
-
" width: 176,",
|
|
946
|
-
" height: 44,",
|
|
947
|
-
" },",
|
|
948
|
-
" darkLogo: {",
|
|
949
|
-
' src: "/brand/logo-dark.svg",',
|
|
950
|
-
" width: 176,",
|
|
951
|
-
" height: 44,",
|
|
952
|
-
" },",
|
|
953
|
-
" },",
|
|
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,",
|
|
954
971
|
" toolsSection: {",
|
|
955
972
|
' key: "tools",',
|
|
956
973
|
' label: "Ferramentas",',
|
|
957
974
|
" icon: Wrench,",
|
|
958
|
-
|
|
975
|
+
" collapsedHref: additionalShellModules[0]?.navItems?.[0]?.href",
|
|
976
|
+
' ?? enabledModules.find((moduleConfig) => moduleConfig.routeHref)?.routeHref ?? "/",',
|
|
959
977
|
" },",
|
|
960
978
|
" modules,",
|
|
961
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
|
+
};
|
|
@@ -42,6 +42,13 @@ export const starterEnvRequirements: StarterEnvRequirement[] = [
|
|
|
42
42
|
description: "Supabase secret key for privileged Admin, CRM, Marketing, and Projects actions.",
|
|
43
43
|
requiredFor: ["crm", "marketing", "projects", "admin"],
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
key: "SUPABASE_KEEPALIVE_SECRET",
|
|
47
|
+
scope: "server",
|
|
48
|
+
description:
|
|
49
|
+
"Bearer secret for /api/cron/keepalive, which a scheduler calls so free-tier Supabase projects do not idle-pause.",
|
|
50
|
+
requiredFor: ["core-auth"],
|
|
51
|
+
},
|
|
45
52
|
{
|
|
46
53
|
key: "RESEND_API_KEY",
|
|
47
54
|
scope: "server",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ShellContextualAction,
|
|
3
|
+
ShellModuleRegistration,
|
|
4
|
+
ShellRegistrationOverrides,
|
|
5
|
+
} from "@brightweblabs/app-shell";
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* App-owned shell customizations. This scaffolded file is never overwritten by
|
|
@@ -14,3 +18,27 @@ import type { ShellRegistrationOverrides } from "@brightweblabs/app-shell";
|
|
|
14
18
|
* ```
|
|
15
19
|
*/
|
|
16
20
|
export const shellRegistrationOverrides: ShellRegistrationOverrides = {};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* App-owned nav modules — surfaces this app implements itself, which no
|
|
24
|
+
* BrightWeb package provides.
|
|
25
|
+
*
|
|
26
|
+
* `shellRegistrationOverrides` can only transform registrations that already
|
|
27
|
+
* exist, so it cannot introduce a new one. Put app-owned surfaces here instead
|
|
28
|
+
* of editing `config/shell.ts`, which is regenerated by `create-bw-app update`.
|
|
29
|
+
*
|
|
30
|
+
* @example An app-owned tool mounted under the Ferramentas section:
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { BookOpen } from "lucide-react";
|
|
33
|
+
*
|
|
34
|
+
* export const additionalShellModules: ShellModuleRegistration<ShellContextualAction>[] = [
|
|
35
|
+
* {
|
|
36
|
+
* key: "tools",
|
|
37
|
+
* placement: "tools",
|
|
38
|
+
* navItems: [{ href: "/ferramentas/conteudos", label: "Conteúdos", icon: BookOpen, visibility: "admin" }],
|
|
39
|
+
* toolbarRoutes: [{ surface: "insights-cms", match: { prefixes: ["/ferramentas/conteudos"] } }],
|
|
40
|
+
* },
|
|
41
|
+
* ];
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export const additionalShellModules: ShellModuleRegistration<ShellContextualAction>[] = [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientAccountPage as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectDetailLoading as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectDetailRoute as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectsListLoading as default } from "@brightweblabs/module-projects";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientProjectsListPage as default } from "@brightweblabs/module-projects";
|