6

When I am developing a JavaScript module, I can use npm link to install my local development version in local projects that use the module as a dependency. This is a great workflow.

It's not developing in place, which I think is a less good than TDD, but its a way easier way to do integration testing and manual QA, I think.

In Composer, I can, if possible, force a package to install using git, so then I can develop in place. Nice, but not great.

Short version of question: Can I tell composer to temporarily install a dependency from a git repo/ set of files in my local file system and control the link from the composer CLI?

JPollock
  • 3,218
  • 4
  • 26
  • 36

2 Answers2

5

You could use a path repo in your composer.json.

This will install a symlink instead of a git clone in your vendor folder.

This is exactly what already mentioned franzl/studio package does under the hood.

Edi Modrić
  • 2,240
  • 1
  • 15
  • 18
1

I created my own plugin for this

https://github.com/SanderSander/composer-link

It doesn't alter your composer.json or lock file.

Sander Visser
  • 4,144
  • 1
  • 31
  • 42