drupal-console-core icon indicating copy to clipboard operation
drupal-console-core copied to clipboard

console directory appears in the root of my consumer project

Open AlexSkrypnyk opened this issue 4 years ago • 6 comments

Continuing discussion started in https://github.com/hechoendrupal/drupal-console-core/pull/364

I do not understand why something that I did not ask for (as an owner of the my consumer repo) was added to the root of my project? Could someone please clearly explain which exact project adds this and why?

Separately to this - if it is the drupal console (hechoendrupal/drupal-console-core) that adds the transaltion - can the logic of creating /console dir be modified to be added only if there is a flag in "extras" of my composer.json?

AlexSkrypnyk avatar Aug 28 '19 07:08 AlexSkrypnyk

Looking at https://github.com/hechoendrupal/drupal-console-core/pull/364/files#diff-0af9161b4d83c4008a9a0d8ac7a4b6b3R83

Why the default value is outside of vendor? If I want to use transaltion in my workflow - I will force the location to be somewhere in my project myself; I do not want it to be forced on me by default.

AlexSkrypnyk avatar Aug 28 '19 07:08 AlexSkrypnyk

composer depends drupal/console-en
drupal/console-core  1.9.2      requires  drupal/console-en (1.9.2)  
drupal/drupal        8.7.x-dev  requires  drupal/console-en (^1.9)

clemens-tolboom avatar Aug 28 '19 07:08 clemens-tolboom

Having the translations appear in root seems like an oversight. I understand the desire to allow application-level translations, but console-en feels like it should be in vendor.

RobLoach avatar Sep 04 '19 02:09 RobLoach

When having custom commands you have to add translations. Even to console-en.

I consider ./vendor a readonly directory so I understand the location ./console/. But it feels a little weird when not having the need to translate for console-en having it in there.

As it is similar to drupal scaffold I can live with it.

(my 2 cents)

clemens-tolboom avatar Sep 04 '19 06:09 clemens-tolboom

@clemens-tolboom I do not understand why polluting a root of the project is okay. No other dependency does this. What if every dependency start to create their own files and directories in the repo root?

Regarding vendor being read-only: I would agree that this is the case if you want to override the transaltion for your projects. However, by default, it would be expected for the translation directory to appear in the project root only if a developer added a key to composer.json into extra ot some other explicit way.

Drupal scaffold is different in a way that it once per project, but this project is required during composer install on each build (and the translation directory is created as well).

As I mentioned, the implication of this change are huge - I have to patch all projects using console to exclude this directory.

AlexSkrypnyk avatar Sep 04 '19 06:09 AlexSkrypnyk

@AlexSkrypnyk @clemens-tolboom @RobLoach This was related to an old PR https://github.com/composer/installers/pull/311 merged to the composer/installers repository that is no longer required.

But got fixed on latest release of the drupal-console project https://github.com/hechoendrupal/drupal-console/releases/tag/1.9.3

jmolivas avatar Sep 09 '19 00:09 jmolivas