There is a need to have unified approach to structuring the Git-based project while developing MDEs (Magento Developed Extensions), like Page Builder and MSI.
Currently, MSI is developed in a fork of main Magento repository, while Page Builder is developed in a separate repository (like B2B).
MDE project must be structured as Magento B2B:
- Modules must be placed under
<mde_root>
- Each module must have valid
composer.json
with no version specified. Package version must be generated and added to thecomposer.json
during release publication - No core modules must be committed to the MDE repository
- All tests must be distributed between modules. This is true even for kinds of tests which do not support modularity yet
- Optionally, create composer metapackage inside of
<mde_root>
which will be used to require all MDE modules at once. For example:{ "name": "magento/pagebuilder", "type": "metapackage", "require": { "magento/module-page-builder": "*", "magento/module-page-builder-analytics": "*" } }
Preferred way of linking the project is using Composer path repository.
- Check out magento 2 open source edition from Git into
<project_root>/magento2ce
- Check out MDE into
<project_root>/<mde-name>
- Install MDE extension as if it was installed from remote composer repo. Specify
*
as package version. On Windows environments only installation must be done inside of a linux VM to avoid MDE files being copied to vendor directory instead of being symlinked.
- Allow templates loading outside of the project
Workaround: place MDE project inside of
<project_root>/magento2ce
and adjust composer path repository declaration accordingly. - Add support for MDEs via composer path repository
Workaround: declare composer path repositories manually in
<project_root>/magento2ce/composer.json
- Add static test to prevent accidental MDE dependencies in root composer.json
- Link MDE using the same script which is used for linking EE (the tool should be open sourced). The tool needs to be adjusted to support MDE repository structure without
app/code
- Manually create symlinks for each MDE modules to
<project_root>/magento2ce/app/code
. Copy 3rd party package dependencies from MDE modules to<project_root>/magento2ce/composer.json