-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup Yarn constraints (#13363)
- Loading branch information
Showing
161 changed files
with
926 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
% Enforces that all workspaces depend on other workspaces using `workspace:*` in devDependencies | ||
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, 'workspace:*', 'devDependencies') :- | ||
workspace_has_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, 'devDependencies'), | ||
% Only consider dependency ranges that start with 'workspace:' | ||
atom_concat('workspace:', _, DependencyRange). | ||
|
||
% Enforces the license in all public workspaces while removing it from private workspaces | ||
gen_enforced_field(WorkspaceCwd, 'license', 'MIT') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true). | ||
gen_enforced_field(WorkspaceCwd, 'license', null) :- | ||
workspace_field(WorkspaceCwd, 'private', true). | ||
|
||
% Enforces the repository field for all public workspaces while removing it from private workspaces | ||
gen_enforced_field(WorkspaceCwd, 'repository.type', 'git') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true). | ||
gen_enforced_field(WorkspaceCwd, 'repository.url', 'https://github.com/babel/babel.git') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true). | ||
gen_enforced_field(WorkspaceCwd, 'repository.directory', WorkspaceCwd) :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true). | ||
gen_enforced_field(WorkspaceCwd, 'repository', null) :- | ||
workspace_field(WorkspaceCwd, 'private', true). | ||
|
||
% Enforces 'publishConfig.access' is set to public for public workspaces while removing it from private workspaces | ||
gen_enforced_field(WorkspaceCwd, 'publishConfig.access', 'public') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true). | ||
gen_enforced_field(WorkspaceCwd, 'publishConfig.access', null) :- | ||
workspace_field(WorkspaceCwd, 'private', true). | ||
|
||
% Enforces the engines.node field for all workspaces except '@babel/eslint*' | ||
gen_enforced_field(WorkspaceCwd, 'engines.node', '>=6.9.0') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true), | ||
% Get the workspace name | ||
workspace_ident(WorkspaceCwd, WorkspaceIdent), | ||
% Exempt from the rule as it supports '>=4'. TODO: remove with the next major | ||
WorkspaceIdent \= '@babel/plugin-proposal-unicode-property-regex', | ||
% Exempt from the rule as it supports '>=6.0.0'. TODO: remove with the next major | ||
WorkspaceIdent \= '@babel/parser', | ||
% Skip '@babel/eslint*' workspaces. TODO: remove with the next major | ||
\+ atom_concat('@babel/eslint', _, WorkspaceIdent). | ||
|
||
% Enforces the engines.node field for '@babel/eslint*' workspaces | ||
% TODO: remove with the next major | ||
gen_enforced_field(WorkspaceCwd, 'engines.node', '^10.13.0 || ^12.13.0 || >=14.0.0') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true), | ||
% Get the workspace name | ||
workspace_ident(WorkspaceCwd, WorkspaceIdent), | ||
% Only target '@babel/eslint*' workspaces | ||
atom_concat('@babel/eslint', _, WorkspaceIdent). | ||
|
||
% Removes the 'engines.node' field from private workspaces | ||
gen_enforced_field(WorkspaceCwd, 'engines.node', null) :- | ||
workspace_field(WorkspaceCwd, 'private', true). | ||
|
||
% Enforces the author field to be consistent | ||
gen_enforced_field(WorkspaceCwd, 'author', 'The Babel Team (https://babel.dev/team)') :- | ||
\+ workspace_field(WorkspaceCwd, 'private', true). | ||
gen_enforced_field(WorkspaceCwd, 'author', null) :- | ||
workspace_field(WorkspaceCwd, 'private', true). | ||
|
||
% Enforces the main and types field to start with ./ | ||
gen_enforced_field(WorkspaceCwd, FieldName, ExpectedValue) :- | ||
% Fields the rule applies to | ||
member(FieldName, ['main', 'types']), | ||
% Get current value | ||
workspace_field(WorkspaceCwd, FieldName, CurrentValue), | ||
% Must not start with ./ already | ||
\+ atom_concat('./', _, CurrentValue), | ||
% Store './' + CurrentValue in ExpectedValue | ||
atom_concat('./', CurrentValue, ExpectedValue). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.