Closed oravecz-jpmc closed 6 months ago
Is this your root pubspec (where only the melos dependency should be)? Can you post your full pubspec and melos file.
I can see how a root pubspec might only include melos.yaml
if I was building a library, but this is a UX project with different app features organized in a monorepo manner.
Even running melos clean
fails with the same error
I can see how a root pubspec might only include melos.yaml if I was building a library, but this is a UX project with different app features organized in a monorepo manner.
I think you might have misunderstood me, you still need a root pubspec, but you shouldn't have any package/app in the root of your monorepo where the workspace is defined. You can read about the recommended structure here: https://melos.invertase.dev/getting-started#recommended-directory-structure
That goes a bit beyond a recommended
structure. :) You mean it is a required structure, or more succinctly, if you use Melos, you cannot have a root pubspec.yaml with dependencies other than melos
, and thus you cannot have the typical Flutter structure where a lib
folder contains your main UX code.
I'll try that structure and see how it works for me.
if you use Melos, you cannot have a root pubspec.yaml with dependencies other than melos,
Yes, that is correct, and monorepos in general are not recommended to have projects in the root of the repository.
... and thus you cannot have the typical Flutter structure where a
lib
folder contains your main UX code.
Of course you can, but since it is a monorepo it should live within the project that it belongs to (and no project should live in the root, since that is where the monorepo workspace is defined), for example if you have an app named your_app
it could look like this:
my_project/
├── apps/
│ └─ your_app/
| ├─ pubspec.yaml
| └─ lib/
├── melos.yaml
├── pubspec.yaml
└── README.md
The recommended Flutter structure is per app/package/plugin, not per repository.
@oravecz-jpmc if that didn't solve your issue, feel free to just write in here and I'll re-open it :)
Is there an existing issue for this?
Version
5.1.0
Description
Melos throws an error if I attempt to override a package version specified as an override in my
melos.yaml
bootstrap config.pubspec.yaml
melos.yaml
Error
Steps to reproduce
melos.yaml
for a package that does not exist in Pubmelos bootstrap
Expected behavior
I would expect the version override in
melos.yaml
to take priority over any settings in the packages in my monorepo.Hopefully, I am understanding the documentation regarding bootstrap config and what a "shared version" is.
Screenshots
No response
Additional context and comments
We run a private repository, and this package is a work in progress. I have not yet published it to our internal Pub repository.