Skip to content
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

Allow relative local directory for repositories of type composer #11519

Closed
helhum opened this issue Jun 22, 2023 · 3 comments · Fixed by #11526
Closed

Allow relative local directory for repositories of type composer #11519

helhum opened this issue Jun 22, 2023 · 3 comments · Fixed by #11526
Labels
Milestone

Comments

@helhum
Copy link
Contributor

helhum commented Jun 22, 2023

For a custom mono repo approach, I'm currently generating packages.json file in a local directory.
I would love to be able to specify the path to this repository relative to the root composer.json similar to repositories of type path:

{
    "repositories": [
        {
            "type": "composer",
            "url": "./path/to/local-dir/"
        }
    ]
}

Composer repositories though, only allow URLs. I could specify a file:// URL, but then the specified path needs to be an absolute file path:

{
    "repositories": [
        {
            "type": "composer",
            "url": "file:///absolute/path/to/local-dir/"
        }
    ]
}

Is there anything conceptually ore security wise that is a blocker to allow local relative file system paths for repositories of type Composer?

If not, I'm happy to create a PR to allow it.

@Seldaek
Copy link
Member

Seldaek commented Jun 22, 2023

Ah weird I thought this supported relative paths, but indeed it seems like it doesn't. I think it should be fine to allow it..

@Seldaek Seldaek added this to the 2.6 milestone Jun 22, 2023
@helhum
Copy link
Contributor Author

helhum commented Jun 23, 2023

Cool, thanks. Then I'll try to provide a PR for that

@helhum
Copy link
Contributor Author

helhum commented Jun 26, 2023

Added support for local file paths in a very simple way, which I assumed has the lowest impact. Let me know in the PR if this is fine and whether I should add some docs or tests for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants