@editframe/cli 0.9.0-beta.3 → 0.10.0-beta.2
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/VERSION.d.ts +1 -1
- package/dist/VERSION.js +1 -1
- package/dist/commands/process-file.js +4 -4
- package/dist/commands/render.js +1 -1
- package/dist/operations/syncAssetsDirectory.js +12 -12
- package/package.json +5 -5
- package/src/commands/process-file.ts +4 -4
- package/src/commands/render.ts +1 -1
- package/src/operations/syncAssetsDirectory.ts +12 -12
package/dist/VERSION.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.10.0-beta.2";
|
package/dist/VERSION.js
CHANGED
|
@@ -8,11 +8,11 @@ import { createUnprocessedFile, uploadUnprocessedFile, updateUnprocessedFile } f
|
|
|
8
8
|
import { md5FilePath } from "@editframe/assets";
|
|
9
9
|
program.command("process-file <file>").description("Upload a audio/video to Editframe for processing.").action(async (path) => {
|
|
10
10
|
const client = getClient();
|
|
11
|
-
const
|
|
11
|
+
const md5 = await md5FilePath(path);
|
|
12
12
|
const byte_size = (await stat(path)).size;
|
|
13
13
|
await withSpinner("Creating unprocessed file record", async () => {
|
|
14
14
|
await createUnprocessedFile(client, {
|
|
15
|
-
|
|
15
|
+
md5,
|
|
16
16
|
processes: [],
|
|
17
17
|
filename: basename(path),
|
|
18
18
|
byte_size
|
|
@@ -20,12 +20,12 @@ program.command("process-file <file>").description("Upload a audio/video to Edit
|
|
|
20
20
|
});
|
|
21
21
|
const readStream = createReadStream(path);
|
|
22
22
|
await withSpinner("Uploading file", async () => {
|
|
23
|
-
await uploadUnprocessedFile(client,
|
|
23
|
+
await uploadUnprocessedFile(client, md5, readStream, byte_size);
|
|
24
24
|
});
|
|
25
25
|
const unprocessedFile = await withSpinner(
|
|
26
26
|
"Marking for processing",
|
|
27
27
|
async () => {
|
|
28
|
-
return await updateUnprocessedFile(client,
|
|
28
|
+
return await updateUnprocessedFile(client, md5, {
|
|
29
29
|
processes: ["isobmff"]
|
|
30
30
|
});
|
|
31
31
|
}
|
package/dist/commands/render.js
CHANGED
|
@@ -101,7 +101,7 @@ program.command("render [directory]").description(
|
|
|
101
101
|
await writeFile(path.join(distDir, "index.html"), doc.toString());
|
|
102
102
|
const md5 = await md5Directory(distDir);
|
|
103
103
|
const render = await createRender(getClient(), {
|
|
104
|
-
|
|
104
|
+
md5,
|
|
105
105
|
width: renderInfo.width,
|
|
106
106
|
height: renderInfo.height,
|
|
107
107
|
fps: renderInfo.fps,
|
|
@@ -64,12 +64,12 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
64
64
|
process.stderr.write(` ${message}
|
|
65
65
|
`);
|
|
66
66
|
};
|
|
67
|
-
for (const
|
|
68
|
-
reportInfo(
|
|
69
|
-
const assetDir = path.join(fullPath,
|
|
67
|
+
for (const assetMd5 of assets) {
|
|
68
|
+
reportInfo(assetMd5, `Syncing asset: ${assetMd5}`);
|
|
69
|
+
const assetDir = path.join(fullPath, assetMd5);
|
|
70
70
|
const stat2 = await fs.stat(assetDir);
|
|
71
71
|
if (!stat2.isDirectory()) {
|
|
72
|
-
reportError(
|
|
72
|
+
reportError(assetMd5, "Invalid asset. Did not find asset directory.");
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
const subAssets = await fs.readdir(assetDir);
|
|
@@ -102,7 +102,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
102
102
|
}
|
|
103
103
|
reportInfo(subAsset, `🖼️ Syncing image: ${subAsset}`);
|
|
104
104
|
const created = await createImageFile(getClient(), {
|
|
105
|
-
|
|
105
|
+
md5: assetMd5,
|
|
106
106
|
filename: subAsset,
|
|
107
107
|
width: videoProbe.width,
|
|
108
108
|
height: videoProbe.height,
|
|
@@ -135,7 +135,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
135
135
|
case trackMatch.test(subAsset): {
|
|
136
136
|
reportInfo(subAsset, `📼 Syncing a/v track: ${subAsset}`);
|
|
137
137
|
const createdFile = await createISOBMFFFile(getClient(), {
|
|
138
|
-
|
|
138
|
+
md5: assetMd5,
|
|
139
139
|
filename: subAsset.replace(/\.track-[\d]+.mp4$/, "")
|
|
140
140
|
});
|
|
141
141
|
if (createdFile) {
|
|
@@ -160,7 +160,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
160
160
|
const stat3 = await fs.stat(subAssetPath);
|
|
161
161
|
const createPayload = track.codec_type === "audio" ? {
|
|
162
162
|
type: track.codec_type,
|
|
163
|
-
file_id:
|
|
163
|
+
file_id: createdFile.id,
|
|
164
164
|
track_id: Number(trackId),
|
|
165
165
|
probe_info: track,
|
|
166
166
|
duration_ms: Math.round(track.duration * 1e3),
|
|
@@ -168,7 +168,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
168
168
|
byte_size: stat3.size
|
|
169
169
|
} : {
|
|
170
170
|
type: track.codec_type,
|
|
171
|
-
file_id:
|
|
171
|
+
file_id: createdFile.id,
|
|
172
172
|
track_id: Number(trackId),
|
|
173
173
|
probe_info: track,
|
|
174
174
|
duration_ms: Math.round(track.duration * 1e3),
|
|
@@ -207,7 +207,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
207
207
|
case fragmentIndexMatch.test(subAsset): {
|
|
208
208
|
reportInfo(subAsset, `📋 Syncing fragment index: ${subAsset}`);
|
|
209
209
|
const createdFile = await createISOBMFFFile(getClient(), {
|
|
210
|
-
|
|
210
|
+
md5: assetMd5,
|
|
211
211
|
filename: subAsset.replace(/\.tracks.json$/, "")
|
|
212
212
|
});
|
|
213
213
|
if (createdFile) {
|
|
@@ -219,7 +219,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
219
219
|
const readStream = createReadStream(subAssetPath);
|
|
220
220
|
await uploadFragmentIndex(
|
|
221
221
|
getClient(),
|
|
222
|
-
|
|
222
|
+
assetMd5,
|
|
223
223
|
readStream,
|
|
224
224
|
stats.size
|
|
225
225
|
).then(() => {
|
|
@@ -244,7 +244,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
244
244
|
case captionsMatch.test(subAsset): {
|
|
245
245
|
reportInfo(subAsset, `📝 Syncing captions: ${subAsset}`);
|
|
246
246
|
const createdFile = await createCaptionFile(getClient(), {
|
|
247
|
-
|
|
247
|
+
md5: assetMd5,
|
|
248
248
|
filename: subAsset.replace(/\.captions.json$/, ""),
|
|
249
249
|
byte_size: (await fs.stat(subAsset)).size
|
|
250
250
|
});
|
|
@@ -257,7 +257,7 @@ const syncAssetDirectory = async (projectDirectory) => {
|
|
|
257
257
|
const stats = statSync(subAssetPath);
|
|
258
258
|
await uploadCaptionFile(
|
|
259
259
|
getClient(),
|
|
260
|
-
|
|
260
|
+
assetMd5,
|
|
261
261
|
readStream,
|
|
262
262
|
stats.size
|
|
263
263
|
).then(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-beta.2",
|
|
4
4
|
"description": "Command line interface for EditFrame",
|
|
5
5
|
"bin": {
|
|
6
6
|
"editframe": "./dist/index.js"
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"vite-tsconfig-paths": "^4.3.2"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@editframe/api": "0.
|
|
27
|
-
"@editframe/assets": "0.
|
|
28
|
-
"@editframe/elements": "0.
|
|
29
|
-
"@editframe/vite-plugin": "0.
|
|
26
|
+
"@editframe/api": "0.10.0-beta.2",
|
|
27
|
+
"@editframe/assets": "0.10.0-beta.2",
|
|
28
|
+
"@editframe/elements": "0.10.0-beta.2",
|
|
29
|
+
"@editframe/vite-plugin": "0.10.0-beta.2",
|
|
30
30
|
"@inquirer/prompts": "^5.3.8",
|
|
31
31
|
"axios": "^1.6.8",
|
|
32
32
|
"chalk": "^5.3.0",
|
|
@@ -20,13 +20,13 @@ program
|
|
|
20
20
|
.action(async (path: string) => {
|
|
21
21
|
const client = getClient();
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const md5 = await md5FilePath(path);
|
|
24
24
|
|
|
25
25
|
const byte_size = (await stat(path)).size;
|
|
26
26
|
|
|
27
27
|
await withSpinner("Creating unprocessed file record", async () => {
|
|
28
28
|
await createUnprocessedFile(client, {
|
|
29
|
-
|
|
29
|
+
md5,
|
|
30
30
|
processes: [],
|
|
31
31
|
filename: basename(path),
|
|
32
32
|
byte_size,
|
|
@@ -36,13 +36,13 @@ program
|
|
|
36
36
|
const readStream = createReadStream(path);
|
|
37
37
|
|
|
38
38
|
await withSpinner("Uploading file", async () => {
|
|
39
|
-
await uploadUnprocessedFile(client,
|
|
39
|
+
await uploadUnprocessedFile(client, md5, readStream, byte_size);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
const unprocessedFile = await withSpinner(
|
|
43
43
|
"Marking for processing",
|
|
44
44
|
async () => {
|
|
45
|
-
return await updateUnprocessedFile(client,
|
|
45
|
+
return await updateUnprocessedFile(client, md5, {
|
|
46
46
|
processes: ["isobmff"],
|
|
47
47
|
});
|
|
48
48
|
},
|
package/src/commands/render.ts
CHANGED
|
@@ -88,12 +88,12 @@ export const syncAssetDirectory = async (
|
|
|
88
88
|
process.stderr.write(` ${message}\n`);
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
for (const
|
|
92
|
-
reportInfo(
|
|
93
|
-
const assetDir = path.join(fullPath,
|
|
91
|
+
for (const assetMd5 of assets) {
|
|
92
|
+
reportInfo(assetMd5, `Syncing asset: ${assetMd5}`);
|
|
93
|
+
const assetDir = path.join(fullPath, assetMd5);
|
|
94
94
|
const stat = await fs.stat(assetDir);
|
|
95
95
|
if (!stat.isDirectory()) {
|
|
96
|
-
reportError(
|
|
96
|
+
reportError(assetMd5, "Invalid asset. Did not find asset directory.");
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
const subAssets = await fs.readdir(assetDir);
|
|
@@ -135,7 +135,7 @@ export const syncAssetDirectory = async (
|
|
|
135
135
|
}
|
|
136
136
|
reportInfo(subAsset, `🖼️ Syncing image: ${subAsset}`);
|
|
137
137
|
const created = await createImageFile(getClient(), {
|
|
138
|
-
|
|
138
|
+
md5: assetMd5,
|
|
139
139
|
filename: subAsset,
|
|
140
140
|
width: videoProbe.width,
|
|
141
141
|
height: videoProbe.height,
|
|
@@ -170,7 +170,7 @@ export const syncAssetDirectory = async (
|
|
|
170
170
|
case trackMatch.test(subAsset): {
|
|
171
171
|
reportInfo(subAsset, `📼 Syncing a/v track: ${subAsset}`);
|
|
172
172
|
const createdFile = await createISOBMFFFile(getClient(), {
|
|
173
|
-
|
|
173
|
+
md5: assetMd5,
|
|
174
174
|
filename: subAsset.replace(/\.track-[\d]+.mp4$/, ""),
|
|
175
175
|
});
|
|
176
176
|
if (createdFile) {
|
|
@@ -205,7 +205,7 @@ export const syncAssetDirectory = async (
|
|
|
205
205
|
track.codec_type === "audio"
|
|
206
206
|
? {
|
|
207
207
|
type: track.codec_type,
|
|
208
|
-
file_id:
|
|
208
|
+
file_id: createdFile.id,
|
|
209
209
|
track_id: Number(trackId),
|
|
210
210
|
probe_info: track,
|
|
211
211
|
duration_ms: Math.round(track.duration * 1000),
|
|
@@ -214,7 +214,7 @@ export const syncAssetDirectory = async (
|
|
|
214
214
|
}
|
|
215
215
|
: {
|
|
216
216
|
type: track.codec_type,
|
|
217
|
-
file_id:
|
|
217
|
+
file_id: createdFile.id,
|
|
218
218
|
track_id: Number(trackId),
|
|
219
219
|
probe_info: track,
|
|
220
220
|
duration_ms: Math.round(track.duration * 1000),
|
|
@@ -257,7 +257,7 @@ export const syncAssetDirectory = async (
|
|
|
257
257
|
case fragmentIndexMatch.test(subAsset): {
|
|
258
258
|
reportInfo(subAsset, `📋 Syncing fragment index: ${subAsset}`);
|
|
259
259
|
const createdFile = await createISOBMFFFile(getClient(), {
|
|
260
|
-
|
|
260
|
+
md5: assetMd5,
|
|
261
261
|
filename: subAsset.replace(/\.tracks.json$/, ""),
|
|
262
262
|
});
|
|
263
263
|
if (createdFile) {
|
|
@@ -269,7 +269,7 @@ export const syncAssetDirectory = async (
|
|
|
269
269
|
const readStream = createReadStream(subAssetPath);
|
|
270
270
|
await uploadFragmentIndex(
|
|
271
271
|
getClient(),
|
|
272
|
-
|
|
272
|
+
assetMd5,
|
|
273
273
|
readStream,
|
|
274
274
|
stats.size,
|
|
275
275
|
)
|
|
@@ -296,7 +296,7 @@ export const syncAssetDirectory = async (
|
|
|
296
296
|
case captionsMatch.test(subAsset): {
|
|
297
297
|
reportInfo(subAsset, `📝 Syncing captions: ${subAsset}`);
|
|
298
298
|
const createdFile = await createCaptionFile(getClient(), {
|
|
299
|
-
|
|
299
|
+
md5: assetMd5,
|
|
300
300
|
filename: subAsset.replace(/\.captions.json$/, ""),
|
|
301
301
|
byte_size: (await fs.stat(subAsset)).size,
|
|
302
302
|
});
|
|
@@ -309,7 +309,7 @@ export const syncAssetDirectory = async (
|
|
|
309
309
|
const stats = statSync(subAssetPath);
|
|
310
310
|
await uploadCaptionFile(
|
|
311
311
|
getClient(),
|
|
312
|
-
|
|
312
|
+
assetMd5,
|
|
313
313
|
readStream,
|
|
314
314
|
stats.size,
|
|
315
315
|
)
|