@cenk1cenk2/oclif-common 6.0.3 → 6.0.4

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
@@ -186,7 +186,7 @@ declare class ParserService {
186
186
  parsers: ClassType<GenericParser>[];
187
187
  constructor(moduleRef: ModuleRef, fs: FileSystemService, logger: LoggerService);
188
188
  getParser(file: string): Promise<GenericParser>;
189
- injectParser(Parser: ClassType<GenericParser>): Promise<GenericParser>;
189
+ inject<T extends GenericParser>(Parser: ClassType<T>): Promise<T>;
190
190
  setParsers(...parsers: ClassType<GenericParser>[]): void;
191
191
  addParsers(...parsers: ClassType<GenericParser>[]): void;
192
192
  read<T = unknown>(file: string): Promise<T>;
@@ -328,7 +328,7 @@ declare class ValidatorService {
328
328
  private logValidationError;
329
329
  }
330
330
 
331
- declare function setup(): void;
331
+ declare function setup(): Promise<void>;
332
332
 
333
333
  interface CliModuleOptions {
334
334
  config: ConfigModuleOptions;
@@ -343,7 +343,7 @@ declare class CliModule {
343
343
  declare class ShouldRunBeforeHook {
344
344
  shouldRunBefore(): void | Promise<void>;
345
345
  }
346
- declare class ShouldRunAfterHook<Ctx> {
346
+ declare class ShouldRunAfterHook<Ctx extends ListrContext = ListrContext> {
347
347
  shouldRunAfter(ctx: Ctx): void | Promise<void>;
348
348
  }
349
349
  declare class RegisterHook {
package/dist/index.js CHANGED
@@ -1,13 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined")
8
- return require.apply(this, arguments);
9
- throw Error('Dynamic require of "' + x + '" is not supported');
10
- });
11
4
  var __publicField = (obj, key, value) => {
12
5
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13
6
  return value;
@@ -791,9 +784,9 @@ var ParserService = (_a9 = class {
791
784
  if (!Parser) {
792
785
  throw new Error(`Parser for the extension is not configured: ${ext}`);
793
786
  }
794
- return this.injectParser(Parser);
787
+ return this.inject(Parser);
795
788
  }
796
- async injectParser(Parser) {
789
+ async inject(Parser) {
797
790
  const parser = await this.moduleRef.create(Parser);
798
791
  return parser;
799
792
  }
@@ -1582,35 +1575,15 @@ ValidatorModule = _ts_decorate18([
1582
1575
  ], ValidatorModule);
1583
1576
 
1584
1577
  // src/lib/setup.ts
1585
- function setup() {
1578
+ async function setup() {
1586
1579
  const inspect = process.argv.indexOf("--inspect");
1587
1580
  if (inspect !== -1) {
1588
- __require("inspector").open();
1581
+ await import("inspector").then((mod) => mod.open());
1589
1582
  process.argv.splice(inspect, 1);
1590
1583
  }
1591
- const verbose = process.argv.indexOf("--verbose");
1592
- if (verbose !== -1) {
1593
- process.env.LOG_LEVEL = "verbose";
1594
- process.argv.splice(verbose, 1);
1595
- }
1596
- const debug = process.argv.indexOf("--debug");
1597
- if (debug !== -1) {
1598
- process.env.LOG_LEVEL = "debug";
1599
- process.argv.splice(debug, 1);
1600
- }
1601
- const trace = process.argv.indexOf("--trace");
1602
- if (trace !== -1) {
1603
- process.env.LOG_LEVEL = "trace";
1604
- process.argv.splice(trace, 1);
1605
- }
1606
- const silent = process.argv.indexOf("--silent");
1607
- if (silent !== -1) {
1608
- process.env.LOG_LEVEL = "silent";
1609
- process.argv.splice(silent, 1);
1610
- }
1611
1584
  const sourceMaps = process.argv.indexOf("--source-map");
1612
1585
  if (sourceMaps !== -1) {
1613
- __require("source-map-support").install();
1586
+ await import("source-map-support").then((mod) => mod.install());
1614
1587
  process.argv.splice(sourceMaps, 1);
1615
1588
  }
1616
1589
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "type": "module",
@@ -80,6 +80,7 @@
80
80
  "execa": "^8.0.1",
81
81
  "fs-extra": "^11.1.1",
82
82
  "listr2": "^7.0.2",
83
+ "source-map-support": "^0.5.21",
83
84
  "yaml": "^2.3.3"
84
85
  }
85
86
  }