Closed danilofuchs closed 3 years ago
I just read the documentation and Dart does not recommend commiting pubspec.lock for packages anyway, so this is a non-issue.
However, I do believe Melos should be aware that git references is an important thing for large organizations
melos replaces the git references in the pubspec.lock file with path references:
This is because that package exists locally in your workspace - this is the core design of how melos functions. You may have some luck with melos bootstrap --ignore="ebanx_logger"
Context
We are using Melos to organize our private Flutter components monorepo.
Dependant projects use git references to securely obtain the packages like this:
Problem
When a package depends on another internal package, we cannot set a path reference as any external project which depends on the root package will not be able to resolve the paths.
So, we decided to set git references on all internal packages, expecting melos to correctly symlink the packages for us (as they do for pub.dev packages). This would make it transparent to both developers (library and app developers).
However, when we run
melos bootstrap
, melos replaces the git references in the pubspec.lock file with path references:This works for the library developer, but breaks for the app developer.
Workaround
To avoid this issue, we are considering not commiting pubspec.lock on our packages, the app developers should lock their dependencies instead.