Skip to content

[Feature] Built-in constraints #469

@vhiairrassary

Description

@vhiairrassary
  • I'd be willing to implement this feature
  • This feature can already be implemented through a plugin

Describe the user story

As a user I don't want to spend too much time learning constraints for basic needs, like enforcing same package version in all my workspaces.

Describe the solution you'd like

Ideally, I would like to use built-in reusable constraints. Currently there are few examples available in the documentation and in this repository.

Instead of copy-pasting:

% This rule will enforce that a workspace MUST depend on the same version of a dependency as the one used by the other workspaces
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, DependencyType) :-
  % Iterates over all dependencies from all workspaces
    workspace_has_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType),
  % Iterates over similarly-named dependencies from all workspaces (again)
    workspace_has_dependency(OtherWorkspaceCwd, DependencyIdent, DependencyRange2, DependencyType2),
  % Ignore peer dependencies
    DependencyType \= 'peerDependencies',
    DependencyType2 \= 'peerDependencies'.

I would like something like:

enforce_same_version_everywhere()

These built-in constraints would be tested and maintained by experienced prolog developers.

Describe the drawbacks of your solution

  • Such built-in constraints may not be suitable for all the use cases.
  • More work for the yarn maintainers;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions