trigger.dev
Version:
A Command-Line Interface for Trigger.dev projects
82 lines (81 loc) • 2.54 kB
TypeScript
import { ResolvedConfig } from "@trigger.dev/core/v3/build";
import { BuildManifest, BuildTarget } from "@trigger.dev/core/v3/schemas";
import { BundleResult } from "./bundle.js";
export type BuildWorkerEventListener = {
onBundleStart?: () => void;
onBundleComplete?: (result: BundleResult) => void;
};
export type BuildWorkerOptions = {
destination: string;
target: BuildTarget;
environment: string;
branch?: string;
resolvedConfig: ResolvedConfig;
listener?: BuildWorkerEventListener;
envVars?: Record<string, string>;
rewritePaths?: boolean;
forcedExternals?: string[];
plain?: boolean;
};
export declare function buildWorker(options: BuildWorkerOptions): Promise<{
runtime: "node" | "node-22" | "bun";
environment: string;
config: {
project: string;
dirs: string[];
};
contentHash: string;
packageVersion: string;
cliPackageVersion: string;
deploy: {
env?: Record<string, string> | undefined;
sync?: {
env?: Record<string, string> | undefined;
parentEnv?: Record<string, string> | undefined;
} | undefined;
};
target: "dev" | "deploy" | "unmanaged";
files: {
out: string;
entry: string;
}[];
sources: Record<string, {
contentHash: string;
contents: string;
}>;
outputPath: string;
runWorkerEntryPoint: string;
indexWorkerEntryPoint: string;
configPath: string;
build: {
env?: Record<string, string> | undefined;
commands?: string[] | undefined;
};
image?: {
pkgs?: string[] | undefined;
instructions?: string[] | undefined;
} | undefined;
branch?: string | undefined;
runControllerEntryPoint?: string | undefined;
indexControllerEntryPoint?: string | undefined;
loaderEntryPoint?: string | undefined;
initEntryPoint?: string | undefined;
externals?: {
name: string;
version: string;
}[] | undefined;
customConditions?: string[] | undefined;
otelImportHook?: {
include?: string[] | undefined;
exclude?: string[] | undefined;
} | undefined;
outputHashes?: Record<string, string> | undefined;
skills?: {
id: string;
filePath: string;
entryPoint: string;
sourcePath: string;
exportName?: string | undefined;
}[] | undefined;
}>;
export declare function rewriteBuildManifestPaths(buildManifest: BuildManifest, destinationDir: string): BuildManifest;