MCPcopy Create free account
hub / github.com/Effect-TS/effect / createProject

Function createProject

packages/tools/docgen/src/Parser.ts:703–729  ·  view source on GitHub ↗
(files: ReadonlyArray<Domain.File>)

Source from the content-addressed store, hash-verified

701 }
702
703const 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.

Callers 1

parseFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected