Closed chuuddo closed 1 month ago
So because each package has peer deps, if you do not specify every package in your package.json to be at a specific version this can happen. Like for example you are not using the bubble menu, but it is a peer dep of vue so it is resolving to a later version. The good thing is that all the packages should be interoperable, so it really isn't too much of a big deal in practice. But, to resolve them, you either need all the packages specified or for everything to be updated to the latest versions.
In Tiptap v3 we plan to drastically reduce the number of packages so that this would be much less of an issue for people
What about @tiptap/starter-kit
? This package does not have any peerDependencies.
npm i @tiptap/core@2.6.6 @tiptap/extension-heading@2.6.6 @tiptap/extension-link@2.6.6 @tiptap/extension-list-item@2.6.6 @tiptap/pm@2.6.6 @tiptap/starter-kit@2.6.6 @tiptap/vue-3@2.6.6 @tiptap/extension-bubble-menu@2.6.6 @tiptap/extension-floating-menu@2.6.6 --save-exact
npm ls @tiptap/core
test-tiptap-install@1.0.0 /Users/ichudin/dev/test-tiptap-install
├── @tiptap/core@2.6.6
├─┬ @tiptap/extension-bubble-menu@2.6.6
│ └── @tiptap/core@2.6.6 deduped
├─┬ @tiptap/extension-floating-menu@2.6.6
│ └── @tiptap/core@2.6.6 deduped
├─┬ @tiptap/extension-heading@2.6.6
│ └── @tiptap/core@2.6.6 deduped
├─┬ @tiptap/extension-link@2.6.6
│ └── @tiptap/core@2.6.6 deduped
├─┬ @tiptap/extension-list-item@2.6.6
│ └── @tiptap/core@2.6.6 deduped
├─┬ @tiptap/starter-kit@2.6.6
│ ├── @tiptap/core@2.7.4
│ ├─┬ @tiptap/extension-blockquote@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-bold@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-bullet-list@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-code-block@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-code@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-document@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-dropcursor@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-gapcursor@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-hard-break@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-history@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-horizontal-rule@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-italic@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-ordered-list@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-paragraph@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ ├─┬ @tiptap/extension-strike@2.7.4
│ │ └── @tiptap/core@2.7.4 deduped
│ └─┬ @tiptap/extension-text@2.7.4
│ └── @tiptap/core@2.7.4 deduped
└─┬ @tiptap/vue-3@2.6.6
└── @tiptap/core@2.6.6 deduped
Ah, it specifies them as dependencies not peer deps: https://github.com/ueberdosis/tiptap/blob/6834a7f7d620c1706aaa5220db3ffcfebef946b7/packages/starter-kit/package.json#L31-L52
This isn't really a problem with Tiptap, it is how NPM resolution works
i think in this package dependencies should be without ^
, except core
and pm
, they should be moved to peerDependencies
I agree that core & pm should be peer deps in starter-kit.
But, starter-kit should not enforce exact dependencies (which is what removing ^
would do).
I could see an argument for allowing any version within the major version like 2.x
For example Storybook lock version in a similar package https://github.com/storybookjs/storybook/blob/next/code/addons/essentials/package.json#L91-L99
They are using yarn so it is not really comparable.
Just fwiw, even if we change the versioning, you are still going to have this problem, you will need to update versions to get the change that is made. And like I said, we are reducing the number of packages with v3
Affected Packages
core, extension-heading, extension-link, extension-list-item, pm, starter-kit, vue-3
Version(s)
2.6.6
Bug Description
Installing these packages results in the message from npm "warn ERESOLVE overriding peer dependency"
Browser Used
Other
Code Example URL
No response
Expected Behavior
Expected that only one version(2.6.6) will be installed for
@tiptap/core
and@tiptap/pm
.Additional Context (Optional)
Dependency Updates