arcadible 0.1.45 → 0.1.46
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 +9 -17
- package/bin/arc-deploy.js +20 -36
- package/bin/arc-init.js +6 -16
- package/bin/arc-inspect.js +3 -7
- package/bin/arc-login.js +5 -5
- package/bin/arc-logout.js +4 -8
- package/bin/arc-open.js +7 -20
- package/bin/arc-pack.js +4 -14
- package/bin/arc-play.js +6 -20
- package/bin/arc-validate.js +8 -17
- package/bin/arc-whoami.js +5 -9
- package/bin/arc.js +7 -2
- package/package.json +1 -1
- package/src/account.js +5 -5
- package/src/action/build/tool.js +8 -15
- package/src/action/deploy/tool-git.js +1 -6
- package/src/action/deploy/wait.js +5 -11
- package/src/action/init/manifest.js +9 -37
- package/src/action/login/flow.js +3 -10
- package/src/action/open/tool.js +2 -1
- package/src/action/pack/limits.js +4 -6
- package/src/action/pack/tool.js +6 -5
- package/src/action/play/tool.js +3 -3
- package/src/action/predeploy/ac.js +28 -43
- package/src/action/predeploy/git.js +4 -4
- package/src/action/predeploy/pm.js +1 -1
- package/src/action/predeploy/published.js +4 -4
- package/src/action/predeploy/tool-git.js +10 -10
- package/src/action/validate/unknown.js +11 -10
- package/src/config/file.js +23 -0
- package/src/config/limit.js +21 -0
- package/src/parser/env.js +0 -2
- package/src/parser/manifest.js +15 -13
- package/src/parser/media.js +9 -11
- package/src/parser/project.js +31 -9
- package/src/phrase.js +168 -39
- package/src/schema/game.js +65 -42
- package/src/schema/workflow.js +7 -8
- package/src/util/argv.js +27 -1
- package/src/util/command.js +18 -0
- package/src/util/delay.js +5 -21
- package/src/util/doc.js +4 -13
- package/src/util/links.js +17 -2
- package/src/util/media.js +2 -2
- package/src/util/objs.js +8 -1
- package/src/util/output.js +24 -2
- package/src/util/rc.js +2 -2
- package/src/util/request.js +1 -1
- package/src/util/s3.js +1 -1
- package/src/util/schema.js +9 -3
- package/src/util/uris.js +1 -1
- package/src/util/zip.js +2 -2
- package/src/config/doc.js +0 -7
package/bin/arc-build.js
CHANGED
|
@@ -104,20 +104,22 @@ const start = function (argv) {
|
|
|
104
104
|
// the heading says what happened: built, built without deploy_dir
|
|
105
105
|
// (a caveat, so yellow), or no build to run.
|
|
106
106
|
if (artifact?.path) {
|
|
107
|
-
log.hs(
|
|
107
|
+
log.hs(phrase.buildSucceeded());
|
|
108
108
|
print(artifact, { nl: true, toml: true });
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
if (artifact?.missing) {
|
|
112
|
-
log.result(
|
|
113
|
-
log.nlpw(
|
|
112
|
+
log.result(phrase.buildSucceeded(), [], { color: "yellow" });
|
|
113
|
+
log.nlpw(
|
|
114
|
+
`⚠ ${phrase.buildOutputMissing(relative(root, artifact.missing))}`,
|
|
115
|
+
);
|
|
114
116
|
return;
|
|
115
117
|
}
|
|
116
|
-
log.hs(
|
|
118
|
+
log.hs(phrase.nothingToDo());
|
|
117
119
|
}
|
|
118
120
|
})
|
|
119
121
|
.catch((ex) =>
|
|
120
|
-
abort(
|
|
122
|
+
abort(phrase.aborted(COMMAND), ex, { data: { warnings }, json, sw }),
|
|
121
123
|
);
|
|
122
124
|
};
|
|
123
125
|
|
|
@@ -128,18 +130,8 @@ const main = function (argv) {
|
|
|
128
130
|
yargs(args.normalize(hideBin(argv)))
|
|
129
131
|
.scriptName(`${TOOL} ${COMMAND}`)
|
|
130
132
|
.usage("$0 [options]")
|
|
131
|
-
.option("json", {
|
|
132
|
-
|
|
133
|
-
default: conf.json,
|
|
134
|
-
describe: "Format output as JSON",
|
|
135
|
-
type: "boolean",
|
|
136
|
-
})
|
|
137
|
-
.option("quiet", {
|
|
138
|
-
alias: "q",
|
|
139
|
-
default: conf.quiet,
|
|
140
|
-
describe: "Output only errors",
|
|
141
|
-
type: "boolean",
|
|
142
|
-
})
|
|
133
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
134
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
143
135
|
.option("cwd", args.CWD)
|
|
144
136
|
.help("help")
|
|
145
137
|
.alias("help", "h")
|
package/bin/arc-deploy.js
CHANGED
|
@@ -72,33 +72,13 @@ const handler = function ({ json, pb, quiet, sw, warnings }) {
|
|
|
72
72
|
return {
|
|
73
73
|
onAccountRefresh(refresh) {
|
|
74
74
|
sw.start(json || quiet);
|
|
75
|
-
return refresh(
|
|
75
|
+
return refresh();
|
|
76
76
|
},
|
|
77
77
|
onDeployBegin() {
|
|
78
78
|
if (!json && !quiet && pb) {
|
|
79
79
|
pb.start();
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
onLogInfo({ code, level, message }) {
|
|
83
|
-
if (code) {
|
|
84
|
-
warnings.push(warning(code, message));
|
|
85
|
-
}
|
|
86
|
-
if (!json && !quiet) {
|
|
87
|
-
switch (level) {
|
|
88
|
-
case "warn":
|
|
89
|
-
sw.stop(true);
|
|
90
|
-
if (pb) {
|
|
91
|
-
pb.stop();
|
|
92
|
-
}
|
|
93
|
-
log.pw(`⚠ ${message}`);
|
|
94
|
-
sw.start(json || quiet);
|
|
95
|
-
if (pb) {
|
|
96
|
-
pb.start();
|
|
97
|
-
}
|
|
98
|
-
// no default
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
82
|
onPredeployBegin() {
|
|
103
83
|
sw.start(json || quiet);
|
|
104
84
|
},
|
|
@@ -109,6 +89,20 @@ const handler = function ({ json, pb, quiet, sw, warnings }) {
|
|
|
109
89
|
}
|
|
110
90
|
}
|
|
111
91
|
},
|
|
92
|
+
onWarning({ code, message }) {
|
|
93
|
+
warnings.push(warning(code, message));
|
|
94
|
+
if (!json && !quiet) {
|
|
95
|
+
sw.stop(true);
|
|
96
|
+
if (pb) {
|
|
97
|
+
pb.stop();
|
|
98
|
+
}
|
|
99
|
+
log.pw(`⚠ ${message}`);
|
|
100
|
+
sw.start(false);
|
|
101
|
+
if (pb) {
|
|
102
|
+
pb.start();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
112
106
|
};
|
|
113
107
|
};
|
|
114
108
|
|
|
@@ -205,7 +199,7 @@ const waitAndReport = async function (
|
|
|
205
199
|
git,
|
|
206
200
|
studio,
|
|
207
201
|
});
|
|
208
|
-
abort(
|
|
202
|
+
abort(phrase.waitTimedOut(), new ArcError(cfgcode.WAIT_TIMED_OUT, reason), {
|
|
209
203
|
data,
|
|
210
204
|
json,
|
|
211
205
|
sw,
|
|
@@ -214,7 +208,7 @@ const waitAndReport = async function (
|
|
|
214
208
|
}
|
|
215
209
|
if (release.status === "failed") {
|
|
216
210
|
const reason = phrase.releaseFailed(release, studio);
|
|
217
|
-
abort(
|
|
211
|
+
abort(phrase.releaseFailedHeading(), new Error(reason), {
|
|
218
212
|
code: release.reason ?? cfgcode.INTERNAL,
|
|
219
213
|
data,
|
|
220
214
|
json,
|
|
@@ -408,7 +402,7 @@ const start = function (argv) {
|
|
|
408
402
|
return null;
|
|
409
403
|
})
|
|
410
404
|
.catch((ex) =>
|
|
411
|
-
abort(
|
|
405
|
+
abort(phrase.aborted(COMMAND), ex, { data: { warnings }, json, pb, sw }),
|
|
412
406
|
);
|
|
413
407
|
};
|
|
414
408
|
|
|
@@ -427,18 +421,8 @@ const main = function (argv) {
|
|
|
427
421
|
type: "string",
|
|
428
422
|
}),
|
|
429
423
|
)
|
|
430
|
-
.option("json", {
|
|
431
|
-
|
|
432
|
-
default: conf.json,
|
|
433
|
-
describe: "Format output as JSON",
|
|
434
|
-
type: "boolean",
|
|
435
|
-
})
|
|
436
|
-
.option("quiet", {
|
|
437
|
-
alias: "q",
|
|
438
|
-
default: conf.quiet,
|
|
439
|
-
describe: "Output only errors",
|
|
440
|
-
type: "boolean",
|
|
441
|
-
})
|
|
424
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
425
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
442
426
|
.option("wait", {
|
|
443
427
|
alias: "w",
|
|
444
428
|
default: conf.wait,
|
package/bin/arc-init.js
CHANGED
|
@@ -82,13 +82,13 @@ const start = function (argv) {
|
|
|
82
82
|
print({ project });
|
|
83
83
|
} else if (!quiet) {
|
|
84
84
|
sw.stop(true);
|
|
85
|
-
log.hs(
|
|
85
|
+
log.hs(phrase.initialized());
|
|
86
86
|
print(project, { nl: true, toml: true });
|
|
87
87
|
}
|
|
88
88
|
// degit sometimes hangs, so exit once stdout is written.
|
|
89
89
|
process.stdout.write("", () => process.exit(0));
|
|
90
90
|
})
|
|
91
|
-
.catch((ex) => abort(
|
|
91
|
+
.catch((ex) => abort(phrase.aborted(COMMAND), ex, { json, sw }));
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
// [function]
|
|
@@ -110,7 +110,7 @@ const prompt = async function ({ yes, ...argv }) {
|
|
|
110
110
|
if (!opts.template) {
|
|
111
111
|
// without a terminal, the prompt would read end-of-input and exit.
|
|
112
112
|
if (!process.stdin.isTTY) {
|
|
113
|
-
throw new ArcError(cfgcode.TEMPLATE_MISSING, phrase.
|
|
113
|
+
throw new ArcError(cfgcode.TEMPLATE_MISSING, phrase.templateMissing());
|
|
114
114
|
}
|
|
115
115
|
opts.template = await select(cfgtemplate);
|
|
116
116
|
}
|
|
@@ -126,7 +126,7 @@ const inquire = function (argv) {
|
|
|
126
126
|
if (ex?.name === "ExitPromptError") {
|
|
127
127
|
process.exit(130);
|
|
128
128
|
}
|
|
129
|
-
abort(
|
|
129
|
+
abort(phrase.aborted(COMMAND), ex, { json: argv.json });
|
|
130
130
|
});
|
|
131
131
|
};
|
|
132
132
|
|
|
@@ -159,18 +159,8 @@ const main = function (argv) {
|
|
|
159
159
|
describe: "Accept prompt defaults",
|
|
160
160
|
type: "boolean",
|
|
161
161
|
})
|
|
162
|
-
.option("json", {
|
|
163
|
-
|
|
164
|
-
default: conf.json,
|
|
165
|
-
describe: "Format output as JSON",
|
|
166
|
-
type: "boolean",
|
|
167
|
-
})
|
|
168
|
-
.option("quiet", {
|
|
169
|
-
alias: "q",
|
|
170
|
-
default: conf.quiet,
|
|
171
|
-
describe: "Output only errors",
|
|
172
|
-
type: "boolean",
|
|
173
|
-
})
|
|
162
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
163
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
174
164
|
.option("cwd", args.CWD)
|
|
175
165
|
.help("help")
|
|
176
166
|
.alias("help", "h")
|
package/bin/arc-inspect.js
CHANGED
|
@@ -17,6 +17,7 @@ const cfgpackage = require("../src/config/package");
|
|
|
17
17
|
const cfgproduct = require("../src/config/product");
|
|
18
18
|
const inspect = require("../src/cli/inspect");
|
|
19
19
|
const output = require("../src/util/output");
|
|
20
|
+
const phrase = require("../src/phrase");
|
|
20
21
|
const rc = require("../src/util/rc");
|
|
21
22
|
|
|
22
23
|
// [use]
|
|
@@ -56,7 +57,7 @@ const start = function (argv) {
|
|
|
56
57
|
}
|
|
57
58
|
print(data, { key: selector, toml: true });
|
|
58
59
|
})
|
|
59
|
-
.catch((ex) => abort(
|
|
60
|
+
.catch((ex) => abort(phrase.aborted(COMMAND), ex, { json }));
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
// [function]
|
|
@@ -73,12 +74,7 @@ const main = function (argv) {
|
|
|
73
74
|
type: "string",
|
|
74
75
|
}),
|
|
75
76
|
)
|
|
76
|
-
.option("json", {
|
|
77
|
-
alias: "j",
|
|
78
|
-
default: conf.json,
|
|
79
|
-
describe: "Format output as JSON",
|
|
80
|
-
type: "boolean",
|
|
81
|
-
})
|
|
77
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
82
78
|
.option("cwd", args.CWD)
|
|
83
79
|
.help("help")
|
|
84
80
|
.alias("help", "h")
|
package/bin/arc-login.js
CHANGED
|
@@ -80,7 +80,7 @@ const handler = function ({ browser, qrcode: qr, shown, sw }) {
|
|
|
80
80
|
sw.stop(true);
|
|
81
81
|
shown.link = true;
|
|
82
82
|
const link = `${url}/${secret}`;
|
|
83
|
-
log.p(
|
|
83
|
+
log.p(phrase.loggingIn());
|
|
84
84
|
qrcode.generate(link, { small: true }, (code) => {
|
|
85
85
|
if (qr) {
|
|
86
86
|
log.p(code);
|
|
@@ -89,7 +89,7 @@ const handler = function ({ browser, qrcode: qr, shown, sw }) {
|
|
|
89
89
|
log.h(dac.toUpperCase());
|
|
90
90
|
// a key press can only be read from a terminal.
|
|
91
91
|
if (browser && process.stdin.isTTY) {
|
|
92
|
-
log.nlp(
|
|
92
|
+
log.nlp(phrase.pressEnterToOpen());
|
|
93
93
|
onLoginEnter(() => {
|
|
94
94
|
launch(link);
|
|
95
95
|
});
|
|
@@ -116,15 +116,15 @@ const start = function (argv) {
|
|
|
116
116
|
.then((current) => {
|
|
117
117
|
const user = current?.user;
|
|
118
118
|
if (!user) {
|
|
119
|
-
throw new ArcError(cfgcode.
|
|
119
|
+
throw new ArcError(cfgcode.LOGIN_FAILED, phrase.loginFailed());
|
|
120
120
|
}
|
|
121
121
|
sw.stop(true);
|
|
122
122
|
process.stdin.pause();
|
|
123
|
-
log.result(
|
|
123
|
+
log.result(phrase.loggedIn(), [user.display_name], { nl: true });
|
|
124
124
|
})
|
|
125
125
|
.catch((ex) => {
|
|
126
126
|
process.stdin.pause();
|
|
127
|
-
abort(
|
|
127
|
+
abort(phrase.aborted(COMMAND), ex, { nl: shown.link, sw });
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
|
package/bin/arc-logout.js
CHANGED
|
@@ -14,6 +14,7 @@ const cfgproduct = require("../src/config/product");
|
|
|
14
14
|
const log = require("../src/util/log");
|
|
15
15
|
const logout = require("../src/cli/logout");
|
|
16
16
|
const output = require("../src/util/output");
|
|
17
|
+
const phrase = require("../src/phrase");
|
|
17
18
|
const rc = require("../src/util/rc");
|
|
18
19
|
|
|
19
20
|
// [use]
|
|
@@ -40,10 +41,10 @@ const start = function (argv) {
|
|
|
40
41
|
return logout()
|
|
41
42
|
.then(() => {
|
|
42
43
|
if (!argv.quiet) {
|
|
43
|
-
log.hs(
|
|
44
|
+
log.hs(phrase.loggedOut());
|
|
44
45
|
}
|
|
45
46
|
})
|
|
46
|
-
.catch((ex) => abort(
|
|
47
|
+
.catch((ex) => abort(phrase.aborted(COMMAND), ex));
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
// [function]
|
|
@@ -53,12 +54,7 @@ const main = function (argv) {
|
|
|
53
54
|
yargs(args.normalize(hideBin(argv)))
|
|
54
55
|
.scriptName(`${TOOL} ${COMMAND}`)
|
|
55
56
|
.usage("$0 [options]")
|
|
56
|
-
.option("quiet", {
|
|
57
|
-
alias: "q",
|
|
58
|
-
default: conf.quiet,
|
|
59
|
-
describe: "Output only errors",
|
|
60
|
-
type: "boolean",
|
|
61
|
-
})
|
|
57
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
62
58
|
.help("help")
|
|
63
59
|
.alias("help", "h")
|
|
64
60
|
.version(VERSION)
|
package/bin/arc-open.js
CHANGED
|
@@ -18,7 +18,6 @@ const cfgpackage = require("../src/config/package");
|
|
|
18
18
|
const cfgproduct = require("../src/config/product");
|
|
19
19
|
const cfguri = require("../src/config/uri");
|
|
20
20
|
const error = require("../src/util/error");
|
|
21
|
-
const log = require("../src/util/log");
|
|
22
21
|
const open = require("../src/cli/open");
|
|
23
22
|
const output = require("../src/util/output");
|
|
24
23
|
const phrase = require("../src/phrase");
|
|
@@ -31,6 +30,7 @@ const abort = output.abort;
|
|
|
31
30
|
const ArcError = error.ArcError;
|
|
32
31
|
const findRc = rc.findRc;
|
|
33
32
|
const launch = shell.launch;
|
|
33
|
+
const launched = output.launched;
|
|
34
34
|
const resolve = path.resolve;
|
|
35
35
|
|
|
36
36
|
// [declare]
|
|
@@ -55,26 +55,17 @@ const start = function (argv) {
|
|
|
55
55
|
root: resolve(process.cwd(), argv.cwd),
|
|
56
56
|
})
|
|
57
57
|
.then((data) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
throw new ArcError(cfgcode.GAME_ID_MISSING, phrase.noGameId());
|
|
58
|
+
if (!data) {
|
|
59
|
+
throw new ArcError(cfgcode.GAME_ID_MISSING, phrase.gameIdMissing());
|
|
61
60
|
}
|
|
62
|
-
const url =
|
|
61
|
+
const { page, url } = data;
|
|
63
62
|
const opening = argv.browser
|
|
64
63
|
? launch(url)
|
|
65
64
|
: launch(`${cfguri.HOST_APP_STORE}${page}`, url);
|
|
66
65
|
return Promise.all([opening, url]);
|
|
67
66
|
})
|
|
68
|
-
.then(([where, url]) =>
|
|
69
|
-
|
|
70
|
-
log.result(phrase.opened(where), [url]);
|
|
71
|
-
} else {
|
|
72
|
-
log.result(phrase.unableToOpen(), [url, phrase.openToContinue()], {
|
|
73
|
-
color: "yellow",
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
.catch((ex) => abort("Open aborted.", ex));
|
|
67
|
+
.then(([where, url]) => launched(where, url))
|
|
68
|
+
.catch((ex) => abort(phrase.aborted(COMMAND), ex));
|
|
78
69
|
};
|
|
79
70
|
|
|
80
71
|
// [function]
|
|
@@ -91,11 +82,7 @@ const main = function (argv) {
|
|
|
91
82
|
type: "string",
|
|
92
83
|
}),
|
|
93
84
|
)
|
|
94
|
-
.option("browser", {
|
|
95
|
-
default: conf.browser,
|
|
96
|
-
describe: "Open in a web browser",
|
|
97
|
-
type: "boolean",
|
|
98
|
-
})
|
|
85
|
+
.option("browser", { ...args.BROWSER, default: conf.browser })
|
|
99
86
|
.option("cwd", args.CWD)
|
|
100
87
|
.help("help")
|
|
101
88
|
.alias("help", "h")
|
package/bin/arc-pack.js
CHANGED
|
@@ -97,12 +97,12 @@ const start = function (argv) {
|
|
|
97
97
|
}
|
|
98
98
|
if (!quiet) {
|
|
99
99
|
sw.stop(true);
|
|
100
|
-
log.hs(
|
|
100
|
+
log.hs(phrase.packed());
|
|
101
101
|
print(artifact, { nl: true, toml: true });
|
|
102
102
|
}
|
|
103
103
|
})
|
|
104
104
|
.catch((ex) =>
|
|
105
|
-
abort(
|
|
105
|
+
abort(phrase.aborted(COMMAND), ex, { data: { warnings }, json, sw }),
|
|
106
106
|
);
|
|
107
107
|
};
|
|
108
108
|
|
|
@@ -125,18 +125,8 @@ const main = function (argv) {
|
|
|
125
125
|
describe: "Set the output file",
|
|
126
126
|
type: "string",
|
|
127
127
|
})
|
|
128
|
-
.option("json", {
|
|
129
|
-
|
|
130
|
-
default: conf.json,
|
|
131
|
-
describe: "Format output as JSON",
|
|
132
|
-
type: "boolean",
|
|
133
|
-
})
|
|
134
|
-
.option("quiet", {
|
|
135
|
-
alias: "q",
|
|
136
|
-
default: conf.quiet,
|
|
137
|
-
describe: "Output only errors",
|
|
138
|
-
type: "boolean",
|
|
139
|
-
})
|
|
128
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
129
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
140
130
|
.option("cwd", args.CWD)
|
|
141
131
|
.help("help")
|
|
142
132
|
.alias("help", "h")
|
package/bin/arc-play.js
CHANGED
|
@@ -32,6 +32,7 @@ const abort = output.abort;
|
|
|
32
32
|
const ArcError = error.ArcError;
|
|
33
33
|
const findRc = rc.findRc;
|
|
34
34
|
const launch = shell.launch;
|
|
35
|
+
const launched = output.launched;
|
|
35
36
|
const resolve = path.resolve;
|
|
36
37
|
const SpinnerWheel = spinner.SpinnerWheel;
|
|
37
38
|
|
|
@@ -74,7 +75,7 @@ const start = function (argv) {
|
|
|
74
75
|
const orientation = data?.orientation;
|
|
75
76
|
const url = data?.url;
|
|
76
77
|
if (!orientation || !url) {
|
|
77
|
-
throw new ArcError(cfgcode.GAME_ID_MISSING, phrase.
|
|
78
|
+
throw new ArcError(cfgcode.GAME_ID_MISSING, phrase.gameIdMissing());
|
|
78
79
|
}
|
|
79
80
|
sw.stop(true);
|
|
80
81
|
if (data.fallback && !argv.quiet) {
|
|
@@ -87,16 +88,10 @@ const start = function (argv) {
|
|
|
87
88
|
})
|
|
88
89
|
.then(([where, url]) => {
|
|
89
90
|
if (!argv.quiet) {
|
|
90
|
-
|
|
91
|
-
log.result(phrase.opened(where), [url]);
|
|
92
|
-
} else {
|
|
93
|
-
log.result(phrase.unableToOpen(), [url, phrase.openToContinue()], {
|
|
94
|
-
color: "yellow",
|
|
95
|
-
});
|
|
96
|
-
}
|
|
91
|
+
launched(where, url);
|
|
97
92
|
}
|
|
98
93
|
})
|
|
99
|
-
.catch((ex) => abort(
|
|
94
|
+
.catch((ex) => abort(phrase.aborted(COMMAND), ex, { sw }));
|
|
100
95
|
};
|
|
101
96
|
|
|
102
97
|
// [function]
|
|
@@ -122,17 +117,8 @@ const main = function (argv) {
|
|
|
122
117
|
describe: "Release channel or version",
|
|
123
118
|
type: "string",
|
|
124
119
|
})
|
|
125
|
-
.option("browser", {
|
|
126
|
-
|
|
127
|
-
describe: "Open in a web browser",
|
|
128
|
-
type: "boolean",
|
|
129
|
-
})
|
|
130
|
-
.option("quiet", {
|
|
131
|
-
alias: "q",
|
|
132
|
-
default: conf.quiet,
|
|
133
|
-
describe: "Output only errors",
|
|
134
|
-
type: "boolean",
|
|
135
|
-
})
|
|
120
|
+
.option("browser", { ...args.BROWSER, default: conf.browser })
|
|
121
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
136
122
|
.option("cwd", args.CWD)
|
|
137
123
|
.help("help")
|
|
138
124
|
.alias("help", "h")
|
package/bin/arc-validate.js
CHANGED
|
@@ -17,6 +17,7 @@ const cfgpackage = require("../src/config/package");
|
|
|
17
17
|
const cfgproduct = require("../src/config/product");
|
|
18
18
|
const log = require("../src/util/log");
|
|
19
19
|
const output = require("../src/util/output");
|
|
20
|
+
const phrase = require("../src/phrase");
|
|
20
21
|
const rc = require("../src/util/rc");
|
|
21
22
|
const schema = require("../src/util/schema");
|
|
22
23
|
const validate = require("../src/cli/validate");
|
|
@@ -57,26 +58,26 @@ const start = function (argv) {
|
|
|
57
58
|
const [probs, refs] = dereference(issues);
|
|
58
59
|
const probcount = probs.length;
|
|
59
60
|
if (probcount) {
|
|
60
|
-
log.hdo(
|
|
61
|
+
log.hdo(phrase.listed(probcount, "issue"));
|
|
61
62
|
log.p(probs.map((prob) => `✗ ${prob}`));
|
|
62
63
|
}
|
|
63
64
|
const warncount = argv.quiet ? 0 : warnings.length;
|
|
64
65
|
if (warncount) {
|
|
65
|
-
log.hwo(
|
|
66
|
+
log.hwo(phrase.listed(warncount, "warning"));
|
|
66
67
|
log.p(warnings.map((each) => `⚠ ${schemaPrint(each)}`));
|
|
67
68
|
}
|
|
68
69
|
const refcount = refs.length;
|
|
69
70
|
if (refcount) {
|
|
70
|
-
log.h(
|
|
71
|
+
log.h(phrase.listed(refcount, "reference"));
|
|
71
72
|
log.p(refs);
|
|
72
73
|
}
|
|
73
74
|
if (!count && !argv.quiet) {
|
|
74
|
-
log.hs(
|
|
75
|
+
log.hs(phrase.noIssuesFound());
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
process.exit(count ? 1 : 0);
|
|
78
79
|
})
|
|
79
|
-
.catch((ex) => abort(
|
|
80
|
+
.catch((ex) => abort(phrase.aborted(COMMAND), ex, { json }));
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
// [function]
|
|
@@ -86,18 +87,8 @@ const main = function (argv) {
|
|
|
86
87
|
yargs(args.normalize(hideBin(argv)))
|
|
87
88
|
.scriptName(`${TOOL} ${COMMAND}`)
|
|
88
89
|
.usage("$0 [options]")
|
|
89
|
-
.option("json", {
|
|
90
|
-
|
|
91
|
-
default: conf.json,
|
|
92
|
-
describe: "Format output as JSON",
|
|
93
|
-
type: "boolean",
|
|
94
|
-
})
|
|
95
|
-
.option("quiet", {
|
|
96
|
-
alias: "q",
|
|
97
|
-
default: conf.quiet,
|
|
98
|
-
describe: "Output only errors",
|
|
99
|
-
type: "boolean",
|
|
100
|
-
})
|
|
90
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
91
|
+
.option("quiet", { ...args.QUIET, default: conf.quiet })
|
|
101
92
|
.option("cwd", args.CWD)
|
|
102
93
|
.help("help")
|
|
103
94
|
.alias("help", "h")
|
package/bin/arc-whoami.js
CHANGED
|
@@ -14,6 +14,7 @@ const cfgpackage = require("../src/config/package");
|
|
|
14
14
|
const cfgproduct = require("../src/config/product");
|
|
15
15
|
const log = require("../src/util/log");
|
|
16
16
|
const output = require("../src/util/output");
|
|
17
|
+
const phrase = require("../src/phrase");
|
|
17
18
|
const rc = require("../src/util/rc");
|
|
18
19
|
const spinner = require("../src/util/spinner");
|
|
19
20
|
const whoami = require("../src/cli/whoami");
|
|
@@ -44,7 +45,7 @@ const handler = function ({ json, sw }) {
|
|
|
44
45
|
return {
|
|
45
46
|
onAccountRefresh(refresh) {
|
|
46
47
|
sw.start(json);
|
|
47
|
-
return refresh(
|
|
48
|
+
return refresh();
|
|
48
49
|
},
|
|
49
50
|
};
|
|
50
51
|
};
|
|
@@ -62,7 +63,7 @@ const start = function (argv) {
|
|
|
62
63
|
print({ user: null });
|
|
63
64
|
} else {
|
|
64
65
|
sw.stop(true);
|
|
65
|
-
log.p(
|
|
66
|
+
log.p(phrase.noAccount());
|
|
66
67
|
}
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
@@ -85,7 +86,7 @@ const start = function (argv) {
|
|
|
85
86
|
}
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
abort(
|
|
89
|
+
abort(phrase.aborted(COMMAND), ex, { json, sw });
|
|
89
90
|
});
|
|
90
91
|
};
|
|
91
92
|
|
|
@@ -96,12 +97,7 @@ const main = function (argv) {
|
|
|
96
97
|
yargs(args.normalize(hideBin(argv)))
|
|
97
98
|
.scriptName(`${TOOL} ${COMMAND}`)
|
|
98
99
|
.usage("$0 [options]")
|
|
99
|
-
.option("json", {
|
|
100
|
-
alias: "j",
|
|
101
|
-
default: conf.json,
|
|
102
|
-
describe: "Format output as JSON",
|
|
103
|
-
type: "boolean",
|
|
104
|
-
})
|
|
100
|
+
.option("json", { ...args.JSON_OUTPUT, default: conf.json })
|
|
105
101
|
.help("help")
|
|
106
102
|
.alias("help", "h")
|
|
107
103
|
.version(VERSION)
|
package/bin/arc.js
CHANGED
|
@@ -10,6 +10,7 @@ const fs = require("fs-extra");
|
|
|
10
10
|
const cfgpackage = require("../src/config/package");
|
|
11
11
|
const cfgproduct = require("../src/config/product");
|
|
12
12
|
const log = require("../src/util/log");
|
|
13
|
+
const phrase = require("../src/phrase");
|
|
13
14
|
|
|
14
15
|
// [use]
|
|
15
16
|
|
|
@@ -50,8 +51,8 @@ const main = function (argv, load) {
|
|
|
50
51
|
const args = normalize(dispatch(argv));
|
|
51
52
|
pathExists(args[1], (err, exists) => {
|
|
52
53
|
if (err || !exists) {
|
|
53
|
-
log.hd(
|
|
54
|
-
log.pd(
|
|
54
|
+
log.hd(phrase.aborted("command"));
|
|
55
|
+
log.pd(phrase.unableToFind(args[1]));
|
|
55
56
|
process.exit(1);
|
|
56
57
|
}
|
|
57
58
|
const command = load(args[1]);
|
|
@@ -64,3 +65,7 @@ const main = function (argv, load) {
|
|
|
64
65
|
if (require.main === module) {
|
|
65
66
|
main(process.argv, require);
|
|
66
67
|
}
|
|
68
|
+
|
|
69
|
+
// [export]
|
|
70
|
+
|
|
71
|
+
module.exports = { main };
|
package/package.json
CHANGED
package/src/account.js
CHANGED
|
@@ -112,11 +112,11 @@ const getSaved = function (onRefresh) {
|
|
|
112
112
|
if (!session) {
|
|
113
113
|
return null;
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
if (!expired(session)) {
|
|
116
|
+
return current;
|
|
117
|
+
}
|
|
118
|
+
// the handler starts its spinner, then refreshes.
|
|
119
|
+
return onRefresh ? onRefresh(() => refresh(current)) : null;
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
122
|
|
package/src/action/build/tool.js
CHANGED
|
@@ -12,6 +12,7 @@ const fs = require("fs-extra");
|
|
|
12
12
|
// [import]
|
|
13
13
|
|
|
14
14
|
const cfgcode = require("../../config/code");
|
|
15
|
+
const commands = require("../../util/command");
|
|
15
16
|
const error = require("../../util/error");
|
|
16
17
|
const given = require("../../parser/given");
|
|
17
18
|
const phrase = require("../../phrase");
|
|
@@ -19,6 +20,7 @@ const phrase = require("../../phrase");
|
|
|
19
20
|
// [use]
|
|
20
21
|
|
|
21
22
|
const ArcError = error.ArcError;
|
|
23
|
+
const buildCommand = commands.buildCommand;
|
|
22
24
|
const exec = cp.exec;
|
|
23
25
|
const pathExists = fs.pathExists;
|
|
24
26
|
const resolvePath = path.resolve;
|
|
@@ -61,21 +63,12 @@ const build = function (command, { cwdPath, outputPath }) {
|
|
|
61
63
|
|
|
62
64
|
const main = function (conf) {
|
|
63
65
|
const root = conf.root;
|
|
64
|
-
return given(conf).then(({ workflow }) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.filter(Boolean)
|
|
71
|
-
.join(" && ")
|
|
72
|
-
: command.trim(),
|
|
73
|
-
{
|
|
74
|
-
cwdPath: root,
|
|
75
|
-
outputPath: resolvePath(root, workflow.deploy_dir),
|
|
76
|
-
},
|
|
77
|
-
);
|
|
78
|
-
});
|
|
66
|
+
return given(conf).then(({ workflow }) =>
|
|
67
|
+
build(buildCommand(workflow.build), {
|
|
68
|
+
cwdPath: root,
|
|
69
|
+
outputPath: resolvePath(root, workflow.deploy_dir),
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
79
72
|
};
|
|
80
73
|
|
|
81
74
|
// [export]
|