Skip to content
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

Support for mono repo #119

Open
SAGARSURI opened this issue May 16, 2024 · 3 comments
Open

Support for mono repo #119

SAGARSURI opened this issue May 16, 2024 · 3 comments

Comments

@SAGARSURI
Copy link

SAGARSURI commented May 16, 2024

Hey,
I have a mono-repo setup with around 100+ local packages. Can you provide a solution on how to have a single dart_dependency_validator.yaml across the project?

@devilbuddy
Copy link

Just being able to pass exclude/ignore on command line instead of via per-package yaml configuration would go a long way.

@matthewnitschke-wk
Copy link
Contributor

Configuring options via cli args seems like a good solution to this, but I can't commit to any timeline on when this could be implemented. I'd be happy to review something if you'd like to take a stab at what that would look like

One immediate workaround could be to symlink to a root dart_dependency_validator.yaml file from within each of the nested local packages. That way updates to the root, would automatically be reflected in each of the nested packages

@renefloor
Copy link

I wonder if there is any plan to support dart workspaces

It's still quite early, but I expect this to become the standard for mono-repos very soon. Current Flutter stable already supports dart packages and I expect the next stable to support flutter packages as well.

When creating a workspace you add a pubspec.yaml in the root of a mono repo. In the pubspec.yaml of the package you add resolution: workspace to indicate the dependency resolution should happen on the workspace level instead of the package level. The result is that the package won't have a pubspec.lock file or a separate analyzer context.

When running the dependency_validator in a workspace package you will get the following error:

No .dart_tool/package_config.json file found, please run "pub get" first.

That's because the .dart_tool folder is missing some files
image

The workspace_ref.json indicates the root of the workspace.

The dependency_validator should validate how you define dependencies on the workspace level, for example if you allow pinned dependencies, but it should still validate unused/missing and under/over promoted dependencies on the package level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants