-
Notifications
You must be signed in to change notification settings - Fork 4
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
Control which local dependencies are installed dev vs. stable versions #3
Comments
As I commented in #4 I'm working on a Drupal 8 distribution architecture and I will suggest here a way to decide which packages to symlink and which ones to install from composer. From the both options pointed out in this issue I prefer the second, keeping it local to the package instead of using the global
But as I do not like to have local development related stuff in Git I don't like to put it into the For this package my suggestion therefore is to use a root
|
This is exactly how I mean it: https://www.reddit.com/r/PHP/comments/4lq9z2/whats_your_workflow_for_developing_with_composer/d3q6hjn/ |
I occasionally run into two situations where I didn't want to have my local package symlinked (I fixed it, by fixing the issue on the referenced package), though my own input for this is very rare. Thanks for describing your situation. Though the question remains, at which location do I define my local strategy (other than in global So, instead of using |
First of all, I'm not a composer developer but just a user. So I have no knowledge about its internals and how it works etc. So to answer your question
the idea is that everything defined in the
For
I've read somewhere that for repository items there exists a And yes, playing with stability flags is bad. But sometimes you have to. Think about finding a bug or getting a bug report and your analysis nails it down to one 3rd party contrib module you use. Then you find out that the latest release (which you are using) is quite old but there is a current dev version, and you don't find a corresponding issue. Then you might want to test if the bug is solved by the latest dev version or still exists. If it solves the bug you might get more information by looking on the diff between working and not working version and possibly find the issue with knowledge about the commit fixing it. Then you have to decide to either apply a patch fixing the bug, using the dev version of that module until its next release or do something else. This situation is not that rare as you might expect, especially if your customer needs exotic features which require exotic and less actively maintained modules where it takes lots of months until the next release. Side information: All work in the organization behind the project which is bringing me here is voluntarily, so I do it in my spare time and might need a bit longer to reply. |
Having a Well, what I'm looking for is some values that you'd define globally and you might overwrite at a given repo. With this plugin I globally define my local packaes and each of my repos will use that config to symlink to them. So which configuration I would like to overwrite at a repo, which is configured globally. E.g. I configured the package |
At the moment, all locally found packages are symlinked instead of being installed from composer. This might not be ideal, e.g. stable packages (which exists as dev versions locally) shouldn't be symlinked. There needs to be a mechanism to control this kind of installs.
Possible locations for config options (maybe both?):
.composer/config.json
: Make a new node underconfig.localdev.options
and another one forconfig.localdev.paths
to separate them accordinglyextra
section of each rootcomposer.json
can some config for localdev that overwrites a global configuration.Possible strategies to decide whether the dev version will be symlinked or the latest dev version from packagist will be installed:
dev-master
) than a symlink will be created, if the version refers to a major version (e.g.~2
) than the latest stable from packagist will be installedrequire-dev
overwritesrequire
section. That would mean, therequire
section is for production andrequire-dev
for development environment.require
can consists of sth like this:"Symfony/Finder": "~2"
and will be overwritten inrequire-dev
with"Symfony/Finder": "dev-master"
. When the install/update happens in dev-mode and the package is available inrequire-dev
section, than a symlink will happen. Anyway normal install follows. Can also be coupled with strategy (1)Config options can be used to control the strategies.
The text was updated successfully, but these errors were encountered: