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

fix: update template to work with @asyncapi/parser 2.x #272

Merged
merged 2 commits into from Mar 30, 2023

Conversation

ivankahl
Copy link
Contributor

@ivankahl ivankahl commented Mar 30, 2023

Description

Tests

I updated the test snapshot as the template change. See integration test results below:

 PASS  test/integration.test.js
  template integration test using generator
    ✓ should generate application files  (660 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   6 passed, 6 total
Time:        3.067 s
Ran all test suites.

I tested the template by using it for my own project and checking the application runs and the WebSocket works. Please see test results below:

D:\Code\AsyncApiFoodDelivery
❯ ag asyncapi.yaml https://github.com/ivankahl/nodejs-ws-template -p server=dev -o ws-server --force-write


Done! ✨
Check out your shiny new generated files at D:\Code\AsyncApiFoodDelivery\ws-server.


D:\Code\AsyncApiFoodDelivery took 36s
❯ cd .\ws-server\

Code\AsyncApiFoodDelivery\ws-server is 📦 v1.0.0 via  v14.21.3 
❯ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN food-delivery-api@1.0.0 No repository field.
npm WARN food-delivery-api@1.0.0 No license field.

added 190 packages from 175 contributors and audited 190 packages in 19.415s

45 packages are looking for funding
  run `npm fund` for details

found 3 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

Code\AsyncApiFoodDelivery\ws-server is 📦 v1.0.0 via  v14.21.3 took 21s
❯ npm run start

> food-delivery-api@1.0.0 start D:\Code\AsyncApiFoodDelivery\ws-server
> node src/api/index.js

Listening on port 3000

Proof that the WebSocket connection works:
image

Related issue(s)
Resolves #271

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@ivankahl ivankahl changed the title Update template to work with @asyncapi/parser 2.x fix: Update template to work with @asyncapi/parser 2.x Mar 30, 2023
@derberg derberg changed the title fix: Update template to work with @asyncapi/parser 2.x fix: update template to work with @asyncapi/parser 2.x Mar 30, 2023
@derberg
Copy link
Member

derberg commented Mar 30, 2023

@ivankahl I update PR title (must start lower case). Please update snapshots for tests, as template code changed

@sonarcloud
Copy link

sonarcloud bot commented Mar 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ivankahl
Copy link
Contributor Author

Sure thing @derberg, I've updated the snapshot and the tests pass:

 PASS  test/integration.test.js
  template integration test using generator
    ✓ should generate application files  (660 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   6 passed, 6 total
Time:        3.067 s
Ran all test suites.

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.

Thanks

@derberg
Copy link
Member

derberg commented Mar 30, 2023

/rtm

@asyncapi-bot asyncapi-bot merged commit 18f3adf into asyncapi:master Mar 30, 2023
16 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.9.32 🎉

The release is available on:

Your semantic-release bot 📦🚀

@derberg
Copy link
Member

derberg commented Mar 30, 2023

@allcontributors please add @ivankahl for code, test

@allcontributors
Copy link
Contributor

@derberg

I've put up a pull request to add @ivankahl! 🎉

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

Successfully merging this pull request may close these issues.

Template incorrectly references 2.x versions of @asyncapi/parser instead of 1.x
3 participants