franzliedke / studio

A workbench for developing Composer packages.
MIT License
1.14k stars 73 forks source link

Should a studio loaded package take precedence over composer vendor package? #42

Closed weotch closed 8 years ago

weotch commented 8 years ago

In my use case, I want to workbench a package that is being consumed by a project already. My expectation is that, by loading it via Studio, the PSR-4 classes of the workbenched package will be get loaded instead of those in the composer vendor directory. This isn't what I'm observing, though. Is my expectation wrong here?

franzliedke commented 8 years ago

Which version are you using?

weotch commented 8 years ago

0.9.5

franzliedke commented 8 years ago

Hey, sorry for not getting back earlier.

Why did you have duplicate classes in the first place?

By the way, I am revamping how this package works. In the next big release, when you load a package via Studio, the consuming package will symlink its location on disk into the vendor folder instead of messing with the generated autoloader files.

We do this by hooking into Composer's path repository mechanism (which you can use directly until I fix the remaining implementation issues with the new approach).

weotch commented 8 years ago

I end up with duplicate classes because I'm workbenching a package that is already being used by my app. For instance, say I am working on a project and I realize that there is a bug in a package it's using. What I want to do is use Studio to workbench the fork of that package where I work on the bug fix. For a time, I have a duplicate classes in /vendor and /workbench.

brokenhd commented 8 years ago

With the new approach you are talking about, does that mean that Studio will be touching the composer.json file?

franzliedke commented 8 years ago

Nope, everything will be contained in the studio.json file. When Studio discovers that, it will automatically set up the paths defined therein as path repositories. Great for your local development, but you won't have to change your composer.json file (which would mess with other contributors or dependants) or remember not to commit the changes to that file.

weotch commented 8 years ago

Perf! Looking forward to it.

franzliedke commented 8 years ago

As stated above, this is fixed in master. We're just waiting for a Composer PR to be merged, then this can take off. ;)

weotch commented 8 years ago

:beers: