( options: Partial<UploadConfig & ProjectExecutorOnlyOptions>, context: NormalizedExecutorContext, )
| 43 | } |
| 44 | |
| 45 | export function uploadConfig( |
| 46 | options: Partial<UploadConfig & ProjectExecutorOnlyOptions>, |
| 47 | context: NormalizedExecutorContext, |
| 48 | ): Partial<UploadConfig> { |
| 49 | const { workspaceRoot, projectName } = context; |
| 50 | |
| 51 | const { projectPrefix, server, apiKey, organization, project, timeout } = |
| 52 | options; |
| 53 | const applyPrefix = workspaceRoot !== '.'; |
| 54 | const prefix = projectPrefix && applyPrefix ? `${projectPrefix}-` : ''; |
| 55 | |
| 56 | const derivedProject = |
| 57 | projectName && !project ? `${prefix}${projectName}` : project; |
| 58 | |
| 59 | return { |
| 60 | ...parseEnv(process.env), |
| 61 | ...Object.fromEntries( |
| 62 | Object.entries({ |
| 63 | server, |
| 64 | apiKey, |
| 65 | organization, |
| 66 | ...(derivedProject ? { project: derivedProject } : {}), |
| 67 | timeout, |
| 68 | }).filter(([_, v]) => v !== undefined), |
| 69 | ), |
| 70 | }; |
| 71 | } |
no test coverage detected