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

feat: add support for melos_overrides.yaml + command/bootstrap/dependencyOverridePaths #410

Merged
merged 11 commits into from Dec 20, 2022

Conversation

hacker1024
Copy link
Contributor

Description

This adds two related features related to the feature request #409.

  1. Adds a melos_overrides.yaml file, that can be used to override any field in melos.yaml (for making local, untracked changes)

    Example use cases: local dependency_overrides, customized IDE project generation

  2. Adds a dependency_overrides configuration option, to add non-workspace packages to each package's dependency_overrides.yaml.

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Oct 18, 2022

CLA assistant check
All committers have signed the CLA.

@hacker1024 hacker1024 changed the title Feature/dependency overrides melos_overrides.yaml + a new dependency_overrides option Oct 18, 2022
@hacker1024 hacker1024 changed the title melos_overrides.yaml + a new dependency_overrides option feat: melos_overrides.yaml + a new dependency_overrides option Oct 18, 2022
@hacker1024 hacker1024 marked this pull request as draft October 18, 2022 11:47
@hacker1024 hacker1024 marked this pull request as ready for review October 18, 2022 12:21
Copy link
Collaborator

@blaugold blaugold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing!

packages/melos/lib/src/workspace_configs.dart Outdated Show resolved Hide resolved
packages/melos/lib/src/workspace_configs.dart Outdated Show resolved Hide resolved
packages/melos/lib/src/workspace_configs.dart Outdated Show resolved Hide resolved
packages/melos/lib/src/workspace_configs.dart Outdated Show resolved Hide resolved
docs/configuration/overview.mdx Outdated Show resolved Hide resolved
packages/melos/lib/src/common/utils.dart Outdated Show resolved Hide resolved
packages/melos/lib/src/commands/bootstrap.dart Outdated Show resolved Hide resolved
@blaugold
Copy link
Collaborator

The changes in _generateTemporaryProjects were not quite right yet, but I've fixed that.

The PR LGTM as it is right now, but I got thinking whether it would be better if the dependencyOverrides in melos.yaml worked like those in a pubspec.yaml. Currently, you can only use path dependencies for workspace-wide overrides, but sometimes it's useful to use different sources (pub.dev, git). WDYT @hacker1024?

@hacker1024
Copy link
Contributor Author

hacker1024 commented Oct 30, 2022

For my specific usecase, linking to local projects that weren't part of the workspace, I wasn't concerned about supporting packages from other sources.

Allowing them would be nice, but it adds complexity. Relative path packages would need to be adjusted depending on the directory of each workspace package, and that goes for git packages with local URIs, too. Furthermore, the glob functionality would be unavailable.

The one change that I think could be useful would be to allow packages from directories outside the workspace directory, as is supported in path dependencies, but that's also hard to implement due to the glob resolution design, and can be worked around with an untracked symlink anyway.

@hacker1024
Copy link
Contributor Author

@blaugold gentle bump, is there anything else that needs to be done?

@@ -88,6 +91,22 @@ ignore:
> You can also expand the scope of ignored packages on a per-command basis via
> the [`--scope` filter](/filters#scope) flag.

## `dependencyOverrides`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this to command/bootstrap/dependencyOverrides since this is specific to the bootstrap command?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@blaugold
Copy link
Collaborator

Sorry, it took me so long to get to this PR.

I've renamed dependencyOverrides to dependencyOverridePaths so we can use dependencyOverrides for an option that works like dependency_overrides in pubspec.yaml in the future if we want to. I've also moved the option to command/bootstrap.

LGTM now, and thanks for the contribution @hacker1024.

@blaugold blaugold changed the title feat: melos_overrides.yaml + a new dependency_overrides option feat: add support for melos_overrides.yaml + command/bootstrap/dependencyOverridePaths Dec 20, 2022
@blaugold blaugold linked an issue Dec 20, 2022 that may be closed by this pull request
1 task
@blaugold blaugold merged commit bf26b52 into invertase:main Dec 20, 2022
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

Successfully merging this pull request may close these issues.

request: Untracked, local additions to pubspec_overrides.yaml
4 participants