@revideo/cli 0.3.7-red.988 → 0.4.1-cat.995

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 CHANGED
@@ -9,7 +9,7 @@ const program = new commander_1.Command();
9
9
  program
10
10
  .name('revideo')
11
11
  .description('CLI to interact with the revideo service')
12
- .version('0.3.6');
12
+ .version('0.4.0');
13
13
  program
14
14
  .command('serve')
15
15
  .description('UNSTABLE (still WIP): Start the revideo server in development mode. Watches for changes ' +
@@ -19,7 +19,7 @@ async function buildProject() {
19
19
  try {
20
20
  await (0, vite_1.build)({
21
21
  configFile: false,
22
- plugins: [(0, vite_plugin_1.default)()],
22
+ plugins: [(0, vite_plugin_1.default)({ project: process.env.PROJECT_FILE })],
23
23
  build: {
24
24
  outDir: 'dist',
25
25
  rollupOptions: {
@@ -62,7 +62,14 @@ async function createHotReloader(dir) {
62
62
  }
63
63
  exports.createHotReloader = createHotReloader;
64
64
  async function player(req, res) {
65
- const path = `./dist/${req.params.file}`;
65
+ let path = `./dist/${req.params.file}`;
66
+ if (req.params.file === 'projectFile') {
67
+ const playerFileName = (process.env.PROJECT_FILE ?? '')
68
+ .split('/')
69
+ .pop()
70
+ ?.replace('.ts', '.js');
71
+ path = `./dist/${playerFileName}`;
72
+ }
66
73
  let buildTime = undefined;
67
74
  let error = false;
68
75
  // Check if the file exists and build the project if it doesn't.
@@ -23,6 +23,7 @@ async function renderWithCallback(req, res) {
23
23
  // TODO: validate request body
24
24
  const { variables, callbackUrl, settings } = req.body;
25
25
  const tempProjectName = (0, uuid_1.v4)();
26
+ const outputFileName = `${tempProjectName}.mp4`;
26
27
  res.json({ tempProjectName });
27
28
  try {
28
29
  await (0, renderer_1.renderVideo)({
@@ -30,11 +31,11 @@ async function renderWithCallback(req, res) {
30
31
  variables,
31
32
  settings: {
32
33
  ...settings,
33
- outFile: tempProjectName,
34
+ outFile: outputFileName,
34
35
  },
35
36
  });
36
- const resultFilePath = path_1.default.join(process.cwd(), `output/${tempProjectName}.mp4`);
37
- const downloadLink = `${req.protocol}://${req.get('host')}/download/${tempProjectName}.mp4`;
37
+ const resultFilePath = path_1.default.join(process.cwd(), `output/${outputFileName}`);
38
+ const downloadLink = `${req.protocol}://${req.get('host')}/download/${outputFileName}`;
38
39
  const response = await axios_1.default.post(callbackUrl, {
39
40
  tempProjectName,
40
41
  status: 'success',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revideo/cli",
3
- "version": "0.3.7-red.988+3bfa488",
3
+ "version": "0.4.1-cat.995+cf88b1a",
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.7-red.988+3bfa488",
29
- "@revideo/telemetry": "^0.3.7-red.988+3bfa488",
28
+ "@revideo/renderer": "^0.4.1-cat.995+cf88b1a",
29
+ "@revideo/telemetry": "^0.4.1-cat.995+cf88b1a",
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": "3bfa488e0c9aec2e5344650fc8d6df959a668a4c"
36
+ "gitHead": "cf88b1a08e579957ff3c4d44975a47afa96d688c"
37
37
  }