arcadible 0.0.1 → 0.1.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.
- package/README.md +3 -0
- package/bin/arc-check.js +74 -0
- package/bin/arc-default.js +56 -0
- package/bin/arc-deploy.js +86 -0
- package/bin/arc-inspect.js +86 -0
- package/bin/arc-pack.js +93 -0
- package/bin/arc.js +59 -0
- package/npm-shrinkwrap.json +988 -0
- package/package.json +38 -1
- package/src/cmd/check.js +26 -0
- package/src/cmd/deploy.js +22 -0
- package/src/cmd/index.js +12 -0
- package/src/cmd/inspect.js +26 -0
- package/src/cmd/pack.js +24 -0
- package/src/cmd-check/index.js +57 -0
- package/src/cmd-deploy/index.js +43 -0
- package/src/cmd-inspect/index.js +53 -0
- package/src/cmd-pack/index.js +83 -0
- package/src/config/audience.js +5 -0
- package/src/config/game.js +5 -0
- package/src/config/genre.js +22 -0
- package/src/config/input.js +14 -0
- package/src/config/orientation.js +14 -0
- package/src/config/visibility.js +5 -0
- package/src/config/workflow.js +5 -0
- package/src/manifest.js +46 -0
- package/src/media.js +96 -0
- package/src/project.js +62 -0
- package/src/readme.js +144 -0
- package/src/schema/game.js +319 -0
- package/src/schema/workflow.js +117 -0
- package/src/util/arc.js +74 -0
- package/src/util/dom.js +53 -0
- package/src/util/git.js +23 -0
- package/src/util/log.js +99 -0
- package/src/util/md.js +24 -0
- package/src/util/objs.js +26 -0
- package/src/util/promise.js +29 -0
- package/src/util/rc.js +41 -0
- package/src/util/strs.js +21 -0
- package/src/util/zip.js +59 -0
package/README.md
ADDED
package/bin/arc-check.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// [import]
|
|
5
|
+
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [import]
|
|
9
|
+
|
|
10
|
+
const hideBin = require("yargs/helpers").hideBin;
|
|
11
|
+
const yargs = require("yargs/yargs");
|
|
12
|
+
|
|
13
|
+
// [import]
|
|
14
|
+
|
|
15
|
+
const check = require("../src/cmd/check");
|
|
16
|
+
const pkg = require("../package.json");
|
|
17
|
+
const rc = require("../src/util/rc");
|
|
18
|
+
|
|
19
|
+
// [use]
|
|
20
|
+
|
|
21
|
+
const dirname = path.dirname;
|
|
22
|
+
const findRc = rc.findRc;
|
|
23
|
+
const join = path.join;
|
|
24
|
+
const resolve = path.resolve;
|
|
25
|
+
|
|
26
|
+
// [declare]
|
|
27
|
+
|
|
28
|
+
const CMD = "arc";
|
|
29
|
+
const SUBCMD = "check";
|
|
30
|
+
|
|
31
|
+
// [define]
|
|
32
|
+
|
|
33
|
+
const conf = {
|
|
34
|
+
quiet: false,
|
|
35
|
+
...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// [function]
|
|
39
|
+
|
|
40
|
+
const fixBin = function (argv) {
|
|
41
|
+
argv[1] = join(dirname(argv[1]), CMD);
|
|
42
|
+
return hideBin(argv);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// [function]
|
|
46
|
+
|
|
47
|
+
const start = function (cli) {
|
|
48
|
+
const argv = cli.parse();
|
|
49
|
+
check({ quiet: argv.quiet, root: resolve(process.cwd(), argv.cwd) });
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// [start]
|
|
53
|
+
|
|
54
|
+
start(
|
|
55
|
+
yargs(fixBin(process.argv))
|
|
56
|
+
.usage(`${CMD} ${SUBCMD} [options]`)
|
|
57
|
+
.option("quiet", {
|
|
58
|
+
alias: "q",
|
|
59
|
+
default: conf.quiet,
|
|
60
|
+
describe: "Suppress standard output and show only errors.",
|
|
61
|
+
type: "boolean",
|
|
62
|
+
})
|
|
63
|
+
.option("cwd", {
|
|
64
|
+
alias: "C",
|
|
65
|
+
default: ".",
|
|
66
|
+
describe: "Run in the specified path.",
|
|
67
|
+
type: "string",
|
|
68
|
+
})
|
|
69
|
+
.help("help")
|
|
70
|
+
.alias("help", "h")
|
|
71
|
+
.version(pkg.version)
|
|
72
|
+
.alias("version", "v")
|
|
73
|
+
.strict(),
|
|
74
|
+
);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// [import]
|
|
5
|
+
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [import]
|
|
9
|
+
|
|
10
|
+
const hideBin = require("yargs/helpers").hideBin;
|
|
11
|
+
const yargs = require("yargs/yargs");
|
|
12
|
+
|
|
13
|
+
// [import]
|
|
14
|
+
|
|
15
|
+
const pkg = require("../package.json");
|
|
16
|
+
|
|
17
|
+
// [use]
|
|
18
|
+
|
|
19
|
+
const dirname = path.dirname;
|
|
20
|
+
const join = path.join;
|
|
21
|
+
|
|
22
|
+
// [declare]
|
|
23
|
+
|
|
24
|
+
const CMD = "arc";
|
|
25
|
+
|
|
26
|
+
// [function]
|
|
27
|
+
|
|
28
|
+
const fixBin = function (argv) {
|
|
29
|
+
argv[1] = join(dirname(argv[1]), CMD);
|
|
30
|
+
return hideBin(argv);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// [function]
|
|
34
|
+
|
|
35
|
+
const start = function (cli) {
|
|
36
|
+
const argv = cli.parse();
|
|
37
|
+
if (!argv._.length) {
|
|
38
|
+
cli.showHelp();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// [start]
|
|
43
|
+
|
|
44
|
+
start(
|
|
45
|
+
yargs(fixBin(process.argv))
|
|
46
|
+
.usage(`${CMD} <command> [options]`)
|
|
47
|
+
.command("check", "Check workspace for issues.")
|
|
48
|
+
.command("deploy", "Deploy to Arcadible.")
|
|
49
|
+
.command("inspect", "Inspect project details.")
|
|
50
|
+
.command("pack", "Pack for distribution.")
|
|
51
|
+
.help("help")
|
|
52
|
+
.alias("help", "h")
|
|
53
|
+
.version(pkg.version)
|
|
54
|
+
.alias("version", "v")
|
|
55
|
+
.strict(),
|
|
56
|
+
);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// [import]
|
|
5
|
+
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [import]
|
|
9
|
+
|
|
10
|
+
const hideBin = require("yargs/helpers").hideBin;
|
|
11
|
+
const yargs = require("yargs/yargs");
|
|
12
|
+
|
|
13
|
+
// [import]
|
|
14
|
+
|
|
15
|
+
const deploy = require("../src/cmd/deploy");
|
|
16
|
+
const pkg = require("../package.json");
|
|
17
|
+
const rc = require("../src/util/rc");
|
|
18
|
+
|
|
19
|
+
// [use]
|
|
20
|
+
|
|
21
|
+
const dirname = path.dirname;
|
|
22
|
+
const findRc = rc.findRc;
|
|
23
|
+
const join = path.join;
|
|
24
|
+
const resolve = path.resolve;
|
|
25
|
+
|
|
26
|
+
// [declare]
|
|
27
|
+
|
|
28
|
+
const CMD = "arc";
|
|
29
|
+
const SUBCMD = "deploy";
|
|
30
|
+
|
|
31
|
+
// [define]
|
|
32
|
+
|
|
33
|
+
const conf = {
|
|
34
|
+
production: false,
|
|
35
|
+
quiet: false,
|
|
36
|
+
...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// [function]
|
|
40
|
+
|
|
41
|
+
const fixBin = function (argv) {
|
|
42
|
+
argv[1] = join(dirname(argv[1]), CMD);
|
|
43
|
+
return hideBin(argv);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// [function]
|
|
47
|
+
|
|
48
|
+
const start = function (cli) {
|
|
49
|
+
const argv = cli.parse();
|
|
50
|
+
deploy({
|
|
51
|
+
pre: !argv.production,
|
|
52
|
+
preId: "rc",
|
|
53
|
+
quiet: argv.quiet,
|
|
54
|
+
root: resolve(process.cwd(), argv.cwd),
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// [start]
|
|
59
|
+
|
|
60
|
+
start(
|
|
61
|
+
yargs(fixBin(process.argv))
|
|
62
|
+
.usage(`${CMD} ${SUBCMD} [options]`)
|
|
63
|
+
.option("production", {
|
|
64
|
+
alias: "p",
|
|
65
|
+
default: conf.production,
|
|
66
|
+
describe: "Deploy to production.",
|
|
67
|
+
type: "boolean",
|
|
68
|
+
})
|
|
69
|
+
.option("quiet", {
|
|
70
|
+
alias: "q",
|
|
71
|
+
default: conf.quiet,
|
|
72
|
+
describe: "Suppress standard output and show only errors.",
|
|
73
|
+
type: "boolean",
|
|
74
|
+
})
|
|
75
|
+
.option("cwd", {
|
|
76
|
+
alias: "C",
|
|
77
|
+
default: ".",
|
|
78
|
+
describe: "Run in the specified path.",
|
|
79
|
+
type: "string",
|
|
80
|
+
})
|
|
81
|
+
.help("help")
|
|
82
|
+
.alias("help", "h")
|
|
83
|
+
.version(pkg.version)
|
|
84
|
+
.alias("version", "v")
|
|
85
|
+
.strict(),
|
|
86
|
+
);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// [import]
|
|
5
|
+
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [import]
|
|
9
|
+
|
|
10
|
+
const hideBin = require("yargs/helpers").hideBin;
|
|
11
|
+
const yargs = require("yargs/yargs");
|
|
12
|
+
|
|
13
|
+
// [import]
|
|
14
|
+
|
|
15
|
+
const inspect = require("../src/cmd/inspect");
|
|
16
|
+
const pkg = require("../package.json");
|
|
17
|
+
const rc = require("../src/util/rc");
|
|
18
|
+
|
|
19
|
+
// [use]
|
|
20
|
+
|
|
21
|
+
const dirname = path.dirname;
|
|
22
|
+
const findRc = rc.findRc;
|
|
23
|
+
const join = path.join;
|
|
24
|
+
const resolve = path.resolve;
|
|
25
|
+
|
|
26
|
+
// [declare]
|
|
27
|
+
|
|
28
|
+
const CMD = "arc";
|
|
29
|
+
const SUBCMD = "inspect";
|
|
30
|
+
|
|
31
|
+
// [define]
|
|
32
|
+
|
|
33
|
+
const conf = {
|
|
34
|
+
json: false,
|
|
35
|
+
topic: "manifest",
|
|
36
|
+
...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// [function]
|
|
40
|
+
|
|
41
|
+
const fixBin = function (argv) {
|
|
42
|
+
argv[1] = join(dirname(argv[1]), CMD);
|
|
43
|
+
return hideBin(argv);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// [function]
|
|
47
|
+
|
|
48
|
+
const start = function (cli) {
|
|
49
|
+
const argv = cli.parse();
|
|
50
|
+
inspect({
|
|
51
|
+
json: argv.json,
|
|
52
|
+
root: resolve(process.cwd(), argv.cwd),
|
|
53
|
+
topic: argv.topic,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// [start]
|
|
58
|
+
|
|
59
|
+
start(
|
|
60
|
+
yargs(fixBin(process.argv))
|
|
61
|
+
.usage(`${CMD} ${SUBCMD} [options]`)
|
|
62
|
+
.option("topic", {
|
|
63
|
+
alias: "t",
|
|
64
|
+
choices: ["manifest", "manifest:game", "manifest:workflow"],
|
|
65
|
+
default: conf.topic,
|
|
66
|
+
describe: "Output details about a topic.",
|
|
67
|
+
type: "string",
|
|
68
|
+
})
|
|
69
|
+
.option("json", {
|
|
70
|
+
alias: "j",
|
|
71
|
+
default: conf.json,
|
|
72
|
+
describe: "Format standard output in JSON.",
|
|
73
|
+
type: "boolean",
|
|
74
|
+
})
|
|
75
|
+
.option("cwd", {
|
|
76
|
+
alias: "C",
|
|
77
|
+
default: ".",
|
|
78
|
+
describe: "Run in the specified path.",
|
|
79
|
+
type: "string",
|
|
80
|
+
})
|
|
81
|
+
.help("help")
|
|
82
|
+
.alias("help", "h")
|
|
83
|
+
.version(pkg.version)
|
|
84
|
+
.alias("version", "v")
|
|
85
|
+
.strict(),
|
|
86
|
+
);
|
package/bin/arc-pack.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// [import]
|
|
5
|
+
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
// [import]
|
|
9
|
+
|
|
10
|
+
const hideBin = require("yargs/helpers").hideBin;
|
|
11
|
+
const yargs = require("yargs/yargs");
|
|
12
|
+
|
|
13
|
+
// [import]
|
|
14
|
+
|
|
15
|
+
const pack = require("../src/cmd/pack");
|
|
16
|
+
const pkg = require("../package.json");
|
|
17
|
+
const rc = require("../src/util/rc");
|
|
18
|
+
|
|
19
|
+
// [use]
|
|
20
|
+
|
|
21
|
+
const dirname = path.dirname;
|
|
22
|
+
const findRc = rc.findRc;
|
|
23
|
+
const join = path.join;
|
|
24
|
+
const resolve = path.resolve;
|
|
25
|
+
|
|
26
|
+
// [declare]
|
|
27
|
+
|
|
28
|
+
const CMD = "arc";
|
|
29
|
+
const SUBCMD = "pack";
|
|
30
|
+
|
|
31
|
+
// [define]
|
|
32
|
+
|
|
33
|
+
const conf = {
|
|
34
|
+
json: false,
|
|
35
|
+
out: "package.zip",
|
|
36
|
+
quiet: false,
|
|
37
|
+
...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// [function]
|
|
41
|
+
|
|
42
|
+
const fixBin = function (argv) {
|
|
43
|
+
argv[1] = join(dirname(argv[1]), CMD);
|
|
44
|
+
return hideBin(argv);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// [function]
|
|
48
|
+
|
|
49
|
+
const start = function (cli) {
|
|
50
|
+
const argv = cli.parse();
|
|
51
|
+
pack({
|
|
52
|
+
json: argv.json,
|
|
53
|
+
out: argv.out,
|
|
54
|
+
quiet: argv.quiet,
|
|
55
|
+
root: resolve(process.cwd(), argv.cwd),
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// [start]
|
|
60
|
+
|
|
61
|
+
start(
|
|
62
|
+
yargs(fixBin(process.argv))
|
|
63
|
+
.usage(`${CMD} ${SUBCMD} [options]`)
|
|
64
|
+
.option("out", {
|
|
65
|
+
alias: "o",
|
|
66
|
+
default: conf.out,
|
|
67
|
+
describe: "Write to the specified path.",
|
|
68
|
+
type: "string",
|
|
69
|
+
})
|
|
70
|
+
.option("json", {
|
|
71
|
+
alias: "j",
|
|
72
|
+
default: conf.json,
|
|
73
|
+
describe: "Format standard output in JSON.",
|
|
74
|
+
type: "boolean",
|
|
75
|
+
})
|
|
76
|
+
.option("quiet", {
|
|
77
|
+
alias: "q",
|
|
78
|
+
default: conf.quiet,
|
|
79
|
+
describe: "Suppress standard output and show only errors.",
|
|
80
|
+
type: "boolean",
|
|
81
|
+
})
|
|
82
|
+
.option("cwd", {
|
|
83
|
+
alias: "C",
|
|
84
|
+
default: ".",
|
|
85
|
+
describe: "Run in the specified path.",
|
|
86
|
+
type: "string",
|
|
87
|
+
})
|
|
88
|
+
.help("help")
|
|
89
|
+
.alias("help", "h")
|
|
90
|
+
.version(pkg.version)
|
|
91
|
+
.alias("version", "v")
|
|
92
|
+
.strict(),
|
|
93
|
+
);
|
package/bin/arc.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// [import]
|
|
5
|
+
|
|
6
|
+
const fs = require("fs-extra");
|
|
7
|
+
|
|
8
|
+
// [import]
|
|
9
|
+
|
|
10
|
+
const log = require("../src/util/log");
|
|
11
|
+
const pkg = require("../package.json");
|
|
12
|
+
|
|
13
|
+
// [use]
|
|
14
|
+
|
|
15
|
+
const pathExists = fs.pathExists;
|
|
16
|
+
|
|
17
|
+
// [declare]
|
|
18
|
+
|
|
19
|
+
const CMD = "arc";
|
|
20
|
+
|
|
21
|
+
// [function]
|
|
22
|
+
|
|
23
|
+
const fixBin = function (argv) {
|
|
24
|
+
const subcmds = Object.keys(pkg.bin)
|
|
25
|
+
.filter((key) => key !== CMD)
|
|
26
|
+
.map((key) => key.slice(CMD.length + 1));
|
|
27
|
+
if (!subcmds.includes(argv[2])) {
|
|
28
|
+
argv.splice(2, 0, "default");
|
|
29
|
+
}
|
|
30
|
+
return argv;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// [function]
|
|
34
|
+
|
|
35
|
+
const normalize = function (argv) {
|
|
36
|
+
argv[1] = argv[1].endsWith(".js")
|
|
37
|
+
? argv[1].replace(/\.js$/u, `-${argv[2]}.js`)
|
|
38
|
+
: argv[1].concat(`-${argv[2]}`);
|
|
39
|
+
argv.splice(2, 1);
|
|
40
|
+
return argv;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// [function]
|
|
44
|
+
|
|
45
|
+
const start = function (argv, cb) {
|
|
46
|
+
const args = normalize(fixBin(argv));
|
|
47
|
+
pathExists(args[1], (err, exists) => {
|
|
48
|
+
if (err || !exists) {
|
|
49
|
+
log.hd("Command aborted.");
|
|
50
|
+
log.pdnl(`Unable to find: ${args[1]}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
cb(args[1]);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// [start]
|
|
58
|
+
|
|
59
|
+
start(process.argv, require);
|