keystonejs-contrib / k6-contrib

Keyston-6 contrib
MIT License
35 stars 18 forks source link

Some dependencies should be peer dependencies #14

Closed andreialecu closed 3 years ago

andreialecu commented 3 years ago

I noticed that some (or all) packages define a direct dependency on keystone.

https://github.com/keystonejs-contrib/k6-contrib/blob/1c7861c6b2d8fa2d730679d3103888f3fdf851a0/packages/fields-s3images/package.json#L21

This is problematic, I think this should be a peer dependency otherwise it results in two versions of keystone potentially conflicting.

In my case this results in this library installing keystone 26, while the main project uses keystone 27. Note that only npm will dedupe packages by default even if they match the semver range. It's possible that two separate keystones are installed when using yarn.

I'm using yarn 3, and here's its output:

➜ yarn why @keystone-next/keystone
├─ @k6-contrib/fields-s3-images@npm:0.4.1
│  └─ @keystone-next/keystone@npm:26.1.1 (via npm:^26.1.0)
│
└─ keystone-app@workspace:packages/backend
   └─ @keystone-next/keystone@npm:27.0.1 (via npm:^27.0.1)

Shouldn't the same keystone core instance be shared? I think there are some other duplicated dependencies as well.

gautamsi commented 3 years ago

this is complete for next release