Closed thisistonydang closed 1 year ago
Thanks for this PR! Really appreciate it! I would do a find-and-replace to implement this across all chapters unless you want to update the PR to do it yourself! :)
@andrelandgraf I updated the PR to make the change across the entire project and also included more info about ts-node
in the PR description for clarification!
Whoops, it looks like my prettier changed the single quotes to double quotes in the markdown file. I'll fix that!
Fixed the prettier formatting and also caught another typo in the chapter 15 package.json
. It's fixed as well in the latest commit.
Thanks a lot for doing this! Great improvement!
Summary
Use
ts-node
instead ofbun
to run dbseed.ts
script.Details
The current db
seed.ts
script usesbun
, which readers may not have installed. Usingts-node
instead will be more familiar to readers since it's part of the node ecosystem.Changes made:
bun prisma/seed.ts
withnpx ts-node --esm prisma/seed.ts
across the project.Notes
ts-node
can be used to run esm modules via the following methods:I chose the flag option so that we don't have to install
ts-node
as a dependency nor update thetsconfig.json
. For more details, please see thets-node
docs.