🎥 Make videos programmatically with React
Load provider help without cloud SDKs
JonnyBurgerdc5623198cef
diff --git a/packages/cli/src/cloudrun-command.ts b/packages/cli/src/cloudrun-command.tsindex 93429be846..4f3979ffc2 100644--- a/packages/cli/src/cloudrun-command.ts+++ b/packages/cli/src/cloudrun-command.ts@@ -7,20 +7,24 @@ export const tryPrintCloudrunHelp = (args: string[],logLevel: LogLevel,) => {+ let path: string;try {- const path = require.resolve('@remotion/cloudrun', {+ path = require.resolve('@remotion/cloudrun/internal/help', {paths: [remotionRoot],});- const {CloudrunInternals} = require(path);- if (typeof CloudrunInternals?.printHelp !== 'function') {- return false;- }-- CloudrunInternals.printHelp(args, logLevel);- return true;} catch {return false;}++ const {printHelp} = require(path);+ if (typeof printHelp !== 'function') {+ throw new TypeError(+ '@remotion/cloudrun/internal/help does not export printHelp',+ );+ }++ printHelp(args, logLevel);+ return true;};export const cloudrunCommand = async (diff --git a/packages/cli/src/lambda-command.ts b/packages/cli/src/lambda-command.tsindex 7b1c0e589f..a4f85b17ad 100644--- a/packages/cli/src/lambda-command.ts+++ b/packages/cli/src/lambda-command.ts@@ -7,20 +7,24 @@ export const tryPrintLambdaHelp = (args: string[],logLevel: LogLevel,) => {+ let path: string;try {- const path = require.resolve('@remotion/lambda', {+ path = require.resolve('@remotion/lambda/internal/help', {paths: [remotionRoot],});- const {LambdaInternals} = require(path);- if (typeof LambdaInternals?.printHelp !== 'function') {- return false;- }-- LambdaInternals.printHelp(args, logLevel);- return true;} catch {return false;}++ const {printHelp} = require(path);+ if (typeof printHelp !== 'function') {+ throw new TypeError(+ '@remotion/lambda/internal/help does not export printHelp',+ );+ }++ printHelp(args, logLevel);+ return true;};export const lambdaCommand = async (diff --git a/packages/cloudrun/package.json b/packages/cloudrun/package.jsonindex ca2bb5607b..f49dedaef3 100644--- a/packages/cloudrun/package.json+++ b/packages/cloudrun/package.json@@ -41,6 +41,7 @@"./defaults": "./dist/defaults.js","./regions": "./dist/regions.js","./client": "./dist/client.js",+ "./internal/help": "./dist/cli/help.js","./permissions.json": "./dist/shared/sa-permissions.json"},"typesVersions": {@@ -53,6 +54,9 @@],"client": ["dist/client.d.ts"+ ],+ "internal/help": [+ "dist/cli/help.d.ts"]}},diff --git a/packages/cloudrun/src/cli/commands/command-names.ts b/packages/cloudrun/src/cli/commands/command-names.tsnew file mode 100644index 0000000000..d3ddea5c23--- /dev/null+++ b/packages/cloudrun/src/cli/commands/command-names.ts@@ -0,0 +1,18 @@+export const CLOUDRUN_BINARY_NAME = 'remotion cloudrun';++export const PERMISSIONS_COMMAND = 'permissions';+export const REGIONS_COMMAND = 'regions';+export const RENDER_COMMAND = 'render';+export const SERVICES_COMMAND = 'services';+export const STILL_COMMAND = 'still';+export const SITES_COMMAND = 'sites';++export const CLOUD_RUN_DEPLOY_SUBCOMMAND = 'deploy';+export const SERVICES_LS_SUBCOMMAND = 'ls';+export const SERVICES_RM_SUBCOMMAND = 'rm';+export const SERVICES_RMALL_SUBCOMMAND = 'rmall';++export const SITES_CREATE_SUBCOMMAND = 'create';+export const SITES_LS_SUBCOMMAND = 'ls';+export const SITES_RM_COMMAND = 'rm';+export const SITES_RMALL_COMMAND = 'rmall';diff --git a/packages/cloudrun/src/cli/commands/permissions.ts b/packages/cloudrun/src/cli/commands/permissions.tsindex 9f28a5a170..fd13d0420e 100644--- a/packages/cloudrun/src/cli/commands/permissions.ts+++ b/packages/cloudrun/src/cli/commands/permissions.ts@@ -7,7 +7,7 @@ import {import {getProjectId} from '../../functions/helpers/is-in-cloud-task';import {Log} from '../log';-export const PERMISSIONS_COMMAND = 'permissions';+export {PERMISSIONS_COMMAND} from './command-names';export const permissionsCommand = async (logLevel: LogLevel) => {try {diff --git a/packages/cloudrun/src/cli/commands/regions.ts b/packages/cloudrun/src/cli/commands/regions.tsindex a280b628a3..894d02e173 100644--- a/packages/cloudrun/src/cli/commands/regions.ts+++ b/packages/cloudrun/src/cli/commands/regions.ts@@ -2,7 +2,7 @@ import {CliInternals} from '@remotion/cli';import type {LogLevel} from '@remotion/renderer';import {GCP_REGIONS} from '../../regions';-export const REGIONS_COMMAND = 'regions';+export {REGIONS_COMMAND} from './command-names';export const regionsCommand = (logLevel: LogLevel) => {CliInternals.Log.info({indent: false, logLevel}, GCP_REGIONS.join(' '));diff --git a/packages/cloudrun/src/cli/commands/render/index.ts b/packages/cloudrun/src/cli/commands/render/index.tsindex 7f5725c969..93c5f9d994 100644--- a/packages/cloudrun/src/cli/commands/render/index.ts+++ b/packages/cloudrun/src/cli/commands/render/index.ts@@ -15,9 +15,10 @@ import {validateServeUrl} from '../../../shared/validate-serveurl';import {parsedCloudrunCli} from '../../args';import {displayCrashLogs} from '../../helpers/cloudrun-crash-logs';import {Log} from '../../log';+import {RENDER_COMMAND} from '../command-names';import {renderArgsCheck} from './helpers/renderArgsCheck';-export const RENDER_COMMAND = 'render';+export {RENDER_COMMAND} from '../command-names';const {audioBitrateOption,diff --git a/packages/cloudrun/src/cli/commands/services/deploy.ts b/packages/cloudrun/src/cli/commands/services/deploy.tsindex dc149d861c..dff6fe938a 100644--- a/packages/cloudrun/src/cli/commands/services/deploy.ts+++ b/packages/cloudrun/src/cli/commands/services/deploy.ts@@ -17,7 +17,7 @@ import {makeConsoleUrl} from '../../helpers/make-console-url';import {quit} from '../../helpers/quit';import {Log} from '../../log';-export const CLOUD_RUN_DEPLOY_SUBCOMMAND = 'deploy';+export {CLOUD_RUN_DEPLOY_SUBCOMMAND} from '../command-names';export const cloudRunDeploySubcommand = async (logLevel: LogLevel) => {const region = getGcpRegion();diff --git a/packages/cloudrun/src/cli/commands/services/index.ts b/packages/cloudrun/src/cli/commands/services/index.tsindex cb65591230..0da151f6e8 100644--- a/packages/cloudrun/src/cli/commands/services/index.ts+++ b/packages/cloudrun/src/cli/commands/services/index.ts@@ -4,12 +4,13 @@ import type {ServiceInfo} from '../../../api/get-service-info';import {BINARY_NAME} from '../../../shared/constants';import {quit} from '../../helpers/quit';import {Log} from '../../log';+import {SERVICES_COMMAND} from '../command-names';import {CLOUD_RUN_DEPLOY_SUBCOMMAND, cloudRunDeploySubcommand} from './deploy';import {SERVICES_LS_SUBCOMMAND, servicesLsCommand} from './ls';import {SERVICES_RM_SUBCOMMAND, servicesRmCommand} from './rm';import {SERVICES_RMALL_SUBCOMMAND, servicesRmallCommand} from './rmall';-export const SERVICES_COMMAND = 'services';+export {SERVICES_COMMAND} from '../command-names';export const LEFT_COL = 20;diff --git a/packages/cloudrun/src/cli/commands/services/ls.ts b/packages/cloudrun/src/cli/commands/services/ls.tsindex 3785e01522..93853e52a7 100644--- a/packages/cloudrun/src/cli/commands/services/ls.ts+++ b/packages/cloudrun/src/cli/commands/services/ls.ts@@ -5,7 +5,7 @@ import {getServices} from '../../../api/get-services';import {getGcpRegion} from '../../get-gcp-region';import {Log} from '../../log';-export const SERVICES_LS_SUBCOMMAND = 'ls';+export {SERVICES_LS_SUBCOMMAND} from '../command-names';export const servicesLsCommand = async (logLevel: LogLevel) => {const region = getGcpRegion();diff --git a/packages/cloudrun/src/cli/commands/services/rm.ts b/packages/cloudrun/src/cli/commands/services/rm.tsindex e3ad9aaafa..1081354586 100644--- a/packages/cloudrun/src/cli/commands/services/rm.ts+++ b/packages/cloudrun/src/cli/commands/services/rm.ts@@ -10,7 +10,7 @@ import {Log} from '../../log';import {displayServiceInfo, SERVICES_COMMAND} from './index';import {SERVICES_LS_SUBCOMMAND} from './ls';-export const SERVICES_RM_SUBCOMMAND = 'rm';+export {SERVICES_RM_SUBCOMMAND} from '../command-names';export const servicesRmCommand = async (args: string[], logLevel: LogLevel) => {if (args.length === 0) {diff --git a/packages/cloudrun/src/cli/commands/services/rmall.ts b/packages/cloudrun/src/cli/commands/services/rmall.tsindex 932db424a2..07ac02f6ea 100644--- a/packages/cloudrun/src/cli/commands/services/rmall.ts+++ b/packages/cloudrun/src/cli/commands/services/rmall.ts@@ -7,7 +7,7 @@ import {confirmCli} from '../../helpers/confirm';import {Log} from '../../log';import {displayServiceInfo} from './index';-export const SERVICES_RMALL_SUBCOMMAND = 'rmall';+export {SERVICES_RMALL_SUBCOMMAND} from '../command-names';export const servicesRmallCommand = async (logLevel: LogLevel) => {const region = getGcpRegion();diff --git a/packages/cloudrun/src/cli/commands/sites/create.ts b/packages/cloudrun/src/cli/commands/sites/create.tsindex a9c5dc35c4..b895914841 100644--- a/packages/cloudrun/src/cli/commands/sites/create.ts+++ b/packages/cloudrun/src/cli/commands/sites/create.ts@@ -27,7 +27,7 @@ import {Log} from '../../log';const {disableGitSourceOption, askAIOption, keyboardShortcutsOption} =BrowserSafeApis.options;-export const SITES_CREATE_SUBCOMMAND = 'create';+export {SITES_CREATE_SUBCOMMAND} from '../command-names';export const sitesCreateSubcommand = async (args: string[],diff --git a/packages/cloudrun/src/cli/commands/sites/index.ts b/packages/cloudrun/src/cli/commands/sites/index.tsindex 640f7091c2..bbdcd7cad3 100644--- a/packages/cloudrun/src/cli/commands/sites/index.ts+++ b/packages/cloudrun/src/cli/commands/sites/index.ts@@ -4,12 +4,13 @@ import type {Site} from '../../../api/get-sites';import {BINARY_NAME} from '../../../shared/constants';import {quit} from '../../helpers/quit';import {Log} from '../../log';+import {SITES_COMMAND} from '../command-names';import {SITES_CREATE_SUBCOMMAND, sitesCreateSubcommand} from './create';import {SITES_LS_SUBCOMMAND, sitesLsSubcommand} from './ls';import {SITES_RM_COMMAND, sitesRmSubcommand} from './rm';import {SITES_RMALL_COMMAND, sitesRmallSubcommand} from './rmall';-export const SITES_COMMAND = 'sites';+export {SITES_COMMAND} from '../command-names';export const displaySiteInfo = (site: Site) => {return [diff --git a/packages/cloudrun/src/cli/commands/sites/ls.ts b/packages/cloudrun/src/cli/commands/sites/ls.tsindex 388245a3fa..4a839e9acd 100644--- a/packages/cloudrun/src/cli/commands/sites/ls.ts+++ b/packages/cloudrun/src/cli/commands/sites/ls.ts@@ -6,7 +6,7 @@ import {parsedCloudrunCli} from '../../args';import {getGcpRegion} from '../../get-gcp-region';import {Log} from '../../log';-export const SITES_LS_SUBCOMMAND = 'ls';+export {SITES_LS_SUBCOMMAND} from '../command-names';export const sitesLsSubcommand = async (logLevel: LogLevel) => {// check if --allRegions flag is provideddiff --git a/packages/cloudrun/src/cli/commands/sites/rm.ts b/packages/cloudrun/src/cli/commands/sites/rm.tsindex b417d7c709..999ab88e54 100644--- a/packages/cloudrun/src/cli/commands/sites/rm.ts+++ b/packages/cloudrun/src/cli/commands/sites/rm.ts@@ -10,7 +10,7 @@ import {quit} from '../../helpers/quit';import {Log} from '../../log';import {SITES_LS_SUBCOMMAND} from './ls';-export const SITES_RM_COMMAND = 'rm';+export {SITES_RM_COMMAND} from '../command-names';export const sitesRmSubcommand = async (args: string[], logLevel: LogLevel) => {if (args.length === 0) {diff --git a/packages/cloudrun/src/cli/commands/sites/rmall.ts b/packages/cloudrun/src/cli/commands/sites/rmall.tsindex 91d66d02f9..4a274417a8 100644--- a/packages/cloudrun/src/cli/commands/sites/rmall.ts+++ b/packages/cloudrun/src/cli/commands/sites/rmall.ts@@ -7,7 +7,7 @@ import {getGcpRegion} from '../../get-gcp-region';import {confirmCli} from '../../helpers/confirm';import {Log} from '../../log';-export const SITES_RMALL_COMMAND = 'rmall';+export {SITES_RMALL_COMMAND} from '../command-names';export const sitesRmallSubcommand = async (logLevel: LogLevel) => {const allRegions = parsedCloudrunCli['all-regions'];diff --git a/packages/cloudrun/src/cli/commands/still.ts b/packages/cloudrun/src/cli/commands/still.tsindex bedc332524..8d612693e3 100644--- a/packages/cloudrun/src/cli/commands/still.ts+++ b/packages/cloudrun/src/cli/commands/still.ts@@ -9,9 +9,10 @@ import {renderStillOnCloudrun} from '../../api/render-still-on-cloudrun';import {validateServeUrl} from '../../shared/validate-serveurl';import {displayCrashLogs} from '../helpers/cloudrun-crash-logs';import {Log} from '../log';+import {STILL_COMMAND} from './command-names';import {renderArgsCheck} from './render/helpers/renderArgsCheck';-export const STILL_COMMAND = 'still';+export {STILL_COMMAND} from './command-names';const {offthreadVideoCacheSizeInBytesOption,diff --git a/packages/cloudrun/src/cli/help.ts b/packages/cloudrun/src/cli/help.tsindex 1af087a6e0..5418a1cb9e 100644--- a/packages/cloudrun/src/cli/help.ts+++ b/packages/cloudrun/src/cli/help.ts@@ -1,22 +1,23 @@import {CliInternals} from '@remotion/cli';import type {LogLevel} from '@remotion/renderer';import {BrowserSafeApis} from '@remotion/renderer/client';-import {BINARY_NAME} from '../shared/constants';-import {PERMISSIONS_COMMAND} from './commands/permissions';-import {REGIONS_COMMAND} from './commands/regions';-import {RENDER_COMMAND} from './commands/render';-import {SERVICES_COMMAND} from './commands/services';-import {CLOUD_RUN_DEPLOY_SUBCOMMAND} from './commands/services/deploy';-import {SERVICES_LS_SUBCOMMAND} from './commands/services/ls';-import {SERVICES_RM_SUBCOMMAND} from './commands/services/rm';-import {SERVICES_RMALL_SUBCOMMAND} from './commands/services/rmall';-import {SITES_COMMAND} from './commands/sites';-import {SITES_CREATE_SUBCOMMAND} from './commands/sites/create';-import {SITES_LS_SUBCOMMAND} from './commands/sites/ls';-import {SITES_RM_COMMAND} from './commands/sites/rm';-import {SITES_RMALL_COMMAND} from './commands/sites/rmall';-import {STILL_COMMAND} from './commands/still';-import {Log} from './log';+import {+ CLOUD_RUN_DEPLOY_SUBCOMMAND,+ CLOUDRUN_BINARY_NAME,+ PERMISSIONS_COMMAND,+ REGIONS_COMMAND,+ RENDER_COMMAND,+ SERVICES_COMMAND,+ SERVICES_LS_SUBCOMMAND,+ SERVICES_RM_SUBCOMMAND,+ SERVICES_RMALL_SUBCOMMAND,+ SITES_COMMAND,+ SITES_CREATE_SUBCOMMAND,+ SITES_LS_SUBCOMMAND,+ SITES_RM_COMMAND,+ SITES_RMALL_COMMAND,+ STILL_COMMAND,+} from './commands/command-names';const packagejson = require('../../package.json');@@ -338,7 +339,7 @@ const commandHelp = [export const getCloudrunHelp = (selectedPath: readonly string[]) => {return CliInternals.getCommandHelp({- binaryName: BINARY_NAME,+ binaryName: CLOUDRUN_BINARY_NAME,commands: commandHelp,selectedPath,rootDocumentation: 'https://www.remotion.dev/docs/cloudrun/cli',@@ -350,9 +351,9 @@ export const printHelp = (logLevel: LogLevel,) => {if (selectedPath.length === 0) {- Log.info(+ CliInternals.Log.info({indent: false, logLevel},- `${BINARY_NAME} ${+ `${CLOUDRUN_BINARY_NAME} ${packagejson.version} © ${new Date().getFullYear()} The Remotion developers`,);@@ -360,6 +361,6 @@ export const printHelp = (const lines = getCloudrunHelp(selectedPath);for (const line of selectedPath.length === 0 ? lines : lines.slice(1)) {- Log.info({indent: false, logLevel}, line);+ CliInternals.Log.info({indent: false, logLevel}, line);}};diff --git a/packages/cloudrun/src/internals.ts b/packages/cloudrun/src/internals.tsindex 3c01a2c763..048bf33c32 100644--- a/packages/cloudrun/src/internals.ts+++ b/packages/cloudrun/src/internals.ts@@ -1,6 +1,4 @@-import {printHelp} from './cli/help';import {executeCommand} from './cli/index';export const CloudrunInternals = {executeCommand,- printHelp,};diff --git a/packages/cloudrun/src/test/cli-help.test.ts b/packages/cloudrun/src/test/cli-help.test.tsindex 4fc4fa000f..6a1c3f103d 100644--- a/packages/cloudrun/src/test/cli-help.test.ts+++ b/packages/cloudrun/src/test/cli-help.test.ts@@ -4,6 +4,8 @@ import {mkdtempSync, readdirSync, rmSync, writeFileSync} from 'node:fs';import path from 'node:path';import {getCloudrunHelp} from '../cli/help';+const exampleDirectory = path.join(__dirname, '..', '..', '..', 'example');+const commandHelpPages = [{args: [], documentation: '/docs/cloudrun/cli', option: null},{@@ -108,8 +110,34 @@ test('defines help for every Cloud Run command', () => {expect(createSiteHelp).toContain('--disable-ask-ai');});+test('exposes a help-only package entry point', () => {+ const result = spawnSync(+ 'node',+ [+ '-e',+ `const help = require('@remotion/cloudrun/internal/help'); process.stdout.write(JSON.stringify({printHelp: typeof help.printHelp, hasRenderOptions: help.getCloudrunHelp(['render']).join('\\n').includes('--service-name <service-name>')}));`,+ ],+ {+ cwd: exampleDirectory,+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'pipe'],+ timeout: 10_000,+ },+ );++ if (result.error) {+ throw result.error;+ }++ expect(result.signal).toBeNull();+ expect(result.status).toBe(0);+ expect(JSON.parse(result.stdout)).toEqual({+ printHelp: 'function',+ hasRenderOptions: true,+ });+});+test('the Remotion CLI delegates Cloud Run help before loading config', () => {- const exampleDirectory = path.join(__dirname, '..', '..', '..', 'example');const temporaryDirectory = mkdtempSync(path.join(exampleDirectory, '.tmp-cloudrun-cli-help-'),);diff --git a/packages/lambda/package.json b/packages/lambda/package.jsonindex 32fe0a54e2..9e6675ef0c 100644--- a/packages/lambda/package.json+++ b/packages/lambda/package.json@@ -78,6 +78,12 @@"require": "./dist/policies.js","module": "./dist/esm/policies.mjs","import": "./dist/esm/policies.mjs"+ },+ "./internal/help": {+ "types": "./dist/cli/help.d.ts",+ "require": "./dist/cli/help.js",+ "module": "./dist/cli/help.js",+ "import": "./dist/cli/help.js"}},"typesVersions": {@@ -87,6 +93,9 @@],"policies": ["./dist/policies.d.ts"+ ],+ "internal/help": [+ "./dist/cli/help.d.ts"]}},diff --git a/packages/lambda/src/cli/commands/command-names.ts b/packages/lambda/src/cli/commands/command-names.tsnew file mode 100644index 0000000000..dd99471e9e--- /dev/null+++ b/packages/lambda/src/cli/commands/command-names.ts@@ -0,0 +1,8 @@+export const COMPOSITIONS_COMMAND = 'compositions';+export const FUNCTIONS_COMMAND = 'functions';+export const POLICIES_COMMAND = 'policies';+export const QUOTAS_COMMAND = 'quotas';+export const REGIONS_COMMAND = 'regions';+export const RENDER_COMMAND = 'render';+export const SITES_COMMAND = 'sites';+export const STILL_COMMAND = 'still';diff --git a/packages/lambda/src/cli/commands/compositions/index.ts b/packages/lambda/src/cli/commands/compositions/index.tsindex 37ae33c364..bb2bb1bd6d 100644--- a/packages/lambda/src/cli/commands/compositions/index.ts+++ b/packages/lambda/src/cli/commands/compositions/index.ts@@ -13,8 +13,9 @@ import {getAwsRegion} from '../../get-aws-region';import {findFunctionName} from '../../helpers/find-function-name';import {quit} from '../../helpers/quit';import {Log} from '../../log';+import {COMPOSITIONS_COMMAND} from '../command-names';-export const COMPOSITIONS_COMMAND = 'compositions';+export {COMPOSITIONS_COMMAND} from '../command-names';const {enableMultiprocessOnLinuxOption,diff --git a/packages/lambda/src/cli/commands/functions/index.ts b/packages/lambda/src/cli/commands/functions/index.tsindex 36d5699549..9dcf6fb26a 100644--- a/packages/lambda/src/cli/commands/functions/index.ts+++ b/packages/lambda/src/cli/commands/functions/index.ts@@ -4,12 +4,13 @@ import type {LogLevel} from '@remotion/renderer';import {FullClientSpecifics, ProviderSpecifics} from '@remotion/serverless';import {AwsProvider} from '../../../client';import {quit} from '../../helpers/quit';+import {FUNCTIONS_COMMAND} from '../command-names';import {FUNCTIONS_DEPLOY_SUBCOMMAND, functionsDeploySubcommand} from './deploy';import {FUNCTIONS_LS_SUBCOMMAND, functionsLsCommand} from './ls';import {FUNCTIONS_RM_SUBCOMMAND, functionsRmCommand} from './rm';import {FUNCTIONS_RMALL_SUBCOMMAND, functionsRmallCommand} from './rmall';-export const FUNCTIONS_COMMAND = 'functions';+export {FUNCTIONS_COMMAND} from '../command-names';const printFunctionsHelp = (logLevel: LogLevel) => {CliInternals.Log.info(diff --git a/packages/lambda/src/cli/commands/policies/policies.ts b/packages/lambda/src/cli/commands/policies/policies.tsindex 5d98da8c15..f8453ec9ba 100644--- a/packages/lambda/src/cli/commands/policies/policies.ts+++ b/packages/lambda/src/cli/commands/policies/policies.ts@@ -3,11 +3,12 @@ import {BINARY_NAME} from '@remotion/lambda-client/constants';import type {LogLevel} from '@remotion/renderer';import {quit} from '../../helpers/quit';import {Log} from '../../log';+import {POLICIES_COMMAND} from '../command-names';import {ROLE_SUBCOMMAND, roleSubcommand} from './role';import {USER_SUBCOMMAND, userSubcommand} from './user';import {VALIDATE_SUBCOMMAND, validateSubcommand} from './validate';-export const POLICIES_COMMAND = 'policies';+export {POLICIES_COMMAND} from '../command-names';const printPoliciesHelp = (logLevel: LogLevel) => {Log.info(diff --git a/packages/lambda/src/cli/commands/quotas/index.ts b/packages/lambda/src/cli/commands/quotas/index.tsindex bb3160ae57..9d746c8b85 100644--- a/packages/lambda/src/cli/commands/quotas/index.ts+++ b/packages/lambda/src/cli/commands/quotas/index.ts@@ -1,9 +1,11 @@import {CliInternals} from '@remotion/cli';import {BINARY_NAME} from '@remotion/lambda-client/constants';import type {LogLevel} from '@remotion/renderer';+import {QUOTAS_COMMAND} from '../command-names';import {INCREASE_SUBCOMMAND, quotasIncreaseCommand} from './increase';import {quotasListCommand} from './list';-export const QUOTAS_COMMAND = 'quotas';++export {QUOTAS_COMMAND} from '../command-names';const printHelp = (logLevel: LogLevel) => {CliInternals.Log.info({indent: false, logLevel}, 'Available commands:');diff --git a/packages/lambda/src/cli/commands/regions.ts b/packages/lambda/src/cli/commands/regions.tsindex 286275b350..6b69be3a3a 100644--- a/packages/lambda/src/cli/commands/regions.ts+++ b/packages/lambda/src/cli/commands/regions.ts@@ -3,7 +3,7 @@ import type {LogLevel} from '@remotion/renderer';import {getRegions} from '../../api/get-regions';import {parsedLambdaCli} from '../args';-export const REGIONS_COMMAND = 'regions';+export {REGIONS_COMMAND} from './command-names';export const regionsCommand = (logLevel: LogLevel) => {CliInternals.Log.info(diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex d148a3f218..969f200f11 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -34,9 +34,10 @@ import {import {getWebhookCustomData} from '../../helpers/get-webhook-custom-data';import {quit} from '../../helpers/quit';import {Log} from '../../log';+import {RENDER_COMMAND} from '../command-names';import {makeProgressString} from './progress';-export const RENDER_COMMAND = 'render';+export {RENDER_COMMAND} from '../command-names';const {x264Option,diff --git a/packages/lambda/src/cli/commands/sites/index.ts b/packages/lambda/src/cli/commands/sites/index.tsindex 2b5376f457..8b4242ece9 100644--- a/packages/lambda/src/cli/commands/sites/index.ts+++ b/packages/lambda/src/cli/commands/sites/index.ts@@ -4,12 +4,13 @@ import {BINARY_NAME} from '@remotion/lambda-client/constants';import type {LogLevel} from '@remotion/renderer';import type {ProviderSpecifics} from '@remotion/serverless';import {quit} from '../../helpers/quit';+import {SITES_COMMAND} from '../command-names';import {SITES_CREATE_SUBCOMMAND, sitesCreateSubcommand} from './create';import {SITES_LS_SUBCOMMAND, sitesLsSubcommand} from './ls';import {SITES_RM_COMMAND, sitesRmSubcommand} from './rm';import {SITES_RMALL_COMMAND, sitesRmallSubcommand} from './rmall';-export const SITES_COMMAND = 'sites';+export {SITES_COMMAND} from '../command-names';const printSitesHelp = (logLevel: LogLevel) => {CliInternals.Log.info(diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.tsindex d51e541aa9..2306b5cf9c 100644--- a/packages/lambda/src/cli/commands/still.ts+++ b/packages/lambda/src/cli/commands/still.ts@@ -24,6 +24,7 @@ import {} from '../helpers/get-s3-output-provider-from-cli';import {quit} from '../helpers/quit';import {Log} from '../log';+import {STILL_COMMAND} from './command-names';import {makeArtifactProgress} from './render/progress';const {@@ -58,7 +59,7 @@ const {getCompositionWithDimensionOverride,} = CliInternals;-export const STILL_COMMAND = 'still';+export {STILL_COMMAND} from './command-names';export const stillCommand = async ({args,diff --git a/packages/lambda/src/cli/help.ts b/packages/lambda/src/cli/help.tsindex f125089c03..51436f9fd1 100644--- a/packages/lambda/src/cli/help.ts+++ b/packages/lambda/src/cli/help.ts@@ -2,15 +2,16 @@ import {CliInternals} from '@remotion/cli';import {BINARY_NAME} from '@remotion/lambda-client/constants';import type {LogLevel} from '@remotion/renderer';import {BrowserSafeApis} from '@remotion/renderer/client';-import {COMPOSITIONS_COMMAND} from './commands/compositions';-import {FUNCTIONS_COMMAND} from './commands/functions';-import {POLICIES_COMMAND} from './commands/policies/policies';-import {QUOTAS_COMMAND} from './commands/quotas';-import {REGIONS_COMMAND} from './commands/regions';-import {RENDER_COMMAND} from './commands/render/render';-import {SITES_COMMAND} from './commands/sites';-import {STILL_COMMAND} from './commands/still';-import {Log} from './log';+import {+ COMPOSITIONS_COMMAND,+ FUNCTIONS_COMMAND,+ POLICIES_COMMAND,+ QUOTAS_COMMAND,+ REGIONS_COMMAND,+ RENDER_COMMAND,+ SITES_COMMAND,+ STILL_COMMAND,+} from './commands/command-names';const packagejson = require('../../package.json');const rendererOptions = Object.values(BrowserSafeApis.options);@@ -489,7 +490,7 @@ export const getLambdaHelp = (selectedPath: readonly string[]) => {export const printHelp: PrintHelp = (selectedPath, logLevel) => {if (selectedPath.length === 0) {- Log.info(+ CliInternals.Log.info({indent: false, logLevel},`${BINARY_NAME} ${packagejson.version@@ -499,6 +500,6 @@ export const printHelp: PrintHelp = (selectedPath, logLevel) => {const lines = getLambdaHelp(selectedPath);for (const line of selectedPath.length === 0 ? lines : lines.slice(1)) {- Log.info({indent: false, logLevel}, line);+ CliInternals.Log.info({indent: false, logLevel}, line);}};diff --git a/packages/lambda/src/internals.ts b/packages/lambda/src/internals.tsindex 13ecbf47c9..df569da341 100644--- a/packages/lambda/src/internals.ts+++ b/packages/lambda/src/internals.ts@@ -13,7 +13,6 @@ import type {InternalDeploySiteInput,} from './api/deploy-site';import {internalDeploySite} from './api/deploy-site';-import type {PrintHelp} from './cli/help';import {executeCommand} from './cli/index';import {getLayers} from './shared/get-layers';import type {AwsLayer} from './shared/hosted-layers';@@ -26,7 +25,6 @@ export const LambdaInternals: {providerSpecifics: ProviderSpecifics<AwsProvider> | null,fullClientSpecifics: FullClientSpecifics<AwsProvider> | null,) => Promise<void>;- printHelp: (selectedPath: readonly string[], logLevel: LogLevel) => void;internalDeploySite: (input: InternalDeploySiteInput) => DeploySiteOutput;getLayers: (options: {option: RuntimePreference;@@ -34,10 +32,6 @@ export const LambdaInternals: {}) => AwsLayer[];} = {executeCommand,- printHelp: (selectedPath, logLevel) => {- const {printHelp} = require('./cli/help') as {printHelp: PrintHelp};- printHelp(selectedPath, logLevel);- },internalDeploySite,getLayers,};diff --git a/packages/lambda/src/test/unit/cli-help.test.ts b/packages/lambda/src/test/unit/cli-help.test.tsindex d7399ac1a8..f5c6f30f6c 100644--- a/packages/lambda/src/test/unit/cli-help.test.ts+++ b/packages/lambda/src/test/unit/cli-help.test.ts@@ -4,6 +4,15 @@ import {mkdtempSync, readdirSync, rmSync, writeFileSync} from 'node:fs';import path from 'node:path';import {getLambdaHelp} from '../../cli/help';+const exampleDirectory = path.join(+ __dirname,+ '..',+ '..',+ '..',+ '..',+ 'example',+);+const commandHelpPages = [{args: [], documentation: '/docs/lambda/cli', option: null},{@@ -154,15 +163,34 @@ test('defines help for every Lambda command', () => {expect(policyHelp).toContain('--region <region>');});-test('the Remotion CLI delegates Lambda help before loading config', () => {- const exampleDirectory = path.join(- __dirname,- '..',- '..',- '..',- '..',- 'example',+test('exposes a help-only package entry point', () => {+ const result = spawnSync(+ 'node',+ [+ '-e',+ `const help = require('@remotion/lambda/internal/help'); process.stdout.write(JSON.stringify({printHelp: typeof help.printHelp, hasRenderOptions: help.getLambdaHelp(['render']).join('\\n').includes('--frames-per-lambda <count>')}));`,+ ],+ {+ cwd: exampleDirectory,+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'pipe'],+ timeout: 10_000,+ },);++ if (result.error) {+ throw result.error;+ }++ expect(result.signal).toBeNull();+ expect(result.status).toBe(0);+ expect(JSON.parse(result.stdout)).toEqual({+ printHelp: 'function',+ hasRenderOptions: true,+ });+});++test('the Remotion CLI delegates Lambda help before loading config', () => {const temporaryDirectory = mkdtempSync(path.join(exampleDirectory, '.tmp-lambda-cli-help-'),);