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
2 changes: 1 addition & 1 deletion .repos/effect
Submodule effect updated 749 files
2 changes: 1 addition & 1 deletion .repos/lalph
Submodule lalph updated 825 files
2 changes: 1 addition & 1 deletion .repos/opencode
Submodule opencode updated 811 files
2 changes: 1 addition & 1 deletion .repos/t3code
Submodule t3code updated 735 files
4 changes: 2 additions & 2 deletions apps/cli-e2e/src/server/pg-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface PgFixture {
rows: (string | null)[][];
}

export interface PgError {
interface PgError {
/** 5-char SQLSTATE code, e.g. "42501" (insufficient_privilege). */
code: string;
/** Human-readable error message. */
Expand All @@ -46,7 +46,7 @@ export interface PgError {
severity?: string;
}

export type PgMockState =
type PgMockState =
| { type: "empty" }
| { type: "fixture"; fixture: PgFixture }
| { type: "error"; error: PgError };
Expand Down
38 changes: 18 additions & 20 deletions apps/cli/package.json
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the important change, we're moving all dependencies as dev dependencies as they're packaged in the final Bun binary and we don't want them to end up in node_modules when the users do npm install

Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,13 @@
"check:all": "nx run-many -t types:check lint:check fmt:check knip:check --projects=$npm_package_name",
"fix:all": "nx run-many -t lint:fix fmt:fix knip:fix --projects=$npm_package_name"
},
"dependencies": {
"@clack/prompts": "^1.2.0",
"devDependencies": {
"@clack/prompts": "^1.4.0",
"@effect/atom-react": "catalog:",
"@effect/platform-bun": "catalog:",
"@napi-rs/keyring": "^1.1.2",
"@parcel/watcher": "^2.5.6",
"@vercel/detect-agent": "^1.2.3",
"effect": "catalog:",
"ink": "^7.0.1",
"ink-spinner": "^5.0.0",
"posthog-node": "^5.29.4",
"react": "^19.2.5"
},
"devDependencies": {
"@effect/vitest": "catalog:",
"@napi-rs/keyring": "^1.3.0",
"@parcel/watcher": "^2.5.6",
"@supabase/api": "workspace:*",
"@supabase/config": "workspace:*",
"@supabase/process-compose": "workspace:*",
Expand All @@ -59,23 +51,21 @@
"@types/bun": "catalog:",
"@types/react": "^19.2.14",
"@typescript/native-preview": "catalog:",
"@vercel/detect-agent": "^1.2.3",
"@vitest/coverage-istanbul": "catalog:",
"effect": "catalog:",
"ink": "^7.0.3",
"ink-spinner": "^5.0.0",
"knip": "catalog:",
"oxfmt": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"posthog-node": "^5.34.3",
"react": "^19.2.6",
"react-devtools-core": "^7.0.1",
"vitest": "catalog:"
},
"optionalDependencies": {
"@parcel/watcher-darwin-arm64": "2.5.6",
"@parcel/watcher-darwin-x64": "2.5.6",
"@parcel/watcher-linux-arm64-glibc": "2.5.6",
"@parcel/watcher-linux-arm64-musl": "2.5.6",
"@parcel/watcher-linux-x64-glibc": "2.5.6",
"@parcel/watcher-linux-x64-musl": "2.5.6",
"@parcel/watcher-win32-arm64": "2.5.6",
"@parcel/watcher-win32-x64": "2.5.6",
"@supabase/cli-darwin-arm64": "workspace:*",
"@supabase/cli-darwin-x64": "workspace:*",
"@supabase/cli-linux-arm64": "workspace:*",
Expand Down Expand Up @@ -112,6 +102,14 @@
"nx"
],
"ignoreDependencies": [
"@parcel/watcher-darwin-arm64",
"@parcel/watcher-darwin-x64",
"@parcel/watcher-linux-arm64-glibc",
"@parcel/watcher-linux-arm64-musl",
"@parcel/watcher-linux-x64-glibc",
"@parcel/watcher-linux-x64-musl",
"@parcel/watcher-win32-arm64",
"@parcel/watcher-win32-x64",
"@typescript/native-preview",
"oxfmt",
"oxlint",
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/src/next/auth/api.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Effect, Redacted } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

import type { ApiError } from "./errors.ts";

Expand Down Expand Up @@ -27,4 +27,4 @@ interface ApiShape {
) => Effect.Effect<ProfileResponse, ApiError>;
}

export class Api extends ServiceMap.Service<Api, ApiShape>()("supabase/auth/Api") {}
export class Api extends Context.Service<Api, ApiShape>()("supabase/auth/Api") {}
4 changes: 2 additions & 2 deletions apps/cli/src/next/auth/credentials.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Effect, Option, Redacted } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

/**
* Credentials - Boundary for loading and persisting the CLI access token.
Expand All @@ -17,6 +17,6 @@ interface CredentialsShape {
/**
* Credentials - Service tag for access token persistence.
*/
export class Credentials extends ServiceMap.Service<Credentials, CredentialsShape>()(
export class Credentials extends Context.Service<Credentials, CredentialsShape>()(
"supabase/auth/Credentials",
) {}
4 changes: 2 additions & 2 deletions apps/cli/src/next/auth/crypto.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ECDH } from "node:crypto";
import type { Effect } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

export type EncryptedPayload = { ciphertext: string; publicKey: string; nonce: string };

Expand All @@ -11,4 +11,4 @@ interface CryptoShape {
readonly decryptToken: (ecdh: ECDH, payload: EncryptedPayload) => Effect.Effect<string>;
}

export class Crypto extends ServiceMap.Service<Crypto, CryptoShape>()("supabase/auth/Crypto") {}
export class Crypto extends Context.Service<Crypto, CryptoShape>()("supabase/auth/Crypto") {}
4 changes: 2 additions & 2 deletions apps/cli/src/next/auth/platform-api.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ApiClient } from "@supabase/api/effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

export class PlatformApi extends ServiceMap.Service<PlatformApi, ApiClient>()(
export class PlatformApi extends Context.Service<PlatformApi, ApiClient>()(
"supabase/auth/PlatformApi",
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
StateManager,
type EdgeRuntimeConfig,
} from "@supabase/stack/effect";
import { Duration, Effect, FileSystem, Layer, Option, ServiceMap, Stream } from "effect";
import { Duration, Effect, FileSystem, Layer, Option, Stream } from "effect";
import { join } from "node:path";
import { CliConfig } from "../../../config/cli-config.service.ts";
import { ProjectHome } from "../../../config/project-home.service.ts";
Expand Down Expand Up @@ -52,7 +52,7 @@ interface FunctionsDevWatchChange {
readonly touchesProjectConfig: boolean;
}

type StackService = ServiceMap.Service.Shape<typeof Stack>;
type StackService = typeof Stack.Service;

function versionsFromContext(context: ResolvedServiceVersionContext) {
return withServiceVersions(toStartStackConfig([], "auto"), context.runtimeVersions);
Expand Down Expand Up @@ -93,7 +93,7 @@ const startFullStack = Effect.fnUntraced(function* (opts: FunctionsDevStackOptio

const stackLayer = yield* daemonLayer(config, daemonEntryPoint);
yield* startStackWithProgress().pipe(Effect.provide(stackLayer));
const stack = yield* Stack.asEffect().pipe(Effect.provide(stackLayer));
const stack = yield* Stack.pipe(Effect.provide(stackLayer));

return { stack, startedByCommand: true };
});
Expand All @@ -117,7 +117,7 @@ export const connectOrStartFunctionsDevStack = Effect.fnUntraced(function* (
);

if (Option.isSome(existingLayer)) {
const stack = yield* Stack.asEffect().pipe(Effect.provide(existingLayer.value));
const stack = yield* Stack.pipe(Effect.provide(existingLayer.value));
return { stack, startedByCommand: false };
}

Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/next/commands/link/link.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const link = Effect.fnUntraced(function* (flags: LinkFlags) {
const output = yield* Output;
const analytics = yield* Analytics;
const projectHome = yield* ProjectHome;
const stateManager = yield* StateManager.asEffect().pipe(
const stateManager = yield* StateManager.pipe(
Effect.provide(StateManager.make(projectStateManagerPathsFromRoot(projectHome.projectHomeDir))),
);

Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/next/commands/logs/logs.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const logs = Effect.fnUntraced(function* (flags: LogsFlags) {
projectStateRoot: projectHome.projectHomeDir,
name: flags.stack,
});
const stack = yield* Effect.provide(Stack.asEffect(), layer);
const stack = yield* Effect.provide(Stack, layer);
const services = flags.service.length === 0 ? undefined : flags.service;
const history = flags.tail > 0 ? yield* stack.logHistoryAll(flags.tail, services) : [];
const historyStream = Stream.fromIterable(history).pipe(
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/next/commands/platform/platform-openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ObjectShape = {

export type PlatformOpenApiSchema = OpenApiSchema;
export type PlatformOpenApiParameter = OpenApiParameter;
export type PlatformOpenApiRequestBody = OpenApiRequestBody;
type PlatformOpenApiRequestBody = OpenApiRequestBody;
export type PlatformOpenApiResponse = OpenApiResponse;

export type PlatformOpenApiOperationEntry = {
Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/next/commands/platform/platform-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { PlatformApi } from "../../auth/platform-api.service.ts";

export type PlatformHttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";

export type PlatformFieldLocation = "path" | "query" | "header" | "body";
type PlatformFieldLocation = "path" | "query" | "header" | "body";

export type PlatformFieldKind = "string" | "boolean" | "enum" | "unknown" | "array" | "object";
type PlatformFieldKind = "string" | "boolean" | "enum" | "unknown" | "array" | "object";

export type PlatformSchemaKind = PlatformFieldKind | "integer" | "number" | "union";

export type PlatformBodyKind = "none" | "json" | "binary" | "multipart" | "urlencoded";
type PlatformBodyKind = "none" | "json" | "binary" | "multipart" | "urlencoded";

export interface PlatformSchemaNode {
readonly name?: string;
Expand Down Expand Up @@ -89,7 +89,7 @@ export interface PlatformRouteDescriptor {
}>;
}

export type PlatformOperationError = PlatformInputError | SupabaseApiError;
type PlatformOperationError = PlatformInputError | SupabaseApiError;

interface PlatformInputError {
readonly _tag: "PlatformInputError";
Expand Down
9 changes: 4 additions & 5 deletions apps/cli/src/next/commands/start/start.command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Effect, Layer, Option, ServiceMap } from "effect";
import { Effect, Layer, Option, Context } from "effect";
import {
DEFAULT_MANAGED_STACK_NAME,
StateManager,
Expand Down Expand Up @@ -65,10 +65,9 @@ interface StartVersionStateShape {
readonly serviceVersionContext: ResolvedServiceVersionContext;
}

export class StartVersionState extends ServiceMap.Service<
StartVersionState,
StartVersionStateShape
>()("supabase/commands/start/StartVersionState") {}
export class StartVersionState extends Context.Service<StartVersionState, StartVersionStateShape>()(
"supabase/commands/start/StartVersionState",
) {}

const flags = {
stack: Flag.string("stack").pipe(
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/src/next/commands/start/ui/dashboard-state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Effect, Layer, ServiceMap, Stream, SubscriptionRef } from "effect";
import { Effect, Layer, Context, Stream, SubscriptionRef } from "effect";
import type { StackServiceState, StackInfo } from "@supabase/stack/effect";
import { Stack } from "@supabase/stack/effect";

Expand All @@ -13,7 +13,7 @@ function updateServiceStates(
: [...current, state];
}

export class StartDashboardState extends ServiceMap.Service<
export class StartDashboardState extends Context.Service<
StartDashboardState,
{
readonly stackInfoRef: SubscriptionRef.SubscriptionRef<StackInfo | null>;
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/next/commands/status/status.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const status = Effect.fnUntraced(function* (_flags: StatusFlags) {
name: _flags.stack,
});

const stack = yield* Effect.provide(Stack.asEffect(), layer.value);
const stack = yield* Effect.provide(Stack, layer.value);
const [info, services] = yield* Effect.all([stack.getInfo(), stack.getAllStates()]);
const existingMetadata = yield* stateManager.readMetadata(managedStack.state.name).pipe(
Effect.map(Option.some),
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/src/next/config/cli-config.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Option, Redacted } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

interface CliConfigShape {
readonly apiUrl: string;
Expand All @@ -16,6 +16,6 @@ interface CliConfigShape {
readonly doNotTrack: Option.Option<string>;
}

export class CliConfig extends ServiceMap.Service<CliConfig, CliConfigShape>()(
export class CliConfig extends Context.Service<CliConfig, CliConfigShape>()(
"supabase/config/CliConfig",
) {}
4 changes: 2 additions & 2 deletions apps/cli/src/next/config/project-context.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { ProjectConfig, ProjectEnvironment, ProjectPaths } from "@supabase/config";
import type { Option } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

interface ProjectContextShape {
readonly paths: Option.Option<ProjectPaths>;
readonly projectEnv: Option.Option<ProjectEnvironment>;
readonly rawProjectConfig: Option.Option<ProjectConfig>;
}

export class ProjectContext extends ServiceMap.Service<ProjectContext, ProjectContextShape>()(
export class ProjectContext extends Context.Service<ProjectContext, ProjectContextShape>()(
"supabase/config/ProjectContext",
) {}
4 changes: 2 additions & 2 deletions apps/cli/src/next/config/project-home.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Effect } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";

interface ProjectHomeShape {
readonly projectRoot: string;
Expand All @@ -15,6 +15,6 @@ interface ProjectHomeShape {
readonly stackLogsDir: (name: string) => string;
}

export class ProjectHome extends ServiceMap.Service<ProjectHome, ProjectHomeShape>()(
export class ProjectHome extends Context.Service<ProjectHome, ProjectHomeShape>()(
"supabase/config/ProjectHome",
) {}
9 changes: 4 additions & 5 deletions apps/cli/src/next/config/project-link-remote.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Effect } from "effect";
import { ServiceMap } from "effect";
import { Context } from "effect";
import type { LinkedServiceVersions } from "./project-link-state.service.ts";

export const linkedProjectVersionServices = ["postgres", "postgrest", "auth", "storage"] as const;
Expand Down Expand Up @@ -31,7 +31,6 @@ interface ProjectLinkRemoteShape {
) => Effect.Effect<LinkedProjectSnapshot, unknown>;
}

export class ProjectLinkRemote extends ServiceMap.Service<
ProjectLinkRemote,
ProjectLinkRemoteShape
>()("supabase/config/ProjectLinkRemote") {}
export class ProjectLinkRemote extends Context.Service<ProjectLinkRemote, ProjectLinkRemoteShape>()(
"supabase/config/ProjectLinkRemote",
) {}
8 changes: 4 additions & 4 deletions apps/cli/src/next/config/project-link-state.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Effect, Option } from "effect";
import { Data, Schema, ServiceMap } from "effect";
import { Data, Schema, Context } from "effect";

export const LinkedServiceVersionsSchema = Schema.Struct({
const LinkedServiceVersionsSchema = Schema.Struct({
postgres: Schema.optionalKey(Schema.String),
postgrest: Schema.optionalKey(Schema.String),
auth: Schema.optionalKey(Schema.String),
Expand All @@ -10,7 +10,7 @@ export const LinkedServiceVersionsSchema = Schema.Struct({

export type LinkedServiceVersions = Schema.Schema.Type<typeof LinkedServiceVersionsSchema>;

export const ActiveBranchSchema = Schema.Struct({
const ActiveBranchSchema = Schema.Struct({
ref: Schema.String,
name: Schema.String,
is_default: Schema.Boolean,
Expand Down Expand Up @@ -57,6 +57,6 @@ interface ProjectLinkStateShape {
) => Effect.Effect<void, InvalidProjectLinkStateError | ProjectNotLinkedError>;
}

export class ProjectLinkState extends ServiceMap.Service<ProjectLinkState, ProjectLinkStateShape>()(
export class ProjectLinkState extends Context.Service<ProjectLinkState, ProjectLinkStateShape>()(
"supabase/config/ProjectLinkState",
) {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Effect, Option } from "effect";
import { Data, Schema, ServiceMap } from "effect";
import { Data, Schema, Context } from "effect";

const LocalServiceVersionsSchema = Schema.Struct({
postgres: Schema.optionalKey(Schema.String),
Expand Down Expand Up @@ -37,7 +37,7 @@ interface ProjectLocalServiceVersionsShape {
>;
}

export class ProjectLocalServiceVersions extends ServiceMap.Service<
export class ProjectLocalServiceVersions extends Context.Service<
ProjectLocalServiceVersions,
ProjectLocalServiceVersionsShape
>()("supabase/config/ProjectLocalServiceVersions") {}
Loading
Loading