{"id":13579201,"url":"https://github.com/drupal-composer/drupal-project","last_synced_at":"2025-05-13T22:12:13.481Z","repository":{"id":16712478,"uuid":"19469355","full_name":"drupal-composer/drupal-project","owner":"drupal-composer","description":":rocket: Composer template for Drupal projects. Quick installation via \"composer create-project drupal-composer/drupal-project\"","archived":false,"fork":false,"pushed_at":"2024-10-09T02:42:53.000Z","size":337,"stargazers_count":1562,"open_issues_count":9,"forks_count":936,"subscribers_count":97,"default_branch":"10.x","last_synced_at":"2025-05-08T14:50:10.174Z","etag":null,"topics":["composer","drupal"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drupal-composer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-05T20:03:19.000Z","updated_at":"2025-05-07T12:03:03.000Z","dependencies_parsed_at":"2023-01-13T18:59:17.495Z","dependency_job_id":"42552a8b-7c90-4442-8554-c5bc7d3335e8","html_url":"https://github.com/drupal-composer/drupal-project","commit_stats":{"total_commits":230,"total_committers":63,"mean_commits":"3.6507936507936507","dds":0.4826086956521739,"last_synced_commit":"f57a511f2c5a078c0669cf7d5a2b7ae0f9696759"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-composer%2Fdrupal-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-composer%2Fdrupal-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-composer%2Fdrupal-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupal-composer%2Fdrupal-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drupal-composer","download_url":"https://codeload.github.com/drupal-composer/drupal-project/tar.gz/refs/heads/10.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036842,"owners_count":22003654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","drupal"],"created_at":"2024-08-01T15:01:37.347Z","updated_at":"2025-05-13T22:12:13.432Z","avatar_url":"https://github.com/drupal-composer.png","language":"PHP","readme":"# Composer template for Drupal projects\n\n[![CI](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml/badge.svg?branch=10.x)](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml)\n![LICENSE](https://img.shields.io/github/license/drupal-composer/drupal-project)\n\nThis project template provides a starter kit for managing your site\ndependencies with [Composer](https://getcomposer.org/).\n\n\u003e [!IMPORTANT]\n\u003e [Drupal 11 branch](https://github.com/drupal-composer/drupal-project/tree/11.x) is available!\n\n## What does the template do?\n\n* Drupal will be installed in the `web` directory.\n* Generated composer autoloader `vendor/autoload.php` is used  instead of\n  `web/vendor/autoload.php` provided by Drupal core.\n* Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib` directory.\n* Themes (packages of type `drupal-theme`) will be placed in `web/themes/contrib` directory.\n* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib` directory.\n* Creates default writable versions of `settings.php` and `services.yml`.\n* Creates `web/sites/default/files` directory.\n* Drush is installed for use as `vendor/bin/drush`.\n* Provides an [example](.env.example) of the `.env` file.\n\n## Installing\n\n\u003e [!NOTE]\n\u003e The instructions below refer to the [global Composer installation](https://getcomposer.org/doc/00-intro.md#globally).\nYou might need to replace `composer` with `php composer.phar` (or similar)\nfor your setup.\n\nCreate your project:\n\n```bash\ncomposer create-project drupal-composer/drupal-project:10.x-dev some-dir --no-interaction\n```\n\nThe `composer create-project` command passes ownership of all files to the\nproject that is created. You should create a new Git repository, and commit\nall files not excluded by the `.gitignore` file.\n\n## Usage\n\n### Adding new dependencies\n\nUse `composer require` to include and download dependencies for your project.\n\n```bash\ncd some-dir\ncomposer require drupal/devel\n```\n\nBy default, this project is set to install only stable releases of dependencies,\nas specified by `\"minimum-stability\": \"stable\"` in `composer.json`. If you need \nto use non-stable releases (e.g., `alpha`, `beta`, `RC`), you can modify the \nversion constraint to allow for such versions. For instance, to require a beta \nversion of a module:\n\n```bash\ncomposer require drupal/devel:1.0.0-beta1\n```\n\nAlternatively, you can globally adjust the stability settings by modifying \n`composer.json` to include the desired stability level and explicitly allow it:\n\n```json\n{\n    \"minimum-stability\": \"beta\",\n    \"prefer-stable\": true\n}\n```\n\nThis configuration ensures that stable releases are preferred, but allows the \ninstallation of non-stable packages when necessary.\n\n### Adding libraries\n\nYou can manage front-end asset libraries with Composer thanks to the\n[asset-packagist repository](https://asset-packagist.org/). Composer will detect\nand install new versions of a library that meet the stated constraints.\n\n```bash\ncomposer require bower-asset/dropzone\n```\n\n### Custom installation paths for libraries\n\nThe installation path of a specific library can be controlled by adding it to\nthe `extra.installer-paths` configuration preceding `web/libraries/{$name}`.\nFor example, the `chosen` Drupal module expects the `chosen` library to be\nlocated on `web/libraries/chosen`, but `composer require npm-asset/chosen-js`\ninstalls the library into `web/libraries/chosen-js`. The following configuration\noverrides installation it into the expected directory:\n\n```json\n{\n    \"extra\": {\n        \"installer-paths\": {\n            \"web/libraries/chosen\": [\n                \"npm-asset/chosen-js\"\n            ],\n            \"web/libraries/{$name}\": [\n                \"type:drupal-library\",\n                \"type:npm-asset\",\n                \"type:bower-asset\"\n            ]\n        }\n    }\n}\n```\n\nFor more details, see https://asset-packagist.org/site/about\n\n### Updating Drupal Core\n\nThis project will attempt to keep all of your Drupal Core files up-to-date; the\nproject [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold)\nis used to ensure that your scaffold files are updated every time `drupal/core`\nis updated.\n\nIf you customize any of the \"scaffolding\" files (commonly `.htaccess`),\nyou may need to merge conflicts if any of your modified files are updated in a\nnew release of Drupal core.\n\nFollow the steps below to update your Drupal core files.\n\n1. Run `composer update \"drupal/core-*\" --with-dependencies` to update Drupal Core and its dependencies.\n2. Run `git diff` to determine if any of the scaffolding files have changed.\n   Review the files for any changes and restore any customizations to\n  `.htaccess` or `robots.txt`.\n3. Commit everything all together in a single commit, so `web` will remain in\n   sync with the `core` when checking out branches or running `git bisect`.\n4. In the event that there are non-trivial conflicts in step 2, you may wish\n   to perform these steps on a branch, and use `git merge` to combine the\n   updated core files with your customized files. This facilitates the use\n   of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple;\n   keeping all of your modifications at the beginning or end of the file is a\n   good strategy to keep merges easy.\n\n## FAQs\n\n### Should I commit the contrib modules I download?\n\nComposer recommends **no**. They provide [argumentation against but also\nworkarounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).\n\n### Should I commit the scaffolding files?\n\nThe [Drupal Composer Scaffold](https://github.com/drupal/core-composer-scaffold)\nplugin can download the scaffold files (like `index.php`, `update.php` etc.) to\nthe `web` directory of your project. If you have not customized those files you\ncould choose to not check them into your version control system (e.g. git).\nIf that is the case for your project, it might be convenient to automatically\nrun the drupal-scaffold plugin after every install or update of your project.\nYou can achieve that by registering `@composer drupal:scaffold` as `post-install`\nand `post-update` command in your `composer.json`:\n\n```json\n\"scripts\": {\n    \"post-install-cmd\": [\n        \"@composer drupal:scaffold\",\n        \"...\"\n    ],\n    \"post-update-cmd\": [\n        \"@composer drupal:scaffold\",\n        \"...\"\n    ]\n},\n```\n\n### How can I apply patches to included dependencies?\n\nIf you need to apply patches, you can do so with the\n[composer-patches](https://github.com/cweagans/composer-patches) plugin included\nin this project.\n\nTo add a patch to Drupal module `foobar`, insert the `patches` section in the\n`extra` section of `composer.json`:\n\n```json\n\"extra\": {\n    \"patches\": {\n        \"drupal/foobar\": {\n            \"Patch description\": \"URL or local path to patch\"\n        }\n    }\n}\n```\n\n### How do I specify a PHP version?\n\nThere are 2 places where Composer will be looking for PHP version requirements\nwhen resolving dependencies:\n1. The `require.php` version value in `composer.json`.\n2. The `config.platform` version value in `composer.json`.\n\nThe purpose of `require.php` is to set the minimum PHP language requirements\nfor a package. For example, the minimum version required for Drupal 10.0 is\n`8.0.2` or above, which can be specified as `\u003e=8`.\n\nThe purpose of `config.platform` is to set the PHP language requirements for the\nspecific instance of the package running in the current environment. For\nexample, while the minimum version required for Drupal 10 is `8.0.2` or above,\nthe  actual PHP version on the hosting provider could be `8.1.0`. The value of\nthis field should provide your exact version of PHP with all 3 parts of the\nversion.\n\n#### Which versions to specify in my Drupal site?\n\nThis project includes `drupal/core` which already has `require.php` added. Your\nwould inherit that constraint. There is no need to add `require.php` to your\n`composer.json`.\n\n`config.platform` is a platform-specific. It is recommended to specify\n`config.platform` as a _specific version_ (e.g.`8.1.19`) constraint to ensure\nthat only the package versions supported by your current environment are used.\n\n```json\n\"config\": {\n    \"platform\": {\n        \"php\": \"8.1.19\"\n    }\n},\n```\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupal-composer%2Fdrupal-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrupal-composer%2Fdrupal-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupal-composer%2Fdrupal-project/lists"}