Skip to content

Commit

Permalink
Rename modules.local to modules
Browse files Browse the repository at this point in the history
Non-local modules, e.g. those declared by external packages, live wherever deps are installed, which is usually `vendor`.
Local modules, therefore, are the only modules that will be declared by _this_ package. Hence, the "locality" of the modules does not need to be reaffirmed.
  • Loading branch information
XedinUnknown committed Aug 4, 2023
1 parent d7d8dda commit 3f2fb44
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .idea/plugin.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Use this project as a starter for your [modular][modularity] WordPress plugin!
into packages of their own when necessary.

Modules can be installed from other packages, or included in the package. In the latter
case, they should be added to the directory `modules.local`. One such module, the `core`
case, they should be added to the directory `modules`. One such module, the `core`
module of the plugin, is already included in the package. Its `composer.json` should
also be personalized, just like the `composer.json` of this package.

Expand Down Expand Up @@ -215,7 +215,7 @@ To add a module from another package, require that package with Composer
and add the `ModuleInterface` instance to the list.

##### Local Modules
To add a local module, add the module to the `modules.local` folder,
To add a local module, add the module to the `modules` folder,
and do the same as for any other module. Local modules may also declare their own
dependencies by adding a `composer.json` file to their root folder.
These files will be picked up by Composer when updating dependencies in
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"extra": {
"merge-plugin": {
"include": [
"modules.local/*/composer.json"
"modules/*/composer.json"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion inc/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return function (string $rootDir, string $mainFile): iterable {
$modulesDir = "$rootDir/modules";
$localModulesDir = "$rootDir/modules.local";
$localModulesDir = "$rootDir/modules";

$modules = [
(require "$localModulesDir/core/module.php")($rootDir, $mainFile),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
>
<projectFiles>
<directory name="src"/>
<directory name="modules.local"/>
<directory name="modules"/>
</projectFiles>

<stubs>
Expand Down

0 comments on commit 3f2fb44

Please sign in to comment.