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(seeder): refactor seeder to support running compiled files #2751

Merged
merged 1 commit into from
Feb 12, 2022

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Feb 12, 2022

This makes the whole seeding more in line with how migrations already work.

  • adds pathTs option to support having different paths for JS and TS
  • adds emit to support generating JS seeder files directly
  • adds glob and rework how we require files, so we don't care about their names
  • adds fileName to allow control over generated seeder names
  • no longer uses the "nest file name strategy" for seeders (foo.seeder.ts -> FooSeeder.ts)

Closes #2728

This makes the whole seeding more in line with how migrations already work.

- adds `pathTs` option to support having different paths for JS and TS
- adds `emit` to support generating JS seeder files directly
- adds `glob` and rework how we require files, so we don't care about their names
- adds `fileName` to allow control over generated seeder names
- no longer uses the "nest file name strategy" for seeders (`foo.seeder.ts` -> `FooSeeder.ts`)

Closes #2728
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2022

Codecov Report

Merging #2751 (773aa7d) into master (72385b3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2751   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          194       194           
  Lines        11636     11644    +8     
  Branches      2667      2669    +2     
=========================================
+ Hits         11636     11644    +8     
Impacted Files Coverage Δ
packages/core/src/typings.ts 100.00% <ø> (ø)
packages/cli/src/commands/CreateSeederCommand.ts 100.00% <100.00%> (ø)
packages/cli/src/commands/DatabaseSeedCommand.ts 100.00% <100.00%> (ø)
...ckages/cli/src/commands/MigrationCommandFactory.ts 100.00% <100.00%> (ø)
packages/cli/src/commands/SchemaCommandFactory.ts 100.00% <100.00%> (ø)
packages/core/src/utils/Configuration.ts 100.00% <100.00%> (ø)
packages/core/src/utils/ConfigurationLoader.ts 100.00% <100.00%> (ø)
packages/seeder/src/SeedManager.ts 100.00% <100.00%> (ø)
packages/seeder/src/Seeder.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72385b3...773aa7d. Read the comment docs.

@B4nan B4nan merged commit 8d9c4c0 into master Feb 12, 2022
@B4nan B4nan deleted the seeder-refactor branch February 12, 2022 18:51
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.

SeedManager is hardcoded to always look for .ts files, even without ts-node
2 participants