@remotion/studio-server 4.0.496 → 4.0.498
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/better-opn/index.d.ts +6 -0
- package/dist/better-opn/index.js +46 -18
- package/dist/codemods/update-sequence-props/update-sequence-props.js +47 -0
- package/dist/helpers/css-shorthand-properties.d.ts +27 -0
- package/dist/helpers/css-shorthand-properties.js +43 -0
- package/dist/helpers/package-manager-spawn-options.d.ts +2 -0
- package/dist/helpers/package-manager-spawn-options.js +7 -0
- package/dist/helpers/parse-background-shorthand.d.ts +11 -0
- package/dist/helpers/parse-background-shorthand.js +41 -0
- package/dist/helpers/parse-border-shorthand.d.ts +6 -0
- package/dist/helpers/parse-border-shorthand.js +135 -0
- package/dist/helpers/resolve-composition-component.d.ts +3 -1
- package/dist/helpers/resolve-composition-component.js +38 -9
- package/dist/index.d.ts +5 -6
- package/dist/index.js +2 -0
- package/dist/open-browser-shortcut.js +26 -16
- package/dist/preview-server/api-routes.js +4 -0
- package/dist/preview-server/api-types.d.ts +1 -0
- package/dist/preview-server/handler.d.ts +2 -1
- package/dist/preview-server/handler.js +2 -1
- package/dist/preview-server/routes/batch-update-keyframe-settings.d.ts +7 -0
- package/dist/preview-server/routes/batch-update-keyframe-settings.js +187 -0
- package/dist/preview-server/routes/can-update-sequence-props.js +54 -3
- package/dist/preview-server/routes/download-remote-asset.js +1 -0
- package/dist/preview-server/routes/insert-element.js +7 -1
- package/dist/preview-server/routes/insert-jsx-element.js +9 -1
- package/dist/preview-server/routes/install-dependency.js +5 -1
- package/dist/preview-server/routes/save-sequence-props.js +90 -22
- package/dist/preview-server/routes/update-public-license.d.ts +7 -0
- package/dist/preview-server/routes/update-public-license.js +93 -0
- package/dist/preview-server/start-server.d.ts +4 -6
- package/dist/preview-server/start-server.js +4 -6
- package/dist/routes.d.ts +2 -1
- package/dist/routes.js +2 -1
- package/dist/start-studio.d.ts +5 -7
- package/dist/start-studio.js +4 -6
- package/package.json +6 -6
- package/dist/preview-server/routes/delete-effect-keyframe.d.ts +0 -3
- package/dist/preview-server/routes/delete-effect-keyframe.js +0 -89
- package/dist/preview-server/routes/delete-sequence-keyframe.d.ts +0 -3
- package/dist/preview-server/routes/delete-sequence-keyframe.js +0 -82
- package/dist/preview-server/routes/save-props-mutex.d.ts +0 -1
- package/dist/preview-server/routes/save-props-mutex.js +0 -11
|
@@ -59,14 +59,20 @@ const shouldSuppressHmrForSequencePropEdits = (edits) => {
|
|
|
59
59
|
(edit.sourceEdit === null || edit.sourceEdit === undefined));
|
|
60
60
|
};
|
|
61
61
|
exports.shouldSuppressHmrForSequencePropEdits = shouldSuppressHmrForSequencePropEdits;
|
|
62
|
-
const saveSequencePropsHandler = ({ input: { edits,
|
|
63
|
-
var _a, _b, _c;
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyframes, clientId, undoLabel, redoLabel, }, remotionRoot, logLevel, }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
63
|
+
var _a, _b, _c, _d;
|
|
64
|
+
const keyframesToAdd = addedKeyframes === null ? [] : addedKeyframes;
|
|
65
|
+
const keyframesToMove = movedKeyframes === null
|
|
66
|
+
? { sequenceKeyframes: [], effectKeyframes: [] }
|
|
67
|
+
: movedKeyframes;
|
|
68
|
+
const totalKeyframeMoves = keyframesToMove.sequenceKeyframes.length +
|
|
69
|
+
keyframesToMove.effectKeyframes.length;
|
|
70
|
+
if (edits.length === 0 &&
|
|
71
|
+
keyframesToAdd.length === 0 &&
|
|
72
|
+
totalKeyframeMoves === 0) {
|
|
67
73
|
throw new Error('No sequence prop edits to save');
|
|
68
74
|
}
|
|
69
|
-
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[save-sequence-props] Received request with ${edits.length} edit(s) and ${totalKeyframeMoves} moved keyframe(s)`);
|
|
75
|
+
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[save-sequence-props] Received request with ${edits.length} edit(s), ${keyframesToAdd.length} added keyframe(s), and ${totalKeyframeMoves} moved keyframe(s)`);
|
|
70
76
|
const editGroups = new Map();
|
|
71
77
|
for (const [index, edit] of edits.entries()) {
|
|
72
78
|
const parsedValue = parseSequencePropEditValue(edit.value);
|
|
@@ -79,7 +85,8 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
79
85
|
const group = (_a = editGroups.get(absolutePath)) !== null && _a !== void 0 ? _a : {
|
|
80
86
|
fileRelativeToRoot,
|
|
81
87
|
edits: [],
|
|
82
|
-
|
|
88
|
+
addedKeyframes: [],
|
|
89
|
+
movedSequenceKeyframes: [],
|
|
83
90
|
effectKeyframes: [],
|
|
84
91
|
};
|
|
85
92
|
group.edits.push({
|
|
@@ -98,7 +105,7 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
98
105
|
});
|
|
99
106
|
editGroups.set(absolutePath, group);
|
|
100
107
|
}
|
|
101
|
-
for (const
|
|
108
|
+
for (const keyframe of keyframesToAdd) {
|
|
102
109
|
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
103
110
|
remotionRoot,
|
|
104
111
|
fileName: keyframe.fileName,
|
|
@@ -107,13 +114,14 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
107
114
|
const group = (_b = editGroups.get(absolutePath)) !== null && _b !== void 0 ? _b : {
|
|
108
115
|
fileRelativeToRoot,
|
|
109
116
|
edits: [],
|
|
110
|
-
|
|
117
|
+
addedKeyframes: [],
|
|
118
|
+
movedSequenceKeyframes: [],
|
|
111
119
|
effectKeyframes: [],
|
|
112
120
|
};
|
|
113
|
-
group.
|
|
121
|
+
group.addedKeyframes.push(keyframe);
|
|
114
122
|
editGroups.set(absolutePath, group);
|
|
115
123
|
}
|
|
116
|
-
for (const [index, keyframe] of
|
|
124
|
+
for (const [index, keyframe,] of keyframesToMove.sequenceKeyframes.entries()) {
|
|
117
125
|
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
118
126
|
remotionRoot,
|
|
119
127
|
fileName: keyframe.fileName,
|
|
@@ -122,7 +130,24 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
122
130
|
const group = (_c = editGroups.get(absolutePath)) !== null && _c !== void 0 ? _c : {
|
|
123
131
|
fileRelativeToRoot,
|
|
124
132
|
edits: [],
|
|
125
|
-
|
|
133
|
+
addedKeyframes: [],
|
|
134
|
+
movedSequenceKeyframes: [],
|
|
135
|
+
effectKeyframes: [],
|
|
136
|
+
};
|
|
137
|
+
group.movedSequenceKeyframes.push({ ...keyframe, index });
|
|
138
|
+
editGroups.set(absolutePath, group);
|
|
139
|
+
}
|
|
140
|
+
for (const [index, keyframe] of keyframesToMove.effectKeyframes.entries()) {
|
|
141
|
+
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
142
|
+
remotionRoot,
|
|
143
|
+
fileName: keyframe.fileName,
|
|
144
|
+
action: 'modify',
|
|
145
|
+
});
|
|
146
|
+
const group = (_d = editGroups.get(absolutePath)) !== null && _d !== void 0 ? _d : {
|
|
147
|
+
fileRelativeToRoot,
|
|
148
|
+
edits: [],
|
|
149
|
+
addedKeyframes: [],
|
|
150
|
+
movedSequenceKeyframes: [],
|
|
126
151
|
effectKeyframes: [],
|
|
127
152
|
};
|
|
128
153
|
group.effectKeyframes.push({ ...keyframe, index });
|
|
@@ -158,7 +183,40 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
158
183
|
});
|
|
159
184
|
}
|
|
160
185
|
}
|
|
161
|
-
for (const keyframeGroup of groupBy(group.
|
|
186
|
+
for (const keyframeGroup of groupBy(group.addedKeyframes, (keyframe) => JSON.stringify(keyframe.nodePath.nodePath))) {
|
|
187
|
+
const [firstSequenceKeyframe] = keyframeGroup;
|
|
188
|
+
if (!firstSequenceKeyframe) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const updates = keyframeGroup.map((keyframe) => ({
|
|
192
|
+
key: keyframe.key,
|
|
193
|
+
operation: {
|
|
194
|
+
type: 'add',
|
|
195
|
+
frame: keyframe.frame,
|
|
196
|
+
value: JSON.parse(keyframe.value),
|
|
197
|
+
},
|
|
198
|
+
}));
|
|
199
|
+
const result = await (0, update_keyframes_1.updateSequenceKeyframes)({
|
|
200
|
+
input: output,
|
|
201
|
+
nodePath: firstSequenceKeyframe.nodePath.nodePath,
|
|
202
|
+
schema: firstSequenceKeyframe.schema,
|
|
203
|
+
videoConfigValues: firstSequenceKeyframe.nodePath.videoConfigValues,
|
|
204
|
+
updates,
|
|
205
|
+
});
|
|
206
|
+
output = result.output;
|
|
207
|
+
firstLogLine = Math.min(firstLogLine, result.logLine);
|
|
208
|
+
for (const [updateIndex, update] of updates.entries()) {
|
|
209
|
+
sequenceKeyframeLogs.push({
|
|
210
|
+
fileRelativeToRoot: group.fileRelativeToRoot,
|
|
211
|
+
line: result.logLine,
|
|
212
|
+
key: update.key,
|
|
213
|
+
oldValueString: result.oldValueStrings[updateIndex],
|
|
214
|
+
newValueString: result.newValueStrings[updateIndex],
|
|
215
|
+
formatted: result.formatted,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
for (const keyframeGroup of groupBy(group.movedSequenceKeyframes, (keyframe) => JSON.stringify(keyframe.nodePath.nodePath))) {
|
|
162
220
|
const [firstSequenceKeyframe] = keyframeGroup;
|
|
163
221
|
if (!firstSequenceKeyframe) {
|
|
164
222
|
continue;
|
|
@@ -318,10 +376,16 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
318
376
|
});
|
|
319
377
|
}
|
|
320
378
|
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
321
|
-
const
|
|
379
|
+
const statusTargets = [
|
|
380
|
+
...new Map([...edits, ...keyframesToAdd].map((target) => [
|
|
381
|
+
JSON.stringify(target.nodePath),
|
|
382
|
+
target,
|
|
383
|
+
])).values(),
|
|
384
|
+
];
|
|
385
|
+
const results = statusTargets.map((target) => {
|
|
322
386
|
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
323
387
|
remotionRoot,
|
|
324
|
-
fileName:
|
|
388
|
+
fileName: target.fileName,
|
|
325
389
|
action: 'modify',
|
|
326
390
|
});
|
|
327
391
|
const output = outputByPath.get(absolutePath);
|
|
@@ -330,22 +394,26 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
|
|
|
330
394
|
}
|
|
331
395
|
const newStatus = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
|
|
332
396
|
fileContents: output,
|
|
333
|
-
keys: (0, studio_shared_1.getAllSchemaKeys)(
|
|
334
|
-
assetKeys: (0, studio_shared_1.getAssetSchemaKeys)(
|
|
335
|
-
nodePath:
|
|
397
|
+
keys: (0, studio_shared_1.getAllSchemaKeys)(target.schema),
|
|
398
|
+
assetKeys: (0, studio_shared_1.getAssetSchemaKeys)(target.schema),
|
|
399
|
+
nodePath: target.nodePath.nodePath,
|
|
336
400
|
componentIdentity: null,
|
|
337
401
|
effects: [],
|
|
338
|
-
videoConfigValues:
|
|
402
|
+
videoConfigValues: target.nodePath.videoConfigValues,
|
|
339
403
|
});
|
|
340
404
|
return {
|
|
341
|
-
fileName:
|
|
342
|
-
nodePath:
|
|
405
|
+
fileName: target.fileName,
|
|
406
|
+
nodePath: target.nodePath,
|
|
343
407
|
props: newStatus.props,
|
|
344
408
|
};
|
|
345
409
|
});
|
|
410
|
+
const firstResult = results[0];
|
|
411
|
+
if (!firstResult) {
|
|
412
|
+
throw new Error('Could not compute sequence prop edit status');
|
|
413
|
+
}
|
|
346
414
|
return {
|
|
347
415
|
canUpdate: true,
|
|
348
|
-
props:
|
|
416
|
+
props: firstResult.props,
|
|
349
417
|
results,
|
|
350
418
|
};
|
|
351
419
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UpdatePublicLicenseRequest, UpdatePublicLicenseResponse } from '@remotion/studio-shared';
|
|
2
|
+
import type { ApiHandler } from '../api-types';
|
|
3
|
+
export declare const updatePublicLicenseInConfig: ({ configContents, publicLicenseKey, }: {
|
|
4
|
+
configContents: string;
|
|
5
|
+
publicLicenseKey: string;
|
|
6
|
+
}) => string;
|
|
7
|
+
export declare const updatePublicLicenseHandler: ApiHandler<UpdatePublicLicenseRequest, UpdatePublicLicenseResponse>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.updatePublicLicenseHandler = exports.updatePublicLicenseInConfig = void 0;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const recast = __importStar(require("recast"));
|
|
39
|
+
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
40
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
41
|
+
const updatePublicLicenseInConfig = ({ configContents, publicLicenseKey, }) => {
|
|
42
|
+
const ast = (0, parse_ast_1.parseAst)(configContents);
|
|
43
|
+
recast.types.visit(ast.program, {
|
|
44
|
+
visitExpressionStatement(path) {
|
|
45
|
+
const { expression } = path.node;
|
|
46
|
+
if (expression.type === 'CallExpression' &&
|
|
47
|
+
expression.callee.type === 'MemberExpression' &&
|
|
48
|
+
!expression.callee.computed &&
|
|
49
|
+
expression.callee.object.type === 'Identifier' &&
|
|
50
|
+
expression.callee.object.name === 'Config' &&
|
|
51
|
+
expression.callee.property.type === 'Identifier' &&
|
|
52
|
+
expression.callee.property.name === 'setPublicLicenseKey') {
|
|
53
|
+
path.prune();
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
this.traverse(path);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
const configWithoutExistingCalls = recast.print(ast, {
|
|
60
|
+
lineTerminator: '\n',
|
|
61
|
+
}).code;
|
|
62
|
+
const separator = configWithoutExistingCalls.endsWith('\n') ? '' : '\n';
|
|
63
|
+
const escapedPublicLicenseKey = publicLicenseKey
|
|
64
|
+
.replaceAll('\\', '\\\\')
|
|
65
|
+
.replaceAll("'", "\\'")
|
|
66
|
+
.replaceAll('\r', '\\r')
|
|
67
|
+
.replaceAll('\n', '\\n')
|
|
68
|
+
.replaceAll('\u2028', '\\u2028')
|
|
69
|
+
.replaceAll('\u2029', '\\u2029');
|
|
70
|
+
return `${configWithoutExistingCalls}${separator}Config.setPublicLicenseKey('${escapedPublicLicenseKey}');\n`;
|
|
71
|
+
};
|
|
72
|
+
exports.updatePublicLicenseInConfig = updatePublicLicenseInConfig;
|
|
73
|
+
const updatePublicLicenseHandler = ({ input, configFile }) => {
|
|
74
|
+
if (configFile === null || configFile === undefined) {
|
|
75
|
+
return Promise.resolve({
|
|
76
|
+
success: false,
|
|
77
|
+
reason: 'No Remotion config file was loaded.',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (input.publicLicenseKey.length === 0) {
|
|
81
|
+
return Promise.resolve({
|
|
82
|
+
success: false,
|
|
83
|
+
reason: 'The public license key must not be empty.',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const configContents = (0, node_fs_1.readFileSync)(configFile, 'utf8');
|
|
87
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(configFile, (0, exports.updatePublicLicenseInConfig)({
|
|
88
|
+
configContents,
|
|
89
|
+
publicLicenseKey: input.publicLicenseKey,
|
|
90
|
+
}), undefined);
|
|
91
|
+
return Promise.resolve({ success: true });
|
|
92
|
+
};
|
|
93
|
+
exports.updatePublicLicenseHandler = updatePublicLicenseHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WebpackOverrideFn } from '@remotion/bundler';
|
|
1
|
+
import type { BundlerOverrideFn, RspackOverrideFn, WebpackOverrideFn } from '@remotion/bundler';
|
|
2
2
|
import type { GitSource, RenderDefaults, RenderJob, StudioRuntimeConfig } from '@remotion/studio-shared';
|
|
3
3
|
import type { QueueMethods } from './api-types';
|
|
4
4
|
import type { LiveEventsServer } from './live-events';
|
|
@@ -14,14 +14,13 @@ export type StartServerResult = {
|
|
|
14
14
|
export declare const startServer: (options: {
|
|
15
15
|
entry: string;
|
|
16
16
|
userDefinedComponent: string;
|
|
17
|
+
bundlerOverride: BundlerOverrideFn;
|
|
18
|
+
rspackOverride: RspackOverrideFn;
|
|
17
19
|
webpackOverride: WebpackOverrideFn;
|
|
18
20
|
getCurrentInputProps: () => object;
|
|
19
21
|
getEnvVariables: () => Record<string, string>;
|
|
20
22
|
port: number | null;
|
|
21
|
-
maxTimelineTracks: number | null;
|
|
22
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
23
23
|
remotionRoot: string;
|
|
24
|
-
keyboardShortcutsEnabled: boolean;
|
|
25
24
|
publicDir: string;
|
|
26
25
|
poll: number | null;
|
|
27
26
|
staticHash: string;
|
|
@@ -39,9 +38,8 @@ export declare const startServer: (options: {
|
|
|
39
38
|
getAudioLatencyHint: () => AudioContextLatencyCategory | null;
|
|
40
39
|
getPreviewSampleRate: () => number | null;
|
|
41
40
|
enableCrossSiteIsolation: boolean;
|
|
42
|
-
askAIEnabled: boolean;
|
|
43
|
-
interactivityEnabled: boolean;
|
|
44
41
|
forceNew: boolean;
|
|
45
42
|
rspack: boolean;
|
|
46
43
|
getStudioRuntimeConfig: () => StudioRuntimeConfig;
|
|
44
|
+
configFile: string | null;
|
|
47
45
|
}) => Promise<StartServerResult>;
|
|
@@ -16,7 +16,7 @@ const node_path_cache_1 = require("./node-path-cache");
|
|
|
16
16
|
const undo_stack_1 = require("./undo-stack");
|
|
17
17
|
const watch_ignore_next_change_1 = require("./watch-ignore-next-change");
|
|
18
18
|
const startServer = async (options) => {
|
|
19
|
-
var _a, _b
|
|
19
|
+
var _a, _b;
|
|
20
20
|
const desiredPort = (_b = (_a = options === null || options === void 0 ? void 0 : options.port) !== null && _a !== void 0 ? _a : (process.env.PORT ? Number(process.env.PORT) : undefined)) !== null && _b !== void 0 ? _b : undefined;
|
|
21
21
|
const portConfig = renderer_1.RenderInternals.getPortConfig(options.forceIPv4);
|
|
22
22
|
const onPortUnavailable = options.forceNew
|
|
@@ -37,14 +37,11 @@ const startServer = async (options) => {
|
|
|
37
37
|
userDefinedComponent: options.userDefinedComponent,
|
|
38
38
|
outDir: null,
|
|
39
39
|
environment: 'development',
|
|
40
|
+
bundlerOverride: options.bundlerOverride,
|
|
41
|
+
rspackOverride: options.rspackOverride,
|
|
40
42
|
webpackOverride: options === null || options === void 0 ? void 0 : options.webpackOverride,
|
|
41
|
-
maxTimelineTracks: (_c = options === null || options === void 0 ? void 0 : options.maxTimelineTracks) !== null && _c !== void 0 ? _c : null,
|
|
42
43
|
remotionRoot: options.remotionRoot,
|
|
43
|
-
keyboardShortcutsEnabled: options.keyboardShortcutsEnabled,
|
|
44
44
|
poll: options.poll,
|
|
45
|
-
bufferStateDelayInMilliseconds: options.bufferStateDelayInMilliseconds,
|
|
46
|
-
askAIEnabled: options.askAIEnabled,
|
|
47
|
-
interactivityEnabled: options.interactivityEnabled,
|
|
48
45
|
extraPlugins: [watchIgnorePlugin],
|
|
49
46
|
};
|
|
50
47
|
let compiler;
|
|
@@ -105,6 +102,7 @@ const startServer = async (options) => {
|
|
|
105
102
|
getPreviewSampleRate: options.getPreviewSampleRate,
|
|
106
103
|
enableCrossSiteIsolation: options.enableCrossSiteIsolation,
|
|
107
104
|
getStudioRuntimeConfig: options.getStudioRuntimeConfig,
|
|
105
|
+
configFile: options.configFile,
|
|
108
106
|
});
|
|
109
107
|
})
|
|
110
108
|
.catch((err) => {
|
package/dist/routes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
2
2
|
import type { GitSource, RenderDefaults, RenderJob, StudioRuntimeConfig } from '@remotion/studio-shared';
|
|
3
3
|
import type { QueueMethods } from './preview-server/api-types';
|
|
4
4
|
import type { LiveEventsServer } from './preview-server/live-events';
|
|
5
|
-
export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, }: {
|
|
5
|
+
export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, configFile, }: {
|
|
6
6
|
staticHash: string;
|
|
7
7
|
staticHashPrefix: string;
|
|
8
8
|
outputHash: string;
|
|
@@ -26,4 +26,5 @@ export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash,
|
|
|
26
26
|
getPreviewSampleRate: () => number | null;
|
|
27
27
|
enableCrossSiteIsolation: boolean;
|
|
28
28
|
getStudioRuntimeConfig: () => StudioRuntimeConfig;
|
|
29
|
+
configFile: string | null;
|
|
29
30
|
}) => Promise<void>;
|
package/dist/routes.js
CHANGED
|
@@ -394,7 +394,7 @@ const handleBeep = (_, response) => {
|
|
|
394
394
|
readStream.pipe(response);
|
|
395
395
|
return Promise.resolve();
|
|
396
396
|
};
|
|
397
|
-
const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, }) => {
|
|
397
|
+
const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, configFile, }) => {
|
|
398
398
|
const url = new URL(request.url, 'http://localhost');
|
|
399
399
|
if (url.pathname === '/api/file-source') {
|
|
400
400
|
return handleFileSource({
|
|
@@ -453,6 +453,7 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
|
|
|
453
453
|
methods,
|
|
454
454
|
binariesDirectory,
|
|
455
455
|
publicDir,
|
|
456
|
+
configFile,
|
|
456
457
|
});
|
|
457
458
|
}
|
|
458
459
|
}
|
package/dist/start-studio.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WebpackOverrideFn } from '@remotion/bundler';
|
|
1
|
+
import type { BundlerOverrideFn, RspackOverrideFn, WebpackOverrideFn } from '@remotion/bundler';
|
|
2
2
|
import type { GitSource, RenderDefaults, RenderJob, StudioRuntimeConfig } from '@remotion/studio-shared';
|
|
3
3
|
import type { QueueMethods } from './preview-server/api-types';
|
|
4
4
|
export type StartStudioResult = {
|
|
@@ -6,7 +6,7 @@ export type StartStudioResult = {
|
|
|
6
6
|
} | {
|
|
7
7
|
type: 'already-running';
|
|
8
8
|
};
|
|
9
|
-
export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort,
|
|
9
|
+
export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort, remotionRoot, relativePublicDir, bundlerOverride, rspackOverride, webpackOverride, poll, getRenderDefaults, getRenderQueue, getNumberOfAudioTags, queueMethods, previewEntry, gitSource, binariesDirectory, forceIPv4, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, forceNew, rspack, getStudioRuntimeConfig, configFile, }: {
|
|
10
10
|
browserArgs: string;
|
|
11
11
|
browserFlag: string;
|
|
12
12
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
@@ -15,11 +15,10 @@ export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser
|
|
|
15
15
|
getCurrentInputProps: () => object;
|
|
16
16
|
getEnvVariables: () => Record<string, string>;
|
|
17
17
|
desiredPort: number | null;
|
|
18
|
-
maxTimelineTracks: number | null;
|
|
19
|
-
bufferStateDelayInMilliseconds: number | null;
|
|
20
18
|
remotionRoot: string;
|
|
21
|
-
keyboardShortcutsEnabled: boolean;
|
|
22
19
|
relativePublicDir: string | null;
|
|
20
|
+
bundlerOverride: BundlerOverrideFn;
|
|
21
|
+
rspackOverride: RspackOverrideFn;
|
|
23
22
|
webpackOverride: WebpackOverrideFn;
|
|
24
23
|
poll: number | null;
|
|
25
24
|
getRenderDefaults: () => RenderDefaults;
|
|
@@ -33,9 +32,8 @@ export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser
|
|
|
33
32
|
gitSource: GitSource | null;
|
|
34
33
|
binariesDirectory: string | null;
|
|
35
34
|
forceIPv4: boolean;
|
|
36
|
-
askAIEnabled: boolean;
|
|
37
|
-
interactivityEnabled: boolean;
|
|
38
35
|
forceNew: boolean;
|
|
39
36
|
rspack: boolean;
|
|
40
37
|
getStudioRuntimeConfig: () => StudioRuntimeConfig;
|
|
38
|
+
configFile: string | null;
|
|
41
39
|
}) => Promise<StartStudioResult>;
|
package/dist/start-studio.js
CHANGED
|
@@ -19,7 +19,7 @@ const public_folder_1 = require("./preview-server/public-folder");
|
|
|
19
19
|
const start_server_1 = require("./preview-server/start-server");
|
|
20
20
|
const server_ready_1 = require("./server-ready");
|
|
21
21
|
const watch_root_file_1 = require("./watch-root-file");
|
|
22
|
-
const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort,
|
|
22
|
+
const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort, remotionRoot, relativePublicDir, bundlerOverride, rspackOverride, webpackOverride, poll, getRenderDefaults, getRenderQueue, getNumberOfAudioTags, queueMethods, previewEntry, gitSource, binariesDirectory, forceIPv4, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, forceNew, rspack, getStudioRuntimeConfig, configFile, }) => {
|
|
23
23
|
try {
|
|
24
24
|
if (typeof Bun === 'undefined') {
|
|
25
25
|
process.title = 'node (npx remotion studio)';
|
|
@@ -69,10 +69,10 @@ const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEn
|
|
|
69
69
|
getCurrentInputProps,
|
|
70
70
|
getEnvVariables,
|
|
71
71
|
port: desiredPort,
|
|
72
|
-
maxTimelineTracks,
|
|
73
72
|
remotionRoot,
|
|
74
|
-
keyboardShortcutsEnabled,
|
|
75
73
|
publicDir,
|
|
74
|
+
bundlerOverride,
|
|
75
|
+
rspackOverride,
|
|
76
76
|
webpackOverride,
|
|
77
77
|
poll,
|
|
78
78
|
staticHash,
|
|
@@ -85,17 +85,15 @@ const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEn
|
|
|
85
85
|
getNumberOfAudioTags,
|
|
86
86
|
queueMethods,
|
|
87
87
|
gitSource,
|
|
88
|
-
bufferStateDelayInMilliseconds,
|
|
89
88
|
binariesDirectory,
|
|
90
89
|
forceIPv4,
|
|
91
90
|
getAudioLatencyHint,
|
|
92
91
|
getPreviewSampleRate,
|
|
93
92
|
enableCrossSiteIsolation,
|
|
94
|
-
askAIEnabled,
|
|
95
|
-
interactivityEnabled,
|
|
96
93
|
forceNew,
|
|
97
94
|
rspack,
|
|
98
95
|
getStudioRuntimeConfig,
|
|
96
|
+
configFile,
|
|
99
97
|
});
|
|
100
98
|
if (result.type === 'already-running') {
|
|
101
99
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `Already running on port ${result.port}.`);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-server"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio-server",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.498",
|
|
7
7
|
"description": "Run a Remotion Studio with a server backend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"kiwi-schema": "0.5.0",
|
|
31
31
|
"semver": "7.5.3",
|
|
32
32
|
"prettier": "3.8.1",
|
|
33
|
-
"remotion": "4.0.
|
|
33
|
+
"remotion": "4.0.498",
|
|
34
34
|
"recast": "0.23.11",
|
|
35
|
-
"@remotion/bundler": "4.0.
|
|
36
|
-
"@remotion/renderer": "4.0.
|
|
37
|
-
"@remotion/studio-shared": "4.0.
|
|
35
|
+
"@remotion/bundler": "4.0.498",
|
|
36
|
+
"@remotion/renderer": "4.0.498",
|
|
37
|
+
"@remotion/studio-shared": "4.0.498",
|
|
38
38
|
"memfs": "3.4.3",
|
|
39
39
|
"open": "8.4.2"
|
|
40
40
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ast-types": "0.16.1",
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"@types/semver": "7.5.3",
|
|
45
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
45
|
+
"@remotion/eslint-config-internal": "4.0.498",
|
|
46
46
|
"eslint": "9.19.0",
|
|
47
47
|
"@types/node": "20.12.14",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const deleteEffectKeyframeHandler: ApiHandler<DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteEffectKeyframeHandler = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
-
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
8
|
-
const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
|
|
9
|
-
const file_watcher_1 = require("../../file-watcher");
|
|
10
|
-
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
11
|
-
const undo_stack_1 = require("../undo-stack");
|
|
12
|
-
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
13
|
-
const can_update_effect_props_1 = require("./can-update-effect-props");
|
|
14
|
-
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
15
|
-
const log_effect_update_1 = require("./log-updates/log-effect-update");
|
|
16
|
-
const save_props_mutex_1 = require("./save-props-mutex");
|
|
17
|
-
const deleteEffectKeyframeHandler = ({ input: { fileName, sequenceNodePath, effectIndex, key, frame, schema, clientId, }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
18
|
-
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[delete-effect-keyframe] Received request for fileName="${fileName}" effectIndex=${effectIndex} key="${key}" frame=${frame}`);
|
|
19
|
-
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
20
|
-
remotionRoot,
|
|
21
|
-
fileName,
|
|
22
|
-
action: 'modify',
|
|
23
|
-
});
|
|
24
|
-
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
25
|
-
const { output, oldValueStrings, newValueStrings, formatted, logLine, effectCallee, } = await (0, update_keyframes_1.updateEffectKeyframes)({
|
|
26
|
-
input: fileContents,
|
|
27
|
-
sequenceNodePath: sequenceNodePath.nodePath,
|
|
28
|
-
effectIndex,
|
|
29
|
-
updates: [
|
|
30
|
-
{
|
|
31
|
-
key,
|
|
32
|
-
operation: {
|
|
33
|
-
type: 'remove',
|
|
34
|
-
frame,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
});
|
|
39
|
-
const oldValueString = oldValueStrings[0];
|
|
40
|
-
const newValueString = newValueStrings[0];
|
|
41
|
-
const undoPropChange = `${key} keyframe restored at frame ${frame}`;
|
|
42
|
-
const redoPropChange = `${key} keyframe deleted at frame ${frame}`;
|
|
43
|
-
(0, undo_stack_1.pushToUndoStack)({
|
|
44
|
-
filePath: absolutePath,
|
|
45
|
-
oldContents: fileContents,
|
|
46
|
-
newContents: null,
|
|
47
|
-
logLevel,
|
|
48
|
-
remotionRoot,
|
|
49
|
-
logLine,
|
|
50
|
-
description: {
|
|
51
|
-
undoMessage: `↩️ ${undoPropChange}`,
|
|
52
|
-
redoMessage: `↪️ ${redoPropChange}`,
|
|
53
|
-
},
|
|
54
|
-
entryType: 'effect-props',
|
|
55
|
-
suppressHmrOnFileRestore: true,
|
|
56
|
-
});
|
|
57
|
-
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
58
|
-
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
59
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
60
|
-
(0, log_effect_update_1.logEffectUpdate)({
|
|
61
|
-
fileRelativeToRoot,
|
|
62
|
-
line: logLine,
|
|
63
|
-
effectName: effectCallee,
|
|
64
|
-
propKey: key,
|
|
65
|
-
oldValueString,
|
|
66
|
-
newValueString,
|
|
67
|
-
defaultValueString: null,
|
|
68
|
-
formatted,
|
|
69
|
-
logLevel,
|
|
70
|
-
removedProps: [],
|
|
71
|
-
addedProps: [],
|
|
72
|
-
});
|
|
73
|
-
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
74
|
-
const ast = (0, parse_ast_1.parseAst)((0, node_fs_1.readFileSync)(absolutePath, 'utf-8'));
|
|
75
|
-
const jsx = (0, can_update_sequence_props_1.findJsxElementAtNodePath)(ast, sequenceNodePath.nodePath);
|
|
76
|
-
if (!jsx) {
|
|
77
|
-
return {
|
|
78
|
-
canUpdate: false,
|
|
79
|
-
effectIndex,
|
|
80
|
-
reason: 'not-found',
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return (0, can_update_effect_props_1.computeEffectPropStatus)({
|
|
84
|
-
jsx,
|
|
85
|
-
effectIndex,
|
|
86
|
-
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
exports.deleteEffectKeyframeHandler = deleteEffectKeyframeHandler;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const deleteSequenceKeyframeHandler: ApiHandler<DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse>;
|