PacktPublishing / Full-Stack-Web-Development-with-Remix

Full Stack Web Development with Remix, published by Packt
MIT License
132 stars 27 forks source link

Use `ts-node` instead of `bun` to run db `seed.ts` script #120

Closed thisistonydang closed 1 year ago

thisistonydang commented 1 year ago

Summary

Use ts-node instead of bun to run db seed.ts script.

Details

The current db seed.ts script uses bun, which readers may not have installed. Using ts-node instead will be more familiar to readers since it's part of the node ecosystem.

Changes made:

Notes

ts-node can be used to run esm modules via the following methods:

# pass the flag
ts-node --esm

# Use the convenience binary
ts-node-esm

# or add `"esm": true` to your tsconfig.json to make it automatic
ts-node

I chose the flag option so that we don't have to install ts-node as a dependency nor update the tsconfig.json. For more details, please see the ts-node docs.

andrelandgraf commented 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! :)

thisistonydang commented 1 year ago

@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!

thisistonydang commented 1 year ago

Whoops, it looks like my prettier changed the single quotes to double quotes in the markdown file. I'll fix that!

thisistonydang commented 1 year ago

Fixed the prettier formatting and also caught another typo in the chapter 15 package.json. It's fixed as well in the latest commit.

andrelandgraf commented 1 year ago

Thanks a lot for doing this! Great improvement!