Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Composer improvements #370

Merged
merged 1 commit into from
May 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,30 @@
}
],
"require": {
"php": "~5.5|~7.0",
"sonata-project/admin-bundle": "~3.0",
"sonata-project/block-bundle": "^2.3.2",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/property-access": "~2.2|~3.0",
"doctrine/phpcr-odm": "~1.1",
"doctrine/phpcr-bundle": "~1.1",
"symfony-cmf/tree-browser-bundle": "~2.0",
"symfony-cmf/resource-rest-bundle": "~1.0"
"php": "^5.5 || ^7.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to use || instead of the quite common |?

Copy link
Member Author

@soullivaneuh soullivaneuh May 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of the quite common |?

This is the problem: it shouldn't.

|| is the new standard. See examples on docs: https://getcomposer.org/doc/04-schema.md

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info, good to know that the single one is actually sort-of deprecated.

"sonata-project/admin-bundle": "3.x-dev@dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here, why not 3.*?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should at least be ^3.0@dev and not 3.x-dev@dev (which is double btw, 3.x-dev should be enough).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.x-dev@dev looks indeed fishy…

"symfony/framework-bundle": "^2.3 || ^3.0",
"symfony/property-access": "^2.2 || ^3.0",
"doctrine/phpcr-odm": "^1.1",
"doctrine/phpcr-bundle": "^1.1",
"symfony-cmf/tree-browser-bundle": "^2.0@dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually different than having the minimum-stability: we make every user install dev versions of the tree bundle even once a stable version of the tree bundle is out. assuming that we don't release before tree bundle 2.0 is stable, we can still correct that however.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use ^2.0@dev|^2.0 then ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes no difference, it still opens the dependency to dev versions.

in the cmf, we preferred to use the minimum-stability during development and remove that before releaseing (when the dependencies hopefully have stable versions around). actually keeping minimum-stability can reveil accidental BC breaks in the dependencies. as it only affects composer run in this repository and not the including project, i find it cleaner than adding @dev into dependencies. but if somebody already starts using this, they need to include all our deps explicitly or also set minimum-stability in the project to end up with something installable. so really not sure which is the more elegant approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO adding @dev to some dependencies is cleaner because explicit, and seems to make Composer faster, probably because it reduces possibilities.

that makes no difference, it still opens the dependency to dev versions.

Maybe it is best to wait then, that way we don't forget to remove this @dev when a stable release is out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that @dev is cleaner than the minimum-stability. Please note that the same rules apply to the tags as to the min stability (both are root-only).

In the CMF, I switched to min stability because there were a lot of dependencies that we don't really depend on that needed a dev stability (because of deps of deps).

"symfony-cmf/resource-rest-bundle": "^1.0@dev"
},
"require-dev": {
"jackalope/jackalope-jackrabbit": "~1.0",
"symfony/phpunit-bridge": "~2.7|~3.0",
"symfony/security-acl": "~2.4|~3.0",
"fabpot/php-cs-fixer": "~0.1|~1.0"
"jackalope/jackalope-jackrabbit": "^1.0",
"symfony/phpunit-bridge": "^2.7 || ^3.0",
"symfony/security-acl": "^2.4 || ^3.0",
"fabpot/php-cs-fixer": "~0.1 || ^1.0"
},
"provide": {
"sonata-project/admin-bundle-persistency-layer": "1.0.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": { "Sonata\\DoctrinePHPCRAdminBundle\\": "" }
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.x-dev"
}
}
}