feat(cli): scaffold fetch-style edge functions#5845
Conversation
|
👋 Thanks for the contribution! This pull request isn't linked to a tracked issue, so it's being closed automatically. Please open an issue first, wait for a maintainer to add the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5077ca5265
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| imports: { | ||
| "@supabase/functions-js": "jsr:@supabase/functions-js@^2", | ||
| }, | ||
| private: true, | ||
| type: "module", | ||
| dependencies: {}, | ||
| }, |
There was a problem hiding this comment.
Upload the function-local package manifest for API deploys
When a user adds a bare-specifier dependency to this generated manifest and runs the default supabase functions deploy, the API deployment path cannot resolve it: writeSourceDeployForm in apps/cli/src/shared/functions/deploy.ts only uploads the entrypoint and reachable local/import-map files, and its import walker skips bare specifiers, so this package.json is never included in the multipart upload. The deployed runtime therefore has neither the manifest nor the dependency declaration; either include the manifest in source uploads or route package-based functions through the bundler.
Useful? React with 👍 / 👎.
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@5077ca5265106cc841a9bd12cb191f30b0b03036Preview package for commit |
Summary
Updates the next CLI Edge Function scaffold to use the Web Fetch-style
export default { fetch(...) }authoring model instead ofDeno.serve(...).New functions now get a function-local
package.jsonwith no default dependencies, and no generateddeno.json. This makes the default template dependency-free while establishing the package-manifest boundary for users who add dependencies undersupabase/functions/<function-name>and import them by bare specifier from function code.Notes
Existing
deno.jsonmanifest detection remains in shared config so existing projects and explicit import-map flows keep working.