@@ -27,14 +27,14 @@ import typescriptPlugin, {
2727 getCategories ,
2828} from './packages/plugin-typescript/src/index.js' ;
2929
30- export function configureUpload ( ) : CoreConfig {
30+ export function configureUpload ( projectName ?: string ) : CoreConfig {
3131 return {
3232 ...( process . env [ 'CP_API_KEY' ] && {
3333 upload : {
3434 server : 'https://api.staging.code-pushup.dev/graphql' ,
3535 apiKey : process . env [ 'CP_API_KEY' ] ,
3636 organization : 'code-pushup' ,
37- project : process . env [ 'NX_TASK_TARGET_PROJECT' ] ?? 'cli-workspace' ,
37+ project : projectName ? `cli- ${ projectName } ` : 'cli-workspace' ,
3838 } ,
3939 } ) ,
4040 plugins : [ ] ,
@@ -89,20 +89,19 @@ export async function configureEslintPlugin(
8989export async function configureCoveragePlugin (
9090 projectName ?: string ,
9191) : Promise < CoreConfig > {
92+ const targets = [ 'unit-test' , 'int-test' ] ;
9293 const config : CoveragePluginConfig = projectName
9394 ? // We do not need to run a coverageToolCommand. This is handled over the Nx task graph.
9495 {
95- reports : [
96- {
97- pathToProject : `packages/${ projectName } ` ,
98- resultsPath : `packages/${ projectName } /coverage/lcov.info` ,
99- } ,
100- ] ,
96+ reports : targets . map ( target => ( {
97+ pathToProject : `packages/${ projectName } ` ,
98+ resultsPath : `coverage/${ projectName } /${ target } s/lcov.info` ,
99+ } ) ) ,
101100 }
102101 : {
103- reports : await getNxCoveragePaths ( [ 'unit-test' , 'int-test' ] ) ,
102+ reports : await getNxCoveragePaths ( targets ) ,
104103 coverageToolCommand : {
105- command : ' npx nx run-many -t unit-test,int-test' ,
104+ command : ` npx nx run-many -t ${ targets . join ( ',' ) } ` ,
106105 } ,
107106 } ;
108107 return {
0 commit comments