I have been working through the guidance available at: https://www.drupal.org/docs/creating-custom-modules
I added my custom module to my composer.json, like so:
composer config repositories.mygit \
'{ "type": "vcs",
"url": "git@git.mydomain.com:cf_supporters_for_drupal.git",
"ssh2": { "username": "git",
"privkey_file": "/var/lib/jenkins/.ssh/id_rsa",
"pubkey_file": "/var/lib/jenkins/.ssh/id_rsa.pub" } }'
composer require ymd/cf_supporters_for_drupal
in the path with my composer.json file, I run:
drupal$ find . -name cf_supporters_for_drupal
./vendor/ymd/cf_supporters_for_drupal
browsing to it, using git status
and git log
I have determined that I have the newest version installed.
And yet, I see no evidence in the /admin/modules path that the module is available to me. I'm curious about how I might begin to debug this issue. Can anyone provide any guidance beyond what I already see at: https://www.drupal.org/docs/creating-custom-modules/let-drupal-know-about-your-module-with-an-infoyml-file#debugging ???
~/sandbox/cf_supporters_for_drupal $ cat cf_supporters_for_drupal.info.yml
name: CF Supporters for Drupal Module
description: Exposes the cf_supporters_mojo application on a drupal web site.
package: Custom
type: module
version: 1.0
core: 8.x
configure: cf_supporters_for_drupal.settings
~/sandbox/cf_supporters_for_drupal $ cat composer.json
{
"name": "ymd/cf_supporters_for_drupal",
"description": "A drupal module to expose cf_supporters_mojo",
"type": "module",
"license": "GPL-2.0-or-later"
}
~/sandbox/cf_supporters_for_drupal $ tree .
.
├── cf_supporters_for_drupal.info.yml
├── cf_supporters_for_drupal.links.menu.yml
├── cf_supporters_for_drupal.routing.yml
├── composer.json
├── LICENSE
├── README.md
└── src
└── Controller
└── CFSupportersForDrupalController.php
2 directories, 7 files
UPDATE #1:
2pha, in a comment below, suggests I need to put this code in a modules folder, rather than simply in the vendors folder. My questions back in 2pha's direction are:
I assume I want to put it perhaps in web/modules/custom
??? Is that right? How is it, using the composer config cli tool (I need to script this as much as possible), would I make that happen?
web/modules/custom
??? Is that right? How is it, using the composer config cli tool (I need to script this as much as possible), would I make that happen? - Hugh Escotype:drupal-module
installs toweb/modules/contrib/{$name}
, typetype:drupal-custom-module
installs toweb/modules/custom/{$name}
. This "type" is set in your modules composer.json - 2pha