( language: languages.Language, sourceFile: string, sourceLanguage: string, alphabetizeProperties: boolean, additionalRendererOptions: RendererOptions, graphqlSchema?: string )
| 71 | } |
| 72 | |
| 73 | export async function quicktypeForLanguage( |
| 74 | language: languages.Language, |
| 75 | sourceFile: string, |
| 76 | sourceLanguage: string, |
| 77 | alphabetizeProperties: boolean, |
| 78 | additionalRendererOptions: RendererOptions, |
| 79 | graphqlSchema?: string |
| 80 | ) { |
| 81 | try { |
| 82 | await quicktype({ |
| 83 | srcLang: sourceLanguage, |
| 84 | lang: language.name, |
| 85 | src: [sourceFile], |
| 86 | out: language.output, |
| 87 | graphqlSchema, |
| 88 | topLevel: language.topLevel, |
| 89 | alphabetizeProperties, |
| 90 | rendererOptions: _.merge( |
| 91 | {}, |
| 92 | language.rendererOptions, |
| 93 | additionalRendererOptions |
| 94 | ), |
| 95 | quiet: true |
| 96 | }); |
| 97 | } catch (e) { |
| 98 | failWith("quicktype threw an exception", { error: e }); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | export async function inDir(dir: string, work: () => Promise<void>) { |
| 103 | let origin = process.cwd(); |
searching dependent graphs…