Skip to content

feat(196): Support importing Bruno Collections#773

Draft
giemic8 wants to merge 7 commits into
mainfrom
feature/196-support-importing-bruno-collections
Draft

feat(196): Support importing Bruno Collections#773
giemic8 wants to merge 7 commits into
mainfrom
feature/196-support-importing-bruno-collections

Conversation

@giemic8
Copy link
Copy Markdown
Collaborator

@giemic8 giemic8 commented May 4, 2026

User description

Changes

Implements BrunoImporter to support importing Bruno collections into Trufos (closes #196).

  • bruno-importer.ts — New importer using @usebruno/lang (official Bruno parser):
    • Reads collection name/uid from bruno.json
    • Walks the directory recursively: subdirs → folders, .bru files → requests
    • Respects seq ordering from the meta block
    • Supports body types: json, text, xml, multipartForm, formUrlEncoded, file
    • Supports auth: bearer, basic, inherit, oauth2 (client_credentials, authorization_code, PKCE)
    • Imports query params from params:query block
    • Imports environments from the environments/ subdirectory
  • bruno-types.d.ts — TypeScript declarations for the JS-only @usebruno/lang package
  • import-service.ts — Registers BrunoImporter under the 'Bruno' strategy
  • CollectionImport.tsx — Replaces "Coming soon..." with a working Bruno import UI (directory picker → target dir → title → Import)
  • Added @usebruno/lang dependency

Testing

16 automated tests in bruno-importer.test.ts covering:

  • Collection metadata import
  • All HTTP methods and body types
  • All auth types (bearer, basic, inherit, oauth2 grant types)
  • Query params from params:query block
  • Nested folders and seq-based ordering
  • Environment import from environments/ directory
  • Accepting directory path or bruno.json file path as input

Checklist

  • Issue has been linked to this PR
  • Code has been reviewed by person creating the PR
  • Automated tests have been written, if possible
  • Manual testing has been performed
  • Documentation has been updated, if necessary
  • Changes have been reviewed by second person

PR Type

Enhancement, Tests


Description

  • Implement BrunoImporter for Bruno collections

  • Support HTTP methods, bodies, auth, query, environments

  • Register Bruno strategy and update build config

  • Enable Bruno import UI and comprehensive tests


File Walkthrough

Relevant files
Tests
1 files
bruno-importer.test.ts
Add tests for BrunoImporter functionality                               
+501/-0 
Enhancement
3 files
bruno-importer.ts
Implement BrunoImporter for Bruno collections                       
+305/-0 
import-service.ts
Register BrunoImporter in ImportService                                   
+2/-0     
CollectionImport.tsx
Add Bruno import UI with directory pickers                             
+29/-3   
Documentation
1 files
bruno-types.d.ts
Add type declarations for @usebruno/lang                                 
+98/-0   
Configuration changes
1 files
vite.config.ts
Exclude @usebruno/lang from Rollup bundle                               
+3/-0     
Dependencies
1 files
package.json
Add @usebruno/lang dependency                                                       
+1/-0     

@giemic8 giemic8 marked this pull request as draft May 4, 2026 20:56
@giemic8 giemic8 force-pushed the feature/196-support-importing-bruno-collections branch from 9c3bc83 to 98155e7 Compare May 5, 2026 19:26
@giemic8 giemic8 marked this pull request as ready for review May 5, 2026 19:27
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

196 - Partially compliant

Compliant requirements:

  • Implement a BrunoImporter in src/main/import/service that implements the CollectionImporter interface
  • Register the BrunoImporter in the ImportService
  • Mirror functionality of PostmanImporter (read metadata, walk directory, support body types, auth, query params, environments)
  • Add automated tests for the new importer

Non-compliant requirements:

  • (none)

Requires further human verification:

  • Manual end-to-end testing of the Bruno import UI and error flows
  • Verification of any necessary documentation updates
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@giemic8 giemic8 marked this pull request as draft May 5, 2026 19:30
giemic8 and others added 7 commits May 19, 2026 15:02
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ohm-js (used by @usebruno/lang) cannot be correctly bundled by Rollup
into a CJS output — ohm.grammar ends up undefined at runtime.
Making @usebruno/lang external causes Electron to require() it directly
from node_modules at runtime, where it works correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giemic8 giemic8 force-pushed the feature/196-support-importing-bruno-collections branch from 98155e7 to 06abf68 Compare May 19, 2026 13:04
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.

Support importing Bruno Collections

1 participant