-
Notifications
You must be signed in to change notification settings - Fork 0
feat(rss10): add syndication namespace with Python and Node.js bindings #28
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
Conversation
- Add Syndication Module namespace support (syn:updatePeriod, syn:updateFrequency, syn:updateBase) - Add content:encoded namespace support to RSS 1.0 parser - Create comprehensive RSS 1.0 integration tests (12+ test cases) - Add is_syn_tag() helper for namespace detection - All 510 tests passing, clippy clean Phase 3: RSS 1.0 validation and enhancement
… Node.js bindings Add complete support for syndication module (RSS 1.0) and Dublin Core metadata fields in both Python (PyO3) and Node.js (napi-rs) bindings. Changes: - Export SyndicationMeta and UpdatePeriod from core library - Python bindings: - New PySyndicationMeta wrapper class with update_period, update_frequency, update_base getters - Added syndication, dc_creator, dc_publisher, dc_rights getters to PyFeedMeta - Added comprehensive test suite for syndication and Dublin Core fields - Node.js bindings: - New SyndicationMeta struct with automatic camelCase conversion (updatePeriod, etc.) - Added syndication, dcCreator, dcPublisher, dcRights fields to FeedMeta - Added test suite for syndication and Dublin Core fields - All tests passing - Clippy clean with no warnings This completes Phase 3 syndication bindings implementation.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 91.08% 91.55% +0.46%
==========================================
Files 32 33 +1
Lines 6447 6616 +169
==========================================
+ Hits 5872 6057 +185
+ Misses 575 559 -16
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
- Python: Return &str instead of String for update_period() to avoid allocation - Python: Optimize __repr__ to access fields directly without allocations - Node.js: Simplify Entry conversion using collect() for all Vec fields - Add tests for invalid input handling (bozo pattern) - Add tests for case-insensitive updatePeriod parsing - Add tests for partial syndication metadata All tests passing, clippy clean.
3666fde to
f604fb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive support for the RSS 1.0 Syndication Module namespace, including update schedule metadata (updatePeriod, updateFrequency, updateBase), enhances RSS 2.0 xml:lang support, adds Creative Commons license field support across all formats, and provides extensive test coverage with 12+ integration tests for RSS 1.0 parsing.
Key Changes
- Syndication Module Implementation: New
namespace/syndication.rsmodule with UpdatePeriod enum, SyndicationMeta struct, and parsing handlers for RSS 1.0 update schedule metadata - Parser Enhancements: Added syndication and content namespace support to RSS 1.0 parser, xml:lang attribute propagation in RSS 2.0, and license field extraction in RSS 2.0/Atom
- Cross-Language Bindings: Exposed syndication metadata and license fields in both Python (PyO3) and Node.js (napi-rs) bindings with proper type conversions
- Comprehensive Testing: Added 12 integration tests for RSS 1.0 (basic parsing, Dublin Core, content:encoded, syndication, edge cases) plus binding-specific tests
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/feedparser-rs-core/src/namespace/syndication.rs |
New syndication module with UpdatePeriod enum, parsing logic, and comprehensive unit tests |
crates/feedparser-rs-core/src/parser/rss10.rs |
Integrated syndication and content namespace handlers into RSS 1.0 parser |
crates/feedparser-rs-core/src/parser/rss.rs |
Added xml:lang attribute extraction and license field support for RSS 2.0 |
crates/feedparser-rs-core/src/parser/atom.rs |
Added license link relation extraction for Atom feeds |
crates/feedparser-rs-core/src/parser/common.rs |
Added is_syn_tag() and extract_xml_lang() helper functions |
crates/feedparser-rs-core/src/types/feed.rs |
Added license and syndication fields to FeedMeta |
crates/feedparser-rs-core/src/types/entry.rs |
Added license field to Entry |
crates/feedparser-rs-core/tests/test_rss10.rs |
Comprehensive RSS 1.0 integration tests (520 lines, 12 test cases) |
crates/feedparser-rs-py/src/types/syndication.rs |
Python bindings for SyndicationMeta with proper getter methods |
crates/feedparser-rs-py/src/types/feed_meta.rs |
Exposed syndication, license, and Dublin Core fields to Python |
crates/feedparser-rs-py/tests/test_syndication.py |
Python binding tests for syndication namespace (9 test cases) |
crates/feedparser-rs-node/src/lib.rs |
Node.js bindings with SyndicationMeta interface and type conversions (with Vec pre-allocation removed) |
crates/feedparser-rs-node/index.d.ts |
TypeScript definitions for syndication metadata and license fields |
crates/feedparser-rs-node/__test__/syndication.spec.mjs |
Node.js binding tests for syndication namespace (9 test cases) |
Summary
Phase 3: RSS 1.0 validation and enhancement + Bindings support
Core Library
syn:updatePeriod,syn:updateFrequency,syn:updateBase)content:encodednamespace support to RSS 1.0 parseris_syn_tag()helper for namespace detectionPython Bindings
PySyndicationMetawrapper class with PyO3 bindingssyndication,dc_creator,dc_publisher,dc_rightsgetters toFeedMeta&strinstead ofStringfor enum valuesNode.js Bindings
SyndicationMetastruct with napi-rs bindingsFeedMeta.collect()patternNew Files
Core
crates/feedparser-rs-core/src/namespace/syndication.rscrates/feedparser-rs-core/tests/test_rss10.rsPython Bindings
crates/feedparser-rs-py/src/types/syndication.rscrates/feedparser-rs-py/tests/test_syndication.pyNode.js Bindings
crates/feedparser-rs-node/__test__/syndication.spec.mjsReview Results
Test Plan