-
Notifications
You must be signed in to change notification settings - Fork 9k
feat: deploy RSSHub to Cloudflare Workers #20804
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
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| import * as buffer from 'node:buffer'; | ||
| import * as child_process from 'node:child_process'; | ||
| import * as console_module from 'node:console'; | ||
| import * as constants from 'node:constants'; |
Check warning
Code scanning / ESLint
disallow deprecated APIs Warning
| import path from 'node:path'; | ||
| import * as perf_hooks from 'node:perf_hooks'; | ||
| import * as process from 'node:process'; | ||
| import * as punycode from 'node:punycode'; |
Check warning
Code scanning / ESLint
disallow deprecated APIs Warning
- Create Worker entry point (lib/worker.ts) with polyfills - Implement Worker-specific app configuration (lib/app.worker.tsx) - Add automatic .worker.ts resolution plugin for cleaner config - Simplify build configuration with only 3 essential shims - Enable static asset serving via Cloudflare Static Assets feature - Support dynamic route loading with proper module aliasing 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 <[email protected]>
- Add @cloudflare/puppeteer for Browser Rendering API support - Create puppeteer.worker.ts with Cloudflare Browser binding - Add request-rewriter Worker version with static browser headers - Add vm module shim to node-module.ts for JSDOM compatibility - Configure __dirname/__filename in tsdown for CommonJS compat - Update wrangler.toml with BROWSER binding configuration - Dynamically extract namespaces from foloAnalysisTop100 for routes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The async initialization caused cache tests to fail because the cache module wasn't ready when tests ran. Restored synchronous imports while keeping Worker-specific no-op behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add miniflare for Worker environment simulation - Create lib/worker.worker.test.ts with integration tests - Test basic routes (/test/1, /, unknown routes) - Test RSS feed routes (hackernews, v2ex) - Test error handling for puppeteer routes without BROWSER binding - Add worker-test npm script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Replace third-party routes (hackernews, v2ex, weibo) with /test/* routes - Remove miniflare dependency (wrangler includes it internally) - Simplify test setup using wrangler's unstable_dev API 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The header-generator library may return different platform values due to internal randomness. Update test to check for valid format instead of exact value. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Worker tests require the dist-worker bundle to be built first, which is not part of the regular CI test workflow. These tests should be run separately using 'pnpm worker-test'. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add worker-build step to CI workflow before running tests - Revert exclusion of worker tests from vitest coverage run - Worker tests now run as part of the regular test suite 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Change alias key from absolute path to relative import path to match how it's imported in lib/registry.ts. This fixes the worker build failing with "Could not resolve '../assets/build/routes.js'" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The worker build requires routes-worker.js which is generated by running build:routes with WORKER_BUILD=true. This was missing in CI, causing the worker build to fail with "Could not resolve routes.js". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Worker tests need more time in CI environments. Increase individual test timeouts from default 10s to 30s for each test case. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
562230b to
ae6bb33
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
tqlyy |
Involved Issue / 该 PR 相关 Issue
Close #
Example for the Proposed Route(s) / 路由地址示例
New RSS Route Checklist / 新 RSS 路由检查表
PuppeteerNote / 说明
Summary
.worker.tsmodule resolution to minimize manual aliasesChanges
lib/worker.tsas Worker entry point with MessagePort polyfill for undici compatibilitylib/app.worker.tsxwith simplified middleware stack (excludes heavy dependencies like Sentry, Cheerio, Redis)tsdown-worker.config.tswith automatic.worker.tsresolution pluginTest Plan
npm run build:worker/test/1should return valid feed