@cenk1cenk2/oclif-common 3.5.1 → 3.5.2

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/index.d.ts CHANGED
@@ -298,7 +298,7 @@ declare type DeepPartial<T> = {
298
298
  };
299
299
 
300
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 {
301
- static globalFlags: FlagInput;
301
+ static globalFlags: object;
302
302
  logger: Logger;
303
303
  tasks: Manager<Ctx, 'default' | 'verbose' | 'silent' | 'simple'>;
304
304
  validator: ValidatorService;
@@ -336,13 +336,14 @@ declare class Command<Ctx extends ListrContext = ListrContext, Flags extends Rec
336
336
  }
337
337
 
338
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;
339
+ static globalFlags: object;
340
340
  choices: ConfigCommandChoices<CommandChoices>;
341
341
  locker: LockerService<LockFile>;
342
+ private ux;
342
343
  run(): Promise<void>;
343
- setup(): ConfigCommandSetup<CommandChoices, LockFile> | Promise<ConfigCommandSetup<CommandChoices, LockFile>>;
344
+ construct(): ConfigCommandSetup<CommandChoices, LockFile> | Promise<ConfigCommandSetup<CommandChoices, LockFile>>;
344
345
  protected table(...options: Parameters<typeof CliUx.ux.table>): void;
345
- private generate;
346
+ private select;
346
347
  }
347
348
 
348
349
  declare enum FileConstants {
package/dist/index.js CHANGED
@@ -1084,7 +1084,7 @@ var Command = class extends import_core3.Command {
1084
1084
  shouldRunAfter(_ctx) {
1085
1085
  }
1086
1086
  run() {
1087
- return;
1087
+ throw new Error("The command should have a run function to do something!");
1088
1088
  }
1089
1089
  async finally() {
1090
1090
  this.logger.trace("tasks", { status: "stage" });
@@ -1138,25 +1138,30 @@ Command.globalFlags = CLI_FLAGS;
1138
1138
 
1139
1139
  // src/commands/config.command.ts
1140
1140
  var ConfigCommand = class extends Command {
1141
+ constructor() {
1142
+ super(...arguments);
1143
+ this.ux = import_core2.CliUx.ux;
1144
+ }
1141
1145
  async run() {
1142
- const setup2 = await this.setup();
1146
+ const setup2 = await this.construct();
1143
1147
  this.choices = setup2.choices;
1144
1148
  this.locker = setup2.locker;
1145
- await this.generate();
1149
+ const response = await this.select();
1150
+ return this.choices[response].bind(this)();
1146
1151
  }
1147
- setup() {
1152
+ construct() {
1148
1153
  throw new Error("The command should be setup first!");
1149
1154
  }
1150
1155
  table(...options) {
1151
- import_core2.CliUx.ux.table(...options);
1156
+ this.ux.table(...options);
1152
1157
  }
1153
- async generate() {
1158
+ async select() {
1154
1159
  const response = await this.prompt({
1155
1160
  type: "Select",
1156
1161
  message: "Please select what to do with the configuration.",
1157
1162
  choices: Object.keys(this.choices)
1158
1163
  });
1159
- return this.choices[response].bind(this)();
1164
+ return response;
1160
1165
  }
1161
1166
  };
1162
1167
  __name(ConfigCommand, "ConfigCommand");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "author": {