feat(plugin-rss): add final output transform hook for atom/rss/json#3238
feat(plugin-rss): add final output transform hook for atom/rss/json#3238
transform hook for atom/rss/json#3238Conversation
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff Generated by Rsdoctor GitHub Action |
Deploying rspress-v2 with
|
| Latest commit: |
0d31347
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://51afaf67.rspress-v2.pages.dev |
| Branch Preview URL: | https://copilot-featureexclude-md-md.rspress-v2.pages.dev |
|
I tested that this pr can achieve what I want. My configuration is: This pr can be merged? |
22f9587 to
327594e
Compare
ab6451b to
0d31347
Compare
transform hook for atom/rss/json
There was a problem hiding this comment.
Pull request overview
This PR extends @rspress/plugin-rss to allow post-processing of the final serialized feed output (RSS/Atom/JSON) via a new output.transform hook, and updates docs/tests accordingly.
Changes:
- Add
output.transform(content, context)to transform serialized feed content before writing to disk, with per-feed override over plugin-level. - Update RSS plugin docs (EN/ZH) to reflect current
testcallback signature/behavior and document the new transform hook with examples. - Add automated tests covering transform behavior across output types and precedence.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/plugin/official-plugins/rss.mdx | Updates ZH docs for test signature/behavior and documents output.transform with example usage. |
| website/docs/en/plugin/official-plugins/rss.mdx | Updates EN docs for test signature/behavior and documents output.transform with example usage. |
| scripts/dictionary.txt | Adds folo to the dictionary to prevent spelling/lint false-positives in docs/tests. |
| packages/plugin-rss/tests/output.test.ts | Adds coverage for transform application across rss/atom/json and override precedence. |
| packages/plugin-rss/src/type.ts | Introduces transform types (FeedOutputTransformer, context) and adds siteUrl to the item callback signature. |
| packages/plugin-rss/src/plugin-rss.ts | Switches file writing to use renderFeedContent(...) so transforms run after serialization. |
| packages/plugin-rss/src/options.ts | Implements renderFeedContent(...) and wires resolved transform into getOutputInfo(...). |
| packages/plugin-rss/src/internals/type.ts | Extends ResolvedOutput to carry the resolved transform function. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@rspress/plugin-rssalready supports filtering pages viatest, but it could not customize the final serialized feed output. This made it hard to inject extra channel/feed metadata such as custom IDs required by some feed consumers while keeping one configuration model across RSS, Atom, and JSON Feed.Add final-output customization hook
output.transformonFeedOutputOptions.rss,atom, andjsonoutputs.Keep configuration precedence predictable
transformat both:outputoutputtransformoverrides the top-level one, matching existing output option behavior.Clarify filtering and callback docs
testcallback as the recommended way to include a route prefix while excluding specific pages such as/blog/.test/itemcallback signatures with the current implementation.Document cross-format customization
Example:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
accounts.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=5242 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/playwright_chromiumdev_profile-gXhtxK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1635927436449698563,13978106266449576955,262144 --enable-features=CDPScreenshotNewSurface --disable-features=AutoDeElevate,AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,OptimizationHints,PaintHolding,Rend(dns block)/opt/google/chrome/chrome /opt/google/chrome/chrome --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl bin/node(dns block)clients2.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=5242 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/playwright_chromiumdev_profile-gXhtxK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1635927436449698563,13978106266449576955,262144 --enable-features=CDPScreenshotNewSurface --disable-features=AutoDeElevate,AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,OptimizationHints,PaintHolding,Rend(dns block)/opt/google/chrome/chrome /opt/google/chrome/chrome --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl bin/node(dns block)safebrowsingohttpgateway.googleapis.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=5242 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/playwright_chromiumdev_profile-gXhtxK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1635927436449698563,13978106266449576955,262144 --enable-features=CDPScreenshotNewSurface --disable-features=AutoDeElevate,AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,OptimizationHints,PaintHolding,Rend(dns block)/opt/google/chrome/chrome /opt/google/chrome/chrome --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl bin/node(dns block)www.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=5242 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/playwright_chromiumdev_profile-gXhtxK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1635927436449698563,13978106266449576955,262144 --enable-features=CDPScreenshotNewSurface --disable-features=AutoDeElevate,AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,OptimizationHints,PaintHolding,Rend(dns block)/opt/google/chrome/chrome /opt/google/chrome/chrome --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl bin/node(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.