-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Support for Composer package in sub-directory of GitHub repo #472
Comments
…r to get around Composer/Packagist issue: composer/packagist#472
This is very unlikely because it'd be kinda hard to find those files via the github API unless we do a full listing of all dirs and that'd slow down all our updates quite a lot. |
what about manually setting the path in a form on the packagist server? |
I have a multi language project too and moving the composer.json to the root of the git repository would break the project structure. I think that is not so difficult to allow us to provide some relative path inside the repository so packagist can find the composer.json if it is not on the root of the repo... |
Please reopen this issue. This restriction causes major headaches for both users and maintainers of composer projects. |
This would also help with MonoRepos such as symfony/symfony as the projects would not necessarily needed to be split up into single repositories. Using |
@buffcode given that packagist does not generate its own archives but relies on the github archives for downloads, downloading components directly from the mono-repo would not be possible. This would require a major change in the architecture of packagist to allow that. |
Time to start looking for better dependency management alternatives then. It is sad to see how composer is years behind from other systems like NPM in terms of features and flexibility |
I think it is important to allow having the composer-related files and directories in a project subdirectory, in order to avoid a root directory full of unorganized configuration files. Maybe it could be done using a composer.json directive or through some kind of form on Packagist. For example, on creating the package on Packagist, alongside with the remote repository URL the composer.json path could be asked too. |
Does this matter when a developer submits a specific package URL to Packagist manually anyway? Instead of:
we could just submit a subdir URL:
|
Probably an off-topic question but this seems to be about packagist. Is there any way to do this with composer with code from GitHub I have full control over? Meaning I can place the Composer has something like post install scripts I think. Maybe there is a way to do this for code that is actually NOT on packagist? Or maybe there is some workaround? I guess I could configure a package to install into |
This would be really great for monorepos e doesn't need to slow down anything if the |
Dang, and I was excited I could switch to GIT and won't need tons of readonly repos with my monorepo and tools to synchronize them. Maybe I will stay with Subversion as composer supports this feature with "package-path" (so it is not a new concept). |
it is possible with a little workaround: just place a composer.json similar to this one in the project root:
|
@zolex this might work when the project is in a sub-directory (and your package is only used as a template to start the project). But not for packages meant to be used as dependencies |
cause non private packagist.org does not support providing user defined location setting of composer.json see also: composer/packagist#472
other lang all support pub a subdir as a extention to package manager,such as java/node/python/.net,reallly need this feature. |
Hello @Seldaek :) |
agree |
1 similar comment
agree |
There is one way to achieve it, you can use .gitattributes files and you can define in that file those folders/files that you want composer to ignore at the time when someone requires the library in the project. |
Hello @djvickx , |
Hi @LLyaudet, I agree its not a true solution and it doesn't work for the sub directories in case of composer file is in a sub directory but its a work around atleast to remove files/folder on the same root level. |
Hello @djvickx, I understand your point of view.
You wanted to help, but the true solution is just to add the feature that is needed. Best regards, |
Hi @LLyaudet, |
Hi @LLyaudet To support this function by Packagist.org, changes will be required from GitHub API. Currently zipball GitHub api does not allows downloads source code archives for specific path prefix in git repository. But Packeton in first clone git repository to local cache and use command |
Hello @vtsykun
I don't have all the elements to see if you're right or if you're wrong.
Easy solutions exist, no solution is from people don't want some solutions. Best regards, |
The points here are invalid at best. Many other package repos support uploading the package directly from e.g. Github Actions. So not supporting this is plain naiveness |
I have a multi-language project in a GitHub repo (https://github.com/google/gtfs-realtime-bindings/) that has a php/ subdirectory containing a composer.json file. Best I can tell, there is no way to generate a Packagist package from my repo given this configuration. Any chance this is a scenario you would consider supporting?
The text was updated successfully, but these errors were encountered: