-
Notifications
You must be signed in to change notification settings - Fork 24
Add composer template #15
Add composer template #15
Conversation
@xtreamwayz |
template/composer.json
Outdated
"type": "library", | ||
"license": "BSD-3-Clause", | ||
"keywords": [ | ||
"http", |
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.
I would replace these lines with a short description like:
"keywords" : [
"<individual keywords for current project>"
],
template/composer.json
Outdated
} | ||
}, | ||
"require": { | ||
"php": "^5.6 || ^7.0" |
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.
Should we change order also here, to have first 7.0
?
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.
Don't know. I think in every project it's the lowest PHP first at the moment.
template/composer.json
Outdated
"issues": "https://github.com/zendframework/<project-name>/issues", | ||
"source": "https://github.com/zendframework/<project-name>", | ||
"slack": "https://zendframework-slack.herokuapp.com", | ||
"forum": "https://discourse.zendframework.com" |
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.
Should we have here link to the main page of forum or maybe specific category there?
https://github.com/zendframework/zend-expressive/blob/master/composer.json#L19
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.
If a category exists, then we should use it.
template/composer.json
Outdated
"type": "library", | ||
"license": "BSD-3-Clause", | ||
"keywords": [ | ||
"http", |
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.
Maybe we should have here also zf
or zendframework
keyword?
template/composer.json
Outdated
"test": "phpunit --colors=always", | ||
"test-coverage": "phpunit --coverage-clover clover.xml" | ||
} | ||
} |
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.
Please add empty line at the end of the file.
template/composer.json
Outdated
"php": "^5.6 || ^7.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^6.0.8 || ^5.7.15", |
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.
I would update these version to the latest: ^6.2.3 || ^5.7.21
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.
I agree, however PHP Unit updates twice a month or so. It should not be the goal of this template to keep track of PHP Unit releases.
template/composer.json
Outdated
"type": "library", | ||
"license": "BSD-3-Clause", | ||
"keywords": [ | ||
"<individual keywords for current project>" |
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.
Maybe we should have here some common keywords like zf
or zendframework
?
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.
Good question. The keywords are used at searching and filtering. Maybe is "zend" as mark / brand also interesting?!
template/composer.json
Outdated
@@ -0,0 +1,55 @@ | |||
{ | |||
"name": "zendframework/<project-name>", | |||
"description": "<project-description>", |
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.
My suggestion:
"description": "<project description, the same like the repository description>",
- Add default keywords - Add possible forum categories - Update PHP Unit versions - Add empty line at end of file - Update description
> It is recommended to omit this field and have it just default to > `library`. @see https://getcomposer.org/doc/04-schema.md#type
template/composer.json
Outdated
@@ -2,7 +2,6 @@ | |||
"name": "zendframework/<project-name>", | |||
"description": "<project description, the same like the repository description>", | |||
"homepage": "https://docs.zendframework.com/<project-name>/", | |||
"type": "library", |
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.
Good catch! 👍
@xtreamwayz what about adding: "config": {
"sort-packages": true
}, https://github.com/weierophinney/hal/blob/master/composer.json#L15-L17 |
I was thinking about |
Currently version constrains are written in different ways:
According to the composer docs it doesn't matter how you write it?
So what to do? |
Right, because:
I prefer a simple and intuitive reading: |
I assumed that the So, the main thing is that we are consistent. I agree with @froschdesign that latest last makes sense, as the constraints are then ordered. |
LGTM 👍 |
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.
Since the template is for new packages, we should push the PHP and PHPUnit constraints higher.
All else looks good.
"docs": "https://docs.zendframework.com/<package_name>/", | ||
"issues": "https://github.com/zendframework/<package_name>/issues", | ||
"source": "https://github.com/zendframework/<package_name>", | ||
"rss": "https://github.com/zendframework/<package_name>/releases.atom", |
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.
I find it funny that we use an Atom feed for the RSS item. 😄 That said, it's the only appropriate location.
template/composer.json
Outdated
"forum": "https://discourse.zendframework.com/c/questions/<components|expressive|apigility>" | ||
}, | ||
"require": { | ||
"php": "^5.6 || ^7.0" |
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.
For new packages, this will be simply ^7.1
, in which case, we can change the PHPUnit constraint to simply ^6.2
.
Thanks, @webimpress! |
??? |
lol, thanks @xtreamwayz 👍 👍 👍 |
@xtreamwayz I typed the wrong issue identifier when I wrote that! (I use gh from the command line for a number of tasks) THANK YOU, Geert! |
As discussed in several communication channels, there is no clear path on how the composer.json file should look like these days. There have been many changes which were not communicated to all maintainers and contributors in a central place. This PR adds a composer.json template to provide that central communication to everyone involved.