Commit Graph
35 Commits
Author SHA1 Message Date
Tony a3f06e485c feat: esm directory import (#21428) 2026-03-18 15:15:28 +08:00
Vanilla 3ecf9ee350 fix(lib/registry.ts): Allow hide debug info. (#20891) 2026-01-15 19:33:36 +08:00
DIYgodandClaude Opus 4.5 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
github-actions[bot] 2f37d73a24 style: auto format 2026-01-02 01:44:18 +00: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 cf4e772de8 refactor: replace art template with jsx (#20777)
* refactor: replace art template with jsx

* fix: tsx files

* fix: renderToString import

* fix: hono html raw import

* feat: remove art
2025-12-29 12:27:32 +08:00
Stephen Zhou add80cdb57 chore: fix vercel serve static 2025-12-06 23:50:22 +08:00
github-actions[bot] edfac9f24c style: auto format 2025-11-27 05:54:33 +00:00
github-actions[bot] 838eb3c7ff style: auto format 2025-11-27 05:49:33 +00:00
github-actions[bot] a28890a135 style: auto format 2025-11-27 02:55:46 +00:00
Stephen Zhou 411bf6e445 fix(package): no fallback serve for package mode 2025-11-27 03:33:44 +08:00
Stephen Zhou b4a2aa5e70 fix(core): package mode (#20580) 2025-11-26 20:44:18 +08:00
Aleksandr BogdanovandTony 9d2fc7a676 feat(route/telegram): Fix tglib (#18268)
* refactor telegram/tglib for Hono

* linter fix

* add CSP for channel media

* don't cut feed item title prematurely

* implement shared Geo position attachment

* don't start TG client unless routes are requested

* resolve typescript; fix private chats and groups; fix stickers and no-thumbnail document attachments; fix media-by-link attachments

* fix empty text and message grouping; add GeoLive media type; add Poll/Quiz media type

* add script-src none to CSP

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* add unwrap media for stories support

* fix fwdFrom access

* remove unnecessary core patches, add media route docs

* remove tglib fallback, as it's already preferred if configured

* implement stories endpoint

* improve text representation of channel content

* serve channel media under /channel/entityName/msgId

* improve stories endpoint

* restore original post links to avoid feed duplicates on upgrade

* appease eslint

* fix lint

* improve stories config route definition

* fix poll handling

* lint fix

* format poll results nicely

* fix node compat

* remove duplicate ignore

---------
2025-09-16 21:41:05 +08:00
dependabot[bot] 802cbf95d2 chore(deps-dev): bump eslint-plugin-unicorn from 60.0.0 to 61.0.2 (#19998)
* chore(deps-dev): bump eslint-plugin-unicorn from 60.0.0 to 61.0.1

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 60.0.0 to 61.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v60.0.0...v61.0.1)

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

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

* refactor: replace `replace(/regex/g)` with replaceAll

* refactor: replace sort() with toSorted() for immutability in various routes and utilities

* refactor: fix unicorn/prefer-array-find

* refactor: fix unicorn/prefer-at

* refactor: add unicorn/no-array-sort rule to ESLint configuration

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 23:03:48 +08:00
DIYgod bbe768246f feat: vercel compatibility 2025-08-11 21:39:03 +08:00
Lawrence Ching ab278982a5 feat: Exclude NSFW feeds when env variable DISABLE_NSFW is set to true (#19448)
* Exclude NSFW feeds when env variable DISABLE_NSFW is set to true

* Update lib/registry.ts

---------
2025-07-04 03:24:27 +08:00
dependabot[bot] 72466f0ea7 chore(deps): bump hono from 4.7.11 to 4.8.0 (#19404) 2025-06-19 11:28:16 +08:00
Tony e10c3a51ee feat(logger): add debug logging for matched routes (#19287) 2025-06-05 19:55:45 +08:00
DIYgod 8520db3e13 feat: api route (#19209)
* feat: api route

* test: api route
2025-05-27 13:21:27 +08:00
dependabot[bot] 5a824d3367 chore(deps-dev): bump eslint-plugin-unicorn from 58.0.0 to 59.0.0 (#18957)
* chore(deps-dev): bump eslint-plugin-unicorn from 58.0.0 to 59.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 58.0.0 to 59.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v58.0.0...v59.0.0)

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

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

* fix: no-unnecessary-array-flat-depth

* fix(eslint): unicorn/prefer-import-meta-properties

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 21:50:53 +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
Ethan Shen d359da431d fix(registry): Prioritize route registration based on specificity (#18002)
* fix(registry): Prioritize route registration based on specificity

* fix: Skip processing undefined namespaces

---------
2025-02-20 04:17:50 +08:00
Tony adce4057dc fix(core): healthz bypass cache (#16455) 2024-08-16 00:50:31 +08:00
incubator4 351578a876 feat(core): add healthz route for server health check (#16450) 2024-08-15 11:29:48 +08:00
Nya Candyandincubator4 68c7430fbb feat(core): opentelementry support (update of #14668) (#16087)
* chore: squash commit

* fix: tweak some mentioned issues

---------

Co-authored-by: incubator4 <aries0robin@gmail.com>
2024-07-05 19:22:33 +08:00
Innei eed1c568e5 fix: typo (#15989)
Signed-off-by: Innei <i@innei.in>
2024-06-25 19:01:14 +08:00
Tony 0893debb07 style(eslint): lint tsx (#15098) 2024-04-04 20:28:45 +08:00
JimenezLi b9ff661337 fix(core): fix wrong path on windows deploy (#15000) 2024-03-29 02:58:56 +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
DIYgod 901075eda9 feat: radar rules api 2024-03-14 20:06:15 +08:00
DIYgod 45f9ea21fb feat: add routes 2024-03-09 03:06:53 +08:00
DIYgod fe320c1153 feat: lazy load for production 2024-03-09 01:31:42 +08:00
DIYgod e0df7f11ac test: disable directoryImport in test env 2024-03-09 00:35:03 +08:00
DIYgod 6902129eb0 feat: new build script 2024-03-08 23:31:50 +08:00
DIYgod d4771fcbc4 feat: next generation routing registration method 2024-03-08 16:45:05 +08:00