@schandlergarcia/sf-web-components 1.9.24 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.24",
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 ""