Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does one handle custom modules in 7.x? #107

Closed
dsdeiz opened this issue Feb 6, 2016 · 4 comments
Closed

How does one handle custom modules in 7.x? #107

dsdeiz opened this issue Feb 6, 2016 · 4 comments

Comments

@dsdeiz
Copy link

dsdeiz commented Feb 6, 2016

Hi!

I think unlike Drupal 8, modules can be stored just inside the modules/ directory. I'm wondering how I should handle this in the 7.x branch? All packages would be inside web so I guess if I have custom modules I could put them inside web/sites/all/modules/custom though what's going to happen now is that if I track these custom modules in git, I need to track the files inside web - specifically web/sites/all/modules/custom/* (and I was hoping to completely ignore the web directory). Would like to know what's a clean approach for this.

@tobiasbaehr
Copy link

You can do it so:
(preserve-paths is for derhasi/composer-preserve-paths)

"installer-paths": {
      "web/": ["type:drupal-core"],
      "web/sites/all/modules/custom/my_custom_module/": ["vendor/my_custom_module"],
      "web/sites/all/themes/custom/my_custom_theme/": ["vendor/my_custom_theme"],
      "web/sites/all/modules/contrib/{$name}/": ["type:drupal-module"],
      "web/sites/all/themes/contrib/{$name}/": ["type:drupal-theme"],
      "web/sites/all/libraries/{$name}/": ["type:drupal-library"],
      "web/sites/all/drush/{$name}/": ["type:drupal-drush"],
      "web/profiles/{$name}/": ["type:drupal-profile"]
},
"preserve-paths": [
      "web/sites/all/modules/contrib",
      "web/sites/all/modules/custom",
      "web/sites/all/themes/contrib",
      "web/sites/all/themes/custom",
      "web/sites/all/libraries",
      "web/sites/all/drush",
      "web/sites/default/settings.php",
      "web/sites/default/files"
]

@dsdeiz
Copy link
Author

dsdeiz commented Feb 6, 2016

I guess this approach would be a little bit difficult to manage i.e. you need to provide a composer.json file for your custom modules and you'll need to explicitly list each one of them inside the installer-paths block.

@greg-1-anderson
Copy link
Collaborator

Answered accurately; closing.

@hawkeyetwolf
Copy link

hawkeyetwolf commented Nov 23, 2016

To make it a little easier, you can put all your custom modules in one repo, same for themes. That way you don't need to have separate repo's and composer.json entries for each individual custom theme/module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants