Local development

One of the things we regularly need to do when developing our own packages is link the package to an existing project to see if it works in a real project.

A shortcut for this is putting the following command as an alias in your ~/.zshrc file. (credit to Caleb Porzio and Johannes Pichler)

composer-link() {
  repositoryName=${3:-local}

  composer config repositories.$repositoryName '{"type": "path", "url": "'$1'", "options": {"symlink": true}}' --file composer.json
  composer require $2 @dev
}

This command is used like this:

composer-link /path/to/chief vendor/package
Last Updated: 7/24/2019, 10:27:51 AM