-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: unify logic for metrics collection when any command is executed #8
chore: unify logic for metrics collection when any command is executed #8
Conversation
@smoya Only applied to |
@smoya Logic applied to the rest of commands already (just the five ones covered in this POC). |
src/commands/convert.ts
Outdated
@@ -78,13 +78,13 @@ export default class Convert extends Command { | |||
if (document !== undefined) { | |||
metadata = MetadataFromDocument(document, metadata); | |||
metadata['from_version'] = document.version(); | |||
this.specFile = await load(filePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about this extra parsing stuff here. Would it make sense to use the original file (specFile
var) instead 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, we can revisit all of that in the general PR.
@@ -14,7 +14,7 @@ const { writeFile } = promises; | |||
export enum Optimizations { | |||
REMOVE_COMPONENTS='remove-components', | |||
REUSE_COMPONENTS='reuse-components', | |||
MOVE_TO_COMPONETS='move-to-components' | |||
MOVE_TO_COMPONENTS='move-to-components' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah...it was there since a loooong time ago 🙈
Changed the title to chore as it is basically a refactor not adding any feature |
Add new methods to unify logic so metrics are collected when any CLI command is executed. All this logic will be implemented in base.ts file and removed from the different command files, except the metadata generated for every different command.