refactor(V2): convert modeltypes files from cjs to esm#1561
Merged
Conversation
Rename all src/models modeltypes modules from .cjs to .js, convert CommonJS exports to ESM defaults, and update all consuming model imports. This unblocks the planned uuid v13 upgrade by removing CJS-only usage.
Move uuid from v10 to v13 now that modeltypes modules are ESM-only. This keeps dependencies current while preserving existing runtime behavior.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/models/**/*.modeltypes.cjsfiles to ESM*.modeltypes.js.modeltypes.jscjsfrompackage.jsonextensionless.lookForTest plan
eval "$(fnm env)" && fnm use && npm run buildeval "$(fnm env)" && fnm use && npm run test:v1eval "$(fnm env)" && fnm use && npm run test:v2Note
Medium Risk
Medium risk because it changes module format and import paths across many Sequelize models; any missed default/named export mismatch or loader behavior change could break model initialization at runtime.
Overview
Converts Sequelize
*.modeltypesdefinitions from CommonJS to ESM across both v1 and v2 models, updating all consuming models/mirror models to import*.modeltypes.js(withexport default), and adjusting a few v2 type modules to default-export their type maps.Updates runtime packaging settings by dropping
cjsfromextensionless.lookForand bumpinguuidfrom^10to^13(lockfile updated accordingly).Written by Cursor Bugbot for commit d594c0d. This will update automatically on new commits. Configure here.