@revideo/cli 0.3.6 → 0.3.7-alpha.986
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/index.js +1 -1
- package/dist/server/player.js +0 -1
- package/dist/server/render.js +25 -9
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ program
|
|
|
14
14
|
.command('serve')
|
|
15
15
|
.description('UNSTABLE (still WIP): Start the revideo server in development mode. Watches for changes ' +
|
|
16
16
|
'in the project directory and re-builds the player on each change.')
|
|
17
|
-
.option('--projectFile <path>', 'Path to the project file', './
|
|
17
|
+
.option('--projectFile <path>', 'Path to the project file', './src/project.ts')
|
|
18
18
|
.option('--port <number>', 'Port on which to start the server', '4000')
|
|
19
19
|
.option('--watchDir <path>', 'Directory to watch for changes', 'src')
|
|
20
20
|
.action(async (options) => {
|
package/dist/server/player.js
CHANGED
package/dist/server/render.js
CHANGED
|
@@ -20,13 +20,18 @@ async function render(req, res) {
|
|
|
20
20
|
}
|
|
21
21
|
exports.render = render;
|
|
22
22
|
async function renderWithCallback(req, res) {
|
|
23
|
+
// TODO: validate request body
|
|
23
24
|
const { variables, callbackUrl, settings } = req.body;
|
|
24
25
|
const tempProjectName = (0, uuid_1.v4)();
|
|
25
26
|
res.json({ tempProjectName });
|
|
26
27
|
try {
|
|
27
|
-
await (0, renderer_1.renderVideo)(
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
await (0, renderer_1.renderVideo)({
|
|
29
|
+
projectFile: process.env.PROJECT_FILE || '',
|
|
30
|
+
variables,
|
|
31
|
+
settings: {
|
|
32
|
+
...settings,
|
|
33
|
+
outFile: tempProjectName,
|
|
34
|
+
},
|
|
30
35
|
});
|
|
31
36
|
const resultFilePath = path_1.default.join(process.cwd(), `output/${tempProjectName}.mp4`);
|
|
32
37
|
const downloadLink = `${req.protocol}://${req.get('host')}/download/${tempProjectName}.mp4`;
|
|
@@ -60,8 +65,9 @@ async function renderWithCallback(req, res) {
|
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
67
|
async function renderWithoutCallback(req, res) {
|
|
68
|
+
// TODO: validate request body
|
|
63
69
|
const { variables, streamProgress, settings } = req.body;
|
|
64
|
-
const tempProjectName = (0, uuid_1.v4)()
|
|
70
|
+
const tempProjectName = `${(0, uuid_1.v4)()}.mp4`;
|
|
65
71
|
const resultFilePath = path_1.default.join(process.cwd(), `output/${tempProjectName}.mp4`);
|
|
66
72
|
if (streamProgress) {
|
|
67
73
|
res.writeHead(200, {
|
|
@@ -77,9 +83,14 @@ async function renderWithoutCallback(req, res) {
|
|
|
77
83
|
res.write(`data: ${JSON.stringify({ worker, progress })}\n\n`);
|
|
78
84
|
};
|
|
79
85
|
try {
|
|
80
|
-
await (0, renderer_1.renderVideo)(
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
await (0, renderer_1.renderVideo)({
|
|
87
|
+
projectFile: process.env.PROJECT_FILE || '',
|
|
88
|
+
variables,
|
|
89
|
+
settings: {
|
|
90
|
+
...settings,
|
|
91
|
+
outFile: tempProjectName,
|
|
92
|
+
progressCallback: sendProgress,
|
|
93
|
+
},
|
|
83
94
|
});
|
|
84
95
|
const downloadLink = `${req.protocol}://${req.get('host')}/download/${tempProjectName}.mp4`;
|
|
85
96
|
res.write(`event: completed\n`);
|
|
@@ -96,8 +107,13 @@ async function renderWithoutCallback(req, res) {
|
|
|
96
107
|
}
|
|
97
108
|
else {
|
|
98
109
|
try {
|
|
99
|
-
await (0, renderer_1.renderVideo)(
|
|
100
|
-
|
|
110
|
+
await (0, renderer_1.renderVideo)({
|
|
111
|
+
projectFile: process.env.PROJECT_FILE || '',
|
|
112
|
+
variables,
|
|
113
|
+
settings: {
|
|
114
|
+
...settings,
|
|
115
|
+
outFile: tempProjectName,
|
|
116
|
+
},
|
|
101
117
|
});
|
|
102
118
|
const downloadLink = `${req.protocol}://${req.get('host')}/download/${tempProjectName}.mp4`;
|
|
103
119
|
res.json({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revideo/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7-alpha.986+40c195c6",
|
|
4
4
|
"description": "A CLI for revideo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "revideo",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"typescript": "^5.4.3"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@revideo/renderer": "0.3.
|
|
29
|
-
"@revideo/telemetry": "0.3.
|
|
28
|
+
"@revideo/renderer": "^0.3.7-alpha.986+40c195c6",
|
|
29
|
+
"@revideo/telemetry": "^0.3.7-alpha.986+40c195c6",
|
|
30
30
|
"chokidar": "^3.5.3",
|
|
31
31
|
"commander": "^12.0.0",
|
|
32
32
|
"cors": "^2.8.5",
|
|
33
33
|
"express": "^4.19.2",
|
|
34
34
|
"uuid": "^9.0.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "40c195c6ca30e24a57dac56d0c760ed5825b6f56"
|
|
37
37
|
}
|