arcadible 0.1.4 → 0.1.6
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-default.js +3 -3
- package/bin/arc-deploy.js +4 -5
- package/bin/arc-init.js +13 -13
- package/bin/arc-inspect.js +3 -3
- package/bin/arc-login.js +2 -1
- package/bin/arc-pack.js +5 -5
- package/bin/arc-validate.js +7 -10
- package/bin/arc-whoami.js +1 -1
- package/package.json +1 -1
- package/src/action/deploy-git/git.js +6 -6
- package/src/action/deploy-git/tool.js +2 -2
- package/src/action/init/tool.js +5 -3
- package/src/action/inspect/tool.js +1 -1
- package/src/action/pack/tool.js +3 -3
- package/src/action/validate/tool.js +1 -1
- package/src/config/workflow.js +1 -1
- package/src/parser/manifest.js +2 -2
- package/src/parser/media.js +6 -6
- package/src/parser/pkg.js +12 -8
- package/src/parser/project.js +9 -8
- package/src/parser/readme.js +4 -4
- package/src/prompt/{starter.js → template.js} +6 -6
- package/src/schema/check/game.js +67 -0
- package/src/schema/check/workflow.js +47 -0
- package/src/schema/game.js +193 -65
- package/src/schema/workflow.js +29 -59
- package/src/user.js +2 -2
- package/src/util/dom.js +3 -3
- package/src/util/image.js +84 -0
- package/src/util/log.js +4 -4
- package/src/util/objs.js +11 -11
- package/src/util/output.js +3 -3
- package/src/util/schema.js +6 -6
- package/src/util/strs.js +11 -1
- package/src/util/video.js +122 -0
- package/src/util/zip.js +2 -2
package/bin/arc-default.js
CHANGED
|
@@ -31,12 +31,12 @@ const main = function (argv) {
|
|
|
31
31
|
.scriptName(CMD)
|
|
32
32
|
.usage("$0 <command> [options]")
|
|
33
33
|
.command("deploy", "Deploy to Arcadible")
|
|
34
|
-
.command("
|
|
34
|
+
.command("validate", "Validate workspace")
|
|
35
35
|
.command("inspect", "Inspect project metadata")
|
|
36
|
+
.command("init", "Initialize a project")
|
|
37
|
+
.command("whoami", "Show current Arcadible account")
|
|
36
38
|
.command("login", "Log in to Arcadible")
|
|
37
39
|
.command("logout", "Log out of Arcadible")
|
|
38
|
-
.command("validate", "Validate workspace")
|
|
39
|
-
.command("whoami", "Show current account")
|
|
40
40
|
.help("help")
|
|
41
41
|
.alias("help", "h")
|
|
42
42
|
.version(pkg.version)
|
package/bin/arc-deploy.js
CHANGED
|
@@ -111,27 +111,26 @@ const main = function (argv) {
|
|
|
111
111
|
.scriptName(`${CMD} ${SUBCMD}`)
|
|
112
112
|
.usage("$0 [options]")
|
|
113
113
|
.option("git", {
|
|
114
|
-
alias: "g",
|
|
115
114
|
default: conf.git,
|
|
116
|
-
describe: "Deploy through Git
|
|
115
|
+
describe: "Deploy through Git",
|
|
117
116
|
type: "boolean",
|
|
118
117
|
})
|
|
119
118
|
.option("json", {
|
|
120
119
|
alias: "j",
|
|
121
120
|
default: conf.json,
|
|
122
|
-
describe: "Format output as JSON
|
|
121
|
+
describe: "Format output as JSON",
|
|
123
122
|
type: "boolean",
|
|
124
123
|
})
|
|
125
124
|
.option("quiet", {
|
|
126
125
|
alias: "q",
|
|
127
126
|
default: conf.quiet,
|
|
128
|
-
describe: "Output only errors
|
|
127
|
+
describe: "Output only errors",
|
|
129
128
|
type: "boolean",
|
|
130
129
|
})
|
|
131
130
|
.option("cwd", {
|
|
132
131
|
alias: "C",
|
|
133
132
|
default: ".",
|
|
134
|
-
describe: "Set the working directory
|
|
133
|
+
describe: "Set the working directory",
|
|
135
134
|
type: "string",
|
|
136
135
|
})
|
|
137
136
|
.help("help")
|
package/bin/arc-init.js
CHANGED
|
@@ -20,7 +20,7 @@ const output = require("../src/util/output");
|
|
|
20
20
|
const pkg = require("../package.json");
|
|
21
21
|
const project = require("../src/prompt/project");
|
|
22
22
|
const rc = require("../src/util/rc");
|
|
23
|
-
const
|
|
23
|
+
const template = require("../src/prompt/template");
|
|
24
24
|
|
|
25
25
|
// [use]
|
|
26
26
|
|
|
@@ -70,7 +70,7 @@ const start = function (argv) {
|
|
|
70
70
|
handler: handler({ json, quiet }),
|
|
71
71
|
project: argv.project,
|
|
72
72
|
root,
|
|
73
|
-
|
|
73
|
+
template: argv.template,
|
|
74
74
|
})
|
|
75
75
|
.then((data) => {
|
|
76
76
|
const dir = relative(root, data.path);
|
|
@@ -110,14 +110,14 @@ const prompt = async function ({ yes, ...argv }) {
|
|
|
110
110
|
const opts = { ...argv };
|
|
111
111
|
if (yes) {
|
|
112
112
|
opts.project ??= project.input.default;
|
|
113
|
-
opts.
|
|
113
|
+
opts.template ??= template.select.default;
|
|
114
114
|
return opts;
|
|
115
115
|
}
|
|
116
116
|
if (!argv.project) {
|
|
117
117
|
opts.project = await input(project.input);
|
|
118
118
|
}
|
|
119
|
-
if (!argv.
|
|
120
|
-
opts.
|
|
119
|
+
if (!argv.template) {
|
|
120
|
+
opts.template = await select(template.select);
|
|
121
121
|
}
|
|
122
122
|
return opts;
|
|
123
123
|
};
|
|
@@ -131,43 +131,43 @@ const main = function (argv) {
|
|
|
131
131
|
.usage("$0 <project> [options]")
|
|
132
132
|
.command("$0 <project>", false, (cli) =>
|
|
133
133
|
cli.positional("project", {
|
|
134
|
-
describe: "
|
|
134
|
+
describe: "Project directory",
|
|
135
135
|
type: "string",
|
|
136
136
|
}),
|
|
137
137
|
)
|
|
138
|
-
.option("
|
|
138
|
+
.option("template", {
|
|
139
139
|
alias: "t",
|
|
140
|
-
describe: "
|
|
140
|
+
describe: "Project template",
|
|
141
141
|
type: "string",
|
|
142
142
|
})
|
|
143
143
|
.option("yes", {
|
|
144
144
|
alias: "y",
|
|
145
145
|
default: conf.yes,
|
|
146
|
-
describe: "Answer prompts using default values
|
|
146
|
+
describe: "Answer prompts using default values",
|
|
147
147
|
type: "boolean",
|
|
148
148
|
})
|
|
149
149
|
.option("force", {
|
|
150
150
|
alias: "f",
|
|
151
151
|
default: conf.force,
|
|
152
|
-
describe: "Overwrite an existing directory
|
|
152
|
+
describe: "Overwrite an existing directory",
|
|
153
153
|
type: "boolean",
|
|
154
154
|
})
|
|
155
155
|
.option("json", {
|
|
156
156
|
alias: "j",
|
|
157
157
|
default: conf.json,
|
|
158
|
-
describe: "Format output as JSON
|
|
158
|
+
describe: "Format output as JSON",
|
|
159
159
|
type: "boolean",
|
|
160
160
|
})
|
|
161
161
|
.option("quiet", {
|
|
162
162
|
alias: "q",
|
|
163
163
|
default: conf.quiet,
|
|
164
|
-
describe: "Output only errors
|
|
164
|
+
describe: "Output only errors",
|
|
165
165
|
type: "boolean",
|
|
166
166
|
})
|
|
167
167
|
.option("cwd", {
|
|
168
168
|
alias: "C",
|
|
169
169
|
default: ".",
|
|
170
|
-
describe: "Set the working directory
|
|
170
|
+
describe: "Set the working directory",
|
|
171
171
|
type: "string",
|
|
172
172
|
})
|
|
173
173
|
.help("help")
|
package/bin/arc-inspect.js
CHANGED
|
@@ -71,20 +71,20 @@ const main = function (argv) {
|
|
|
71
71
|
.command("$0 [key]", false, (cli) =>
|
|
72
72
|
cli.positional("key", {
|
|
73
73
|
default: conf.key,
|
|
74
|
-
describe: "
|
|
74
|
+
describe: "Metadata key",
|
|
75
75
|
type: "string",
|
|
76
76
|
}),
|
|
77
77
|
)
|
|
78
78
|
.option("json", {
|
|
79
79
|
alias: "j",
|
|
80
80
|
default: conf.json,
|
|
81
|
-
describe: "Format output as JSON
|
|
81
|
+
describe: "Format output as JSON",
|
|
82
82
|
type: "boolean",
|
|
83
83
|
})
|
|
84
84
|
.option("cwd", {
|
|
85
85
|
alias: "C",
|
|
86
86
|
default: ".",
|
|
87
|
-
describe: "Set the working directory
|
|
87
|
+
describe: "Set the working directory",
|
|
88
88
|
type: "string",
|
|
89
89
|
})
|
|
90
90
|
.help("help")
|
package/bin/arc-login.js
CHANGED
|
@@ -104,7 +104,8 @@ const main = function (argv) {
|
|
|
104
104
|
.usage("$0 [options]")
|
|
105
105
|
.option("browser", {
|
|
106
106
|
default: conf.browser,
|
|
107
|
-
describe:
|
|
107
|
+
describe:
|
|
108
|
+
"Open a web browser automatically (use --no-browser to disable)",
|
|
108
109
|
type: "boolean",
|
|
109
110
|
})
|
|
110
111
|
.help("help")
|
package/bin/arc-pack.js
CHANGED
|
@@ -34,7 +34,7 @@ const SUBCMD = "pack";
|
|
|
34
34
|
|
|
35
35
|
const conf = {
|
|
36
36
|
json: false,
|
|
37
|
-
output: "
|
|
37
|
+
output: "project.zip",
|
|
38
38
|
quiet: false,
|
|
39
39
|
...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
|
|
40
40
|
};
|
|
@@ -84,25 +84,25 @@ const main = function (argv) {
|
|
|
84
84
|
.option("output", {
|
|
85
85
|
alias: "o",
|
|
86
86
|
default: conf.output,
|
|
87
|
-
describe: "Set the output path
|
|
87
|
+
describe: "Set the output path",
|
|
88
88
|
type: "string",
|
|
89
89
|
})
|
|
90
90
|
.option("json", {
|
|
91
91
|
alias: "j",
|
|
92
92
|
default: conf.json,
|
|
93
|
-
describe: "Format output as JSON
|
|
93
|
+
describe: "Format output as JSON",
|
|
94
94
|
type: "boolean",
|
|
95
95
|
})
|
|
96
96
|
.option("quiet", {
|
|
97
97
|
alias: "q",
|
|
98
98
|
default: conf.quiet,
|
|
99
|
-
describe: "Output only errors
|
|
99
|
+
describe: "Output only errors",
|
|
100
100
|
type: "boolean",
|
|
101
101
|
})
|
|
102
102
|
.option("cwd", {
|
|
103
103
|
alias: "C",
|
|
104
104
|
default: ".",
|
|
105
|
-
describe: "Set the working directory
|
|
105
|
+
describe: "Set the working directory",
|
|
106
106
|
type: "string",
|
|
107
107
|
})
|
|
108
108
|
.help("help")
|
package/bin/arc-validate.js
CHANGED
|
@@ -45,16 +45,13 @@ const start = function (argv) {
|
|
|
45
45
|
return validate({ root: resolve(process.cwd(), argv.cwd) })
|
|
46
46
|
.then((issues) => {
|
|
47
47
|
const count = issues.length;
|
|
48
|
-
const term = count === 1 ? "issue" : "issues";
|
|
49
48
|
if (json) {
|
|
50
49
|
print({ issues });
|
|
50
|
+
} else if (count) {
|
|
51
|
+
log.hd(`${count} ${count === 1 ? "issue" : "issues"} found.`);
|
|
52
|
+
log.p(issues.map((error) => `✗ ${error}`));
|
|
51
53
|
} else if (!quiet) {
|
|
52
|
-
|
|
53
|
-
log.hd(`${count} ${term} found.`);
|
|
54
|
-
log.p(issues.map((error) => `✗ ${error}`));
|
|
55
|
-
} else {
|
|
56
|
-
log.hs("Validated.");
|
|
57
|
-
}
|
|
54
|
+
log.hs("Validated.");
|
|
58
55
|
}
|
|
59
56
|
process.exit(count ? 1 : 0);
|
|
60
57
|
})
|
|
@@ -80,19 +77,19 @@ const main = function (argv) {
|
|
|
80
77
|
.option("json", {
|
|
81
78
|
alias: "j",
|
|
82
79
|
default: conf.json,
|
|
83
|
-
describe: "Format output as JSON
|
|
80
|
+
describe: "Format output as JSON",
|
|
84
81
|
type: "boolean",
|
|
85
82
|
})
|
|
86
83
|
.option("quiet", {
|
|
87
84
|
alias: "q",
|
|
88
85
|
default: conf.quiet,
|
|
89
|
-
describe: "Output only errors
|
|
86
|
+
describe: "Output only errors",
|
|
90
87
|
type: "boolean",
|
|
91
88
|
})
|
|
92
89
|
.option("cwd", {
|
|
93
90
|
alias: "C",
|
|
94
91
|
default: ".",
|
|
95
|
-
describe: "Set the working directory
|
|
92
|
+
describe: "Set the working directory",
|
|
96
93
|
type: "string",
|
|
97
94
|
})
|
|
98
95
|
.help("help")
|
package/bin/arc-whoami.js
CHANGED
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ const git = function (root, args, cb) {
|
|
|
27
27
|
const ensureRepo = function (root, cb) {
|
|
28
28
|
const message = [
|
|
29
29
|
"Unable to find a Git repository.",
|
|
30
|
-
"
|
|
30
|
+
"Ensure you are in a Git repository, or create one before continuing.",
|
|
31
31
|
];
|
|
32
32
|
git(root, ["rev-parse", "--is-inside-work-tree"], (err) => {
|
|
33
33
|
if (err) {
|
|
@@ -43,7 +43,7 @@ const ensureRepo = function (root, cb) {
|
|
|
43
43
|
const ensureRemote = function (root, cb) {
|
|
44
44
|
const message = [
|
|
45
45
|
"Unable to access Git remote 'origin'.",
|
|
46
|
-
"
|
|
46
|
+
"Ensure the remote exists and you have permission to access it.",
|
|
47
47
|
];
|
|
48
48
|
git(root, ["ls-remote", "origin"], (err) => {
|
|
49
49
|
if (err) {
|
|
@@ -58,8 +58,8 @@ const ensureRemote = function (root, cb) {
|
|
|
58
58
|
|
|
59
59
|
const ensureClean = function (root, cb) {
|
|
60
60
|
const message = [
|
|
61
|
-
"Unable to continue with
|
|
62
|
-
"
|
|
61
|
+
"Unable to continue with Git changes present.",
|
|
62
|
+
"Ensure all changes are staged, committed, or discarded before continuing.",
|
|
63
63
|
];
|
|
64
64
|
git(root, ["diff", "--quiet"], (err) => {
|
|
65
65
|
if (err) {
|
|
@@ -89,7 +89,7 @@ const ensureClean = function (root, cb) {
|
|
|
89
89
|
const createTag = function (root, version, cb) {
|
|
90
90
|
const message = [
|
|
91
91
|
"Unable to create Git tag.",
|
|
92
|
-
"
|
|
92
|
+
"Ensure the release tag does not already exist locally.",
|
|
93
93
|
];
|
|
94
94
|
git(
|
|
95
95
|
root,
|
|
@@ -117,7 +117,7 @@ const createTag = function (root, version, cb) {
|
|
|
117
117
|
const pushTag = function (root, version, cb) {
|
|
118
118
|
const message = [
|
|
119
119
|
"Unable to push Git tag.",
|
|
120
|
-
"
|
|
120
|
+
"Ensure the release tag does not already exist on remote 'origin'.",
|
|
121
121
|
];
|
|
122
122
|
git(root, ["push", "origin", `${PREFIX}${version}`], (err) => {
|
|
123
123
|
if (err) {
|
|
@@ -40,7 +40,7 @@ const deployEnsure = function ({ root }, { onInfo }, cb) {
|
|
|
40
40
|
if (diff.cached) {
|
|
41
41
|
onInfo({
|
|
42
42
|
level: "warn",
|
|
43
|
-
message: "Staged but uncommitted changes will not be
|
|
43
|
+
message: "Staged but uncommitted changes will not be included.",
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
ensureRemote(root, cb);
|
|
@@ -64,7 +64,7 @@ const deploy = function (version, { root }, handler, cb) {
|
|
|
64
64
|
|
|
65
65
|
const main = function ({ root }, { onBegin, ...handler }) {
|
|
66
66
|
onBegin({ root });
|
|
67
|
-
return project
|
|
67
|
+
return project(root).then(
|
|
68
68
|
({ game }) =>
|
|
69
69
|
new Promise((resolve, reject) => {
|
|
70
70
|
deploy(game.version, { root }, handler, (err, data) => {
|
package/src/action/init/tool.js
CHANGED
|
@@ -27,14 +27,16 @@ const init = function (src, dest, { onBegin, onInfo }) {
|
|
|
27
27
|
|
|
28
28
|
// [function]
|
|
29
29
|
|
|
30
|
-
const main = function ({ force, project, root,
|
|
30
|
+
const main = function ({ force, project, root, template }, handler) {
|
|
31
31
|
const dest = resolve(root, project);
|
|
32
32
|
return pathExists(dest)
|
|
33
33
|
.then((exists) => {
|
|
34
34
|
if (exists && !force) {
|
|
35
|
-
throw new Error(
|
|
35
|
+
throw new Error(
|
|
36
|
+
"Directory already exists. Use `--force` to overwrite.",
|
|
37
|
+
);
|
|
36
38
|
}
|
|
37
|
-
return init(
|
|
39
|
+
return init(template, dest, handler);
|
|
38
40
|
})
|
|
39
41
|
.then(() => ({ path: dest }));
|
|
40
42
|
};
|
package/src/action/pack/tool.js
CHANGED
|
@@ -15,8 +15,8 @@ const Zip = require("../../util/zip");
|
|
|
15
15
|
|
|
16
16
|
// [use]
|
|
17
17
|
|
|
18
|
+
const parse = path.parse;
|
|
18
19
|
const pathExists = fs.pathExists;
|
|
19
|
-
const pathParse = path.parse;
|
|
20
20
|
const resolve = path.resolve;
|
|
21
21
|
|
|
22
22
|
// [declare]
|
|
@@ -46,8 +46,8 @@ const pack = function (name, game, { deployPath, mediaPath, zipPath }) {
|
|
|
46
46
|
// [function]
|
|
47
47
|
|
|
48
48
|
const main = function ({ output, root }) {
|
|
49
|
-
return project
|
|
50
|
-
pack(
|
|
49
|
+
return project(root).then(({ game, workflow }) =>
|
|
50
|
+
pack(parse(output).name, game, {
|
|
51
51
|
deployPath: resolve(root, workflow.deploy_dir),
|
|
52
52
|
mediaPath: resolve(root, MEDIA),
|
|
53
53
|
zipPath: resolve(root, output),
|
|
@@ -31,7 +31,7 @@ const validate = function (proj, { root }) {
|
|
|
31
31
|
// [function]
|
|
32
32
|
|
|
33
33
|
const main = function ({ root }) {
|
|
34
|
-
return project
|
|
34
|
+
return project(root).then((proj) => validate(proj, { root }));
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
// [export]
|
package/src/config/workflow.js
CHANGED
package/src/parser/manifest.js
CHANGED
|
@@ -33,7 +33,7 @@ const parseToml = function (buf) {
|
|
|
33
33
|
|
|
34
34
|
// [function]
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const main = function (root) {
|
|
37
37
|
const file = join(root, MANIFEST);
|
|
38
38
|
return pathExists(file)
|
|
39
39
|
.then((exists) => (exists ? readFile(file, "utf8") : null))
|
|
@@ -42,4 +42,4 @@ const parse = function (root) {
|
|
|
42
42
|
|
|
43
43
|
// [export]
|
|
44
44
|
|
|
45
|
-
module.exports =
|
|
45
|
+
module.exports = main;
|
package/src/parser/media.js
CHANGED
|
@@ -14,11 +14,11 @@ const objs = require("../util/objs");
|
|
|
14
14
|
|
|
15
15
|
// [use]
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const deepCompact = objs.deepCompact;
|
|
18
18
|
const extname = path.extname;
|
|
19
19
|
const join = path.join;
|
|
20
|
+
const parse = path.parse;
|
|
20
21
|
const pathExists = fs.pathExists;
|
|
21
|
-
const pathParse = path.parse;
|
|
22
22
|
const readdir = fs.promises.readdir;
|
|
23
23
|
|
|
24
24
|
// [declare]
|
|
@@ -44,7 +44,7 @@ const MEDIA = ".arcadible";
|
|
|
44
44
|
|
|
45
45
|
const handleArt = function (exists) {
|
|
46
46
|
return Object.fromEntries(
|
|
47
|
-
ART.map((f, i) => [
|
|
47
|
+
ART.map((f, i) => [parse(f).name, exists[i] ? join(MEDIA, f) : null]),
|
|
48
48
|
);
|
|
49
49
|
};
|
|
50
50
|
|
|
@@ -79,12 +79,12 @@ const gallery = function (root) {
|
|
|
79
79
|
|
|
80
80
|
// [function]
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const main = function (root) {
|
|
83
83
|
return new Promise((resolve, reject) => {
|
|
84
84
|
Promise.resolve({})
|
|
85
85
|
.then(art(root))
|
|
86
86
|
.then(gallery(root))
|
|
87
|
-
.then(
|
|
87
|
+
.then(deepCompact)
|
|
88
88
|
.then((game) => ({ game }))
|
|
89
89
|
.then(resolve)
|
|
90
90
|
.catch(reject);
|
|
@@ -93,4 +93,4 @@ const parse = function (root) {
|
|
|
93
93
|
|
|
94
94
|
// [export]
|
|
95
95
|
|
|
96
|
-
module.exports =
|
|
96
|
+
module.exports = main;
|
package/src/parser/pkg.js
CHANGED
|
@@ -8,8 +8,13 @@ const path = require("node:path");
|
|
|
8
8
|
|
|
9
9
|
const fs = require("fs-extra");
|
|
10
10
|
|
|
11
|
+
// [import]
|
|
12
|
+
|
|
13
|
+
const objs = require("../util/objs");
|
|
14
|
+
|
|
11
15
|
// [use]
|
|
12
16
|
|
|
17
|
+
const deepCompact = objs.deepCompact;
|
|
13
18
|
const join = path.join;
|
|
14
19
|
const pathExists = fs.pathExists;
|
|
15
20
|
const readFile = fs.readFile;
|
|
@@ -33,17 +38,16 @@ const parseJson = function (buf) {
|
|
|
33
38
|
// [function]
|
|
34
39
|
|
|
35
40
|
const extract = function (pkg) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
);
|
|
41
|
+
/* eslint-disable camelcase */
|
|
42
|
+
const game = { version: pkg.version };
|
|
43
|
+
const workflow = { skip_build: pkg.scripts?.build ? false : null };
|
|
44
|
+
/* eslint-enable camelcase */
|
|
45
|
+
return deepCompact({ game, workflow });
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
// [function]
|
|
45
49
|
|
|
46
|
-
const
|
|
50
|
+
const main = function (root) {
|
|
47
51
|
const file = join(root, PACKAGE);
|
|
48
52
|
return pathExists(file)
|
|
49
53
|
.then((exists) => (exists ? readFile(file, "utf8") : null))
|
|
@@ -53,4 +57,4 @@ const parse = function (root) {
|
|
|
53
57
|
|
|
54
58
|
// [export]
|
|
55
59
|
|
|
56
|
-
module.exports =
|
|
60
|
+
module.exports = main;
|
package/src/parser/project.js
CHANGED
|
@@ -24,21 +24,22 @@ const configGame = function (readmeGame, mediaGame, pkgGame, manifestGame) {
|
|
|
24
24
|
|
|
25
25
|
// [function]
|
|
26
26
|
|
|
27
|
-
const configWorkflow = function (manifestWorkflow) {
|
|
27
|
+
const configWorkflow = function (pkgWorkflow, manifestWorkflow) {
|
|
28
28
|
return {
|
|
29
29
|
...cfgworkflow,
|
|
30
|
+
...(pkgWorkflow || {}),
|
|
30
31
|
...(manifestWorkflow || {}),
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
// [function]
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
+
const main = function (root) {
|
|
37
38
|
const parsers = [
|
|
38
|
-
() => manifest
|
|
39
|
-
() => media
|
|
40
|
-
() => pkg
|
|
41
|
-
() => readme
|
|
39
|
+
() => manifest(root),
|
|
40
|
+
() => media(root),
|
|
41
|
+
() => pkg(root),
|
|
42
|
+
() => readme(root),
|
|
42
43
|
];
|
|
43
44
|
return promise
|
|
44
45
|
.serial(parsers)
|
|
@@ -49,11 +50,11 @@ const parse = function (root) {
|
|
|
49
50
|
pkgData.game,
|
|
50
51
|
manifestData.game,
|
|
51
52
|
);
|
|
52
|
-
const workflow = configWorkflow(manifestData.workflow);
|
|
53
|
+
const workflow = configWorkflow(pkgData.workflow, manifestData.workflow);
|
|
53
54
|
return { game, workflow };
|
|
54
55
|
});
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
// [export]
|
|
58
59
|
|
|
59
|
-
module.exports =
|
|
60
|
+
module.exports = main;
|
package/src/parser/readme.js
CHANGED
|
@@ -17,7 +17,7 @@ const strs = require("../util/strs");
|
|
|
17
17
|
|
|
18
18
|
// [use]
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const deepCompact = objs.deepCompact;
|
|
21
21
|
const join = path.join;
|
|
22
22
|
const pathExists = fs.pathExists;
|
|
23
23
|
const readFile = fs.readFile;
|
|
@@ -141,14 +141,14 @@ const findReadme = function (root) {
|
|
|
141
141
|
|
|
142
142
|
// [function]
|
|
143
143
|
|
|
144
|
-
const
|
|
144
|
+
const main = function (root) {
|
|
145
145
|
return findReadme(root)
|
|
146
146
|
.then((file) => (file ? readFile(join(root, file), "utf8") : null))
|
|
147
147
|
.then((buf) => (buf === null ? null : parseReadme(buf)))
|
|
148
|
-
.then(
|
|
148
|
+
.then(deepCompact)
|
|
149
149
|
.then((game) => ({ game: game || null }));
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
// [export]
|
|
153
153
|
|
|
154
|
-
module.exports =
|
|
154
|
+
module.exports = main;
|
|
@@ -10,32 +10,32 @@ module.exports = {
|
|
|
10
10
|
select: {
|
|
11
11
|
choices: [
|
|
12
12
|
{
|
|
13
|
-
description: "Blank starter
|
|
13
|
+
description: "Blank starter.",
|
|
14
14
|
name: "Blank",
|
|
15
15
|
value: `${REPO}/starter`,
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
description: "Three.js starter
|
|
18
|
+
description: "Three.js starter.",
|
|
19
19
|
name: "Three.js",
|
|
20
20
|
value: `${REPO}/starter-threejs`,
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
description: "Phaser starter
|
|
23
|
+
description: "Phaser starter.",
|
|
24
24
|
name: "Phaser",
|
|
25
25
|
value: `${REPO}/starter-phaser`,
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
description: "PixiJS starter
|
|
28
|
+
description: "PixiJS starter.",
|
|
29
29
|
name: "PixiJS",
|
|
30
30
|
value: `${REPO}/starter-pixijs`,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
description: "Babylon.js starter
|
|
33
|
+
description: "Babylon.js starter.",
|
|
34
34
|
name: "Babylon.js",
|
|
35
35
|
value: `${REPO}/starter-babylonjs`,
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
38
|
default: `${REPO}/starter`,
|
|
39
|
-
message: "
|
|
39
|
+
message: "Template",
|
|
40
40
|
},
|
|
41
41
|
};
|