How janbiasi/rollup-plugin-sbom works
Main Components
a. Input Layer:
• Rollup/Vite Build Process
• Project Dependencies
• Configuration Options
b. Core Plugin Components:
• Builder Module (src/builder.ts)
• Options Handler (src/options.ts)
• Helpers (src/helpers.ts)
• Type Definitions (src/types/)
c. Output Layer:
• CycloneDX SBOM Generation
• Multiple Format Outputs (JSON/XML)
• Well-known Directory Output
┌─────────────────────────────────────────────────────────┐
• Build Process │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Rollup │ │ Vite │ │ Project │ │
• Plugin │───▶│ Plugin │ │Dependencies │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┬─────────────────────────────┘
• ▼
┌─────────────────────────────────────────────────────────┐
• Plugin Core │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Options │ │ Builder │ │ Helpers │ │
• Handler │───▶│ Module │◄───│ Module │ │
• ┘ └─────────────┘ └─────────────┘ │
• ▲ │ │
• ┌────────────────┐ │ │
• Types │ │ │
• Definitions │ │ │
• ┘ ▼ │
• ┘
• ▼
┌─────────────────────────────────────────────────────────┐
• Output Generation │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• CycloneDX │ │ JSON │ │ XML │ │
• SBOM │───▶│ Format │ │ Format │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
Important Elements to Highlight
• Version Compatibility:
• Supported Vite (v4, v5, v6) and Rollup (v3, v4) versions
• Node.js version support (18, 20, 22)
• CycloneDX spec versions (1.5, 1.6)
• Configuration Options Flow:
• How user configuration merges with default options
• Configuration validation process
Key Relationships
• Builder module's interaction with the input build process
• Options handling and validation flow
• Output format generation paths
• Test fixtures integration for different Vite versions