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: Standalone Package to convert to Bruno collection #2341

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

thim81
Copy link

@thim81 thim81 commented May 19, 2024

Description

Linked to #2340

Provide the Bruno importers (located now in /bruno-app/src/utils/importers) as a standalone package, that can be published as a NPM package.

This would allow open-source tools to import and use the import functions to convert Postman, OpenAPI, ... programmatically to BRU files, which can be used via the Bruno App and Bruno CLI.

Support conversion from:

  • Postman collection
  • Insomnia collection
  • OpenAPI specification
  • Postman environment

To Bruno collection

This would be a phased PR:

  • first branch of the Bruno importers as a separate package
  • merge into main
  • publish the importers as a NPM package
  • use the package in the bruno-app and replace the functions

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@thim81 thim81 changed the title Convert Postman collection to Bruno collection Standalone Package to convert to Bruno collection May 20, 2024
@Thessi
Copy link

Thessi commented Jun 20, 2024

This would be very helpful for me. Could someone take a look? @helloanoop

@thim81
Copy link
Author

thim81 commented Jun 20, 2024

Let me know, if this is useful so I can update the PR with the latest code changes from the main branch.

@thim81 thim81 changed the title Standalone Package to convert to Bruno collection Feat: Standalone Package to convert to Bruno collection Jul 31, 2024
@dfdgsdfg
Copy link

Can I use this package to create Bruno collection with Bruno cli?

#1013
#1109

@thim81
Copy link
Author

thim81 commented Aug 19, 2024

If the PR gets accepted, it will easier to use the Bruno convert methods in other Node proejcts or build a standalone Bruno CLI.

@dfdgsdfg
Copy link

@helloanoop any update? : )

@thim81
Copy link
Author

thim81 commented Sep 14, 2024

Who can we best request for some feedback on the PR?

@Thessi
Copy link

Thessi commented Sep 15, 2024

This would still be really helpful for us, thanks a lot @thim81 ! If this doesn‘t get merged, I might just use your fork and hope the format doesn‘t change too much.
@helloanoop could you help us with this?

@thim81
Copy link
Author

thim81 commented Sep 15, 2024

@Thessi I just updated the code to be in sync with the latest main branch. The effort is rather limited with some diffing.

If it got accepted I would want to add some test to have coverage.

Depending on the timeline we could already publish it is a unofficial npm package to have it used in the field. Although I would prefer to keep it as official bruno package.

@thim81
Copy link
Author

thim81 commented Sep 15, 2024

Minor update: I added already some jest test to cover the main scenario's.

@mjhcorporate
Copy link
Contributor

I really like this approach! I noticed that here you are adding the importers to a new package, but you are not removing the existing importers. That runs the risk of the two becoming out of sync. When do you think would be the best time to switch over?

@mjhcorporate
Copy link
Contributor

If the PR gets accepted, it will easier to use the Bruno convert methods in other Node proejcts or build a standalone Bruno CLI.

There is a Bruno CLI. I think it would be really cool if it supported something like bru convert my-postman-colleciton.json.

@thim81
Copy link
Author

thim81 commented Sep 18, 2024

hi @mjhcorporate

This would be a phased PR:

  • first branch of the Bruno importers as a separate package
  • merge into main
  • publish the importers as a NPM package
  • use the package in the bruno-app and implement the functions and remove the original code

The goal would be to allow to build a Bruno converter CLI or plug it in other packages to generate Bru files, while leveraging the core conversion functions (examples: https://github.com/gyuha/openapi-to-bruno or https://github.com/sthuck/openapi-to-bruno)

The current bruno cli is a runner to execute requests (like newman), so we don't to mess with that for conversions.

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.

5 participants