@oclif/core 1.16.2 → 1.16.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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.16.4](https://github.com/oclif/core/compare/v1.16.3...v1.16.4) (2022-09-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * work with 4.8.3 ([#493](https://github.com/oclif/core/issues/493)) ([2f09a72](https://github.com/oclif/core/commit/2f09a725bb7ff7ef8b4f4d6d6f67d0d83a1ed1f8))
11
+
12
+ ### [1.16.3](https://github.com/oclif/core/compare/v1.16.2...v1.16.3) (2022-09-16)
13
+
5
14
  ### [1.16.2](https://github.com/oclif/core/compare/v1.16.1...v1.16.2) (2022-09-16)
6
15
 
7
16
 
@@ -17,7 +17,7 @@ export declare const ux: {
17
17
  readonly confirm: typeof import("./prompt").confirm;
18
18
  readonly action: ActionBase;
19
19
  readonly prideAction: ActionBase;
20
- styledObject(obj: any, keys?: string[] | undefined): void;
20
+ styledObject(obj: any, keys?: string[]): void;
21
21
  readonly styledHeader: typeof import("./styled/header").default;
22
22
  readonly styledJSON: typeof import("./styled/json").default;
23
23
  readonly table: typeof Table.table;
@@ -29,7 +29,7 @@ export declare const ux: {
29
29
  trace(format: string, ...args: string[]): void;
30
30
  debug(format: string, ...args: string[]): void;
31
31
  info(format: string, ...args: string[]): void;
32
- log(format?: string | undefined, ...args: string[]): void;
32
+ log(format?: string, ...args: string[]): void;
33
33
  url(text: string, uri: string, params?: {}): void;
34
34
  annotation(text: string, annotation: string): void;
35
35
  flush(ms?: number): Promise<void>;
package/lib/command.d.ts CHANGED
@@ -95,7 +95,7 @@ export default abstract class Command {
95
95
  */
96
96
  abstract run(): PromiseLike<any>;
97
97
  protected init(): Promise<any>;
98
- protected parse<F, G, A extends {
98
+ protected parse<F extends Interfaces.FlagOutput, G extends Interfaces.FlagOutput, A extends {
99
99
  [name: string]: any;
100
100
  }>(options?: Interfaces.Input<F, G>, argv?: string[]): Promise<Interfaces.ParserOutput<F, G, A>>;
101
101
  protected catch(err: Error & {
package/lib/command.js CHANGED
@@ -48,10 +48,8 @@ class Command {
48
48
  this.globalFlags = jsonFlag;
49
49
  }
50
50
  else {
51
- // @ts-expect-error because this.globalFlags is typed as a plain object
52
51
  delete this.globalFlags?.json;
53
52
  this.flags = {}; // force the flags setter to run
54
- // @ts-expect-error because this.flags is typed as a plain object
55
53
  delete this.flags?.json;
56
54
  }
57
55
  }
package/lib/help/index.js CHANGED
@@ -131,7 +131,12 @@ class Help extends HelpBase {
131
131
  this.log('');
132
132
  }
133
133
  if (subCommands.length > 0) {
134
- this.log(this.formatCommands(subCommands));
134
+ const aliases = [];
135
+ const uniqueSubCommands = subCommands.filter(p => {
136
+ aliases.push(...p.aliases);
137
+ return !aliases.includes(p.id);
138
+ });
139
+ this.log(this.formatCommands(uniqueSubCommands));
135
140
  this.log('');
136
141
  }
137
142
  }
@@ -243,7 +243,9 @@ export declare type CompletableOptionFlag<T> = OptionFlag<T> & {
243
243
  completion?: Completion;
244
244
  };
245
245
  export declare type CompletableFlag<T> = BooleanFlag<T> | CompletableOptionFlag<T>;
246
- export declare type FlagInput<T extends FlagOutput = object> = {
246
+ export declare type FlagInput<T extends FlagOutput = {
247
+ [flag: string]: any;
248
+ }> = {
247
249
  [P in keyof T]: CompletableFlag<T[P]>;
248
250
  };
249
251
  export {};
package/lib/main.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Interfaces from './interfaces';
2
2
  import { Config } from './config';
3
3
  export declare const helpAddition: (argv: string[], config: Interfaces.Config) => boolean;
4
- export declare const versionAddition: (argv: string[], config?: Interfaces.Config | undefined) => boolean;
4
+ export declare const versionAddition: (argv: string[], config?: Interfaces.Config) => boolean;
5
5
  export declare function run(argv?: string[], options?: Interfaces.LoadOptions): Promise<unknown>;
@@ -1,10 +1,10 @@
1
1
  import * as args from './args';
2
2
  import * as flags from './flags';
3
- import { Input, ParserOutput } from '../interfaces';
3
+ import { Input, ParserOutput, OutputFlags, FlagOutput } from '../interfaces';
4
4
  export { args };
5
5
  export { flags };
6
6
  export { flagUsages } from './help';
7
- export declare function parse<TFlags, GFlags, TArgs extends {
7
+ export declare function parse<TFlags extends OutputFlags<any>, GFlags extends FlagOutput, TArgs extends {
8
8
  [name: string]: string;
9
9
  }>(argv: string[], options: Input<TFlags, GFlags>): Promise<ParserOutput<TFlags, GFlags, TArgs>>;
10
10
  export { boolean, integer, url, directory, file, string, build, option, custom } from './flags';
@@ -1,4 +1,6 @@
1
- export declare function pickBy<T>(obj: T, fn: (i: T[keyof T]) => boolean): Partial<T>;
1
+ export declare function pickBy<T extends {
2
+ [s: string]: T[keyof T];
3
+ } | ArrayLike<T[keyof T]>>(obj: T, fn: (i: T[keyof T]) => boolean): Partial<T>;
2
4
  export declare function maxBy<T>(arr: T[], fn: (i: T) => number): T | undefined;
3
5
  declare type SortTypes = string | number | undefined | boolean;
4
6
  export declare function sortBy<T>(arr: T[], fn: (i: T) => SortTypes | SortTypes[]): T[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "1.16.2",
4
+ "version": "1.16.4",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -73,9 +73,9 @@
73
73
  "shelljs": "^0.8.5",
74
74
  "shx": "^0.3.4",
75
75
  "sinon": "^11.1.2",
76
- "ts-node": "^9.1.1",
76
+ "ts-node": "^10.9.1",
77
77
  "tsd": "^0.22.0",
78
- "typescript": "4.5.5"
78
+ "typescript": "^4.8.3"
79
79
  },
80
80
  "engines": {
81
81
  "node": ">=14.0.0"
@@ -111,7 +111,7 @@
111
111
  "prepack": "yarn run build",
112
112
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
113
113
  "test:e2e": "mocha \"test/**/*.e2e.ts\" --timeout 600000",
114
- "pretest": "yarn build --noEmit && tsc -p test --noEmit"
114
+ "pretest": "yarn build --noEmit && tsc -p test --noEmit --skipLibCheck"
115
115
  },
116
116
  "types": "lib/index.d.ts"
117
117
  }