| 701 | } |
| 702 | |
| 703 | const createProject = (files: ReadonlyArray<Domain.File>) => |
| 704 | Effect.gen(function*() { |
| 705 | const config = yield* Configuration.Configuration |
| 706 | const process = yield* Domain.Process |
| 707 | const cwd = yield* process.cwd |
| 708 | // Convert the raw config into a format that TS/TS-Morph expects |
| 709 | const parsed = ast.ts.parseJsonConfigFileContent( |
| 710 | { |
| 711 | compilerOptions: { |
| 712 | strict: true, |
| 713 | moduleResolution: "node", |
| 714 | ...config.parseCompilerOptions |
| 715 | } |
| 716 | }, |
| 717 | ast.ts.sys, |
| 718 | cwd |
| 719 | ) |
| 720 | |
| 721 | const options: ast.ProjectOptions = { |
| 722 | compilerOptions: parsed.options |
| 723 | } |
| 724 | const project = new ast.Project(options) |
| 725 | for (const file of files) { |
| 726 | project.addSourceFileAtPath(file.path) |
| 727 | } |
| 728 | return project |
| 729 | }) |
| 730 | |
| 731 | /** |
| 732 | * Parses source files into module documentation models sorted by path. |