This document outlines the strategic migration of specific packages from the modules/ directory to the packages/ directory within the Ensemble monorepo. This migration is designed to maintain backward compatibility while enabling modern package management and publication workflows.
- Problem: The
modules/directory contains packages that are tightly coupled with the Ensemble runtime, making them difficult to use as standalone dependencies in other projects. - Solution: Moving packages to the
packages/directory allows them to be published to pub.dev and used independently.
- Problem: Packages in
modules/cannot be easily published to pub.dev due to their tight integration with the Ensemble ecosystem i.e used as git with main ref. This causes conflicts when we update them or publish to pub.dev. - Solution: The
packages/directory provides a clean separation for packages intended for public distribution.
- Problem: Existing Ensemble applications depend on packages from the
modules/directory. - Solution: Keep both versions temporarily to ensure smooth transitions for existing users.
The following packages have been migrated from modules/ to packages/:
- Old Location:
modules/parsejs_null_safety/ - New Location:
packages/parsejs_null_safety/ - Purpose: JavaScript parser with null safety support
- Status: ✅ Published to pub.dev
- Old Location:
modules/otp_pin_field/ - New Location:
packages/ensemble_otp/ - Purpose: OTP/PIN field widget for Flutter
- Status: ✅ Published for pub.dev
- Old Location:
modules/ensemble_ts_interpreter/ - New Location:
packages/ensemble_ts_interpreter/ - Purpose: JavaScript (ES5) interpreter written in Dart
- Status: ✅ Published for pub.dev
- Old Location:
modules/device_preview/ - New Location:
packages/ensemble_device_preview/ - Purpose: Device preview and testing utilities
- Status: ✅ Published for pub.dev
modules/versions: Kept for backward compatibility with older Ensemble runtime versionspackages/versions: New, actively maintained versions intended for pub.dev publication
The melos.yaml has been updated to exclude deprecated packages from the workspace:
packages:
- modules/**
- starter
- packages/**
ignore:
- modules/ensemble_ts_interpreter- Use latest ensemble version (ensemble: ^1.2.0)
- Move to latest ensemble version as soon as possible (ensemble: ^1.2.0)
- Focus development efforts on
packages/versions modules/versions are deprecated and will not receive updates- Use
packages/versions for testing and development
- ✅ Enables pub.dev publication
- ✅ Maintains backward compatibility
- ✅ Allows independent package development
- ✅ Allows us to properly update individual packages without affecting the whole ensemble runtime
- 🚀 Better package ecosystem management
- 🚀 Independent versioning and release cycles
- 🚀 Easier integration with other Flutter projects
- 🚀 Improved dependency resolution
- 🚀 Better separation of concerns
- 🚀 Better testing and CI/CD pipelines
- 🚀 Better package management and versioning
- 🚀 Easier to update packages without affecting the whole ensemble runtime
This migration strategy provides a balanced approach to modernizing the Ensemble package ecosystem while maintaining backward compatibility.
Last Updated: Aug 15 2025