From 89c864775187abf1860459753dff8484468ea190 Mon Sep 17 00:00:00 2001 From: Jongsun Suh <34228073+MajorLift@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:40:45 -0700 Subject: [PATCH] `eth-json-rpc-provider` migration - B4: Add exceptions in `constraints.pro` for ISC license. (#1767) ## Explanation This PR implements the following incremental step in the process for migrating `eth-json-rpc-provider` into the core monorepo: *** ### Phase B: Staging in `migrated-packages/` #### 4. Add exception for non-MIT license. - [x] If migration target uses a non-MIT license, add exception entries in the root `constraints.pro` file. - [x] Make sure the new rule doesn't break any of the existing package.json files by running `yarn constraints`. *** See https://github.com/MetaMask/core/issues/1551#issuecomment-1745665740 for an outline of the entire process. ## References - Contributes to #1685 - Contributes to #1551 ## Changelog N/A ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate --- constraints.pro | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/constraints.pro b/constraints.pro index f79e0a5e4c7..1b462b0359a 100644 --- a/constraints.pro +++ b/constraints.pro @@ -207,9 +207,14 @@ gen_enforced_field(WorkspaceCwd, 'repository.url', RepoUrl) :- repo_name(RepoUrl, _). WorkspaceCwd \= '.'. -% The license for all published packages must be MIT. +% The license for all published packages must be MIT unless otherwise specified. gen_enforced_field(WorkspaceCwd, 'license', 'MIT') :- - \+ workspace_field(WorkspaceCwd, 'private', true). + \+ workspace_field(WorkspaceCwd, 'private', true), + WorkspaceCwd \= 'packages/eth-json-rpc-provider'. +% The following published packages use an ISC license instead of MIT. +gen_enforced_field(WorkspaceCwd, 'license', 'ISC') :- + \+ workspace_field(WorkspaceCwd, 'private', true), + WorkspaceCwd == 'packages/eth-json-rpc-provider'. % Non-published packages do not have a license. gen_enforced_field(WorkspaceCwd, 'license', null) :- workspace_field(WorkspaceCwd, 'private', true).