Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Mar 27, 2024
1 parent 6f3d884 commit 45d75c1
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 98 deletions.
1 change: 1 addition & 0 deletions .asyncapi-analytics
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"analyticsEnabled":"true","infoMessageShown":"false","userID":"0e9cf95d-b96e-42ce-9d22-d5118c95dd7c"}
88 changes: 0 additions & 88 deletions index.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default abstract class extends Command {
break;
case 'production':
// NODE_ENV set to `production` in bin/run_bin, which is specified in 'bin' package.json section
sink = new NewRelicSink(process.env.ASYNCAPI_METRICS_NEWRELIC_KEY || 'eu01xx1dbea6bbf5f6b546cef26c042bFFFFNRAL');
sink = new NewRelicSink(process.env.ASYNCAPI_METRICS_NEWRELIC_KEY || 'eu01xx73a8521047150dd9414f6aedd2FFFFNRAL');

if (analyticsConfigFileContent.infoMessageShown === 'false') {
this.log('\nAsyncAPI anonymously tracks command executions to improve the specification and tools, ensuring no sensitive data reaches our servers. It aids in comprehending how AsyncAPI tools are used and adopted, facilitating ongoing improvements to our specifications and tools.\n\nTo disable tracking, please run the following command:\n asyncapi config analytics --disable\n\nOnce disabled, if you want to enable tracking back again then run:\n asyncapi config analytics --enable');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class Convert extends Command {

try {
// LOAD FILE
this.specFile = await load(filePath);
this.specFile = await load(this,filePath);
this.metricsMetadata.to_version = flags['target-version'];

// CONVERSION
Expand Down
4 changes: 2 additions & 2 deletions src/commands/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class Diff extends Command {
markdownSubtype = setDefaultMarkdownSubtype(outputFormat, markdownSubtype);

try {
firstDocument = await load(firstDocumentPath);
firstDocument = await load(this,firstDocumentPath);

if (firstDocument.isAsyncAPI3()) {
this.error('Diff command does not support AsyncAPI v3 yet which was your first document, please checkout https://github.com/asyncapi/diff/issues/154');
Expand All @@ -111,7 +111,7 @@ export default class Diff extends Command {
}

try {
secondDocument = await load(secondDocumentPath);
secondDocument = await load(this,secondDocumentPath);

if (secondDocument.isAsyncAPI3()) {
this.error('Diff command does not support AsyncAPI v3 yet which was your second document, please checkout https://github.com/asyncapi/diff/issues/154');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/generate/fromTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export default class Template extends Command {
mapBaseUrlToFolder: parsedFlags.mapBaseUrlToFolder,
disabledHooks: parsedFlags.disableHooks,
};

const asyncapiInput = (await load(this,asyncapi)) || (await load(this));

this.specFile = asyncapiInput;
this.metricsMetadata.template = template;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/generate/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default class Models extends Command {
const { args, flags } = await this.parse(Models);
const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, tsMarshalling, tsExampleInstance, namespace, csharpAutoImplement, csharpArrayType, csharpNewtonsoft, csharpHashcode, csharpEqual, csharpSystemJson, packageName, javaIncludeComments, javaJackson, javaConstraints, output } = flags;
const { language, file } = args;
const inputFile = (await load(file)) || (await load());
const inputFile = (await load(this,file)) || (await load(this));
if (inputFile.isAsyncAPI3()) {
this.error('Generate Models command does not support AsyncAPI v3 yet, please checkout https://github.com/asyncapi/modelina/issues/1376');
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/new/glee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class NewGlee extends Command {

try {
console.log(file);
const asyncapiInput = (await load(file)) || (await load());
const asyncapiInput = (await load(this,file)) || (await load(this));
console.log(asyncapiInput);

const serversObject = asyncapiInput.toJson()?.servers;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class Optimize extends Command {
const filePath = args['spec-file'];

try {
this.specFile = await load(filePath);
this.specFile = await load(this,filePath);
} catch (err) {
this.error(
new ValidationError({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/start/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class StartStudio extends Command {

async run() {
const { flags } = await this.parse(StartStudio);
const filePath = flags.file || (await load()).getFilePath();
const filePath = flags.file || (await load(this)).getFilePath();
const port = flags.port;

startStudio(filePath as string, port);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Validate extends Command {
const filePath = args['spec-file'];
const watchMode = flags.watch;

this.specFile = await load(filePath);
this.specFile = await load(this,filePath);
if (watchMode) {
specWatcher({ spec: this.specFile, handler: this, handlerName: 'validate' });
}
Expand Down

0 comments on commit 45d75c1

Please sign in to comment.