( finalOptions: Options, cliOptions: CliOptions, )
| 200 | } |
| 201 | |
| 202 | function getResolvedCreateTelemetryProperties( |
| 203 | finalOptions: Options, |
| 204 | cliOptions: CliOptions, |
| 205 | ) { |
| 206 | const includeExamples = |
| 207 | (<Options & { includeExamples?: boolean }>finalOptions).includeExamples !== false |
| 208 | const addOnIds = sanitizeIdList(finalOptions.chosenAddOns.map((addOn) => addOn.id)) |
| 209 | const deployment = finalOptions.chosenAddOns.find( |
| 210 | (addOn) => addOn.type === 'deployment', |
| 211 | ) |
| 212 | const toolchain = finalOptions.chosenAddOns.find( |
| 213 | (addOn) => addOn.type === 'toolchain', |
| 214 | ) |
| 215 | |
| 216 | return { |
| 217 | ...getStarterTelemetryProperties( |
| 218 | finalOptions.starter?.id || cliOptions.starter || cliOptions.templateId || cliOptions.template, |
| 219 | ), |
| 220 | add_on_count: addOnIds.length, |
| 221 | add_on_ids: addOnIds, |
| 222 | deployment: deployment ? sanitizeId(deployment.id) : undefined, |
| 223 | examples: includeExamples, |
| 224 | framework: sanitizeId(finalOptions.framework.id), |
| 225 | git: finalOptions.git, |
| 226 | install: finalOptions.install !== false, |
| 227 | intent: finalOptions.intent, |
| 228 | package_manager: finalOptions.packageManager, |
| 229 | router_only: !!cliOptions.routerOnly, |
| 230 | toolchain: toolchain ? sanitizeId(toolchain.id) : undefined, |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | function formatErrorMessage(error: unknown) { |
| 235 | return error instanceof Error ? error.message : 'An unknown error occurred' |
no test coverage detected