Edit in GitHubLog an issue

Extension repository structure

For module, theme, and language pack component 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.

Before:

Copied to your clipboard
1<extension_repo_root\>
2└── app/code/<Vendor>/
3 └── <Module1>

After:

Copied to your clipboard
1<extension_repo_root>/
2└── <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:

Copied to your clipboard
1// This is not supported
2<extension_repo_root>
3├── <Module1>
4├── <theme1>
5└── <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:

Copied to your clipboard
1<extension_repo_root>
2├── <Module1>
3├── <Module2>
4├── <Module1SampleData>
5└── <Module2SampleData>

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

Copied to your clipboard
1<extension_repo_root>/
2├── <theme1>
3└── <theme2>
Copied to your clipboard
1<extension_repo_root>/
2├── <language1>
3└── <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:

Copied to your clipboard
1<MyModule_repo_root>
2├── Api
3├── Block
4├── Controller
5├── Console
6├── etc
7├── Helper
8├── i18n
9├── Model
10├── Plugin
11├── Test
12├── view
13├── composer.json
14├── LICENSE.txt
15└── ...

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.

Copied to your clipboard
1<extension_repo_root>
2├── <Module1>
3│ ├── ...
4│ ├── Test
5│ │ ├── Unit
6│ │ ├── Integration
7│ │ └── Mftf
8│ │ ├── TestSuite
9│ │ └── composer.json
10│ └── ...
11├── <Module2>
12├── <Module1SampleData>
13└── <Module2SampleData>
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.