@remotion/studio-server 4.0.527 → 4.0.528
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/codemods/apply-codemod-to-file.d.ts +2 -1
- package/dist/codemods/apply-codemod-to-file.js +141 -8
- package/dist/codemods/update-effect-props/update-effect-props.d.ts +6 -33
- package/dist/codemods/update-effect-props/update-effect-props.js +16 -6
- package/dist/codemods/update-keyframes/update-keyframes.d.ts +24 -65
- package/dist/codemods/update-keyframes/update-keyframes.js +23 -5
- package/dist/codemods/update-sequence-props/update-sequence-props.d.ts +2 -17
- package/dist/codemods/update-sequence-props/update-sequence-props.js +15 -8
- package/dist/helpers/open-file-for-writing-without-symlinks.d.ts +6 -1
- package/dist/helpers/open-file-for-writing-without-symlinks.js +9 -6
- package/dist/index.d.ts +0 -22
- package/dist/index.js +0 -7
- package/dist/preview-server/api-routes.js +4 -0
- package/dist/preview-server/hot-middleware/index.js +13 -46
- package/dist/preview-server/routes/add-effect.js +16 -8
- package/dist/preview-server/routes/apply-codemod.d.ts +0 -19
- package/dist/preview-server/routes/apply-codemod.js +22 -25
- package/dist/preview-server/routes/apply-visual-control-change.js +12 -65
- package/dist/preview-server/routes/can-update-sequence-props.d.ts +0 -10
- package/dist/preview-server/routes/can-update-sequence-props.js +39 -505
- package/dist/preview-server/routes/delete-effect.js +14 -13
- package/dist/preview-server/routes/delete-jsx-nodes.js +15 -4
- package/dist/preview-server/routes/download-remote-asset.d.ts +5 -0
- package/dist/preview-server/routes/download-remote-asset.js +25 -20
- package/dist/preview-server/routes/duplicate-effect.js +11 -4
- package/dist/preview-server/routes/duplicate-jsx-node.js +14 -4
- package/dist/preview-server/routes/insert-element.js +399 -280
- package/dist/preview-server/routes/install-dependency.js +14 -4
- package/dist/preview-server/routes/prepare-element-install.js +3 -0
- package/dist/preview-server/routes/reorder-effect.js +11 -5
- package/dist/preview-server/routes/reorder-sequence.js +9 -5
- package/dist/preview-server/routes/replace-video-source.d.ts +3 -0
- package/dist/preview-server/routes/replace-video-source.js +81 -0
- package/dist/preview-server/routes/save-sequence-props.js +5 -26
- package/dist/preview-server/routes/split-jsx-sequence.js +13 -5
- package/dist/preview-server/routes/split-video-from-audio.js +8 -4
- package/dist/preview-server/routes/subscribe-to-sequence-props.js +6 -10
- package/dist/preview-server/routes/update-config.js +38 -2
- package/dist/preview-server/routes/update-default-props.js +11 -8
- package/dist/preview-server/routes/wrap-jsx-node.d.ts +3 -0
- package/dist/preview-server/routes/wrap-jsx-node.js +97 -0
- package/dist/preview-server/studio-protocol/handle-discovery.js +1 -1
- package/dist/preview-server/studio-protocol/handle-element-library.js +3 -3
- package/dist/preview-server/undo-stack.d.ts +2 -1
- package/dist/preview-server/undo-stack.js +19 -0
- package/dist/routes.js +2 -0
- package/package.json +8 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type CodemodResult } from '@remotion/codemods';
|
|
1
2
|
import type { RecastCodemod, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
3
|
export declare const resolveFilePathFromSymbolicatedStack: (remotionRoot: string, stack: SymbolicatedStackFrame) => string;
|
|
3
4
|
export declare const applyCodemodToFile: ({ filePath, codeMod, }: {
|
|
4
5
|
filePath: string;
|
|
5
6
|
codeMod: RecastCodemod;
|
|
6
|
-
}) => Promise<
|
|
7
|
+
}) => Promise<CodemodResult>;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.applyCodemodToFile = exports.resolveFilePathFromSymbolicatedStack = void 0;
|
|
4
7
|
const node_fs_1 = require("node:fs");
|
|
8
|
+
const promises_1 = require("node:fs/promises");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
5
10
|
const codemods_1 = require("@remotion/codemods");
|
|
11
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
12
|
const resolve_file_inside_project_1 = require("../helpers/resolve-file-inside-project");
|
|
7
13
|
const can_update_default_props_1 = require("../preview-server/routes/can-update-default-props");
|
|
8
|
-
const { parseAndApplyCodemod } = codemods_1.CodemodsInternals;
|
|
9
14
|
const resolveFilePathFromSymbolicatedStack = (remotionRoot, stack) => {
|
|
10
15
|
if (!stack.originalFileName) {
|
|
11
16
|
throw new Error('Could not determine the file where this composition is defined');
|
|
@@ -21,13 +26,141 @@ const resolveFilePathFromSymbolicatedStack = (remotionRoot, stack) => {
|
|
|
21
26
|
return absolutePath;
|
|
22
27
|
};
|
|
23
28
|
exports.resolveFilePathFromSymbolicatedStack = resolveFilePathFromSymbolicatedStack;
|
|
24
|
-
const applyCodemodToFile = ({ filePath, codeMod, }) => {
|
|
29
|
+
const applyCodemodToFile = async ({ filePath, codeMod, }) => {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
25
31
|
(0, can_update_default_props_1.checkIfTypeScriptFile)(filePath);
|
|
26
|
-
const input = (0,
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
+
const input = await (0, promises_1.readFile)(filePath, 'utf-8');
|
|
33
|
+
const options = {
|
|
34
|
+
project: { files: { [filePath]: input }, rootDir: node_path_1.default.dirname(filePath) },
|
|
35
|
+
compositionFile: filePath,
|
|
36
|
+
};
|
|
37
|
+
if (codeMod.type === 'apply-visual-control') {
|
|
38
|
+
return (0, codemods_1.updateVisualControls)({
|
|
39
|
+
...options,
|
|
40
|
+
filePath,
|
|
41
|
+
changes: codeMod.changes,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (codeMod.type === 'new-composition') {
|
|
45
|
+
const componentFilePath = node_path_1.default.join(node_path_1.default.dirname(filePath), `${codeMod.componentName}.tsx`);
|
|
46
|
+
if ((0, node_fs_1.existsSync)(componentFilePath)) {
|
|
47
|
+
throw new Error(`Cannot create ${componentFilePath} because it already exists`);
|
|
48
|
+
}
|
|
49
|
+
const composition = {
|
|
50
|
+
...options,
|
|
51
|
+
compositionId: codeMod.newId,
|
|
52
|
+
component: {
|
|
53
|
+
filePath: componentFilePath,
|
|
54
|
+
importName: codeMod.componentName,
|
|
55
|
+
importPath: codeMod.componentImportPath,
|
|
56
|
+
},
|
|
57
|
+
metadata: {
|
|
58
|
+
width: codeMod.newWidth,
|
|
59
|
+
height: codeMod.newHeight,
|
|
60
|
+
fps: codeMod.newFps,
|
|
61
|
+
durationInFrames: codeMod.newDurationInFrames,
|
|
62
|
+
},
|
|
63
|
+
folder: codeMod.folderName === null
|
|
64
|
+
? undefined
|
|
65
|
+
: { name: codeMod.folderName, parentName: codeMod.parentName },
|
|
66
|
+
};
|
|
67
|
+
if (codeMod.canvasCapture !== null) {
|
|
68
|
+
return (0, codemods_1.addCanvasCaptureComposition)({
|
|
69
|
+
...composition,
|
|
70
|
+
capture: codeMod.canvasCapture,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const result = (0, codemods_1.addComposition)(composition);
|
|
74
|
+
return {
|
|
75
|
+
...result,
|
|
76
|
+
changes: [
|
|
77
|
+
...result.changes,
|
|
78
|
+
{
|
|
79
|
+
filePath: componentFilePath,
|
|
80
|
+
previousContents: null,
|
|
81
|
+
nextContents: (0, studio_shared_1.emptyCompositionComponent)(codeMod.componentName),
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (codeMod.type === 'rename-composition') {
|
|
87
|
+
return (0, codemods_1.renameComposition)({
|
|
88
|
+
...options,
|
|
89
|
+
compositionId: codeMod.idToRename,
|
|
90
|
+
newId: codeMod.newId,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (codeMod.type === 'delete-composition') {
|
|
94
|
+
return (0, codemods_1.deleteComposition)({ ...options, compositionId: codeMod.idToDelete });
|
|
95
|
+
}
|
|
96
|
+
if (codeMod.type === 'duplicate-composition' ||
|
|
97
|
+
codeMod.type === 'update-composition-metadata') {
|
|
98
|
+
const metadata = {
|
|
99
|
+
width: (_a = codeMod.newWidth) !== null && _a !== void 0 ? _a : undefined,
|
|
100
|
+
height: (_b = codeMod.newHeight) !== null && _b !== void 0 ? _b : undefined,
|
|
101
|
+
fps: codeMod.type === 'duplicate-composition' && codeMod.tag === 'Still'
|
|
102
|
+
? undefined
|
|
103
|
+
: ((_c = codeMod.newFps) !== null && _c !== void 0 ? _c : undefined),
|
|
104
|
+
durationInFrames: codeMod.type === 'duplicate-composition' && codeMod.tag === 'Still'
|
|
105
|
+
? undefined
|
|
106
|
+
: ((_d = codeMod.newDurationInFrames) !== null && _d !== void 0 ? _d : undefined),
|
|
107
|
+
};
|
|
108
|
+
const result = codeMod.type === 'duplicate-composition'
|
|
109
|
+
? (0, codemods_1.duplicateComposition)({
|
|
110
|
+
...options,
|
|
111
|
+
compositionId: codeMod.idToDuplicate,
|
|
112
|
+
newId: codeMod.newId,
|
|
113
|
+
tag: codeMod.tag,
|
|
114
|
+
metadata,
|
|
115
|
+
})
|
|
116
|
+
: (0, codemods_1.updateCompositionMetadata)({
|
|
117
|
+
...options,
|
|
118
|
+
compositionId: codeMod.idToUpdate,
|
|
119
|
+
metadata,
|
|
120
|
+
});
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
if (codeMod.type === 'move-composition-or-folder') {
|
|
124
|
+
const target = codeMod.destination;
|
|
125
|
+
const destination = target.type === 'root'
|
|
126
|
+
? target
|
|
127
|
+
: target.type === 'folder'
|
|
128
|
+
? {
|
|
129
|
+
type: 'folder',
|
|
130
|
+
folder: { name: target.folderName, parentName: target.parentName },
|
|
131
|
+
}
|
|
132
|
+
: {
|
|
133
|
+
type: target.type,
|
|
134
|
+
target: target.target.type === 'composition'
|
|
135
|
+
? target.target
|
|
136
|
+
: {
|
|
137
|
+
type: 'folder',
|
|
138
|
+
name: target.target.folderName,
|
|
139
|
+
parentName: target.target.parentName,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
const result = codeMod.source.type === 'composition'
|
|
143
|
+
? (0, codemods_1.moveComposition)({
|
|
144
|
+
...options,
|
|
145
|
+
compositionId: codeMod.source.compositionId,
|
|
146
|
+
destination,
|
|
147
|
+
})
|
|
148
|
+
: (0, codemods_1.moveFolder)({
|
|
149
|
+
...options,
|
|
150
|
+
folder: {
|
|
151
|
+
name: codeMod.source.folderName,
|
|
152
|
+
parentName: codeMod.source.parentName,
|
|
153
|
+
},
|
|
154
|
+
destination,
|
|
155
|
+
});
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
const folder = { name: codeMod.folderName, parentName: codeMod.parentName };
|
|
159
|
+
const folderResult = codeMod.type === 'new-folder'
|
|
160
|
+
? (0, codemods_1.addFolder)({ ...options, folder })
|
|
161
|
+
: codeMod.type === 'rename-folder'
|
|
162
|
+
? (0, codemods_1.renameFolder)({ ...options, folder, newName: codeMod.newName })
|
|
163
|
+
: (0, codemods_1.unwrapFolder)({ ...options, folder });
|
|
164
|
+
return folderResult;
|
|
32
165
|
};
|
|
33
166
|
exports.applyCodemodToFile = applyCodemodToFile;
|
|
@@ -1,38 +1,11 @@
|
|
|
1
|
-
import type { JSXAttribute } from '@babel/types';
|
|
2
1
|
import { type EffectArrayElement, type EffectPropUpdate, type PropDelta, type UpdateEffectPropsResult } from '@remotion/codemods';
|
|
2
|
+
import type { InteractivitySchema, SequenceNodePath } from 'remotion';
|
|
3
3
|
export type { EffectArrayElement, EffectPropUpdate, PropDelta, UpdateEffectPropsResult, };
|
|
4
|
-
export declare const enumerateEffectArrayElements: (arr: import("@babel/types").ArrayExpression) => EffectArrayElement[]
|
|
5
|
-
|
|
6
|
-
effectIndex: number;
|
|
7
|
-
}) => {
|
|
8
|
-
kind: "ok";
|
|
9
|
-
call: import("@babel/types").CallExpression;
|
|
10
|
-
callee: string;
|
|
11
|
-
} | {
|
|
12
|
-
kind: "error";
|
|
13
|
-
reason: "not-call-expression" | "not-found";
|
|
14
|
-
}, updateEffectProps: ({ effectIndex, input, prettierConfigOverride, schema, sequenceNodePath, update, }: {
|
|
15
|
-
effectIndex: number;
|
|
4
|
+
export declare const enumerateEffectArrayElements: (arr: import("@babel/types").ArrayExpression) => EffectArrayElement[];
|
|
5
|
+
export declare const updateEffectProps: ({ input, sequenceNodePath, effectIndex, update, schema, }: {
|
|
16
6
|
input: string;
|
|
17
|
-
|
|
18
|
-
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
19
|
-
update: EffectPropUpdate;
|
|
20
|
-
} & {
|
|
21
|
-
formatFile?: import("@remotion/codemods").FormatEffectFile | undefined;
|
|
22
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
23
|
-
}) => Promise<UpdateEffectPropsResult>, updateEffectPropsAst: ({ effectIndex, input, prettierConfigOverride, schema, sequenceNodePath, update, }: {
|
|
7
|
+
sequenceNodePath: SequenceNodePath;
|
|
24
8
|
effectIndex: number;
|
|
25
|
-
input: string;
|
|
26
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
27
|
-
schema: import("remotion").InteractivitySchema;
|
|
28
|
-
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
29
9
|
update: EffectPropUpdate;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
oldValueString: string;
|
|
33
|
-
newValueString: string;
|
|
34
|
-
logLine: number;
|
|
35
|
-
effectCallee: string;
|
|
36
|
-
removedProps: PropDelta[];
|
|
37
|
-
};
|
|
38
|
-
export declare const findEffectsAttr: (attrs: readonly unknown[]) => JSXAttribute | null;
|
|
10
|
+
schema: InteractivitySchema;
|
|
11
|
+
}) => Promise<UpdateEffectPropsResult>;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.updateEffectProps = exports.enumerateEffectArrayElements = void 0;
|
|
4
4
|
const codemods_1 = require("@remotion/codemods");
|
|
5
|
-
({ enumerateEffectArrayElements: exports.enumerateEffectArrayElements
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
({ enumerateEffectArrayElements: exports.enumerateEffectArrayElements } = codemods_1.CodemodsInternals);
|
|
6
|
+
const updateEffectProps = async ({ input, sequenceNodePath, effectIndex, update, schema, }) => {
|
|
7
|
+
var _a;
|
|
8
|
+
var _b;
|
|
9
|
+
const result = await (0, codemods_1.updateEffectProps)({
|
|
10
|
+
project: { files: { 'source.tsx': input }, rootDir: '/' },
|
|
11
|
+
effect: { filePath: 'source.tsx', nodePath: sequenceNodePath, effectIndex },
|
|
12
|
+
updates: [update],
|
|
13
|
+
schema,
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
...result.results[0],
|
|
17
|
+
output: (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : input,
|
|
18
|
+
};
|
|
9
19
|
};
|
|
10
|
-
exports.
|
|
20
|
+
exports.updateEffectProps = updateEffectProps;
|
|
@@ -1,83 +1,42 @@
|
|
|
1
1
|
import { type EffectKeyframeUpdate, type IntroducedKeyframeIdentifiers, type KeyframeOperation, type SequenceKeyframeUpdate } from '@remotion/codemods';
|
|
2
|
+
import type { InteractivitySchema, SequenceNodePath, VideoConfigValues } from 'remotion';
|
|
2
3
|
export type { EffectKeyframeUpdate, IntroducedKeyframeIdentifiers, KeyframeOperation, SequenceKeyframeUpdate, };
|
|
3
|
-
|
|
4
|
+
type KeyframeInput = {
|
|
4
5
|
input: string;
|
|
5
|
-
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
6
|
-
effectIndex: number;
|
|
7
|
-
updates: EffectKeyframeUpdate[];
|
|
8
|
-
schema?: import("remotion").InteractivitySchema | undefined;
|
|
9
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
10
|
-
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
11
|
-
}) => {
|
|
12
|
-
serialized: string;
|
|
13
|
-
oldValueStrings: string[];
|
|
14
|
-
newValueStrings: string[];
|
|
15
|
-
logLine: number;
|
|
16
|
-
effectCallee: string;
|
|
17
|
-
updatedSequenceNodePath: import("remotion").SequenceNodePath;
|
|
18
|
-
}, updateSequenceKeyframesAst: ({ input, nodePath, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
19
|
-
input: string;
|
|
20
|
-
nodePath: import("remotion").SequenceNodePath;
|
|
21
6
|
updates: SequenceKeyframeUpdate[];
|
|
22
|
-
schema?:
|
|
23
|
-
prettierConfigOverride?: Record<string, unknown> | null
|
|
24
|
-
videoConfigValues:
|
|
25
|
-
}) => {
|
|
26
|
-
serialized: string;
|
|
27
|
-
oldValueStrings: string[];
|
|
28
|
-
newValueStrings: string[];
|
|
29
|
-
logLine: number;
|
|
30
|
-
updatedNodePath: import("remotion").SequenceNodePath;
|
|
7
|
+
schema?: InteractivitySchema;
|
|
8
|
+
prettierConfigOverride?: Record<string, unknown> | null;
|
|
9
|
+
videoConfigValues: VideoConfigValues | null;
|
|
31
10
|
};
|
|
32
|
-
declare const
|
|
33
|
-
|
|
34
|
-
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
35
|
-
effectIndex: number;
|
|
36
|
-
updates: EffectKeyframeUpdate[];
|
|
37
|
-
schema?: import("remotion").InteractivitySchema | undefined;
|
|
38
|
-
formatFile?: import("@remotion/codemods").FormatKeyframesFile | undefined;
|
|
39
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
40
|
-
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
41
|
-
}) => Promise<{
|
|
42
|
-
output: string;
|
|
43
|
-
formatted: boolean;
|
|
44
|
-
oldValueStrings: string[];
|
|
45
|
-
newValueStrings: string[];
|
|
46
|
-
logLine: number;
|
|
47
|
-
effectCallee: string;
|
|
48
|
-
updatedSequenceNodePath: import("remotion").SequenceNodePath;
|
|
49
|
-
}>, updateSequenceKeyframesCodemod: ({ input, nodePath, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
50
|
-
input: string;
|
|
51
|
-
nodePath: import("remotion").SequenceNodePath;
|
|
52
|
-
updates: SequenceKeyframeUpdate[];
|
|
53
|
-
schema?: import("remotion").InteractivitySchema | undefined;
|
|
54
|
-
formatFile?: import("@remotion/codemods").FormatKeyframesFile | undefined;
|
|
55
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
56
|
-
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
11
|
+
export declare const updateSequenceKeyframes: ({ input, nodePath, videoConfigValues, ...options }: KeyframeInput & {
|
|
12
|
+
nodePath: SequenceNodePath;
|
|
57
13
|
}) => Promise<{
|
|
58
|
-
|
|
14
|
+
changes: import("@remotion/codemods").CodemodFileChange[];
|
|
15
|
+
nodePathRemappings: import("@remotion/codemods").JsxNodePathRemapping[];
|
|
59
16
|
formatted: boolean;
|
|
60
17
|
oldValueStrings: string[];
|
|
61
18
|
newValueStrings: string[];
|
|
62
19
|
logLine: number;
|
|
63
|
-
updatedNodePath:
|
|
64
|
-
|
|
65
|
-
type UpdateSequenceKeyframesInput = Omit<Parameters<typeof updateSequenceKeyframesCodemod>[0], 'formatFile'>;
|
|
66
|
-
type UpdateEffectKeyframesInput = Omit<Parameters<typeof updateEffectKeyframesCodemod>[0], 'formatFile'>;
|
|
67
|
-
export declare const updateSequenceKeyframes: (input: UpdateSequenceKeyframesInput) => Promise<{
|
|
20
|
+
updatedNodePath: SequenceNodePath;
|
|
21
|
+
updatedNode: import("@remotion/codemods").JsxNodeReference;
|
|
68
22
|
output: string;
|
|
69
|
-
formatted: boolean;
|
|
70
|
-
oldValueStrings: string[];
|
|
71
|
-
newValueStrings: string[];
|
|
72
|
-
logLine: number;
|
|
73
|
-
updatedNodePath: import("remotion").SequenceNodePath;
|
|
74
23
|
}>;
|
|
75
|
-
export declare const updateEffectKeyframes: (input:
|
|
76
|
-
|
|
24
|
+
export declare const updateEffectKeyframes: ({ input, sequenceNodePath, effectIndex, videoConfigValues, ...options }: KeyframeInput & {
|
|
25
|
+
sequenceNodePath: SequenceNodePath;
|
|
26
|
+
effectIndex: number;
|
|
27
|
+
}) => Promise<{
|
|
28
|
+
changes: import("@remotion/codemods").CodemodFileChange[];
|
|
29
|
+
nodePathRemappings: import("@remotion/codemods").JsxNodePathRemapping[];
|
|
77
30
|
formatted: boolean;
|
|
78
31
|
oldValueStrings: string[];
|
|
79
32
|
newValueStrings: string[];
|
|
80
33
|
logLine: number;
|
|
81
34
|
effectCallee: string;
|
|
82
|
-
updatedSequenceNodePath:
|
|
35
|
+
updatedSequenceNodePath: SequenceNodePath;
|
|
36
|
+
updatedEffect: {
|
|
37
|
+
filePath: string;
|
|
38
|
+
nodePath: SequenceNodePath;
|
|
39
|
+
effectIndex: number;
|
|
40
|
+
};
|
|
41
|
+
output: string;
|
|
83
42
|
}>;
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateEffectKeyframes = exports.updateSequenceKeyframes =
|
|
3
|
+
exports.updateEffectKeyframes = exports.updateSequenceKeyframes = void 0;
|
|
4
4
|
const codemods_1 = require("@remotion/codemods");
|
|
5
|
-
({
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const updateSequenceKeyframes = async ({ input, nodePath, videoConfigValues, ...options }) => {
|
|
6
|
+
var _a;
|
|
7
|
+
var _b;
|
|
8
|
+
const result = await (0, codemods_1.updateJsxNodeKeyframes)({
|
|
9
|
+
project: { files: { 'source.tsx': input }, rootDir: '/' },
|
|
10
|
+
node: { filePath: 'source.tsx', nodePath },
|
|
11
|
+
videoConfig: videoConfigValues !== null && videoConfigValues !== void 0 ? videoConfigValues : undefined,
|
|
12
|
+
...options,
|
|
13
|
+
});
|
|
14
|
+
return { ...result, output: (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : input };
|
|
15
|
+
};
|
|
8
16
|
exports.updateSequenceKeyframes = updateSequenceKeyframes;
|
|
9
|
-
const updateEffectKeyframes = (input) =>
|
|
17
|
+
const updateEffectKeyframes = async ({ input, sequenceNodePath, effectIndex, videoConfigValues, ...options }) => {
|
|
18
|
+
var _a;
|
|
19
|
+
var _b;
|
|
20
|
+
const result = await (0, codemods_1.updateEffectKeyframes)({
|
|
21
|
+
project: { files: { 'source.tsx': input }, rootDir: '/' },
|
|
22
|
+
effect: { filePath: 'source.tsx', nodePath: sequenceNodePath, effectIndex },
|
|
23
|
+
videoConfig: videoConfigValues !== null && videoConfigValues !== void 0 ? videoConfigValues : undefined,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
26
|
+
return { ...result, output: (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : input };
|
|
27
|
+
};
|
|
10
28
|
exports.updateEffectKeyframes = updateEffectKeyframes;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
import type { File } from '@babel/types';
|
|
2
1
|
import { type RemovedProp, type SequencePropsNodeUpdate, type SequencePropsNodeUpdateResult, type SequencePropUpdate } from '@remotion/codemods';
|
|
3
2
|
import type { InteractivitySchema, SequenceNodePath, VideoConfigValues } from 'remotion';
|
|
4
|
-
|
|
5
|
-
input: string;
|
|
6
|
-
nodePath: SequenceNodePath;
|
|
7
|
-
updates: SequencePropUpdate[];
|
|
8
|
-
schema: InteractivitySchema;
|
|
9
|
-
videoConfigValues: VideoConfigValues | null;
|
|
10
|
-
}) => {
|
|
11
|
-
serialized: string;
|
|
12
|
-
oldValueStrings: string[];
|
|
13
|
-
logLine: number;
|
|
14
|
-
removedProps: RemovedProp[];
|
|
15
|
-
};
|
|
16
|
-
export { type RemovedProp, type SequencePropsNodeUpdate, type SequencePropsNodeUpdateResult, type SequencePropUpdate, updateSequencePropsAst, };
|
|
3
|
+
export { type RemovedProp, type SequencePropsNodeUpdate, type SequencePropsNodeUpdateResult, type SequencePropUpdate, };
|
|
17
4
|
type PrettierConfigOverride = Record<string, unknown> | null;
|
|
18
5
|
type UpdateMultipleSequencePropsResult = {
|
|
19
6
|
output: string;
|
|
20
7
|
formatted: boolean;
|
|
21
8
|
results: SequencePropsNodeUpdateResult[];
|
|
22
|
-
ast: File;
|
|
23
9
|
};
|
|
24
10
|
type UpdateSequencePropsResult = {
|
|
25
11
|
output: string;
|
|
@@ -28,11 +14,10 @@ type UpdateSequencePropsResult = {
|
|
|
28
14
|
logLine: number;
|
|
29
15
|
removedProps: RemovedProp[];
|
|
30
16
|
};
|
|
31
|
-
export declare const updateMultipleSequenceProps: ({ input, changes, prettierConfigOverride,
|
|
17
|
+
export declare const updateMultipleSequenceProps: ({ input, changes, prettierConfigOverride, }: {
|
|
32
18
|
input: string;
|
|
33
19
|
changes: SequencePropsNodeUpdate[];
|
|
34
20
|
prettierConfigOverride: PrettierConfigOverride;
|
|
35
|
-
ast?: File | undefined;
|
|
36
21
|
}) => Promise<UpdateMultipleSequencePropsResult>;
|
|
37
22
|
export declare const updateSequenceProps: ({ input, nodePath, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
38
23
|
input: string;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateSequenceProps = exports.updateMultipleSequenceProps =
|
|
3
|
+
exports.updateSequenceProps = exports.updateMultipleSequenceProps = void 0;
|
|
4
4
|
const codemods_1 = require("@remotion/codemods");
|
|
5
|
-
const {
|
|
6
|
-
const updateMultipleSequenceProps = ({ input, changes, prettierConfigOverride, ast: providedAst, }) => {
|
|
5
|
+
const updateMultipleSequenceProps = ({ input, changes, prettierConfigOverride, }) => {
|
|
7
6
|
return Promise.resolve().then(() => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
var _a;
|
|
8
|
+
var _b;
|
|
9
|
+
const result = (0, codemods_1.updateMultipleJsxNodeProps)({
|
|
10
|
+
project: { files: { 'source.tsx': input }, rootDir: '/' },
|
|
11
|
+
changes: changes.map(({ nodePath, updates, schema, videoConfigValues }) => ({
|
|
12
|
+
node: { filePath: 'source.tsx', nodePath },
|
|
13
|
+
updates,
|
|
14
|
+
schema,
|
|
15
|
+
videoConfig: videoConfigValues !== null && videoConfigValues !== void 0 ? videoConfigValues : undefined,
|
|
16
|
+
})),
|
|
12
17
|
prettierConfigOverride,
|
|
13
18
|
});
|
|
14
|
-
|
|
19
|
+
const output = (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : input;
|
|
20
|
+
const { results } = result;
|
|
21
|
+
return { output, formatted: true, results };
|
|
15
22
|
});
|
|
16
23
|
};
|
|
17
24
|
exports.updateMultipleSequenceProps = updateMultipleSequenceProps;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const assertNoSymlinks: ({ rootDirectory, absolutePath, }: {
|
|
2
2
|
rootDirectory: string;
|
|
3
3
|
absolutePath: string;
|
|
4
|
+
}) => void;
|
|
5
|
+
export declare const openFileForWritingWithoutSymlinks: ({ rootDirectory, absolutePath, exclusive, }: {
|
|
6
|
+
rootDirectory: string;
|
|
7
|
+
absolutePath: string;
|
|
8
|
+
exclusive: boolean;
|
|
4
9
|
}) => number;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.openFileForWritingWithoutSymlinks = void 0;
|
|
6
|
+
exports.openFileForWritingWithoutSymlinks = exports.assertNoSymlinks = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const assertNoSymlinks = ({ rootDirectory, absolutePath, }) => {
|
|
@@ -29,23 +29,26 @@ const assertNoSymlinks = ({ rootDirectory, absolutePath, }) => {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
exports.assertNoSymlinks = assertNoSymlinks;
|
|
33
|
+
const openFileForWritingWithoutSymlinks = ({ rootDirectory, absolutePath, exclusive, }) => {
|
|
33
34
|
const resolvedRootDirectory = node_path_1.default.resolve(rootDirectory);
|
|
34
35
|
const resolvedAbsolutePath = node_path_1.default.resolve(absolutePath);
|
|
35
|
-
assertNoSymlinks({
|
|
36
|
+
(0, exports.assertNoSymlinks)({
|
|
36
37
|
rootDirectory: resolvedRootDirectory,
|
|
37
38
|
absolutePath: resolvedAbsolutePath,
|
|
38
39
|
});
|
|
39
40
|
node_fs_1.default.mkdirSync(node_path_1.default.dirname(resolvedAbsolutePath), { recursive: true });
|
|
40
|
-
assertNoSymlinks({
|
|
41
|
+
(0, exports.assertNoSymlinks)({
|
|
41
42
|
rootDirectory: resolvedRootDirectory,
|
|
42
43
|
absolutePath: resolvedAbsolutePath,
|
|
43
44
|
});
|
|
44
45
|
const flags = process.platform === 'win32'
|
|
45
|
-
?
|
|
46
|
+
? exclusive
|
|
47
|
+
? 'wx'
|
|
48
|
+
: 'w'
|
|
46
49
|
: node_fs_1.default.constants.O_CREAT |
|
|
47
50
|
node_fs_1.default.constants.O_WRONLY |
|
|
48
|
-
node_fs_1.default.constants.O_TRUNC |
|
|
51
|
+
(exclusive ? node_fs_1.default.constants.O_EXCL : node_fs_1.default.constants.O_TRUNC) |
|
|
49
52
|
node_fs_1.default.constants.O_NOFOLLOW;
|
|
50
53
|
return node_fs_1.default.openSync(resolvedAbsolutePath, flags);
|
|
51
54
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type RecastCodemod } from '@remotion/studio-shared';
|
|
2
1
|
export { ApiRoutes, CopyStillToClipboardRequest, getDefaultOutLocation, OpenInFileExplorerRequest, } from '@remotion/studio-shared';
|
|
3
2
|
export type { AggregateRenderProgress, BundlingState, CopyingState, DownloadProgress, HotMiddlewareOptions, JobProgressCallback, ModuleMap, PackageManager, ProjectInfo, RenderingProgressInput, RenderJob, RenderJobWithCleanup, RequiredChromiumOptions, StitchingProgressInput, UiOpenGlOptions, } from '@remotion/studio-shared';
|
|
4
3
|
import { AnsiDiff } from './ansi-diff';
|
|
@@ -89,27 +88,6 @@ export declare const StudioServerInternals: {
|
|
|
89
88
|
binary?: boolean | undefined;
|
|
90
89
|
signed: boolean;
|
|
91
90
|
}) | undefined) => string;
|
|
92
|
-
parseAndApplyCodemod: ({ input, codeMod, }: {
|
|
93
|
-
input: string;
|
|
94
|
-
codeMod: RecastCodemod;
|
|
95
|
-
}) => {
|
|
96
|
-
newContents: string;
|
|
97
|
-
changesMade: {
|
|
98
|
-
description: string;
|
|
99
|
-
}[];
|
|
100
|
-
};
|
|
101
|
-
applyCodemodToFile: ({ filePath, codeMod, }: {
|
|
102
|
-
filePath: string;
|
|
103
|
-
codeMod: RecastCodemod;
|
|
104
|
-
}) => Promise<string>;
|
|
105
|
-
updateDefaultProps: ({ input, compositionId, newDefaultProps, enumPaths, }: {
|
|
106
|
-
input: string;
|
|
107
|
-
compositionId: string;
|
|
108
|
-
newDefaultProps: Record<string, unknown>;
|
|
109
|
-
enumPaths: import("@remotion/studio-shared").EnumPath[];
|
|
110
|
-
}) => {
|
|
111
|
-
output: string;
|
|
112
|
-
};
|
|
113
91
|
getInstalledDependencies: (remotionRoot: string) => {
|
|
114
92
|
dependencies: string[];
|
|
115
93
|
devDependencies: string[];
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,8 @@ exports.StudioServerInternals = exports.remotionSkillNames = exports.parseRemoti
|
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const studio_shared_2 = require("@remotion/studio-shared");
|
|
6
6
|
Object.defineProperty(exports, "getDefaultOutLocation", { enumerable: true, get: function () { return studio_shared_2.getDefaultOutLocation; } });
|
|
7
|
-
const codemods_1 = require("@remotion/codemods");
|
|
8
7
|
const ansi_diff_1 = require("./ansi-diff");
|
|
9
8
|
const client_render_queue_1 = require("./client-render-queue");
|
|
10
|
-
const apply_codemod_to_file_1 = require("./codemods/apply-codemod-to-file");
|
|
11
9
|
const detect_outdated_remotion_skills_1 = require("./detect-outdated-remotion-skills");
|
|
12
10
|
Object.defineProperty(exports, "detectOutdatedRemotionSkills", { enumerable: true, get: function () { return detect_outdated_remotion_skills_1.detectOutdatedRemotionSkills; } });
|
|
13
11
|
Object.defineProperty(exports, "parseRemotionSkillVersion", { enumerable: true, get: function () { return detect_outdated_remotion_skills_1.parseRemotionSkillVersion; } });
|
|
@@ -24,8 +22,6 @@ const update_available_1 = require("./preview-server/update-available");
|
|
|
24
22
|
const remotion_skill_names_1 = require("./remotion-skill-names");
|
|
25
23
|
Object.defineProperty(exports, "remotionSkillNames", { enumerable: true, get: function () { return remotion_skill_names_1.remotionSkillNames; } });
|
|
26
24
|
const start_studio_1 = require("./start-studio");
|
|
27
|
-
const { updateDefaultProps } = codemods_1.CodemodsInternals;
|
|
28
|
-
const parseAndApplyCodemod = ({ input, codeMod, }) => codemods_1.CodemodsInternals.parseAndApplyCodemod({ input, codeMod });
|
|
29
25
|
exports.StudioServerInternals = {
|
|
30
26
|
startStudio: start_studio_1.startStudio,
|
|
31
27
|
getRemotionVersion: update_available_1.getRemotionVersion,
|
|
@@ -43,9 +39,6 @@ exports.StudioServerInternals = {
|
|
|
43
39
|
setFileWatcherRegistry: file_watcher_1.setFileWatcherRegistry,
|
|
44
40
|
AnsiDiff: ansi_diff_1.AnsiDiff,
|
|
45
41
|
formatBytes: studio_shared_1.formatBytes,
|
|
46
|
-
parseAndApplyCodemod,
|
|
47
|
-
applyCodemodToFile: apply_codemod_to_file_1.applyCodemodToFile,
|
|
48
|
-
updateDefaultProps,
|
|
49
42
|
getInstalledDependencies: get_installed_dependencies_1.getInstalledDependencies,
|
|
50
43
|
getInstalledDependenciesWithVersions: get_installed_dependencies_1.getInstalledDependenciesWithVersions,
|
|
51
44
|
getInstallCommand: install_command_1.getInstallCommand,
|
|
@@ -45,6 +45,7 @@ const remove_render_1 = require("./routes/remove-render");
|
|
|
45
45
|
const rename_static_file_1 = require("./routes/rename-static-file");
|
|
46
46
|
const reorder_effect_1 = require("./routes/reorder-effect");
|
|
47
47
|
const reorder_sequence_1 = require("./routes/reorder-sequence");
|
|
48
|
+
const replace_video_source_1 = require("./routes/replace-video-source");
|
|
48
49
|
const restart_studio_1 = require("./routes/restart-studio");
|
|
49
50
|
const save_effect_props_1 = require("./routes/save-effect-props");
|
|
50
51
|
const save_multiple_effect_props_1 = require("./routes/save-multiple-effect-props");
|
|
@@ -66,6 +67,7 @@ const update_effect_keyframe_settings_1 = require("./routes/update-effect-keyfra
|
|
|
66
67
|
const update_element_install_target_1 = require("./routes/update-element-install-target");
|
|
67
68
|
const update_sequence_keyframe_settings_1 = require("./routes/update-sequence-keyframe-settings");
|
|
68
69
|
const upgrade_remotion_1 = require("./routes/upgrade-remotion");
|
|
70
|
+
const wrap_jsx_node_1 = require("./routes/wrap-jsx-node");
|
|
69
71
|
exports.allApiRoutes = {
|
|
70
72
|
'/api/invalidate-bundle': invalidate_bundle_1.invalidateBundleHandler,
|
|
71
73
|
'/api/composition-component-info': composition_component_info_1.compositionComponentInfoHandler,
|
|
@@ -110,9 +112,11 @@ exports.allApiRoutes = {
|
|
|
110
112
|
'/api/paste-effects': paste_effects_1.pasteEffectsHandler,
|
|
111
113
|
'/api/delete-jsx-nodes': delete_jsx_nodes_1.deleteJsxNodesHandler,
|
|
112
114
|
'/api/duplicate-jsx-node': duplicate_jsx_node_1.duplicateJsxNodeHandler,
|
|
115
|
+
'/api/wrap-jsx-node': wrap_jsx_node_1.wrapJsxNodeHandler,
|
|
113
116
|
'/api/split-jsx-sequence': split_jsx_sequence_1.splitJsxSequenceHandler,
|
|
114
117
|
'/api/split-video-from-audio': split_video_from_audio_1.splitVideoFromAudioHandler,
|
|
115
118
|
'/api/insert-basic-captions': insert_basic_captions_1.insertBasicCaptionsHandler,
|
|
119
|
+
'/api/replace-video-source': replace_video_source_1.replaceVideoSourceHandler,
|
|
116
120
|
'/api/update-available': update_available_1.handleUpdate,
|
|
117
121
|
'/api/release-notes': release_notes_1.getReleaseNotesHandler,
|
|
118
122
|
'/api/remotion-skills-info': remotion_skills_info_1.remotionSkillsInfoHandler,
|