add getGeneratedDirectory to GenerateExtraFiles
@@ -42,6 +42,7 @@ import type {FormatModule} from 'writeRelayGeneratedFile';
export type GenerateExtraFiles = (
getOutputDirectory: (path?: string) => CodegenDirectory,
compilerContext: RelayCompilerContext,
+ getGeneratedDirectory: (definitionName: string) => CodegenDirectory,
) => void;
export type WriterConfig = {
@@ -231,7 +232,8 @@ class RelayFileWriter implements FileWriterInterface {
if (this._config.generateExtraFiles) {
const configDirectory = this._config.outputDir;
- this._config.generateExtraFiles(dir => {
+ this._config.generateExtraFiles(
+ dir => {
const outputDirectory = dir || configDirectory;
invariant(
outputDirectory,
@@ -243,7 +245,10 @@ class RelayFileWriter implements FileWriterInterface {
outputDir = addCodegenDir(outputDirectory);
}
return outputDir;
- }, transformedQueryContext);
+ },
+ transformedQueryContext,
+ getGeneratedDirectory,
+ );
}
// clean output directories
