datocms / cli

Official CLI to interact with DatoCMS projects!
MIT License
7 stars 7 forks source link

Use await import instead of require in migrations #4

Closed JanStevens closed 1 year ago

JanStevens commented 1 year ago

Hello 👋 ,

We are manually importing the run.ts file so we can extend it with some common behaviour. We are currently facing issues because we try to use "type": "module" in our package.json but this fails because the migrations run.ts still uses a require statement

https://github.com/datocms/cli/blob/732c8785319e5b50a2941a4cd9371c6634e7201a/packages/cli/src/commands/migrations/run.ts#L198

Could this be converted to an await import instead?

stefanoverna commented 1 year ago

Hi @JanStevens, please try the latest version (1.0.15), we replaced require with import!