Skip to content

Commit

Permalink
Add constraint for bugs field in package.json (#1030)
Browse files Browse the repository at this point in the history
A constraint has been added to ensure that the `bugs` field in
`package.json` is always set to the correct value. This field was not
covered by existing validation.

This constraint is useful for a subsequent PR, where the repository is
renamed.

**Checklist**

- [x] Tests are included if applicable
- [x] Any added code is fully documented
  • Loading branch information
Gudahtt authored and MajorLift committed Oct 11, 2023
1 parent e0c8732 commit 19e4159
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ gen_enforced_field(WorkspaceCwd, 'repository.type', 'git').
% packages.
gen_enforced_field(WorkspaceCwd, 'repository.url', 'https://github.com/MetaMask/controllers.git').

% "bugs.url" must be "https://github.com/MetaMask/controllers/issues" for all
% workspace packages.
gen_enforced_field(WorkspaceCwd, 'bugs.url', 'https://github.com/MetaMask/controllers/issues') :-
\+ workspace_field(WorkspaceCwd, 'private', true).

% "bugs" must unset for the root.
gen_enforced_field(WorkspaceCwd, 'bugs', null) :-
workspace_field(WorkspaceCwd, 'private', true).

% "license" must be "MIT" for all workspace packages and unset for the root.
gen_enforced_field(WorkspaceCwd, 'license', 'MIT') :-
\+ workspace_field(WorkspaceCwd, 'private', true).
Expand Down

0 comments on commit 19e4159

Please sign in to comment.