rollberry 0.1.8 → 0.2.0

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +189 -7
  3. package/dist/capture/actions.d.ts +11 -0
  4. package/dist/capture/actions.js +81 -0
  5. package/dist/capture/browser-install.d.ts +3 -0
  6. package/dist/capture/browser-install.js +1 -1
  7. package/dist/capture/browser.d.ts +13 -0
  8. package/dist/capture/browser.js +16 -10
  9. package/dist/capture/capture.d.ts +8 -0
  10. package/dist/capture/capture.js +566 -55
  11. package/dist/capture/constants.d.ts +15 -0
  12. package/dist/capture/constants.js +7 -0
  13. package/dist/capture/ffmpeg.d.ts +41 -0
  14. package/dist/capture/ffmpeg.js +457 -36
  15. package/dist/capture/logger.d.ts +15 -0
  16. package/dist/capture/preflight.d.ts +4 -0
  17. package/dist/capture/preflight.js +8 -2
  18. package/dist/capture/progress.d.ts +7 -0
  19. package/dist/capture/progress.js +50 -0
  20. package/dist/capture/scroll-plan.d.ts +9 -0
  21. package/dist/capture/scroll-plan.js +7 -1
  22. package/dist/capture/stabilize.d.ts +7 -0
  23. package/dist/capture/stabilize.js +11 -5
  24. package/dist/capture/types.d.ts +216 -0
  25. package/dist/capture/utils.d.ts +14 -0
  26. package/dist/capture/utils.js +30 -3
  27. package/dist/cli.d.ts +2 -0
  28. package/dist/cli.js +86 -5
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.js +6 -0
  31. package/dist/options.d.ts +42 -0
  32. package/dist/options.js +229 -115
  33. package/dist/project.d.ts +27 -0
  34. package/dist/project.js +722 -0
  35. package/dist/render-plan.d.ts +103 -0
  36. package/dist/render-plan.js +144 -0
  37. package/dist/run-capture.d.ts +3 -0
  38. package/dist/run-capture.js +20 -10
  39. package/dist/run-render.d.ts +17 -0
  40. package/dist/run-render.js +434 -0
  41. package/dist/version.d.ts +1 -0
  42. package/dist/version.js +1 -0
  43. package/package.json +10 -3
  44. package/rollberry.project.sample.json +92 -0
  45. package/rollberry.project.schema.json +474 -0
@@ -0,0 +1,474 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://co-r-e.github.io/rollberry/rollberry.project.schema.json",
4
+ "title": "Rollberry Project",
5
+ "type": "object",
6
+ "required": ["scenes"],
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string"
10
+ },
11
+ "schemaVersion": {
12
+ "const": 1
13
+ },
14
+ "name": {
15
+ "type": "string"
16
+ },
17
+ "summaryManifest": {
18
+ "type": "string"
19
+ },
20
+ "defaults": {
21
+ "$ref": "#/$defs/defaults"
22
+ },
23
+ "scenes": {
24
+ "type": "array",
25
+ "minItems": 1,
26
+ "items": {
27
+ "$ref": "#/$defs/scene"
28
+ }
29
+ },
30
+ "outputs": {
31
+ "type": "array",
32
+ "minItems": 1,
33
+ "items": {
34
+ "$ref": "#/$defs/output"
35
+ }
36
+ }
37
+ },
38
+ "additionalProperties": false,
39
+ "$defs": {
40
+ "waitFor": {
41
+ "type": "string",
42
+ "pattern": "^(load|selector:.+|ms:[0-9]+)$"
43
+ },
44
+ "motion": {
45
+ "type": "string",
46
+ "enum": ["ease-in-out-sine", "linear"]
47
+ },
48
+ "selectorAction": {
49
+ "type": "object",
50
+ "required": ["type", "selector"],
51
+ "properties": {
52
+ "type": {
53
+ "type": "string",
54
+ "enum": ["click", "hover", "scroll-to"]
55
+ },
56
+ "selector": {
57
+ "type": "string"
58
+ },
59
+ "block": {
60
+ "type": "string",
61
+ "enum": ["start", "center", "end"]
62
+ }
63
+ },
64
+ "additionalProperties": false
65
+ },
66
+ "typeAction": {
67
+ "type": "object",
68
+ "required": ["type", "selector", "text"],
69
+ "properties": {
70
+ "type": {
71
+ "const": "type"
72
+ },
73
+ "selector": {
74
+ "type": "string"
75
+ },
76
+ "text": {
77
+ "type": "string"
78
+ },
79
+ "clear": {
80
+ "type": "boolean"
81
+ }
82
+ },
83
+ "additionalProperties": false
84
+ },
85
+ "pressAction": {
86
+ "type": "object",
87
+ "required": ["type", "key"],
88
+ "properties": {
89
+ "type": {
90
+ "const": "press"
91
+ },
92
+ "key": {
93
+ "type": "string"
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ },
98
+ "waitAction": {
99
+ "type": "object",
100
+ "required": ["type", "ms"],
101
+ "properties": {
102
+ "type": {
103
+ "const": "wait"
104
+ },
105
+ "ms": {
106
+ "type": "integer",
107
+ "minimum": 1
108
+ }
109
+ },
110
+ "additionalProperties": false
111
+ },
112
+ "setupAction": {
113
+ "oneOf": [
114
+ { "$ref": "#/$defs/waitAction" },
115
+ { "$ref": "#/$defs/selectorAction" },
116
+ { "$ref": "#/$defs/typeAction" },
117
+ { "$ref": "#/$defs/pressAction" }
118
+ ]
119
+ },
120
+ "timelineScroll": {
121
+ "type": "object",
122
+ "required": ["type"],
123
+ "properties": {
124
+ "type": {
125
+ "const": "scroll"
126
+ },
127
+ "duration": {
128
+ "oneOf": [
129
+ { "type": "number", "exclusiveMinimum": 0 },
130
+ { "const": "auto" }
131
+ ]
132
+ },
133
+ "motion": {
134
+ "$ref": "#/$defs/motion"
135
+ },
136
+ "to": {
137
+ "oneOf": [{ "type": "number", "minimum": 0 }, { "const": "bottom" }]
138
+ },
139
+ "by": {
140
+ "type": "number"
141
+ },
142
+ "toSelector": {
143
+ "type": "string"
144
+ },
145
+ "block": {
146
+ "type": "string",
147
+ "enum": ["start", "center", "end"]
148
+ }
149
+ },
150
+ "additionalProperties": false
151
+ },
152
+ "timelinePause": {
153
+ "type": "object",
154
+ "required": ["type", "duration"],
155
+ "properties": {
156
+ "type": {
157
+ "const": "pause"
158
+ },
159
+ "duration": {
160
+ "type": "number",
161
+ "exclusiveMinimum": 0
162
+ }
163
+ },
164
+ "additionalProperties": false
165
+ },
166
+ "timelineWait": {
167
+ "type": "object",
168
+ "required": ["type", "ms"],
169
+ "properties": {
170
+ "type": {
171
+ "const": "wait"
172
+ },
173
+ "ms": {
174
+ "type": "integer",
175
+ "minimum": 1
176
+ }
177
+ },
178
+ "additionalProperties": false
179
+ },
180
+ "timelineAction": {
181
+ "allOf": [
182
+ {
183
+ "oneOf": [
184
+ { "$ref": "#/$defs/selectorAction" },
185
+ { "$ref": "#/$defs/typeAction" },
186
+ { "$ref": "#/$defs/pressAction" }
187
+ ]
188
+ },
189
+ {
190
+ "type": "object",
191
+ "properties": {
192
+ "holdAfterSeconds": {
193
+ "type": "number",
194
+ "minimum": 0
195
+ }
196
+ }
197
+ }
198
+ ]
199
+ },
200
+ "timelineStep": {
201
+ "oneOf": [
202
+ { "$ref": "#/$defs/timelineScroll" },
203
+ { "$ref": "#/$defs/timelinePause" },
204
+ { "$ref": "#/$defs/timelineWait" },
205
+ { "$ref": "#/$defs/timelineAction" }
206
+ ]
207
+ },
208
+ "scene": {
209
+ "type": "object",
210
+ "required": ["url"],
211
+ "properties": {
212
+ "name": {
213
+ "type": "string"
214
+ },
215
+ "url": {
216
+ "type": "string",
217
+ "format": "uri"
218
+ },
219
+ "duration": {
220
+ "oneOf": [
221
+ { "type": "number", "exclusiveMinimum": 0 },
222
+ { "const": "auto" }
223
+ ]
224
+ },
225
+ "motion": {
226
+ "$ref": "#/$defs/motion"
227
+ },
228
+ "waitFor": {
229
+ "$ref": "#/$defs/waitFor"
230
+ },
231
+ "hideSelectors": {
232
+ "type": "array",
233
+ "items": { "type": "string" }
234
+ },
235
+ "holdAfterSeconds": {
236
+ "type": "number",
237
+ "minimum": 0
238
+ },
239
+ "actions": {
240
+ "type": "array",
241
+ "items": { "$ref": "#/$defs/setupAction" }
242
+ },
243
+ "timeline": {
244
+ "type": "array",
245
+ "minItems": 1,
246
+ "items": { "$ref": "#/$defs/timelineStep" }
247
+ }
248
+ },
249
+ "additionalProperties": false
250
+ },
251
+ "defaults": {
252
+ "type": "object",
253
+ "properties": {
254
+ "viewport": {
255
+ "type": "string",
256
+ "pattern": "^[0-9]+x[0-9]+$"
257
+ },
258
+ "fps": {
259
+ "type": "integer",
260
+ "minimum": 1,
261
+ "maximum": 120
262
+ },
263
+ "duration": {
264
+ "oneOf": [
265
+ { "type": "number", "exclusiveMinimum": 0 },
266
+ { "const": "auto" }
267
+ ]
268
+ },
269
+ "motion": {
270
+ "$ref": "#/$defs/motion"
271
+ },
272
+ "timeoutMs": {
273
+ "type": "integer",
274
+ "minimum": 1
275
+ },
276
+ "waitFor": {
277
+ "$ref": "#/$defs/waitFor"
278
+ },
279
+ "hideSelectors": {
280
+ "type": "array",
281
+ "items": { "type": "string" }
282
+ },
283
+ "holdAfterSeconds": {
284
+ "type": "number",
285
+ "minimum": 0
286
+ }
287
+ },
288
+ "additionalProperties": false
289
+ },
290
+ "audio": {
291
+ "type": "object",
292
+ "required": ["path"],
293
+ "properties": {
294
+ "path": {
295
+ "type": "string"
296
+ },
297
+ "volume": {
298
+ "type": "number",
299
+ "minimum": 0
300
+ },
301
+ "loop": {
302
+ "type": "boolean"
303
+ }
304
+ },
305
+ "additionalProperties": false
306
+ },
307
+ "subtitles": {
308
+ "type": "object",
309
+ "required": ["path"],
310
+ "properties": {
311
+ "path": {
312
+ "type": "string"
313
+ },
314
+ "mode": {
315
+ "type": "string",
316
+ "enum": ["soft", "burn-in"]
317
+ }
318
+ },
319
+ "additionalProperties": false
320
+ },
321
+ "transition": {
322
+ "type": "object",
323
+ "required": ["type", "duration"],
324
+ "properties": {
325
+ "type": {
326
+ "type": "string",
327
+ "enum": ["fade-in", "crossfade"]
328
+ },
329
+ "duration": {
330
+ "type": "number",
331
+ "exclusiveMinimum": 0
332
+ }
333
+ },
334
+ "additionalProperties": false
335
+ },
336
+ "intermediateVideo": {
337
+ "type": "object",
338
+ "properties": {
339
+ "preset": {
340
+ "type": "string",
341
+ "enum": [
342
+ "ultrafast",
343
+ "superfast",
344
+ "veryfast",
345
+ "faster",
346
+ "fast",
347
+ "medium",
348
+ "slow",
349
+ "slower",
350
+ "veryslow",
351
+ "placebo"
352
+ ]
353
+ },
354
+ "crf": {
355
+ "type": "integer",
356
+ "minimum": 0,
357
+ "maximum": 51
358
+ }
359
+ },
360
+ "additionalProperties": false
361
+ },
362
+ "intermediateArtifact": {
363
+ "type": "object",
364
+ "properties": {
365
+ "format": {
366
+ "const": "mp4"
367
+ },
368
+ "preset": {
369
+ "type": "string",
370
+ "enum": [
371
+ "ultrafast",
372
+ "superfast",
373
+ "veryfast",
374
+ "faster",
375
+ "fast",
376
+ "medium",
377
+ "slow",
378
+ "slower",
379
+ "veryslow",
380
+ "placebo"
381
+ ]
382
+ },
383
+ "crf": {
384
+ "type": "integer",
385
+ "minimum": 0,
386
+ "maximum": 51
387
+ }
388
+ },
389
+ "additionalProperties": false
390
+ },
391
+ "finalVideo": {
392
+ "type": "object",
393
+ "properties": {
394
+ "preset": {
395
+ "type": "string",
396
+ "enum": [
397
+ "ultrafast",
398
+ "superfast",
399
+ "veryfast",
400
+ "faster",
401
+ "fast",
402
+ "medium",
403
+ "slow",
404
+ "slower",
405
+ "veryslow",
406
+ "placebo"
407
+ ]
408
+ },
409
+ "deadline": {
410
+ "type": "string",
411
+ "enum": ["best", "good", "realtime"]
412
+ },
413
+ "crf": {
414
+ "type": "integer",
415
+ "minimum": 0,
416
+ "maximum": 63
417
+ }
418
+ },
419
+ "additionalProperties": false
420
+ },
421
+ "output": {
422
+ "type": "object",
423
+ "properties": {
424
+ "name": {
425
+ "type": "string"
426
+ },
427
+ "out": {
428
+ "type": "string"
429
+ },
430
+ "format": {
431
+ "type": "string",
432
+ "enum": ["mp4", "webm"]
433
+ },
434
+ "manifest": {
435
+ "type": "string"
436
+ },
437
+ "logFile": {
438
+ "type": "string"
439
+ },
440
+ "viewport": {
441
+ "type": "string",
442
+ "pattern": "^[0-9]+x[0-9]+$"
443
+ },
444
+ "fps": {
445
+ "type": "integer",
446
+ "minimum": 1,
447
+ "maximum": 120
448
+ },
449
+ "debugFramesDir": {
450
+ "type": "string"
451
+ },
452
+ "audio": {
453
+ "$ref": "#/$defs/audio"
454
+ },
455
+ "subtitles": {
456
+ "$ref": "#/$defs/subtitles"
457
+ },
458
+ "transition": {
459
+ "$ref": "#/$defs/transition"
460
+ },
461
+ "intermediateVideo": {
462
+ "$ref": "#/$defs/intermediateVideo"
463
+ },
464
+ "intermediateArtifact": {
465
+ "$ref": "#/$defs/intermediateArtifact"
466
+ },
467
+ "finalVideo": {
468
+ "$ref": "#/$defs/finalVideo"
469
+ }
470
+ },
471
+ "additionalProperties": false
472
+ }
473
+ }
474
+ }