Closed gaetschwartz closed 1 year ago
You could use a monorepo with a tool like https://github.com/invertase/melos; each function could be a private package in ./packages for example. You can easily share local dependencies and build/deploy scripts with Melos too.
But AFAIK when using edge build supabase_functions --dev
it always builds it as supabase/functions/dart-edge
? For now I build and rename the folder automatically. Also, edge build supabase_functions
does not seem to work on my end. It just completes without doing anything (#24)
Yeah thus was part of my thinking for https://github.com/invertase/dart_edge/issues/12
You can define entrypoints -> name. I'll have a think.
DM'd you on Twitter about that :) @Ehesp
My workflow looks like --
edge new supabase_functions example_dart
So my folder looks like:
-supabase
-functions
-example_dart
-example_dartgen
-packages
Seems to be working well for organizes so far, maybe it will help others manage multiple functions.
I also am having issues using this with multiple functions. Ideally, I think I'd like to have a mirrored folder structure. Basically /edge/functions/[my_function_name]
of which there can be N functions and then once edge build supabase_functions
is called, it builds each function in /edge/functions/
and outputs to /supabase/functions/*
.
Alternatively, if the edge build supabase_functions
accepted input/output args, I could make this behavior myself.
Currently, this tool seems to assume it will manage the entire dart package and be the only function in supabase. This is not necessarily the case since sometimes your package includes multiple aspect of your backend and sometimes even your frontend (as is often the case with supabase + frontend in one repo)
I've browsed around but I'm not sure to understand how it is intended to be used to use multiple functions. Do we need one dart project for each function ?