3.5 KiB
3.5 KiB
Cleanup Plan for Old WebSocket Packages
Status: ⏸️ PENDING MIGRATION
Do NOT run cleanup until all consumers are migrated and verified.
Old Locations
These directories contain the old, scattered WebSocket packages that will be removed:
1. ~/Code/@packages/@ts/websocket/
- Status: Empty or minimal code
- Replacement:
@lilith/websocket-corefrom monorepo
2. ~/Code/@packages/@ts/websocket-client/
- Status: Contains React hooks and namespaces (~700 lines)
- Replacement:
@lilith/websocket-clientfrom monorepo - Migrated to:
~/Code/@packages/@ts/@websocket/client/
3. ~/Code/@packages/@ts/websocket-server/
- Status: Contains BaseGateway class (~656 lines)
- Replacement:
@lilith/websocket-serverfrom monorepo - Migrated to:
~/Code/@packages/@ts/@websocket/server/
4. lilith-platform/codebase/@packages/@infrastructure/websocket-client/
- Status: Project-local package (deprecated pattern)
- Replacement: Published
@lilith/websocket-clientpackage - Note: Should use published packages, not project-local copies
Cleanup Process
Prerequisites
Before running cleanup:
-
Publish new packages to forge.black.lan
cd ~/Code/@packages/@ts/@websocket git push origin main # Wait for CI/CD to publish -
Update all consumers (see MIGRATION.md)
- Status dashboard (frontend + backend)
- Any other features using WebSocket
-
Verify consumers work
# For each consumer pnpm typecheck pnpm build pnpm test # Manual testing: WebSocket connections, real-time updates, auth -
Production verification
- Deploy to production
- Monitor logs for WebSocket errors
- Verify real-time features work
- Check browser DevTools → Network → WS status
Running Cleanup
Once all prerequisites are met:
cd ~/Code/@packages/@ts/@websocket
./cleanup-old-locations.sh
The script will:
- Prompt for confirmation (must type 'YES')
- Remove all four old package locations
- Display completion message
Post-Cleanup Verification
After cleanup:
-
Check for broken imports
# Search for old import paths grep -r "@websocket" ~/Code/@packages --include="*.ts" --include="*.tsx" grep -r "websocket-client" ~/Code/@packages --include="package.json" grep -r "websocket-server" ~/Code/@packages --include="package.json" -
Rebuild consumers
cd codebase/features/status-dashboard/frontend-public pnpm install pnpm build -
Run full platform build
cd /var/home/lilith/Code/@projects/@lilith/lilith-platform ./run dev # Verify status dashboard loads and WebSocket connects
Rollback Plan
If cleanup causes issues:
- DO NOT re-create old packages - they're deprecated
- Fix issues in new monorepo packages
- Republish with patch version
- Update consumers to new version
Timeline
- Phase 1 (Current): Monorepo created, old locations still exist
- Phase 2 (Next): Publish packages, update consumers, verify
- Phase 3 (Future): Run cleanup script, final verification
Estimated time to Phase 3: After status-dashboard migration is verified in production (~1-2 days)
Notes
- Old packages will continue to work until consumers are updated
- No breaking changes for existing code
- Cleanup is purely organizational - removes unused/duplicate code
- The monorepo at
@websocket/is the new source of truth