Add Switch modules - Islandora-Devops/isle-dc GitHub Wiki

Composer relies on packagist.org to determine where a given module's code is hosted. If you forked a module or would like to add a custom module, you must manually declare it to the composer.json file and then run composer install to get it to download and install the module correctly. If you were to manually clone a repo to the modules directory, it would likely be removed the next time a composer command is run.

Within the composer.json file is the "repositories" section. This is where you'd add the custom repository. I'd suggest this format. This will allow you to specify a version number to equal a GitHub branch.

        {
            "type": "package",
            "package": {
                "name": "citation-style-language/locales",
                "version":"1.0.0",
                "type": "drupal-module",
                "source": {
                    "type": "git",
                    "url": "https://github.com/citation-style-language/locales.git",
                    "reference": "master"
                }
            }
        },
  • Name: is what name you want to use to install and maintain it. I'd keep it the same as the URL but in all lowercase.
  • Version: number needs to increment as you make changes/updates to the code of that repo.
  • Type: tells composer where to install it and how to treat it. The bottom of the composer.json file shows the list and where the corresponding types are to be installed.
  • URL: needs to include a .git at the end of the URL
  • Reference: can be a branch name or hash value.