@remotion/studio-server 4.0.513 → 4.0.514

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.
Files changed (56) hide show
  1. package/dist/codemods/delete-jsx-node.d.ts +2 -5
  2. package/dist/codemods/delete-jsx-node.js +23 -341
  3. package/dist/codemods/duplicate-composition.d.ts +1 -9
  4. package/dist/codemods/duplicate-composition.js +3 -49
  5. package/dist/codemods/format-inline-content.d.ts +0 -4
  6. package/dist/codemods/format-inline-content.js +7 -46
  7. package/dist/codemods/recast-mods.js +0 -18
  8. package/dist/codemods/reorder-sequence.d.ts +2 -2
  9. package/dist/codemods/reorder-sequence.js +12 -112
  10. package/dist/codemods/split-jsx-sequence.d.ts +1 -2
  11. package/dist/codemods/split-jsx-sequence.js +11 -298
  12. package/dist/codemods/split-video-from-audio.d.ts +15 -0
  13. package/dist/codemods/split-video-from-audio.js +15 -0
  14. package/dist/codemods/update-default-props.d.ts +2 -6
  15. package/dist/codemods/update-default-props.js +12 -220
  16. package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.d.ts +1 -4
  17. package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.js +5 -102
  18. package/dist/codemods/update-keyframes/update-keyframes.d.ts +8 -93
  19. package/dist/codemods/update-keyframes/update-keyframes.js +11 -1302
  20. package/dist/detect-outdated-remotion-skills.d.ts +7 -0
  21. package/dist/detect-outdated-remotion-skills.js +11 -5
  22. package/dist/helpers/resolve-composition-component.d.ts +3 -11
  23. package/dist/helpers/resolve-composition-component.js +38 -1495
  24. package/dist/index.d.ts +3 -2
  25. package/dist/index.js +1 -0
  26. package/dist/max-timeline-tracks.d.ts +2 -1
  27. package/dist/max-timeline-tracks.js +10 -4
  28. package/dist/preview-server/api-routes.js +4 -0
  29. package/dist/preview-server/routes/add-effect.js +1 -1
  30. package/dist/preview-server/routes/apply-codemod.js +3 -3
  31. package/dist/preview-server/routes/apply-visual-control-change.js +3 -3
  32. package/dist/preview-server/routes/can-update-sequence-props.js +107 -24
  33. package/dist/preview-server/routes/delete-effect.js +1 -1
  34. package/dist/preview-server/routes/delete-jsx-node.js +1 -1
  35. package/dist/preview-server/routes/duplicate-effect.js +1 -1
  36. package/dist/preview-server/routes/duplicate-jsx-node.js +1 -1
  37. package/dist/preview-server/routes/element-install-plan.d.ts +1 -1
  38. package/dist/preview-server/routes/insert-element.js +2 -2
  39. package/dist/preview-server/routes/insert-jsx-element.js +1 -1
  40. package/dist/preview-server/routes/log-updates/log-effect-update.js +2 -1
  41. package/dist/preview-server/routes/log-updates/log-update.js +2 -1
  42. package/dist/preview-server/routes/paste-effects.js +1 -1
  43. package/dist/preview-server/routes/remotion-skills-info.d.ts +7 -0
  44. package/dist/preview-server/routes/remotion-skills-info.js +24 -0
  45. package/dist/preview-server/routes/reorder-effect.js +1 -1
  46. package/dist/preview-server/routes/reorder-sequence.js +1 -1
  47. package/dist/preview-server/routes/source-file-write-queue.d.ts +1 -0
  48. package/dist/preview-server/routes/source-file-write-queue.js +11 -2
  49. package/dist/preview-server/routes/split-jsx-sequence.js +1 -1
  50. package/dist/preview-server/routes/split-video-from-audio.d.ts +3 -0
  51. package/dist/preview-server/routes/split-video-from-audio.js +80 -0
  52. package/dist/preview-server/routes/update-default-props.js +1 -1
  53. package/dist/preview-server/start-server.js +188 -140
  54. package/dist/preview-server/undo-stack.d.ts +3 -52
  55. package/dist/preview-server/update-available.js +4 -4
  56. package/package.json +8 -8
package/dist/index.d.ts CHANGED
@@ -60,7 +60,8 @@ export declare const StudioServerInternals: {
60
60
  installCommand: string;
61
61
  startCommand: string;
62
62
  };
63
- getMaxTimelineTracks: () => number;
63
+ getMaxTimelineTracks: () => number | null;
64
+ getConfiguredMaxTimelineTracks: () => number | null;
64
65
  setMaxTimelineTracks: (maxTracks: number) => void;
65
66
  resetMaxTimelineTracks: () => void;
66
67
  getLatestRemotionVersion: () => Promise<any>;
@@ -92,7 +93,7 @@ export declare const StudioServerInternals: {
92
93
  codeMod: import("@remotion/studio-shared").RecastCodemod;
93
94
  }) => {
94
95
  newContents: string;
95
- changesMade: import("./codemods/recast-mods").Change[];
96
+ changesMade: import("@remotion/studio-codemods").Change[];
96
97
  };
97
98
  applyCodemodToFile: ({ filePath, codeMod, }: {
98
99
  filePath: string;
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ exports.StudioServerInternals = {
32
32
  lockFilePaths: get_package_manager_1.lockFilePaths,
33
33
  getPackageManager: get_package_manager_1.getPackageManager,
34
34
  getMaxTimelineTracks: max_timeline_tracks_1.getMaxTimelineTracks,
35
+ getConfiguredMaxTimelineTracks: max_timeline_tracks_1.getConfiguredMaxTimelineTracks,
35
36
  setMaxTimelineTracks: max_timeline_tracks_1.setMaxTimelineTracks,
36
37
  resetMaxTimelineTracks: max_timeline_tracks_1.resetMaxTimelineTracks,
37
38
  getLatestRemotionVersion: get_latest_remotion_version_1.getLatestRemotionVersion,
@@ -1,3 +1,4 @@
1
1
  export declare const setMaxTimelineTracks: (maxTracks: number) => void;
2
- export declare const getMaxTimelineTracks: () => number;
2
+ export declare const getMaxTimelineTracks: () => number | null;
3
+ export declare const getConfiguredMaxTimelineTracks: () => number | null;
3
4
  export declare const resetMaxTimelineTracks: () => void;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resetMaxTimelineTracks = exports.getMaxTimelineTracks = exports.setMaxTimelineTracks = void 0;
4
- const studio_shared_1 = require("@remotion/studio-shared");
5
- let maxTimelineTracks = studio_shared_1.DEFAULT_TIMELINE_TRACKS;
3
+ exports.resetMaxTimelineTracks = exports.getConfiguredMaxTimelineTracks = exports.getMaxTimelineTracks = exports.setMaxTimelineTracks = void 0;
4
+ let maxTimelineTracks = null;
5
+ let configuredMaxTimelineTracks = null;
6
6
  const setMaxTimelineTracks = (maxTracks) => {
7
7
  if (typeof maxTracks !== 'number') {
8
8
  throw new Error(`Need to pass a number to Config.setMaxTimelineTracks(), got ${typeof maxTracks}`);
@@ -17,13 +17,19 @@ const setMaxTimelineTracks = (maxTracks) => {
17
17
  throw new Error(`Need to pass a non-negative number to Config.setMaxTimelineTracks(), got ${maxTracks}`);
18
18
  }
19
19
  maxTimelineTracks = maxTracks;
20
+ configuredMaxTimelineTracks = maxTracks;
20
21
  };
21
22
  exports.setMaxTimelineTracks = setMaxTimelineTracks;
22
23
  const getMaxTimelineTracks = () => {
23
24
  return maxTimelineTracks;
24
25
  };
25
26
  exports.getMaxTimelineTracks = getMaxTimelineTracks;
27
+ const getConfiguredMaxTimelineTracks = () => {
28
+ return configuredMaxTimelineTracks;
29
+ };
30
+ exports.getConfiguredMaxTimelineTracks = getConfiguredMaxTimelineTracks;
26
31
  const resetMaxTimelineTracks = () => {
27
- maxTimelineTracks = studio_shared_1.DEFAULT_TIMELINE_TRACKS;
32
+ maxTimelineTracks = null;
33
+ configuredMaxTimelineTracks = null;
28
34
  };
29
35
  exports.resetMaxTimelineTracks = resetMaxTimelineTracks;
@@ -37,6 +37,7 @@ const prepare_element_install_1 = require("./routes/prepare-element-install");
37
37
  const project_info_1 = require("./routes/project-info");
38
38
  const redo_1 = require("./routes/redo");
39
39
  const register_client_render_1 = require("./routes/register-client-render");
40
+ const remotion_skills_info_1 = require("./routes/remotion-skills-info");
40
41
  const remove_render_1 = require("./routes/remove-render");
41
42
  const rename_static_file_1 = require("./routes/rename-static-file");
42
43
  const reorder_effect_1 = require("./routes/reorder-effect");
@@ -46,6 +47,7 @@ const save_effect_props_1 = require("./routes/save-effect-props");
46
47
  const save_multiple_effect_props_1 = require("./routes/save-multiple-effect-props");
47
48
  const save_sequence_props_1 = require("./routes/save-sequence-props");
48
49
  const split_jsx_sequence_1 = require("./routes/split-jsx-sequence");
50
+ const split_video_from_audio_1 = require("./routes/split-video-from-audio");
49
51
  const subscribe_to_default_props_1 = require("./routes/subscribe-to-default-props");
50
52
  const subscribe_to_file_existence_1 = require("./routes/subscribe-to-file-existence");
51
53
  const subscribe_to_sequence_props_1 = require("./routes/subscribe-to-sequence-props");
@@ -104,7 +106,9 @@ exports.allApiRoutes = {
104
106
  '/api/delete-jsx-node': delete_jsx_node_1.deleteJsxNodeHandler,
105
107
  '/api/duplicate-jsx-node': duplicate_jsx_node_1.duplicateJsxNodeHandler,
106
108
  '/api/split-jsx-sequence': split_jsx_sequence_1.splitJsxSequenceHandler,
109
+ '/api/split-video-from-audio': split_video_from_audio_1.splitVideoFromAudioHandler,
107
110
  '/api/update-available': update_available_1.handleUpdate,
111
+ '/api/remotion-skills-info': remotion_skills_info_1.remotionSkillsInfoHandler,
108
112
  '/api/project-info': project_info_1.projectInfoHandler,
109
113
  '/api/delete-static-file': delete_static_file_1.deleteStaticFileHandler,
110
114
  '/api/rename-static-file': rename_static_file_1.renameStaticFileHandler,
@@ -55,7 +55,7 @@ const addEffectHandler = ({ input: { fileName, sequenceNodePath, effectName, eff
55
55
  absolutePath,
56
56
  line: logLine,
57
57
  });
58
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Added ${(0, formatting_1.attrName)(effectLabel)} to ${nodeLabel}`);
58
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Added ${(0, formatting_1.attrName)(effectLabel)} to ${nodeLabel}`);
59
59
  if (!formatted) {
60
60
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
61
61
  }
@@ -7,10 +7,10 @@ exports.applyCodemodHandler = exports.getCodemodLogMessage = void 0;
7
7
  const node_fs_1 = require("node:fs");
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
9
  const renderer_1 = require("@remotion/renderer");
10
+ const studio_codemods_1 = require("@remotion/studio-codemods");
10
11
  const generate_canvas_capture_composition_1 = require("../../canvas-capture/generate-canvas-capture-composition");
11
12
  const apply_codemod_to_file_1 = require("../../codemods/apply-codemod-to-file");
12
13
  const duplicate_composition_1 = require("../../codemods/duplicate-composition");
13
- const simple_diff_1 = require("../../codemods/simple-diff");
14
14
  const file_watcher_1 = require("../../file-watcher");
15
15
  const format_log_file_location_1 = require("../format-log-file-location");
16
16
  const project_info_1 = require("../project-info");
@@ -194,7 +194,7 @@ const applyCodemodHandler = ({ input: { codemod, dryRun, symbolicatedStack }, lo
194
194
  filePath,
195
195
  codeMod: codemod,
196
196
  });
197
- const diff = (0, simple_diff_1.simpleDiff)({
197
+ const diff = (0, studio_codemods_1.simpleDiff)({
198
198
  oldLines: input.split('\n'),
199
199
  newLines: formatted.split('\n'),
200
200
  });
@@ -272,7 +272,7 @@ const applyCodemodHandler = ({ input: { codemod, dryRun, symbolicatedStack }, lo
272
272
  });
273
273
  }
274
274
  const logMessage = (0, exports.getCodemodLogMessage)(codemod);
275
- const editMessage = `${renderer_1.RenderInternals.chalk.blueBright((0, format_log_file_location_1.formatLogFileLocation)({
275
+ const editMessage = `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright((0, format_log_file_location_1.formatLogFileLocation)({
276
276
  remotionRoot,
277
277
  absolutePath: filePath,
278
278
  line: logLine,
@@ -36,9 +36,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.applyVisualControlHandler = void 0;
37
37
  const node_fs_1 = require("node:fs");
38
38
  const renderer_1 = require("@remotion/renderer");
39
+ const studio_codemods_1 = require("@remotion/studio-codemods");
39
40
  const recast = __importStar(require("recast"));
40
41
  const parse_ast_1 = require("../../codemods/parse-ast");
41
- const recast_mods_1 = require("../../codemods/recast-mods");
42
42
  const file_watcher_1 = require("../../file-watcher");
43
43
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
44
44
  const format_log_file_location_1 = require("../format-log-file-location");
@@ -78,7 +78,7 @@ const applyVisualControlHandler = ({ input: { fileName, changes }, remotionRoot,
78
78
  const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
79
79
  const ast = (0, parse_ast_1.parseAst)(fileContents);
80
80
  const logLine = changes.length > 0 ? getVisualControlChangeLine(ast, changes[0].id) : 1;
81
- const { newAst, changesMade } = (0, recast_mods_1.applyCodemod)({
81
+ const { newAst, changesMade } = (0, studio_codemods_1.applyCodemod)({
82
82
  file: ast,
83
83
  codeMod: {
84
84
  type: 'apply-visual-control',
@@ -150,7 +150,7 @@ const applyVisualControlHandler = ({ input: { fileName, changes }, remotionRoot,
150
150
  absolutePath,
151
151
  line: logLine,
152
152
  });
153
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Applied visual control changes`);
153
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Applied visual control changes`);
154
154
  if (!formatted) {
155
155
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
156
156
  }
@@ -603,12 +603,8 @@ const getFrameDisplayOffsetAdjustmentBetweenPaths = ({ startPath, endPath, video
603
603
  }
604
604
  return current ? { adjustment, hasEnclosingElement } : null;
605
605
  };
606
- const getDefaultFrameDisplayOffsetAdjustment = ({ jsxElement, ast, videoConfigValues, }) => {
606
+ const getDefaultFrameDisplayOffsetAdjustment = ({ jsxPath, videoConfigValues, }) => {
607
607
  var _a;
608
- const jsxPath = findNodePath(ast, jsxElement);
609
- if (!jsxPath) {
610
- return null;
611
- }
612
608
  let functionPath = jsxPath.parentPath;
613
609
  while (functionPath) {
614
610
  const node = functionPath.value;
@@ -629,15 +625,50 @@ const getDefaultFrameDisplayOffsetAdjustment = ({ jsxElement, ast, videoConfigVa
629
625
  });
630
626
  return (_a = result === null || result === void 0 ? void 0 : result.adjustment) !== null && _a !== void 0 ? _a : null;
631
627
  };
632
- const getCurrentFrameDisplayOffsetAdjustment = ({ node, ast, videoConfigValues, }) => {
628
+ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
633
629
  var _a;
634
630
  if (node.type === 'TSAsExpression') {
635
- return getCurrentFrameDisplayOffsetAdjustment({
631
+ return resolveCurrentFrameExpression({
636
632
  node: node.expression,
637
633
  ast,
638
- videoConfigValues,
634
+ seenDeclarations,
639
635
  });
640
636
  }
637
+ if (node.type === 'BinaryExpression' &&
638
+ (node.operator === '+' || node.operator === '-')) {
639
+ const rightValue = getNumericValue(node.right);
640
+ if (rightValue !== null && Number.isFinite(rightValue)) {
641
+ const resolvedLeft = resolveCurrentFrameExpression({
642
+ node: node.left,
643
+ ast,
644
+ seenDeclarations,
645
+ });
646
+ if (resolvedLeft !== null) {
647
+ return {
648
+ ...resolvedLeft,
649
+ offset: resolvedLeft.offset +
650
+ (node.operator === '+' ? rightValue : -rightValue),
651
+ };
652
+ }
653
+ }
654
+ if (node.operator === '+') {
655
+ const leftValue = getNumericValue(node.left);
656
+ if (leftValue !== null && Number.isFinite(leftValue)) {
657
+ const resolvedRight = resolveCurrentFrameExpression({
658
+ node: node.right,
659
+ ast,
660
+ seenDeclarations,
661
+ });
662
+ if (resolvedRight !== null) {
663
+ return {
664
+ ...resolvedRight,
665
+ offset: resolvedRight.offset + leftValue,
666
+ };
667
+ }
668
+ }
669
+ }
670
+ return null;
671
+ }
641
672
  if (node.type !== 'Identifier') {
642
673
  return null;
643
674
  }
@@ -647,7 +678,9 @@ const getCurrentFrameDisplayOffsetAdjustment = ({ node, ast, videoConfigValues,
647
678
  return null;
648
679
  }
649
680
  let matchingDeclarations = 0;
650
- let isCurrentFrameBinding = false;
681
+ let matchingDeclaration = null;
682
+ let initializer = null;
683
+ let isConstDeclaration = false;
651
684
  recast.types.visit(bindingScope.path, {
652
685
  visitVariableDeclarator(p) {
653
686
  var _a;
@@ -658,18 +691,68 @@ const getCurrentFrameDisplayOffsetAdjustment = ({ node, ast, videoConfigValues,
658
691
  return this.traverse(p);
659
692
  }
660
693
  matchingDeclarations++;
661
- isCurrentFrameBinding = Boolean(init && isUseCurrentFrameCall(init, ast));
694
+ const declaration = p.parentPath.node;
695
+ if (init) {
696
+ matchingDeclaration = p.node;
697
+ initializer = init;
698
+ isConstDeclaration =
699
+ declaration.type === 'VariableDeclaration' &&
700
+ declaration.kind === 'const';
701
+ }
662
702
  return false;
663
703
  },
664
704
  });
665
- if (matchingDeclarations !== 1 || !isCurrentFrameBinding) {
705
+ if (matchingDeclarations !== 1 ||
706
+ matchingDeclaration === null ||
707
+ initializer === null ||
708
+ seenDeclarations.has(matchingDeclaration)) {
709
+ return null;
710
+ }
711
+ if (isUseCurrentFrameCall(initializer, ast)) {
712
+ return { bindingScopePath: bindingScope.path, offset: 0 };
713
+ }
714
+ if (!isConstDeclaration) {
715
+ return null;
716
+ }
717
+ const nextSeenDeclarations = new Set(seenDeclarations);
718
+ nextSeenDeclarations.add(matchingDeclaration);
719
+ return resolveCurrentFrameExpression({
720
+ node: initializer,
721
+ ast,
722
+ seenDeclarations: nextSeenDeclarations,
723
+ });
724
+ };
725
+ const getCurrentFrameDisplayOffsetAdjustment = ({ node, ast, videoConfigValues, }) => {
726
+ if (node.type === 'TSAsExpression') {
727
+ return getCurrentFrameDisplayOffsetAdjustment({
728
+ node: node.expression,
729
+ ast,
730
+ videoConfigValues,
731
+ });
732
+ }
733
+ const nodePath = findNodePath(ast, node);
734
+ const resolved = resolveCurrentFrameExpression({
735
+ node,
736
+ ast,
737
+ seenDeclarations: new Set(),
738
+ });
739
+ if (!nodePath || resolved === null) {
666
740
  return null;
667
741
  }
668
- return getFrameDisplayOffsetAdjustmentBetweenPaths({
742
+ const frameDisplayOffset = getFrameDisplayOffsetAdjustmentBetweenPaths({
669
743
  startPath: nodePath,
670
- endPath: bindingScope.path,
744
+ endPath: resolved.bindingScopePath,
671
745
  videoConfigValues,
672
746
  });
747
+ if (frameDisplayOffset === null) {
748
+ return null;
749
+ }
750
+ return {
751
+ ...frameDisplayOffset,
752
+ // interpolate(frame + offset, [keyframe], ...) reaches the keyframe at
753
+ // composition frame `keyframe - offset`.
754
+ adjustment: frameDisplayOffset.adjustment - resolved.offset,
755
+ };
673
756
  };
674
757
  const getComputedStatus = (node, ast, videoConfigValues) => {
675
758
  const interpolation = getInterpolationKeyframes(node, ast, videoConfigValues);
@@ -769,17 +852,17 @@ const findJsxElementAtNodePath = (ast, nodePath) => {
769
852
  return current ? current.value : null;
770
853
  };
771
854
  exports.findJsxElementAtNodePath = findJsxElementAtNodePath;
772
- const findJsxElementNodeAtNodePath = (ast, nodePath) => {
855
+ const getJsxElementNodeFromJsxPath = (jsxPath) => {
773
856
  var _a;
774
- const current = (0, exports.findJsxElementPathAtNodePath)(ast, nodePath);
775
- if (!current) {
776
- return null;
777
- }
778
- if (recast.types.namedTypes.JSXElement.check((_a = current.parentPath) === null || _a === void 0 ? void 0 : _a.value)) {
779
- return current.parentPath.value;
857
+ if (recast.types.namedTypes.JSXElement.check((_a = jsxPath.parentPath) === null || _a === void 0 ? void 0 : _a.value)) {
858
+ return jsxPath.parentPath.value;
780
859
  }
781
860
  return null;
782
861
  };
862
+ const findJsxElementNodeAtNodePath = (ast, nodePath) => {
863
+ const current = (0, exports.findJsxElementPathAtNodePath)(ast, nodePath);
864
+ return current ? getJsxElementNodeFromJsxPath(current) : null;
865
+ };
783
866
  exports.findJsxElementNodeAtNodePath = findJsxElementNodeAtNodePath;
784
867
  const findJsxChildrenAttribute = (jsxElement) => {
785
868
  const childrenAttr = jsxElement.attributes.find((attr) => {
@@ -1175,9 +1258,10 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
1175
1258
  };
1176
1259
  const computeSequencePropsStatusFromAstAndIdentifiers = ({ ast, nodePath, componentIdentity, keys, assetKeys, effects, videoConfigIdentifierValues, }) => {
1177
1260
  var _a;
1178
- const jsxElementNode = (0, exports.findJsxElementNodeAtNodePath)(ast, nodePath);
1261
+ const jsxPath = (0, exports.findJsxElementPathAtNodePath)(ast, nodePath);
1262
+ const jsxElementNode = jsxPath ? getJsxElementNodeFromJsxPath(jsxPath) : null;
1179
1263
  const jsxElement = (_a = jsxElementNode === null || jsxElementNode === void 0 ? void 0 : jsxElementNode.openingElement) !== null && _a !== void 0 ? _a : null;
1180
- if (!jsxElement || !jsxElementNode) {
1264
+ if (!jsxPath || !jsxElement || !jsxElementNode) {
1181
1265
  throw new jsx_element_not_found_at_location_error_1.JsxElementNotFoundAtLocationError();
1182
1266
  }
1183
1267
  if (!(0, jsx_component_identity_1.jsxComponentIdentitiesMatch)({
@@ -1201,8 +1285,7 @@ const computeSequencePropsStatusFromAstAndIdentifiers = ({ ast, nodePath, compon
1201
1285
  videoConfigValues: videoConfigIdentifierValues,
1202
1286
  });
1203
1287
  const defaultKeyframeDisplayOffsetAdjustment = getDefaultFrameDisplayOffsetAdjustment({
1204
- jsxElement,
1205
- ast,
1288
+ jsxPath,
1206
1289
  videoConfigValues: videoConfigIdentifierValues,
1207
1290
  });
1208
1291
  const addDefaultKeyframeDisplayOffsetAdjustment = (status) => {
@@ -90,7 +90,7 @@ const deleteEffectHandler = ({ input: effects, remotionRoot, logLevel }) => {
90
90
  absolutePath: update.absolutePath,
91
91
  line: update.logLine,
92
92
  });
93
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} ${(0, formatting_1.strikeThroughOrRemovedPrefix)(deletedEffectDescription)}`);
93
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} ${(0, formatting_1.strikeThroughOrRemovedPrefix)(deletedEffectDescription)}`);
94
94
  if (!update.formatted) {
95
95
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
96
96
  }
@@ -87,7 +87,7 @@ const deleteJsxNodeHandler = ({ input: { nodes }, remotionRoot, logLevel }) => {
87
87
  absolutePath: update.absolutePath,
88
88
  line: update.logLine,
89
89
  });
90
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Deleted ${deletedNodeDescription}`);
90
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Deleted ${deletedNodeDescription}`);
91
91
  if (!update.formatted) {
92
92
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
93
93
  }
@@ -84,7 +84,7 @@ const duplicateEffectHandler = ({ input: effects, remotionRoot, logLevel }) => {
84
84
  absolutePath: update.absolutePath,
85
85
  line: update.logLine,
86
86
  });
87
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Duplicated ${(0, formatting_1.attrName)(duplicatedEffectDescription)}`);
87
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Duplicated ${(0, formatting_1.attrName)(duplicatedEffectDescription)}`);
88
88
  if (!update.formatted) {
89
89
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
90
90
  }
@@ -56,7 +56,7 @@ const duplicateJsxNodeHandler = ({ input: { fileName, nodePath }, remotionRoot,
56
56
  absolutePath,
57
57
  line: logLine,
58
58
  });
59
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Duplicated ${nodeLabel}`);
59
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Duplicated ${nodeLabel}`);
60
60
  if (!formatted) {
61
61
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
62
62
  }
@@ -25,7 +25,7 @@ export declare const getElementInstallPlan: ({ compositionFile, compositionId, e
25
25
  expectedFileState: ElementInstallExpectedFileState;
26
26
  filePath: string;
27
27
  importPath: string;
28
- location: import("../../helpers/resolve-composition-component").ResolvedCompositionComponentWithFile;
28
+ location: import("@remotion/studio-codemods").ResolvedCompositionComponentWithFile;
29
29
  safePaths: {
30
30
  compositionFileName: string;
31
31
  elementFileName: string;
@@ -197,8 +197,8 @@ const insertElementHandler = ({ input: { compositionFile, compositionId, element
197
197
  : plan.elementFileExists
198
198
  ? 'Reused existing Element source'
199
199
  : 'Created Element source';
200
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(elementLocationLabel)} ${elementFileAction}`);
201
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(compositionLocationLabel)} Added <${plan.componentName}>`);
200
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(elementLocationLabel)} ${elementFileAction}`);
201
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(compositionLocationLabel)} Added <${plan.componentName}>`);
202
202
  if (!inserted.formatted) {
203
203
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
204
204
  }
@@ -204,7 +204,7 @@ const insertJsxElementHandler = ({ input: { compositionFile, compositionId, elem
204
204
  absolutePath: fileName,
205
205
  line: logLine,
206
206
  });
207
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Added ${elementLabel}`);
207
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Added ${elementLabel}`);
208
208
  if (!formatted) {
209
209
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
210
210
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.logEffectUpdate = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const source_file_write_queue_1 = require("../source-file-write-queue");
5
6
  const format_effect_prop_change_1 = require("./format-effect-prop-change");
6
7
  const log_update_1 = require("./log-update");
7
8
  const logEffectUpdate = ({ fileRelativeToRoot, line, effectName, propKey, oldValueString, newValueString, defaultValueString, formatted, logLevel, removedProps, addedProps, }) => {
@@ -15,7 +16,7 @@ const logEffectUpdate = ({ fileRelativeToRoot, line, effectName, propKey, oldVal
15
16
  removedProps,
16
17
  addedProps,
17
18
  });
18
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} ${propChange}`);
19
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} ${propChange}`);
19
20
  if (!formatted) {
20
21
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
21
22
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.logUpdate = exports.normalizeQuotes = exports.warnAboutPrettierOnce = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const source_file_write_queue_1 = require("../source-file-write-queue");
5
6
  const format_prop_change_1 = require("./format-prop-change");
6
7
  let warnedAboutPrettier = false;
7
8
  const warnAboutPrettierOnce = (logLevel) => {
@@ -31,7 +32,7 @@ const logUpdate = ({ fileRelativeToRoot, line, key, oldValueString, newValueStri
31
32
  removedProps,
32
33
  addedProps,
33
34
  });
34
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} ${propChange}`);
35
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} ${propChange}`);
35
36
  if (!formatted) {
36
37
  (0, exports.warnAboutPrettierOnce)(logLevel);
37
38
  }
@@ -66,7 +66,7 @@ const pasteEffectsHandler = ({ input: { targetFileName, targetSequenceNodePath,
66
66
  absolutePath,
67
67
  line: logLine,
68
68
  });
69
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Pasted ${(0, formatting_1.attrName)(effectDescription)}`);
69
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Pasted ${(0, formatting_1.attrName)(effectDescription)}`);
70
70
  if (!formatted) {
71
71
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
72
72
  }
@@ -0,0 +1,7 @@
1
+ import type { GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
3
+ export declare const getRemotionSkillsInfo: ({ remotionRoot, homeDirectory, }: {
4
+ remotionRoot: string;
5
+ homeDirectory?: string | undefined;
6
+ }) => GetRemotionSkillsInfoResponse;
7
+ export declare const remotionSkillsInfoHandler: ApiHandler<GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.remotionSkillsInfoHandler = exports.getRemotionSkillsInfo = void 0;
7
+ const node_fs_1 = require("node:fs");
8
+ const node_os_1 = require("node:os");
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const detect_outdated_remotion_skills_1 = require("../../detect-outdated-remotion-skills");
11
+ const getRemotionSkillsInfo = ({ remotionRoot, homeDirectory = (0, node_os_1.homedir)(), }) => {
12
+ const skillsDirectories = (0, detect_outdated_remotion_skills_1.getRemotionSkillsDirectories)({
13
+ cwd: remotionRoot,
14
+ homeDirectory,
15
+ });
16
+ const isSkillAvailable = (skillName) => Object.values(skillsDirectories).some((skillsDirectory) => (0, node_fs_1.existsSync)(node_path_1.default.join(skillsDirectory, skillName, 'SKILL.md')));
17
+ return {
18
+ remotionUpgradeSkillAvailable: isSkillAvailable('remotion-upgrade'),
19
+ remotionInteractivitySkillAvailable: isSkillAvailable('remotion-interactivity'),
20
+ };
21
+ };
22
+ exports.getRemotionSkillsInfo = getRemotionSkillsInfo;
23
+ const remotionSkillsInfoHandler = ({ remotionRoot }) => Promise.resolve((0, exports.getRemotionSkillsInfo)({ remotionRoot }));
24
+ exports.remotionSkillsInfoHandler = remotionSkillsInfoHandler;
@@ -54,7 +54,7 @@ const reorderEffectHandler = ({ input: { fileName, sequenceNodePath, fromIndex,
54
54
  absolutePath,
55
55
  line: logLine,
56
56
  });
57
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Reordered ${(0, formatting_1.attrName)(effectLabel)}`);
57
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Reordered ${(0, formatting_1.attrName)(effectLabel)}`);
58
58
  if (!formatted) {
59
59
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
60
60
  }
@@ -62,7 +62,7 @@ const reorderSequenceHandler = ({ input: { fileName, sourceNodePath, targetNodeP
62
62
  absolutePath,
63
63
  line: logLine,
64
64
  });
65
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Reordered ${(0, formatting_1.attrName)(sequenceLabel)}`);
65
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Reordered ${(0, formatting_1.attrName)(sequenceLabel)}`);
66
66
  if (!formatted) {
67
67
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
68
68
  }
@@ -1 +1,2 @@
1
+ export declare const getCodemodTimingPrefix: (logLevel: "error" | "info" | "trace" | "verbose" | "warn") => string;
1
2
  export declare const withSourceFileWriteQueue: <T>(fn: () => Promise<T>) => Promise<T>;
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withSourceFileWriteQueue = void 0;
3
+ exports.withSourceFileWriteQueue = exports.getCodemodTimingPrefix = void 0;
4
+ const node_async_hooks_1 = require("node:async_hooks");
4
5
  let chain = Promise.resolve();
6
+ const codemodStartTime = new node_async_hooks_1.AsyncLocalStorage();
7
+ const getCodemodTimingPrefix = (logLevel) => {
8
+ const startTime = codemodStartTime.getStore();
9
+ return logLevel === 'trace' && startTime !== undefined
10
+ ? `[${Date.now() - startTime}ms] `
11
+ : '';
12
+ };
13
+ exports.getCodemodTimingPrefix = getCodemodTimingPrefix;
5
14
  const withSourceFileWriteQueue = (fn) => {
6
- const run = () => fn();
15
+ const run = () => codemodStartTime.run(Date.now(), fn);
7
16
  const next = chain.then(run, run);
8
17
  chain = next.then(() => undefined, () => undefined);
9
18
  return next;
@@ -60,7 +60,7 @@ const splitJsxSequenceHandler = ({ input: { fileName, nodePath, sequenceKeys, sp
60
60
  absolutePath,
61
61
  line: logLine,
62
62
  });
63
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Split ${nodeLabel}`);
63
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Split ${nodeLabel}`);
64
64
  if (!formatted) {
65
65
  (0, log_update_1.warnAboutPrettierOnce)(logLevel);
66
66
  }
@@ -0,0 +1,3 @@
1
+ import type { SplitVideoFromAudioRequest, SplitVideoFromAudioResponse } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
3
+ export declare const splitVideoFromAudioHandler: ApiHandler<SplitVideoFromAudioRequest, SplitVideoFromAudioResponse>;