Widget System Sync Plan

Plan to sync the new widget-system library from gograb-space to editor monorepo

๐Ÿ”„ Widget System Sync Plan

Date: October 31, 2025
Status: ๐ŸŽฏ READY TO EXECUTE
Priority: ๐Ÿ”ฅ CRITICAL - Blocks Phase 4 completion


๐Ÿ“Š Executive Summary

The gograb-space team has created a revolutionary new widget system (@gograb-space/widget-system) with 7,000+ lines of production-ready code. This library needs to be synced to the editor monorepo to:

  1. Enable Phase 4 (Widget System Enhancement) completion
  2. Unify widget implementation across both monorepos
  3. Provide foundation for AI-generated modules
  4. Support dynamic widget composition in canvases

๐ŸŽฏ What's Being Synced

From gograb-space Monorepo

libs/core/widget-system/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ base/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ base-widget.component.ts (259 lines)
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ widget-container/ (118 lines + templates)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ widget-error/ (42 lines + templates)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ widget-grid/ (233 lines + templates)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ widget-placeholder/ (24 lines + templates)
โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ grid-config.interface.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ widget-lifecycle.interface.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ widget-state.interface.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ widget-event.ts
โ”‚   โ”‚   โ””โ”€โ”€ services/
โ”‚   โ”‚       โ”œโ”€โ”€ widget-communication.service.ts (207 lines)
โ”‚   โ”‚       โ””โ”€โ”€ widget-layout.service.ts (221 lines)
โ”‚   โ””โ”€โ”€ index.ts (barrel exports)
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ base-widget.component.test.ts (653 lines)
โ”‚   โ”œโ”€โ”€ widget-container.component.test.ts (585 lines)
โ”‚   โ”œโ”€โ”€ widget-grid.component.test.ts (467 lines)
โ”‚   โ”œโ”€โ”€ widget-layout.service.test.ts (572 lines)
โ”‚   โ””โ”€โ”€ widget-system-integration.test.ts (687 lines)
โ”œโ”€โ”€ project.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ tsconfig.lib.json
โ”œโ”€โ”€ tsconfig.spec.json
โ”œโ”€โ”€ vite.config.mts
โ”œโ”€โ”€ ng-package.json
โ””โ”€โ”€ README.md (716 lines)

Total: ~7,000 lines of code, tests, and documentation


โœ… Pre-Sync Checklist

Required Before Sync

Dependencies Verified


๐Ÿš€ Sync Steps

Step 1: Copy Widget System Library (15 minutes)

# Navigate to editor monorepo
cd /Users/fguijarro/developer/repos/editor

# Create widget-system directory
mkdir -p libs/core/widget-system

# Copy from gograb-space (adjust path as needed)
cp -r /Users/fguijarro/developer/repos/gograb-space/libs/core/widget-system/* \
      libs/core/widget-system/

# Verify files copied
ls -la libs/core/widget-system/

Expected Result: All files present in libs/core/widget-system/


Step 2: Update Import Paths (10 minutes)

All imports need to change from @gograb-space/* to @libs-core/*:

# Find all imports to update
cd libs/core/widget-system
grep -r "@gograb-space" src/

# Replace imports (or do manually)
find src/ -name "*.ts" -exec sed -i '' 's/@gograb-space/@libs-core/g' {} \;

Files to Check:

Example Changes:

// Before
import { LoggerService } from '@gograb-space/log-system';
import { ModuleParameterMetadata } from '@gograb-space/module-base';

// After
import { LoggerService } from '@libs-core/log-system';
import { ModuleParameterMetadata } from '@libs-core/module-base';

Step 3: Update tsconfig.base.json (5 minutes)

Add path mapping for the new library:

{
  "compilerOptions": {
    "paths": {
      // ... existing paths ...
      "@libs-core/widget-system": ["libs/core/widget-system/src/index"],
      "@libs-core/widget-system/*": ["libs/core/widget-system/src/*"]
    }
  }
}

File: editor/tsconfig.base.json


Step 4: Update Library Configuration (10 minutes)

package.json

Update peer dependencies if needed:

{
  "peerDependencies": {
    "@angular/common": "^20.1.0",
    "@angular/core": "^20.1.0",
    "@libs-core/module-base": "workspace:*",
    "@libs-core/log-system": "workspace:*",
    "rxjs": "workspace:*"
  }
}

project.json

Verify build configuration is compatible with editor monorepo standards.

tsconfig.lib.json

May need to update to match editor's TypeScript configuration patterns.


Step 5: Build Widget System (5 minutes)

# Build the widget-system library
npx nx build widget-system

# Expected: Successful build with no errors

If Errors Occur:

  1. Check import paths are correct
  2. Verify dependencies are built (module-base, log-system)
  3. Check TypeScript configuration

Step 6: Run Tests (10 minutes)

# Run widget-system tests
npx nx test widget-system

# Expected: All tests pass (or skip if tests need adjustment)

Note: Tests may need import path updates or adjustment to work in editor monorepo.


Step 7: Update Existing Widgets Library (20 minutes)

Update libs/widgets to use the new widget-system:

// libs/widgets/src/lib/base/widget-module-base.ts

// Add import
import { BaseWidget } from '@libs-core/widget-system';

// Update widgets to extend BaseWidget where appropriate

Files to Update:


Step 8: Verification (10 minutes)

Build Verification

# Build all affected libraries
npx nx run-many -t build --projects=widget-system,widgets,demos-lib

# Expected: All builds successful

Import Verification

# Test importing from new library
cd libs/widgets/src
grep -r "@libs-core/widget-system" .

# Expected: Imports work correctly

Linter Verification

# Run linter
npx nx lint widget-system
npx nx lint widgets

# Expected: No linter errors

๐Ÿงช Testing Plan

Unit Tests

Integration Tests

Manual Tests


๐Ÿ“š Documentation Updates

Documents to Create

Documents to Update


๐Ÿšจ Potential Issues & Solutions

Issue 1: Import Path Mismatches

Problem: Some imports may not resolve correctly
Solution: Use find/replace to systematically update all imports
Command: find src/ -name "*.ts" -exec sed -i '' 's/@gograb-space/@libs-core/g' {} \;

Issue 2: Dependency Version Mismatches

Problem: Widget system may expect different versions
Solution: Check package.json and align versions with editor standards

Issue 3: TypeScript Configuration Differences

Problem: TypeScript compiler options may differ
Solution: Update tsconfig.lib.json to match editor's patterns

Issue 4: Test Framework Differences

Problem: Tests may use different testing utilities
Solution: Update test imports or adapt tests to editor's testing setup

Issue 5: Build System Differences

Problem: Nx configuration may differ
Solution: Update project.json to match editor's build patterns


โœ… Completion Checklist

Code Sync

Build & Test

Integration

Documentation


๐Ÿ“Š Success Metrics

Quantitative

Qualitative


๐ŸŽฏ Post-Sync Actions

Immediate (Same Day)

  1. Update progress tracker with sync results
  2. Document any issues encountered
  3. Create migration guide for widgets

Short-term (1-2 Days)

  1. Migrate 1-2 existing widgets to new system as proof of concept
  2. Test integrated widgets in Editor canvas
  3. Update widget documentation

Medium-term (3-7 Days)

  1. Migrate remaining widgets to new system
  2. Update Modularity tool to use widget-system
  3. Enable widget selection in module packager
  4. Connect canvases to widget-system

๐Ÿ’ก Tips & Best Practices

During Sync

  1. Copy entire directory first, then make changes
  2. Commit after each major step (copy, imports, build)
  3. Test frequently - don't wait until the end
  4. Document issues as they arise

After Sync

  1. Create examples showing how to use new system
  2. Communicate changes to team
  3. Monitor for issues in existing functionality
  4. Iterate quickly on problems

๐Ÿ“ž Support & Resources

Documentation

Code References


๐Ÿ Ready to Execute?

Estimated Total Time: 1.5 - 2 hours
Complexity: Medium
Risk Level: Low (new library, doesn't break existing code)
Rollback: Easy (just delete libs/core/widget-system)

Status: โœ… READY - All prerequisites met, plan is clear!


Next Step: Execute Step 1 (Copy Widget System Library)

"Let's bring the widget revolution to the editor monorepo!" ๐Ÿš€