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

Function writeMarkdown

packages/tools/docgen/src/Core.ts:579–591  ·  view source on GitHub ↗
(files: ReadonlyArray<Domain.File>)

Source from the content-addressed store, hash-verified

577 }))
578
579const writeMarkdown = (files: ReadonlyArray<Domain.File>) =>
580 Effect.gen(function*() {
581 const config = yield* Configuration.Configuration
582 const fileSystem = yield* FileSystem.FileSystem
583 const path = yield* Path.Path.pipe(Effect.provide(NodePath.layerPosix))
584 const pattern = path.normalize(path.join(config.outDir, "**/*.ts.md"))
585 yield* Effect.logDebug(`Deleting ${chalk.black(pattern)}...`)
586 const paths = yield* glob(pattern)
587 yield* Effect.forEach(paths, (path) => fileSystem.remove(path, { recursive: true }), {
588 concurrency: "unbounded"
589 })
590 return yield* writeFilesToOutDir(files)
591 })
592
593/** @internal */
594export const program = Effect.gen(function*() {

Callers 1

Core.tsFile · 0.85

Calls 7

writeFilesToOutDirFunction · 0.85
joinMethod · 0.80
globFunction · 0.70
pipeMethod · 0.65
forEachMethod · 0.65
provideMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected