@schandlergarcia/sf-web-components 1.9.23 → 1.9.25

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.
@@ -43,4 +43,4 @@ You MUST load the **command-center-builder** and **component-library** skills be
43
43
 
44
44
  14. **Heroicon names** — common correct names: `PaperAirplaneIcon` (not PlaneIcon), `BuildingOfficeIcon` (not HotelIcon), `BanknotesIcon` (not MoneyIcon), `ExclamationTriangleIcon` (not AlertIcon), `UserIcon` (not PersonIcon).
45
45
 
46
- 15. **Wire the dashboard as the home page.** After creating your dashboard and updating `CommandCenter.tsx`, also update `src/routes.tsx`: set `Home` as the index route (it renders CommandCenter which renders your dashboard) and move `Search` to `/search`. The dashboard must be the first thing users see at `/`.
46
+ 15. **Wire the dashboard as the home page.** After creating your dashboard and updating `CommandCenter.tsx`, you MUST also update `src/pages/Home.tsx` to render `CommandCenter` (replace any search interface with `import CommandCenter from "@/components/workspace/CommandCenter"; export default function HomePage() { return <CommandCenter />; }`), and update `src/routes.tsx` to set `Home` as the index route and move `Search` to `/search`. The dashboard must be the first thing users see at `/`.
@@ -183,6 +183,16 @@ export default function CommandCenter() {
183
183
  }
184
184
  ```
185
185
 
186
+ **Step 2.5:** Update `Home.tsx` to render `CommandCenter`:
187
+ ```tsx
188
+ // src/pages/Home.tsx
189
+ import CommandCenter from "@/components/workspace/CommandCenter";
190
+
191
+ export default function HomePage() {
192
+ return <CommandCenter />;
193
+ }
194
+ ```
195
+
186
196
  **Step 3:** Update `src/routes.tsx` to make the dashboard the home page. Replace the Search page index route with the Home/CommandCenter route:
187
197
  ```tsx
188
198
  // src/routes.tsx — change the index route
@@ -203,7 +213,8 @@ The `Home` page renders `CommandCenter`, which renders your dashboard. The Searc
203
213
  **Verify:** After writing all files, confirm:
204
214
  1. Your dashboard `.tsx` file exists in `src/pages/`
205
215
  2. `CommandCenter.tsx` (in `src/components/workspace/`) imports your dashboard (not `BlankDashboard`)
206
- 3. `src/routes.tsx` has `Home` as the index route and `Search` at `/search`
216
+ 3. `Home.tsx` (in `src/pages/`) imports and renders `CommandCenter` (not search interface)
217
+ 4. `src/routes.tsx` has `Home` as the index route and `Search` at `/search`
207
218
 
208
219
  ## Page Structure
209
220
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.23",
3
+ "version": "1.9.25",
4
4
  "description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -256,12 +256,25 @@ if (fs.existsSync(packageJsonPath)) {
256
256
  }
257
257
 
258
258
  // Add the reset:command-center script if it doesn't exist
259
+ let scriptsAdded = [];
259
260
  if (!packageJson.scripts['reset:command-center']) {
260
261
  packageJson.scripts['reset:command-center'] = 'bash node_modules/@schandlergarcia/sf-web-components/scripts/reset-command-center.sh';
262
+ scriptsAdded.push('reset:command-center');
263
+ }
264
+
265
+ // Add the validate:dashboard script if it doesn't exist
266
+ if (!packageJson.scripts['validate:dashboard']) {
267
+ packageJson.scripts['validate:dashboard'] = 'bash node_modules/@schandlergarcia/sf-web-components/scripts/validate-dashboard.sh';
268
+ scriptsAdded.push('validate:dashboard');
269
+ }
270
+
271
+ if (scriptsAdded.length > 0) {
261
272
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
262
- console.log(' ✓ Added "reset:command-center" script to package.json');
273
+ scriptsAdded.forEach(script => {
274
+ console.log(` ✓ Added "${script}" script to package.json`);
275
+ });
263
276
  } else {
264
- console.log(' ℹ Script "reset:command-center" already exists');
277
+ console.log(' ℹ Scripts already exist');
265
278
  }
266
279
  } catch (error) {
267
280
  console.error(` ✗ Failed to update package.json: ${error.message}`);
@@ -21,8 +21,8 @@ else
21
21
  fi
22
22
  cd "$ROOT"
23
23
 
24
- PAGES_DIR="src/components/pages"
25
- TRAVEL_DIR="src/components/travel"
24
+ PAGES_DIR="src/pages"
25
+ WORKSPACE_DIR="src/components/workspace"
26
26
  ERRORS=0
27
27
  WARNINGS=0
28
28
 
@@ -40,8 +40,11 @@ echo ""
40
40
 
41
41
  echo "── Wiring ──"
42
42
 
43
- WRAPPER="$PAGES_DIR/CommandCenter.tsx"
44
- if grep -q 'BlankDashboard' "$WRAPPER"; then
43
+ WRAPPER="$WORKSPACE_DIR/CommandCenter.tsx"
44
+ if [ ! -f "$WRAPPER" ]; then
45
+ red "CommandCenter.tsx not found at $WORKSPACE_DIR/"
46
+ ERRORS=$((ERRORS + 1))
47
+ elif grep -q 'BlankDashboard' "$WRAPPER"; then
45
48
  red "CommandCenter.tsx still imports BlankDashboard — no dashboard is wired up"
46
49
  ERRORS=$((ERRORS + 1))
47
50
  else
@@ -51,19 +54,17 @@ echo ""
51
54
 
52
55
  # ── 2. Find all dashboard files to scan ──────────────────────────────────────
53
56
 
54
- # Collect all .jsx/.tsx in pages/ and travel/ dirs (excluding BlankDashboard, HelloWorld, CommandCenter)
57
+ # Collect all .tsx in pages/ dir (excluding BlankDashboard, Home, NotFound, Search)
55
58
  SCAN_FILES=()
56
- for dir in "$PAGES_DIR" "$TRAVEL_DIR" "src/pages"; do
57
- if [ -d "$dir" ]; then
58
- while IFS= read -r f; do
59
- base=$(basename "$f")
60
- case "$base" in
61
- BlankDashboard.*|HelloWorld.*|CommandCenter.*|Home.*|NotFound.*|Search.*|TestAccPage.*) continue ;;
62
- *) SCAN_FILES+=("$f") ;;
63
- esac
64
- done < <(find "$dir" -maxdepth 1 \( -name "*.jsx" -o -name "*.tsx" \) | sort)
65
- fi
66
- done
59
+ if [ -d "$PAGES_DIR" ]; then
60
+ while IFS= read -r f; do
61
+ base=$(basename "$f")
62
+ case "$base" in
63
+ BlankDashboard.*|Home.*|NotFound.*|Search.*) continue ;;
64
+ *) SCAN_FILES+=("$f") ;;
65
+ esac
66
+ done < <(find "$PAGES_DIR" -maxdepth 1 -name "*.tsx" | sort)
67
+ fi
67
68
 
68
69
  if [ ${#SCAN_FILES[@]} -eq 0 ]; then
69
70
  yellow "No dashboard files found to scan"
@@ -234,14 +235,14 @@ echo ""
234
235
 
235
236
  # ── 10. Check file extensions ─────────────────────────────────────────────────
236
237
 
237
- echo "── File extensions (dashboard pages should be .jsx) ──"
238
+ echo "── File extensions (dashboard pages MUST be .tsx) ──"
238
239
 
239
240
  for f in "${SCAN_FILES[@]}"; do
240
241
  base=$(basename "$f")
241
242
 
242
- if [[ "$f" == *.tsx ]] && [[ "$f" == *components/pages* || "$f" == *components/travel* ]]; then
243
- yellow "$base: dashboard component uses .tsxconvention is .jsx"
244
- WARNINGS=$((WARNINGS + 1))
243
+ if [[ "$f" == *.jsx ]]; then
244
+ red "$base: dashboard uses .jsxthis is a TypeScript project, all React components MUST use .tsx"
245
+ ERRORS=$((ERRORS + 1))
245
246
  fi
246
247
  done
247
248
  echo ""