@schandlergarcia/sf-web-components 1.0.0 → 1.0.1

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.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: command-center-project
3
+ description: >-
4
+ Project architecture, tech stack, and conventions for the enginebespokeapp.
5
+ Use when building components, pages, or features in this project, or when
6
+ asking about its structure, patterns, or conventions.
7
+ ---
8
+
9
+ # Enginebespokeapp — Project Context
10
+
11
+ Vite 7 + React 19 + TypeScript 5.9 + Tailwind CSS 4 + React Router 7. SPA (not Next.js).
12
+
13
+ ## Tech Stack
14
+
15
+ - **Build:** Vite 7 (`@tailwindcss/vite` plugin, `@vitejs/plugin-react`)
16
+ - **Routing:** React Router 7 (`createBrowserRouter` in `src/app.tsx`, routes in `src/routes.tsx`)
17
+ - **Styling:** Tailwind CSS 4 + two parallel UI systems (see below)
18
+ - **Testing:** Vitest 4 (unit) + Playwright (e2e)
19
+ - **Salesforce:** SDKs linked via `file:` refs; stubbed in standalone mode (`src/stubs/`)
20
+ - **Install:** Always use `npm install --legacy-peer-deps` for dependency conflicts.
21
+
22
+ ## Project Structure
23
+
24
+ ```
25
+ src/
26
+ ├── app.tsx # Entry: creates router, renders into #root
27
+ ├── routes.tsx # Route definitions (RouteObject[])
28
+ ├── appLayout.tsx # Outer app shell (nav + Outlet)
29
+ ├── styles/global.css # Tailwind + HeroUI + shadcn + brand tokens
30
+ ├── lib/utils.ts # cn() helper (clsx + tailwind-merge)
31
+ ├── pages/ # App-level pages (Home, NotFound)
32
+ ├── features/ # Feature modules (global-search)
33
+ │ └── global-search/ # Search API, components, hooks
34
+ ├── components/
35
+ │ ├── library/ # Vendored command-center component library (.jsx files)
36
+ │ ├── workspace/ # ComponentRegistry.jsx (schema renderer)
37
+ │ ├── pages/ # Dashboard pages (CommandCenter.tsx wraps active dashboard)
38
+ │ ├── ui/ # shadcn/ui components (button, card, dialog, etc.)
39
+ │ ├── alerts/ # StatusAlert (CVA + Lucide)
40
+ │ └── layouts/ # CardLayout (uses shadcn Card)
41
+ └── stubs/ # No-op stubs for standalone dev (sdk-data, webapp-experimental, agentforce)
42
+ ```
43
+
44
+ ## Two UI Systems
45
+
46
+ This project runs **two parallel UI systems** with separate scoping:
47
+
48
+ 1. **shadcn/ui** (`src/components/ui/`) — Used by the outer app (auth pages, search, layouts). Uses Radix UI + Lucide icons + CVA. Helper: `cn()` from `src/lib/utils.ts`.
49
+
50
+ 2. **Command Center library** (`src/components/library/`) — Used by the dashboard at `/` (rendered via `Home.tsx` → `CommandCenter.tsx`). Uses HeroUI + Heroicons + custom cards/charts. Barrel: `@/components/library`.
51
+
52
+ **CSS scoping:** The `.heroui-scope` class in `global.css` restores HeroUI theme variables inside the command center, because shadcn redefines `--muted`, `--accent`, etc. with different semantics.
53
+
54
+ **Never mix these systems.** Don't import shadcn components into command center pages, and don't import library components into outer app pages.
55
+
56
+ ## Route Architecture
57
+
58
+ All routes live under `AppLayout` in `src/routes.tsx`:
59
+
60
+ | Route | Content | Notes |
61
+ |-------|---------|-------|
62
+ | `/` (index) | `Home` → `CommandCenter` | Dashboard with providers (`AppThemeProvider`, `DataModeProvider`), wrapped in `heroui-scope` |
63
+ | `/search` | Search page | Global search input (shadcn/outer app) |
64
+ | `/global-search/:query` | Search results | Results + filters (shadcn/outer app) |
65
+ | `/object/:objectApiName/:recordId` | Detail page | Record detail (shadcn/outer app) |
66
+
67
+ The command center renders at `/` inside the app layout shell. Its `heroui-scope` wrapper isolates HeroUI theme variables.
68
+
69
+ ## Path Aliases
70
+
71
+ Configured in both `vite.config.ts` and `tsconfig.json`:
72
+
73
+ - `@/` → `src/` (primary — use this)
74
+ - `@components/` → `src/components/`
75
+ - `@api/` → `src/api/`
76
+ - `@utils/` → `src/utils/`
77
+ - `@styles/` → `src/styles/`
78
+ - `@assets/` → `src/assets/`
79
+
80
+ ## Key Conventions
81
+
82
+ - **Dashboard pages** go in `src/components/pages/`. Wire into `CommandCenter.tsx` by importing and rendering.
83
+ - **Outer app pages** go in `src/pages/` or `src/features/*/pages/`. Wire into `src/routes.tsx`.
84
+ - **TypeScript** for outer app code (`.tsx`/`.ts`). **JSX** for command center library and dashboard pages (`.jsx`).
85
+ - **Component library** is a vendored copy from command-center-starter — not an npm package. Changes sync manually.
86
+ - Vite config has `loader: { '.js': 'jsx' }` in `optimizeDeps` to support the `.js`→JSX library files.
87
+ - **Reset script:** `npm run reset:command-center` wipes custom dashboards and restores blank canvas.
88
+
89
+ ## Naming
90
+
91
+ - Page IDs: kebab-case (`"fleet-status"`)
92
+ - Page titles: Title Case (`"Fleet Status"`)
93
+ - Registry types: PascalCase (`"MetricCard"`)
94
+ - Component files: PascalCase (`FleetStatus.js`)
95
+ - Styling: Tailwind only. No CSS Modules, no inline styles for layout.
96
+
97
+ ## Scripts
98
+
99
+ - `npm run dev` — Start dev server
100
+ - `npm run dev:design` — Design mode (standalone)
101
+ - `npm run build` — TypeScript check + Vite build
102
+ - `npm run test` — Vitest
103
+ - `npm run reset:command-center` — Reset dashboard to blank canvas