zendframework / maintainers

Contributors and maintainers information for Zend Framework.
BSD 3-Clause "New" or "Revised" License
50 stars 26 forks source link

Add composer template #15

Closed geerteltink closed 6 years ago

geerteltink commented 7 years ago

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.

froschdesign commented 7 years ago

@xtreamwayz You are too fast! 😉 I had already written a new issue report, but your PR is much better!

michalbundyra commented 7 years ago

@xtreamwayz what about adding:


"config": {
  "sort-packages": true
},

https://github.com/weierophinney/hal/blob/master/composer.json#L15-L17

geerteltink commented 7 years ago

I was thinking about sort-packages as well. I'm not sure how that works out with existing dependencies. It's added to the expressive skeleton as well. It does make it easier to lookup dependencies when they are sorted.

geerteltink commented 7 years ago

Currently version constrains are written in different ways:

According to the composer docs it doesn't matter how you write it?

When you write a version constraint, it may reference a specific tag (e.g., 1.1) or it may reference a valid range of tags (e.g., >=1.1 <2.0, or ~4.0). To resolve these constraints, Composer first asks the VCS to list all available tags, then creates an internal list of available versions based on these tags. In the above example, composer's internal list includes versions 1.0, 1.0.1, 1.0.2, the beta release of 1.1, the first and second release candidates of 1.1, the final release version 1.1, etc....

When Composer has a complete list of available versions from your VCS, it then finds the highest version that matches all version constraints in your project.

So what to do? "lowest || highest" vs "highest || lowest".

froschdesign commented 7 years ago

…it doesn't matter how you write it?

Right, because:

…finds the highest version…

I prefer a simple and intuitive reading: "lowest || highest"

weierophinney commented 7 years ago

I assumed that the || operator worked as it does in most programming languages, choosing the first to match. However, when I consider it from a practical point of view, it will use this to determine what set of packages are valid, so it can choose the latest based on the requirements of other dependencies.

So, the main thing is that we are consistent. I agree with @froschdesign that latest last makes sense, as the constraints are then ordered.

froschdesign commented 6 years ago

LGTM 👍

weierophinney commented 6 years ago

Thanks, @webimpress!

geerteltink commented 6 years ago

Thanks, @webimpress!

???

michalbundyra commented 6 years ago

lol, thanks @xtreamwayz :+1: :+1: :+1:

weierophinney commented 6 years ago

@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!