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

Packages depencies with each other ? #7

Open
cyrilchapon opened this issue Jul 26, 2019 · 4 comments
Open

Packages depencies with each other ? #7

cyrilchapon opened this issue Jul 26, 2019 · 4 comments

Comments

@cyrilchapon
Copy link

What if the different packages have dependency on each other ?

Moving app to root will kill those dependencies before installing and resolving dependencies

@joeyfigaro
Copy link

Have identified same issue as @cyrilchapon – I've got one application in my monorepo with a handful of sibling/adjacent packages that it depends on. Application's deps can't be installed using this approach/buildpack.

@philipaarseth
Copy link

Did anyone of you find a solution to this problem?

@paulmelnikow
Copy link

Our environment looks like this:

unpublished-packages/first-dep
unpublished-packages/second-dep
unpublished-packages/third-dep
apps/first-app
apps/second-app

It's using npm, with relative file dependencies in each app's package.json.

The reason we're using a monorepo is to share code between the applications, so it would be helpful if this case were supported.

@paulmelnikow
Copy link

I'd propose the following solution here (as an alternative to #17):

  1. In this buildpack, when moving the content from APP_BASE to the new root, use cp -RL instead of mv. This has the effect of preserving all symlinks within APP_BASE.
  2. In the application, create a dependencies folder inside APP_BASE, with a set of symlinks pointing to the common packages living outside APP_BASE.
  3. In the application's dependency manifest, reference the dependencies through these symlinks (e.g. file:dependencies/my-lib, instead of file:../../libs/my-lib). Since this buildpack will have turned those symlinks into copies, the language-specific buildpacks should be able to resolve them.

This will also support transitive dependencies, so long as the following are adhered to:

  1. The dependencies are organized flat, in a single parent folder, and reference each other using e.g. file:../other-lib.
  2. The application keeps the symlinks flattened the same way in dependencies.
  3. The application dependencies folder includes a symlink for both the direct dependencies and their transitive dependencies.

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

4 participants