@remotion/studio-server 4.0.495 → 4.0.496
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.
|
@@ -37,6 +37,7 @@ exports.applyCodemod = void 0;
|
|
|
37
37
|
const recast = __importStar(require("recast"));
|
|
38
38
|
const apply_visual_control_1 = require("./apply-visual-control");
|
|
39
39
|
const delete_jsx_node_1 = require("./delete-jsx-node");
|
|
40
|
+
const strip_parenthesized_extra_1 = require("./strip-parenthesized-extra");
|
|
40
41
|
const b = recast.types.builders;
|
|
41
42
|
const applyCodemod = ({ file, codeMod, }) => {
|
|
42
43
|
const changesMade = [];
|
|
@@ -131,25 +132,13 @@ const mapReturnStatement = (statement, transformation, changesMade, parentFolder
|
|
|
131
132
|
};
|
|
132
133
|
};
|
|
133
134
|
const nullLiteral = () => ({ type: 'NullLiteral' });
|
|
134
|
-
// When a node was originally parenthesized (e.g. the `<JSX/>` inside
|
|
135
|
-
// `return (<JSX/>)`), Babel records `extra.parenthesized` on it. If we move
|
|
136
|
-
// such a node into a JSXFragment without clearing that hint, recast prints
|
|
137
|
-
// stray `(` / `)` characters around it as JSX text. Clear the hint so the
|
|
138
|
-
// node prints cleanly in its new context.
|
|
139
|
-
const stripParenthesizedExtra = (node) => {
|
|
140
|
-
if (!node.extra) {
|
|
141
|
-
return node;
|
|
142
|
-
}
|
|
143
|
-
const { parenthesized: _p, parenStart: _ps, ...rest } = node.extra;
|
|
144
|
-
return { ...node, extra: rest };
|
|
145
|
-
};
|
|
146
135
|
const wrapInJsxFragment = (children) => ({
|
|
147
136
|
type: 'JSXFragment',
|
|
148
137
|
openingFragment: { type: 'JSXOpeningFragment' },
|
|
149
138
|
closingFragment: { type: 'JSXClosingFragment' },
|
|
150
139
|
children: children.map((child) => {
|
|
151
140
|
if (child.type === 'JSXElement' || child.type === 'JSXFragment') {
|
|
152
|
-
return stripParenthesizedExtra(child);
|
|
141
|
+
return (0, strip_parenthesized_extra_1.stripParenthesizedExtra)(child);
|
|
153
142
|
}
|
|
154
143
|
return child;
|
|
155
144
|
}),
|
|
@@ -292,7 +281,7 @@ const appendCompositionToFolder = ({ compositionElement, folderElement, }) => {
|
|
|
292
281
|
type: 'JSXClosingElement',
|
|
293
282
|
name: folderElement.openingElement.name,
|
|
294
283
|
};
|
|
295
|
-
folderElement.children.push(stripParenthesizedExtra(compositionElement));
|
|
284
|
+
folderElement.children.push((0, strip_parenthesized_extra_1.stripParenthesizedExtra)(compositionElement));
|
|
296
285
|
};
|
|
297
286
|
const appendCompositionToRoot = ({ compositionElement, file, }) => {
|
|
298
287
|
let appended = false;
|
|
@@ -307,7 +296,7 @@ const appendCompositionToRoot = ({ compositionElement, file, }) => {
|
|
|
307
296
|
return undefined;
|
|
308
297
|
}
|
|
309
298
|
if (argument.type === 'JSXFragment') {
|
|
310
|
-
argument.children.push(stripParenthesizedExtra(compositionElement));
|
|
299
|
+
argument.children.push((0, strip_parenthesized_extra_1.stripParenthesizedExtra)(compositionElement));
|
|
311
300
|
}
|
|
312
301
|
else {
|
|
313
302
|
astPath.node.argument = wrapInJsxFragment([
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stripParenthesizedExtra: <T extends object>(node: T) => T;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripParenthesizedExtra = void 0;
|
|
4
|
+
// When a node was originally parenthesized (e.g. the `<JSX/>` inside
|
|
5
|
+
// `return (<JSX/>)`), Babel records `extra.parenthesized` on it. If we move
|
|
6
|
+
// such a node into a new JSX parent without clearing that hint, recast prints
|
|
7
|
+
// stray `(` / `)` characters around it as JSX text.
|
|
8
|
+
const stripParenthesizedExtra = (node) => {
|
|
9
|
+
const { extra } = node;
|
|
10
|
+
if (!extra) {
|
|
11
|
+
return node;
|
|
12
|
+
}
|
|
13
|
+
const { parenthesized: _p, parenStart: _ps, ...rest } = extra;
|
|
14
|
+
return { ...node, extra: rest };
|
|
15
|
+
};
|
|
16
|
+
exports.stripParenthesizedExtra = stripParenthesizedExtra;
|
|
@@ -44,6 +44,7 @@ const recast = __importStar(require("recast"));
|
|
|
44
44
|
const no_react_1 = require("remotion/no-react");
|
|
45
45
|
const format_file_content_1 = require("../codemods/format-file-content");
|
|
46
46
|
const parse_ast_1 = require("../codemods/parse-ast");
|
|
47
|
+
const strip_parenthesized_extra_1 = require("../codemods/strip-parenthesized-extra");
|
|
47
48
|
const update_nested_prop_1 = require("../codemods/update-nested-prop");
|
|
48
49
|
const imports_1 = require("./imports");
|
|
49
50
|
const svg_to_jsx_1 = require("./svg-to-jsx");
|
|
@@ -1110,7 +1111,7 @@ const addElementToComponentRoot = ({ ast, exportName, element, }) => {
|
|
|
1110
1111
|
if (rootNode.type === 'JSXElement' && rootNode.openingElement.selfClosing) {
|
|
1111
1112
|
const fragment = recast.types.builders.jsxFragment(recast.types.builders.jsxOpeningFragment(), recast.types.builders.jsxClosingFragment(), [
|
|
1112
1113
|
createSequenceWithChild({
|
|
1113
|
-
child: rootNode,
|
|
1114
|
+
child: (0, strip_parenthesized_extra_1.stripParenthesizedExtra)(rootNode),
|
|
1114
1115
|
sequenceLocalName: ensureSequenceImport(ast),
|
|
1115
1116
|
}),
|
|
1116
1117
|
element,
|
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.496",
|
|
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.496",
|
|
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.496",
|
|
36
|
+
"@remotion/renderer": "4.0.496",
|
|
37
|
+
"@remotion/studio-shared": "4.0.496",
|
|
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.496",
|
|
46
46
|
"eslint": "9.19.0",
|
|
47
47
|
"@types/node": "20.12.14",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|