Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Yarn 4 #367

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

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

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
enableConstraintsChecks: true

packageExtensions:
"@jbrowse/core@*":
peerDependencies:
Expand All @@ -23,20 +25,10 @@ packageExtensions:
react-dom: "*"
mocha@*:
dependencies:
ts-node: "*"
source-map-support: "*"
ts-node: "*"
mongoose-id-validator@*:
peerDependencies:
mongoose: "*"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
spec: "@yarnpkg/plugin-constraints"

yarnPath: .yarn/releases/yarn-3.6.4.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
9 changes: 0 additions & 9 deletions constraints.pro

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "apollo3",
"description": "Monorepo containing Apollo front and back end code",
"packageManager": "yarn@3.6.4",
"packageManager": "yarn@4.1.1",
"workspaces": [
"packages/*"
],
Expand All @@ -17,6 +17,7 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"@yarnpkg/types": "^4.0.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
Expand Down
32 changes: 32 additions & 0 deletions yarn.config.cjs
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)
},
})
Loading
Loading