cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: enable edge runtime inspector feature

Open nyannyacha opened this issue 1 year ago • 3 comments

What kind of change does this PR introduce?

Feature closes https://github.com/supabase/cli/issues/2311

Description

This PR introduces several flags to the supabase functions serve command to enable the inspector capability of edge-runtime.

See the doc added to this PR for about these flags.

nyannyacha avatar May 23 '24 02:05 nyannyacha

Pull Request Test Coverage Report for Build 9280055496

Details

  • 39 of 73 (53.42%) changed or added relevant lines in 4 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 60.189%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/utils/config.go 3 6 50.0%
cmd/functions.go 5 14 35.71%
internal/functions/serve/serve.go 30 52 57.69%
<!-- Total: 39 73
Files with Coverage Reduction New Missed Lines %
internal/functions/serve/serve.go 2 64.19%
internal/storage/rm/rm.go 2 89.53%
internal/gen/keys/keys.go 5 11.76%
<!-- Total: 9
Totals Coverage Status
Change from base Build 9271086176: -0.1%
Covered Lines: 6888
Relevant Lines: 11444

💛 - Coveralls

coveralls avatar May 23 '24 02:05 coveralls

I've made it possible to change the host port for accepting inspector sessions in the experimental section, but a recent commit seems to have added an extra edge_runtime section.

Is it better to keep it as it is, or better to move functions_inspector_port to the edge_runtime section?

nyannyacha avatar May 23 '24 22:05 nyannyacha

Serve all Functions locally

Usage:
  supabase functions serve [flags]

Flags:
      --env-file string                           Path to an env file to be populated to the Function environment.
  -h, --help                                      help for serve
      --import-map string                         Path to import map file.
      --inspect                                   Alias of --inspect-mode run.
      --inspect-main                              Allow creating inspector for main worker.
      --inspect-mode [ off | run | brk | wait ]   Activate inspector capability. (default off)
      --no-verify-jwt                             Disable JWT verification for the Function.
      --policy [ per_worker | oneshot ]           Policy to the handling of incoming requests. (default per_worker)
      --wallclock-limit-sec uint                  Worker's wall clock limit in seconds. If 0 is specified, unlimited. (default 400)

Global Flags:
      --create-ticket                     create a support ticket for any CLI error
      --debug                             output debug logs to stderr
      --dns-resolver [ native | https ]   lookup domain names using the specified resolver (default native)
      --experimental                      enable experimental features
      --workdir string                    path to a Supabase project directory
A new version of Supabase CLI is available: v1.167.4 (currently installed v)
We recommend updating regularly for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli

nyannyacha avatar May 27 '24 05:05 nyannyacha

Serve all Functions locally

Usage:
  supabase functions serve [flags]

Flags:
      --env-file string                     Path to an env file to be populated to the Function environment.
  -h, --help                                help for serve
      --import-map string                   Path to import map file.
      --inspect                             Alias of --inspect-mode run.
      --inspect-main                        Allow creating inspector for main worker.
      --inspect-mode [ run | brk | wait ]   Activate inspector capability.
      --no-verify-jwt                       Disable JWT verification for the Function.
      --policy [ per_worker | oneshot ]     Policy to the handling of incoming requests. (default per_worker)
      --wallclock-limit-sec uint            Worker's wall clock limit in seconds. If 0 is specified, unlimited. (default 400)

Global Flags:
      --create-ticket                     create a support ticket for any CLI error
      --debug                             output debug logs to stderr
      --dns-resolver [ native | https ]   lookup domain names using the specified resolver (default native)
      --experimental                      enable experimental features
      --workdir string                    path to a Supabase project directory
A new version of Supabase CLI is available: v1.167.4 (currently installed v)
We recommend updating regularly for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli

nyannyacha avatar May 27 '24 21:05 nyannyacha

Serve all Functions locally

Usage:
  supabase functions serve [flags]

Flags:
      --env-file string                     Path to an env file to be populated to the Function environment.
  -h, --help                                help for serve
      --import-map string                   Path to import map file.
      --inspect                             Alias of --inspect-mode run.
      --inspect-main                        Allow inspecting the main worker.
      --inspect-mode [ run | brk | wait ]   Activate inspector capability for debugging.
      --no-verify-jwt                       Disable JWT verification for the Function.

Global Flags:
      --create-ticket                     create a support ticket for any CLI error
      --debug                             output debug logs to stderr
      --dns-resolver [ native | https ]   lookup domain names using the specified resolver (default native)
      --experimental                      enable experimental features
      --workdir string                    path to a Supabase project directory
A new version of Supabase CLI is available: v1.169.8 (currently installed v)
We recommend updating regularly for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli

nyannyacha avatar May 27 '24 23:05 nyannyacha

Is there some tutorial about how to use this? Will this work with the VS Code debugger?

escopecz avatar Jul 18 '24 09:07 escopecz