Developing Compass Modules Locally

Follow these steps to develop a Compass module locally.

1. Create a directory for packages

For example:

mkdir packages

2. Clone the package you want to develop

git clone git@github.com:noardcode/compass-ecommerce.git packages/noardcode/ecommerce

3. Add a local path repository to your composer.json

At the top of the repositories section, add:

{
    "type": "path",
    "url": "packages/noardcode/ecommerce",
    "options": {
        "symlink": true
    }
}

4. Update Composer

Run the following command to link the local package:

composer update noardcode/compass-ecommerce

5. Switch to a feature branch or create a development branch

git checkout -b feature/your-feature-name

6. Start developing

Make your changes locally. Your changes will be immediately reflected thanks to the symlink.

7. Commit and push

git add .
git commit -m "Describe your changes"
git push origin feature/your-feature-name

8. Merge changes (after approval)

Merge your feature branch into the target branch (e.g., main, develop, etc.).

9. Clean up composer.json

Remove the path repository entry you added earlier.

10. Run Composer update again

Switch back to using the package from the source repository:

composer update noardcode/compass-ecommerce

✅ You're done!