[Feature] Built-in constraints
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
- 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;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the constraints documentation and the examples in constraints.pro first, especially the same-version rule shown in the issue. Define the built-in constraint API and scope from the requested enforce_same_version_everywhere() example. Done means reusable basic constraints are available without copy-pasting Prolog and are tested and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100