@schandlergarcia/sf-web-components 1.9.79 → 1.9.80

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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.80] - 2026-04-04
9
+
10
+ ### Added
11
+ - **Reset script cleans Salesforce metadata** — `reset-command-center.sh` now removes all Apex classes (`.cls` + `.cls-meta.xml`), custom field XML, and platform event directories from `force-app/main/default/`. Walks up from the webapp root to find the SFDX project structure automatically.
12
+
13
+ **Context:** Demo phases create Apex classes (Agent*, TCC_*), custom fields (Weather_Impact__c), and platform events (Travel_Disruption_Alert__e) that need to be cleaned up when resetting for a fresh demo run.
14
+
8
15
  ## [1.9.79] - 2026-04-04
9
16
 
10
17
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.79",
3
+ "version": "1.9.80",
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",
@@ -755,7 +755,79 @@ else
755
755
  echo " ⚠ Skipped logo (package logo not found)"
756
756
  fi
757
757
 
758
- echo ""
758
+ # ── Clean Salesforce metadata created during the demo ────────────────────────
759
+
760
+ SFDX_DEFAULT=""
761
+
762
+ # Walk up from webapp root to find force-app/main/default
763
+ check="$ROOT"
764
+ for i in 1 2 3 4 5; do
765
+ if [ -d "$check/force-app/main/default" ]; then
766
+ SFDX_DEFAULT="$check/force-app/main/default"
767
+ break
768
+ fi
769
+ parent="$(dirname "$check")"
770
+ # Check if we're already inside force-app/main/default
771
+ if [[ "$check" == */force-app/main/default/* ]]; then
772
+ SFDX_DEFAULT="${check%%/force-app/main/default/*}/force-app/main/default"
773
+ break
774
+ fi
775
+ check="$parent"
776
+ done
777
+
778
+ if [ -n "$SFDX_DEFAULT" ]; then
779
+ echo "→ Cleaning Salesforce metadata…"
780
+
781
+ # Remove all Apex classes (.cls and .cls-meta.xml)
782
+ CLASSES_DIR="$SFDX_DEFAULT/classes"
783
+ if [ -d "$CLASSES_DIR" ]; then
784
+ cls_count=$(find "$CLASSES_DIR" -maxdepth 1 -name "*.cls" -o -name "*.cls-meta.xml" 2>/dev/null | wc -l | tr -d ' ')
785
+ if [ "$cls_count" -gt 0 ]; then
786
+ rm -f "$CLASSES_DIR"/*.cls "$CLASSES_DIR"/*.cls-meta.xml
787
+ echo " ✓ Removed $cls_count Apex class files from classes/"
788
+ else
789
+ echo " ℹ No Apex classes to remove"
790
+ fi
791
+ fi
792
+
793
+ # Remove custom fields created during the demo (e.g., Weather_Impact__c)
794
+ OBJECTS_DIR="$SFDX_DEFAULT/objects"
795
+ if [ -d "$OBJECTS_DIR" ]; then
796
+ fields_removed=0
797
+ for fields_dir in "$OBJECTS_DIR"/*/fields; do
798
+ if [ -d "$fields_dir" ]; then
799
+ for f in "$fields_dir"/*.field-meta.xml; do
800
+ if [ -f "$f" ]; then
801
+ rm "$f"
802
+ echo " ✓ Removed $(basename "$f")"
803
+ fields_removed=$((fields_removed + 1))
804
+ fi
805
+ done
806
+ fi
807
+ done
808
+ if [ "$fields_removed" -eq 0 ]; then
809
+ echo " ℹ No custom fields to remove"
810
+ fi
811
+
812
+ # Remove platform event directories (e.g., Travel_Disruption_Alert__e/)
813
+ events_removed=0
814
+ for evt_dir in "$OBJECTS_DIR"/*__e; do
815
+ if [ -d "$evt_dir" ]; then
816
+ rm -rf "$evt_dir"
817
+ echo " ✓ Removed platform event $(basename "$evt_dir")"
818
+ events_removed=$((events_removed + 1))
819
+ fi
820
+ done
821
+ if [ "$events_removed" -eq 0 ]; then
822
+ echo " ℹ No platform events to remove"
823
+ fi
824
+ fi
825
+
826
+ echo ""
827
+ else
828
+ echo "→ Skipping metadata cleanup (no force-app directory found)"
829
+ echo ""
830
+ fi
759
831
 
760
832
  # ── Done ─────────────────────────────────────────────────────────────────────
761
833
 
@@ -764,18 +836,15 @@ echo "║ ✓ Reset complete! ║"
764
836
  echo "║ ║"
765
837
  echo "║ Restored: ║"
766
838
  echo "║ • Engine brand theme (global.css) ║"
767
- echo "║ - Teal brand palette (#5BC8C8) ║"
768
- echo "║ - Inter font stack ║"
769
- echo "║ - HeroUI Engine theme overrides ║"
770
- echo "║ • Engine sample data (engine-sample-data.js)║"
771
- echo "║ • Engine live data (engine-live-data.js) ║"
839
+ echo "║ Engine sample data + live data ║"
772
840
  echo "║ • Live data hook (useEngineLiveData.ts) ║"
773
- echo "║ • GraphQL schema (schema.graphql) ║"
774
- echo "║ • Engine PRD (engine-command-center-prd.md)║"
775
- echo "║ • Engine logo (engine_logo.png) ║"
776
- echo "║ • Component library (cards, charts, etc.) ║"
777
- echo "║ • HeroUI wrappers & theme providers ║"
778
- echo "║ • Salesforce SDK stubs for local dev ║"
841
+ echo "║ • GraphQL schema + PRD + logo ║"
842
+ echo "║ • Component library + theme providers ║"
843
+ echo "║ ║"
844
+ echo "║ Cleaned: ║"
845
+ echo "║ • Apex classes (force-app classes/) ║"
846
+ echo "║ • Custom fields (force-app objects/) ║"
847
+ echo "║ • Platform events (force-app *__e/) ║"
779
848
  echo "║ ║"
780
849
  echo "║ Layout: ║"
781
850
  echo "║ / → Home (search page) ║"
@@ -783,9 +852,6 @@ echo "║ /search → Search (search page) ║"
783
852
  echo "║ Nav bar on Home + Search pages only ║"
784
853
  echo "║ ║"
785
854
  echo "║ Start building: ║"
786
- echo "║ • For dashboards: Edit BlankDashboard.tsx ║"
787
- echo "║ then wire into routes or CommandCenter ║"
788
- echo "║ • For search app: Ready to go! ║"
789
855
  echo "║ npm run dev ║"
790
856
  echo "╚════════════════════════════════════════════════╝"
791
857
  echo ""