Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 2.88 KB

mde-project-structure.md

File metadata and controls

47 lines (35 loc) · 2.88 KB

Overview

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 structure for Git-based installations

MDE project must be structured as Magento B2B:

  1. Modules must be placed under <mde_root>
  2. Each module must have valid composer.json with no version specified. Package version must be generated and added to the composer.json during release publication
  3. No core modules must be committed to the MDE repository
  4. All tests must be distributed between modules. This is true even for kinds of tests which do not support modularity yet
  5. 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": "*"
       }
    }
    

Git-based project linking for local development

Preferred way of linking the project is using Composer path repository.

  1. Check out magento 2 open source edition from Git into <project_root>/magento2ce
  2. Check out MDE into <project_root>/<mde-name>
  3. 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.

Blockers

  1. Allow templates loading outside of the project Workaround: place MDE project inside of <project_root>/magento2ce and adjust composer path repository declaration accordingly.
  2. Add support for MDEs via composer path repository Workaround: declare composer path repositories manually in <project_root>/magento2ce/composer.json
  3. Add static test to prevent accidental MDE dependencies in root composer.json

Alternative options considered (not recommended)

  1. 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
  2. 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