feat(amazon): unify ranking commands for bestsellers/new-releases/movers-shakers#724
Merged
jackwener merged 2 commits intojackwener:mainfrom Apr 3, 2026
Merged
Conversation
Owner
|
Did you already join WeChat group? If not,you can contact me. |
…or all ranking types 1. Remove unnecessary __test__ wrapper from bestsellers.ts — the test now uses normalizeRankingCandidate directly from rankings.ts, eliminating a needless indirection layer. 2. Fix isRankingPaginationUrl to detect pagination refs for all ranking types: zg_bs_pg_ (bestsellers), zg_bsnr_pg_ (new releases), zg_bsms_pg_ (movers & shakers). Previously only matched the bestsellers-specific ref pattern.
Contributor
Author
|
@jackwener 没加呢,在哪加?我推特上找你? |
Owner
|
推特找我就行 @leozejia |
Contributor
Author
|
私信dd你了 @jackwener |
just-buer
pushed a commit
to just-buer/opencli
that referenced
this pull request
Apr 8, 2026
…ers-shakers (jackwener#724) * feat(amazon): unify ranking adapters for three signal boards * refactor: simplify bestsellers wrapper and fix pagination detection for all ranking types 1. Remove unnecessary __test__ wrapper from bestsellers.ts — the test now uses normalizeRankingCandidate directly from rankings.ts, eliminating a needless indirection layer. 2. Fix isRankingPaginationUrl to detect pagination refs for all ranking types: zg_bs_pg_ (bestsellers), zg_bsnr_pg_ (new releases), zg_bsms_pg_ (movers & shakers). Previously only matched the bestsellers-specific ref pattern. --------- Co-authored-by: 泽加武 <zejiawu@zejiawudeMac-mini.local> Co-authored-by: jackwener <jakevingoo@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n- add a shared amazon rankings core and route bestsellers through it\n- add amazon new-releases and amazon movers-shakers commands using the same extraction/normalization pipeline\n- unify ranking schema output across all 3 commands with consistent provenance and category fields\n- add URL/path validation per ranking list and normalize tracking ref segments to canonical ranking URLs\n- add best-effort category_node_id extraction and normalized visible_category_links metadata\n\nTests\n- npm run test:adapter -- src/clis/amazon/shared.test.ts src/clis/amazon/bestsellers.test.ts src/clis/amazon/rankings.test.ts\n- npm run build\n- runtime check: list includes amazon/bestsellers, amazon/new-releases, amazon/movers-shakers and each command returns ranked JSON items