Commit Graph

127 Commits

Author SHA1 Message Date
Tony 0ab18ff80e
test: refactor tests (#22677)
* test: refactor tests

* test: run *.worker.ts unit tests inside workerd
2026-07-10 23:26:43 +08:00
TonyRL 762885e40a docs: fix empty routes
close #22485
2026-07-09 16:30:42 +08:00
Tony 9c5549ef25
feat: move to ts6 (#22480) 2026-07-09 05:31:38 +08:00
Tony cb0791cb41
perf: dx (#22478)
* perf: use only one WASM alloc for xxhash

* perf(deps): lazy load mercury-parser and use googleapis/youtube instead of heavy googleapis

* perf(dx): lazy load dev registry

speed up npm dev script

* perf: close playwright browser on destroy

* fix: show exception msg in prod

* revert: "perf: use only one WASM alloc for xxhash"

This reverts commit 01ecdd48d09a046dce05f440814dcbec0323a7de.

* perf: use only one WASM alloc for xxhash

* test: add claim for worker

* fix: missing piece from 8dd9c9a

* feat: add namespace to the chunkfilename

* fix: keep var naming
2026-07-09 02:37:41 +08:00
TonyRL 5bb2e32409 chore: use upstream action 2026-07-04 23:39:52 +08:00
dependabot[bot] 417ab04f06
chore(deps-dev): bump eslint-plugin-unicorn from 66.0.0 to 68.0.0 (#22310)
* chore(deps-dev): bump eslint-plugin-unicorn from 66.0.0 to 68.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 66.0.0 to 68.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v66.0.0...v68.0.0)

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

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

* style: fix no-useless-coercion

* style: fix prefer-boolean-return

* style: fix no-useless-logical-operand

* style: fix prefer-single-replace

* style: fix consistent-conditional-object-spread

* style: fix no-useless-else

* style: fix prefer-unicode-code-point-escapes

* style: fix operator-assignment

* style: fix prefer-continue

* style: fix prefer-math-constants

* style: fix prefer-hoisting-branch-code

* style: fix prefer-array-slice

* style: fix consistent-class-member-order

* style: fix no-return-array-push

* style: fix prefer-promise-with-resolvers

* style: fix no-array-concat-in-loop

* style: fix no-loop-iterable-mutation

* style: fix no-invalid-argument-count

* style: fix no-duplicate-if-branches

* style: fix prefer-else-if

* style: fix no-unreadable-for-of-expression

* style: fix logical-assignment-operators

* style: fix default-export-style

* style: revert false positve in prefer-type-literal-last in #22274

* style: fix arrow-body-style

* style: add v68 recommended preset

* style: refactor GraphQL queries to use template literals for better readability

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
2026-06-20 23:11:27 +08:00
Tony 1c29f986c3 chore: reuse comments 2026-06-18 05:24:17 +08:00
Tony 6826e85b3e chore: fix proper await handling 2026-06-16 16:22:18 +08:00
dependabot[bot] 873618e99d
chore(deps-dev): bump eslint-plugin-unicorn from 65.0.1 to 66.0.0 (#22274)
* chore(deps-dev): bump eslint-plugin-unicorn from 65.0.1 to 66.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 65.0.1 to 66.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v65.0.1...v66.0.0)

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

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

* style: fix unicorn-js/prefer-url-href

* style: oxlint disable

* style: fix unicorn-js/no-useless-else

* style: no-unsafe-string-replacement

* style: fix no-duplicate-loops

* style: fix prefer-number-is-safe-integer

* style: fix prefer-single-array-predicate

* style: fix no-object-methods-with-collections

* style: fix no-useless-boolean-cast

* style: fix no-useless-template-literals

* style: fix no-negated-array-predicate

* style: fix prefer-direct-iteration

* style: fix consistent-optional-chaining

* style: fix prefer-simple-sort-comparator

* style: fix prefer-global-number-constants

* style: fix prefer-type-literal-last

* style: fix require-array-sort-compare.

* style: fix prefer-early-return

* style: fix prefer-short-arrow-method

* style: fix prefer-array-from-map

* style: fix prefer-scoped-selector

* style: fix no-global-object-property-assignment

* style: fix no-unnecessary-global-this

* style: fix no-unreadable-object-destructuring

* style: fix no-invalid-argument-count

* style: fix prefer-smaller-scope

* style: fix prefer-iterator-to-array.

* style: fix prefer-object-iterable-methods

* style: fix typo

* style: fix max-nested-calls

* style: fix no-incorrect-template-string-interpolation

* style: fix no-break-in-nested-loop

* style: fix prefer-await

* style: fix no-computed-property-existence-check

* style: fix prefer-number-coercion

* style: fix no-empty-file

* style: update eslint unicorn v66 recommended preset

* style: add unicorn/prefer-spread to oxlint-disable comments

* style: fix no-array-reduce

* style: delete github/no-then as it's covered by unicorn/prefer-await

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
2026-06-16 14:43:42 +08:00
dependabot[bot] 07834413f5
chore(deps-dev): bump eslint-plugin-unicorn from 64.0.0 to 65.0.0 (#22219)
* chore(deps-dev): bump eslint-plugin-unicorn from 64.0.0 to 65.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 64.0.0 to 65.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v64.0.0...v65.0.0)

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

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

* fix: no-array-from-fill

* fix: unicorn-js/no-duplicate-set-values

* fix: no-this-outside-of-class

* fix: no-unnecessary-nested-ternary

* fix: prefer-array-last-methods

* fix: prefer-queue-microtask

* fix: prefer-split-limit

* fix: no-array-from-fill

* fix: no-unused-array-method-return

* fix: prefer-single-call

* fix: prefer-includes-over-repeated-comparisons

* fix: consistent-compound-words

* fix: prefer-includes-over-repeated-comparisons

* chore: add eslint-plugin-unicorn v65 recommended preset

* fix: correct duration parsing logic in parseDuration function

* fix: update oxlint-disable

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
2026-06-09 00:08:15 +08:00
Tony 75d43dd086
chore: add eslint-plugin-regexp (#22189)
* chore: add eslint-plugin-regexp

* chore: autofix

* chore: fix no-useless-flag

* chore: fix optimal-lookaround-quantifier

* chore: fix no-lazy-ends

* chore: fix no-contradiction-with-assertion

* chore: fix no-useless-assertions

* chore: fix no-useless-quantifier

* chore: fix remaining regexp issues

* fix: regex for WFU news link validation
2026-06-05 20:04:39 +08:00
Tony a769e297b5 chore: enhance identify function 2026-05-13 19:17:03 +08:00
Tony 12a7918d4b chore: run check issue before call maintainers 2026-05-13 03:58:39 +08:00
Tony ef15da5f2b chore: simpler rss proposal 2026-05-13 02:53:24 +08:00
Tony c2b00f6090 chore: format description in lint-staged 2026-05-08 05:59:53 +08:00
Tony 5faaf6c2b3 chore(format): fix lifting of trailing directives from tables 2026-05-08 05:40:34 +08:00
Tony 70cd080406 chore: revive remark formatter
refs: #14040
2026-05-08 04:40:49 +08:00
Tony ecffcd3d95 chore: add vouch trust management system 2026-04-16 07:11:37 +08:00
github-actions[bot] ebfe021b50 style: auto format 2026-04-14 15:15:05 +00:00
Tony 0f7808f345
docs: add sports category (#21704)
* feat: add sports category

* fix: fix runyeah
2026-04-13 04:21:20 +08:00
Tony 75cb4a3fb9 chore: use mdast for route identification script 2026-03-13 19:57:27 +08:00
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 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 d96ca62d3d80806b0475a54e749decfc07b24701
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
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] 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
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
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