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
The idea is as to install Vendor.Package to package if aura-package <pac... #24
Conversation
…package-name> provided and download and install 3rd party packages to include folder when aura-include is provided
|
I am interested to discuss about this . The base idea is as of the topic https://groups.google.com/forum/?fromgroups#!topic/composer-dev/GogrK7F6uLc Which helps to install all the packages for the framework which is system https://github.com/auraphp/system Which contains a package folder . |
|
Your pull request is correct. Only packages with the type Let me know if that makes sense and I'll merge this in. Thanks @harikt! |
|
@shama hm . For eg lets consider composer.json of Aura.Router : https://github.com/auraphp/Aura.Router/blob/master/composer.json The Aura.Router is exactly a library which can be used independently . But when its used inside the system folder I need it to download it at package folder . Not just Aura.Router , but also for some more packages which are Aura specific . Is there a way we can work on for composer ? So how can I make it happen that way ? Thank you . |
|
Yes, if this is merged you would just set the type of Aura.Router to The only part I am unsure of is the autoloading. Installing packages to a folder other than If Aura is or can use the |
|
@shama in that case what will happen if I need to download Aura.Router as a library? I agreed that when the type is changed to But here there are two options I need . Probably you didn't get it completely . Aura.Router can be used standalone or if I am using aura as a framework , I need to download it in package folder. In that case Aura.Autoload will do the work of autoloading . But if its installed just as a library I need composer to autoload it . |
|
Ah I see. Thanks for clarifying. Then you would need to use the {
"require": {
"composer/installers": "*"
},
"extra": {
"installer-paths": {
"package/Aura.Router/": ["aura/router"],
"package/Aura.Web/": ["aura/web"],
}
}
}That would also mean the types in this PR wouldn't be necessary. |
|
@shama one more thing I feel seems good, if its merged we can make use of other Aura packages like Hari.Contact etc . So I can just issue something like that . |
|
That won't work. AFAIK, composer only works off the composer.json. If you added a composer.json to Hari.Contact and installed by adding One use of composer/installers that might benefit Aura is the package name inflection. Do all Aura packages follow the convention We could add the type |
Yes. The naming convention is PSR-0 related. Regarding the dot separator: PSR-0 allows for underscores in the namespace portion, where those underscores are not converted to directory separators. (Underscores in the classname portion are converted to directory separators.) This means that we can't use an underscore as a separator between the vendor name and the package name; one would not be able to tell where the vendor name ended and the package name began. Likewise, slashes, colons, and backslashes won't work because they are already directory separators in different filesystems (and for other reasons). Thus, we use the dot as the separator, to delineate between the vendor name and the package name. Regarding casing: We use the same case in the package names as the namespace; so, Aura.Uri is a package using the namespace Aura\Uri. That means less converting back-and-forth between expected package names and expected namespaces. |
|
@shama what I was thinking was if I have a composer.json in Hari.Blog and later I add https://github.com/harikt/aura-system/blob/master/composer.json will it download automatically without me specifying the So the base idea is I just can add the required onces other than Aura.Packages and the remaining all other Vendor packages which are dependent on aura can be added in a single line. Qn : Do all Aura packages follow the convention Vendor.Name? eg Hari.Contact, Hari.Blog, Shama.MyAuraPackage, etc. Ans : Yes all Aura packages follow Vendor.Package format and resides in package folder inside the system . Qn : We could add the type aura-library that would install to vendor/{$vendor}.{$name}/ and capitalize the first letters of Vendor and Name. I feel I have created the system and is at http://packagist.org/packages/hari/aura-system So once I download system from https://github.com/harikt/aura-system and run composer.phar install I feel it will download all files to package/Aura.Package . I want to test, but as I am running on RC 5.4 , I am not able to do :) . Thank you . |
|
@harikt What you have in hari/aura-system looks correct. We can implement If the convention for Aura is all packages should go into the Sound good? We could change this after some trial as well. Only types marked in bold in the README are guaranteed to not change. |
|
Hi @shama Thank you for your quick reply . I will discuss with folks and say . Lets wait for a while . |
|
Hey @shama I did tried as you mentioned . But it seems its not downloading to package folder as mentioned. I am not sure whether this is the real behaviour or not . See the composer.json , after running install and later the ls output . |
|
@pmjones I feel we should stick on to composer-installer so that the packages will not be downloaded else where like two folders as of now ( aura and Aura ) and also as you mentioned earlier when we download from github repo the name of the package will be So the goal what we thought and named the package will break which I am not really interested . We will rename the And all the @auraphp and Thoughts on this ? |
|
@harikt What you did should work. I'll give it a shot later and get back to you. |
|
ok I will wait . But this didn't happened for me . |
|
@shama any progress ? |
|
Seems like you are doing a lot of stuff to bend around how composer should work. Is there any reason for alle the libraries to not be in |
|
@henrikbjorn yes this post is a good reference what exactly the framework is doing https://groups.google.com/d/topic/auraphp/QhIQVLd3S3g/discussion |
|
@harikt Okay figured out the problem. Two things:
The following example composer.json example will override the package and use the {
"name": "hari/aura-system",
"minimum-stability": "dev",
"repositories": {
"aura-unofficial": {
"type": "package",
"package": {
"type": "cakephp-plugin",
"name": "aura/autoload",
"version": "1.0.0-beta3",
"source": {
"url": "git://github.com/auraphp/Aura.Autoload.git",
"type": "git",
"reference": "origin/master"
},
"require": {
"composer/installers": "*"
}
}
}
},
"require": {
"composer/installers": "*",
"aura/autoload": "1.0.0-beta3"
},
"extra": {
"installer-paths": {
"package/Aura.Autoload/": ["aura/autoload"]
}
}
}What we should do from here is:
Then you can install without needing the |
|
Aura types: You can change the Thanks! |
|
Thank you for the help. A few questions : 1 ) Each of those Aura packages don't require composer/installers in their composer.json. So they are not using composer/installers. Which is why it's installing to the default Composer location. They each need to have "require": { "composer/installers": "*" } in them. If we add "composer/installers" in those Aura packages, does that mean composer will not be able to autoload a single package . As I said if I am going to use Aura.Router only , currently composer can autoload . What I understand is if we add the 2 ) Since an Aura type currently doesn't exist in composer/installers each of those packages would be ignored even if they require composer/installers. Because installers ignores any type not implemented, it never checks for the extra.installer-paths config (I guess I never considered anyone trying to use it on a type not implemented :). What I did was added a AuraInstaller in Yes your example works. The composer.json of mine is Some doubts is 3 ) currently for aura/autoload and aura/cli we have placed I am not really familiar the internal working . Does that means composer is downloading package via git and the user needs git to download ? 4 ) For each package aura/autoload , aura/cli etc though we have a composer.json and as its not having the wordings Is there a way that composer knows when we can get rid of this via composer itself understanding checking Else what I am seeing is we need to go and edit the version at two places , and in future this may become tedious :) . One at the require itself and the other at the aura-unofficial itself. for the time please keep this open . @pmjones is trying to make it work the way composer is working. That means it will download all aura packages in vendor folder as default composer is doing . I am not sure how much fruitful it is for we have a blocker in packagist composer/packagist#186 . And I am not satisfied with the current composer.json ( of mine ) for we need to add more lines as in aura-unofficial as we already have a composer.json but for we have'nt kept the composer installer for its really a library , and can be autoloaded individually . Thank you once again for your hard work on this. I appreciate. |
|
So the horrible composer.json for aura may look like https://gist.github.com/3243564 |
|
You wouldn't want to use the I may still be confused but I think the issue is this: If that is the case then I think you shouldn't use Composer to build the system framework. I think git submodules would be a better choice for that. Or build your own Aura Composer Installer that handles that use case. |
|
I don't mind helping you to build an Aura Composer Installer either. They made it fairly easy to do. It would install each to the |
|
Yes you are correct. Thank you. |
|
@shama did you got any progress ? Else I am interested to know how I can do or how I can achieve it . |
|
@harikt Just published an installer for Please test and let me know if you have any questions. Let's move this conversation over to shama/aura-system-installer#1 as well. Cheers and closing. |
|
A BIG Thanks :) |
...kage-name> provided and download and install 3rd party packages to include folder when aura-include is provided
I feel this will not work :P .
The idea is to keep a
composer.jsonin https://github.com/auraphp/systemI am also wondering if we are adding to other packages which can be used independently will that also download in package folder ?
Which should go to the normal vendor directory of the user choosen .
https://github.com/auraphp/Aura.Framework/blob/master/composer.json#L33