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

Function getExamplesEntryPoint

packages/tools/docgen/src/Core.ts:338–349  ·  view source on GitHub ↗
(examples: ReadonlyArray<Domain.File>)

Source from the content-addressed store, hash-verified

336 * Generates an entry point file for the given examples.
337 */
338const getExamplesEntryPoint = (examples: ReadonlyArray<Domain.File>) =>
339 Effect.gen(function*() {
340 const config = yield* Configuration.Configuration
341 const path = yield* Path.Path
342 const content = examples.map((example) => `import './${path.basename(example.path, ".ts")}'`)
343 .join("\n")
344 return new Domain.File(
345 path.normalize(path.join(config.outDir, "examples", "index.ts")),
346 `${content}\n`,
347 true // make the file overwritable
348 )
349 })
350
351/**
352 * Removes the "examples" directory from the output directory specified in the configuration.

Callers 1

writeExamplesToOutDirFunction · 0.85

Calls 2

joinMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected