-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathconstraints.pro
15 lines (13 loc) · 1023 Bytes
/
constraints.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% Force all workspace dependencies to be made explicit
% https://yarnpkg.com/features/constraints#force-all-workspace-dependencies-to-be-made-explicit
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, 'workspace:*', DependencyType) :-
workspace_ident(_, DependencyIdent),
workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, DependencyType).
% Prevent two workspaces from depending on conflicting versions on the same dependency
% This is useful for avoiding resolution bugs when multiple workspaces of the same package are installed
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, DependencyType) :-
workspace_has_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType),
workspace_has_dependency(OtherWorkspaceCwd, DependencyIdent, DependencyRange2, DependencyType2),
DependencyRange \= DependencyRange2.
gen_enforced_dependency(WorkspaceCwd, 'lodash', '^4.17.21', DependencyType) :-
workspace_has_dependency(WorkspaceCwd, 'lodash', _, DependencyType).