-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2832 from owid/yarn-4
- Loading branch information
Showing
10 changed files
with
6,970 additions
and
6,844 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
nodeLinker: node-modules | ||
compressionLevel: mixed | ||
|
||
yarnPath: .yarn/releases/yarn-3.3.0.cjs | ||
enableGlobalCache: false | ||
|
||
logFilters: | ||
# A package cannot be found in the cache for the given package and will be fetched from its remote location. | ||
- code: YN0013 | ||
- code: YN0013 # A package cannot be found in the cache for the given package and will be fetched from its remote location. | ||
level: discard | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.0.0.cjs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @ts-check | ||
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. | ||
*/ | ||
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.