-
I have my app split into several packages using melos. I don't plan to publish one of those packages individually, as I use melos only for abstraction reasons. Now, one of the third party packages depends on a newly published package on pub.dev, that has the same name as my local package from path. As a result version solving is failing, since flutter is assuming its the same package (one hosted, one from path). I explicitly set 'publish_to: none' for the corresponding package. Is there a way to keep on using my local package using melos, without renaming it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
In short, no. The reason is not specific to Melos, though. Within the dependencies of a package (including transitive ones), all package names must be unique. Otherwise, package imports would be ambiguous. I'm wondering why version solving is failing. I would expect compilation to fail. How are you depending on the local package? If you are using path dependencies like below, Melos does not even do anything to override dependencies. dependencies:
local:
path: ../local For purely local packages that never get published, you could use this shorter syntax. dependencies:
local: any With this, Melos would add the overrides for you, while path dependencies are just left as is. |
Beta Was this translation helpful? Give feedback.
In short, no.
The reason is not specific to Melos, though. Within the dependencies of a package (including transitive ones), all package names must be unique. Otherwise, package imports would be ambiguous.
I'm wondering why version solving is failing. I would expect compilation to fail. How are you depending on the local package? If you are using path dependencies like below, Melos does not even do anything to override dependencies.
For purely local packages that never get published, you could use this shorter syntax.
With this, Melos would add the overrides for you, while path dependencies are just left as is.