Skip to content
Open
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
9 changes: 8 additions & 1 deletion packages/cli-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
],
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
".": "./src/index.ts",
"./internal": "./src/internal.ts"
}
},
"devDependencies": {
Expand Down Expand Up @@ -159,6 +160,12 @@
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./internal": {
"import": {
"types": "./dist/esm/internal.d.ts",
"default": "./dist/esm/internal.js"
}
}
}
}
2 changes: 1 addition & 1 deletion packages/cli-v3/src/deploy/buildImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ export async function generateContainerfile(options: GenerateContainerfileOption
}
}

const parseGenerateOptions = (options: GenerateContainerfileOptions) => {
export const parseGenerateOptions = (options: GenerateContainerfileOptions) => {
const buildArgs = Object.entries(options.build.env || {})
.flatMap(([key]) => `ARG ${key}`)
.join("\n");
Expand Down
33 changes: 33 additions & 0 deletions packages/cli-v3/src/internal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Public API surface for downstream tooling that wants to drive the
// build / deploy pipeline programmatically without going through the
// `trigger` CLI binary.
//
// Mirrors the pattern used by `@trigger.dev/build`'s `./internal` subpath:
// the modules exported here are stable enough to be consumed by adjacent
// packages, but they sit *below* the documented CLI command surface, so
// consumers should pin to a specific version of this package.

// Build / deploy primitives
export { loadConfig } from "./config.js";
export { buildWorker } from "./build/buildWorker.js";
export { buildImage, parseGenerateOptions } from "./deploy/buildImage.js";

// Auth + project-environment resolution. `login` reads TRIGGER_ACCESS_TOKEN
// from the env when present (so it works in CI without a config file);
// `getProjectClient` performs the two-step engine API URL discovery and
// returns an engine-bound CliApiClient that callers use for all subsequent
// deploy/register/finalize/fail API calls.
export { login } from "./commands/login.js";
export { getProjectClient } from "./utilities/session.js";

// Deploy-time env var sync (deploy.sync.env / .parentEnv -> POST .../envvars/import).
export { syncEnvVarsWithServer } from "./commands/deploy.js";

// Build-host helpers used by the deploy flow:
// - resolveLocalEnvVars / loadDotEnvVars: read project-local .env files
// - createGitMeta: extract git metadata for the deployment record
// - getTmpDir: scoped temp directory with cleanup tracking
export { resolveLocalEnvVars } from "./utilities/localEnvVars.js";
export { loadDotEnvVars } from "./utilities/dotEnv.js";
export { createGitMeta } from "./utilities/gitMeta.js";
export { getTmpDir } from "./utilities/tempDirectories.js";
Loading