* Generate all entrypoint-* files
( project: Project, p: FsProject, targets: Target[] )
| 508 | * Generate all entrypoint-* files |
| 509 | */ |
| 510 | function generateEntrypoints( |
| 511 | project: Project, |
| 512 | p: FsProject, |
| 513 | targets: Target[] |
| 514 | ) { |
| 515 | /** Array of entrypoint files to be imported during the test */ |
| 516 | let entrypoints: string[] = []; |
| 517 | for (const entrypointExt of ['cjs', 'mjs'] as const) { |
| 518 | // TODO consider removing this logic; deferring to conditionals in the generateEntrypoint which emit meaningful comments |
| 519 | const withExtPermutations = |
| 520 | entrypointExt == 'mjs' && |
| 521 | project.experimentalSpecifierResolutionNode === false |
| 522 | ? [true] |
| 523 | : [false, true]; |
| 524 | for (const withExt of withExtPermutations) { |
| 525 | // Location of the entrypoint |
| 526 | for (const entrypointLocation of ['src', 'out'] as const) { |
| 527 | // Target of the entrypoint's import statements |
| 528 | for (const entrypointTargetting of ['src', 'out'] as const) { |
| 529 | // TODO re-enable when we have out <-> src mapping |
| 530 | if (entrypointLocation !== 'src') continue; |
| 531 | if (entrypointTargetting !== 'src') continue; |
| 532 | |
| 533 | entrypoints.push( |
| 534 | generateEntrypoint(project, p, targets, { |
| 535 | entrypointExt, |
| 536 | withExt, |
| 537 | entrypointLocation, |
| 538 | entrypointTargetting, |
| 539 | }) |
| 540 | ); |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | } |
| 545 | return entrypoints; |
| 546 | } |
| 547 | |
| 548 | function generateEntrypoint( |
| 549 | project: Project, |
no test coverage detected
searching dependent graphs…