@briklab/lib 1.1.9 → 1.2.0-test
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/dist/cli-john/index.js +459 -15
- package/dist/cli-john/index.js.map +1 -1
- package/dist/color/index.js +205 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/jstc/index.js +97 -5
- package/dist/stylesheet/index.js +251 -14
- package/dist/warner/index.d.ts +4 -0
- package/dist/warner/index.js +169 -4
- package/dist/warner/index.js.map +1 -1
- package/package.json +2 -3
package/dist/cli-john/index.js
CHANGED
|
@@ -1,15 +1,459 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* # CLI John
|
|
5
|
+
*
|
|
6
|
+
* **CLI John** is a **Node.js CLI framework** designed to create **fully functional CLIs** quickly.
|
|
7
|
+
* It hooks into a given NodeJS process, automatically listens for commands, parses arguments,
|
|
8
|
+
* and allows beautiful console messages. Its design is **modular**, using Commands and Options as sub-classes.
|
|
9
|
+
*
|
|
10
|
+
* ## Features
|
|
11
|
+
* - Auto-listening to commands
|
|
12
|
+
* - Command parsing
|
|
13
|
+
* - Beautiful console messages
|
|
14
|
+
* - One CLI per file
|
|
15
|
+
* - Add your file to `bin` in package.json → CLI works seamlessly
|
|
16
|
+
* - Event-driven command handling
|
|
17
|
+
*
|
|
18
|
+
* ## Usage
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { CLI as CLI } from "@briklab/lib/cli-john"
|
|
21
|
+
* import * as process from "node:process"
|
|
22
|
+
*
|
|
23
|
+
* const cli = new CLI(process);
|
|
24
|
+
*
|
|
25
|
+
* const cmd = cli.command("myCommand");
|
|
26
|
+
* const opt = cmd.option("force");
|
|
27
|
+
*
|
|
28
|
+
* cmd.on("run", ({commandArgs}) => {
|
|
29
|
+
* CJ.notice("Hey, this is my CLI!");
|
|
30
|
+
* CJ.message("Do you like it?");
|
|
31
|
+
* CJ.error("Invalid args:", ...commandArgs.map(a => a.name));
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* cli.run();
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ## Limitations
|
|
38
|
+
* - Only **one CLI per file** is allowed (CLI enforces this)
|
|
39
|
+
* - CLI file must be manually added to `bin` in package.json
|
|
40
|
+
*
|
|
41
|
+
* ## Hierarchy
|
|
42
|
+
* ```
|
|
43
|
+
* CLI
|
|
44
|
+
* ├─ Command
|
|
45
|
+
* │ └─ Option
|
|
46
|
+
* └─ CLIErrors
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* ## Error Handling
|
|
50
|
+
* - All errors are instances of `CLIErrors`
|
|
51
|
+
* - Dynamic names allow easy identification of which part of the CLI threw the error
|
|
52
|
+
*
|
|
53
|
+
* @module cli-john
|
|
54
|
+
*/
|
|
55
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
56
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
57
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
58
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
59
|
+
};
|
|
60
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
61
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
62
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
63
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
64
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
65
|
+
};
|
|
66
|
+
var _CLI_instances, _CLI_commands, _CLI_onCmdFunctions, _CLI_figureOutCommand, _CLI_process, _CLI_ErrorClass, _CLI_createErr, _CLI_createWarn;
|
|
67
|
+
// -------------------------------------------------------------------------------------------------------
|
|
68
|
+
//#region Defination of custom JSTC handler
|
|
69
|
+
import JSTC from "../jstc/index.js";
|
|
70
|
+
import InlineStyle, { StyleSheet } from "../stylesheet/index.js";
|
|
71
|
+
import Color from "../color/index.js";
|
|
72
|
+
import { warner } from "../warner/index.js";
|
|
73
|
+
JSTC.addCustomHandler("NodeJS Process", (p) => {
|
|
74
|
+
return (p &&
|
|
75
|
+
typeof p === "object" &&
|
|
76
|
+
typeof p.pid === "number" &&
|
|
77
|
+
typeof p.cwd === "function" &&
|
|
78
|
+
typeof p.exit === "function");
|
|
79
|
+
});
|
|
80
|
+
//#endregion
|
|
81
|
+
// -------------------------------------------------------------------------------------------------------
|
|
82
|
+
//#region The Main Class
|
|
83
|
+
/**
|
|
84
|
+
* # CLI
|
|
85
|
+
* @classdesc The main class for **CLI**.
|
|
86
|
+
* @example
|
|
87
|
+
* import * as process from "node:process"
|
|
88
|
+
* import {CLI} from "@briklab/lib/cli-john"
|
|
89
|
+
* const cli = new CLI(process)
|
|
90
|
+
* cli.run()
|
|
91
|
+
*/
|
|
92
|
+
export class CLI {
|
|
93
|
+
/**
|
|
94
|
+
* ## CLI: Constructor
|
|
95
|
+
* @param {NodeJS.Process} process - **The main process**
|
|
96
|
+
* @constructor
|
|
97
|
+
* @constructs CLI
|
|
98
|
+
* @example
|
|
99
|
+
* import * as process from "node:process"
|
|
100
|
+
* import {CLI} from "@briklab/lib/cli-john"
|
|
101
|
+
* const cli = new CLI(process)
|
|
102
|
+
* cli.run()
|
|
103
|
+
*/
|
|
104
|
+
constructor(process) {
|
|
105
|
+
_CLI_instances.add(this);
|
|
106
|
+
_CLI_commands.set(this, []);
|
|
107
|
+
_CLI_onCmdFunctions.set(this, []);
|
|
108
|
+
_CLI_process.set(this, void 0);
|
|
109
|
+
_CLI_ErrorClass.set(this, class extends CLIErrors {
|
|
110
|
+
constructor(message) {
|
|
111
|
+
super(message);
|
|
112
|
+
this.setName = "CLI";
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
if (!JSTC.for([process]).check(["NodeJS Process"])) {
|
|
116
|
+
throw __classPrivateFieldGet(this, _CLI_instances, "m", _CLI_createErr).call(this, "Invalid First Argument!", "You must pass a valid NodeJS process (imported from node:process) while constructing a CLI Class!");
|
|
117
|
+
}
|
|
118
|
+
__classPrivateFieldSet(this, _CLI_process, process, "f");
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* ### CLI.command
|
|
122
|
+
* create a new command in a CLI.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} name
|
|
125
|
+
*/
|
|
126
|
+
command(name) {
|
|
127
|
+
if (!JSTC.for([name]).check(["string"])) {
|
|
128
|
+
__classPrivateFieldGet(this, _CLI_instances, "m", _CLI_createWarn).call(this, "Invalid First Argument!", "CLI.option expects a string as the first argument.", "Using String(given argument) as fallback.");
|
|
129
|
+
name = String(name);
|
|
130
|
+
}
|
|
131
|
+
let c = new CLI.Command(name);
|
|
132
|
+
let f = __classPrivateFieldGet(this, _CLI_commands, "f").findIndex((a) => a.name === name);
|
|
133
|
+
if (f !== -1)
|
|
134
|
+
__classPrivateFieldGet(this, _CLI_commands, "f")[f] = c;
|
|
135
|
+
else
|
|
136
|
+
__classPrivateFieldGet(this, _CLI_commands, "f").push(c);
|
|
137
|
+
return c;
|
|
138
|
+
}
|
|
139
|
+
on(event, func) {
|
|
140
|
+
if (!JSTC.for([event, func]).check(["string", "function"]))
|
|
141
|
+
throw __classPrivateFieldGet(this, _CLI_instances, "m", _CLI_createErr).call(this, "Arguments in CLI.on are invalid!", "The first argument must be a string, and the second argument must be a function.");
|
|
142
|
+
switch (event.toLowerCase()) {
|
|
143
|
+
case "command":
|
|
144
|
+
__classPrivateFieldGet(this, _CLI_onCmdFunctions, "f").push(func);
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
__classPrivateFieldGet(this, _CLI_instances, "m", _CLI_createWarn).call(this, "Invalid event in CLI.on", "Please enter a valid event from CLI.ValidEvents (array)");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
run() {
|
|
151
|
+
let { options, commandArgs, command, failed } = __classPrivateFieldGet(this, _CLI_instances, "m", _CLI_figureOutCommand).call(this);
|
|
152
|
+
if (failed)
|
|
153
|
+
return;
|
|
154
|
+
for (let i = 0; i < __classPrivateFieldGet(this, _CLI_onCmdFunctions, "f").length; i++) {
|
|
155
|
+
__classPrivateFieldGet(this, _CLI_onCmdFunctions, "f")[i]({ options, commandArgs, command });
|
|
156
|
+
}
|
|
157
|
+
warner.flush();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
_CLI_commands = new WeakMap(), _CLI_onCmdFunctions = new WeakMap(), _CLI_process = new WeakMap(), _CLI_ErrorClass = new WeakMap(), _CLI_instances = new WeakSet(), _CLI_figureOutCommand = function _CLI_figureOutCommand() {
|
|
161
|
+
// for eg. we have nodepath filepath cli build
|
|
162
|
+
let [, , ...commands] = __classPrivateFieldGet(this, _CLI_process, "f").argv; // now its cli build. clear
|
|
163
|
+
if (commands.length === 0)
|
|
164
|
+
return { options: [], command: "", commandArgs: [], failed: true };
|
|
165
|
+
let command = __classPrivateFieldGet(this, _CLI_commands, "f").find((a) => a.name === commands[0]); // find the command
|
|
166
|
+
if (!command)
|
|
167
|
+
return { options: [], command: "", commandArgs: [], failed: true }; // command not found?
|
|
168
|
+
let commandArgs = [];
|
|
169
|
+
const args = commands.slice(1);
|
|
170
|
+
for (let i = 0; i < args.length; i++) {
|
|
171
|
+
let arg = args[i];
|
|
172
|
+
if (arg.startsWith("--"))
|
|
173
|
+
break;
|
|
174
|
+
commandArgs.push(arg);
|
|
175
|
+
}
|
|
176
|
+
let leftover = args.slice(commandArgs.length); // args = [1,2,3]; command args = [1,2] command args length is 2, therefore .slice(2) results in [3]
|
|
177
|
+
let options = [];
|
|
178
|
+
for (let i = 0; i < leftover.length; i++) {
|
|
179
|
+
const opt = leftover[i];
|
|
180
|
+
if (!opt.startsWith("--"))
|
|
181
|
+
continue;
|
|
182
|
+
const values = [];
|
|
183
|
+
for (let j = i + 1; j < leftover.length; j++) {
|
|
184
|
+
if (leftover[j].startsWith("--"))
|
|
185
|
+
break;
|
|
186
|
+
values.push(leftover[j]);
|
|
187
|
+
}
|
|
188
|
+
options.push({ option: opt, arguments: values });
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
options,
|
|
192
|
+
commandArgs,
|
|
193
|
+
command,
|
|
194
|
+
failed: false,
|
|
195
|
+
};
|
|
196
|
+
}, _CLI_createErr = function _CLI_createErr(message, hint) {
|
|
197
|
+
return new (__classPrivateFieldGet(this, _CLI_ErrorClass, "f"))(`${message}
|
|
198
|
+
Hint: ${hint}`);
|
|
199
|
+
}, _CLI_createWarn = function _CLI_createWarn(message, hint, otherMessage) {
|
|
200
|
+
warner.warn({ message: `[Class CLI] ${message}
|
|
201
|
+
Hint: ${hint}
|
|
202
|
+
${otherMessage}` });
|
|
203
|
+
return;
|
|
204
|
+
};
|
|
205
|
+
//#endregion
|
|
206
|
+
// -------------------------------------------------------------------------------------------------------
|
|
207
|
+
//#region Error Class
|
|
208
|
+
class CLIErrors extends Error {
|
|
209
|
+
constructor(message) {
|
|
210
|
+
super(message);
|
|
211
|
+
this.name = `[] @briklab/lib/cli-john`;
|
|
212
|
+
Error.captureStackTrace(this, CLIErrors);
|
|
213
|
+
}
|
|
214
|
+
set setName(name) {
|
|
215
|
+
this.name = `[${name}] @briklab/lib/cli-john`;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
(function (CLI) {
|
|
219
|
+
var _Command_instances, _Command_name, _Command_createWarn, _Command_options;
|
|
220
|
+
CLI.ValidEvents = ["command"];
|
|
221
|
+
/**
|
|
222
|
+
* ## CLI.Command
|
|
223
|
+
* A command in a CLI Command
|
|
224
|
+
*/
|
|
225
|
+
class Command {
|
|
226
|
+
/**
|
|
227
|
+
* ### Command Constructor
|
|
228
|
+
* @param name The name of the command
|
|
229
|
+
* @constructor
|
|
230
|
+
*/
|
|
231
|
+
constructor(name) {
|
|
232
|
+
_Command_instances.add(this);
|
|
233
|
+
_Command_name.set(this, void 0);
|
|
234
|
+
_Command_options.set(this, []);
|
|
235
|
+
__classPrivateFieldSet(this, _Command_name, name, "f");
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The name of the Command
|
|
240
|
+
* @returns {string}
|
|
241
|
+
*/
|
|
242
|
+
get name() {
|
|
243
|
+
return __classPrivateFieldGet(this, _Command_name, "f");
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* the metadata of the Command
|
|
247
|
+
* @returns {object}
|
|
248
|
+
*/
|
|
249
|
+
get metadata() {
|
|
250
|
+
let metadata = {
|
|
251
|
+
options: __classPrivateFieldGet(this, _Command_options, "f").map((a) => a.metadata),
|
|
252
|
+
name: this.name,
|
|
253
|
+
};
|
|
254
|
+
return metadata;
|
|
255
|
+
}
|
|
256
|
+
option(name) {
|
|
257
|
+
if (!JSTC.for([name]).check(["string"])) {
|
|
258
|
+
__classPrivateFieldGet(this, _Command_instances, "m", _Command_createWarn).call(this, "First argument is invalid!", "The first argument must be a string", "Using String(argument) as fallback");
|
|
259
|
+
name = String(name);
|
|
260
|
+
}
|
|
261
|
+
let o = new CLI.Command.Option(name);
|
|
262
|
+
let f = __classPrivateFieldGet(this, _Command_options, "f").findIndex((a) => a.name === name);
|
|
263
|
+
if (f !== -1)
|
|
264
|
+
__classPrivateFieldGet(this, _Command_options, "f")[f] = o;
|
|
265
|
+
else
|
|
266
|
+
__classPrivateFieldGet(this, _Command_options, "f").push(o);
|
|
267
|
+
return o;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
_Command_name = new WeakMap(), _Command_options = new WeakMap(), _Command_instances = new WeakSet(), _Command_createWarn = function _Command_createWarn(message, hint, otherMessage) {
|
|
271
|
+
warner.warn({ message: `[Class CLI.Command] ${message}
|
|
272
|
+
Hint: ${hint}
|
|
273
|
+
${otherMessage}` });
|
|
274
|
+
return;
|
|
275
|
+
};
|
|
276
|
+
CLI.Command = Command;
|
|
277
|
+
})(CLI || (CLI = {}));
|
|
278
|
+
//#endregion
|
|
279
|
+
// -------------------------------------------------------------------------------------------------------
|
|
280
|
+
//#region CLI.Command.Option
|
|
281
|
+
(function (CLI) {
|
|
282
|
+
var Command;
|
|
283
|
+
(function (Command) {
|
|
284
|
+
var _Option_name;
|
|
285
|
+
/**
|
|
286
|
+
* ## CLI.Command.Option
|
|
287
|
+
* A option for a CLI.Command
|
|
288
|
+
*/
|
|
289
|
+
class Option {
|
|
290
|
+
get metadata() {
|
|
291
|
+
let metadata = {
|
|
292
|
+
name: `${__classPrivateFieldGet(this, _Option_name, "f")}`, // <-- Templates TO NOT reference the actual variable
|
|
293
|
+
};
|
|
294
|
+
return metadata;
|
|
295
|
+
}
|
|
296
|
+
constructor(name) {
|
|
297
|
+
_Option_name.set(this, void 0);
|
|
298
|
+
__classPrivateFieldSet(this, _Option_name, name, "f");
|
|
299
|
+
return this;
|
|
300
|
+
}
|
|
301
|
+
get name() {
|
|
302
|
+
return __classPrivateFieldGet(this, _Option_name, "f");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
_Option_name = new WeakMap();
|
|
306
|
+
Command.Option = Option;
|
|
307
|
+
})(Command = CLI.Command || (CLI.Command = {}));
|
|
308
|
+
})(CLI || (CLI = {}));
|
|
309
|
+
//#endregion
|
|
310
|
+
// -------------------------------------------------------------------------------------------------------
|
|
311
|
+
//#region CLI Utilities
|
|
312
|
+
JSTC.addCustomHandler("Utilities Tag Config", (p) => {
|
|
313
|
+
return (p &&
|
|
314
|
+
typeof p === "object" &&
|
|
315
|
+
typeof p.tag === "string" &&
|
|
316
|
+
typeof p.showErrorInTag === "boolean" &&
|
|
317
|
+
typeof p.paddingLeft === "number" &&
|
|
318
|
+
typeof p.paddingRight === "number" &&
|
|
319
|
+
(typeof p.styleName === "string" || p.styleName === undefined));
|
|
320
|
+
});
|
|
321
|
+
class UtilitiesClass {
|
|
322
|
+
constructor() {
|
|
323
|
+
this.styleSheet = new StyleSheet();
|
|
324
|
+
this.tags = {};
|
|
325
|
+
this.addTag("error", {
|
|
326
|
+
tag: "ERROR",
|
|
327
|
+
showErrorInTag: false,
|
|
328
|
+
paddingLeft: 0,
|
|
329
|
+
paddingRight: 0,
|
|
330
|
+
});
|
|
331
|
+
this.addTag("warning", {
|
|
332
|
+
tag: "WARNING",
|
|
333
|
+
showErrorInTag: true,
|
|
334
|
+
paddingLeft: 0,
|
|
335
|
+
paddingRight: 0,
|
|
336
|
+
});
|
|
337
|
+
this.addTag("info", {
|
|
338
|
+
tag: "INFO",
|
|
339
|
+
showErrorInTag: true,
|
|
340
|
+
paddingLeft: 0,
|
|
341
|
+
paddingRight: 0,
|
|
342
|
+
});
|
|
343
|
+
this.setTagStyle("error", new InlineStyle({ color: "red", fontWeight: "bold" }));
|
|
344
|
+
this.setTagStyle("warning", new InlineStyle({ color: "orange", fontWeight: "bold" }));
|
|
345
|
+
this.setTagStyle("info", new InlineStyle({ color: "blue" }));
|
|
346
|
+
}
|
|
347
|
+
/** Add a new tag */
|
|
348
|
+
addTag(name, config = {}) {
|
|
349
|
+
if (!JSTC.for([name, config]).check(["string", "object"])) {
|
|
350
|
+
warner.warn({ message: `[UtilitiesClass.addTag] @briklab/lib/cli-john: Invalid Arguments!
|
|
351
|
+
Hint: The first argument must be a string, and the second argument must be a object.
|
|
352
|
+
Using String(argument1) and {} as fallback.` });
|
|
353
|
+
name = String(name);
|
|
354
|
+
config = {};
|
|
355
|
+
}
|
|
356
|
+
const fullConfig = {
|
|
357
|
+
tag: name.toUpperCase(),
|
|
358
|
+
showErrorInTag: false,
|
|
359
|
+
paddingLeft: 0,
|
|
360
|
+
paddingRight: 0,
|
|
361
|
+
styleName: "",
|
|
362
|
+
...config,
|
|
363
|
+
};
|
|
364
|
+
if (!JSTC.for([fullConfig]).check(["Utilities Tag Config"])) {
|
|
365
|
+
warner.warn({ message: `[UtilitiesClass.addTag] @briklab/lib/cli-john: Invalid tag config passed for "${name}"
|
|
366
|
+
Hint: The config must be in format {tag?: string, showErrorInTag?:boolean, paddingLeft?:number, paddingRight?:number, styleName?:string}` });
|
|
367
|
+
warner.warn({ message: JSON.stringify(fullConfig, null, 2) });
|
|
368
|
+
return this;
|
|
369
|
+
}
|
|
370
|
+
this.tags[name] = fullConfig;
|
|
371
|
+
return this;
|
|
372
|
+
}
|
|
373
|
+
/** Set style for a tag */
|
|
374
|
+
setTagStyle(tagName, style) {
|
|
375
|
+
if (typeof tagName !== "string" || !(style instanceof InlineStyle)) {
|
|
376
|
+
warner.warn({ message: `[UtilitiesClass.setTagStyle] @briklab/lib/cli-john: Invalid arguments!
|
|
377
|
+
Hint: The first argument must be a string and the second argument must be a instance of InlineStyle
|
|
378
|
+
Using String(firstArgument) and new InlineStyle({}) as fallback` });
|
|
379
|
+
tagName = String(tagName);
|
|
380
|
+
style = new InlineStyle({});
|
|
381
|
+
}
|
|
382
|
+
if (!this.tags[tagName]) {
|
|
383
|
+
warner.warn({ message: `[UtilitiesClass.setTagStyle] @briklab/lib/cli-john: Tag "${tagName}" does not exist!
|
|
384
|
+
Hint: Use a valid tag that you have defined or use "error"|"warn"|"info"` });
|
|
385
|
+
return this;
|
|
386
|
+
}
|
|
387
|
+
const styleName = `${tagName} Tag Color`;
|
|
388
|
+
this.styleSheet.set(styleName, style);
|
|
389
|
+
this.tags[tagName].styleName = styleName;
|
|
390
|
+
return this;
|
|
391
|
+
}
|
|
392
|
+
log(tagName, ...messages) {
|
|
393
|
+
if (!JSTC.for([tagName]).check(["string"])) {
|
|
394
|
+
warner.warn({ message: `[UtilitiesClass.log] @briklab/lib/cli-john: Invalid Arguments!
|
|
395
|
+
Hint: The first argument must be a string
|
|
396
|
+
Using String(argument1) as fallback` });
|
|
397
|
+
tagName = String(tagName);
|
|
398
|
+
}
|
|
399
|
+
if (!messages || messages.length === 0)
|
|
400
|
+
messages = [""];
|
|
401
|
+
const tag = this.tags[tagName];
|
|
402
|
+
if (!tag) {
|
|
403
|
+
warner.warn({ message: `[UtilitiesClass.log] @briklab/lib/cli-john: Tag "${tagName}" does not exist!
|
|
404
|
+
Hint: Use a valid tag that you have defined or use "error"|"warn"|"info"` });
|
|
405
|
+
console.log(...messages);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const inlineStyle = this.styleSheet.get(tag.styleName);
|
|
409
|
+
const style = inlineStyle?.text ?? "";
|
|
410
|
+
const leftPad = " ".repeat(tag.paddingLeft);
|
|
411
|
+
const rightPad = " ".repeat(tag.paddingRight);
|
|
412
|
+
const isNodeTTY = typeof process !== "undefined" &&
|
|
413
|
+
typeof process.stdout !== "undefined" &&
|
|
414
|
+
Boolean(process.stdout.isTTY);
|
|
415
|
+
if (isNodeTTY) {
|
|
416
|
+
const ansi = inlineStyle?.ansi ?? "";
|
|
417
|
+
const reset = Color.RESET;
|
|
418
|
+
if (tag.showErrorInTag) {
|
|
419
|
+
console.log("[" + ansi + leftPad + tag.tag + rightPad + reset + "]:", ...messages);
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
console.log(ansi + "[" + leftPad + tag.tag + rightPad + "]" + reset + ":", ...messages);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
if (tag.showErrorInTag) {
|
|
427
|
+
console.log(`[%c${leftPad}${tag.tag}${rightPad}%c]:`, style, ...messages);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
console.log(`%c[${leftPad}${tag.tag}${rightPad}]%c:`, style, ...messages);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
error(...msg) {
|
|
435
|
+
if (!msg || msg.length === 0)
|
|
436
|
+
msg = [""];
|
|
437
|
+
this.log("error", ...msg);
|
|
438
|
+
return this;
|
|
439
|
+
}
|
|
440
|
+
warning(...msg) {
|
|
441
|
+
if (!msg || msg.length === 0)
|
|
442
|
+
msg = [""];
|
|
443
|
+
this.log("warning", ...msg);
|
|
444
|
+
return this;
|
|
445
|
+
}
|
|
446
|
+
info(...msg) {
|
|
447
|
+
if (!msg || msg.length === 0)
|
|
448
|
+
msg = [""];
|
|
449
|
+
this.log("info", ...msg);
|
|
450
|
+
return this;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
export const Utilities = new UtilitiesClass();
|
|
454
|
+
//#endregion
|
|
455
|
+
// -------------------------------------------------------------------------------------------------------
|
|
456
|
+
//#region TODO
|
|
457
|
+
// TODO: Wire Options to Commands
|
|
458
|
+
// TODO: Create metadata getter-s in both commands and options
|
|
459
|
+
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js"],
|
|
4
|
-
"mappings": "AAsDA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAMC,EAAG,CACtG,GAAID,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOF,GAAU,WAAaD,IAAaC,GAAS,CAACE,EAAI,CAACF,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,0EAA0E,EACjL,OAAOE,IAAS,IAAMC,EAAID,IAAS,IAAMC,EAAE,KAAKH,CAAQ,EAAIG,EAAIA,EAAE,MAAQF,EAAM,IAAID,CAAQ,CAChG,EACII,EAAkE,SAAUJ,EAAUC,EAAOI,EAAOH,EAAMC,EAAG,CAC7G,GAAID,IAAS,IAAK,MAAM,IAAI,UAAU,gCAAgC,EACtE,GAAIA,IAAS,KAAO,CAACC,EAAG,MAA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AUF,EAAI,IAAMG,EAAW,IAAME,EAAQ,IAAK,GAAGN,CAAQ,CAE9F,MAEQC,EAAI,eACJ,QAAQ,IAAI,MAAME,CAAO,GAAGF,EAAI,GAAG,GAAGG,CAAQ,OAAQN,EAAO,GAAGE,CAAQ,EAGxE,QAAQ,IAAI,MAAMG,CAAO,GAAGF,EAAI,GAAG,GAAGG,CAAQ,OAAQN,EAAO,GAAGE,CAAQ,CAGpF,CACA,SAASO,EAAK,CACV,OAAI,CAACA,GAAOA,EAAI,SAAW,KACvBA,EAAM,CAAC,EAAE,GACb,KAAK,IAAI,QAAS,GAAGA,CAAG,EACjB,IACX,CACA,WAAWA,EAAK,CACZ,OAAI,CAACA,GAAOA,EAAI,SAAW,KACvBA,EAAM,CAAC,EAAE,GACb,KAAK,IAAI,UAAW,GAAGA,CAAG,EACnB,IACX,CACA,QAAQA,EAAK,CACT,OAAI,CAACA,GAAOA,EAAI,SAAW,KACvBA,EAAM,CAAC,EAAE,GACb,KAAK,IAAI,OAAQ,GAAGA,CAAG,EAChB,IACX,CACJ,CACO,MAAMC,EAAY,IAAId",
|
|
5
5
|
"names": ["__classPrivateFieldGet", "receiver", "state", "kind", "f", "__classPrivateFieldSet", "value", "_CLI_instances", "_CLI_commands", "_CLI_onCmdFunctions", "_CLI_figureOutCommand", "_CLI_process", "_CLI_ErrorClass", "_CLI_createErr", "_CLI_createWarn", "JSTC", "InlineStyle", "StyleSheet", "Color", "warner", "p", "CLI", "process", "CLIErrors", "message", "name", "c", "a", "event", "func", "options", "commandArgs", "command", "failed", "i", "commands", "args", "arg", "leftover", "opt", "values", "j", "hint", "otherMessage", "_Command_instances", "_Command_name", "_Command_createWarn", "_Command_options", "Command", "o", "_Option_name", "Option", "UtilitiesClass", "config", "fullConfig", "tagName", "style", "styleName", "messages", "tag", "inlineStyle", "leftPad", "rightPad", "ansi", "reset", "msg", "Utilities"]
|
|
6
6
|
}
|