-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix: remappings with blue anchor (option 3) #520
Conversation
Co-authored-by: Romain Milon <rmilon@gmail.com> Signed-off-by: Quentin Garchery <QGarchery@users.noreply.github.com>
Note that if morpho-blue is twice a submodule of some repository, only a single version of morpho-blue will be used because of this remapping So it solves one problem, but not all |
Actually this solution has different consequences compared to #517: In #517, we are creating the convention that morpho-blue dependencies will only use a single remapping in an integrator's repository, essentially pinning morpho-blue's dependencies to a single version in the case where morpho-blue is twice a submodule of the repository In this PR, we are creating the convention that morpho-blue will only use a single remapping in an integrator's repository, essentially pinning morpho-blue to a single version in the case where morpho-blue is twice a submodule of the repository and that the integrator doesn't override the I think this PR is better, because 1 morpho-blue version goes with 1 version of its dependencies, but I just realized that this is a hard convention (unfortunately necessary): all morpho-blue-related remappings will be prefixed |
In addition, if we want to force the integrator to pin If we don't do this, the integrator would be able to use 2 versions of morpho-blue but only a single version of its dependencies: the one selected by forge automatically when building remappings = the last remapping |
ce3686b
Wdyt about this @QGarchery? |
I don't know, are you sure that it always forces them to use a single version ? What if the file they use does not import other local files ? What if morpho-blue's versions are compatible in the sense that importing wrong files still compiles ? It feels a bit like a hack (a nice one !), and I don't think it's our responsibility to ensure that integrator don't have multiple versions of morpho-blue. Plus I like to have the flexibility to use relative imports (they read and interact nicely) |
That is correct: they can always use relative imports The solution of the |
It still has the issue that if a project imports morpho-blue twice, then the same version of the dependencies will be used for both |
This option is more verbose than option 2 in the imports (who cares though if it is understandable ?), but it has the following benefits:
@blue
corresponds to themorpho-blue
folder. I find it unexpected to refer to@blue
for the dependencies of blue.@blue/src
can refer to the files defined by themorpho-blue/src
folder, same thing with@blue/test