Skip to content

Commit ccfc1df

Browse files
committed
fix: adjust models
1 parent 9b9616e commit ccfc1df

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

packages/cli/src/lib/implementation/core-config.model.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import type { CoreConfig, Format, UploadConfig } from '@code-pushup/models';
1+
import type {
2+
CacheConfig,
3+
CoreConfig,
4+
Format,
5+
UploadConfig,
6+
} from '@code-pushup/models';
27

38
export type PersistConfigCliOptions = {
49
'persist.outputDir'?: string;
@@ -13,6 +18,11 @@ export type UploadConfigCliOptions = {
1318
'upload.server'?: string;
1419
};
1520

21+
export type CacheConfigCliOptions = {
22+
'cache.read'?: boolean;
23+
'cache.write'?: boolean;
24+
};
25+
1626
export type ConfigCliOptions = {
1727
config?: string;
1828
tsconfig?: string;
@@ -21,4 +31,4 @@ export type ConfigCliOptions = {
2131

2232
export type CoreConfigCliOptions = Pick<CoreConfig, 'persist'> & {
2333
upload?: Partial<Omit<UploadConfig, 'timeout'>>;
24-
};
34+
} & CacheConfig;

packages/cli/src/lib/implementation/core-config.options.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Options } from 'yargs';
22
import type {
3+
CacheConfigCliOptions,
34
PersistConfigCliOptions,
45
UploadConfigCliOptions,
56
} from './core-config.model.js';
@@ -11,6 +12,7 @@ export function yargsCoreConfigOptionsDefinition(): Record<
1112
return {
1213
...yargsPersistConfigOptionsDefinition(),
1314
...yargsUploadConfigOptionsDefinition(),
15+
...yargsCacheConfigOptionsDefinition(),
1416
};
1517
}
1618

@@ -57,3 +59,19 @@ export function yargsUploadConfigOptionsDefinition(): Record<
5759
},
5860
};
5961
}
62+
63+
export function yargsCacheConfigOptionsDefinition(): Record<
64+
keyof CacheConfigCliOptions,
65+
Options
66+
> {
67+
return {
68+
'cache.read': {
69+
describe: 'Read runner-output.json to file system',
70+
type: 'boolean',
71+
},
72+
'cache.write': {
73+
describe: 'Write runner-output.json to file system',
74+
type: 'boolean',
75+
},
76+
};
77+
}

0 commit comments

Comments
 (0)