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

feat(core): Allow to use .ts files as configuration without ts-node #4702

Merged
merged 4 commits into from Sep 17, 2023

Conversation

octet-stream
Copy link
Contributor

@octet-stream octet-stream commented Sep 16, 2023

Details

This PR introduces two new options to allow .ts files as configs when ts-node is not enabled:

  • alwaysAllowTs flag in mikro-orm section of package.json
  • MIKRO_ORM_CLI_ALWAYS_ALLOW_TS environment variable

Changes

  • Add optional alwaysAllowTs field on Settings interface in ConfigurationLoader;
  • Return .ts configs files from ConfigurationLoader.getConfigPaths() when alwaysAllowTs option is enabled;
  • Add tests;
  • Add documentation for these new options

Fixes #4701

@octet-stream octet-stream marked this pull request as ready for review September 16, 2023 15:38
Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks!

@codecov
Copy link

codecov bot commented Sep 17, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
packages/core/src/utils/ConfigurationLoader.ts 100.00%

📢 Thoughts on this report? Let us know!.

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

Successfully merging this pull request may close these issues.

Allow to pass .ts files as config with Bun when ts-node is disabled
2 participants