Skip to content

Commit 1499830

Browse files
feat: add metadata for some remaining commands (#1431)
Co-authored-by: asyncapi-bot <[email protected]>
1 parent f2b337d commit 1499830

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/commands/config/analytics.ts

+3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ export default class Analytics extends Command {
2626
if (flags.disable) {
2727
analyticsConfigFileContent.analyticsEnabled = 'false';
2828
this.log('\nAnalytics disabled.\n');
29+
this.metricsMetadata.analytics_disabled = flags.disable;
2930
} else if (flags.enable) {
3031
analyticsConfigFileContent.analyticsEnabled = 'true';
3132
this.log('\nAnalytics enabled.\n');
33+
this.metricsMetadata.analytics_enabled = flags.enable;
3234
} else if (!flags.status) {
3335
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');
3436
return;
@@ -41,6 +43,7 @@ export default class Analytics extends Command {
4143
} else {
4244
this.log('\nAnalytics are disabled. Please append the "--enable" flag to the command in case you prefer to enable analytics.\n');
4345
}
46+
this.metricsMetadata.analytics_status_checked = flags.status;
4447
}
4548
} catch (e: any) {
4649
switch (e.code) {

src/commands/diff.ts

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ export default class Diff extends Command {
7676
checkAndWarnFalseFlag(outputFormat, markdownSubtype);
7777
markdownSubtype = setDefaultMarkdownSubtype(outputFormat, markdownSubtype) as string;
7878

79+
this.metricsMetadata.output_format = outputFormat;
80+
this.metricsMetadata.output_type = outputType;
81+
if (outputFormat === 'md') {
82+
this.metricsMetadata.output_markdown_subtype = flags['markdownSubtype'];
83+
}
84+
7985
try {
8086
firstDocument = await load(firstDocumentPath);
8187

src/commands/new/glee.ts

+4
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ export default class NewGlee extends Command {
213213
projectName,
214214
forceWrite
215215
);
216+
this.specFile = await load(flags.file);
217+
this.metricsMetadata.template = flags.template;
216218
} else {
217219
try {
218220
await fPromises.mkdir(PROJECT_DIRECTORY);
@@ -258,6 +260,8 @@ export default class NewGlee extends Command {
258260
`Unable to create the project. Please check the following message for further info about the error:\n\n${err}`
259261
);
260262
}
263+
this.specFile = await load(`${GLEE_TEMPLATES_DIRECTORY}/asyncapi.yaml`);
264+
this.metricsMetadata.template = flags.template;
261265
}
262266
}
263267
}

src/commands/start/studio.ts

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default class StartStudio extends Command {
1616
const { flags } = await this.parse(StartStudio);
1717
const filePath = flags.file || (await load()).getFilePath();
1818
const port = flags.port;
19+
20+
this.specFile = await load(filePath);
21+
this.metricsMetadata.port = port;
1922

2023
startStudio(filePath as string, port);
2124
}

0 commit comments

Comments
 (0)