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: remove -f flag from asyncapi start command #1638

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

Adi-204
Copy link
Contributor

@Adi-204 Adi-204 commented Jan 20, 2025

Description
Remove -f flag from asyncapi start command
asyncapi start command can now work without filename also

Fixes #1623

Case 1 Filename given in command by user.
Screenshot 2025-01-20 200812

Case 2 Filename not given in command by user but asyncapi.yaml default file is present in current working directory.
Screenshot 2025-01-20 200724

Case 3 Filename not given in command by user and asyncapi.yaml default file is not present in current working directory. Open studio with empty file.
Screenshot 2025-01-20 200949

Studio for Case 3
image

Copy link

changeset-bot bot commented Jan 20, 2025

⚠️ No Changeset found

Latest commit: aadce2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@Adi-204 Adi-204 changed the title feat: Remove -f flag from asyncapi start command feat: remove -f flag from asyncapi start command Jan 20, 2025
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks pretty good, although please take into account I'm not a maintainer here, so in depth review is needed from their side. I'm not involved here for some time, afaik you should not use console.log directly.

anyway, from code, without manual testing, I see you fulfilled requirements. I hope you did manual testing.

of course there is also a case of missing unit tests

@derberg
Copy link
Member

derberg commented Jan 21, 2025

/ptal

@asyncapi-bot
Copy link
Contributor

@Amzani @Souvikns @AayushSaini101 @Shurtu-gal Please take a look at this PR. Thanks! 👋

@Shurtu-gal
Copy link
Collaborator

After a brief look over the PR, I found the following:

  • I couldn't understand the reason behind removing -f flag as if the only issue is not having default file, then default can be added to flag itself.
  • If file passed doesn't exist it should not open the studio and just throw an error.

Copy link
Member

derberg commented Jan 21, 2025

as specified in linked issues, studio command works like this now: asyncapi start studio -f ./asyncapi-client.yaml which is totally out of sync with other commands. Studio is the only command that requires you to use -f, so if you use multiple commands (like I do) whenever you use studio, you always face error as you do asyncapi start studio ./asyncapi-client.yaml`, and then need to remind yourself what is the right way

If file passed doesn't exist it should not open the studio and just throw an error.
studio is also useful to start locally without any file, to see it in action

@Shurtu-gal
Copy link
Collaborator

Okay, makes sense.

Copy link
Collaborator

@Shurtu-gal Shurtu-gal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Shurtu-gal
Copy link
Collaborator

/rtm

@asyncapi-bot asyncapi-bot merged commit 9f847e2 into asyncapi:master Jan 21, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

asyncapi start studio is not consistent with other commands
4 participants