-
Notifications
You must be signed in to change notification settings - Fork 15
/
code-pushup.config.ts
42 lines (38 loc) · 1.04 KB
/
code-pushup.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import 'dotenv/config';
import { z } from 'zod';
import {
coverageCoreConfigNx,
eslintCoreConfigNx,
jsPackagesCoreConfig,
lighthouseCoreConfig,
} from './code-pushup.preset.js';
import type { CoreConfig } from './packages/models/src/index.js';
import { mergeConfigs } from './packages/utils/src/index.js';
// load upload configuration from environment
const envSchema = z.object({
CP_SERVER: z.string().url(),
CP_API_KEY: z.string().min(1),
CP_ORGANIZATION: z.string().min(1),
CP_PROJECT: z.string().min(1),
});
const { data: env } = await envSchema.safeParseAsync(process.env);
const config: CoreConfig = {
...(env && {
upload: {
server: env.CP_SERVER,
apiKey: env.CP_API_KEY,
organization: env.CP_ORGANIZATION,
project: env.CP_PROJECT,
},
}),
plugins: [],
};
export default mergeConfigs(
config,
await coverageCoreConfigNx(),
await jsPackagesCoreConfig(),
await lighthouseCoreConfig(
'https://github.com/code-pushup/cli?tab=readme-ov-file#code-pushup-cli/',
),
await eslintCoreConfigNx(),
);