Commit Graph

45 Commits

Author SHA1 Message Date
Tony 7c229947f7
perf: lazyload sentry (#22249) 2026-06-12 12:01:11 +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 1410f03e6d test: remove text "Not Found" from httperror
undici (v8.0.2) in node 26.0 enables http2 by default which has empty statusText
refs: 584e6aec01/lib/dispatcher/client-h2.js (L945)
2026-05-06 03:12:57 +08:00
github-actions[bot] ebfe021b50 style: auto format 2026-04-14 15:15:05 +00:00
Tony 1fe4e8a4ae
feat(core): add honeybadger support (#21574)
* feat(core): add honeybadger support

* feat(honeybadger): configure Honeybadger to disable uncaught error tracking

* feat(tests): add info logger mock to app-bootstrap tests

* test: fix mock value

* test: mock honeybadger as well
2026-04-01 01:10:12 +08:00
dependabot[bot] df6b73d866
chore(deps-dev): bump msw from 2.4.3 to 2.12.14 (#21483)
* chore(deps-dev): bump msw from 2.4.3 to 2.12.14

Bumps [msw](https://github.com/mswjs/msw) from 2.4.3 to 2.12.14.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.4.3...v2.12.14)

---
updated-dependencies:
- dependency-name: msw
  dependency-version: 2.12.14
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* chore: remove supertest

MSW's setupServer() works by patching Node's http module (via @mswjs/interceptors) to intercept outgoing requests. supertest's requests to http://127.0.0.1:1200 go through the same patched http module which causes server bad request

* chore(patch): add patch for @mswjs/interceptors@0.41.3

* fix(server): update server listen options to bypass unhandled requests

* chore: update patch for @mswjs/interceptors

---------

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-03-25 02:31:42 +08:00
DIYgod 81ff849337
feat(tests): add comprehensive unit tests for various utility functions and views (#20779)
* feat(tests): add comprehensive unit tests for various utility functions and views

- Implement tests for cache utility to ensure proper behavior with no cache and TTL keys.
- Add tests for common utilities including string manipulation and path handling.
- Introduce tests for directory import functionality to validate file imports and pattern matching.
- Create tests for git hash retrieval to handle fallback scenarios.
- Develop tests for deprecated got utility to verify response handling and retry logic.
- Enhance got utility tests to include request hooks and search parameter handling.
- Mock header generator tests to validate user agent handling.
- Expand helpers tests to cover current path retrieval and duration parsing.
- Implement tests for ofetch utility to ensure proper proxy handling and logging.
- Add OpenTelemetry metric tests to validate metric serialization.
- Create proxy tests to verify multi-proxy selection and failure handling.
- Introduce request rewriter tests to validate fetch and get wrapper functionality.
- Add timezone utility tests to handle various input types.
- Implement view tests for Atom and RSS rendering to ensure correct output.
- Create index view tests to validate debug information display based on configuration.

* refactor: remove deprecated got implementation and associated tests

* test: expand coverage for api, middleware, and utils
2025-12-29 17:34:48 +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
DIYgod 532619a8c2
fix(tests): update expected values and increase timeout for Puppeteer tests
- Adjusted expected values in error handling tests to reflect updated application behavior.
- Increased timeout for Puppeteer tests from 20 seconds to 45 seconds to accommodate longer loading times.
2025-08-22 17:45:39 +08:00
DIYgod f51da43fb7
feat(errors): add CaptchaError handling and related tests
- Introduced a new CaptchaError class to handle captcha-related errors.
- Updated the dynamic route to throw CaptchaError when encountering specific error codes.
- Added tests for CaptchaError to ensure proper error handling in the API.
2025-08-22 15:17:16 +08:00
DIYgod bbe768246f
feat: vercel compatibility 2025-08-11 21:39:03 +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
incubator4 be3ba61788
chore: otel fix and enhancement (#16754)
* feat(otel): use routePath insteadof path

* feat(otel): add otel bucket boundary env

* chore: move otel to debug block with alphabetical sort
2024-09-15 19:42:21 +08:00
Tony 9d7e1943f0
test: fix tests (#16697)
* test: fix tests

* revert "fix: fill image from itunes_item_image (#16694)"

This reverts commit 879772a97f.

* fix: fill image from jsonfeed template

* chore: bump msw to 2.4.3
2024-09-11 01:05:37 +08:00
Songkeys b0464552b4
fix: return json error message when ?format=json (#16315) 2024-07-31 19:14:20 +08:00
DIYgod fc32036d51
fix: error in errorHandler 2024-07-14 15:27:43 +08:00
Nya Candy 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
DIYgod d1dd8a53ca
feat: retry requesting control (#15717)
* feat: retry requesting control

* test: fix error handling test
2024-05-26 21:48:29 +08:00
dependabot[bot] 39af963b3c
chore(deps): bump @sentry/node from 7.114.0 to 8.3.0 (#15675)
* chore(deps): bump @sentry/node from 7.114.0 to 8.3.0

Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.114.0 to 8.3.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.114.0...8.3.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* chore: fix pnpm install

* fix: sentry import

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 13:29:49 +08:00
Rongrong a99b35f257
feat(core/utils/wechat-mp): major rewrite (#15276)
* feat(core/utils/wechat-mp): major rewrite

* Support more `item_show_type`: `APP_MSG_PAGE`, `VIDEO_SHARE_PAGE`,
`AUDIO_SHARE_PAGE`, and `IMG_SHARE_PAGE`. Previously only the first one
could be parsed properly. There are still some other known types waiting
for live examples for further adaptation. If this is the case, a
fallback method will try to generate entries using mostly OpenGraph
metadata. Meanwhile, the administrator of self-hosted instances will see
warnings in the log, asking them to report the URL as a new live
example. Still, `VIDEO_SHARE_PAGE` explicitly uses the fallback method
without any warning, as there is no possible approach to generate a
video/iframe URL from page metadata.

* Show audio and videos in `APP_MSG_PAGE`. However, not all videos
can be shown due to the same reason as `VIDEO_SHARE_PAGE`.

* Show the location where the article is sent.

* Some bugs, mostly due to outdated cheerio selector, are fixed.

* Add a new sub-route `wechat-mp` to `/test` to make things easier.

* All changes are well-tested.

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix ESLint & CodeQL errors

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix a DeepScan issue

Signed-off-by: Rongrong <i@rong.moe>

* style(core/utils/wechat-mp): fix ESLint error

Another try w/ pre-commit hook disabled.

Signed-off-by: Rongrong <i@rong.moe>

---------

Signed-off-by: Rongrong <i@rong.moe>
2024-04-18 22:05:32 +08:00
DIYgod c145a72590
test: add invalid-parameter-error and config-not-found-error 2024-04-07 17:46:46 +08:00
DIYgod 79fcce2729
feat: add ConfigNotFoundError and InvalidParameterError 2024-04-07 17:36:18 +08:00
DIYgod cef1ed1eb6
refactor: error types 2024-04-07 16:37:54 +08:00
DIYgod 2a6d5ac9f9
feat: better error message 2024-04-07 13:07:09 +08:00
github-actions[bot] ad93d75ce7 style: auto format 2024-04-04 12:30:18 +00:00
DIYgod f5ced001eb
test: errors 2024-03-31 03:17:53 +08:00
DIYgod 94cf0742af
feat: new error page 2024-03-06 02:33:28 +08:00
Yufan You c039164007
fix: route syntax for hono (#14638)
* fix: use :param{.+} instead of :param+ for hono

* fix: use two separate routes to simulate :param* in hono

It seems that hono does not support this route syntax. We can simulate
it via two separate routes.

See https://github.com/orgs/honojs/discussions/1536

* fix: use {} instead of () for regex in hono

* fix: revert changes to lib/router.js as it's still using koa router

* Revert "fix: use two separate routes to simulate :param* in hono"

This reverts commit b00a0a74a025939d0a59c3f8f7b3b7038c13f715.

* fix: use :param{.+}? to simulate :param*

* feat: add hint about trailing slash in error message
2024-03-05 21:02:41 +08:00
Tony 4c4d68e32b
test(error/index): revert accidental changes from #14664 2024-03-05 15:19:43 +08:00
Tony d17ebe81d0
feat(index): add back hot stats (#14664) 2024-03-05 13:55:39 +08:00
DIYgod dee7da3105
feat: pure esm and typescript routes 2024-03-04 00:17:16 +08:00
DIYgod 38e42156a0
feat: replace jest with vitest 2024-03-03 18:57:07 +08:00
DIYgod 3bfdf9427c
feat: new home page 2024-03-03 17:36:08 +08:00
DIYgod ba1bdf9bdc
feat: use hono context json and text 2024-03-01 20:50:17 +08:00
DIYgod 398be0f592
feat: rename routes dir - 1/2 2024-03-01 01:21:28 +08:00
DIYgod 206782bb61
fix: not found error handler 2024-02-26 19:34:17 +08:00
DIYgod b58b6e60cf
test: errors 2024-02-26 18:36:34 +08:00
DIYgod fa7eddb50a
fix: add reject error 2024-02-25 21:20:57 +08:00
DIYgod 174752fef5
refactor: format 2024-01-29 23:28:17 +08:00
DIYgod 4591116733
fix: middleware errors 2024-01-21 18:35:11 +08:00
DIYgod e7e3f689bd
fix: error handler and debug info 2024-01-21 15:41:42 +08:00
DIYgod 847724cad1
feat: work with hono and typescript 2024-01-21 11:55:18 +08:00
NeverBehave 0792f7ba25
feat(core): first attempt to init script standard (#8224)
- lazy load
- rate limit per path
- init .debug.json support
- docs
- maintainer
- radar
2021-09-22 05:41:00 -07:00