@remotion/studio-server 4.0.409 → 4.0.411
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.
|
@@ -10,9 +10,13 @@ const getInstalledInstallablePackages = (remotionRoot) => {
|
|
|
10
10
|
...devDependencies,
|
|
11
11
|
...optionalDependencies,
|
|
12
12
|
];
|
|
13
|
-
|
|
13
|
+
const remotionPackages = Object.entries(studio_shared_1.installableMap)
|
|
14
14
|
.filter(([, _installable]) => _installable)
|
|
15
15
|
.map(([pkg]) => (pkg === 'core' ? 'remotion' : `@remotion/${pkg}`))
|
|
16
16
|
.filter((pkg) => installablePackages.includes(pkg));
|
|
17
|
+
const installedExtraPackages = studio_shared_1.extraPackages
|
|
18
|
+
.map((pkg) => pkg.name)
|
|
19
|
+
.filter((pkg) => installablePackages.includes(pkg));
|
|
20
|
+
return [...remotionPackages, ...installedExtraPackages];
|
|
17
21
|
};
|
|
18
22
|
exports.getInstalledInstallablePackages = getInstalledInstallablePackages;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInstallCommand = void 0;
|
|
4
4
|
const getInstallCommand = ({ manager, packages, version, additionalArgs, }) => {
|
|
5
|
-
const pkgList = packages.map((p) => `${p}@${version}`);
|
|
5
|
+
const pkgList = packages.map((p) => (version ? `${p}@${version}` : p));
|
|
6
6
|
const commands = {
|
|
7
7
|
npm: [
|
|
8
8
|
'i',
|
|
@@ -15,16 +15,20 @@ const openDirectoryInFinder = (dirToOpen, allowedDirectory) => {
|
|
|
15
15
|
throw new Error(`Not allowed to open ${relativeToProcessCwd}`);
|
|
16
16
|
}
|
|
17
17
|
if ((0, node_os_1.platform)() === 'win32') {
|
|
18
|
+
const proc = (0, node_child_process_1.spawn)('explorer.exe', ['/select,', resolved]);
|
|
18
19
|
return new Promise((resolve, reject) => {
|
|
19
|
-
(
|
|
20
|
-
|
|
20
|
+
proc.on('exit', (code) => {
|
|
21
|
+
// explorer.exe returns 1 even on success
|
|
22
|
+
if (code === 0 || code === 1) {
|
|
21
23
|
resolve();
|
|
22
|
-
return;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
reject(
|
|
25
|
+
else {
|
|
26
|
+
reject(new Error(`explorer.exe exited with code ${code}`));
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
});
|
|
29
|
+
proc.on('error', (err) => {
|
|
30
|
+
proc.kill();
|
|
31
|
+
reject(err);
|
|
28
32
|
});
|
|
29
33
|
});
|
|
30
34
|
}
|
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleInstallPackage = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
6
|
const node_child_process_1 = require("node:child_process");
|
|
6
7
|
const version_1 = require("remotion/version");
|
|
7
8
|
const install_command_1 = require("../../helpers/install-command");
|
|
8
9
|
const get_package_manager_1 = require("../get-package-manager");
|
|
10
|
+
const extraPackageNames = studio_shared_1.extraPackages.map((pkg) => pkg.name);
|
|
11
|
+
const isExtraPackage = (packageName) => {
|
|
12
|
+
return extraPackageNames.includes(packageName);
|
|
13
|
+
};
|
|
14
|
+
const getExtraPackageVersion = (packageName) => {
|
|
15
|
+
const pkg = studio_shared_1.extraPackages.find((p) => p.name === packageName);
|
|
16
|
+
return pkg ? pkg.version : null;
|
|
17
|
+
};
|
|
9
18
|
const handleInstallPackage = async ({ logLevel, remotionRoot, input: { packageNames } }) => {
|
|
10
19
|
for (const packageName of packageNames) {
|
|
11
|
-
if (!packageName.startsWith('@remotion/')) {
|
|
20
|
+
if (!packageName.startsWith('@remotion/') && !isExtraPackage(packageName)) {
|
|
12
21
|
return Promise.reject(new Error(`Package ${packageName} is not allowed to be installed.`));
|
|
13
22
|
}
|
|
14
23
|
}
|
|
@@ -18,10 +27,18 @@ const handleInstallPackage = async ({ logLevel, remotionRoot, input: { packageNa
|
|
|
18
27
|
.map((p) => p.path)
|
|
19
28
|
.join(', ')}). Install dependencies using your favorite manager!`);
|
|
20
29
|
}
|
|
30
|
+
// Build packages with appropriate versions
|
|
31
|
+
const packagesWithVersions = packageNames.map((pkg) => {
|
|
32
|
+
const extraVersion = getExtraPackageVersion(pkg);
|
|
33
|
+
if (extraVersion) {
|
|
34
|
+
return `${pkg}@${extraVersion}`;
|
|
35
|
+
}
|
|
36
|
+
return `${pkg}@${version_1.VERSION}`;
|
|
37
|
+
});
|
|
21
38
|
const command = (0, install_command_1.getInstallCommand)({
|
|
22
39
|
manager: manager.manager,
|
|
23
|
-
packages:
|
|
24
|
-
version:
|
|
40
|
+
packages: packagesWithVersions,
|
|
41
|
+
version: '',
|
|
25
42
|
additionalArgs: [],
|
|
26
43
|
});
|
|
27
44
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, renderer_1.RenderInternals.chalk.gray(`╭─ ${manager.manager} ${command.join(' ')}`));
|
package/dist/routes.js
CHANGED
|
@@ -156,6 +156,14 @@ const handleOpenInEditor = async (remotionRoot, req, res, logLevel) => {
|
|
|
156
156
|
};
|
|
157
157
|
const handleAddAsset = ({ req, res, search, publicDir, }) => {
|
|
158
158
|
try {
|
|
159
|
+
const { origin } = req.headers;
|
|
160
|
+
const { host } = req.headers;
|
|
161
|
+
if (origin) {
|
|
162
|
+
const originUrl = new URL(origin);
|
|
163
|
+
if (originUrl.host !== host) {
|
|
164
|
+
throw new Error('Request from different origin not allowed');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
159
167
|
const query = new node_url_1.URLSearchParams(search);
|
|
160
168
|
const filePath = query.get('filePath');
|
|
161
169
|
if (typeof filePath !== 'string') {
|
|
@@ -225,7 +233,7 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
|
|
|
225
233
|
if (url.pathname === '/api/open-in-editor') {
|
|
226
234
|
return handleOpenInEditor(remotionRoot, request, response, logLevel);
|
|
227
235
|
}
|
|
228
|
-
if (url.pathname ===
|
|
236
|
+
if (url.pathname === `${staticHash}/api/add-asset`) {
|
|
229
237
|
return handleAddAsset({
|
|
230
238
|
req: request,
|
|
231
239
|
res: response,
|
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.411",
|
|
7
7
|
"description": "Run a Remotion Studio with a server backend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/parser": "7.24.1",
|
|
27
27
|
"semver": "7.5.3",
|
|
28
|
-
"remotion": "4.0.
|
|
28
|
+
"remotion": "4.0.411",
|
|
29
29
|
"recast": "0.23.11",
|
|
30
|
-
"@remotion/bundler": "4.0.
|
|
31
|
-
"@remotion/renderer": "4.0.
|
|
32
|
-
"@remotion/studio-shared": "4.0.
|
|
30
|
+
"@remotion/bundler": "4.0.411",
|
|
31
|
+
"@remotion/renderer": "4.0.411",
|
|
32
|
+
"@remotion/studio-shared": "4.0.411",
|
|
33
33
|
"memfs": "3.4.3",
|
|
34
34
|
"source-map": "0.7.3",
|
|
35
35
|
"open": "^8.4.2"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react": "19.2.3",
|
|
40
40
|
"@babel/types": "7.24.0",
|
|
41
41
|
"@types/semver": "^7.3.4",
|
|
42
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
42
|
+
"@remotion/eslint-config-internal": "4.0.411",
|
|
43
43
|
"eslint": "9.19.0",
|
|
44
44
|
"@types/node": "20.12.14"
|
|
45
45
|
},
|