mycodeself / mongo-migrate-ts

Run mongodb migrations easy from TypeScript
MIT License
85 stars 26 forks source link

tsx - isTsNode #107

Open reslear opened 5 months ago

reslear commented 5 months ago

I've identified an issue with the isTsNode function, which seems to be dependent on another TypeScript compilation library. When running without ts-node, errors occur, especially with .tsx files.

https://github.com/mycodeself/mongo-migrate-ts/blob/cd4f247263eb7ab49d45c32f1f95487b8035f1b5/lib/utils/isTsNode.ts#L2-L5

To fix this:

  1. Update isTsNode to check variables and file types, including .cts and .mts.

Temporary fix:

TS_NODE_DEV=1 dotenv -c -- pnpm tsx ./migrations/config.ts up

This ensures compatibility while we address the underlying problem.

mycodeself commented 3 months ago

Hey @reslear, is this not something can be solve using the glob pattern option?