Support yarn's "resolutions" fields
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start by reproducing the Bolt monorepo setup with package.json resolutions, then compare the resulting dependency tree with yarn why graphql. Trace how Bolt reads workspace package.json files and installs or hoists dependencies; done means supported resolutions are applied rather than ignored and the duplicate graphql versions are resolved.
Written by the indexing model from the issue text.
Description
| Title | Description |
|---|---|
| Type | Feature Request |
| Short Description | Support yarn's "resolutions" fields |
I have a Bolt monorepo setup with a graphql server in packages/server, and a Gatsby site in packages/website:
packages/server/package.json
{
"dependencies": {
"graphql": "^14.0.0"
}
}
packages/website/package.json
{
"scripts": {
"start": "gatsby develop"
},
"dependencies": {
"gatsby": "^2.0.0"
}
}
After running bolt, then cd packages/website && yarn start, I get this error:
error Cannot use GraphQLScalarType "JSON" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
I can confirm multiple versions of graphql with yarn why:
❯ yarn why graphql
=> Found "graphql@14.0.2"
info Has been hoisted to "graphql"
info This module exists because it's specified in "dependencies".
=> Found "gatsby#graphql@0.13.2"
info This module exists because "gatsby" depends on it.
=> Found "relay-compiler#graphql@0.13.2"
info This module exists because "gatsby#relay-compiler" depends on it.
Adding a resolutions field to packages/website/package.json:
{
"resolutions": {
"gatsby/**/graphql": "^14.0.0"
}
}
Doesn't make any different (appears to be ignored entirely).
- Dominant language
- JavaScript
- Stars
- 2.4k
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boltpkg/bolt
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Aa2 Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·