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

Generated JS migrations in modern ESM format #10801

Open
6 of 18 tasks
w3nl opened this issue Mar 28, 2024 · 2 comments · May be fixed by #10802
Open
6 of 18 tasks

Generated JS migrations in modern ESM format #10801

w3nl opened this issue Mar 28, 2024 · 2 comments · May be fixed by #10802

Comments

@w3nl
Copy link

w3nl commented Mar 28, 2024

Issue description

Generated JS migrations in modern ESM format
See also: https://nodejs.org/api/esm.html

ECMAScript modules are the official standard format to package JavaScript code for reuse. Modules are defined using a variety of import and export statements.

Expected Behavior

Generate ESM JS migrations, with import/export
So the migration works in a ESM codebase.

Actual Behavior

Generate CommonJS JS migrations
So migrations dont work now in a ESM codebase.

Steps to reproduce

Add "type": "module", to your package.json
Generate migrations with cli with the -o

My Environment

Dependency Version
Operating System
Node.js version 20.11.1
Typescript version 5.4.3
TypeORM version 0.3.20

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

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

@pleerock PR is created: #10802

@w3nl w3nl linked a pull request Mar 28, 2024 that will close this issue
7 tasks
w3nl added a commit to w3nl/typeorm that referenced this issue Mar 28, 2024
Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations

Closes: typeorm#10801
w3nl added a commit to w3nl/typeorm that referenced this issue Mar 28, 2024
Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations

Closes: typeorm#10801
w3nl added a commit to w3nl/typeorm that referenced this issue Mar 28, 2024
Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations

Closes: typeorm#10801
@w3nl
Copy link
Author

w3nl commented Apr 10, 2024

@pleerock / @NoNameProvided / @AlexMesser / @imnotjames Could you check this?
I already have a PR: #10802

@NoNameProvided
Copy link
Member

I am not a maintainer of TypeORM, I never was.

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

Successfully merging a pull request may close this issue.

2 participants