@cenk1cenk2/oclif-common 4.0.2 → 5.0.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +19 -32
  2. package/dist/index.js +428 -286
  3. package/package.json +10 -11
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Command as Command$1, ux, Hook } from '@oclif/core';
2
2
  export { Flags, ux } from '@oclif/core';
3
3
  import { ExecaChildProcess } from 'execa';
4
- import { Logger as Logger$2, ListrTaskWrapper, ListrContext, Manager, PromptOptions } from 'listr2';
4
+ import { ListrTaskWrapper, ListrContext, Manager, PromptOptions } from 'listr2';
5
5
  import { Logger as Logger$1, LeveledLogMethod } from 'winston';
6
6
  import fs from 'fs-extra';
7
7
  export { default as fs } from 'fs-extra';
@@ -15,6 +15,8 @@ import * as colorette from 'colorette';
15
15
 
16
16
  type ClassType<T> = new (...args: any[]) => T;
17
17
 
18
+ declare function pipeProcessThroughListr(task: ListrTaskWrapper<any, any>, instance: ExecaChildProcess): ExecaChildProcess;
19
+
18
20
  declare enum LogLevels {
19
21
  SILENT = "SILENT",
20
22
  DIRECT = "DIRECT",
@@ -34,6 +36,21 @@ declare enum LogFieldStatus {
34
36
  TERMINATE = "terminate"
35
37
  }
36
38
 
39
+ interface PipeProcessToLoggerOptions {
40
+ /** Will log the command when the process starts. */
41
+ start?: LogLevels;
42
+ /** Will log the command when the process ends. */
43
+ end?: LogLevels;
44
+ /** enable/disable stdout */
45
+ stdout?: LogLevels;
46
+ /** enable/disable stderrr */
47
+ stderr?: LogLevels;
48
+ /** will callback on error in the instance */
49
+ callback?: (error?: Error) => void;
50
+ /** context for logger */
51
+ context?: string;
52
+ }
53
+
37
54
  interface LoggerOptions {
38
55
  useIcons?: boolean;
39
56
  level?: LogLevels;
@@ -72,36 +89,6 @@ declare class Logger {
72
89
  private logColoring;
73
90
  }
74
91
 
75
- declare class ListrLogger extends Logger$2 {
76
- logger: Logger;
77
- constructor(context?: string);
78
- fail(message: string): void;
79
- skip(message: string): void;
80
- success(message: string): void;
81
- data(message: string): void;
82
- start(message: string): void;
83
- title(message: string): void;
84
- retry(message: string): void;
85
- rollback(message: string): void;
86
- }
87
-
88
- declare function pipeProcessThroughListr(task: ListrTaskWrapper<any, any>, instance: ExecaChildProcess): ExecaChildProcess;
89
-
90
- interface PipeProcessToLoggerOptions {
91
- /** Will log the command when the process starts. */
92
- start?: LogLevels;
93
- /** Will log the command when the process ends. */
94
- end?: LogLevels;
95
- /** enable/disable stdout */
96
- stdout?: LogLevels;
97
- /** enable/disable stderrr */
98
- stderr?: LogLevels;
99
- /** will callback on error in the instance */
100
- callback?: (error?: Error) => void;
101
- /** context for logger */
102
- context?: string;
103
- }
104
-
105
92
  /**
106
93
  * Given the instance it will pipe process output through the logger to append prefixes such as the application name.
107
94
  */
@@ -392,4 +379,4 @@ declare const updateNotifierHook: Hook<'init'>;
392
379
 
393
380
  declare const storeHook: <T extends Record<PropertyKey, any> = Record<PropertyKey, any>>(cb: (opts: any, store: StoreService<T>) => void) => Hook<'init'>;
394
381
 
395
- export { CLI_FLAGS, ClassType, Command, CommonLockerData, ConfigCommand, ConfigCommandChoices, ConfigCommandSetup, ConfigIterator, ConfigService, DataStore, DeepPartial, EnvironmentVariableParser, FileConstants, FileSystemService, GenericParser, GlobalConfig, HelpGroups, InferArgs, InferFlags, JsonParser, ListrLogger, LockData, LockableData, LockerService, LogFieldStatus, LogLevels, Logger, LoggerFormat, LoggerOptions, MergeStrategy, ParserService, PipeProcessToLoggerOptions, SetCtxAssignOptions, SetCtxDefaultsOptions, StoreService, UnlockData, ValidatorService, ValidatorServiceOptions, Winston, YamlParser, color, isDebug, isSilent, isVerbose, merge, notFoundHook, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup, storeHook, uniqueFilter, updateNotifierHook };
382
+ export { CLI_FLAGS, ClassType, Command, CommonLockerData, ConfigCommand, ConfigCommandChoices, ConfigCommandSetup, ConfigIterator, ConfigService, DataStore, DeepPartial, EnvironmentVariableParser, FileConstants, FileSystemService, GenericParser, GlobalConfig, HelpGroups, InferArgs, InferFlags, JsonParser, LockData, LockableData, LockerService, LogFieldStatus, LogLevels, Logger, LoggerFormat, LoggerOptions, MergeStrategy, ParserService, PipeProcessToLoggerOptions, SetCtxAssignOptions, SetCtxDefaultsOptions, StoreService, UnlockData, ValidatorService, ValidatorServiceOptions, Winston, YamlParser, color, isDebug, isSilent, isVerbose, merge, notFoundHook, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup, storeHook, uniqueFilter, updateNotifierHook };