forked from supabase/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservices.command.ts
More file actions
34 lines (32 loc) · 1.78 KB
/
Copy pathservices.command.ts
File metadata and controls
34 lines (32 loc) · 1.78 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
import { Layer } from "effect";
import { Command } from "effect/unstable/cli";
import { FetchHttpClient } from "effect/unstable/http";
import { credentialsLayer } from "../../auth/credentials.layer.ts";
import { projectLocalServiceVersionsLayer } from "../../config/project-local-service-versions.layer.ts";
import { projectLinkStateLayer } from "../../config/project-link-state.layer.ts";
import { provideProjectCommandRuntime } from "../../config/project-runtime.layer.ts";
import { projectStackStateManagerLayer } from "../../config/project-stack-state-manager.layer.ts";
import { withJsonErrorHandling } from "../../../shared/output/json-error-handling.ts";
import { commandRuntimeLayer } from "../../../shared/runtime/command-runtime.layer.ts";
import { withCommandInstrumentation } from "../../../shared/telemetry/command-instrumentation.ts";
import { services } from "./services.handler.ts";
const servicesRuntimeLayer = provideProjectCommandRuntime(
Layer.mergeAll(
credentialsLayer,
projectLinkStateLayer,
projectLocalServiceVersionsLayer,
projectStackStateManagerLayer,
commandRuntimeLayer(["services"]),
// `fetchLinkedServiceVersions` builds its management/tenant API clients from
// the ambient HttpClient rather than self-provisioning one.
FetchHttpClient.layer,
),
);
export const servicesCommand = Command.make("services").pipe(
Command.withDescription(
"Show versions of local Supabase services.\n\nPrints the local image matrix and, when this checkout is linked and authenticated, best-effort linked service versions for comparison.",
),
Command.withShortDescription("Show versions of all Supabase services"),
Command.withHandler(() => services().pipe(withCommandInstrumentation(), withJsonErrorHandling)),
Command.provide(servicesRuntimeLayer),
);