Skip to content

Commit

Permalink
fix: add version details property to config interface (#652)
Browse files Browse the repository at this point in the history
@W-12647786@
  • Loading branch information
peternhale authored Mar 9, 2023
1 parent 055ba95 commit 378095d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/interfaces/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ export type LoadOptions = Options | string | Config | undefined
export type PlatformTypes = 'darwin' | 'linux' | 'win32' | 'aix' | 'freebsd' | 'openbsd' | 'sunos' | 'wsl'
export type ArchTypes = 'arm' | 'arm64' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | 'x86'

export type PluginVersionDetail = {
version: string;
type: string;
root: string
};

export type VersionDetails = {
cliVersion: string;
architecture: string;
nodeVersion: string;
pluginVersions?: Record<string, {version: string; type: string; root: string}>;
pluginVersions?: Record<string, PluginVersionDetail>;
osVersion?: string;
shell?: string;
rootPath?: string;
Expand Down Expand Up @@ -107,6 +113,7 @@ export interface Config {
readonly commands: Command.Loadable[];
readonly topics: Topic[];
readonly commandIDs: string[];
readonly versionDetails: VersionDetails

runCommand<T = unknown>(id: string, argv?: string[], cachedCommand?: Command.Loadable): Promise<T>;
runHook<T extends keyof Hooks>(event: T, opts: Hooks[T]['options'], timeout?: number, captureErrors?: boolean): Promise<Hook.Result<Hooks[T]['return']>>;
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export {AlphabetLowercase, AlphabetUppercase} from './alphabet'
export {Config, ArchTypes, PlatformTypes, LoadOptions} from './config'
export {Config, ArchTypes, PlatformTypes, LoadOptions, VersionDetails, PluginVersionDetail} from './config'
export {OclifError, PrettyPrintableError, CommandError} from './errors'
export {HelpOptions} from './help'
export {Hook, Hooks} from './hooks'
Expand Down

0 comments on commit 378095d

Please sign in to comment.