ponylang / pony-stable

:horse: A simple dependency manager for the Pony language.
BSD 2-Clause "Simplified" License
134 stars 18 forks source link

Add the "add" comand. #14

Closed hibnico closed 8 years ago

hibnico commented 8 years ago

The 'install' "add" command takes care of modifying properly the bundle.json, even create one if none exists. And after the modification of the bundle.json it is launching the fetch.

hibnico commented 8 years ago

I just saw that I have missed the support for 'subdir' for github. So it needs a little more work.

hibnico commented 8 years ago

PR updated, but now needs https://github.com/ponylang/ponyc/pull/1115 to be accepted

jemc commented 8 years ago

FWIW I think I'm not a big fan of calling this install, as I find it confusing in this context. When I think of installing something, I think of installing it globally on a system, and having it become integrated with that system.

I know npm uses the term install --save to mean this same thing, but I don't find it to be very intuitive here.

I would suggest calling it add.

jemc commented 8 years ago

Also, there are some style issues where the new code conflicts with the style of the current code, leaving a mixed style as a result. I will do a full review later (pending acceptance of your PR to ponyc), but some general style things I noticed in my quick glance through this:

hibnico commented 8 years ago
jemc commented 8 years ago

I saw some camel cased local variables

Can you point out where these are? I don't know of any in the codebase, but if they are there, they must have been contributed by someone else with me not catching it in review. If they're there, they should be changed.

I use Atom and it is removing spaces on blank lines. Trying to make the PR clean I reverted these removes from the existing code.

Yeah, a lot of folks have editors that make this assumption, unfortunately. If you want to fix it the easy way, you can run scripts/fix-whitespace stable/*.pony before committing to restore the expected whitespace.

hibnico commented 8 years ago

Can you point out where these are? I don't know of any in the codebase, but if they are there, they must have been contributed by someone else with me not catching it in review. If they're there, they should be changed.

I haven't found it in the current master, so it must be me which has modified some code and didn't remember it. So I saw myself changing the style thinking it was somebody else, looks like I have some double personality issue ! :p

jemc commented 8 years ago

Sorry, I forgot this was sitting stale - I forgot to come back to it after the options package was updated.

There are some name changes I'm not wild about here, like ProjectRepo and *ProjectRepo replacing BundleDep and BundleDep*. There are also some remaining style points to clean up.

However, rather than explaining in detail all the changes I'd want made, I think it's easier just to make them. I'm going to work on a branch that includes your commits, then merge that branch when it's done. If I use your branch as the base of mine (as I plan to do), GitHub should show this PR as being merged when I merge my branch.

hibnico commented 8 years ago

I introduced the concept of project repository as a facade to several kind of implementations of sources hosting. So the core of Pony Stable doesn't know the specifics of how sources are hosted in github. And adding support for a new repo, like bitbucket for instance, will be about implementing an interface and referencing it in the factory; so it would not be about touching a lot of files, and it would be typed so there is no way of missing to implement a command. I wanted to properly document it to better explain it but I forgot. I should have.

I also wanted to add a new command, "help", to document inline the commands. See https://github.com/nlalevee/pony-stable/tree/help/stable I don't mind much rewriting it. But should I still use your style of implementing commands ? Even if it will duplicate the switch on the kind of repo ?

hibnico commented 8 years ago

I just listened to the Pony Sync of the 7th of September. There was a very interesting discussion about how to correctly type things. It was hard to grasp every detail of it, especially at the end of the talk with Sylvan, about the "seek" exemple. But just to let you know that I have been working on yet another command, named "resolve". It still needs some work, and would also need some discussion to see if it really fits Pony stable philosophy. This feature in itself is off topic here, but the implementation needs the output of the git command, so it needs to use the process package, so it needs the AmbientAuth. So in order to not pollute the dependency API with specific things for git, the code handling git has to be an instance which would be constructed with the proper AmbientAuth. So even if parsing arguments or json and outputting the help are independent of the instance, that new resolve command will not. I don't know how this would affect the design you were discussing with Sylvan, but I just wanted to let you know that I would need an instance at some point.