Skip to content

feat(cli): port gen types#5514

Merged
Coly010 merged 6 commits into
supabase:developfrom
7ttp:feat/gen-types
Jun 9, 2026
Merged

feat(cli): port gen types#5514
Coly010 merged 6 commits into
supabase:developfrom
7ttp:feat/gen-types

Conversation

@7ttp

@7ttp 7ttp commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Ports supabase gen types to native ts

What’s introduced

adds a ts implementation for gen types that preserves the existing command surface for local, linked, --project-id, and --db-url flows, keeps the legacy behavior, reuses the management api path for hosted ts generation,
and runs pg-meta directly for generation
also moves the ca bundle into ts based template files

& coverage for all of this!

ref

  • Closes CLI-1310

@7ttp 7ttp requested a review from a team as a code owner June 8, 2026 16:34
7ttp and others added 4 commits June 8, 2026 22:33
- pass pg-meta env via docker --env KEY=VALUE (mirrors container.Config.Env),
  fixing the multi-line CA bundle truncation and env-file newline injection
- gate v9-compat detection on db.major_version > 14 and trim rest-version
- honor --network-id over the --db-url host network (matches DockerStart)
- emit Go's SUPABASE_CA_SKIP_VERIFY stderr warning
- discard docker inspect stdout to avoid a pipe-buffer deadlock
- consolidate domain errors into types.errors.ts
- document local/--db-url side effects (files, subprocesses, env, exit codes)
- expand unit + integration coverage (linked, mutual-exclusion, v9 guard,
  TLS-on/--debug, forced-v9, pgmeta-version, --network-id, skip-verify)
@Coly010 Coly010 merged commit 27b6af1 into supabase:develop Jun 9, 2026
19 checks passed
nbhansen added a commit to nbhansen/Talrum that referenced this pull request Jun 11, 2026
#298)

* fix(ci): pin supabase CLI to 2.105.0 — v2.106.0 breaks local gen types

supabase CLI v2.106.0 (released 2026-06-11 12:01 UTC) ported `gen types`
to the new TypeScript CLI (supabase/cli#5514); the ported command demands
an access token even for `--local` generation, so the types-drift step
fails with "Access token not provided" on runners without
SUPABASE_ACCESS_TOKEN. Both jobs installed `version: latest` and picked
the release up within minutes (PR #297's run, two minutes after publish).

Pin both setup-cli steps to 2.105.0 (last release before the port) and
bump deliberately once upstream restores token-free local generation.

* fix(ci): de-flake CLI telemetry race in the function-serve step

The verify job's readiness poll resolved API_URL with a third
`supabase status` call that runs concurrently with the backgrounded
`functions serve`. The two CLI processes can race on
~/.supabase/telemetry.json ("error: NotFound: FileSystem.rename"),
crashing status, leaving API_URL empty, and failing the poll with
HTTP 000 for 30s (observed on this PR's first run; main passed the
same script 40 minutes earlier — nondeterministic).

Reuse the URL already captured into .env.local instead of calling
status again, and set DO_NOT_TRACK=1 job-wide — the CLI's documented
telemetry opt-out — so no two CLI invocations contend on the
telemetry file anywhere in the job.
mxcl pushed a commit to automic-vault/supabase-cli that referenced this pull request Jun 11, 2026
## TL;DR

Ports `supabase gen types` to native ts

## What’s introduced

adds a ts implementation for `gen types` that preserves the existing
command surface for local, linked, `--project-id`, and `--db-url` flows,
keeps the legacy behavior, reuses the management api path for hosted ts
generation,
and runs `pg-meta` directly for generation 
also moves the ca bundle into ts based template files 

& coverage for all of this! 

## ref

- Closes CLI-1310

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
@7ttp 7ttp deleted the feat/gen-types branch June 11, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants