Proposal: Introduce a separate repositories-dev section in composer.json
#12693
rdehnhardt
started this conversation in
General
Replies: 1 comment 3 replies
-
|
This has a huge risk that your composer.lock file is unusable for production installs. A |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Category
Ideas
Content:
Hello Composer community and maintainers,
I'd like to propose a discussion about potentially introducing a separate section for development-only package repositories, such as
repositories-dev, alongside the existingrepositoriessection incomposer.json.Currently, the
repositoriessection is global, meaning all listed sources are consulted for both production (require) and development (require-dev) dependencies.Problem/Context:
While the current behavior is generally acceptable, it presents challenges, particularly in large projects or monorepos where we often use
type: "path"repositories for local package development.repositoriessection can lead to unnecessary metadata or potential confusion about source availability in production/CI environments, even if the dependencies are correctly managed underrequire-dev.repositories-devsection would clearly communicate that certain repositories (especially local ones liketype: "path") are only relevant during development cycles and should be ignored entirely when runningcomposer install --no-dev.Proposed Solution:
Introduce a new, optional section,
repositories-dev, that would function identically torepositories, but only be active when development dependencies are installed (i.e., when--no-devis not used).{ "repositories": [ { "type": "vcs", "url": "[email protected]:owner/repository.git" }, ], "repositories-dev": [ { "type": "path", "url": "../packages/...", "options": { "symlink": true } } ] }This change would benefit the community by:
Improving Clarity: Making the intent of local development setups more explicit.
Encouraging Best Practices: Simplifying the separation of concerns between production and development package sources.
What are the community's thoughts on this proposal, potential implementation challenges, or known reasons why this structure has been avoided so far?
Thank you for your time.
Beta Was this translation helpful? Give feedback.
All reactions