fix(backend): avoid dynamic imports in project handlers

This commit is contained in:
sai karthik
2026-07-24 02:35:45 +05:30
parent b49ca236cf
commit 45e9fb1b77

View File

@@ -12,7 +12,11 @@ import type { Id } from "./_generated/dataModel";
import { action, internalMutation, query } from "./_generated/server";
import { createInitialArtifacts } from "./artifactModel";
import { requireCurrentOrganization } from "./authz";
import { persistPublicGitImportTransaction } from "./projectStore";
import {
makeProjectMutationStore,
makeProjectQueryStore,
persistPublicGitImportTransaction,
} from "./projectStore";
// ---------------------------------------------------------------------------
// Internal: persist a public Git import in one transaction
@@ -146,7 +150,6 @@ export const putContextDocument = internalMutation({
),
},
handler: async (ctx, args) => {
const { makeProjectMutationStore } = await import("./projectStore");
const store = makeProjectMutationStore(ctx);
return store.putContext(args.userId, args.projectId, args.write as never);
},
@@ -160,7 +163,6 @@ export const list = query({
args: {},
handler: async (ctx): Promise<ProjectView[]> => {
const { userId } = await requireCurrentOrganization(ctx);
const { makeProjectQueryStore } = await import("./projectStore");
const store = makeProjectQueryStore(ctx);
return store.listProjects(userId);
},
@@ -174,7 +176,6 @@ export const get = query({
args: { projectId: v.id("projects") },
handler: async (ctx, args): Promise<ProjectView | null> => {
const { userId } = await requireCurrentOrganization(ctx);
const { makeProjectQueryStore } = await import("./projectStore");
const store = makeProjectQueryStore(ctx);
return store.getProject(userId, args.projectId);
},
@@ -216,7 +217,6 @@ export const putText = internalMutation({
},
handler: async (ctx, args) => {
const { userId } = await requireCurrentOrganization(ctx);
const { makeProjectMutationStore } = await import("./projectStore");
const store = makeProjectMutationStore(ctx);
return store.putContext(userId, args.projectId, {
_tag: "UserText" as const,