forked from supabase/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.command.ts
More file actions
42 lines (39 loc) · 1.75 KB
/
Copy pathinit.command.ts
File metadata and controls
42 lines (39 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts";
import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts";
import { withLegacyCommandInstrumentation } from "../../telemetry/legacy-command-instrumentation.ts";
import { legacyInit } from "./init.handler.ts";
const config = {
interactive: Flag.boolean("interactive").pipe(
Flag.withDescription("Enables interactive mode to configure IDE settings."),
Flag.withAlias("i"),
),
useOrioledb: Flag.boolean("use-orioledb").pipe(
Flag.withDescription("Use OrioleDB storage engine for Postgres."),
),
force: Flag.boolean("force").pipe(
Flag.withDescription("Overwrite existing supabase/config.toml."),
),
withVscodeWorkspace: Flag.boolean("with-vscode-workspace").pipe(
Flag.withDescription("Generate VS Code workspace."),
Flag.withHidden,
),
withVscodeSettings: Flag.boolean("with-vscode-settings").pipe(
Flag.withDescription("Generate VS Code settings for Deno."),
Flag.withHidden,
),
withIntellijSettings: Flag.boolean("with-intellij-settings").pipe(
Flag.withDescription("Generate IntelliJ IDEA settings for Deno."),
Flag.withHidden,
),
} as const;
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"),
Command.withHandler((flags) =>
legacyInit(flags).pipe(withLegacyCommandInstrumentation({ flags }), withJsonErrorHandling),
),
Command.provide(commandRuntimeLayer(["init"])),
);