Skip to content

Commit

Permalink
Merge pull request #2832 from owid/yarn-4
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber authored Oct 23, 2023
2 parents 1e9ec49 + 543ee32 commit 91ad2fc
Show file tree
Hide file tree
Showing 10 changed files with 6,970 additions and 6,844 deletions.
807 changes: 0 additions & 807 deletions .yarn/releases/yarn-3.3.0.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.0.cjs

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions .yarnrc.yml
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"engines": {
"node": ">=18.16"
},
"packageManager": "yarn@3.3.0",
"packageManager": "yarn@4.0.0",
"volta": {
"node": "18.16.1",
"yarn": "3.3.0"
Expand Down Expand Up @@ -230,6 +230,7 @@
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.1.0",
"@yarnpkg/types": "^4.0.0",
"chokidar": "^3.5.3",
"cypress": "9.3.1",
"eslint-config-prettier": "^8.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ourworldindata/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/react": "^16.14.23",
"@types/react-dom": "^17.0.11",
"esbuild-sass-plugin": "^2.3.3",
"eslint": "^8.32.0",
"eslint": "^8.44.0",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "~5.2.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@ourworldindata/core-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"@types/d3": "^6",
"eslint": "^8.32.0",
"eslint": "^8.44.0",
"typescript": "~5.2.2"
},
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ourworldindata/grapher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"esbuild-sass-plugin": "^2.3.3",
"eslint": "^8.32.0",
"eslint": "^8.44.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ourworldindata/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/react-tag-autocomplete": "^6.1.1",
"@types/string-pixel-width": "^1.7.2",
"@types/url-parse": "^1.4.8",
"eslint": "^8.32.0",
"eslint": "^8.44.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"typescript": "~5.2.2"
Expand Down
26 changes: 26 additions & 0 deletions yarn.config.cjs
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)
},
})
Loading

0 comments on commit 91ad2fc

Please sign in to comment.