Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adaliszk opened this issue Sep 10, 2024 · 0 comments

Comments

@adaliszk
Copy link

adaliszk commented Sep 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant