Might be worth creating a D8 versoin to hep folks that start out as a traditional site but want to move to drupal-project as per https://github.com/drupal-composer/drupal-project#generate-composerjson-...

Comments

moshe weitzman created an issue.

luksak’s picture

Has anyone started working on this?

greg.1.anderson’s picture

All it needs is a template such as the one suggested. PRs welcome.

In the meantime, go ahead and start yourself a project using https://github.com/drupal-composer/drupal-project. Then, run composer-generate and copy the modules in the `require` section into your composer.json.

luksak’s picture

Ah ok, maybe I misunderstood the purpose of this project. I thought it would migrate a site to composer including the require statements. Then drupal-project already solves this I guess?

greg.1.anderson’s picture

Actually, I did already implement a better workaround for this. Although the composer_generate project does not contain Drupal 8 composer.json templates, you can tell it which one you'd like to use.

Try:

drush composer-generate --base=https://raw.githubusercontent.com/drupal-composer/drupal-project/8.x/composer.json

luksak’s picture

I get an error when running this:

drush composer-generate --base=https://raw.githubusercontent.com/drupal-composer/drupal-project/8.x/composer.json
file_get_contents(/Users/*/.drush/composer_generate/templates/d8_composer.json):    [warning]
failed to open stream: No such file or directory composer_generate.drush.inc:219
The external command could not be executed due to an application error.                          [error]
null
aaronbauman’s picture

You need to do this first:

curl https://raw.githubusercontent.com/drupal-composer/drupal-project/8.x/composer.json > ~/.drush/composer_generate/templates/d8_composer.json

also: if you have an existing makefile, you might get some mileage out of https://github.com/clever-systems/drush-m2c