Skip to content

Commit

Permalink
feat: remove console log (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilch authored Sep 17, 2021
1 parent ec079f1 commit 73fac18
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
// TODO: enable rules below and fix issues
'import/no-cycle': 'off',
'no-console': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class AmplifyRenderer extends ReactStudioTemplateRenderer {
}

renderJsx(component: StudioComponent | StudioComponentChild, parent?: StudioNode): JsxElement | JsxFragment {
console.log(parent);
const node = new StudioNode(component, parent);
switch (component.componentType) {
case 'Collection':
Expand Down Expand Up @@ -67,8 +66,6 @@ export class AmplifyRenderer extends ReactStudioTemplateRenderer {
return new TextRenderer(component, this.importCollection, parent).renderElement();
}

console.warn(`${component.componentType} is not one of the primitives - assuming CustomComponent`);

return new CustomComponentRenderer(component, this.importCollection).renderElement((children) =>
children.map((child) => this.renderJsx(child, node)),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default function renderString(component: StudioComponentChild): JsxFragme
if ('value' in component.properties.value) {
const stringProp = component.properties.value;
const { value } = stringProp;
console.log(value);

const element = factory.createJsxFragment(
factory.createJsxOpeningFragment(),
Expand Down
2 changes: 0 additions & 2 deletions packages/studio-ui-codegen-react/lib/react-output-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import path from 'path';

export class ReactOutputManager extends FrameworkOutputManager<string> {
async writeComponent(input: string, outputPath: string, componentName: string): Promise<void> {
console.log('Writing file ', outputPath);

const { dir } = path.parse(outputPath);

if (!existsSync(dir)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ export abstract class ReactStudioTemplateRenderer extends StudioTemplateRenderer

const { printer, file } = this.createPrinter();

console.log('JSX rendered');

const imports = this.importCollection.buildImportStatements();

let importsText = '';
Expand Down Expand Up @@ -134,8 +132,6 @@ export abstract class ReactStudioTemplateRenderer extends StudioTemplateRenderer

const jsx = this.renderJsx(this.component);

console.log('JSX rendered');

const wrappedFunction = this.renderFunctionWrapper(
this.component.name ?? StudioRendererConstants.unknownName,
jsx,
Expand Down Expand Up @@ -164,8 +160,6 @@ export abstract class ReactStudioTemplateRenderer extends StudioTemplateRenderer

const transpiledComponentText = this.transpile(componentText);

console.log(transpiledComponentText);

return {
componentText: transpiledComponentText,
renderComponentToFilesystem: this.renderComponentToFilesystem(transpiledComponentText)(this.fileName),
Expand Down
3 changes: 0 additions & 3 deletions packages/studio-ui-codegen/lib/template-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class StudioTemplateRendererManager<
if (!component) {
throw new Error('Please ensure you have passed in a valid component schema');
}
console.log('Rendering a component ', component.componentType);
const componentRenderer = this.renderer.buildRenderer(component);
const result = componentRenderer.renderComponent();
result.renderComponentToFilesystem(this.outputConfig.outputPathDir);
Expand All @@ -46,8 +45,6 @@ export class StudioTemplateRendererManager<
throw new Error('Please ensure you have passed in a valid schema');
}

console.log('Rendering multiple components ', jsonSchema.length);

for (const component of jsonSchema) {
const componentPath = path.join(
this.outputConfig.outputPathDir,
Expand Down
1 change: 1 addition & 0 deletions packages/test-generator/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { StudioComponent } from '@amzn/amplify-ui-codegen-schema';
import { StudioTemplateRendererManager, StudioTemplateRendererFactory } from '@amzn/studio-ui-codegen';
import { AmplifyRenderer, ReactOutputConfig, ReactRenderConfig, ScriptKind } from '@amzn/studio-ui-codegen-react';
Expand Down

0 comments on commit 73fac18

Please sign in to comment.