asyncapi / parser-js

AsyncAPI parser for Javascript (browser-compatible too).
Apache License 2.0
119 stars 97 forks source link

fix: updated the method of importing the parser #1045

Closed ayushnau closed 3 months ago

ayushnau commented 3 months ago

Changes Added.

1. updated the way the nunjucks filter was importing the generator. 

Related issue(s)

Related to: https://github.com/asyncapi/parser-js/issues/963

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 5a237b357b0c4fa923eccc9872c3d25c7ca3d5b3

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

This PR includes changesets to release 1 package | Name | Type | | ---------------------- | ----- | | @asyncapi/multi-parser | Patch |

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

ayushnau commented 3 months ago

@smoya Fixed this.

image image

In your example the error is coming due to asyncapi validation other wise the multiparser package is working fine.

I have used this package for testing. @ayushnautiyal706020/multi-parser Also pushed this code here if you want to check https://github.com/ayushnau/asyncapi-parser-example

aeworxet commented 3 months ago

@asyncapi/bounty_team

smoya commented 3 months ago

I don't get why we need this change. Can you please elaborate on that?

smoya commented 3 months ago

@ayushnau

In your example the error is coming due to asyncapi validation other wise the multiparser package is working fine.

Attaching two screenshots running a simple example both with @smoya/multi-parser package and then with @asyncapi/multi-parser one. See the error on the second.

Using @smoya/multi-parser

Code_0voe7Odx@2x

Using @asyncapi/multi-parser

Code_EsUr0mJD@2x

ayushnau commented 3 months ago

I don't get why we need this change. Can you please elaborate on that?

Before I was using parserv3: file::../parser to import the parser in multiparser. but doing this way was creating problem in production build. of the multiparser. It turns out that in turborepo for importing internal dependency we need to use *@asyncapi/parser : ""** this only works if we are using the name which is in the package.json of the package. So we need to use @asyncapi/parser instead of parserv3

ayushnau commented 3 months ago

@ayushnau

In your example the error is coming due to asyncapi validation other wise the multiparser package is working fine.

Attaching two screenshots running a simple example both with @smoya/multi-parser package and then with @asyncapi/multi-parser one. See the error on the second.

Using @smoya/multi-parser

Code_0voe7Odx@2x

Using @asyncapi/multi-parser

Code_EsUr0mJD@2x

yes I am aware of this. Merging this pr will fix this.

smoya commented 3 months ago

The prefix title of the pr should be fix.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

ayushnau commented 3 months ago

/rtm

smoya commented 3 months ago

/rtm

smoya commented 3 months ago

/rtm

smoya commented 3 months ago

/rtm