db-migrate / db-migrate/plugin-typescript
Usage with non-default tsconfig config
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
Hi, we are happily using db-migrate in an nx mono-repo. When we started using tsconfig-paths, our migrations stopped working. As we have a custom tsconfig we need to point the script to, we tried using: `npx ts-config --project tsconfig.migration.ts -r tsconfig-paths/require -r -- node_modules/db-migrate/bin/db-migrate`. This still didn't work correctly.
So digging deeper, we found out that db-migrate-plugin-typescript requires ts-node again and this time without configuration. This seems to overwrite whatever we have configured in the command line. By simply forking this repo and commenting out the require, we were able to get things running again.
**My questions**:
- Do I need to register the `.ts` extension via a plugin and keep my fork?
- Could this plugin only require ts-node if it was not already registered?
Thank you!
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/81615705-usage-with-non-default-tsconfig-config?utm_campaign=plugin&utm_content=tracker%2F45756452&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F45756452&utm_medium=issues&utm_source=github).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the db-migrate/bin/db-migrate entry point and trace how the TypeScript plugin registers ts-node. Reproduce the issue with the shown non-default tsconfig and tsconfig-paths command, then verify that an existing registration is preserved and migrations run with the requested configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- databases, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100