PHP 7.3 reached end of support in December 2021 and Adobe Commerce 2.3.x reaches end of support in September 2022. You may want to consider planning your upgrade now to Adobe Commerce 2.4.x and PHP 7.4.x to help maintain PCI compliance.

Extension Repository Structure

Extension Repository Structure

For Magento module, theme, and language pack extension repositories, we recommend five best practices:

  • Flatter hierarchy
  • One extension type (module, theme, or language pack) per repository
  • Multiple components per repository
  • One component per repository
  • One functional test suite per module component

Flatter hierarchy

Your repository structure should no longer include app/code/<Vendor>/ directories.


└── app/code/<Vendor>/
    └── <Module1>


└── <Module1>

One extension type per repository

You cannot mix extension types (modules, themes, and language packs) in the same extension repository. Each component type must have its own repository. For example, you cannot do this:

// This is not supported
├── <Module1>
├── <theme1>
└── <language1>

Multiple components per repository

If your extension is complex and requires several components, you can keep those components in the same repository to make the extension easy to package and maintain:

├── <Module1>
├── <Module2>
├── <Module1SampleData>
└── <Module2SampleData>

You can do the same for theme and language pack extensions:

├── <theme1>
└── <theme2>
├── <language1>
└── <language2>

One component per repository

If your extension requires only one component, your <component_root> directory and your <repo_root> directory will be the same to reduce unnecessary hierarchy in the directory structure:

├── Api
├── Block
├── Controller
├── Console
├── etc
├── Helper
├── i18n
├── Model
├── Plugin
├── Test
├── view
├── composer.json
├── LICENSE.txt
└── ...

Test Suites

Function tests can be added to a Test directory within each module of your extension.

Note: Currently, only Unit and MFTF tests can be run from within a <Module> directory.

├── <Module1>
│   ├── ...
│   ├── Test
│   │   ├── Unit
│   │   ├── Integration
│   │   └── Mftf
│   │       ├── TestSuite
│   │       └── composer.json
│   └── ...
├── <Module2>
├── <Module1SampleData>
└── <Module2SampleData>