π A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
I expect melos' shared-dependencies feature to be able to understand the path reference I've set for a given dependency and use it based on the reference of the melos.yaml file. So, if my local package is under packages/core/my_local_package, I want to be able to set something like the following and it will adapt the path value based on the folder the package using this dependency is
When using shared dependencies feature, where one of the dependencies is referenced using path relation, and considering a monorepo structure where we have multiple levels of folders with packages in each of those, we can't just copy-paste the path reference defined inside the melos.yaml file. For instance, consider the following scenario:
If I define a library foo to be shared between all of those packages:
# melos.yaml
# ...
command:
bootstrap:
dependencies:
my_local_package:
path: packages/core/my_local_package # this is clear but won't work for any package
path: ../core/my_local_package # this will only work for `package1` and `package2`
path: ../../core/my_local_package # this will only work for `feature_package1` and `feature_package2`
We can't get a path to set that would work for all packages with that local dependency.
Additional context and comments
We probably do something similar with melos bs while creating the pubspec_overrides.yaml file, and I'm not sure shared-dependencies is the best feature for this tbh
Is there an existing feature request for this?
Command
No response
Description
I expect melos' shared-dependencies feature to be able to understand the
path
reference I've set for a given dependency and use it based on the reference of themelos.yaml
file. So, if my local package is underpackages/core/my_local_package
, I want to be able to set something like the following and it will adapt thepath
value based on the folder the package using this dependency isReasoning
When using shared dependencies feature, where one of the dependencies is referenced using
path
relation, and considering a monorepo structure where we have multiple levels of folders with packages in each of those, we can't just copy-paste the path reference defined inside themelos.yaml
file. For instance, consider the following scenario:Folder structure:
If I define a library
foo
to be shared between all of those packages:We can't get a path to set that would work for all packages with that local dependency.
Additional context and comments
We probably do something similar with melos bs while creating the
pubspec_overrides.yaml
file, and I'm not sure shared-dependencies is the best feature for this tbh