diff --git a/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources-framework/framework.ts b/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources-framework/framework.ts index 5ffc3a06670ec..0f628dd448593 100644 --- a/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources-framework/framework.ts +++ b/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources-framework/framework.ts @@ -76,7 +76,7 @@ export class CdkCustomResourceModule extends Module { /** * Render module with components into an output file. */ - public render(file: string) { + public renderTo(file: string) { fs.outputFileSync(file, this.renderer.render(this)); } diff --git a/packages/@aws-cdk/custom-resource-handlers/scripts/generate.ts b/packages/@aws-cdk/custom-resource-handlers/scripts/generate.ts index ea97f9a044472..e9c46be55bd69 100644 --- a/packages/@aws-cdk/custom-resource-handlers/scripts/generate.ts +++ b/packages/@aws-cdk/custom-resource-handlers/scripts/generate.ts @@ -23,7 +23,7 @@ async function main() { } if (module.hasComponents) { - module.render(`dist/${fqn}.generated.ts`); + module.renderTo(`dist/${fqn}.generated.ts`); } } diff --git a/packages/@aws-cdk/custom-resource-handlers/test/custom-resources-framework/framework.test.ts b/packages/@aws-cdk/custom-resource-handlers/test/custom-resources-framework/framework.test.ts index 53e213fd65267..a6650b54eacf2 100644 --- a/packages/@aws-cdk/custom-resource-handlers/test/custom-resources-framework/framework.test.ts +++ b/packages/@aws-cdk/custom-resource-handlers/test/custom-resources-framework/framework.test.ts @@ -28,7 +28,7 @@ describe('framework', () => { module.build(component, path.dirname(outfile).split('/').pop() ?? 'dist'); // WHEN - module.render(`${tmpDir}/result.ts`); + module.renderTo(`${tmpDir}/result.ts`); // THEN const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8'); @@ -48,7 +48,7 @@ describe('framework', () => { module.build(component, path.dirname(outfile).split('/').pop() ?? 'dist'); // WHEN - module.render(`${tmpDir}/result.ts`); + module.renderTo(`${tmpDir}/result.ts`); // THEN const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8'); @@ -68,7 +68,7 @@ describe('framework', () => { module.build(component, path.dirname(outfile).split('/').pop() ?? 'dist'); // WHEN - module.render(`${tmpDir}/result.ts`); + module.renderTo(`${tmpDir}/result.ts`); // THEN const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8'); @@ -88,7 +88,7 @@ describe('framework', () => { module.build(component, path.dirname(outfile).split('/').pop() ?? 'dist'); // WHEN - module.render(`${tmpDir}/result.ts`); + module.renderTo(`${tmpDir}/result.ts`); // THEN const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8');