drupal-composer / drupal-parse-composer

:mag: Components used in Drupal-Packagist to parse package information from drupal.org
10 stars 11 forks source link

Respect Composer.json is availaible #33

Closed generalredneck closed 9 years ago

generalredneck commented 9 years ago

The package drupal/coder has a composer.json available in it's repository. They are also defined over on packagist.org. Since I'm defining

{
  "type": "composer",
  "url": "http://packagist.drupal-composer.org"
},

in my composer.json, I can't use the package from packagist.org. I've tried to do a couple of things as you can see over in this stackoverflow question to no avail. It's my opinion that since this packagist doesn't respect the composer.json, it's a bug as the author of the repository intended his package to be defined a specific way.

webflo commented 9 years ago

Problem is drupal/coder is still a drupal module and should live in the modules folder. The only way to achieve this is using "drupal-module" as type.

We have the same situation with a few other modules. For example Search API Solr and awssdk2.

webflo commented 9 years ago

I tried to alter the composer.json as little as possible. Do you have a specific issue with drupal/code from drupal-packagist?

generalredneck commented 9 years ago

@webflo Check this out. They are pretty much totally different. http://screencast.com/t/J7sX6WU0r.

Specifically the requires from the original package has been blown away.

Honestly I did overlook the fact that it was a drupal-module type on packagist.drupal-composer.org. something I take for granted already :)

webflo commented 9 years ago

Yeah you are right. I think we should merge the requirements from composer.json and info files on Drupal packagist.

davidbarratt commented 9 years ago

I opened an issue to change the type https://www.drupal.org/node/2467651

webflo commented 9 years ago

Fixed the bug a while ago.

helderco commented 9 years ago

config_devel has type: drupal-module in composer.json, but composer sees it as drupal-drush:

$ composer show drupal/config_devel | grep type
type     : drupal-drush

I have these repositories:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://raw.githubusercontent.com/webflo/d8/master/packages.json"
        },
        {
            "type": "composer",
            "url": "https://packagist.drupal-composer.org"
        }
    ],
    "require": {
        "composer/installers": "^1.0.20",
        "drupal/core": "8.0.*",
        "drupal/drupal": "8.*",
        "drupal/token": "8.1.*@dev",
        "drush/drush": "~8"
    },
    "require-dev": {
        "drupal/devel": "8.1.*@dev",
        "drupal/config_devel": "8.*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-install-cmd": "scripts/composer/post-install.sh"
    },
    "extra": {
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "web/drush/commands/{$name}": ["type:drupal-drush"]
        }
    }
}
webflo commented 9 years ago

@helderco Pushed https://github.com/drupal-composer/drupal-parse-composer/commit/fd1d0ed82593123685c2d134439304982b543116 to production and triggered a update on `config_devel``

$ composer clear-cache && composer show drupal/config_devel

Clearing cache (cache-dir): /Users/fweber/.composer/cache
Clearing cache (cache-files-dir): /Users/fweber/.composer/cache/files
Clearing cache (cache-repo-dir): /Users/fweber/.composer/cache/repo
Clearing cache (cache-vcs-dir): /Users/fweber/.composer/cache/vcs
All caches cleared.
name     : drupal/config_devel
descrip. : Helps developers work with configuration.
keywords :
versions : 8.1.x-dev, 8.1.0-beta4, 8.1.0-alpha14, 8.1.0-alpha7, 8.1.0-alpha6, 8.1.0-alpha5, 8.1.0-alpha4, 8.1.0-alpha3, 8.1.0-alpha2, 8.1.0-alpha1, dev-8.x-1.x
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0+) (OSI approved) http://spdx.org/licenses/GPL-2.0+#licenseText
source   : [git] http://git.drupal.org/project/config_devel ba30e9082304027047c1cf3fc5f7d6b03fa1203a
dist     : [zip] http://ftp.drupal.org/files/projects/config_devel-8.x-1.0-beta4.zip
names    : drupal/config_devel

requires
drupal/core 8.*
helderco commented 9 years ago

Cool, but when do I pick up those changes?

$ composer clear-cache && composer show drupal/config_devel
Clearing cache (cache-dir): /Users/helder/.composer/cache
Clearing cache (cache-files-dir): /Users/helder/.composer/cache/files
Clearing cache (cache-repo-dir): /Users/helder/.composer/cache/repo
Cache directory does not exist (cache-vcs-dir): 
All caches cleared.
name     : drupal/config_devel
descrip. : Helps developers work with configuration.
keywords : 
versions : 8.1.x-dev, * 8.1.0-beta4, 8.1.0-alpha14, 8.1.0-alpha7, 8.1.0-alpha6, 8.1.0-alpha5, 8.1.0-alpha4, 8.1.0-alpha3, 8.1.0-alpha2, 8.1.0-alpha1, dev-8.x-1.x
type     : drupal-drush
license  : GNU General Public License v2.0 or later (GPL-2.0+) (OSI approved) http://spdx.org/licenses/GPL-2.0+#licenseText
source   : [git] http://git.drupal.org/project/config_devel ba30e9082304027047c1cf3fc5f7d6b03fa1203a
dist     : [zip] http://ftp.drupal.org/files/projects/config_devel-8.x-1.0-beta4.zip 
names    : drupal/config_devel

requires
drupal/core 8.*
drush/drush >=6
webflo commented 9 years ago

Should be there after a couple of minutes.

helderco commented 9 years ago

Yeah, it's ok now, thanks!

webflo commented 9 years ago

Great.