Skip to content

Cleanup#6

Merged
soedirgo merged 10 commits into
mainfrom
chore/cleanup
Mar 30, 2021
Merged

Cleanup#6
soedirgo merged 10 commits into
mainfrom
chore/cleanup

Conversation

@soedirgo
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Chore.

What is the new behavior?

Sorry about the big PR! A bit difficult to split this up 😅

Changes are split into multiple commits for ease of review:

chore: remove CONTRIBUTING.md

We already have one in supabase/.github

chore: update misc. project stuff

  • set up husky, prettier, jest
  • remove tslint (it's deprecated)
  • set up tsconfig.json

refactor: remove bin/supabase

  • for dev, run the CLI directly with ts-node
  • for prod, compile to dist with npm run build and run npm run start

chore: remove some unused stuff

  • types.ts (currently empty)
  • extensions (unused)

refactor: rename dev -> start

refactor: spruce up the CLI a bit

  • clean up code
  • use spinners for init/start/stop
  • spruce up --help (following vercel's style mostly)

Screenshot 2021-03-28 at 12 35 13 PM

test: update test

chore(build): set up GitHub Actions

Need secrets: GITHUB_TOKEN & NPM_TOKEN

We already have one in supabase/.github
- set up husky, prettier, jest
- remove tslint (it's deprecated)
- set up tsconfig.json
- for `dev`, run the CLI directly with `ts-node`
- for `prod`, compile to `dist` and run `node dist/cli.js`
- `types.ts` (currently empty)
- `extensions` (unused)
@soedirgo soedirgo requested a review from kiwicopple March 28, 2021 04:53
- clean up code
- use spinners for `init`/`start`/`stop`
- spruce up `--help` (following vercel's style mostly)
Need tokens: `GITHUB_TOKEN` & `NPM_TOKEN`
@soedirgo soedirgo merged commit c90ec79 into main Mar 30, 2021
@soedirgo soedirgo deleted the chore/cleanup branch March 30, 2021 02:35
dumko2001 pushed a commit to dumko2001/cli that referenced this pull request Mar 15, 2026
kallebysantos pushed a commit to kallebysantos/supabase-cli that referenced this pull request May 6, 2026
…ase#6)

## Summary

This PR introduces a new generated `@supabase/api` package for the
Supabase Management API and rewires the CLI `platform` command surface
to build dynamically from that SDK + exported OpenAPI metadata instead
of relying on a checked-in generated command tree.

On the CLI side, this keeps `@supabase/api` focused on typed SDK
concerns while letting `@supabase/cli` own command naming, UX,
schema/dry-run behavior, and output formatting.

## What changed

### `@supabase/api`
- adds a new generated Management API SDK package
- generates and exports:
  - typed contracts / schemas
  - `operationDefinitions`
  - generated Effect operations
  - runtime-specific clients for `bun` and `node`
  - raw `openapi.json`
- `openApiOperationIdMap` for joining raw OpenAPI operations back to SDK
operation ids
- replaces the previous large handwritten `v1.d.ts`-style surface with
generated SDK artifacts and runtime clients
- adds tests around public entrypoints and client behavior

### CLI `platform` commands
- replaces the old CLI-side OpenAPI/codegen pipeline with a dynamic
runtime-generated `platform` tree
- builds platform command metadata from:
  - `@supabase/api/openapi.json`
  - `openApiOperationIdMap`
  - SDK operation definitions / execution
- removes the need for a checked-in generated forest of platform command
files
- adds CLI-owned command path normalization and conflict detection
- covers all supported platform operations, including previously missing
bulk endpoints

### Request/input/schema UX
- supports richer request body handling:
  - JSON object bodies via `--json`
- non-object JSON / multipart / binary / urlencoded bodies via `--body`
  - path/query/header input via `--params`
- improves schema inspection and dry-run flows
- fixes string-only OpenAPI unions so fields like `branch_id_or_ref`
prompt as plain text instead of JSON
- improves platform input errors so suggestions point to the exact
command and `--schema` usage
- fixes misleading `--json` guidance for params-only commands

### Text output / interaction polish
- removes noisy generic success banners where they don’t add value
- adds a task/spinner-style output abstraction in the CLI output layer
- improves multiline task completion rendering so continuation lines
keep the left guide rail
- makes text-mode dry-run output neutral by rendering the preview
directly without a success banner

### Docs and test coverage
- adds documentation for how dynamic platform command generation works
- adds metadata, tree, input, schema, body-shape, integration, and e2e
coverage for the new platform flow

## Why

- keep `@supabase/api` as the single typed Management API SDK
- avoid duplicating OpenAPI parsing / generation logic inside the CLI
- make platform command ownership clearer in `@supabase/cli`
- improve maintainability by replacing hundreds of generated command
files with a smaller runtime metadata pipeline
- improve command UX around prompting, dry-run, schema inspection, and
output formatting

## Testing

Validated with workspace checks and targeted tests across `packages/api`
and `apps/cli`, including:
- typecheck / lint / format / knip
- `packages/api` tests
- CLI core tests for platform metadata, input handling, schema output,
tree construction, and body handling
- targeted platform e2e coverage for normalized commands and dry-run
behavior

## Notes

- `@supabase/api` stays SDK-focused; CLI-specific metadata generation
was intentionally not added there
- the CLI continues to own public command naming and UX decisions for
`platform`
@supabase-cli-releaser supabase-cli-releaser Bot mentioned this pull request May 12, 2026
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.

1 participant