asyncapi / generator

Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!
https://asyncapi.com/docs/tools/generator
Apache License 2.0
767 stars 232 forks source link

feat: include default nunjucks filters and new release to the generator #1225

Closed ayushnau closed 3 months ago

ayushnau commented 4 months ago

Changes Added.

  1. Added the new Release with changesets.

Related issue(s)

Related to: https://github.com/asyncapi/generator/issues/1044

ayushnau commented 4 months ago

@derberg I have added the changes for Changesets. I have used the changelog in the ci @changesets/changelog-git (didnt make it false in the config) cause there is ongoing bug in the changesets which they have not given the solution yet. And this is basically causing changesets still search for the CHANGELOG.md inspite of making it false in the config. here is the link https://github.com/changesets/action/issues/256

Also I was needed to install the @changesets/cli in the ci also cause once I run the chagnesets/cli command directly with npx in ci it is installing the cli version and correctly working fine, but then the same ci flow changelog is not getting detected causing the error.

derberg commented 4 months ago

@ayushnau

  1. Regarding your comment about @changesets/cli that can be used with npx, but changelong-git must be installed. Please adda proper comment to YAML file, with link to an issue, so we overtime can followup and improve - otherwise this knowledge will get out of our heads in few months.

  2. why are there changes to package-lock

  3. please add a section in readme, that explain how releasing works now. What has to be done to release minor/patch/major

  4. please explain what will happen once we merge this PR. Btw did you test it somewhere already? can you show results?

  5. please explore how to make it happen, that new filters package is also in dependencies of generator. How to make it happen that once we merge a PR that is marked as "filter", it is automatically bumped in generator

ayushnau commented 4 months ago

@derberg

  1. Added the comment regarding it.

  2. The Changes in package.lockare expected as the generator-filters is also added. Turborepo will add the required dependency together in package.lock for both the packgaes. Also I have updated the jest version to 27.3.1 without it some test were getting broke. I was getting Error node:events not found. found the solution here https://github.com/Azure/azure-sdk-for-js/issues/29014

  3. Added the section in the readmd.md.

  4. I thing the repo will be published to respective npm directories will add the test results.

  5. In 5th point you mean. how to bump the version of generator when there is changes in the generator-filter is that right? If that is the question than it is possible.

  6. Also in beginning you told me to setup the filter in such a way that it is not required to add them to package.json and the filters should get loaded by itself. I checked this one. and found this straightforward. we just need to set the filter object in generator this.templateParams = {filter: "@asyncapi/generator-filters"}; and update other places if the template params is set to {}.

  7. Also we dont want to push the generator-filters as a seprate package like you said before the in the issue??

"generator-filters and generator-hooks also natively a part of generator (we still want to enable people to provide theirs independently)"

aeworxet commented 4 months ago

@asyncapi/bounty_team

ayushnau commented 3 months ago

@derberg test release https://www.npmjs.com/package/@ayushnautiyal706020/generator first ci link: https://github.com/ayushnau/generator/actions/runs/10017954285 created pr link: https://github.com/ayushnau/generator/pull/6 second ci link: https://github.com/ayushnau/generator/actions/runs/10017959613/job/27692765169

ayushnau commented 3 months ago

@derberg i think i have added all the required functionality. please check.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
9 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

derberg commented 3 months ago

@ayushnau please notice that in my comment about docs there were 2 screenshots about two different docs

derberg commented 3 months ago

also I see tests are failing, did you change do ker compose setting as mentioned in slack?

ayushnau commented 3 months ago

also I see tests are failing, did you change do ker compose setting as mentioned in slack?

i was still working on it. but now it is fixed basically i mounted complete project in the volume. and adjusted other directories used.

ayushnau commented 3 months ago

@derberg I think now all tests are passing can we proceed with this.

ayushnau commented 3 months ago

@ayushnau please notice that in my comment about docs there were 2 screenshots about two different docs

checking

derberg commented 3 months ago

added 2 questions to code and also please have a look on this one that you missed -> https://github.com/asyncapi/generator/pull/1225#issuecomment-2248972858

ayushnau commented 3 months ago

@derberg @lmgyuan please check made all the required changes.

ayushnau commented 3 months ago

@derberg @lmgyuan please check the pr.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
9 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

derberg commented 3 months ago

/rtm