Skip to content

fix: fix invalid ts import style of lib/operators#13797

Merged
WikiRik merged 2 commits intosequelize:mainfrom
ephys:fix/issue-13791-again
Dec 20, 2021
Merged

fix: fix invalid ts import style of lib/operators#13797
WikiRik merged 2 commits intosequelize:mainfrom
ephys:fix/issue-13791-again

Conversation

@ephys
Copy link
Copy Markdown
Member

@ephys ephys commented Dec 20, 2021

Pull Request Checklist

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

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

Description Of Change

Replacement PR of #13796

Attempt to fix #13791

There was an issue in PR #13731 where Op was exported using export = but was imported using import Op from './operator' which is not compatible (source https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require).

This is a simple fix that changes the imports back to import Op = require('./lib/operators') syntax.

This one does not include any lint correction either as types/* is not linted and will be removed anyway (#13796 (comment))


Concerns

Things I noticed while working on this PR. Putting them here to decide between fixing them here or opening an issue.

Avoiding breaking changes

As talked about in #13796, we should stick to this import/export syntax in v6 to avoid breaking changes.

We can revisit this in v7.

Two operators.ts definitions

index.d.ts imports '../lib/operators' which points to sequelize/lib/operators.ts instead of sequelize/dist/lib/operators.d.ts.

This could be a problem.

A potential solution to import /lib from /types would be to change the import from ../lib/operators to sequelize/lib/operators.

WikiRik
WikiRik previously approved these changes Dec 20, 2021
Copy link
Copy Markdown
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

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

Looks good, I did make a suggested change but it's inconsistent throughout the files either way si just see what you do with it

Comment thread types/index.d.ts Outdated
@ephys
Copy link
Copy Markdown
Member Author

ephys commented Dec 20, 2021

I don't think the failed test is related to this PR. Very strange. Can we try relaunching that test?

Edit: yep, passed now :)

@WikiRik WikiRik merged commit 8acc14f into sequelize:main Dec 20, 2021
@WikiRik
Copy link
Copy Markdown
Member

WikiRik commented Dec 20, 2021

@sdepold this together with #13795 might be good for 6.12.1, agree?

@sdepold
Copy link
Copy Markdown
Member

sdepold commented Dec 21, 2021

v6.12.1 is on it's way in this very moment :)

@ephys
Copy link
Copy Markdown
Member Author

ephys commented Dec 21, 2021

🤞

@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.12.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ephys ephys mentioned this pull request Dec 21, 2021
4 tasks
aliatsis pushed a commit to creditiq/sequelize that referenced this pull request Jun 2, 2022
* fix: fix invalid ts import style of lib/operators

* refactor: align types/index.d.ts

Co-authored-by: Rik Smale <[email protected]>

Co-authored-by: Rik Smale <[email protected]>
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.

Typescript 4.5.4 does not like sequelize-ESM imports in v6.12

3 participants