| 47 | const context = yield* Effect.context<never>() |
| 48 | const docgenJson = Option.getOrElse(Context.getOption(context, DocgenJsonTag), () => ({} as DocgenJson)) |
| 49 | const readFileString: FileSystem.FileSystem["readFileString"] = (filePath) => { |
| 50 | const fileName = path.basename(filePath) |
| 51 | if (fileName === "package.json") { |
| 52 | return Effect.succeed(JSON.stringify({ name: "name", homepage: "homepage" })) |
| 53 | } else if (fileName === "docgen.json") { |
| 54 | return Effect.succeed(JSON.stringify(docgenJson)) |
| 55 | } |
| 56 | return Effect.die(`file not found: ${filePath}`) |
| 57 | } |
| 58 | const exists: FileSystem.FileSystem["exists"] = (filePath) => { |
| 59 | const fileName = path.basename(filePath) |
| 60 | if (fileName === "invalid-json.txt") { |