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

refactor!: move vue-jest and ts-jest to peer dependencies #6347

Merged
merged 2 commits into from Mar 16, 2021

Conversation

sodatea
Copy link
Member

@sodatea sodatea commented Mar 12, 2021

vue-jest now requires several different peer deps for vue 2 and vue 3;
ts-jest now requires typescript as peer dep, which should be optional
for unit-jest plugin users because they might choose not to use
typescript.

Both are causing annoying peer dep warnings.

So it only makes sense to move them to the project level, to keep things
clean.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

vue-jest now requires several different peer deps for vue 2 and vue 3;
ts-jest now requires typescript as peer dep, which should be optional
for unit-jest plugin users because they might choose not to use
typescript.

Both are causing annoying peer dep warnings.

So it only makes sense to move them to the project level, to keep things
clean.
@sodatea sodatea changed the title refactor: move vue-jest and ts-jest to peer dependencies refactor!: move vue-jest and ts-jest to peer dependencies Mar 12, 2021
@sodatea sodatea merged commit 45eb462 into vuejs:dev Mar 16, 2021
@sodatea sodatea deleted the refactor-jest-deps branch March 16, 2021 07:18
Comment on lines +12 to +22
if (!allDeps['vue-jest']) {
// Likely a Vue 2 project, and uses the builtin preset.
// Because we used to add `vue-jest` v5 to dev deps for Vue 3 projects.
toMerge['vue-jest'] = '^4.0.1'
}

if (allDeps['@vue/cli-plugin-typescript'] && !allDeps['ts-jest']) {
toMerge['ts-jest'] = '^26.5.3'
}

return toMerge

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely bug: These lines end up adding values to the root of package.json itself, instead of under the dependencies / devDependencies keys?

Copy link
Member Author

@sodatea sodatea May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks for noticing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants