create-bw-app 0.16.0 → 0.18.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 +17 -13
- package/src/generator.mjs +4 -4
- package/template/base/app/(shell)/shell-layout-client.tsx +4 -15
- 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",
|
|
@@ -162,14 +166,14 @@ export const PLATFORM_STARTER_FILES = [
|
|
|
162
166
|
];
|
|
163
167
|
|
|
164
168
|
export const APP_DEPENDENCY_DEFAULTS = {
|
|
165
|
-
"@brightweblabs/app-shell": "^0.
|
|
169
|
+
"@brightweblabs/app-shell": "^0.7.0",
|
|
166
170
|
"@brightweblabs/core-auth": "^0.7.0",
|
|
167
171
|
"@brightweblabs/infra": "^0.4.0",
|
|
168
|
-
"@brightweblabs/module-admin": "^0.5.
|
|
169
|
-
"@brightweblabs/module-crm": "^0.
|
|
170
|
-
"@brightweblabs/module-marketing": "^0.2.
|
|
171
|
-
"@brightweblabs/module-orgs": "^0.3.
|
|
172
|
-
"@brightweblabs/module-projects": "^0.7.
|
|
172
|
+
"@brightweblabs/module-admin": "^0.5.6",
|
|
173
|
+
"@brightweblabs/module-crm": "^0.9.1",
|
|
174
|
+
"@brightweblabs/module-marketing": "^0.2.5",
|
|
175
|
+
"@brightweblabs/module-orgs": "^0.3.6",
|
|
176
|
+
"@brightweblabs/module-projects": "^0.7.1",
|
|
173
177
|
"@brightweblabs/theme": "^0.5.0",
|
|
174
178
|
"@brightweblabs/ui": "^1.1.1",
|
|
175
179
|
"geist": "1.7.2",
|
package/src/generator.mjs
CHANGED
|
@@ -395,7 +395,7 @@ export function createPlatformModulesConfigFile(selectedModules) {
|
|
|
395
395
|
' description: "Project portfolio, detail routes, and work-management server logic.",',
|
|
396
396
|
` enabled: ${String(selected.has("projects"))},`,
|
|
397
397
|
' packageName: "@brightweblabs/module-projects",',
|
|
398
|
-
' routeHref: "/
|
|
398
|
+
' routeHref: "/projetos",',
|
|
399
399
|
' placement: "primary",',
|
|
400
400
|
" },",
|
|
401
401
|
" {",
|
|
@@ -496,7 +496,7 @@ function getPlatformStarterRoutes(selectedModules) {
|
|
|
496
496
|
...selectedModules.flatMap((moduleKey) => {
|
|
497
497
|
if (moduleKey === "crm") return ["/crm"];
|
|
498
498
|
if (moduleKey === "marketing") return ["/marketing"];
|
|
499
|
-
if (moduleKey === "projects") return ["/
|
|
499
|
+
if (moduleKey === "projects") return ["/projetos", "/account/projetos"];
|
|
500
500
|
if (moduleKey === "admin") return ["/admin/users"];
|
|
501
501
|
return [];
|
|
502
502
|
}),
|
|
@@ -917,8 +917,8 @@ export function createShellConfig(selectedModules) {
|
|
|
917
917
|
}
|
|
918
918
|
|
|
919
919
|
if (selectedModules.includes("projects")) {
|
|
920
|
-
importLines.push('import {
|
|
921
|
-
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);');
|
|
922
922
|
}
|
|
923
923
|
|
|
924
924
|
return [
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { useMemo, type ReactNode } from "react";
|
|
4
4
|
import { usePathname, useRouter } from "next/navigation";
|
|
5
|
-
import { Users } from "lucide-react";
|
|
6
5
|
import {
|
|
7
6
|
AppHeader,
|
|
8
7
|
AppShellFrame,
|
|
9
8
|
DesktopSidebar,
|
|
10
9
|
MobileNav,
|
|
11
10
|
computeInitials,
|
|
12
|
-
getShellNavGroup,
|
|
13
11
|
useShellNavState,
|
|
14
|
-
type NavGroupConfig,
|
|
15
12
|
type ShellNavStateGroup,
|
|
16
13
|
} from "@brightweblabs/app-shell";
|
|
17
14
|
import { createAuthUiClient } from "@brightweblabs/core-auth/ui";
|
|
@@ -48,13 +45,6 @@ export function ShellLayoutClient({
|
|
|
48
45
|
);
|
|
49
46
|
const { isSidebarCollapsed, isGroupOpen, toggleGroup, toggleSidebar } =
|
|
50
47
|
useShellNavState({ pathname, groups: shellGroups });
|
|
51
|
-
const registeredCrmNavGroup = getShellNavGroup(config, "crm");
|
|
52
|
-
const crmNavGroup = registeredCrmNavGroup ?? ({
|
|
53
|
-
label: "CRM",
|
|
54
|
-
icon: Users,
|
|
55
|
-
children: [],
|
|
56
|
-
} satisfies NavGroupConfig);
|
|
57
|
-
const crmGroupKey = registeredCrmNavGroup?.key ?? "crm";
|
|
58
48
|
const isAdminSurface = pathname === "/admin" || pathname.startsWith("/admin/");
|
|
59
49
|
const isActive = (href: string) =>
|
|
60
50
|
pathname === href || (isAdminSurface && pathname.startsWith(`${href}/`));
|
|
@@ -75,17 +65,16 @@ export function ShellLayoutClient({
|
|
|
75
65
|
visiblePrimaryNav={config.primaryNav}
|
|
76
66
|
adminNavItem={viewer.isAdmin ? config.adminNavItem : null}
|
|
77
67
|
visibleToolNav={config.toolsSection.items}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
navGroups={config.moduleGroups}
|
|
69
|
+
isNavGroupExpanded={isGroupOpen}
|
|
70
|
+
isNavGroupActive={(group) => group.children.some(
|
|
81
71
|
(item) => pathname === item.href || pathname.startsWith(`${item.href}/`),
|
|
82
72
|
)}
|
|
83
73
|
isNavItemActive={isActive}
|
|
84
74
|
isToolLinkActive={isActive}
|
|
85
|
-
isCrmChildActive={isActive}
|
|
86
75
|
onToggleSidebar={toggleSidebar}
|
|
87
76
|
onToggleTools={() => toggleGroup(config.toolsSection.key)}
|
|
88
|
-
|
|
77
|
+
onToggleNavGroup={toggleGroup}
|
|
89
78
|
account={{
|
|
90
79
|
displayName,
|
|
91
80
|
isStaff: viewer.isStaff,
|
|
@@ -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
|