Skip to content

When on typescript project, sequelize-cli still generates javascript files. #1436

Description

@malik-samad

What I am doing?

I'm using Sequelize-cli in a typescript project and it is not generating .ts files and I have to then update those files extensions and make manual changes to the file for making it compatible in my project.

What I expect to happen?

I want to have the CLI work the same for my typescript file as it does for a javascript project. I expect the cli to generate proper migration, see and model files with .ts extension.

What is actually happening?

When I try to run sequelize init or other migration cli, it will generate javascript files instead of typescript as expected.

Dialect: mysql
Database version: latest
Sequelize CLI version: latest
Sequelize version: latest

Would you resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.

I have completed and fully tested the configuration and changes needed for this issue fix, but I am not able to push my work into the repository. Could you please help me get access so that I can push my work on this issue?

Activity

  1. WikiRik commented on Dec 25, 2023

    @WikiRik
    Member

    Thanks for opening this! You can fork this repository, push the changes to there and then open a pull request here

  2. berubenic commented on Dec 28, 2023

    @berubenic

    +1

  3. malik-samad commented on Jan 21, 2024

    @malik-samad
    Author

    Hi WikiRik,
    I have opened a PR for this issue and it needs your review. please have a look and help me get in making it merged into package.

    The PR has 1 regex change which is reported by CodeQL and it needs approving from reviewer as I think its a false positive.

    thanks.

  4. IArnaut2 commented on Feb 16, 2025

    @IArnaut2

    I wish there was an option to generate TypeScript version of the project.

    @malik-samad
    A year later and your pull request is still not merged.

  5. omertairi04 commented on Feb 19, 2025

    @omertairi04

    Why exactly isn't this merged ?

  6. malik-samad commented on Feb 19, 2025

    @malik-samad
    Author

    Why exactly isn't this merged ?

    Hi, thanks for checking.
    The reason is because the PR needs approval from the reviewer. I can't merge it on my own.

  7. omertairi04 commented on Feb 20, 2025

    @omertairi04

    Why exactly isn't this merged ?

    Hi, thanks for checking. The reason is because the PR needs approval from the reviewer. I can't merge it on my own.

    Since i am a beginner when it comes to things as such, is there any work around to implement your solution ?

  8. shlomisas commented on Feb 26, 2025

    @shlomisas

    @WikiRik any update on ETA to approve the PR? 🙏

  9. IArnaut2 commented on Feb 26, 2025

    @IArnaut2

    @WikiRik any update on ETA to approve the PR? 🙏

    There's no ETA. The main devs just don't care.

  10. malik-samad commented on Feb 27, 2025

    @malik-samad
    Author

    Why exactly isn't this merged ?

    Hi, thanks for checking. The reason is because the PR needs approval from the reviewer. I can't merge it on my own.

    Since i am a beginner when it comes to things as such, is there any work around to implement your solution ?

    Yes, You can actually check my other repo for this implementation.

    https://github.com/malik-samad/sequelize-with-typscript

    the repo link above contains the initial boilerplate implementation of using typescript with Sequelize. in that repo you will that I have created sequelize models in typescript instead of javascript. and it is working just fine.

    (Until my PR is not merged in the Sequelize-CLI repo) you can also use my modified Sequelize-cli package to make it support the typescript
    NPM: https://www.npmjs.com/package/sequelize-cli-ts-js
    Repo: https://github.com/malik-samad/sequelize-cli-ts-js

    I hope this will help in your situation.

  11. malik-samad commented on Feb 27, 2025

    @malik-samad
    Author

    @WikiRik any update on ETA to approve the PR? 🙏

    check my repos and NPM package for your reference to get you blocker resolved until my PR gets approved and merged.

    I don't know how long it may take, maybe it never get merged 😄 seems like the repo is abandoned or something.

    the workaround I did is tested and used in production level projects.

  12. malik-samad commented on Feb 27, 2025

    @malik-samad
    Author

    @WikiRik any update on ETA to approve the PR? 🙏

    There's no ETA. The main devs just don't care.

    yeh, you are right. otherwise I should atleast get some response by now. its has been more than a year now since I have opened the PR.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions