Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Argument, Command, Flag } from "effect/unstable/cli";
import { withHidden, withHiddenFromConfig } from "../../../../shared/cli/hidden-flag.ts";
import { legacyFunctionsDeploy } from "./deploy.handler.ts";

const config = {
Expand Down Expand Up @@ -29,20 +28,19 @@ const config = {
Flag.withDescription("Maximum number of parallel jobs."),
Flag.optional,
),
useDocker: withHidden(
Flag.boolean("use-docker").pipe(
Flag.withDescription("Use Docker to bundle functions locally."),
),
useDocker: Flag.boolean("use-docker").pipe(
Flag.withDescription("Use Docker to bundle functions locally."),
Flag.withHidden,
),
legacyBundle: withHidden(
Flag.boolean("legacy-bundle").pipe(Flag.withDescription("Use legacy bundling.")),
legacyBundle: Flag.boolean("legacy-bundle").pipe(
Flag.withDescription("Use legacy bundling."),
Flag.withHidden,
),
} as const;

export const legacyFunctionsDeployCommand = Command.make("deploy", config).pipe(
Command.withDescription("Deploy a Function to the linked Supabase project."),
Command.withShortDescription("Deploy a Function to Supabase"),
withHiddenFromConfig(config),
Command.withHandler((flags) =>
legacyFunctionsDeploy({
functionNames: flags.functionNames.map(String),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Argument, Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withHidden, withHiddenFromConfig } from "../../../../shared/cli/hidden-flag.ts";
import { legacyFunctionsDownload } from "./download.handler.ts";

const config = {
Expand All @@ -15,13 +14,13 @@ const config = {
useApi: Flag.boolean("use-api").pipe(
Flag.withDescription("Unbundle functions server-side without using Docker."),
),
useDocker: withHidden(
Flag.boolean("use-docker").pipe(
Flag.withDescription("Use Docker to unbundle functions locally."),
),
useDocker: Flag.boolean("use-docker").pipe(
Flag.withDescription("Use Docker to unbundle functions locally."),
Flag.withHidden,
),
legacyBundle: withHidden(
Flag.boolean("legacy-bundle").pipe(Flag.withDescription("Use legacy bundling.")),
legacyBundle: Flag.boolean("legacy-bundle").pipe(
Flag.withDescription("Use legacy bundling."),
Flag.withHidden,
),
} as const;

Expand All @@ -32,6 +31,5 @@ export const legacyFunctionsDownloadCommand = Command.make("download", config).p
"Download the source code for a Function from the linked Supabase project. If no function name is provided, downloads all functions.",
),
Command.withShortDescription("Download a Function from Supabase"),
withHiddenFromConfig(config),
Command.withHandler((flags) => legacyFunctionsDownload(flags)),
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withHidden, withHiddenFromConfig } from "../../../../shared/cli/hidden-flag.ts";
import { legacyFunctionsServe } from "./serve.handler.ts";

const INSPECT_MODES = ["run", "brk", "wait"] as const;
Expand All @@ -25,8 +24,10 @@ const config = {
inspectMain: Flag.boolean("inspect-main").pipe(
Flag.withDescription("Allow inspecting the main worker."),
),
all: withHidden(
Flag.boolean("all").pipe(Flag.withDescription("Serve all Functions."), Flag.optional),
all: Flag.boolean("all").pipe(
Flag.withDescription("Serve all Functions."),
Flag.optional,
Flag.withHidden,
),
} as const;

Expand All @@ -35,6 +36,5 @@ export type LegacyFunctionsServeFlags = CliCommand.Command.Config.Infer<typeof c
export const legacyFunctionsServeCommand = Command.make("serve", config).pipe(
Command.withDescription("Serve all Functions locally."),
Command.withShortDescription("Serve all Functions locally"),
withHiddenFromConfig(config),
Command.withHandler((flags) => legacyFunctionsServe(flags)),
);
21 changes: 9 additions & 12 deletions apps/cli/src/legacy/commands/init/init.command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withHidden, withHiddenFromConfig } from "../../../shared/cli/hidden-flag.ts";
import { legacyInit } from "./init.handler.ts";

const config = {
Expand All @@ -14,18 +13,17 @@ const config = {
force: Flag.boolean("force").pipe(
Flag.withDescription("Overwrite existing supabase/config.toml."),
),
withVscodeWorkspace: withHidden(
Flag.boolean("with-vscode-workspace").pipe(Flag.withDescription("Generate VS Code workspace.")),
withVscodeWorkspace: Flag.boolean("with-vscode-workspace").pipe(
Flag.withDescription("Generate VS Code workspace."),
Flag.withHidden,
),
withVscodeSettings: withHidden(
Flag.boolean("with-vscode-settings").pipe(
Flag.withDescription("Generate VS Code settings for Deno."),
),
withVscodeSettings: Flag.boolean("with-vscode-settings").pipe(
Flag.withDescription("Generate VS Code settings for Deno."),
Flag.withHidden,
),
withIntellijSettings: withHidden(
Flag.boolean("with-intellij-settings").pipe(
Flag.withDescription("Generate IntelliJ IDEA settings for Deno."),
),
withIntellijSettings: Flag.boolean("with-intellij-settings").pipe(
Flag.withDescription("Generate IntelliJ IDEA settings for Deno."),
Flag.withHidden,
),
} as const;

Expand All @@ -34,6 +32,5 @@ export type LegacyInitFlags = CliCommand.Command.Config.Infer<typeof config>;
export const legacyInitCommand = Command.make("init", config).pipe(
Command.withDescription("Initialize a local project."),
Command.withShortDescription("Initialize a local project"),
withHiddenFromConfig(config),
Command.withHandler((flags) => legacyInit(flags)),
);
22 changes: 9 additions & 13 deletions apps/cli/src/legacy/commands/projects/create/create.command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Argument, Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withHidden, withHiddenFromConfig } from "../../../../shared/cli/hidden-flag.ts";
import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts";
import { legacyManagementApiRuntimeLayer } from "../../../shared/legacy-management-api-runtime.layer.ts";
import { withLegacyCommandInstrumentation } from "../../../telemetry/legacy-command-instrumentation.ts";
Expand Down Expand Up @@ -70,18 +69,16 @@ const config = {
Flag.withDescription("Select a desired instance size for your project."),
Flag.optional,
),
interactive: withHidden(
Flag.boolean("interactive").pipe(
Flag.withDescription("Enables interactive mode."),
Flag.withAlias("i"),
Flag.optional,
),
interactive: Flag.boolean("interactive").pipe(
Flag.withDescription("Enables interactive mode."),
Flag.withAlias("i"),
Flag.optional,
Flag.withHidden,
),
plan: withHidden(
Flag.string("plan").pipe(
Flag.withDescription("Select a plan that suits your needs."),
Flag.optional,
),
plan: Flag.string("plan").pipe(
Flag.withDescription("Select a plan that suits your needs."),
Flag.optional,
Flag.withHidden,
),
};
export type LegacyProjectsCreateFlags = CliCommand.Command.Config.Infer<typeof config>;
Expand All @@ -96,7 +93,6 @@ export const legacyProjectsCreateCommand = Command.make("create", config).pipe(
description: "Create a new project",
},
]),
withHiddenFromConfig(config),
Command.withHandler((flags) =>
legacyProjectsCreate(flags).pipe(
withLegacyCommandInstrumentation({ flags, safeFlags: ["org-id"] }),
Expand Down
7 changes: 3 additions & 4 deletions apps/cli/src/legacy/commands/start/start.command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withHidden, withHiddenFromConfig } from "../../../shared/cli/hidden-flag.ts";
import { legacyStart } from "./start.handler.ts";

const config = {
Expand All @@ -15,8 +14,9 @@ const config = {
ignoreHealthCheck: Flag.boolean("ignore-health-check").pipe(
Flag.withDescription("Ignore unhealthy services and exit 0"),
),
preview: withHidden(
Flag.boolean("preview").pipe(Flag.withDescription("Connect to feature preview branch")),
preview: Flag.boolean("preview").pipe(
Flag.withDescription("Connect to feature preview branch"),
Flag.withHidden,
),
} as const;

Expand All @@ -25,6 +25,5 @@ export type LegacyStartFlags = CliCommand.Command.Config.Infer<typeof config>;
export const legacyStartCommand = Command.make("start", config).pipe(
Command.withDescription("Start containers for Supabase local development."),
Command.withShortDescription("Start local Supabase stack"),
withHiddenFromConfig(config),
Command.withHandler((flags) => legacyStart(flags)),
);
11 changes: 4 additions & 7 deletions apps/cli/src/legacy/commands/stop/stop.command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withHidden, withHiddenFromConfig } from "../../../shared/cli/hidden-flag.ts";
import { legacyStop } from "./stop.handler.ts";

const config = {
Expand All @@ -10,11 +9,10 @@ const config = {
),
// Hidden boolean kept for Go CLI parity: `--backup=false` is the historical
// way to skip the backup and is functionally identical to `--no-backup`.
backup: withHidden(
Flag.boolean("backup").pipe(
Flag.withDescription("Backs up the current database before stopping."),
Flag.withDefault(true),
),
backup: Flag.boolean("backup").pipe(
Flag.withDescription("Backs up the current database before stopping."),
Flag.withDefault(true),
Flag.withHidden,
),
noBackup: Flag.boolean("no-backup").pipe(
Flag.withDescription("Deletes all data volumes after stopping."),
Expand All @@ -29,6 +27,5 @@ export type LegacyStopFlags = CliCommand.Command.Config.Infer<typeof config>;
export const legacyStopCommand = Command.make("stop", config).pipe(
Command.withDescription("Stop all local Supabase containers."),
Command.withShortDescription("Stop all local Supabase containers"),
withHiddenFromConfig(config),
Command.withHandler((flags) => legacyStop(flags)),
);
83 changes: 0 additions & 83 deletions apps/cli/src/shared/cli/hidden-flag.ts

This file was deleted.

Loading
Loading