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: created hook to load spec file #28

Merged
merged 9 commits into from
Jul 19, 2021
Merged

feat: created hook to load spec file #28

merged 9 commits into from
Jul 19, 2021

Conversation

Souvikns
Copy link
Member

Description

  • As of now we are storing context and we access any context we are using the --context flag to load from the contexts.
  • This PR will complete the context store use case and intelligently figure out which specification file to load.
  • aims to autodetect specification file path asyncapi validate

Related issue(s)

Fixes #20

@Souvikns Souvikns marked this pull request as ready for review July 16, 2021 04:08
@Souvikns
Copy link
Member Author

Not ready yet stuck with some testing issue.

Working as intended

image

Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

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

I think that if you changed PR from draft to open I can make the review :) Overall good, but please refer to my comments.

src/cli.ts Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
src/components/Validate/Validate.tsx Outdated Show resolved Hide resolved
src/constants.ts Outdated Show resolved Hide resolved
src/hooks/context/contextService.spec.ts Show resolved Hide resolved
src/hooks/context/hook.spec.ts Outdated Show resolved Hide resolved
src/hooks/context/hooks.tsx Outdated Show resolved Hide resolved
src/components/Validate/Validate.tsx Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
@Souvikns
Copy link
Member Author

I am on windows, did I miss something.

image

@Souvikns
Copy link
Member Author

I deleted my dist folder then ran the tests again, all tests are passing.

@magicmatatjahu
Copy link
Member

I run tests in the mac, and sometimes they fail, so probably we have some bugs in tests.

@Souvikns
Copy link
Member Author

Hey, @magicmatatjahu is this PR good to go.

@magicmatatjahu
Copy link
Member

@Souvikns

The --flag doesn't work. If I run the cli as:

node ./dist/cli.js validate --file ./spec.yaml

then CLI validates the spec from current context. You have missed changes in https://github.com/asyncapi/cli/blob/master/src/CliModels.ts#L35 file.`

Please update the indentations in the help command, because at the moment it looks like:

image

and update the Readme.md with new help output :)

Btw, overall good, except that file flag, which doesn't work :)

Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

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

Everything works! Great job! I have only one suggestion and I please you to update the @asyncapi/parser package to the newest 1.7.0, because we I have this error, when I use the 2.1.0 spec (cli doesn't support the newest version):

image

README.md Outdated Show resolved Hide resolved
@magicmatatjahu
Copy link
Member

@Souvikns Please also update the package-lock :)

Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

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

LGTM

@magicmatatjahu
Copy link
Member

Awesome work!

@magicmatatjahu magicmatatjahu merged commit 127e9be into asyncapi:master Jul 19, 2021
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate module for loading spec path automatically
3 participants