Skip to content

Expose a helper to import the autoloader no matter the depth of the monorepo packages #76

@adaliszk

Description

@adaliszk

Great work on this, it really does enable monorepo use-cases!

However, one issue I ran into is that all autoload imports needed to be adjusted. The main issue there is not the adjustment, but that if you containerize your workspaces independently, you need to maintain two distinct import paths or adopt your image to mimic the exact folder structure depth.

It would be really useful if a symlink of sort or a helper function would be exposed so that importing the autoload from the global vendor or the local vendor in dockerized environments would not need a custom solution.

The ideal solution to me would be to symlink the vendor/autoload.php, vendor/composer, and vendor/bin in each of the monorepo workspaces, that way importing or using any of the binaries would work.

An alternative solution I can think of is to expose a simple recursive method that would find the vendor folder until it hits a limit or the .git folder and resolves the actual path. While this is extra computation, its not that horribly lot to go through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions