@cenk1cenk2/oclif-common 3.4.3 → 3.5.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/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +29 -3
- package/dist/hooks/not-found.hook.js +1 -2
- package/dist/hooks/store.hook.d.ts +1 -1
- package/dist/hooks/store.hook.js +29 -3
- package/dist/index.d.ts +15 -17
- package/dist/index.js +52 -36
- package/dist/{store.hook-06894aa2.d.ts → store.hook-d02c3547.d.ts} +1 -1
- package/package.json +1 -1
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -66,7 +66,7 @@ var Logger = class {
|
|
|
66
66
|
constructor(context, options) {
|
|
67
67
|
this.context = context;
|
|
68
68
|
this.options = options;
|
|
69
|
-
const parsed = process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO
|
|
69
|
+
const parsed = (process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO */).toUpperCase();
|
|
70
70
|
const level = Object.values(LogLevels).includes(parsed) ? parsed : "INFO" /* INFO */;
|
|
71
71
|
this.options = {
|
|
72
72
|
useIcons: true,
|
|
@@ -74,7 +74,6 @@ var Logger = class {
|
|
|
74
74
|
level
|
|
75
75
|
};
|
|
76
76
|
if (Logger.instance) {
|
|
77
|
-
Logger.instance.level = level;
|
|
78
77
|
this.logger = Logger.instance;
|
|
79
78
|
} else {
|
|
80
79
|
this.logger = this.initiateLogger();
|
|
@@ -241,6 +240,33 @@ var updateNotifierHook = /* @__PURE__ */ __name(async (opts) => {
|
|
|
241
240
|
var import_object_path_immutable = __toESM(require("object-path-immutable"));
|
|
242
241
|
var import_path2 = require("path");
|
|
243
242
|
|
|
243
|
+
// src/interfaces/oclif.interface.ts
|
|
244
|
+
var import_core2 = require("@oclif/core");
|
|
245
|
+
|
|
246
|
+
// src/constants/global-flags.constants.ts
|
|
247
|
+
var CLI_FLAGS = {
|
|
248
|
+
["log-level"]: import_core2.Flags.enum({
|
|
249
|
+
default: "INFO" /* INFO */,
|
|
250
|
+
env: "LOG_LEVEL",
|
|
251
|
+
description: "Set the log level of the application.",
|
|
252
|
+
options: [...Object.values(LogLevels), ...Object.values(LogLevels).map((level) => level.toLowerCase())],
|
|
253
|
+
helpGroup: "CLI" /* CLI */,
|
|
254
|
+
parse: async (input) => input?.toUpperCase()
|
|
255
|
+
}),
|
|
256
|
+
ci: import_core2.Flags.boolean({
|
|
257
|
+
default: false,
|
|
258
|
+
env: "CI",
|
|
259
|
+
description: "Instruct whether this is running the CI/CD configuration.",
|
|
260
|
+
helpGroup: "CLI" /* CLI */
|
|
261
|
+
}),
|
|
262
|
+
json: import_core2.Flags.boolean({
|
|
263
|
+
default: false,
|
|
264
|
+
env: "JSON",
|
|
265
|
+
description: "Put the CLI to respond in JSON.",
|
|
266
|
+
helpGroup: "CLI" /* CLI */
|
|
267
|
+
})
|
|
268
|
+
};
|
|
269
|
+
|
|
244
270
|
// src/lib/parser/json-parser.service.ts
|
|
245
271
|
var _JsonParser = class {
|
|
246
272
|
constructor() {
|
|
@@ -304,7 +330,7 @@ var import_path = require("path");
|
|
|
304
330
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
305
331
|
|
|
306
332
|
// src/utils/index.ts
|
|
307
|
-
var
|
|
333
|
+
var import_core3 = require("@oclif/core");
|
|
308
334
|
|
|
309
335
|
// src/lib/locker/locker.service.ts
|
|
310
336
|
var import_object_path_immutable2 = __toESM(require("object-path-immutable"));
|
|
@@ -62,7 +62,7 @@ var Logger = class {
|
|
|
62
62
|
constructor(context, options) {
|
|
63
63
|
this.context = context;
|
|
64
64
|
this.options = options;
|
|
65
|
-
const parsed = process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO
|
|
65
|
+
const parsed = (process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO */).toUpperCase();
|
|
66
66
|
const level = Object.values(LogLevels).includes(parsed) ? parsed : "INFO" /* INFO */;
|
|
67
67
|
this.options = {
|
|
68
68
|
useIcons: true,
|
|
@@ -70,7 +70,6 @@ var Logger = class {
|
|
|
70
70
|
level
|
|
71
71
|
};
|
|
72
72
|
if (Logger.instance) {
|
|
73
|
-
Logger.instance.level = level;
|
|
74
73
|
this.logger = Logger.instance;
|
|
75
74
|
} else {
|
|
76
75
|
this.logger = this.initiateLogger();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@oclif/core';
|
|
2
|
-
export { s as storeHook } from '../store.hook-
|
|
2
|
+
export { s as storeHook } from '../store.hook-d02c3547.js';
|
package/dist/hooks/store.hook.js
CHANGED
|
@@ -34,6 +34,9 @@ module.exports = __toCommonJS(store_hook_exports);
|
|
|
34
34
|
var import_object_path_immutable = __toESM(require("object-path-immutable"));
|
|
35
35
|
var import_path2 = require("path");
|
|
36
36
|
|
|
37
|
+
// src/interfaces/oclif.interface.ts
|
|
38
|
+
var import_core = require("@oclif/core");
|
|
39
|
+
|
|
37
40
|
// src/utils/logger/listr-logger.ts
|
|
38
41
|
var import_listr22 = require("listr2");
|
|
39
42
|
|
|
@@ -65,7 +68,7 @@ var Logger = class {
|
|
|
65
68
|
constructor(context, options) {
|
|
66
69
|
this.context = context;
|
|
67
70
|
this.options = options;
|
|
68
|
-
const parsed = process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO
|
|
71
|
+
const parsed = (process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO */).toUpperCase();
|
|
69
72
|
const level = Object.values(LogLevels).includes(parsed) ? parsed : "INFO" /* INFO */;
|
|
70
73
|
this.options = {
|
|
71
74
|
useIcons: true,
|
|
@@ -73,7 +76,6 @@ var Logger = class {
|
|
|
73
76
|
level
|
|
74
77
|
};
|
|
75
78
|
if (Logger.instance) {
|
|
76
|
-
Logger.instance.level = level;
|
|
77
79
|
this.logger = Logger.instance;
|
|
78
80
|
} else {
|
|
79
81
|
this.logger = this.initiateLogger();
|
|
@@ -220,6 +222,30 @@ var import_through = __toESM(require("through"));
|
|
|
220
222
|
// src/utils/logger/pipe/pipe-process-to-logger.ts
|
|
221
223
|
var import_through2 = __toESM(require("through"));
|
|
222
224
|
|
|
225
|
+
// src/constants/global-flags.constants.ts
|
|
226
|
+
var CLI_FLAGS = {
|
|
227
|
+
["log-level"]: import_core.Flags.enum({
|
|
228
|
+
default: "INFO" /* INFO */,
|
|
229
|
+
env: "LOG_LEVEL",
|
|
230
|
+
description: "Set the log level of the application.",
|
|
231
|
+
options: [...Object.values(LogLevels), ...Object.values(LogLevels).map((level) => level.toLowerCase())],
|
|
232
|
+
helpGroup: "CLI" /* CLI */,
|
|
233
|
+
parse: async (input) => input?.toUpperCase()
|
|
234
|
+
}),
|
|
235
|
+
ci: import_core.Flags.boolean({
|
|
236
|
+
default: false,
|
|
237
|
+
env: "CI",
|
|
238
|
+
description: "Instruct whether this is running the CI/CD configuration.",
|
|
239
|
+
helpGroup: "CLI" /* CLI */
|
|
240
|
+
}),
|
|
241
|
+
json: import_core.Flags.boolean({
|
|
242
|
+
default: false,
|
|
243
|
+
env: "JSON",
|
|
244
|
+
description: "Put the CLI to respond in JSON.",
|
|
245
|
+
helpGroup: "CLI" /* CLI */
|
|
246
|
+
})
|
|
247
|
+
};
|
|
248
|
+
|
|
223
249
|
// src/lib/parser/json-parser.service.ts
|
|
224
250
|
var _JsonParser = class {
|
|
225
251
|
constructor() {
|
|
@@ -283,7 +309,7 @@ var import_path = require("path");
|
|
|
283
309
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
284
310
|
|
|
285
311
|
// src/utils/index.ts
|
|
286
|
-
var
|
|
312
|
+
var import_core2 = require("@oclif/core");
|
|
287
313
|
|
|
288
314
|
// src/lib/locker/locker.service.ts
|
|
289
315
|
var import_object_path_immutable2 = __toESM(require("object-path-immutable"));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import * as _oclif_core_lib_interfaces from '@oclif/core/lib/interfaces';
|
|
2
|
-
import { InferredFlags, ArgInput } from '@oclif/core/lib/interfaces';
|
|
3
|
-
export { Arg, ArgInput, Flag, FlagInput, InferredFlags } from '@oclif/core/lib/interfaces';
|
|
4
1
|
import { Command as Command$1, CliUx } from '@oclif/core';
|
|
5
2
|
export { CliUx, Flags } from '@oclif/core';
|
|
6
3
|
import { Logger as Logger$2, ListrTaskWrapper, ListrContext, Manager, PromptOptions } from 'listr2';
|
|
7
4
|
import { Logger as Logger$1, LeveledLogMethod } from 'winston';
|
|
8
5
|
import fs from 'fs-extra';
|
|
9
6
|
export { default as fs } from 'fs-extra';
|
|
10
|
-
import { S as StoreService } from './store.hook-
|
|
11
|
-
export { D as DataStore, S as StoreService, s as storeHook } from './store.hook-
|
|
7
|
+
import { S as StoreService } from './store.hook-d02c3547.js';
|
|
8
|
+
export { D as DataStore, S as StoreService, s as storeHook } from './store.hook-d02c3547.js';
|
|
12
9
|
import { ClassTransformOptions } from 'class-transformer';
|
|
13
10
|
import { ValidatorOptions } from 'class-validator';
|
|
11
|
+
import { InferredFlags, FlagInput } from '@oclif/core/lib/interfaces';
|
|
12
|
+
export { Arg, ArgInput, Flag, FlagInput, InferredFlags } from '@oclif/core/lib/interfaces';
|
|
14
13
|
export { notFoundHook } from './hooks/not-found.hook.js';
|
|
15
14
|
export { updateNotifierHook } from './hooks/update-notifier.hook.js';
|
|
16
15
|
import { ExecaChildProcess } from 'execa';
|
|
@@ -52,7 +51,7 @@ declare type Winston = Logger$1 & Record<keyof typeof LogLevels, LeveledLogMetho
|
|
|
52
51
|
declare class Logger {
|
|
53
52
|
private context?;
|
|
54
53
|
private options?;
|
|
55
|
-
static instance
|
|
54
|
+
private static instance;
|
|
56
55
|
private logger;
|
|
57
56
|
constructor(context?: string, options?: LoggerOptions);
|
|
58
57
|
log(level: LogLevels, data: string | Buffer, ...args: any): void;
|
|
@@ -189,7 +188,7 @@ declare class LockerService<LockFile extends LockableData = LockableData> {
|
|
|
189
188
|
}
|
|
190
189
|
|
|
191
190
|
declare class ParserService {
|
|
192
|
-
static instance
|
|
191
|
+
private static instance;
|
|
193
192
|
parsers: ClassType<GenericParser>[];
|
|
194
193
|
private readonly logger;
|
|
195
194
|
private readonly fs;
|
|
@@ -206,7 +205,7 @@ declare class ParserService {
|
|
|
206
205
|
declare class ConfigService implements GlobalConfig {
|
|
207
206
|
oclif: Command['config'];
|
|
208
207
|
command: Command['ctor'];
|
|
209
|
-
static instance
|
|
208
|
+
private static instance;
|
|
210
209
|
defaults: string;
|
|
211
210
|
root: string;
|
|
212
211
|
parser: ParserService;
|
|
@@ -227,7 +226,7 @@ declare class ConfigService implements GlobalConfig {
|
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
declare class FileSystemService {
|
|
230
|
-
static instance
|
|
229
|
+
private static instance;
|
|
231
230
|
private readonly logger;
|
|
232
231
|
constructor();
|
|
233
232
|
exists(path: string): boolean;
|
|
@@ -250,7 +249,7 @@ declare class FileSystemService {
|
|
|
250
249
|
|
|
251
250
|
declare class YamlParser implements GenericParser {
|
|
252
251
|
static extensions: string[];
|
|
253
|
-
static instance
|
|
252
|
+
private static instance;
|
|
254
253
|
private readonly logger;
|
|
255
254
|
constructor();
|
|
256
255
|
parse<T = unknown>(data: string | Buffer): T;
|
|
@@ -259,7 +258,7 @@ declare class YamlParser implements GenericParser {
|
|
|
259
258
|
|
|
260
259
|
declare class JsonParser implements GenericParser {
|
|
261
260
|
static extensions: string[];
|
|
262
|
-
static instance
|
|
261
|
+
private static instance;
|
|
263
262
|
private readonly logger;
|
|
264
263
|
constructor();
|
|
265
264
|
parse<T = unknown>(data: string | Buffer): T;
|
|
@@ -299,11 +298,7 @@ declare type DeepPartial<T> = {
|
|
|
299
298
|
};
|
|
300
299
|
|
|
301
300
|
declare class Command<Ctx extends ListrContext = ListrContext, Flags extends Record<PropertyKey, any> = InferFlags<typeof Command>, Args extends Record<PropertyKey, any> = InferArgs<typeof Command>, Store extends Record<PropertyKey, any> = Record<PropertyKey, any>> extends Command$1 {
|
|
302
|
-
static globalFlags:
|
|
303
|
-
"log-level": _oclif_core_lib_interfaces.OptionFlag<string>;
|
|
304
|
-
ci: _oclif_core_lib_interfaces.BooleanFlag<boolean>;
|
|
305
|
-
};
|
|
306
|
-
static args: ArgInput;
|
|
301
|
+
static globalFlags: FlagInput;
|
|
307
302
|
logger: Logger;
|
|
308
303
|
tasks: Manager<Ctx, 'default' | 'verbose' | 'silent' | 'simple'>;
|
|
309
304
|
validator: ValidatorService;
|
|
@@ -341,6 +336,7 @@ declare class Command<Ctx extends ListrContext = ListrContext, Flags extends Rec
|
|
|
341
336
|
}
|
|
342
337
|
|
|
343
338
|
declare class ConfigCommand<CommandChoices extends string = string, LockFile = any, Ctx extends ListrContext = ListrContext, Flags extends Record<PropertyKey, any> = InferFlags<typeof ConfigCommand>, Args extends Record<PropertyKey, any> = InferArgs<typeof ConfigCommand>, Store extends Record<PropertyKey, any> = Record<PropertyKey, any>> extends Command<Ctx, Flags, Args, Store> {
|
|
339
|
+
static globalFlags: FlagInput;
|
|
344
340
|
choices: ConfigCommandChoices<CommandChoices>;
|
|
345
341
|
locker: LockerService<LockFile>;
|
|
346
342
|
run(): Promise<void>;
|
|
@@ -353,8 +349,10 @@ declare enum FileConstants {
|
|
|
353
349
|
CONFIG_SERVICE_DEFAULTS_DIR = "config"
|
|
354
350
|
}
|
|
355
351
|
|
|
352
|
+
declare const CLI_FLAGS: FlagInput;
|
|
353
|
+
|
|
356
354
|
declare enum HelpGroups {
|
|
357
355
|
CLI = "CLI"
|
|
358
356
|
}
|
|
359
357
|
|
|
360
|
-
export { ClassType, Command, CommonLockerData, ConfigCommand, ConfigCommandChoices, ConfigCommandSetup, ConfigIterator, ConfigService, DeepPartial, FileConstants, FileSystemService, GenericParser, GlobalConfig, GlobalConfigInit, HelpGroups, InferArgs, InferFlags, JsonParser, ListrLogger, LockData, LockableData, LockerService, LogFieldStatus, LogLevels, Logger, LoggerFormat, LoggerOptions, MergeStrategy, ParserService, PipeProcessToLoggerOptions, SetCtxAssignOptions, SetCtxDefaultsOptions, UnlockData, ValidatorService, ValidatorServiceOptions, Winston, YamlParser, color, isDebug, isSilent, isVerbose, merge, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup };
|
|
358
|
+
export { CLI_FLAGS, ClassType, Command, CommonLockerData, ConfigCommand, ConfigCommandChoices, ConfigCommandSetup, ConfigIterator, ConfigService, DeepPartial, FileConstants, FileSystemService, GenericParser, GlobalConfig, GlobalConfigInit, HelpGroups, InferArgs, InferFlags, JsonParser, ListrLogger, LockData, LockableData, LockerService, LogFieldStatus, LogLevels, Logger, LoggerFormat, LoggerOptions, MergeStrategy, ParserService, PipeProcessToLoggerOptions, SetCtxAssignOptions, SetCtxDefaultsOptions, UnlockData, ValidatorService, ValidatorServiceOptions, Winston, YamlParser, color, isDebug, isSilent, isVerbose, merge, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup };
|
package/dist/index.js
CHANGED
|
@@ -26,13 +26,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
26
26
|
// src/index.ts
|
|
27
27
|
var src_exports = {};
|
|
28
28
|
__export(src_exports, {
|
|
29
|
-
|
|
29
|
+
CLI_FLAGS: () => CLI_FLAGS,
|
|
30
|
+
CliUx: () => import_core2.CliUx,
|
|
30
31
|
Command: () => Command,
|
|
31
32
|
ConfigCommand: () => ConfigCommand,
|
|
32
33
|
ConfigService: () => ConfigService,
|
|
33
34
|
FileConstants: () => FileConstants,
|
|
34
35
|
FileSystemService: () => FileSystemService,
|
|
35
|
-
Flags: () =>
|
|
36
|
+
Flags: () => import_core.Flags,
|
|
36
37
|
HelpGroups: () => HelpGroups,
|
|
37
38
|
JsonParser: () => JsonParser,
|
|
38
39
|
ListrLogger: () => ListrLogger,
|
|
@@ -63,7 +64,7 @@ __export(src_exports, {
|
|
|
63
64
|
module.exports = __toCommonJS(src_exports);
|
|
64
65
|
|
|
65
66
|
// src/commands/base.command.ts
|
|
66
|
-
var
|
|
67
|
+
var import_core3 = require("@oclif/core");
|
|
67
68
|
var import_listr23 = require("listr2");
|
|
68
69
|
var import_readline = require("readline");
|
|
69
70
|
var import_reflect_metadata = require("reflect-metadata");
|
|
@@ -80,9 +81,8 @@ var HelpGroups = /* @__PURE__ */ ((HelpGroups2) => {
|
|
|
80
81
|
return HelpGroups2;
|
|
81
82
|
})(HelpGroups || {});
|
|
82
83
|
|
|
83
|
-
// src/
|
|
84
|
-
var
|
|
85
|
-
var import_path2 = require("path");
|
|
84
|
+
// src/interfaces/oclif.interface.ts
|
|
85
|
+
var import_core = require("@oclif/core");
|
|
86
86
|
|
|
87
87
|
// src/utils/logger/listr-logger.ts
|
|
88
88
|
var import_listr22 = require("listr2");
|
|
@@ -120,7 +120,7 @@ var Logger = class {
|
|
|
120
120
|
constructor(context, options) {
|
|
121
121
|
this.context = context;
|
|
122
122
|
this.options = options;
|
|
123
|
-
const parsed = process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO
|
|
123
|
+
const parsed = (process.env.LOG_LEVEL ?? options?.level ?? "INFO" /* INFO */).toUpperCase();
|
|
124
124
|
const level = Object.values(LogLevels).includes(parsed) ? parsed : "INFO" /* INFO */;
|
|
125
125
|
this.options = {
|
|
126
126
|
useIcons: true,
|
|
@@ -128,7 +128,6 @@ var Logger = class {
|
|
|
128
128
|
level
|
|
129
129
|
};
|
|
130
130
|
if (Logger.instance) {
|
|
131
|
-
Logger.instance.level = level;
|
|
132
131
|
this.logger = Logger.instance;
|
|
133
132
|
} else {
|
|
134
133
|
this.logger = this.initiateLogger();
|
|
@@ -297,7 +296,7 @@ var ListrLogger = class extends import_listr22.Logger {
|
|
|
297
296
|
this.logger.warn(message, { status: "retry" });
|
|
298
297
|
}
|
|
299
298
|
rollback(message) {
|
|
300
|
-
this.logger.
|
|
299
|
+
this.logger.error(message, { status: "rollback" });
|
|
301
300
|
}
|
|
302
301
|
};
|
|
303
302
|
__name(ListrLogger, "ListrLogger");
|
|
@@ -362,6 +361,34 @@ function pipeProcessToLogger(logger, instance, options) {
|
|
|
362
361
|
}
|
|
363
362
|
__name(pipeProcessToLogger, "pipeProcessToLogger");
|
|
364
363
|
|
|
364
|
+
// src/constants/global-flags.constants.ts
|
|
365
|
+
var CLI_FLAGS = {
|
|
366
|
+
["log-level"]: import_core.Flags.enum({
|
|
367
|
+
default: "INFO" /* INFO */,
|
|
368
|
+
env: "LOG_LEVEL",
|
|
369
|
+
description: "Set the log level of the application.",
|
|
370
|
+
options: [...Object.values(LogLevels), ...Object.values(LogLevels).map((level) => level.toLowerCase())],
|
|
371
|
+
helpGroup: "CLI" /* CLI */,
|
|
372
|
+
parse: async (input) => input?.toUpperCase()
|
|
373
|
+
}),
|
|
374
|
+
ci: import_core.Flags.boolean({
|
|
375
|
+
default: false,
|
|
376
|
+
env: "CI",
|
|
377
|
+
description: "Instruct whether this is running the CI/CD configuration.",
|
|
378
|
+
helpGroup: "CLI" /* CLI */
|
|
379
|
+
}),
|
|
380
|
+
json: import_core.Flags.boolean({
|
|
381
|
+
default: false,
|
|
382
|
+
env: "JSON",
|
|
383
|
+
description: "Put the CLI to respond in JSON.",
|
|
384
|
+
helpGroup: "CLI" /* CLI */
|
|
385
|
+
})
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
// src/lib/config/config.service.ts
|
|
389
|
+
var import_object_path_immutable = __toESM(require("object-path-immutable"));
|
|
390
|
+
var import_path2 = require("path");
|
|
391
|
+
|
|
365
392
|
// src/lib/parser/json-parser.service.ts
|
|
366
393
|
var _JsonParser = class {
|
|
367
394
|
constructor() {
|
|
@@ -629,7 +656,7 @@ function setCtxAssign(ctx, ...assigns) {
|
|
|
629
656
|
__name(setCtxAssign, "setCtxAssign");
|
|
630
657
|
|
|
631
658
|
// src/utils/index.ts
|
|
632
|
-
var
|
|
659
|
+
var import_core2 = require("@oclif/core");
|
|
633
660
|
|
|
634
661
|
// src/lib/config/config.service.ts
|
|
635
662
|
var ConfigService = class {
|
|
@@ -993,7 +1020,7 @@ function setup() {
|
|
|
993
1020
|
__name(setup, "setup");
|
|
994
1021
|
|
|
995
1022
|
// src/commands/base.command.ts
|
|
996
|
-
var Command = class extends
|
|
1023
|
+
var Command = class extends import_core3.Command {
|
|
997
1024
|
constructor() {
|
|
998
1025
|
super(...arguments);
|
|
999
1026
|
this.store = new StoreService();
|
|
@@ -1020,6 +1047,7 @@ var Command = class extends import_core2.Command {
|
|
|
1020
1047
|
if (err) {
|
|
1021
1048
|
throw err;
|
|
1022
1049
|
}
|
|
1050
|
+
this.logger.trace("init", { status: "stage" });
|
|
1023
1051
|
this.parser = new ParserService();
|
|
1024
1052
|
this.fs = new FileSystemService();
|
|
1025
1053
|
this.validator = new ValidatorService();
|
|
@@ -1046,6 +1074,7 @@ var Command = class extends import_core2.Command {
|
|
|
1046
1074
|
this.logger.fatal("Caught terminate signal.", { context: "exit" });
|
|
1047
1075
|
process.exit(1);
|
|
1048
1076
|
});
|
|
1077
|
+
this.logger.trace("should run before", { status: "stage" });
|
|
1049
1078
|
await this.shouldRunBefore();
|
|
1050
1079
|
}
|
|
1051
1080
|
shouldRunBefore() {
|
|
@@ -1056,7 +1085,9 @@ var Command = class extends import_core2.Command {
|
|
|
1056
1085
|
return;
|
|
1057
1086
|
}
|
|
1058
1087
|
async finally() {
|
|
1088
|
+
this.logger.trace("tasks", { status: "stage" });
|
|
1059
1089
|
const ctx = await this.runTasks();
|
|
1090
|
+
this.logger.trace("should run after", { status: "stage" });
|
|
1060
1091
|
await this.shouldRunAfter(ctx);
|
|
1061
1092
|
return { ctx };
|
|
1062
1093
|
}
|
|
@@ -1082,10 +1113,12 @@ var Command = class extends import_core2.Command {
|
|
|
1082
1113
|
});
|
|
1083
1114
|
}
|
|
1084
1115
|
setCtxDefaults(...defaults) {
|
|
1085
|
-
|
|
1116
|
+
setCtxDefaults(this.tasks.options.ctx, ...defaults);
|
|
1117
|
+
this.logger.trace("updated with defaults: %o", this.tasks.options.ctx, { status: "ctx" });
|
|
1086
1118
|
}
|
|
1087
1119
|
setCtxAssign(...assigns) {
|
|
1088
|
-
|
|
1120
|
+
setCtxAssign(this.tasks.options.ctx, ...assigns);
|
|
1121
|
+
this.logger.trace("updated with assign: %o", this.tasks.options.ctx, { status: "ctx" });
|
|
1089
1122
|
}
|
|
1090
1123
|
greet() {
|
|
1091
1124
|
if (this.cs.isSilent || this.cs.json) {
|
|
@@ -1099,23 +1132,7 @@ var Command = class extends import_core2.Command {
|
|
|
1099
1132
|
}
|
|
1100
1133
|
};
|
|
1101
1134
|
__name(Command, "Command");
|
|
1102
|
-
Command.globalFlags =
|
|
1103
|
-
["log-level"]: import_core2.Flags.enum({
|
|
1104
|
-
default: "INFO" /* INFO */,
|
|
1105
|
-
env: "LOG_LEVEL",
|
|
1106
|
-
description: "Set the log level of the application.",
|
|
1107
|
-
options: [...Object.values(LogLevels), ...Object.values(LogLevels).map((level) => level.toLowerCase())],
|
|
1108
|
-
helpGroup: "CLI" /* CLI */,
|
|
1109
|
-
parse: async (input) => input?.toUpperCase()
|
|
1110
|
-
}),
|
|
1111
|
-
ci: import_core2.Flags.boolean({
|
|
1112
|
-
default: false,
|
|
1113
|
-
env: "CI",
|
|
1114
|
-
description: "Instruct whether this is running the CI/CD configuration.",
|
|
1115
|
-
helpGroup: "CLI" /* CLI */
|
|
1116
|
-
})
|
|
1117
|
-
};
|
|
1118
|
-
Command.args = [];
|
|
1135
|
+
Command.globalFlags = CLI_FLAGS;
|
|
1119
1136
|
|
|
1120
1137
|
// src/commands/config.command.ts
|
|
1121
1138
|
var ConfigCommand = class extends Command {
|
|
@@ -1129,7 +1146,7 @@ var ConfigCommand = class extends Command {
|
|
|
1129
1146
|
throw new Error("The command should be setup first!");
|
|
1130
1147
|
}
|
|
1131
1148
|
table(...options) {
|
|
1132
|
-
|
|
1149
|
+
import_core2.CliUx.ux.table(...options);
|
|
1133
1150
|
}
|
|
1134
1151
|
async generate() {
|
|
1135
1152
|
const response = await this.prompt({
|
|
@@ -1141,14 +1158,15 @@ var ConfigCommand = class extends Command {
|
|
|
1141
1158
|
}
|
|
1142
1159
|
};
|
|
1143
1160
|
__name(ConfigCommand, "ConfigCommand");
|
|
1161
|
+
ConfigCommand.globalFlags = CLI_FLAGS;
|
|
1144
1162
|
|
|
1145
1163
|
// src/hooks/not-found.hook.ts
|
|
1146
|
-
var
|
|
1164
|
+
var import_core4 = require("@oclif/core");
|
|
1147
1165
|
var notFoundHook = /* @__PURE__ */ __name(async (opts) => {
|
|
1148
1166
|
const logger = new Logger(opts.config.name);
|
|
1149
1167
|
logger.fatal("Command not found. Take a look at help. You can also use --[h]elp flag for subcommands.", { custom: opts.config.name });
|
|
1150
1168
|
logger.direct("");
|
|
1151
|
-
const help = new
|
|
1169
|
+
const help = new import_core4.Help(opts.config);
|
|
1152
1170
|
await help.showHelp(["--all"]);
|
|
1153
1171
|
process.exit(127);
|
|
1154
1172
|
}, "notFoundHook");
|
|
@@ -1163,11 +1181,9 @@ var updateNotifierHook = /* @__PURE__ */ __name(async (opts) => {
|
|
|
1163
1181
|
var storeHook = /* @__PURE__ */ __name((cb) => async (opts) => {
|
|
1164
1182
|
cb(opts, new StoreService());
|
|
1165
1183
|
}, "storeHook");
|
|
1166
|
-
|
|
1167
|
-
// src/interfaces/oclif.interface.ts
|
|
1168
|
-
var import_core4 = require("@oclif/core");
|
|
1169
1184
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1170
1185
|
0 && (module.exports = {
|
|
1186
|
+
CLI_FLAGS,
|
|
1171
1187
|
CliUx,
|
|
1172
1188
|
Command,
|
|
1173
1189
|
ConfigCommand,
|
|
@@ -5,7 +5,7 @@ declare type DataStore<T extends Record<PropertyKey, any> = Record<PropertyKey,
|
|
|
5
5
|
} & T;
|
|
6
6
|
|
|
7
7
|
declare class StoreService<T extends Record<PropertyKey, any> = Record<PropertyKey, any>> {
|
|
8
|
-
static instance
|
|
8
|
+
private static instance;
|
|
9
9
|
private store;
|
|
10
10
|
constructor();
|
|
11
11
|
has<K extends keyof DataStore<T>>(key: K): boolean;
|