arcadible 0.1.19 → 0.1.21
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/bin/arc-build.js +8 -6
- package/bin/arc-default.js +16 -11
- package/bin/arc-deploy.js +29 -25
- package/bin/arc-init.js +13 -9
- package/bin/arc-inspect.js +31 -16
- package/bin/arc-login.js +18 -10
- package/bin/arc-logout.js +29 -7
- package/bin/arc-open.js +114 -0
- package/bin/arc-pack.js +8 -6
- package/bin/arc-play.js +68 -18
- package/bin/arc-validate.js +10 -9
- package/bin/arc-whoami.js +14 -12
- package/bin/arc.js +7 -5
- package/package.json +3 -4
- package/product.json +9 -0
- package/src/account.js +14 -12
- package/src/action/deploy/tool-git.js +3 -3
- package/src/action/deploy/tool.js +6 -6
- package/src/action/init/manifest.js +3 -1
- package/src/action/inspect/media.js +6 -1
- package/src/action/inspect/tool.js +25 -9
- package/src/action/open/tool.js +24 -0
- package/src/action/pack/tool.js +10 -4
- package/src/action/play/tool.js +23 -26
- package/src/action/predeploy/ac.js +47 -12
- package/src/action/predeploy/git.js +3 -1
- package/src/action/predeploy/pm.js +41 -0
- package/src/action/predeploy/tool-git.js +25 -5
- package/src/action/predeploy/tool.js +14 -7
- package/src/api.js +16 -3
- package/src/cli/deploy.js +2 -2
- package/src/cli/index.js +2 -2
- package/src/cli/inspect.js +2 -2
- package/src/cli/{count.js → open.js} +2 -2
- package/src/cli/play.js +2 -2
- package/src/cli/predeploy.js +2 -2
- package/src/config/package.js +5 -0
- package/src/config/product.js +5 -0
- package/src/config/uri.js +13 -5
- package/src/config/url.js +3 -2
- package/src/config/workflow.js +9 -1
- package/src/parser/manifest.js +3 -1
- package/src/parser/media.js +3 -1
- package/src/parser/readme.js +6 -4
- package/src/phrase.js +73 -9
- package/src/prompt/template.js +14 -9
- package/src/schema/game.js +5 -2
- package/src/schema/workflow.js +5 -2
- package/src/util/http.js +3 -2
- package/src/util/output.js +2 -2
- package/src/util/rc.js +1 -1
- package/src/util/request.js +8 -6
- package/src/util/shell.js +52 -0
- package/src/util/video.js +6 -6
- package/bin/arc-count.js +0 -115
- package/bin/arc-predeploy.js +0 -2
- package/src/action/count/tool.js +0 -45
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
// [import]
|
|
4
|
+
|
|
5
|
+
const cfgproduct = require("../../config/product");
|
|
6
|
+
|
|
3
7
|
// [declare]
|
|
4
8
|
|
|
5
9
|
const ART = [
|
|
@@ -17,7 +21,8 @@ const ART = [
|
|
|
17
21
|
|
|
18
22
|
// [declare]
|
|
19
23
|
|
|
20
|
-
const
|
|
24
|
+
const HANDLE = cfgproduct.handle;
|
|
25
|
+
const MEDIA = `.${HANDLE}`;
|
|
21
26
|
|
|
22
27
|
// [function]
|
|
23
28
|
|
|
@@ -13,33 +13,49 @@ const project = require("../../parser/project");
|
|
|
13
13
|
|
|
14
14
|
// [function]
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const select = function (proj, key) {
|
|
17
17
|
return key ? dotProp.get(proj, key, null) : proj;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// [function]
|
|
21
21
|
|
|
22
|
-
const
|
|
23
|
-
if (!game || game === "self") {
|
|
24
|
-
return project(root).then((proj) => inspect(proj, selector));
|
|
25
|
-
}
|
|
22
|
+
const inspect = function (id) {
|
|
26
23
|
return api
|
|
27
|
-
.discoverGameBuilds(
|
|
24
|
+
.discoverGameBuilds(id, {
|
|
28
25
|
channel: "production",
|
|
29
26
|
select: "manifest",
|
|
30
27
|
})
|
|
31
28
|
.then((builds) => {
|
|
32
29
|
if (!builds.length) {
|
|
33
|
-
throw new Error(phrase.noProductionBuild(
|
|
30
|
+
throw new Error(phrase.noProductionBuild(id));
|
|
34
31
|
}
|
|
35
|
-
const manifest = builds[0]
|
|
32
|
+
const manifest = builds[0]?.manifest ?? {};
|
|
36
33
|
if (manifest.game) {
|
|
37
34
|
media.dehydrate(manifest.game);
|
|
38
35
|
}
|
|
39
|
-
return
|
|
36
|
+
return manifest;
|
|
40
37
|
});
|
|
41
38
|
};
|
|
42
39
|
|
|
40
|
+
// [function]
|
|
41
|
+
|
|
42
|
+
const main = function ({ game: id, root, selector }, { onInspectFetch }) {
|
|
43
|
+
const local = !id;
|
|
44
|
+
if (onInspectFetch && !local) {
|
|
45
|
+
onInspectFetch({ game: id });
|
|
46
|
+
}
|
|
47
|
+
if (local) {
|
|
48
|
+
return project(root).then((data) => select(data, selector));
|
|
49
|
+
}
|
|
50
|
+
if (id === "self") {
|
|
51
|
+
return project(root)
|
|
52
|
+
.then(({ game }) => game?.handle ?? game?.id)
|
|
53
|
+
.then(inspect)
|
|
54
|
+
.then((data) => select(data, selector));
|
|
55
|
+
}
|
|
56
|
+
return inspect(id).then((data) => select(data, selector));
|
|
57
|
+
};
|
|
58
|
+
|
|
43
59
|
// [export]
|
|
44
60
|
|
|
45
61
|
module.exports = main;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// [import]
|
|
4
|
+
|
|
5
|
+
const project = require("../../parser/project");
|
|
6
|
+
|
|
7
|
+
// [function]
|
|
8
|
+
|
|
9
|
+
const open = function (id) {
|
|
10
|
+
return id ? { page: `/play/${id}` } : null;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// [function]
|
|
14
|
+
|
|
15
|
+
const main = function ({ game: id, root }) {
|
|
16
|
+
if (id === "self") {
|
|
17
|
+
return project(root).then(({ game }) => open(game?.handle ?? game?.id));
|
|
18
|
+
}
|
|
19
|
+
return Promise.resolve(open(id));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// [export]
|
|
23
|
+
|
|
24
|
+
module.exports = main;
|
package/src/action/pack/tool.js
CHANGED
|
@@ -10,6 +10,7 @@ const fs = require("fs-extra");
|
|
|
10
10
|
|
|
11
11
|
// [import]
|
|
12
12
|
|
|
13
|
+
const cfgproduct = require("../../config/product");
|
|
13
14
|
const phrase = require("../../phrase");
|
|
14
15
|
const project = require("../../parser/project");
|
|
15
16
|
const size = require("../../util/size");
|
|
@@ -23,10 +24,15 @@ const resolve = path.resolve;
|
|
|
23
24
|
|
|
24
25
|
// [declare]
|
|
25
26
|
|
|
27
|
+
const HANDLE = cfgproduct.handle;
|
|
28
|
+
const TOOL = cfgproduct.tool;
|
|
29
|
+
|
|
30
|
+
// [declare]
|
|
31
|
+
|
|
26
32
|
const MAIN = "index.html";
|
|
27
|
-
const MANIFEST =
|
|
28
|
-
const MEDIA =
|
|
29
|
-
const OUTPUT =
|
|
33
|
+
const MANIFEST = `${HANDLE}.json`;
|
|
34
|
+
const MEDIA = `.${HANDLE}`;
|
|
35
|
+
const OUTPUT = `.${TOOL}/package`;
|
|
30
36
|
|
|
31
37
|
// [declare]
|
|
32
38
|
|
|
@@ -65,7 +71,7 @@ const pack = function (name, game, { inputPath, mediaPath, outputPath }) {
|
|
|
65
71
|
if (existsInput) {
|
|
66
72
|
zip.addDir(inputPath);
|
|
67
73
|
}
|
|
68
|
-
|
|
74
|
+
throw new Error(phrase.unableToFind(inputPath));
|
|
69
75
|
})
|
|
70
76
|
.then(verifyPartial)
|
|
71
77
|
.then(() => pathExists(mediaPath))
|
package/src/action/play/tool.js
CHANGED
|
@@ -2,42 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
// [import]
|
|
4
4
|
|
|
5
|
-
const dotProp = require("dot-prop");
|
|
6
|
-
|
|
7
|
-
// [import]
|
|
8
|
-
|
|
9
5
|
const api = require("../../api");
|
|
10
|
-
const
|
|
11
|
-
const phrase = require("../../phrase");
|
|
6
|
+
const cfguri = require("../../config/uri");
|
|
12
7
|
const project = require("../../parser/project");
|
|
13
8
|
|
|
14
9
|
// [function]
|
|
15
10
|
|
|
16
|
-
const
|
|
17
|
-
|
|
11
|
+
const play = function (id, release) {
|
|
12
|
+
if (!id) {
|
|
13
|
+
return Promise.resolve(null);
|
|
14
|
+
}
|
|
15
|
+
const target = release === "production" ? "" : `:${release}`;
|
|
16
|
+
const url = `${cfguri.HOST_HTTP_PLAY}/${id}${target}/`;
|
|
17
|
+
return api
|
|
18
|
+
.discoverGame(id, { select: "orientation" })
|
|
19
|
+
.catch(() => null)
|
|
20
|
+
.then((game) => ({
|
|
21
|
+
orientation: game?.orientation ?? "natural",
|
|
22
|
+
url,
|
|
23
|
+
}));
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
// [function]
|
|
21
27
|
|
|
22
|
-
const main = function ({ game, root,
|
|
23
|
-
if (
|
|
24
|
-
|
|
28
|
+
const main = function ({ game: id, release, root }, { onPlayFetch }) {
|
|
29
|
+
if (onPlayFetch) {
|
|
30
|
+
onPlayFetch({ game: id });
|
|
25
31
|
}
|
|
26
|
-
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (!builds.length) {
|
|
33
|
-
throw new Error(phrase.noProductionBuild(game));
|
|
34
|
-
}
|
|
35
|
-
const manifest = builds[0].manifest || {};
|
|
36
|
-
if (manifest.game) {
|
|
37
|
-
media.dehydrate(manifest.game);
|
|
38
|
-
}
|
|
39
|
-
return inspect(manifest, selector);
|
|
40
|
-
});
|
|
32
|
+
if (id === "self") {
|
|
33
|
+
return project(root).then(({ game }) =>
|
|
34
|
+
play(game?.handle ?? game?.id, release),
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return play(id, release);
|
|
41
38
|
};
|
|
42
39
|
|
|
43
40
|
// [export]
|
|
@@ -9,7 +9,7 @@ const s3 = require("../../util/s3");
|
|
|
9
9
|
// [function]
|
|
10
10
|
|
|
11
11
|
const uploadBuild = function (
|
|
12
|
-
|
|
12
|
+
current,
|
|
13
13
|
artifact,
|
|
14
14
|
{ id, version },
|
|
15
15
|
onUploadProgress,
|
|
@@ -21,18 +21,24 @@ const uploadBuild = function (
|
|
|
21
21
|
form.append("sha256", artifact.sha256);
|
|
22
22
|
form.append("size", artifact.size);
|
|
23
23
|
// api
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return api
|
|
25
|
+
.postUpload(form, { token: current?.session?.access_token })
|
|
26
|
+
.then((upload) => {
|
|
27
|
+
s3.upload(upload.upload_url, artifact, onUploadProgress, cb);
|
|
28
|
+
}, cb);
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
// [function]
|
|
31
32
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const ensureGame = function (current, idOrHandle, id, cb) {
|
|
34
|
+
return api.discoverGame(idOrHandle).then(
|
|
35
|
+
(game) => {
|
|
36
|
+
if (game.account === current?.user?.id && game.id === id) {
|
|
37
|
+
cb(null);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
cb(new Error(phrase.gameExists(idOrHandle)));
|
|
41
|
+
},
|
|
36
42
|
(err) => {
|
|
37
43
|
if (err.status === 404) {
|
|
38
44
|
cb(null);
|
|
@@ -45,10 +51,39 @@ const ensureVersion = function (session, { id, version }, cb) {
|
|
|
45
51
|
|
|
46
52
|
// [function]
|
|
47
53
|
|
|
48
|
-
const
|
|
49
|
-
|
|
54
|
+
const ensureId = function (current, { handle, id }, cb) {
|
|
55
|
+
return ensureGame(current, id, id, (err) => {
|
|
56
|
+
if (err || handle === null) {
|
|
57
|
+
cb(err);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
ensureGame(current, handle, id, cb);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// [function]
|
|
65
|
+
|
|
66
|
+
const ensureVersion = function (current, { id, version }, cb) {
|
|
67
|
+
return api
|
|
68
|
+
.gameBuild(id, version, { token: current?.session?.access_token })
|
|
69
|
+
.then(
|
|
70
|
+
() => cb(new Error(phrase.gameVersionExists(version))),
|
|
71
|
+
(err) => {
|
|
72
|
+
if (err.status === 404) {
|
|
73
|
+
cb(null);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
cb(err);
|
|
77
|
+
},
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// [function]
|
|
82
|
+
|
|
83
|
+
const release = function (current, artifact, game, onUploadProgress, cb) {
|
|
84
|
+
uploadBuild(current, artifact, game, onUploadProgress, cb);
|
|
50
85
|
};
|
|
51
86
|
|
|
52
87
|
// [export]
|
|
53
88
|
|
|
54
|
-
module.exports = { ensureVersion, release };
|
|
89
|
+
module.exports = { ensureId, ensureVersion, release };
|
|
@@ -10,6 +10,7 @@ const semver = require("semver");
|
|
|
10
10
|
|
|
11
11
|
// [import]
|
|
12
12
|
|
|
13
|
+
const cfgproduct = require("../../config/product");
|
|
13
14
|
const phrase = require("../../phrase");
|
|
14
15
|
|
|
15
16
|
// [use]
|
|
@@ -19,7 +20,8 @@ const prereleaseSemver = semver.prerelease;
|
|
|
19
20
|
|
|
20
21
|
// [declare]
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
+
const HANDLE = cfgproduct.handle;
|
|
24
|
+
const PREFIX = `${HANDLE}/release/v`;
|
|
23
25
|
|
|
24
26
|
// [function]
|
|
25
27
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// [import]
|
|
4
|
+
|
|
5
|
+
const fs = require("node:fs");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [use]
|
|
9
|
+
|
|
10
|
+
const existsSync = fs.existsSync; // eslint-disable-line no-sync
|
|
11
|
+
const join = path.join;
|
|
12
|
+
|
|
13
|
+
// [import]
|
|
14
|
+
|
|
15
|
+
const phrase = require("../../phrase");
|
|
16
|
+
|
|
17
|
+
// [function]
|
|
18
|
+
|
|
19
|
+
const ensureLockFile = function (root, cb) {
|
|
20
|
+
if (!existsSync(join(root, "package.json"))) {
|
|
21
|
+
cb(null);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (
|
|
25
|
+
// npm
|
|
26
|
+
existsSync(join(root, "package-lock.json")) ||
|
|
27
|
+
existsSync(join(root, "npm-shrinkwrap.json")) ||
|
|
28
|
+
// pnpm
|
|
29
|
+
existsSync(join(root, "pnpm-lock.yaml")) ||
|
|
30
|
+
// yarn
|
|
31
|
+
existsSync(join(root, "yarn.lock"))
|
|
32
|
+
) {
|
|
33
|
+
cb(null);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
cb(new Error(phrase.noLockFile()));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// [export]
|
|
40
|
+
|
|
41
|
+
module.exports = { ensureLockFile };
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
// [import]
|
|
4
4
|
|
|
5
5
|
const git = require("./git");
|
|
6
|
+
const pm = require("./pm");
|
|
6
7
|
const project = require("../../parser/project");
|
|
7
8
|
|
|
8
9
|
// [use]
|
|
9
10
|
|
|
10
11
|
const ensureClean = git.ensureClean;
|
|
12
|
+
const ensureLockFile = pm.ensureLockFile;
|
|
11
13
|
const ensureRemote = git.ensureRemote;
|
|
12
14
|
const ensureRepo = git.ensureRepo;
|
|
13
15
|
const ensureVersion = git.ensureVersion;
|
|
@@ -26,7 +28,7 @@ const deployRelease = function (version, { root }, handler, cb) {
|
|
|
26
28
|
|
|
27
29
|
// [function]
|
|
28
30
|
|
|
29
|
-
const
|
|
31
|
+
const deployEnsureGit = function ({ root }, { onLogInfo }, cb) {
|
|
30
32
|
ensureRepo(root, (err) => {
|
|
31
33
|
if (err) {
|
|
32
34
|
cb(err);
|
|
@@ -50,13 +52,31 @@ const deployEnsure = function ({ root }, { onLogInfo }, cb) {
|
|
|
50
52
|
|
|
51
53
|
// [function]
|
|
52
54
|
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
+
const deployEnsurePm = function ({ root }, handler, cb) {
|
|
56
|
+
ensureLockFile(root, cb);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// [function]
|
|
60
|
+
|
|
61
|
+
const deployEnsure = function (conf, handler, cb) {
|
|
62
|
+
deployEnsurePm(conf, handler, (err) => {
|
|
63
|
+
if (err) {
|
|
64
|
+
cb(err);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
deployEnsureGit(conf, handler, cb, cb);
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// [function]
|
|
72
|
+
|
|
73
|
+
const deploy = function ({ version }, conf, handler, cb) {
|
|
74
|
+
deployEnsure(conf, handler, (err) => {
|
|
55
75
|
if (err) {
|
|
56
76
|
cb(err);
|
|
57
77
|
return;
|
|
58
78
|
}
|
|
59
|
-
deployRelease(version,
|
|
79
|
+
deployRelease(version, conf, handler, cb);
|
|
60
80
|
});
|
|
61
81
|
};
|
|
62
82
|
|
|
@@ -64,7 +84,7 @@ const deploy = function ({ version }, { root }, handler, cb) {
|
|
|
64
84
|
|
|
65
85
|
const main = function ({ root }, { onPredeployBegin, ...handler }) {
|
|
66
86
|
if (onPredeployBegin) {
|
|
67
|
-
onPredeployBegin(
|
|
87
|
+
onPredeployBegin();
|
|
68
88
|
}
|
|
69
89
|
return project(root).then(
|
|
70
90
|
({ game }) =>
|
|
@@ -7,36 +7,43 @@ const project = require("../../parser/project");
|
|
|
7
7
|
|
|
8
8
|
// [use]
|
|
9
9
|
|
|
10
|
+
const ensureId = ac.ensureId;
|
|
10
11
|
const ensureVersion = ac.ensureVersion;
|
|
11
12
|
|
|
12
13
|
// [function]
|
|
13
14
|
|
|
14
|
-
const deployRelease = function (
|
|
15
|
-
|
|
15
|
+
const deployRelease = function (current, game, handler, cb) {
|
|
16
|
+
ensureId(current, game, (err) => {
|
|
16
17
|
if (err) {
|
|
17
18
|
cb(err);
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
ensureVersion(current, game, (err) => {
|
|
22
|
+
if (err) {
|
|
23
|
+
cb(err);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
cb(null, { to: game.version });
|
|
27
|
+
});
|
|
21
28
|
});
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
// [function]
|
|
25
32
|
|
|
26
|
-
const deploy = function (
|
|
27
|
-
deployRelease(
|
|
33
|
+
const deploy = function (current, game, handler, cb) {
|
|
34
|
+
deployRelease(current, game, handler, cb);
|
|
28
35
|
};
|
|
29
36
|
|
|
30
37
|
// [function]
|
|
31
38
|
|
|
32
|
-
const main = function (
|
|
39
|
+
const main = function (current, { root }, { onPredeployBegin, ...handler }) {
|
|
33
40
|
if (onPredeployBegin) {
|
|
34
41
|
onPredeployBegin({ root });
|
|
35
42
|
}
|
|
36
43
|
return project(root).then(
|
|
37
44
|
({ game }) =>
|
|
38
45
|
new Promise((resolve, reject) => {
|
|
39
|
-
deploy(
|
|
46
|
+
deploy(current, game, handler, (err, data) => {
|
|
40
47
|
if (err) {
|
|
41
48
|
reject(err);
|
|
42
49
|
return;
|
package/src/api.js
CHANGED
|
@@ -7,13 +7,12 @@ const request = require("./util/request");
|
|
|
7
7
|
|
|
8
8
|
// [declare]
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const API_VERSION = "v1";
|
|
10
|
+
const VERSION = "v1";
|
|
12
11
|
|
|
13
12
|
// [function]
|
|
14
13
|
|
|
15
14
|
const endpoint = function (path) {
|
|
16
|
-
return `${
|
|
15
|
+
return `${cfguri.HOST_HTTP_API}/${VERSION}${path}`;
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
// [function]
|
|
@@ -42,6 +41,18 @@ const postUpload = function (form, opts) {
|
|
|
42
41
|
|
|
43
42
|
// [function]
|
|
44
43
|
|
|
44
|
+
const game = function (id, opts) {
|
|
45
|
+
return request.get(endpoint(`/games/${id}`), opts);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// [function]
|
|
49
|
+
|
|
50
|
+
const discoverGame = function (id, opts) {
|
|
51
|
+
return request.get(endpoint(`/discover/games/${id}`), opts);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// [function]
|
|
55
|
+
|
|
45
56
|
const discoverGameBuilds = function (id, opts) {
|
|
46
57
|
return request.get(endpoint(`/discover/games/${id}/builds`), opts);
|
|
47
58
|
};
|
|
@@ -55,8 +66,10 @@ const gameBuild = function (id, version, opts) {
|
|
|
55
66
|
// [export]
|
|
56
67
|
|
|
57
68
|
module.exports = {
|
|
69
|
+
discoverGame,
|
|
58
70
|
discoverGameBuilds,
|
|
59
71
|
flow,
|
|
72
|
+
game,
|
|
60
73
|
gameBuild,
|
|
61
74
|
postAuthRefresh,
|
|
62
75
|
postFlow,
|
package/src/cli/deploy.js
CHANGED
|
@@ -7,10 +7,10 @@ const deployToolGit = require("../action/deploy/tool-git");
|
|
|
7
7
|
|
|
8
8
|
// [function]
|
|
9
9
|
|
|
10
|
-
const main = function ({ artifact, git, handler,
|
|
10
|
+
const main = function ({ artifact, current, git, handler, ...conf }) {
|
|
11
11
|
return git
|
|
12
12
|
? deployToolGit(conf, handler)
|
|
13
|
-
: deployTool(
|
|
13
|
+
: deployTool(current, artifact, conf, handler);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// [export]
|
package/src/cli/index.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// [import]
|
|
4
4
|
|
|
5
5
|
const build = require("./build");
|
|
6
|
-
const count = require("./count");
|
|
7
6
|
const deploy = require("./deploy");
|
|
8
7
|
const init = require("./init");
|
|
9
8
|
const inspect = require("./inspect");
|
|
10
9
|
const login = require("./login");
|
|
11
10
|
const logout = require("./logout");
|
|
11
|
+
const open = require("./open");
|
|
12
12
|
const pack = require("./pack");
|
|
13
13
|
const play = require("./play");
|
|
14
14
|
const predeploy = require("./predeploy");
|
|
@@ -19,12 +19,12 @@ const whoami = require("./whoami");
|
|
|
19
19
|
|
|
20
20
|
module.exports = {
|
|
21
21
|
build,
|
|
22
|
-
count,
|
|
23
22
|
deploy,
|
|
24
23
|
init,
|
|
25
24
|
inspect,
|
|
26
25
|
login,
|
|
27
26
|
logout,
|
|
27
|
+
open,
|
|
28
28
|
pack,
|
|
29
29
|
play,
|
|
30
30
|
predeploy,
|
package/src/cli/inspect.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
// [import]
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const openTool = require("../action/open/tool");
|
|
6
6
|
|
|
7
7
|
// [function]
|
|
8
8
|
|
|
9
9
|
const main = function (conf) {
|
|
10
|
-
return
|
|
10
|
+
return openTool(conf);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// [export]
|
package/src/cli/play.js
CHANGED
package/src/cli/predeploy.js
CHANGED
|
@@ -7,10 +7,10 @@ const predeployToolGit = require("../action/predeploy/tool-git");
|
|
|
7
7
|
|
|
8
8
|
// [function]
|
|
9
9
|
|
|
10
|
-
const main = function ({ git, handler,
|
|
10
|
+
const main = function ({ current, git, handler, ...conf }) {
|
|
11
11
|
return git
|
|
12
12
|
? predeployToolGit(conf, handler)
|
|
13
|
-
: predeployTool(
|
|
13
|
+
: predeployTool(current, conf, handler);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// [export]
|
package/src/config/uri.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
// [import]
|
|
4
|
+
|
|
5
|
+
const cfgproduct = require("./product");
|
|
6
|
+
|
|
3
7
|
// [declare]
|
|
4
8
|
|
|
5
|
-
const
|
|
9
|
+
const DOMAIN = cfgproduct.domain;
|
|
10
|
+
const PROTOCOL = cfgproduct.protocol;
|
|
6
11
|
|
|
7
12
|
// [export]
|
|
8
13
|
|
|
9
14
|
module.exports = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
HOST_APP_PLAY: `${PROTOCOL}://play`,
|
|
16
|
+
HOST_APP_STORE: `${PROTOCOL}://store`,
|
|
17
|
+
HOST_HTTP_ACCOUNT: `https://account.${DOMAIN}`,
|
|
18
|
+
HOST_HTTP_API: `https://api.${DOMAIN}`,
|
|
19
|
+
HOST_HTTP_DEVELOPER: `https://developer.${DOMAIN}`,
|
|
20
|
+
HOST_HTTP_PLAY: `https://play.${DOMAIN}`,
|
|
21
|
+
HOST_HTTP_WWW: `https://${DOMAIN}`,
|
|
14
22
|
};
|
package/src/config/url.js
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
// [import]
|
|
4
4
|
|
|
5
|
+
const cfgproduct = require("./product");
|
|
5
6
|
const cfguri = require("./uri");
|
|
6
7
|
|
|
7
8
|
// [declare]
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const HANDLE = cfgproduct.handle;
|
|
10
11
|
|
|
11
12
|
// [export]
|
|
12
13
|
|
|
13
14
|
module.exports = {
|
|
14
15
|
GETTING_STARTED: `${cfguri.HOST_HTTP_DEVELOPER}/guides/games/getting-started`,
|
|
15
16
|
LINK: `${cfguri.HOST_HTTP_ACCOUNT}/link`,
|
|
16
|
-
MANIFEST: `${cfguri.HOST_HTTP_DEVELOPER}/references/${
|
|
17
|
+
MANIFEST: `${cfguri.HOST_HTTP_DEVELOPER}/references/${HANDLE}-manifest`,
|
|
17
18
|
};
|