-
Notifications
You must be signed in to change notification settings - Fork 13
Add composer support #26
base: 8.x-1.x
Are you sure you want to change the base?
Conversation
Where does composer put this? Unless it puts it into the libraries folder, I don't think that actually helps? |
This put inside vendor folder but we use composer in this way mostly.
Installations path is a must in composer project because the drupal contrib module are target with the type:drupal-module so you could keep running So it will be useful for project management. And since in in packegist because make sense to be in composer. Is not the only JavaScript library that is in packagist already. |
Sure, the module itself is fine. and drupal packagist would add the minimal automatically anyway. I meant the dropzonejs library that you're adding as dependency. Edit: Ah, now I see. Ignore above. Yeah, that's not perfect that you have to do it for all, but it's not so bad either, actually. Thanks for showing that. |
We should possibly document that somewhere then, maybe in the README? |
We should add it on the README about the path install. But the composer is needed for automatic and for simplytest.me support.'' edit: And is not about perfection, because for contrib modules like this one you have to define the installation path, other wise it goes to vendor folder. But composer project should be right setup and if this module provide the required library that this module need inside it, will be really helpful |
Yes, sorry if I wasn't clear. That's exactly what I meant. Document in the readme how to set up the project composer.json so that the library is added to the right folder. I suppose it's not possible to put that into composer.json (so that composer would merge it in automatically). |
You're right, childs composer like this one doesn't support the path installation, that need to be done in the root composer file. So it will a great idea to mention it on the README file tho. |
], | ||
"support": { | ||
"issues": "https://www.drupal.org/project/issues/dropzonejs", | ||
"irc": "irc://irc.freenode.org/drupal-contribute", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drupal-media is the channel that we normally "advertise" for support :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Would you consider the following as an alternative? This will work with the webflow composer manager style workflow and it will also place the code into the defined libraries folder. {
"name": "drupal/dropzonejs",
"type": "drupal-module",
"description": "Drupal integration for DropzoneJS - an open source library that provides drag’n’drop file uploads with image previews.",
"homepage": "https://www.drupal.org/project/dropzonejs",
"license": "GPL-2.0+",
"keywords": ["php", "entity", "drupal", "files", "ui", "browser"],
"homepage": "https://www.drupal.org/project/dropzonejs",
"minimum-stability": "dev",
"authors": [
{
"name": "Primoz Hmeljak",
"homepage": "https://www.drupal.org/u/primsi",
"role": "Maintainer"
},
{
"name": "Janez Urevc",
"homepage": "https://www.drupal.org/u/slashrsm",
"role": "Maintainer"
}
],
"support": {
"issues": "https://www.drupal.org/project/issues/dropzonejs",
"irc": "irc://irc.freenode.org/drupal-media",
"source": "http://git.drupal.org/project/dropzonejs.git"
},
"repositories": [
{
"type": "package",
"package": {
"name": "enyo/dropzone",
"version": "master",
"type": "drupal-library",
"dist": {
"url": "https://github.com/enyo/dropzone/archive/master.zip",
"type": "zip"
},
"require": {
"composer/installers": "~1.0"
}
}
}
],
"require": {
"enyo/dropzone": "^4.3"
}
} |
Composer is a must in drupal 8 development, so I thought should be good include the library needed for this module into a compoer so could be easy handle with installation paths.