-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing syntax for per-package configs #6
Conversation
Sorry 😖
Ok, I think this looks pretty good. I like that you built in backwards comparability for Alpha 1. Here's some simple changes we should probably make:
Also, I have some questions for you: I guess I don't fully understand what
but if that is the case, how will types the user has not defined be handled? or is the user forced to define every type they are using? If they are not forced to define every type they are using, then I'd just remove the setting and this function should always return true. If they are forced to define every type, then I'd still remove this setting and just set it to true if they've defined anything other than a it's interesting how @mnsami solved this problem (if it is one): I can go in and test this myself, but I thought I'd just ask because I figured you might already have the answer. :) |
The installer should explicitly define, what package types it supports, so other installers can handle other package types. In the case custom installer and composer installers define the same type, I guess the result could be unpredictable. I added Example for {
"extra": {
"custom-installer": {
"vendor/{$vendor}/{$name}/": ["type:library"],
"web/sites/all/libraries/ckeditor": ["ckeditor/ckeditor"]
}
}
} As far as I see, https://github.com/mnsami/composer-custom-directory-installer can only work for packages of type "library", as it extends the core LibraryInstaller (see https://github.com/composer/composer/blob/master/src/Composer/Installer/LibraryInstaller.php#L61) |
You're right, I did a little test with:
and Drupal core ends up in the Well, we have a few choices. we could either:
I think 3 is probably the way to go. Honestly it would be nice if Composer would pass the entire package object into the supports method, which would fix the problem for us. |
ok, I've opened composer/composer#4058 to address that shortcoming, that would fix a lot of our issues. |
Yes, I think Option 3) would be the best for now. |
I finally found time to rework the PR with your proposed changes. A review would be great :) 💃 |
@davidbarratt , could you test that out? I'd love to use the changes in an official release :) |
certainly! I'll take a look at it as soon as possible, I apologize for my neglect. |
I don't understand how you can specify a custom package (without a type). Based on |
@davidbarratt , yes, that Is because of the way the composer API currently works. Because of that you always have to specify a declaration for the package type of your single package, even if it simply is Every package has a type. If none is explicitly specified, the type defaults to Example{
"extra": {
"custom-installer": {
"vendor/{$vendor}/{$name}/": ["type:library"],
"web/sites/all/libraries/ckeditor": ["ckeditor/ckeditor"]
}
}
} |
Better to say, you always have to specify the type. You never can specify a custom package without specifying its type. |
Changing syntax for per-package configs
Rebase of #4 on
develop
. This would fix #2 and #5.With this PR the plugin will use the same syntax as composer/installers for custom-install-paths. This allows paths to be defined per type and per package name.
composer/installers and davidbarratt/custom-installer can be used side-by-side without problems, when they do not try to alter the same package (or
custom-installer-all-package-types
is set to true).Example for the proposed syntax.