Skip to content

Commit 4ba7bd9

Browse files
committed
refactor: move ExecuteResult to js-execution
It fits better here logically
1 parent c4d74d9 commit 4ba7bd9

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

apps/backend/src/lib/email-rendering.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { executeJavascript } from '@/lib/js-execution';
1+
import { executeJavascript, type ExecuteResult } from '@/lib/js-execution';
22
import { emptyEmailTheme } from '@stackframe/stack-shared/dist/helpers/emails';
33
import { getNodeEnvironment } from '@stackframe/stack-shared/dist/utils/env';
44
import { captureError, StackAssertionError } from '@stackframe/stack-shared/dist/utils/errors';
@@ -70,9 +70,6 @@ const entryJs = deindent`
7070
`;
7171

7272
type EmailRenderResult = { html: string, text: string, subject?: string, notificationCategory?: string };
73-
type ExecuteResult =
74-
| { status: "ok", data: unknown }
75-
| { status: "error", error: unknown };
7673

7774
async function bundleAndExecute<T>(
7875
files: Record<string, string> & { '/entry.js': string },

apps/backend/src/lib/js-execution.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type ExecuteJavascriptOptions = {
1111
engine?: 'freestyle' | 'vercel-sandbox',
1212
};
1313

14-
type ExecuteResult =
14+
export type ExecuteResult =
1515
| { status: "ok", data: unknown }
1616
| { status: "error", error: { message: string, stack?: string, cause?: unknown } };
1717

0 commit comments

Comments
 (0)