epicweb-dev / epicshop

The workshop app for all workshops on EpicWeb.dev

Home Page:https://www.epicweb.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose API for set to playground to filter files

kentcdodds opened this issue · comments

When you hit "set to playground" the data.db will be copied over. This can be annoying if you're logged in as a user with a session and then that session gets deleted even if the schema hasn't changed at all. It would be better to avoid copying the data.db in this case.

To avoid encoding this specific use case into the app, it'd be good to have a special API that allows you to filter out which files should be overwritten.

Related, if the schema changed, then we want to regenerate the prisma client, but if it is unchanged then the prisma client doesn't need to be regenerated. So it would be good to provide a way to know the before/after of some of the files as well.

Perhaps even just having a before-set-to-playground.js and a after-set-to-playground.js file would be sufficient to handle these use cases.