Add .gitignore to exclude all node packages and lock files

This commit is contained in:
Adolfo Reyna
2026-02-23 21:56:04 -05:00
parent faae96c9ed
commit dcc5c6c044
9747 changed files with 1555105 additions and 2 deletions
@@ -0,0 +1,8 @@
import type { JobProgressCallback, RenderJob } from '@remotion/studio-server';
export declare const processStill: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }: {
job: RenderJob;
remotionRoot: string;
entryPoint: string;
onProgress: JobProgressCallback;
addCleanupCallback: (label: string, cb: () => void) => void;
}) => Promise<void>;
@@ -0,0 +1,70 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.processStill = void 0;
const client_1 = require("@remotion/renderer/client");
const preview_server_1 = require("../config/preview-server");
const convert_entry_point_to_serve_url_1 = require("../convert-entry-point-to-serve-url");
const get_cli_options_1 = require("../get-cli-options");
const parsed_cli_1 = require("../parsed-cli");
const still_1 = require("../render-flows/still");
const { publicDirOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
const processStill = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, }) => {
if (job.type !== 'still') {
throw new Error('Expected still job');
}
const { browserExecutable } = (0, get_cli_options_1.getCliOptions)({
isStill: true,
logLevel: job.logLevel,
indent: true,
});
const publicDir = publicDirOption.getValue({
commandLine: parsed_cli_1.parsedCli,
}).value;
const askAIEnabled = askAIOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
const experimentalClientSideRenderingEnabled = experimentalClientSideRenderingOption.getValue({
commandLine: parsed_cli_1.parsedCli,
}).value;
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsed_cli_1.parsedCli,
}).value;
const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(entryPoint);
await (0, still_1.renderStillFlow)({
remotionRoot,
browser: 'chrome',
browserExecutable,
chromiumOptions: job.chromiumOptions,
entryPointReason: 'same as Studio',
envVariables: job.envVariables,
height: null,
fullEntryPoint,
serializedInputPropsWithCustomSchema: job.serializedInputPropsWithCustomSchema,
overwrite: true,
port: (0, preview_server_1.getRendererPortFromConfigFile)(),
publicDir,
puppeteerTimeout: job.delayRenderTimeout,
jpegQuality: job.jpegQuality,
remainingArgs: [],
scale: job.scale,
stillFrame: job.frame,
width: null,
compositionIdFromUi: job.compositionId,
imageFormatFromUi: job.imageFormat,
logLevel: job.logLevel,
onProgress,
indent: true,
addCleanupCallback,
cancelSignal: job.cancelToken.cancelSignal,
outputLocationFromUi: job.outName,
offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
offthreadVideoThreads: job.offthreadVideoThreads,
binariesDirectory: job.binariesDirectory,
publicPath: null,
chromeMode: job.chromeMode,
audioLatencyHint: null,
mediaCacheSizeInBytes: job.mediaCacheSizeInBytes,
askAIEnabled,
experimentalClientSideRenderingEnabled,
keyboardShortcutsEnabled,
});
};
exports.processStill = processStill;
@@ -0,0 +1,10 @@
import type { LogLevel } from '@remotion/renderer';
import type { JobProgressCallback, RenderJob } from '@remotion/studio-server';
export declare const processVideoJob: ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, logLevel, }: {
job: RenderJob;
remotionRoot: string;
entryPoint: string;
onProgress: JobProgressCallback;
addCleanupCallback: (label: string, cb: () => void) => void;
logLevel: LogLevel;
}) => Promise<void>;
@@ -0,0 +1,95 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.processVideoJob = void 0;
const client_1 = require("@remotion/renderer/client");
const preview_server_1 = require("../config/preview-server");
const convert_entry_point_to_serve_url_1 = require("../convert-entry-point-to-serve-url");
const get_cli_options_1 = require("../get-cli-options");
const parsed_cli_1 = require("../parsed-cli");
const render_1 = require("../render-flows/render");
const { publicDirOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
const processVideoJob = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, logLevel, }) => {
var _a, _b, _c;
if (job.type !== 'video' && job.type !== 'sequence') {
throw new Error('Expected video job');
}
const publicDir = publicDirOption.getValue({
commandLine: parsed_cli_1.parsedCli,
}).value;
const askAIEnabled = askAIOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsed_cli_1.parsedCli,
}).value;
const { browserExecutable, ffmpegOverride } = (0, get_cli_options_1.getCliOptions)({
isStill: true,
logLevel,
indent: true,
});
const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(entryPoint);
await (0, render_1.renderVideoFlow)({
remotionRoot,
browser: 'chrome',
browserExecutable,
chromiumOptions: job.chromiumOptions,
entryPointReason: 'same as Studio',
envVariables: job.envVariables,
height: null,
fullEntryPoint,
serializedInputPropsWithCustomSchema: job.serializedInputPropsWithCustomSchema,
overwrite: true,
port: (0, preview_server_1.getRendererPortFromConfigFile)(),
publicDir,
puppeteerTimeout: job.delayRenderTimeout,
jpegQuality: (_a = job.jpegQuality) !== null && _a !== void 0 ? _a : undefined,
remainingArgs: [],
scale: job.scale,
width: null,
compositionIdFromUi: job.compositionId,
logLevel: job.logLevel,
onProgress,
indent: true,
concurrency: job.concurrency,
everyNthFrame: job.type === 'video' ? job.everyNthFrame : 1,
frameRange: [job.startFrame, job.endFrame],
quiet: false,
shouldOutputImageSequence: job.type === 'sequence',
addCleanupCallback,
outputLocationFromUI: job.outName,
uiCodec: job.type === 'video' ? job.codec : null,
uiImageFormat: job.imageFormat,
cancelSignal: job.cancelToken.cancelSignal,
crf: job.type === 'video' ? job.crf : null,
ffmpegOverride,
audioBitrate: job.type === 'video' ? job.audioBitrate : null,
muted: job.type === 'video' ? job.muted : true,
enforceAudioTrack: job.type === 'video' ? job.enforceAudioTrack : false,
proResProfile: job.type === 'video' ? ((_b = job.proResProfile) !== null && _b !== void 0 ? _b : undefined) : undefined,
x264Preset: job.type === 'video' ? ((_c = job.x264Preset) !== null && _c !== void 0 ? _c : null) : null,
pixelFormat: job.type === 'video' ? job.pixelFormat : 'yuv420p',
videoBitrate: job.type === 'video' ? job.videoBitrate : null,
encodingBufferSize: job.type === 'video' ? job.encodingBufferSize : null,
encodingMaxRate: job.type === 'video' ? job.encodingMaxRate : null,
numberOfGifLoops: job.type === 'video' ? job.numberOfGifLoops : null,
audioCodec: job.type === 'video' ? job.audioCodec : null,
disallowParallelEncoding: job.type === 'video' ? job.disallowParallelEncoding : false,
offthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
colorSpace: job.type === 'video' ? job.colorSpace : null,
repro: job.repro,
binariesDirectory: job.binariesDirectory,
forSeamlessAacConcatenation: job.type === 'video' ? job.forSeamlessAacConcatenation : false,
separateAudioTo: job.type === 'video' ? job.separateAudioTo : null,
publicPath: null,
metadata: job.metadata,
hardwareAcceleration: job.type === 'video' ? job.hardwareAcceleration : 'disable',
chromeMode: job.chromeMode,
offthreadVideoThreads: job.offthreadVideoThreads,
mediaCacheSizeInBytes: job.mediaCacheSizeInBytes,
audioLatencyHint: null,
imageSequencePattern: null,
askAIEnabled,
experimentalClientSideRenderingEnabled: experimentalClientSideRenderingOption.getValue({ commandLine: parsed_cli_1.parsedCli })
.value,
keyboardShortcutsEnabled,
});
};
exports.processVideoJob = processVideoJob;
@@ -0,0 +1,11 @@
import type { LogLevel } from '@remotion/renderer';
import type { RenderJob, RenderJobWithCleanup } from '@remotion/studio-server';
export declare const getRenderQueue: () => RenderJob[];
export declare const addJob: ({ job, entryPoint, remotionRoot, logLevel, }: {
job: RenderJobWithCleanup;
entryPoint: string;
remotionRoot: string;
logLevel: LogLevel;
}) => void;
export declare const removeJob: (jobId: string) => void;
export declare const cancelJob: (jobId: string) => void;
@@ -0,0 +1,222 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cancelJob = exports.removeJob = exports.addJob = exports.getRenderQueue = void 0;
const studio_server_1 = require("@remotion/studio-server");
const node_path_1 = __importDefault(require("node:path"));
const chalk_1 = require("../chalk");
const log_1 = require("../log");
const print_error_1 = require("../print-error");
const progress_types_1 = require("../progress-types");
const process_still_1 = require("./process-still");
const process_video_1 = require("./process-video");
let jobQueue = [];
const updateJob = (id, updater) => {
jobQueue = jobQueue.map((j) => {
if (id === j.id) {
return updater(j);
}
return j;
});
notifyClientsOfJobUpdate();
};
const getRenderQueue = () => {
return jobQueue.map((j) => {
const { cleanup, ...rest } = j;
return rest;
});
};
exports.getRenderQueue = getRenderQueue;
const notifyClientsOfJobUpdate = () => {
studio_server_1.StudioServerInternals.waitForLiveEventsListener().then((listener) => {
listener.sendEventToClient({
type: 'render-queue-updated',
queue: (0, exports.getRenderQueue)(),
});
});
};
const processJob = async ({ job, remotionRoot, entryPoint, onProgress, addCleanupCallback, logLevel, }) => {
if (job.type === 'still') {
await (0, process_still_1.processStill)({
job,
remotionRoot,
entryPoint,
onProgress,
addCleanupCallback,
});
return;
}
if (job.type === 'video' || job.type === 'sequence') {
await (0, process_video_1.processVideoJob)({
job,
remotionRoot,
entryPoint,
onProgress,
addCleanupCallback,
logLevel,
});
return;
}
throw new Error(`Unknown job ${JSON.stringify(job)}`);
};
const addJob = ({ job, entryPoint, remotionRoot, logLevel, }) => {
jobQueue.push(job);
processJobIfPossible({ entryPoint, remotionRoot, logLevel });
notifyClientsOfJobUpdate();
};
exports.addJob = addJob;
const removeJob = (jobId) => {
jobQueue = jobQueue.filter((job) => {
if (job.id === jobId) {
job.cleanup.forEach((c) => {
c();
});
return false;
}
return true;
});
notifyClientsOfJobUpdate();
};
exports.removeJob = removeJob;
const cancelJob = (jobId) => {
for (const job of jobQueue) {
if (job.id === jobId) {
if (job.status !== 'running') {
throw new Error('Job is not running');
}
job.cancelToken.cancel();
break;
}
}
};
exports.cancelJob = cancelJob;
const processJobIfPossible = async ({ remotionRoot, entryPoint, logLevel, }) => {
const runningJob = jobQueue.find((q) => {
return q.status === 'running';
});
if (runningJob) {
return;
}
const nextJob = jobQueue.find((q) => {
return q.status === 'idle';
});
if (!nextJob) {
return;
}
const jobCleanups = [];
try {
updateJob(nextJob.id, (job) => {
return {
...job,
status: 'running',
progress: {
value: 0,
message: 'Starting job...',
...(0, progress_types_1.initialAggregateRenderProgress)(),
},
};
});
const startTime = Date.now();
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('╭─ Starting render '));
let lastProgress = null;
await processJob({
job: nextJob,
entryPoint,
remotionRoot,
onProgress: (progress) => {
updateJob(nextJob.id, (job) => {
lastProgress = progress;
// Ignore late callbacks of progress updates after cancelling
if (job.status === 'failed' || job.status === 'done') {
return job;
}
if (job.type === 'still') {
return {
...job,
status: 'running',
progress,
};
}
if (job.type === 'video') {
return {
...job,
status: 'running',
progress,
};
}
if (job.type === 'sequence') {
return {
...job,
status: 'running',
progress,
};
}
throw new Error('Unknown job type');
});
},
addCleanupCallback: (label, cleanup) => {
jobCleanups.push({ label, job: cleanup });
},
logLevel,
});
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('╰─ Done in ' + (Date.now() - startTime) + 'ms.'));
const { unwatch } = studio_server_1.StudioServerInternals.installFileWatcher({
file: node_path_1.default.resolve(remotionRoot, nextJob.outName),
onChange: (type) => {
if (type === 'created') {
updateJob(nextJob.id, (job) => ({
...job,
deletedOutputLocation: false,
}));
}
if (type === 'deleted') {
updateJob(nextJob.id, (job) => ({
...job,
deletedOutputLocation: true,
}));
}
},
});
updateJob(nextJob.id, (job) => {
if (!lastProgress) {
throw new Error('expected progress');
}
return {
...job,
status: 'done',
cleanup: [...job.cleanup, unwatch],
progress: { message: 'Done', value: 1, ...lastProgress },
};
});
}
catch (err) {
log_1.Log.error({ indent: false, logLevel }, chalk_1.chalk.gray('\n╰─ '), chalk_1.chalk.red('Failed to render'));
updateJob(nextJob.id, (job) => {
return {
...job,
status: 'failed',
error: {
message: err.message,
stack: err.stack,
},
};
});
await (0, print_error_1.printError)(err, logLevel);
studio_server_1.StudioServerInternals.waitForLiveEventsListener().then((listener) => {
listener.sendEventToClient({
type: 'render-job-failed',
compositionId: nextJob.compositionId,
error: err,
});
});
}
finally {
await Promise.all(jobCleanups.map(({ job, label }) => {
log_1.Log.verbose({ indent: false, logLevel }, 'Cleanup: ' + label);
return job();
}));
}
processJobIfPossible({ remotionRoot, entryPoint, logLevel });
};