Skip to content

feat: add 9 new package parsers and refactor PackageParser trait#39

Merged
mstykow merged 5 commits intomainfrom
feat/missing-parsers
Feb 9, 2026
Merged

feat: add 9 new package parsers and refactor PackageParser trait#39
mstykow merged 5 commits intomainfrom
feat/missing-parsers

Conversation

@mstykow
Copy link
Copy Markdown
Owner

@mstykow mstykow commented Feb 9, 2026

Summary

  • Add 9 new package manifest parsers: Conan, Bower, AboutCode, Chef, FreeBSD, Autotools, CPAN, Bazel BUILD, and Buck
  • Refactor PackageParser trait to consolidate extract_package_data() and extract_all_packages() into a single extract_packages() method returning Vec<PackageData>

New Parsers

Parser Ecosystem Formats
Conan C/C++ conanfile.py, conanfile.txt, conan.lock
Bower JavaScript bower.json
AboutCode Generic .ABOUT files
Chef Ruby/Infrastructure metadata.json, metadata.rb
FreeBSD BSD +COMPACT_MANIFEST
Autotools C/C++ configure, configure.ac
CPAN Perl META.json, META.yml, MANIFEST
Bazel Multi-language BUILD files (multi-package support)
Buck Multi-language BUCK files, METADATA.bzl (multi-package support)

All parsers include comprehensive test coverage and testdata fixtures.

PackageParser Trait Refactoring

The trait previously had a confusing dual-method API:

  • extract_package_data() — required, returned single PackageData
  • extract_all_packages() — optional, returned Vec<PackageData>

This created an awkward pattern where multi-package parsers (Bazel, Buck, Debian) had to implement both methods with one delegating to the other.

New API:

  • extract_packages() — required, returns Vec<PackageData> (all packages)
  • extract_first_package() — default impl, returns first package (convenience for tests)

Changes span 75 files but are mechanical: rename trait method, wrap single returns in vec![], update all call sites.

Commits

  1. feat(parsers): add Conan, Bower, AboutCode, Chef, FreeBSD, Autotools parsers
  2. feat(parsers): add CPAN Perl package parsers
  3. feat(parsers): add Bazel BUILD and Buck parsers
  4. docs: update parser implementation plan and supported formats
  5. refactor(parsers): consolidate PackageParser trait to single extract_packages method

mstykow and others added 5 commits February 10, 2026 00:13
…parsers

Add six new package manifest parsers with full test coverage:
- Conan (conanfile.py, conanfile.txt, conan.lock)
- Bower (bower.json)
- AboutCode (.ABOUT files)
- Chef (metadata.json, metadata.rb)
- FreeBSD (+COMPACT_MANIFEST)
- Autotools (configure, configure.ac)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add parsers for Perl CPAN ecosystem with three format handlers:
- META.json (v2 spec)
- META.yml (v1.4 spec)
- MANIFEST (file listing with package name extraction)

Includes improvement documentation for beyond-parity features.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add Starlark-based build file parsers using rustpython_parser:
- BazelBuildParser: extracts from BUILD files, supports multiple packages
- BuckBuildParser: extracts from BUCK files, supports multiple packages
- BuckMetadataBzlParser: extracts from METADATA.bzl with package_url support

Both Bazel and Buck parsers share the Starlark parsing approach for
extracting build rule metadata (name, licenses, dependencies).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add next phase planning document
- Update SUPPORTED_FORMATS.md with newly added parsers
- Update archived implementation plan with Phase 0.9 progress

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…packages method

Replace the dual-method PackageParser trait API with a single required method:

Before:
  - extract_package_data(path) -> PackageData       (required, single package)
  - extract_all_packages(path) -> Vec<PackageData>  (optional, multi-package)

After:
  - extract_packages(path) -> Vec<PackageData>      (required, all packages)
  - extract_first_package(path) -> PackageData      (default impl, convenience)

This eliminates the confusing distinction between single and multi-package
parsers. All parsers now implement extract_packages() returning a Vec,
and extract_first_package() is a default trait method that returns the
first element.

Changes across 75 files:
- mod.rs: updated trait definition, macro-generated dispatch, and
  registered all new parsers from previous commits
- 40 parser implementations: renamed method + wrapped returns in vec![]
- 50+ test files: updated call sites to use extract_first_package()
- Doc comments and test function names updated to reflect new API

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@mstykow mstykow merged commit 63e6df4 into main Feb 9, 2026
2 checks passed
@mstykow mstykow deleted the feat/missing-parsers branch February 9, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant