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

fix: mark database drivers as optional peer dependencies #12484

Merged
merged 1 commit into from Jul 11, 2020
Merged

fix: mark database drivers as optional peer dependencies #12484

merged 1 commit into from Jul 11, 2020

Conversation

DRoet
Copy link
Contributor

@DRoet DRoet commented Jul 10, 2020

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

When using yarn 2 and PnP, it will throw an error because sequelize is trying to access the database drivers without listing them as direct dependencies/peerDependencies in package.json

(node:13140) [MODULE_NOT_FOUND] Error: sequelize tried to access mysql2, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Since we don't want to list them as direct dependencies, we can fix this error by listing all the database drivers as optional peer dependencies using the new peerDependenciesMeta field.

@codecov
Copy link

codecov bot commented Jul 10, 2020

Codecov Report

Merging #12484 into v6 will increase coverage by 0.49%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##               v6   #12484      +/-   ##
==========================================
+ Coverage   95.95%   96.45%   +0.49%     
==========================================
  Files          92       95       +3     
  Lines        8951     9155     +204     
==========================================
+ Hits         8589     8830     +241     
+ Misses        362      325      -37     
Impacted Files Coverage Δ
lib/dialects/mariadb/connection-manager.js 100.00% <0.00%> (ø)
lib/dialects/mariadb/index.js 100.00% <0.00%> (ø)
lib/dialects/mariadb/query.js 87.96% <0.00%> (ø)
lib/sequelize.js 95.87% <0.00%> (+0.63%) ⬆️
lib/dialects/postgres/connection-manager.js 95.80% <0.00%> (+1.39%) ⬆️
lib/dialects/abstract/query-interface.js 94.08% <0.00%> (+1.86%) ⬆️
lib/dialects/mariadb/data-types.js 100.00% <0.00%> (+52.63%) ⬆️
lib/dialects/mariadb/query-generator.js 100.00% <0.00%> (+81.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45d9c22...34c0dfc. Read the comment docs.

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

Choose a reason for hiding this comment

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

LGTM, needs a PR to master first

@DRoet
Copy link
Contributor Author

DRoet commented Jul 11, 2020

@sushantdhiman see #12494

@sushantdhiman sushantdhiman merged commit ec2af0d into sequelize:v6 Jul 11, 2020
@DRoet DRoet deleted the fix/yarn-pnp branch July 11, 2020 14:19
@sushantdhiman
Copy link
Contributor

🎉 This PR is included in version 6.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

jctaveras pushed a commit to jctaveras/sequelize that referenced this pull request Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants