142 Commits

Author SHA1 Message Date
Tony
1acb805799 style: migrate eslint to oxlint (#21224)
* chore: add oxlint support

* style: apply autofix

* style: apply autofix for toSorted

* style: use alternative api for nsfw-flag jsPlugins

* fix: git diff

* fix: codeql

* test: console.log

* style: update lint workflow to use Checkstyle SARIF converter

* style: remove debug log from extractDateFromURL function

* chore: use oxlint-json-to-sarif

* test: console.log

* test: remove console.log

* test: update cookie data expectation in getCookies test

https://github.com/mccutchen/go-httpbin/pull/235 breaks this

* style: type-aware linting

* style: enable type-aware linting for oxlint
2026-02-28 21:23:11 +08:00
Tony
7785a7bde4 style: update eslint rules (#21207)
* style: update eslint rules

* style: fix prefer-object-spread

* style: fix no-lonely-if

* fix: typescript-eslint/no-unnecessary-template-expression

* fix: sort import

* style: apply file filtering to config presets

* revert: changes on pkg

* style: revert

* style: use defineConfig

* style: reorder js plugin in eslint config

* chore: remove obsolete override

* style: fix CodeQL initialization to ensure language matrix is used
2026-02-23 08:17:37 +08:00
Tony
ba0f1ad292 style(eslint): fix no-unassigned-vars no-useless-assignment preserve-caught-error (#21175)
* fix: fix no-unassigned-vars

* fix: fix preserve-caught-error

* fix: fix no-useless-assignment

* fix: update variable types for better type safety

* fix: replace nullish coalescing with logical OR for limit assignment

* fix: add DataItem type import for better type safety
2026-02-18 22:25:14 +08:00
DIYgod
5417ec7f13 fix: ensure build directory exists for CF worker build (#21104)
Create output directory recursively before writing routes-worker.js to prevent ENOENT errors during Cloudflare Worker deployment
2026-02-09 17:18:08 +08:00
DIYgod
d40f812563 refactor: deploy all routes to Cloudflare Workers (#20809)
- Remove Worker-specific route filtering (worker_namespaces) to include all 1537 namespaces in Worker builds
- Remove popularity analytics logic (foloAnalysisTop100) as Worker can now handle all routes
- Update node:child_process alias in tsdown config to use dedicated shim file
- Inline child_process shim in node-module.ts to avoid import cycles
- Fix tough-cookie import in telecompaper route (use named import CookieJar)
- Remove ESModule rules from wrangler.toml (not needed)

This enables full RSSHub functionality on Cloudflare Workers with no memory/size limitations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-04 17:33:55 +08:00
DIYgod
e27f501643 refactor: generate JSON data for namespace-centric docs (#20807)
- Update build-docs.ts to output routes.json and categories.json
- Modify workflow to copy JSON files to rsshub-docs/src/public

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 11:50:51 +08:00
DIYgod
1131350b5f feat: deploy RSSHub to Cloudflare Workers (#20804)
* feat: deploy RSSHub to Cloudflare Workers

- 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 <noreply@anthropic.com>

* feat(worker): add puppeteer and request-rewriter support

- 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 <noreply@anthropic.com>

* fix(cache): restore synchronous initialization for tests

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 <noreply@anthropic.com>

* test(worker): add automated Worker integration tests

- 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 <noreply@anthropic.com>

* refactor(worker): use test routes for Worker integration tests

- 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 <noreply@anthropic.com>

* fix(test): make header-generator test less flaky

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 <noreply@anthropic.com>

* fix(test): exclude worker tests from vitest coverage run

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 <noreply@anthropic.com>

* test(worker): add automated Worker integration tests

- 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 <noreply@anthropic.com>

* fix(worker): fix routes.js alias path in worker build config

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 <noreply@anthropic.com>

* ci: trigger CI re-run

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): build worker routes before worker-build

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 <noreply@anthropic.com>

* fix(test): increase timeout for Worker integration tests

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 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-04 09:22:05 +08:00
Tony
b84bb92a8a style: replace unicorn/no-for-loop w/ typescript/prefer-for-of (#20798)
* style: replace unicorn/no-for-loop w/ typescript/prefer-for-of

* style: fix typescript-eslint/prefer-for-of

* style: fix typescript/no-inferrable-types

* style: fix typescript-eslint/consistent-generic-constructors

* style: typescript-eslint/consistent-type-assertions

* style: fix typescript-eslint/array-type

* fix: revert .entries() in d96ca62d3d
2026-01-02 09:42:24 +08:00
DIYgod
e6112c8c93 fix(workflow): ensure CACHE_TYPE is ignored in route generation 2025-12-22 18:48:52 +08:00
DIYgod
2822c5902a fix(workflow): ignore redis and remote config in build-routes 2025-12-22 18:46:59 +08:00
Dzming Li
dbb692462d chore: add Nix flake and NixOS module support (#20597)
* feat(nix): add flake module and offline-friendly build

* chore(nix): upgrade to Node.js 24 and pnpm 10

Update devenv.nix to match project dependencies:
- Upgrade Node.js from 22 to 24 (aligns with Dockerfile node:24-bookworm)
- Upgrade pnpm from 9 to 10 (aligns with package.json pnpm@10.22.0)

* test: fix buffer-get test timeout

Replace external URL with mock server endpoint to prevent test timeout.
The test was trying to fetch from http://example.com which is not mocked,
causing it to timeout. Now uses http://rsshub.test/headers which is
properly mocked in the test setup.
2025-12-09 19:43:06 +08:00
Stephen Zhou
2e9976b24e chore: fix vercel build (#20645) 2025-12-06 14:28:38 +08:00
Stephen Zhou
be83ac8be4 chore: fix prettier config 2025-11-27 14:32:29 +08:00
Tony
bf9f4b5961 style: fix import 2025-11-27 11:22:19 +08:00
github-actions[bot]
a28890a135 style: auto format 2025-11-27 02:55:46 +00:00
Stephen Zhou
69a859ca9d refactor(package): simple type solution 2025-11-27 01:21:20 +08:00
Stephen Zhou
b4a2aa5e70 fix(core): package mode (#20580) 2025-11-26 20:44:18 +08:00
Tony
5bf337b2f3 chore: pull analytics from docs repo instead 2025-11-19 01:36:31 +08:00
dependabot[bot]
6899aca3d4 chore(deps-dev): bump tsdown from 0.15.12 to 0.16.0 (#20431)
* chore(deps-dev): bump tsdown from 0.15.12 to 0.16.0

Bumps [tsdown](https://github.com/rolldown/tsdown) from 0.15.12 to 0.16.0.
- [Release notes](https://github.com/rolldown/tsdown/releases)
- [Commits](https://github.com/rolldown/tsdown/compare/v0.15.12...v0.16.0)

---
updated-dependencies:
- dependency-name: tsdown
  dependency-version: 0.16.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: update file extension from .js to .mjs

* fix: update start script to use .mjs file extension

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-06 01:30:32 +08:00
dependabot[bot]
52c18b7f25 chore(deps-dev): bump eslint-plugin-unicorn from 61.0.2 to 62.0.0 (#20381)
* chore(deps-dev): bump eslint-plugin-unicorn from 61.0.2 to 62.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 61.0.2 to 62.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v61.0.2...v62.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-version: 62.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* style: fix unicorn/prefer-string-raw

* style: fix unicorn/no-useless-collection-argument

* style: fix unicorn/no-immediate-mutation

* style: fix unicorn/no-immediate-mutation

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 01:26:56 +08:00
Tony
b1c74bd3e3 chore: add back minify docker again (#20304)
* Revert "chore: minify docker (#18914)"

This reverts commit e9013a2313.

* Reapply "chore: minify docker (#18914)"

This reverts commit b16a021f0c.

* fix(minify-docker): correct path to cross-env binary

* feat(minify-docker): use import.meta.dirname

* chore(deps): remove deprecated @types/imapflow dependency
2025-10-18 01:48:38 +08:00
DIYgod
1ab16fd6f0 chore: vercel sync 2025-08-11 14:15:16 +08:00
Tony
6764a14555 fix(test): improve error handling and label management in route testing 2025-07-12 03:08:28 +08:00
Tony
45ee587316 fix(workflow): update Docker logs step to always run and add fail-build job 2025-06-22 17:28:38 +08:00
Tony
d929c7a15c chore(tests): rename and handle route failure labels 2025-06-06 00:07:05 +08:00
Tony
ef22a71dd6 chore: update auto label 2025-06-05 21:07:25 +08:00
DIYgod
2d7561b193 fix: popular category in build routes 2025-06-02 09:50:52 +08:00
DIYgod
2dce2e32dd feat: docs sorting and auto popular 2025-05-31 17:10:01 +08:00
DIYgod
8520db3e13 feat: api route (#19209)
* feat: api route

* test: api route
2025-05-27 13:21:27 +08:00
Tony
81ee26fff2 chore: use jsdelivr cdn link to avoid github 429 when build docs 2025-05-09 02:16:10 +08:00
Tony
dd96d12ebb revert: "chore: minify docker (#18914)" (#18931)
This reverts commit e9013a2313.
2025-04-24 02:18:02 +08:00
Tony
e9013a2313 chore: minify docker (#18914)
* chore: minify docker

* chore: bring back minify script
2025-04-23 02:42:25 +08:00
DIYgod
83e701b592 feat: compile ts through tsdown (#18908)
* feat: build ts via tsdown

* feat: exec tsdown

* fix

* fix

* fix

* feat: use tsdown shims

* chore: run rolldown lifecycle script

* fix: use shims

---------
2025-04-22 22:29:11 +08:00
Tony
905062f10c chore: fix test route in issue command 2025-02-12 01:25:55 +08:00
Tony
4fc15dcd02 chore(workflow): fix label removing
fix #16888
2025-02-06 16:00:43 +08:00
Tsuyumi
99ee9e7030 chore: escape HTML entity in route test URL display (#17592) 2024-11-15 20:19:42 +08:00
pseudoyu
52e72e2c60 fix(docs): handle duplicated routes in docs 2024-10-23 11:43:12 +08:00
Tony
2c898cf3fd chore: block PR with empty description 2024-10-21 02:01:35 +08:00
TonyRL
fe683a11e2 chore: unwrap error detail in test route 2024-05-24 20:19:41 +00:00
DIYgod
6ee5d7267b chore: add popular category 2024-05-19 23:00:43 +08:00
Tony
0893debb07 style(eslint): lint tsx (#15098) 2024-04-04 20:28:45 +08:00
DIYgod
d22a63c6d0 chore: schedule test full routes 2024-03-24 22:36:21 +08:00
DIYgod
8817829e20 fix: build docs 2024-03-24 21:14:25 +08:00
DIYgod
b774c60858 test: add full routes test (#14934)
* test: add critical routes test

* fix: youtube channels config

* test: add full routes test

* test: output full routes test result

* test: build routes before test

* test: use one reporter

* test: fix cache test errors

* test: fix cache test errors

* chore: puppeteerrc.cjs

* chore: puppeteerrc.cjs

* chore: puppeteerrc.cjs

* fix: build script

* chore: puppeteerrc rename

* test: route test names

* chore: pass test result to docs
2024-03-24 19:00:03 +08:00
Tony
63adaee7f2 chore: add typo check in build routes 2024-03-24 05:06:06 +08:00
Tony
847fdaba1d chore: fix route test github actions (#14923)
* chore: fix route test actions

* chore: bump unified
2024-03-23 08:19:05 +08:00
DIYgod
2d4abeb9ec docs: default values 2024-03-18 23:50:37 +08:00
DIYgod
939a77ecab chore: commit docs to docs repo 2024-03-18 19:36:56 +08:00
Tony
d585a87daf fix: allow multiple radar rules per route (#14800)
* fix: allow multiple radar rules per route

* fix: github folder

* feat: add namespace to radar target

* docs: fix types url
2024-03-16 03:28:44 +08:00
DIYgod
901075eda9 feat: radar rules api 2024-03-14 20:06:15 +08:00