Closed gaetschwartz closed 1 year ago
Oh, woops!
Yes it should be:
Future<void> runBuild() async {
final functionDirectory = Directory(
p.join(Directory.current.path, 'supabase', 'functions', 'dart_edge'),
);
final entryFile = File(p.join(functionDirectory.path, 'index.ts'));
final compiler = Compiler(
logger: logger,
entryPoint: p.join(Directory.current.path, 'lib', 'main.dart'),
outputDirectory: functionDirectory.path,
outputFileName: 'main.dart.js',
level: CompilerLevel.O4,
);
await compiler.compile();
await entryFile.writeAsString(
edgeFunctionEntryFileDefaultValue('main.dart.js'),
);
}
Feel free to PR - or I'll get around to it soon.
Also the dev build will still work for now in prod, it's just less optimised.
Feel free to PR - or I'll get around to it soon.
Working on a PR along a few other improvements :)
Quickly fixed this in a standalone PR: https://github.com/invertase/dart_edge/commit/c9c0fe3b3cd3496ce3fa3b7dab7f7d4a787d963e
Because every version of supabase_functions from git depends on edge from hosted and supabase_edge_functions depends on edge from git, supabase_functions from git is forbidden.
So, because supabase_edge_functions depends on supabase_functions from git, version solving failed.
When I'm trying to get supabase_functions
0.0.2+2 to fix building the supabase functions.
https://github.com/invertase/dart_edge/blob/822785493f5fad3f876104a17bf5ff431bd02874/packages/edge/lib/src/commands/build_commands/build_supabase.dart#L58
The
runBuild
method is empty. I'm not sure but shouldn't it be something like