Skip to content

feat: refactor CLI to be service based and initial migration of server-api #1825

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Shurtu-gal
Copy link
Collaborator

Description

  • Refactored CLI to be service based. Especially validation and generate due to shared tasks between API and itself.
  • Added a start api command which is working perfectly fine, hence can still be used till I make another PR regarding its release process etc.

Related issue(s)
Fixes #1793
Partial #1794

Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
Copy link

changeset-bot bot commented Jul 22, 2025

🦋 Changeset detected

Latest commit: c27d6a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 22, 2025

Changeset has been generated for this PR as part of auto-changeset workflow.

Please review the changeset before merging the PR.
---
'@asyncapi/cli': minor
---

feat: refactor CLI to be service based and initial migration of server-api

- ac95777: feat: refactor cli to be service based and migrate server-api

Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
- 6b925f4: chore: fix diff test

Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
- cfe6e8d: feat: add generator controller

Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
- b2d7bcc: chore: don't need to install everytime

Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
- dd71d22: Merge remote-tracking branch 'origin/master' into refactor
- 1fd1216: fix: linting

Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
- 6bd3e73: chore: run prettier

Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
- ca3fdee: chore: run linter

Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
- 1d03d79: chore: quick startup of server-api

Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
- 13729bb: chore: rename to apps

Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
- cdd2a43: chore: rename npm commands

Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>

If you are a maintainer or the author of the PR, you can change the changeset by clicking here

Tip

If you don't want auto-changeset to run on this PR, you can add the label skip-changeset to the PR or remove the changeset and change PR title to something other than fix: or feat:.

Shurtu-gal and others added 5 commits July 22, 2025 19:53
Comment on lines 95 to 103
asyncapi = `${asyncapi}+${proxyUrl}`;
}
const asyncapiInput = (await load(asyncapi)) || (await load());

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

const watchTemplate = flags['watch'];
const genOption: any = {};

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Comment on lines 219 to 221
}

private disableHooksParser(inputs?: string[]) {

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Comment on lines 269 to 271
if (!isURL.test(input.toLowerCase())) {
throw new Error(
'Invalid --registry-url flag. The param requires a valid http/https url.',

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Comment on lines 361 to 363
} catch (err: any) {
// intentional
}

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Comment on lines 92 to 99
let optimizer: Optimizer;
let report: Report;
try {
optimizer = new Optimizer(this.specFile.text());
report = await optimizer.getReport();
} catch (err) {
this.error(
new ValidationError({

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Comment on lines 94 to 96
await (await this.recorder).flush();
} catch (e: any) {
if (e instanceof Error) {

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Comment on lines +269 to +271
} catch (e) {
// We did our best...
}

Check notice

Code scanning / SonarCloud

Exceptions should not be ignored Low

Handle this exception or don't catch it at all. See more on SonarQube Cloud
Shurtu-gal and others added 8 commits July 22, 2025 20:19
Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
Signed-off-by: Shurtu-gal <ashishpadhy1729@gmail.com>
Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
Signed-off-by: Ashish Padhy <ashishpadhy1729@gmail.com>
Copy link

@asyncapi-bot asyncapi-bot added the bounty AsyncAPI Bounty program related label label Jul 28, 2025
@aeworxet
Copy link
Contributor

@asyncapi/bounty_team

@aeworxet aeworxet moved this to In Progress in Bounty Program Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty AsyncAPI Bounty program related label
Projects
Status: In Progress
Status: To Triage
Development

Successfully merging this pull request may close these issues.

Refactor the CLI to be service based
3 participants