You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v6: Improve support for ESM & CJS config files #990
So to consolidate this with the other feature request; we also need to include a YML to JSON parser (or something equivalent) so we can also accept .yml and .yaml files.
And for completeness; there is no demand currently to check if the file without extension is a YAML file so that's not in scope for this feature request
Having it in the package.json directly or passable through the command line is still part of #951 since that requires a different approach probably
This PR #987
includes docs update which says ESM configuration files are supported for Node versions that support ESM natively, either via passing `--config config/config.mjs`, or by setting the `type` to `module` in your `package.json`.
In a project using "type": "module",, newly generated migration files are still non ESM:
@ephys Is there any movement on this :-)? I've just spent an hour or two and still dealing with issues. Should I continue with trying to fix it on my end, or did you guys end up providing a support for mjs?
Our efforts are currently focused on getting the first beta version out for sequelize v7. After that we will start looking into updating the CLI but no promises on a timeline yet
But if you open a PR we will make the time to review it
@WikiRik is there any kind of improving to support ESM for running migration using .sequelizerc configuration yet? I thought that migrating to sequelize 7 this is issue would it be fixed but I am still having same issues to not be able to run migrations and seeders written in ESM :(
Activity
WikiRik commentedon Jan 13, 2022
Second part would fix #951, correct?
ephys commentedon Jan 13, 2022
yes :)
I've started working on a PR. Also this would be much easier if we had top-level-await
WikiRik commentedon Jan 13, 2022
So to consolidate this with the other feature request; we also need to include a YML to JSON parser (or something equivalent) so we can also accept .yml and .yaml files.
And for completeness; there is no demand currently to check if the file without extension is a YAML file so that's not in scope for this feature request
Having it in the package.json directly or passable through the command line is still part of #951 since that requires a different approach probably
ephys commentedon Jan 13, 2022
If we're going to support YML & package.json as well, we could use https://github.com/davidtheclark/cosmiconfig. But they don't support ESM yet.
CLI options would be a separate feature yes.
mariusa commentedon May 9, 2022
This PR #987
includes docs update which says
ESM configuration files are supported for Node versions that support ESM natively, either via passing `--config config/config.mjs`, or by setting the `type` to `module` in your `package.json`.In a project using
"type": "module",, newly generated migration files are still non ESM:generates
ephys commentedon May 13, 2022
Similarly to #960, we could detect the module type in package.json, and provide a
--module cjs|esmoption, and generate the right contents accordinglyagjs commentedon Jan 20, 2023
@ephys Is there any movement on this :-)? I've just spent an hour or two and still dealing with issues. Should I continue with trying to fix it on my end, or did you guys end up providing a support for mjs?
Thanks a lot
WikiRik commentedon Jan 20, 2023
Our efforts are currently focused on getting the first beta version out for sequelize v7. After that we will start looking into updating the CLI but no promises on a timeline yet
But if you open a PR we will make the time to review it
IvanGarzon commentedon May 16, 2023
@WikiRik is there any kind of improving to support ESM for running migration using .sequelizerc configuration yet? I thought that migrating to sequelize 7 this is issue would it be fixed but I am still having same issues to not be able to run migrations and seeders written in ESM :(
mahnunchik commentedon Oct 19, 2023
Any news?
nbkhope commentedon Nov 23, 2024
Can we switch to using ESM import/export for
.sequelizercyet, v >= 6?