Skip to content

Commit

Permalink
Remove supabasejs from runtime (#855)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia authored Sep 27, 2024
1 parent 37d1ce1 commit c2ca2ba
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 148 deletions.
5 changes: 0 additions & 5 deletions engine/decofile/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import type { PromiseOrValue } from "../core/utils.ts";
import { ENTRYPOINT } from "./constants.ts";
import { fromEndpoint } from "./fetcher.ts";
import { newFsProvider } from "./fs.ts";
import { newRealtime } from "./realtime.ts";
import { fromConfigsTable } from "./release.ts";

export interface SelectionConfig {
audiences: unknown[];
Expand Down Expand Up @@ -104,7 +102,6 @@ const DECOFILE_PATH_FROM_ENV = Deno.env.get(DECOFILE_RELEASE_ENV_VAR);
* @returns the config store provider.
*/
export const getProvider = async (
site: string,
localStorageOnly = false,
): Promise<DecofileProvider> => {
const providers = [];
Expand All @@ -125,8 +122,6 @@ export const getProvider = async (
),
);
providers.push(fromEndpoint(endpoint));
} else {
providers.push(newRealtime(fromConfigsTable(site), true)); // if not deploy so no background is needed
}

if (Deno.env.has("USE_LOCAL_STORAGE")) {
Expand Down
102 changes: 0 additions & 102 deletions engine/decofile/release.ts

This file was deleted.

4 changes: 2 additions & 2 deletions engine/manifest/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const fulfillContext = async <
}
ctx.namespace ??= `deco-sites/${currentSite}`;
ctx.site = currentSite!;
const provider = release ?? await getProvider(ctx.site);
const provider = release ?? await getProvider();
const runtimePromise = deferred<DecoRuntimeState<T>>();
ctx.runtime = runtimePromise.finally(() => {
ctx.instance.readyAt = new Date();
Expand Down Expand Up @@ -442,7 +442,7 @@ export const $live = async <T extends AppManifest>(
(curr, acc) => buildRuntime<AppManifest, RouteContext>(curr, acc),
[m, {}, []] as [AppManifest, ResolverMap<RouteContext>, DanglingRecover[]],
);
const provider = release ?? await getProvider(context.site);
const provider = release ?? await getProvider();
context.release = provider;
const resolver = new ReleaseResolver<RouteContext>({
resolvers: { ...resolvers, ...defaultResolvers },
Expand Down
2 changes: 1 addition & 1 deletion runtime/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Deco<TAppManifest extends AppManifest = AppManifest> {
opts?: DecoOptions<TAppManifest>,
): Promise<Deco<TAppManifest>> {
const site = opts?.site ?? siteNameFromEnv() ?? randomSiteName();
const decofile = opts?.decofile ?? await getProvider(site);
const decofile = opts?.decofile ?? await getProvider();
const manifest = opts?.manifest ?? (await import(
toFileUrl(join(Deno.cwd(), "manifest.gen.ts")).href
).then((mod) => mod.default));
Expand Down
38 changes: 0 additions & 38 deletions supabase.ts

This file was deleted.

0 comments on commit c2ca2ba

Please sign in to comment.