Skip to content

Commit

Permalink
fix(typegen): only include schemas in api.schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Aug 5, 2022
1 parent 99836ae commit cbf759d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions internal/gen/types/typescript/typescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"os"
"strings"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
Expand All @@ -23,6 +24,10 @@ func Run(useLocal bool, dbUrl string) error {
return errors.New("Must specify either --local or --db-url")
}

if err := utils.LoadConfig(); err != nil {
return err
}

if useLocal {
if err := utils.AssertSupabaseStartIsRunning(); err != nil {
return err
Expand All @@ -36,7 +41,7 @@ func Run(useLocal bool, dbUrl string) error {
"PG_META_DB_HOST=" + utils.DbId,
},
Cmd: []string{
"node", "bin/src/server/app.js", "gen", "types", "typescript", "--exclude-schemas", "auth,extensions,graphql,graphql_public,realtime,storage,supabase_functions,supabase_migrations",
"node", "bin/src/server/app.js", "gen", "types", "typescript", "--include-schemas", strings.Join(append([]string{"public"}, utils.Config.Api.Schemas...), ","),
},
AttachStderr: true,
AttachStdout: true,
Expand Down Expand Up @@ -98,7 +103,7 @@ func Run(useLocal bool, dbUrl string) error {
"PG_META_DB_URL=" + dbUrl,
},
Cmd: []string{
"node", "bin/src/server/app.js", "gen", "types", "typescript", "--exclude-schemas", "auth,extensions,graphql,graphql_public,realtime,storage,supabase_functions,supabase_migrations",
"node", "bin/src/server/app.js", "gen", "types", "typescript", "--include-schemas", strings.Join(append([]string{"public"}, utils.Config.Api.Schemas...), ","),
},
},
&container.HostConfig{},
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
InbucketImage = "inbucket/inbucket:stable"
PostgrestImage = "postgrest/postgrest:v9.0.0.20220211"
DifferImage = "supabase/pgadmin-schema-diff:cli-0.0.4"
PgmetaImage = "supabase/postgres-meta:v0.40.0"
PgmetaImage = "supabase/postgres-meta:v0.42.1"
// TODO: Hardcode version once provided upstream.
StudioImage = "supabase/studio:latest"
DenoRelayImage = "supabase/deno-relay:v1.2.0"
Expand Down

0 comments on commit cbf759d

Please sign in to comment.