| 100 | const compilerOptionsSchema = Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown)) |
| 101 | |
| 102 | const parseCompilerOptionsFlag = (name: string, description: string) => |
| 103 | Flag.string(name).pipe( |
| 104 | Flag.withDescription(description), |
| 105 | Flag.mapEffect((value) => |
| 106 | Schema.decodeUnknownEffect(compilerOptionsSchema)(value).pipe( |
| 107 | Effect.mapError((error) => |
| 108 | new CliError.InvalidValue({ |
| 109 | option: name, |
| 110 | value, |
| 111 | expected: `a JSON record (${globalThis.String(error)})`, |
| 112 | kind: "flag" |
| 113 | }) |
| 114 | ) |
| 115 | ) |
| 116 | ) |
| 117 | ) |
| 118 | |
| 119 | const parseCompilerOptionsFile = Flag.file("parse-tsconfig-file", { mustExist: true }).pipe( |
| 120 | Flag.withDescription("The TypeScript TSConfig file to use for parsing source files"), |