Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Generate markdown document from proto file #1

Merged
merged 4 commits into from
Jun 17, 2022

Conversation

fr0stf0x
Copy link
Collaborator

ref zalopay-oss/backstage-grpc-playground#3

TODO: Cache generated files

thaotx3 added 3 commits June 15, 2022 14:19
@fr0stf0x fr0stf0x added the enhancement New feature or request label Jun 17, 2022
@fr0stf0x fr0stf0x merged commit 0c0bb65 into main Jun 17, 2022
@fr0stf0x fr0stf0x deleted the feat/support-grpc-docs branch June 17, 2022 02:57
@@ -84,7 +87,8 @@ export async function getProtosFromEntitySpec(
imports: imports.map(pSaveProtoTextAsFile),
};
} catch (err) {
console.log('OUTPUT ~ getProtosFromEntitySpec ~ err', err);
logger.info(`Error getProtosFromEntitySpec`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this 2 lines combine to one with logger.error only, info and error log in 2 lines is confusing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix it

console.error(`Error generating document. Please submit a new issue at ${REPO_URL}`);
console.error(`Error:`, err);
logger.warn(`Error generating document. Please submit a new issue at ${REPO_URL}`);
logger.error(err);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with previous comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix it

let isGenDoc = req.body.isGenDoc;

try {
isGenDoc = JSON.parse(isGenDoc);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this just be JSON.parse(req.body.isGenDoc) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote it for prevent the case req.body.isGenDoc is undefined and JSON.parse will throw error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants