{"id":13852331,"url":"https://github.com/grasmash/composerize-drupal","last_synced_at":"2025-04-06T02:12:25.683Z","repository":{"id":37587914,"uuid":"119747587","full_name":"grasmash/composerize-drupal","owner":"grasmash","description":"Convert a non-Composer-managed Drupal application (e.g., one created via tarball) to a Composer-managed Drupal application.","archived":false,"fork":false,"pushed_at":"2023-04-19T21:17:07.000Z","size":209,"stargazers_count":126,"open_issues_count":9,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T01:11:39.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grasmash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-31T21:46:21.000Z","updated_at":"2024-12-01T10:19:09.000Z","dependencies_parsed_at":"2024-01-18T11:02:27.285Z","dependency_job_id":"6f7c44e2-c3e0-478c-9e60-25a4ed8e1b8c","html_url":"https://github.com/grasmash/composerize-drupal","commit_stats":{"total_commits":72,"total_committers":9,"mean_commits":8.0,"dds":"0.26388888888888884","last_synced_commit":"f65af62a485c2b5ee930a4bb21fcfb7199104649"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fcomposerize-drupal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fcomposerize-drupal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fcomposerize-drupal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fcomposerize-drupal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grasmash","download_url":"https://codeload.github.com/grasmash/composerize-drupal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423516,"owners_count":20936626,"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":[],"created_at":"2024-08-04T22:01:15.628Z","updated_at":"2025-04-06T02:12:25.659Z","avatar_url":"https://github.com/grasmash.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/grasmash/composerize-drupal.svg?branch=master)](https://travis-ci.org/grasmash/composerize-drupal) [![Coverage Status](https://coveralls.io/repos/github/grasmash/composerize-drupal/badge.svg?branch=master)](https://coveralls.io/github/grasmash/composerize-drupal?branch=master) [![Packagist](https://img.shields.io/packagist/v/grasmash/composerize-drupal.svg)](https://packagist.org/packages/grasmash/composerize-drupal)\n\n# Composerize Drupal\n\n_Composerize Drupal_ is a Composer plugin that converts a non-Composer-managed Drupal application (e.g., one created via tarball) to a Composer-managed Drupal application.\n\nIt is not for creating new Drupal applications. If you want to create a brand new Drupal application, use [drupal-project](https://github.com/drupal-composer/drupal-project) instead.\n\n## Functionality\n\nThe `composerize-drupal` command will perform the following operations:\n\n* Remove all vestigial `composer.json` and `composer.lock` files\n* Generate a new `composer.json` in the `[composer-root]` directory based on [template.composer.json](template.composer.json).\n    * Populate `require` with entries for `drupal/core-recommended` and `drupal/core-composer-scaffold`\n    * Populate `require` with an entry for each project in:\n        * `[drupal-root]/modules`\n        * `[drupal-root]/modules/contrib`\n        * `[drupal-root]/themes/contrib`\n        * `[drupal-root]/profiles/contrib`\n    * Require and configure suggested Composer plugins:\n        * Add `drupal/composer-scaffold` file paths to `extra` configuration to ensure that Drupal projects are downloaded to the correct locations.\n        * Create and populate `extra.patches` object to facilitate patching with [Composer Patches](https://github.com/cweagans/composer-patches). Patches to profiles, themes, and modules will be automatically discovered and moved to the a new [repo-root]/patches directory.\n        * Add entries to `repositories`:\n            * `https://packages.drupal.org/8` for installing packages from Drupal.org\n            * [`https://asset-packagist.org/`](https://asset-packagist.org/) to permit installing NPM packages.\n* Create or modify `[composer-root]/.gitignore` with entries for Composer-managed contributed projects as [per best practices](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md). You can modify `.gitignore` after composerization if you'd prefer not to follow this practice.\n* Execute `composer update` to generate `composer.lock`, autoload files, and install all dependencies in the correct locations.\n\nIt will NOT add any contributed projects in `docroot/libraries` to `composer.json`. You must add those to your `composer.json` file manually. In addition to [packagist](https://packagist.org/) and Drupal.org packages, you may also use any package from [asset packagist](https://asset-packagist.org/), which makes NPM packages available to Composer.\n\n## Installation\n\n```\ncomposer global require grasmash/composerize-drupal\n```\n\n## Usage:\n```\ncd path/to/drupal/project/repo\ncomposer composerize-drupal --composer-root=[repo-root] --drupal-root=[drupal-root]\n```\n\nThe `[composer-root]` should be the root directory of your project, where `.git` is located.\n\nThe `[drupal-root]` should be the Drupal root, where `index.php` is located.\n\nExamples:\n```\n# Drupal is located in a `docroot` subdirectory.\ncomposer composerize-drupal --composer-root=. --drupal-root=./docroot\n\n# Drupal is located in a `web` subdirectory.\ncomposer composerize-drupal --composer-root=. --drupal-root=./web\n\n# Drupal is located in a `public_html` subdirectory (cPanel compatible).\ncomposer composerize-drupal --composer-root=. --drupal-root=./public_html\n\n# Drupal is located in the repository root, not in a subdirectory.\ncomposer composerize-drupal --composer-root=. --drupal-root=.\n```\n\n## Options\n\n* `--composer-root`: Specifies the root directory of your project where `composer.json` will be generated. This should be the root of your Git repository, where `.git` is located.\n* `--drupal-root`: Specifies the Drupal root directory where `index.php` is located.\n* `--no-update`: Prevents `composer update` from being automatically run after `composer.json` is generated.\n* `--no-gitignore`: Prevents modification of the root .gitignore file. \n* `--exact-versions`: Will cause Drupal core and contributed projects (modules, themes, profiles) to be be required with exact verions constraints in `composer.json`, rather than using the default caret operator. E.g., a `drupal/core` would be required as `8.4.4` rather than `^8.4.4`. This prevents projects from being updated. It is not recommended as a long-term solution, but may help you convert to using Composer more easily by reducing the size of the change to your project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrasmash%2Fcomposerize-drupal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrasmash%2Fcomposerize-drupal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrasmash%2Fcomposerize-drupal/lists"}