Since there is the ability to generate .mjs (ES Modules) migration files using the ley new --esm flag, would be great to also get ability to generate TypeScript migrations using a flag, eg:
$ ley new todos --ts
#=> migrations/003-todos.ts
As an additional detail, this feature could also import the types for the library being used (although I can understand if Ley does not want to maintain these as a library). Eg. for Postgres.js, it could be:
import { Sql } from 'postgres'
export async function up(client: Sql) {}
export async function down(client: Sql) {}
Since new users may forget to also configure tsm, it may be helpful to also improve the error message when TypeScript causes ley migrate commands to fail:
Hi @lukeed 👋 Hope you're well!
Since there is the ability to generate
.mjs
(ES Modules) migration files using theley new --esm
flag, would be great to also get ability to generate TypeScript migrations using a flag, eg:As an additional detail, this feature could also import the types for the library being used (although I can understand if Ley does not want to maintain these as a library). Eg. for Postgres.js, it could be:
Since new users may forget to also configure
tsm
, it may be helpful to also improve the error message when TypeScript causesley migrate
commands to fail: