* Finalizes the generation process by writing the generated files to the output directory.
()
| 255 | * Finalizes the generation process by writing the generated files to the output directory. |
| 256 | */ |
| 257 | async finalize() { |
| 258 | const generatedMapPath = this.generator.outputPathTo('polygen-output.json'); |
| 259 | const resolvedExternalModules = |
| 260 | await this.project.modules.getExternalModules(); |
| 261 | const contents = { |
| 262 | files: this.generator.writtenFiles, |
| 263 | externalPackages: Object.fromEntries( |
| 264 | resolvedExternalModules.map((m) => [m.packageName, m.resolvedPath]) |
| 265 | ), |
| 266 | }; |
| 267 | |
| 268 | await fs.writeFile( |
| 269 | generatedMapPath, |
| 270 | JSON.stringify(contents, undefined, 2) |
| 271 | ); |
| 272 | } |
| 273 | |
| 274 | get rootOutput(): OutputGenerator { |
| 275 | return this.generator; |
no test coverage detected