Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
87ecfdb
chore: sync API types from infrastructure (#4581)
supabase-cli-releaser[bot] Dec 4, 2025
5537961
fix: use double width emoji as icons (#4582)
sweatybridge Dec 4, 2025
c517625
fix(docker): bump the docker-minor group in /pkg/config/templates wit…
dependabot[bot] Dec 5, 2025
48f5c70
fix(docker): bump supabase/postgres from 17.6.1.059 to 17.6.1.061 in …
dependabot[bot] Dec 5, 2025
fab11c2
fix(docker): bump supabase/logflare from 1.26.22 to 1.26.24 in /pkg/c…
dependabot[bot] Dec 6, 2025
69d1666
fix(docker): bump supabase/postgres from 17.6.1.061 to 17.6.1.062 in …
dependabot[bot] Dec 6, 2025
08a7867
fix(docker): bump the docker-minor group in /pkg/config/templates wit…
dependabot[bot] Dec 9, 2025
912594c
fix(docker): bump supabase/postgres from 17.6.1.062 to 17.6.1.063 in …
dependabot[bot] Dec 9, 2025
e436380
fix: scope project region by current profile (#4596)
sweatybridge Dec 9, 2025
50da8ee
fix(docker): bump the docker-minor group in /pkg/config/templates wit…
dependabot[bot] Dec 10, 2025
34b8667
chore: sync API types from infrastructure (#4602)
supabase-cli-releaser[bot] Dec 10, 2025
f1c3b1c
refactor(cli): move Deno/IntelliJ prompts from init to functions new …
avallete Dec 10, 2025
e06f905
fix(docker): bump supabase/postgres from 17.6.1.063 to 17.6.1.064 in …
dependabot[bot] Dec 11, 2025
28de7d2
fix(docker): bump supabase/realtime from v2.67.6 to v2.68.2 in /pkg/c…
dependabot[bot] Dec 11, 2025
5abbdf1
fix: enable s3 locally by default (#4609)
sweatybridge Dec 11, 2025
b316148
fix: change restart policy to unless stopped (#4603)
sweatybridge Dec 11, 2025
f513dbe
chore(deps): bump peter-evans/create-pull-request from 7 to 8 in the …
dependabot[bot] Dec 11, 2025
09b2513
feat(typegen): add python type generator (#4611)
silentworks Dec 11, 2025
4637e25
fix(docker): bump the docker-minor group in /pkg/config/templates wit…
dependabot[bot] Dec 12, 2025
79fc9bd
fix: remove deprecated Deno 2 flags to eliminate warnings (#4599)
avallete Dec 12, 2025
585a758
feat(cli): replace IDE flags with interactive mode in init (#4606)
avallete Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/api-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Create Pull Request
if: steps.check.outputs.has_changes == 'true'
id: cpr
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: "chore: sync API types from infrastructure"
Expand Down
1 change: 1 addition & 0 deletions cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var (
types.LangTypescript,
types.LangGo,
types.LangSwift,
types.LangPython,
},
Value: types.LangTypescript,
}
Expand Down
41 changes: 27 additions & 14 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ package cmd
import (
"fmt"
"os"
"os/signal"

"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/spf13/viper"
_init "github.com/supabase/cli/internal/init"
"github.com/supabase/cli/internal/utils"
"golang.org/x/term"
)

var (
createVscodeSettings = new(bool)
createIntellijSettings = new(bool)
initInteractive bool
createVscodeSettings bool
createIntellijSettings bool
initParams = utils.InitParams{}

initCmd = &cobra.Command{
Expand All @@ -34,16 +35,24 @@ var (
}
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
fsys := afero.NewOsFs()
if !cmd.Flags().Changed("with-vscode-settings") && !cmd.Flags().Changed("with-vscode-workspace") {
createVscodeSettings = nil
interactive := initInteractive && term.IsTerminal(int(os.Stdin.Fd()))
if err := _init.Run(ctx, fsys, interactive, initParams); err != nil {
return err
}

if !cmd.Flags().Changed("with-intellij-settings") {
createIntellijSettings = nil
// Handle backwards compatibility flags
if createVscodeSettings {
if err := _init.WriteVscodeConfig(fsys); err != nil {
return err
}
}
if createIntellijSettings {
if err := _init.WriteIntelliJConfig(fsys); err != nil {
return err
}
}
ctx, _ := signal.NotifyContext(cmd.Context(), os.Interrupt)
return _init.Run(ctx, fsys, createVscodeSettings, createIntellijSettings, initParams)
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
fmt.Println("Finished " + utils.Aqua("supabase init") + ".")
Expand All @@ -53,11 +62,15 @@ var (

func init() {
flags := initCmd.Flags()
flags.BoolVar(createVscodeSettings, "with-vscode-workspace", false, "Generate VS Code workspace.")
cobra.CheckErr(flags.MarkHidden("with-vscode-workspace"))
flags.BoolVar(createVscodeSettings, "with-vscode-settings", false, "Generate VS Code settings for Deno.")
flags.BoolVar(createIntellijSettings, "with-intellij-settings", false, "Generate IntelliJ IDEA settings for Deno.")
flags.BoolVarP(&initInteractive, "interactive", "i", false, "Enables interactive mode to configure IDE settings.")
flags.BoolVar(&initParams.UseOrioleDB, "use-orioledb", false, "Use OrioleDB storage engine for Postgres.")
flags.BoolVar(&initParams.Overwrite, "force", false, "Overwrite existing "+utils.ConfigPath+".")
// Backwards compatibility flags (hidden)
flags.BoolVar(&createVscodeSettings, "with-vscode-workspace", false, "Generate VS Code workspace.")
cobra.CheckErr(flags.MarkHidden("with-vscode-workspace"))
flags.BoolVar(&createVscodeSettings, "with-vscode-settings", false, "Generate VS Code settings for Deno.")
cobra.CheckErr(flags.MarkHidden("with-vscode-settings"))
flags.BoolVar(&createIntellijSettings, "with-intellij-settings", false, "Generate IntelliJ IDEA settings for Deno.")
cobra.CheckErr(flags.MarkHidden("with-intellij-settings"))
rootCmd.AddCommand(initCmd)
}
8 changes: 3 additions & 5 deletions cmd/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,9 @@ func init() {
}

func awsRegions() []string {
result := make([]string, len(utils.RegionMap))
i := 0
for k := range utils.RegionMap {
result[i] = k
i++
result := make([]string, len(utils.CurrentProfile.ProjectRegions))
for i, region := range utils.CurrentProfile.ProjectRegions {
result[i] = string(region)
}
sort.Strings(result)
return result
Expand Down
2 changes: 1 addition & 1 deletion internal/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Run(ctx context.Context, starter StarterTemplate, fsys afero.Fs, options ..
if err := downloadSample(ctx, client, starter.Url, fsys); err != nil {
return err
}
} else if err := initBlank.Run(ctx, fsys, nil, nil, utils.InitParams{Overwrite: true}); err != nil {
} else if err := initBlank.Run(ctx, fsys, false, utils.InitParams{Overwrite: true}); err != nil {
return err
}
// 1. Login
Expand Down
2 changes: 1 addition & 1 deletion internal/db/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func NewHostConfig() container.HostConfig {
hostPort := strconv.FormatUint(uint64(utils.Config.Db.Port), 10)
hostConfig := container.HostConfig{
PortBindings: nat.PortMap{"5432/tcp": []nat.PortBinding{{HostPort: hostPort}}},
RestartPolicy: container.RestartPolicy{Name: "always"},
RestartPolicy: container.RestartPolicy{Name: container.RestartPolicyUnlessStopped},
Binds: []string{
utils.DbId + ":/var/lib/postgresql/data",
},
Expand Down
10 changes: 9 additions & 1 deletion internal/functions/deploy/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap
hostOutputPath := filepath.Join(hostOutputDir, "output.eszip")
// Create exec command
cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath)}
// Handle import map/config flags based on Deno version
// Deno 2: use --config for deno.json files and legacy import_map.json
// Deno 1: use --import-map for all import map files
if len(importMap) > 0 {
cmd = append(cmd, "--import-map", utils.ToDockerPath(importMap))
dockerImportMapPath := utils.ToDockerPath(importMap)
if utils.Config.EdgeRuntime.DenoVersion > 1 {
cmd = append(cmd, "--config", dockerImportMapPath)
} else {
cmd = append(cmd, "--import-map", dockerImportMapPath)
}
}
for _, sf := range staticFiles {
cmd = append(cmd, "--static", utils.ToDockerPath(sf))
Expand Down
15 changes: 15 additions & 0 deletions internal/functions/new/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (

"github.com/go-errors/errors"
"github.com/spf13/afero"
"github.com/supabase/cli/internal/functions/deploy"
_init "github.com/supabase/cli/internal/init"
"github.com/supabase/cli/internal/utils"
"github.com/supabase/cli/internal/utils/flags"
)
Expand Down Expand Up @@ -38,6 +40,13 @@ func Run(ctx context.Context, slug string, fsys afero.Fs) error {
if err := utils.ValidateFunctionSlug(slug); err != nil {
return err
}
// Check if this is the first function being created
existingSlugs, err := deploy.GetFunctionSlugs(fsys)
if err != nil {
fmt.Fprintln(utils.GetDebugLogger(), err)
}
isFirstFunction := len(existingSlugs) == 0

// 2. Create new function.
funcDir := filepath.Join(utils.FunctionsDir, slug)
if err := utils.MkdirIfNotExistFS(fsys, funcDir); err != nil {
Expand All @@ -61,6 +70,12 @@ func Run(ctx context.Context, slug string, fsys afero.Fs) error {
return errors.Errorf("failed to create .npmrc config: %w", err)
}
fmt.Println("Created new Function at " + utils.Bold(funcDir))

if isFirstFunction {
if err := _init.PromptForIDESettings(ctx, fsys); err != nil {
return err
}
}
return nil
}

Expand Down
1 change: 1 addition & 0 deletions internal/functions/serve/templates/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ Deno.serve({
// NOTE(Nyannyacha): Decorator type has been set to tc39 by Lakshan's request,
// but in my opinion, we should probably expose this to customers at some
// point, as their migration process will not be easy.
// This need to be kept for Deno 1 compatibility.
const decoratorType = "tc39";

const absEntrypoint = posix.join(Deno.cwd(), functionsConfig[functionName].entrypointPath);
Expand Down
1 change: 1 addition & 0 deletions internal/gen/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
LangTypescript = "typescript"
LangGo = "go"
LangSwift = "swift"
LangPython = "python"
)

const (
Expand Down
50 changes: 26 additions & 24 deletions internal/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
intelliJDeno string
)

func Run(ctx context.Context, fsys afero.Fs, createVscodeSettings, createIntellijSettings *bool, params utils.InitParams) error {
func Run(ctx context.Context, fsys afero.Fs, interactive bool, params utils.InitParams) error {
// 1. Write `config.toml`.
if err := utils.InitConfig(params, fsys); err != nil {
if errors.Is(err, os.ErrExist) {
Expand All @@ -49,31 +49,31 @@ func Run(ctx context.Context, fsys afero.Fs, createVscodeSettings, createIntelli
}
}

// 3. Generate VS Code settings.
if createVscodeSettings != nil {
if *createVscodeSettings {
return writeVscodeConfig(fsys)
}
} else if createIntellijSettings != nil {
if *createIntellijSettings {
return writeIntelliJConfig(fsys)
}
} else {
console := utils.NewConsole()
if isVscode, err := console.PromptYesNo(ctx, "Generate VS Code settings for Deno?", false); err != nil {
return err
} else if isVscode {
return writeVscodeConfig(fsys)
}
if isIntelliJ, err := console.PromptYesNo(ctx, "Generate IntelliJ Settings for Deno?", false); err != nil {
// 3. Prompt for IDE settings in interactive mode.
if interactive {
if err := PromptForIDESettings(ctx, fsys); err != nil {
return err
} else if isIntelliJ {
return writeIntelliJConfig(fsys)
}
}
return nil
}

// PromptForIDESettings prompts the user to generate IDE settings for Deno.
func PromptForIDESettings(ctx context.Context, fsys afero.Fs) error {
console := utils.NewConsole()
if isVscode, err := console.PromptYesNo(ctx, "Generate VS Code settings for Deno?", true); err != nil {
return err
} else if isVscode {
return WriteVscodeConfig(fsys)
}
if isIntelliJ, err := console.PromptYesNo(ctx, "Generate IntelliJ IDEA settings for Deno?", false); err != nil {
return err
} else if isIntelliJ {
return WriteIntelliJConfig(fsys)
}
return nil
}

func updateGitIgnore(ignorePath string, fsys afero.Fs) error {
var contents []byte

Expand Down Expand Up @@ -146,7 +146,7 @@ func updateJsonFile(path string, template string, fsys afero.Fs) error {
return saveUserSettings(path, userSettings, fsys)
}

func writeVscodeConfig(fsys afero.Fs) error {
func WriteVscodeConfig(fsys afero.Fs) error {
// Create VS Code settings for Deno.
if err := utils.MkdirIfNotExistFS(fsys, vscodeDir); err != nil {
return err
Expand All @@ -157,14 +157,16 @@ func writeVscodeConfig(fsys afero.Fs) error {
if err := updateJsonFile(settingsPath, vscodeSettings, fsys); err != nil {
return err
}
fmt.Println("Generated VS Code settings in " + utils.Bold(settingsPath) + ". Please install the recommended extension!")
fmt.Println("Generated VS Code settings in " + utils.Bold(settingsPath) + ".")
fmt.Println("Please install the Deno extension for VS Code: " + utils.Bold("https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno"))
return nil
}

func writeIntelliJConfig(fsys afero.Fs) error {
func WriteIntelliJConfig(fsys afero.Fs) error {
if err := utils.WriteFile(denoPath, []byte(intelliJDeno), fsys); err != nil {
return err
}
fmt.Println("Generated IntelliJ settings in " + utils.Bold(denoPath) + ". Please install the Deno plugin!")
fmt.Println("Generated IntelliJ settings in " + utils.Bold(denoPath) + ".")
fmt.Println("Please install the Deno plugin for IntelliJ: " + utils.Bold("https://plugins.jetbrains.com/plugin/14382-deno"))
return nil
}
Loading