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

feat: add metadata for some remaining commands #1431

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/commands/config/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export default class Analytics extends Command {
if (flags.disable) {
analyticsConfigFileContent.analyticsEnabled = 'false';
this.log('\nAnalytics disabled.\n');
this.metricsMetadata.analytics_disabled = flags.disable;
peter-rr marked this conversation as resolved.
Show resolved Hide resolved
} else if (flags.enable) {
analyticsConfigFileContent.analyticsEnabled = 'true';
this.log('\nAnalytics enabled.\n');
this.metricsMetadata.analytics_enabled = flags.enable;
} else if (!flags.status) {
this.log('\nPlease append the "--disable" flag to the command in case you prefer to disable analytics, or use the "--enable" flag if you want to enable analytics back again. In case you do not know the analytics current status, then you can append the "--status" flag to be aware of it.\n');
return;
Expand All @@ -41,6 +43,7 @@ export default class Analytics extends Command {
} else {
this.log('\nAnalytics are disabled. Please append the "--enable" flag to the command in case you prefer to enable analytics.\n');
}
this.metricsMetadata.analytics_status_checked = flags.status;
}
} catch (e: any) {
switch (e.code) {
Expand Down
6 changes: 6 additions & 0 deletions src/commands/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ export default class Diff extends Command {
checkAndWarnFalseFlag(outputFormat, markdownSubtype);
markdownSubtype = setDefaultMarkdownSubtype(outputFormat, markdownSubtype) as string;

this.metricsMetadata.output_format = outputFormat;
this.metricsMetadata.output_type = outputType;
if (outputFormat === 'md') {
peter-rr marked this conversation as resolved.
Show resolved Hide resolved
this.metricsMetadata.output_markdown_subtype = flags['markdownSubtype'];
}

try {
firstDocument = await load(firstDocumentPath);

Expand Down
4 changes: 4 additions & 0 deletions src/commands/new/glee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ export default class NewGlee extends Command {
projectName,
forceWrite
);
this.specFile = await load(flags.file);
this.metricsMetadata.template = flags.template;
} else {
try {
await fPromises.mkdir(PROJECT_DIRECTORY);
Expand Down Expand Up @@ -258,6 +260,8 @@ export default class NewGlee extends Command {
`Unable to create the project. Please check the following message for further info about the error:\n\n${err}`
);
}
this.specFile = await load(`${GLEE_TEMPLATES_DIRECTORY}/asyncapi.yaml`);
this.metricsMetadata.template = flags.template;
}
}
}
3 changes: 3 additions & 0 deletions src/commands/start/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default class StartStudio extends Command {
const { flags } = await this.parse(StartStudio);
const filePath = flags.file || (await load()).getFilePath();
const port = flags.port;

this.specFile = await load(filePath);
peter-rr marked this conversation as resolved.
Show resolved Hide resolved
this.metricsMetadata.port = port;

startStudio(filePath as string, port);
}
Expand Down
Loading