create-bw-app 0.15.0 → 0.17.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 +12 -8
- package/src/generator.mjs +39 -26
- package/template/base/config/brand.ts +29 -0
- package/template/modules/projects/app/(shell)/projetos/[projectId]/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projetos/[projectId]/quadro/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projetos/[projectId]/tarefas/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/projetos/page.tsx +1 -0
- package/template/modules/projects/app/(shell)/{projects/projects-server-mounts.tsx → projetos/projetos-server-mounts.tsx} +10 -10
- package/template/modules/projects/app/(shell)/projects/[id]/board/page.tsx +0 -1
- package/template/modules/projects/app/(shell)/projects/[id]/page.tsx +0 -1
- package/template/modules/projects/app/(shell)/projects/[id]/tasks/page.tsx +0 -1
- package/template/modules/projects/app/(shell)/projects/page.tsx +0 -1
- /package/template/modules/projects/app/(shell)/{projects → projetos}/layout.tsx +0 -0
- /package/template/modules/projects/app/(shell)/{projects/projects-live-mounts.tsx → projetos/projetos-live-mounts.tsx} +0 -0
package/package.json
CHANGED
package/src/constants.mjs
CHANGED
|
@@ -105,13 +105,17 @@ export const MODULE_STARTER_FILES = {
|
|
|
105
105
|
"app/api/marketing/workflows/route.ts",
|
|
106
106
|
],
|
|
107
107
|
projects: [
|
|
108
|
-
"app/(shell)/
|
|
109
|
-
"app/(shell)/
|
|
110
|
-
"app/(shell)/
|
|
111
|
-
"app/(shell)/
|
|
112
|
-
"app/(shell)/
|
|
113
|
-
"app/(shell)/
|
|
114
|
-
"app/(shell)/
|
|
108
|
+
"app/(shell)/projetos/layout.tsx",
|
|
109
|
+
"app/(shell)/projetos/page.tsx",
|
|
110
|
+
"app/(shell)/projetos/projetos-live-mounts.tsx",
|
|
111
|
+
"app/(shell)/projetos/projetos-server-mounts.tsx",
|
|
112
|
+
"app/(shell)/projetos/[projectId]/page.tsx",
|
|
113
|
+
"app/(shell)/projetos/[projectId]/quadro/page.tsx",
|
|
114
|
+
"app/(shell)/projetos/[projectId]/tarefas/page.tsx",
|
|
115
|
+
"app/(shell)/account/projetos/page.tsx",
|
|
116
|
+
"app/(shell)/account/projetos/loading.tsx",
|
|
117
|
+
"app/(shell)/account/projetos/[projectId]/page.tsx",
|
|
118
|
+
"app/(shell)/account/projetos/[projectId]/loading.tsx",
|
|
115
119
|
"app/api/projects/_handlers.ts",
|
|
116
120
|
"app/api/projects/route.ts",
|
|
117
121
|
"app/api/projects/stats/route.ts",
|
|
@@ -166,7 +170,7 @@ export const APP_DEPENDENCY_DEFAULTS = {
|
|
|
166
170
|
"@brightweblabs/core-auth": "^0.7.0",
|
|
167
171
|
"@brightweblabs/infra": "^0.4.0",
|
|
168
172
|
"@brightweblabs/module-admin": "^0.5.5",
|
|
169
|
-
"@brightweblabs/module-crm": "^0.
|
|
173
|
+
"@brightweblabs/module-crm": "^0.9.0",
|
|
170
174
|
"@brightweblabs/module-marketing": "^0.2.4",
|
|
171
175
|
"@brightweblabs/module-orgs": "^0.3.5",
|
|
172
176
|
"@brightweblabs/module-projects": "^0.7.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
|
|
|
@@ -366,7 +395,7 @@ export function createPlatformModulesConfigFile(selectedModules) {
|
|
|
366
395
|
' description: "Project portfolio, detail routes, and work-management server logic.",',
|
|
367
396
|
` enabled: ${String(selected.has("projects"))},`,
|
|
368
397
|
' packageName: "@brightweblabs/module-projects",',
|
|
369
|
-
' routeHref: "/
|
|
398
|
+
' routeHref: "/projetos",',
|
|
370
399
|
' placement: "primary",',
|
|
371
400
|
" },",
|
|
372
401
|
" {",
|
|
@@ -467,7 +496,7 @@ function getPlatformStarterRoutes(selectedModules) {
|
|
|
467
496
|
...selectedModules.flatMap((moduleKey) => {
|
|
468
497
|
if (moduleKey === "crm") return ["/crm"];
|
|
469
498
|
if (moduleKey === "marketing") return ["/marketing"];
|
|
470
|
-
if (moduleKey === "projects") return ["/
|
|
499
|
+
if (moduleKey === "projects") return ["/projetos", "/account/projetos"];
|
|
471
500
|
if (moduleKey === "admin") return ["/admin/users"];
|
|
472
501
|
return [];
|
|
473
502
|
}),
|
|
@@ -888,8 +917,8 @@ export function createShellConfig(selectedModules) {
|
|
|
888
917
|
}
|
|
889
918
|
|
|
890
919
|
if (selectedModules.includes("projects")) {
|
|
891
|
-
importLines.push('import {
|
|
892
|
-
registrationLines.push(' if (enabled.has("projects")) registrations.push(
|
|
920
|
+
importLines.push('import { projectsModuleRegistration } from "@brightweblabs/module-projects/registration";');
|
|
921
|
+
registrationLines.push(' if (enabled.has("projects")) registrations.push(projectsModuleRegistration);');
|
|
893
922
|
}
|
|
894
923
|
|
|
895
924
|
return [
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProjectDetailServerMount as default } from "../projetos-server-mounts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProjectBoardServerMount as default } from "../../projetos-server-mounts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProjectTasksServerMount as default } from "../../projetos-server-mounts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProjectsServerMount as default } from "./projetos-server-mounts";
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
ProjectDetailPageLiveMount,
|
|
9
9
|
ProjectsPageLiveMount,
|
|
10
10
|
ProjectTasksPageLiveMount,
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./projetos-live-mounts";
|
|
12
12
|
|
|
13
13
|
const navigation = {
|
|
14
|
-
listHref: "/
|
|
15
|
-
detailHref: (id: string) => `/
|
|
16
|
-
boardHref: (id: string) => `/
|
|
14
|
+
listHref: "/projetos",
|
|
15
|
+
detailHref: (id: string) => `/projetos/${id}`,
|
|
16
|
+
boardHref: (id: string) => `/projetos/${id}/tarefas`,
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export async function ProjectsServerMount() {
|
|
@@ -35,20 +35,20 @@ export async function ProjectsServerMount() {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
async function getInitialProject(params: Promise<{
|
|
39
|
-
const {
|
|
38
|
+
async function getInitialProject(params: Promise<{ projectId: string }>) {
|
|
39
|
+
const { projectId } = await params;
|
|
40
40
|
const { supabase } = await requireServerPageAccess();
|
|
41
|
-
return getProjectDashboard(supabase,
|
|
41
|
+
return getProjectDashboard(supabase, projectId);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export async function ProjectDetailServerMount({ params }: { params: Promise<{
|
|
44
|
+
export async function ProjectDetailServerMount({ params }: { params: Promise<{ projectId: string }> }) {
|
|
45
45
|
return <ProjectDetailPageLiveMount initialData={await getInitialProject(params)} navigation={navigation} />;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export async function ProjectBoardServerMount({ params }: { params: Promise<{
|
|
48
|
+
export async function ProjectBoardServerMount({ params }: { params: Promise<{ projectId: string }> }) {
|
|
49
49
|
return <ProjectBoardPageLiveMount initialData={await getInitialProject(params)} navigation={navigation} />;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export async function ProjectTasksServerMount({ params }: { params: Promise<{
|
|
52
|
+
export async function ProjectTasksServerMount({ params }: { params: Promise<{ projectId: string }> }) {
|
|
53
53
|
return <ProjectTasksPageLiveMount initialData={await getInitialProject(params)} navigation={navigation} />;
|
|
54
54
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProjectBoardServerMount as default } from "../../projects-server-mounts";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProjectDetailServerMount as default } from "../projects-server-mounts";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProjectTasksServerMount as default } from "../../projects-server-mounts";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProjectsServerMount as default } from "./projects-server-mounts";
|
|
File without changes
|