Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add version details property to config interface #652

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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