supabase-community / seed

Automatically seed your database with production-like dummy data based on your schema for local development and testing.
MIT License
468 stars 17 forks source link

fix: rootPath for monorepo setup #124

Closed avallete closed 6 months ago

justinvdm commented 6 months ago

@avallete now that we're needing to find the location of @snaplet/seed dep, I wonder if it'd be more robust (maybe also simpler) to use something like resolve-from to resolve @snaplet/seed's path the same way node would. I guess that's sort of what we're doing here, but it'd be nice to avoid that responsibility, and there might be more nuance to the path resolution to consider.

avallete commented 6 months ago

@avallete now that we're needing to find the location of @snaplet/seed dep, I wonder if it'd be more robust (maybe also simpler) to use something like resolve-from to resolve @snaplet/seed's path the same way node would. I guess that's sort of what we're doing here, but it'd be nice to avoid that responsibility, and there might be more nuance to the path resolution to consider.

Yeah, didn't tough of it . My way to go would be to merge this, since it solve the current bug on turborepo setup and doesn't have much change compare to what's existing. And create an issue to explore refactoring it with the library you mention when we get some time or if we see other issues arising with path resolution related things.

What do you think ?

justinvdm commented 6 months ago

@avallete now that we're needing to find the location of @snaplet/seed dep, I wonder if it'd be more robust (maybe also simpler) to use something like resolve-from to resolve @snaplet/seed's path the same way node would. I guess that's sort of what we're doing here, but it'd be nice to avoid that responsibility, and there might be more nuance to the path resolution to consider.

Yeah, didn't tough of it . My way to go would be to merge this, since it solve the current bug on turborepo setup and doesn't have much change compare to what's existing. And create an issue to explore refactoring it with the library you mention when we get some time or if we see other issues arising with path resolution related things.

What do you think ?

:+1: yep we can do that