arcadible 0.1.32 → 0.1.34
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/README.md +4 -4
- package/bin/arc-build.js +23 -5
- package/bin/arc-deploy.js +78 -13
- package/bin/arc-init.js +6 -1
- package/bin/arc-inspect.js +1 -0
- package/bin/arc-login.js +4 -1
- package/bin/arc-open.js +4 -1
- package/bin/arc-pack.js +23 -3
- package/bin/arc-play.js +4 -1
- package/bin/arc-validate.js +1 -0
- package/bin/arc-whoami.js +1 -0
- package/package.json +3 -3
- package/src/account.js +7 -4
- package/src/action/build/tool.js +8 -4
- package/src/action/deploy/tool-git.js +49 -61
- package/src/action/deploy/tool.js +50 -44
- package/src/action/deploy/wait.js +37 -22
- package/src/action/init/manifest.js +23 -6
- package/src/action/init/tool-patch.js +1 -7
- package/src/action/init/tool.js +12 -9
- package/src/action/login/flow.js +7 -3
- package/src/action/pack/limits.js +13 -3
- package/src/action/pack/tool.js +19 -6
- package/src/action/play/tool.js +7 -1
- package/src/action/predeploy/ac.js +39 -22
- package/src/action/predeploy/git.js +69 -58
- package/src/action/predeploy/pm.js +24 -17
- package/src/action/predeploy/published.js +15 -2
- package/src/action/predeploy/tool-git.js +74 -86
- package/src/action/predeploy/tool.js +7 -33
- package/src/action/validate/tool.js +5 -4
- package/src/api.js +14 -1
- package/src/cli/predeploy.js +1 -1
- package/src/config/code.js +112 -0
- package/src/config/url.js +2 -1
- package/src/parser/env.js +19 -3
- package/src/parser/given.js +17 -0
- package/src/parser/manifest.js +8 -1
- package/src/parser/media.js +5 -9
- package/src/parser/project.js +4 -1
- package/src/parser/readme-file.js +8 -1
- package/src/phrase.js +75 -7
- package/src/schema/check/game.js +5 -26
- package/src/schema/game.js +117 -210
- package/src/schema/message.js +46 -7
- package/src/schema/readme.js +8 -3
- package/src/schema/workflow.js +35 -15
- package/src/util/argv.js +33 -1
- package/src/util/delay.js +4 -1
- package/src/util/error.js +49 -0
- package/src/util/image.js +4 -30
- package/src/util/log.js +8 -0
- package/src/util/media.js +40 -0
- package/src/util/output.js +34 -4
- package/src/util/request.js +11 -2
- package/src/util/s3.js +37 -20
- package/src/util/schema.js +93 -30
- package/src/util/video.js +4 -27
package/src/util/video.js
CHANGED
|
@@ -13,48 +13,25 @@ const fs = require("fs-extra");
|
|
|
13
13
|
|
|
14
14
|
const bytes = require("./bytes");
|
|
15
15
|
const cfgvideo = require("../config/video");
|
|
16
|
+
const media = require("./media");
|
|
16
17
|
const phrase = require("../phrase");
|
|
17
|
-
const size = require("./size");
|
|
18
18
|
|
|
19
19
|
// [use]
|
|
20
20
|
|
|
21
|
+
const checkAspect = media.checkAspect;
|
|
22
|
+
const checkSize = media.checkSize;
|
|
21
23
|
const extname = path.extname;
|
|
22
24
|
const formatBytes = bytes.formatBytes;
|
|
25
|
+
const MAX_READ = media.MAX_READ;
|
|
23
26
|
const readFileSync = fs.readFileSync; // eslint-disable-line no-sync
|
|
24
27
|
const statSync = fs.statSync; // eslint-disable-line no-sync
|
|
25
28
|
|
|
26
29
|
// [declare]
|
|
27
30
|
|
|
28
|
-
// a file over 64 MB can't be packed (action/pack/limits.js), so it isn't read.
|
|
29
|
-
const MAX_READ = size.mb(64);
|
|
30
31
|
const NO_TRACK = "no-video-track";
|
|
31
32
|
|
|
32
33
|
// [function]
|
|
33
34
|
|
|
34
|
-
const checkAspect = function (width, height, aspect) {
|
|
35
|
-
if (!aspect) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
const parts = aspect.split(":");
|
|
39
|
-
if (parts.length !== 2) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
const aspectWidth = Number(parts[0]);
|
|
43
|
-
const aspectHeight = Number(parts[1]);
|
|
44
|
-
if (!aspectWidth || !aspectHeight) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return width * aspectHeight === height * aspectWidth;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// [function]
|
|
51
|
-
|
|
52
|
-
const checkSize = function (fileSize, maxSize) {
|
|
53
|
-
return !maxSize || fileSize <= maxSize;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// [function]
|
|
57
|
-
|
|
58
35
|
const readMp4 = function (file) {
|
|
59
36
|
const data = readFileSync(file);
|
|
60
37
|
const mp4 = createFile();
|