@@ -22,39 +22,11 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, Depende
22
22
).
23
23
24
24
% This rule will prevent workspaces from depending on non-workspace versions of available workspaces
25
- gen_enforced_dependency (WorkspaceCwd , DependencyIdent , WorkspaceRange , DependencyType ) :-
25
+ gen_enforced_dependency (WorkspaceCwd , DependencyIdent , 'workspace:^' , DependencyType ) :-
26
26
% Iterates over all dependencies from all workspaces
27
27
workspace_has_dependency(WorkspaceCwd , DependencyIdent , DependencyRange , DependencyType ),
28
28
% Only consider those that target something that could be a workspace
29
- workspace_ident(DependencyCwd , DependencyIdent ),
30
- % Obtain the version from the dependency
31
- workspace_field(DependencyCwd , 'version' , DependencyVersion ),
32
- % Quirk: we must discard the workspaces that don't declare a version
33
- atom(DependencyVersion ),
34
- % Only proceed if the dependency isn't satisfied by a workspace
35
- \+ project_workspaces_by_descriptor(DependencyIdent , DependencyRange , DependencyCwd ),
36
- % Derive the expected range from the version
37
- (
38
- DependencyType = 'peerDependencies' ->
39
- atom_concat ('^' , DependencyVersion , WorkspaceRange )
40
- ;
41
- DependencyType = 'devDependencies' ->
42
- WorkspaceRange = 'workspace:*'
43
- ;
44
- atom_concat('workspace:^' , DependencyVersion , WorkspaceRange )
45
- ).
46
-
47
- % This rule enforces that all workspaces must depend on other workspaces using `workspace:*` in devDependencies
48
- gen_enforced_dependency (WorkspaceCwd , DependencyIdent , 'workspace:*' , 'devDependencies' ) :-
49
- workspace_has_dependency(WorkspaceCwd , DependencyIdent , _ , 'devDependencies' ),
50
- % Only consider those that target something that could be a workspace
51
- workspace_ident(DependencyCwd , DependencyIdent ).
52
-
53
- % This rule enforces that all workspaces must depend on other workspaces using `workspace:^` in peerDependencies
54
- gen_enforced_dependency (WorkspaceCwd , DependencyIdent , 'workspace:^' , 'peerDependencies' ) :-
55
- workspace_has_dependency(WorkspaceCwd , DependencyIdent , _ , 'peerDependencies' ),
56
- % Only consider those that target something that could be a workspace
57
- workspace_ident(DependencyCwd , DependencyIdent ).
29
+ workspace_ident(DependencyCwd , DependencyIdent ).
58
30
59
31
% This rule enforces that all packages must not depend on inquirer - we use enquirer instead
60
32
gen_enforced_dependency (WorkspaceCwd , 'inquirer' , null , DependencyType ) :-
0 commit comments