-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca85128
commit f09e176
Showing
11 changed files
with
8,566 additions
and
9,160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @ts-check | ||
|
||
/** @type {import('@yarnpkg/types')} */ | ||
const { defineConfig } = require('@yarnpkg/types') | ||
|
||
/** | ||
* This rule will enforce that a workspace MUST depend on the same version of | ||
* a dependency as the one used by the other workspaces. | ||
* Copied from {@link https://yarnpkg.com/features/constraints}. | ||
* | ||
* | ||
* @param {import('@yarnpkg/types').Yarn.Constraints.Context} context | ||
*/ | ||
function enforceConsistentDependenciesAcrossTheProject({ Yarn }) { | ||
for (const dependency of Yarn.dependencies()) { | ||
if (dependency.type === 'peerDependencies') continue | ||
|
||
for (const otherDependency of Yarn.dependencies({ | ||
ident: dependency.ident, | ||
})) { | ||
if (otherDependency.type === 'peerDependencies') continue | ||
|
||
dependency.update(otherDependency.range) | ||
} | ||
} | ||
} | ||
|
||
module.exports = defineConfig({ | ||
constraints: async (ctx) => { | ||
enforceConsistentDependenciesAcrossTheProject(ctx) | ||
}, | ||
}) |
Oops, something went wrong.