@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 +1 -1
- package/scripts/postinstall.mjs +15 -2
- package/scripts/validate-dashboard.sh +21 -20
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -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
|
-
|
|
273
|
+
scriptsAdded.forEach(script => {
|
|
274
|
+
console.log(` ✓ Added "${script}" script to package.json`);
|
|
275
|
+
});
|
|
263
276
|
} else {
|
|
264
|
-
console.log(' ℹ
|
|
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/
|
|
25
|
-
|
|
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="$
|
|
44
|
-
if
|
|
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 .
|
|
57
|
+
# Collect all .tsx in pages/ dir (excluding BlankDashboard, Home, NotFound, Search)
|
|
55
58
|
SCAN_FILES=()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
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" == *.
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
if [[ "$f" == *.jsx ]]; then
|
|
244
|
+
red "$base: dashboard uses .jsx — this is a TypeScript project, all React components MUST use .tsx"
|
|
245
|
+
ERRORS=$((ERRORS + 1))
|
|
245
246
|
fi
|
|
246
247
|
done
|
|
247
248
|
echo ""
|