From 83e701b59225f7da356bd66cff56a7ae8aaa3138 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 22 Apr 2025 22:29:11 +0800 Subject: [PATCH] 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 --------- --- .prettierignore | 1 + eslint.config.mjs | 1 + lib/registry.ts | 14 +- lib/routes/005/index.ts | 2 - lib/routes/12306/index.ts | 2 - lib/routes/141jav/index.ts | 2 - lib/routes/141ppv/index.ts | 2 - lib/routes/163/ds.ts | 2 - lib/routes/163/exclusive.ts | 2 - lib/routes/163/music/artist-songs.ts | 2 - lib/routes/163/music/artist.ts | 2 - lib/routes/163/music/djradio.ts | 2 - lib/routes/163/music/playlist.ts | 2 - lib/routes/163/music/userevents.ts | 2 - lib/routes/163/music/userplaylist.ts | 2 - lib/routes/163/music/userplayrecords.ts | 2 - lib/routes/163/open/vip.ts | 2 - lib/routes/163/utils.ts | 3 - lib/routes/18comic/utils.ts | 3 - lib/routes/199it/index.ts | 3 - lib/routes/1point3acres/offer.ts | 2 - lib/routes/1point3acres/utils.ts | 3 - lib/routes/1x/index.ts | 4 +- lib/routes/2048/index.ts | 2 - lib/routes/3kns/index.ts | 2 - lib/routes/423down/index.ts | 14 +- lib/routes/4gamers/utils.ts | 3 - lib/routes/4ksj/forum.ts | 2 - lib/routes/500px/tribe-set.ts | 2 - lib/routes/56kog/util.ts | 3 - lib/routes/591/list.ts | 2 - lib/routes/78dm/index.ts | 2 - lib/routes/7mmtv/index.ts | 2 - lib/routes/8264/list.ts | 2 - lib/routes/91porn/author.ts | 2 - lib/routes/91porn/index.ts | 2 - lib/routes/95mm/utils.ts | 3 - lib/routes/a9vg/index.ts | 2 - lib/routes/abc/index.ts | 2 - lib/routes/accessbriefing/index.ts | 2 - lib/routes/acs/journal.ts | 2 - lib/routes/adquan/case-library.ts | 3 - lib/routes/adquan/index.ts | 3 - lib/routes/aeaweb/index.ts | 2 - lib/routes/aeon/utils.ts | 3 - lib/routes/agri/index.ts | 2 - lib/routes/aibase/util.ts | 3 - lib/routes/aicaijing/index.ts | 2 - lib/routes/aip/utils.ts | 3 - lib/routes/ali213/news.ts | 3 - lib/routes/ali213/zl.ts | 3 - lib/routes/aljazeera/index.ts | 2 - lib/routes/amazon/kindle-software-updates.ts | 2 - lib/routes/app-center/release.ts | 2 - lib/routes/appstorrent/programs.ts | 2 - lib/routes/aqara/post.ts | 2 - lib/routes/arcteryx/new-arrivals.ts | 2 - lib/routes/arcteryx/outlet.ts | 2 - lib/routes/arcteryx/regear-new-arrivals.ts | 2 - lib/routes/artstation/user.ts | 2 - lib/routes/asiafruitchina/categories.ts | 3 - lib/routes/asiafruitchina/news.ts | 3 - lib/routes/asiantolick/index.ts | 2 - lib/routes/asmr-200/index.ts | 3 +- lib/routes/asus/bios.ts | 2 - lib/routes/baidu/gushitong/index.ts | 2 - lib/routes/baidu/search.ts | 2 - lib/routes/baidu/tieba/forum.ts | 2 - lib/routes/baidu/tieba/post.ts | 2 - lib/routes/baidu/tieba/search.ts | 2 - lib/routes/baidu/top.ts | 2 - lib/routes/bandcamp/weekly.ts | 2 - lib/routes/bangumi.online/online.ts | 2 - lib/routes/bangumi.tv/calendar/today.ts | 2 - lib/routes/bangumi.tv/subject/ep.ts | 3 - lib/routes/bangumi.tv/user/collections.ts | 3 - lib/routes/baozimh/index.ts | 2 - lib/routes/bc3ts/list.ts | 5 +- lib/routes/bdys/index.ts | 2 - lib/routes/behance/user.ts | 2 - lib/routes/bgmlist/onair.ts | 2 - lib/routes/bilibili/utils.ts | 3 - lib/routes/bing/search.ts | 4 +- lib/routes/bloomberg/utils.ts | 3 - lib/routes/booru/mmda.ts | 2 - lib/routes/bsky/feeds.ts | 2 - lib/routes/bsky/posts.ts | 2 - lib/routes/btzj/index.ts | 2 - lib/routes/buaa/lib/space/newbook.ts | 2 - lib/routes/caai/utils.ts | 3 - lib/routes/caareviews/utils.ts | 3 - lib/routes/cahkms/index.ts | 2 - lib/routes/caixin/database.ts | 2 - lib/routes/caixin/utils.ts | 3 - lib/routes/cankaoxiaoxi/index.ts | 2 - lib/routes/cara/likes.ts | 3 - lib/routes/cara/timeline.ts | 3 - lib/routes/cartoonmad/comic.ts | 2 - lib/routes/cbaigui/index.ts | 2 - lib/routes/ccf/ccfcv/index.ts | 2 - lib/routes/ccf/tfbd/utils.ts | 3 - lib/routes/ccfa/index.ts | 2 - lib/routes/cctv/xwlb.ts | 2 +- lib/routes/cde/xxgk.ts | 33 +- lib/routes/cdzjryb/project-list.ts | 2 - lib/routes/cebbank/all.ts | 2 - lib/routes/cebbank/history.ts | 2 - lib/routes/chaincatcher/home.ts | 2 - lib/routes/changba/user.ts | 2 - lib/routes/chaoxing/qk.ts | 2 - lib/routes/chinacdc/index.ts | 3 - lib/routes/chinadegrees/province.ts | 2 - lib/routes/chuanliu/nice.ts | 2 - lib/routes/cls/depth.ts | 2 - lib/routes/cls/hot.ts | 2 - lib/routes/cls/subject.ts | 2 - lib/routes/cls/telegraph.ts | 2 - lib/routes/cma/channel.ts | 2 - lib/routes/cngal/entry.ts | 2 - lib/routes/cngal/weekly.ts | 2 - lib/routes/cnjxol/index.ts | 2 - lib/routes/cnki/debut.ts | 2 - lib/routes/cnki/utils.ts | 3 - lib/routes/cntheory/paper.ts | 2 - lib/routes/cntv/column.ts | 2 - lib/routes/codeforces/contests.ts | 10 +- lib/routes/comicskingdom/index.ts | 2 - lib/routes/coomer/index.ts | 4 +- lib/routes/copymanga/comic.ts | 2 - lib/routes/creative-comic/book.ts | 2 - lib/routes/cuilingmag/index.ts | 2 - lib/routes/curius/links.ts | 2 - lib/routes/cztv/daily.ts | 2 - lib/routes/cztv/zjxwlb.ts | 2 - lib/routes/daily/utils.ts | 2 - lib/routes/damai/activity.ts | 2 - lib/routes/dcfever/utils.ts | 3 - lib/routes/deadline/posts.ts | 2 - lib/routes/dedao/knowledge.ts | 2 - lib/routes/dedao/user.ts | 2 - lib/routes/deeplearning/the-batch.ts | 2 - lib/routes/dehenglaw/index.ts | 2 - lib/routes/diershoubing/news.ts | 2 - lib/routes/discord/channel.ts | 2 - lib/routes/discord/search.ts | 3 - lib/routes/dlnews/category.ts | 2 - lib/routes/dlsite/utils.ts | 3 - lib/routes/dn/news.ts | 2 - lib/routes/douban/movie/coming.ts | 3 - lib/routes/douban/other/explore.ts | 2 - lib/routes/douban/other/list.ts | 2 - lib/routes/douban/other/recommended.ts | 2 - lib/routes/douban/other/weekly-best.ts | 2 - lib/routes/douyin/utils.ts | 3 - lib/routes/douyu/group.ts | 2 - lib/routes/douyu/post.ts | 2 - lib/routes/dribbble/utils.ts | 3 - lib/routes/duozhuayu/search.ts | 2 - lib/routes/dushu/fuzhou/index.ts | 2 - lib/routes/dw/utils.ts | 2 - lib/routes/e-hentai/index.ts | 2 - lib/routes/eastmoney/report/index.ts | 3 - lib/routes/ecnu/contest.ts | 2 - lib/routes/elsevier/issue.ts | 2 - lib/routes/elsevier/journal.ts | 2 - lib/routes/epicgames/index.ts | 2 - lib/routes/eprice/rss.ts | 2 - lib/routes/eshukan/academic.ts | 2 - lib/routes/espn/news.ts | 5 +- lib/routes/esquirehk/tag.ts | 5 +- lib/routes/famitsu/category.ts | 4 +- lib/routes/fanbox/utils.ts | 3 - lib/routes/fangchan/list.ts | 3 - lib/routes/fansly/utils.ts | 3 - lib/routes/farmatters/index.ts | 2 - lib/routes/fashionnetwork/index.ts | 2 - lib/routes/fastbull/news.ts | 2 - lib/routes/feng/forum.ts | 2 - lib/routes/ff14/ff14-global.ts | 2 - lib/routes/ff14/ff14-zh.ts | 2 - lib/routes/fffdm/manhua/manhua.ts | 2 - lib/routes/fisher-spb/news.ts | 2 - lib/routes/flyert/util.ts | 3 - lib/routes/focustaiwan/index.ts | 2 - lib/routes/followin/utils.ts | 3 - lib/routes/foresightnews/util.ts | 3 - lib/routes/fosshub/index.ts | 2 - lib/routes/freecomputerbooks/index.ts | 2 - lib/routes/furstar/utils.ts | 3 - lib/routes/futunn/main.ts | 2 - lib/routes/gameapps/index.ts | 2 - lib/routes/gamebase/news.ts | 3 - lib/routes/gcores/articles.ts | 3 - lib/routes/gcores/categories.ts | 3 - lib/routes/gcores/collections.ts | 3 - lib/routes/gcores/news.ts | 3 - lib/routes/gcores/parser.ts | 3 - lib/routes/gcores/program-previews.ts | 3 - lib/routes/gcores/radio.ts | 2 - lib/routes/gcores/tags.ts | 3 - lib/routes/gcores/topics.ts | 3 - lib/routes/gcores/util.ts | 3 - lib/routes/gcores/videos.ts | 3 - lib/routes/geekpark/index.ts | 2 - lib/routes/gelbooru/utils.ts | 3 - lib/routes/gelonghui/live.ts | 2 - lib/routes/gettr/user.ts | 2 - lib/routes/github/pulse.ts | 2 - lib/routes/github/trending.ts | 2 - lib/routes/gitpod/blog.ts | 2 - lib/routes/gofans/index.ts | 2 - lib/routes/google/fonts.ts | 2 - lib/routes/google/news.ts | 2 - lib/routes/google/search.ts | 2 - lib/routes/gov/caac/cjwt.ts | 2 - lib/routes/gov/cmse/fxrw.ts | 2 - lib/routes/gov/cmse/index.ts | 2 - lib/routes/gov/csrc/news.ts | 4 +- lib/routes/gov/forestry/gjlckjdjt.ts | 2 - lib/routes/gov/general/general.ts | 5 +- lib/routes/gov/guangdong/tqyb/sncsyjxh.ts | 2 - lib/routes/gov/guangdong/tqyb/tfxtq.ts | 2 - lib/routes/gov/hangzhou/zwfw.ts | 2 - lib/routes/gov/jiangsu/wlt/index.ts | 3 - lib/routes/gov/safe/util.ts | 3 - lib/routes/gov/samr/xgzlyhd.ts | 2 - lib/routes/gov/sh/fgw/index.ts | 2 - lib/routes/gov/sh/rsj/ksxm.ts | 2 - lib/routes/gov/sh/wgj/wgj.ts | 2 - .../gov/sichuan/deyang/govpublicinfo.ts | 2 - lib/routes/gov/sichuan/deyang/mztoday.ts | 2 - lib/routes/gov/stats/index.ts | 2 - lib/routes/guduodata/daily.ts | 2 - lib/routes/gumroad/index.ts | 2 - lib/routes/gzdaily/app.ts | 2 - lib/routes/hafu/utils.ts | 3 - lib/routes/hashnode/blog.ts | 2 - lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts | 2 - lib/routes/hellogithub/report.ts | 2 - lib/routes/hellogithub/volume.ts | 2 - lib/routes/hiring.cafe/jobs.ts | 3 - lib/routes/hitcon/zeroday.ts | 3 - lib/routes/hk01/utils.ts | 3 - lib/routes/hkej/index.ts | 2 - lib/routes/hket/index.ts | 2 - lib/routes/hostmonit/cloudflareyes.ts | 2 - lib/routes/houxu/events.ts | 2 - lib/routes/houxu/index.ts | 2 - lib/routes/houxu/memory.ts | 2 - lib/routes/hoyolab/news.ts | 2 - lib/routes/hupu/all.ts | 2 - lib/routes/hupu/bbs.ts | 2 - lib/routes/huxiu/util.ts | 3 - lib/routes/i-cable/news.ts | 3 - lib/routes/ianspriggs/index.ts | 2 - lib/routes/idaily/index.ts | 2 - lib/routes/ieee/author.ts | 2 - lib/routes/ieee/journal.ts | 2 - lib/routes/ifeng/news.ts | 2 - lib/routes/ifeng/utils.ts | 3 - lib/routes/ikea/cn/utils.ts | 3 - lib/routes/ikea/gb/new.ts | 2 - lib/routes/ikea/gb/offer.ts | 2 - lib/routes/iknowwhatyoudownload/daily.ts | 3 - lib/routes/imdb/chart.ts | 4 +- lib/routes/imiker/jinghua.ts | 2 - lib/routes/infoq/presentations.ts | 2 - lib/routes/informs/index.ts | 2 - lib/routes/instagram/common-utils.ts | 3 - lib/routes/instagram/web-api/utils.ts | 3 - lib/routes/ipsw.dev/index.ts | 2 - lib/routes/iqilu/program.ts | 2 - lib/routes/iqiyi/album.ts | 2 - lib/routes/iresearch/chart.ts | 3 - lib/routes/iresearch/report.ts | 2 - lib/routes/iresearch/weekly.ts | 2 - lib/routes/itch/devlog.ts | 2 - lib/routes/itch/index.ts | 2 - lib/routes/ithome/zt.ts | 2 - lib/routes/iwara/subscriptions.ts | 2 - lib/routes/ixigua/user-video.ts | 2 - lib/routes/japanpost/track.ts | 3 - lib/routes/japanpost/utils.ts | 6 +- lib/routes/javbus/index.ts | 2 - lib/routes/javlibrary/utils.ts | 3 - lib/routes/javtiful/utils.ts | 3 - lib/routes/javtrailers/utils.ts | 2 - lib/routes/jd/price.ts | 2 - lib/routes/jiemian/lists.ts | 2 - lib/routes/jimmyspa/books.ts | 2 - lib/routes/jimmyspa/news.ts | 2 - lib/routes/jin10/category.ts | 2 - lib/routes/jin10/index.ts | 2 - lib/routes/jinse/catalogue.ts | 2 - lib/routes/jinse/lives.ts | 2 - lib/routes/jinse/timeline.ts | 2 - lib/routes/jiuyangongshe/community.ts | 5 +- lib/routes/jjwxc/author.ts | 2 - lib/routes/jjwxc/book.ts | 2 - lib/routes/joins/chinese.ts | 2 - lib/routes/joneslanglasalle/index.ts | 3 - lib/routes/jpxgmn/utils.ts | 3 - lib/routes/jump/discount.ts | 2 - lib/routes/kadokawa/blog.ts | 2 - lib/routes/kamen-rider-official/news.ts | 2 - lib/routes/kantarworldpanel/index.ts | 2 - lib/routes/kcna/news.ts | 2 - lib/routes/keep/user.ts | 2 - lib/routes/kemono/index.ts | 6 +- lib/routes/kepu/live.ts | 2 - lib/routes/kpmg/insights.ts | 2 - lib/routes/kpopping/kpics.ts | 3 - lib/routes/kpopping/news.ts | 3 - lib/routes/kyodonews/index.ts | 2 - lib/routes/lang/room.ts | 2 - lib/routes/lanqiao/utils.ts | 3 - lib/routes/learnku/topic.ts | 2 - lib/routes/leetcode/dailyquestion-cn.ts | 2 - lib/routes/leetcode/dailyquestion-en.ts | 2 - lib/routes/lfsyd/utils.ts | 3 - lib/routes/linkedin/cn/utils.ts | 3 - lib/routes/linkresearcher/index.ts | 2 - lib/routes/lkong/forum.ts | 2 - lib/routes/lkong/thread.ts | 2 - lib/routes/lmu/jobs.ts | 2 - lib/routes/logclub/index.ts | 2 - lib/routes/logclub/report.ts | 2 - lib/routes/logonews/index.ts | 2 - lib/routes/logrocket/index.ts | 9 +- lib/routes/loltw/news.ts | 2 - lib/routes/lorientlejour/index.ts | 4 +- lib/routes/lovelive-anime/news.ts | 2 - lib/routes/lovelive-anime/schedules.ts | 6 +- lib/routes/lovelive-anime/topics.ts | 2 - lib/routes/lrepacks/index.ts | 2 - lib/routes/ltaaa/article.ts | 3 - lib/routes/luolei/index.ts | 2 - lib/routes/lvv2/news.ts | 2 - lib/routes/lvv2/top.ts | 2 - lib/routes/lxixsxa/discography.ts | 2 - lib/routes/lxixsxa/information.ts | 2 - lib/routes/m4/index.ts | 2 - lib/routes/maccms/index.ts | 3 +- lib/routes/magazinelib/latest-magazine.ts | 2 - lib/routes/manhuagui/subscribe.ts | 2 - lib/routes/manyvids/video.ts | 5 +- lib/routes/mcmod/index.ts | 3 +- lib/routes/mdpi/journal.ts | 2 - lib/routes/mercari/util.ts | 2 - lib/routes/metacritic/index.ts | 2 - lib/routes/meteor/utils.ts | 3 - lib/routes/mi/utils.ts | 11 +- lib/routes/mihoyo/bbs/follow-list.ts | 2 - lib/routes/mihoyo/bbs/official.ts | 2 - lib/routes/mihoyo/bbs/utils.ts | 3 - lib/routes/mihoyo/ys/news.ts | 2 - lib/routes/mindmeister/example.ts | 2 - lib/routes/mingpao/index.ts | 2 - lib/routes/missav/new.ts | 2 - lib/routes/misskey/utils.ts | 3 - lib/routes/mittrchina/index.ts | 2 - lib/routes/modelscope/community.ts | 2 - lib/routes/modelscope/datasets.ts | 2 - lib/routes/modelscope/studios.ts | 2 - lib/routes/modrinth/versions.ts | 3 - lib/routes/mrdx/daily.ts | 2 +- lib/routes/mydrivers/index.ts | 2 - lib/routes/myfans/post.ts | 5 +- lib/routes/myfigurecollection/activity.ts | 2 - lib/routes/myfigurecollection/index.ts | 2 - lib/routes/mymusicsheet/usersheets.ts | 2 - lib/routes/natgeo/dailyphoto.ts | 2 - .../nationalgeographic/latest-stories.ts | 2 - lib/routes/nautil/topics.ts | 2 - lib/routes/nber/common.ts | 3 - lib/routes/ncc-cma/cmdp.ts | 2 - lib/routes/netflav/index.ts | 2 - lib/routes/news/xhsxw.ts | 2 - lib/routes/newzmz/util.ts | 3 - lib/routes/nhentai/util.ts | 3 - lib/routes/nhk/news-web-easy.ts | 2 - lib/routes/nhk/news.ts | 2 - lib/routes/nicovideo/utils.ts | 5 +- lib/routes/nikkei/news.ts | 2 - lib/routes/nintendo/direct.ts | 2 - lib/routes/nintendo/eshop-hk.ts | 2 - lib/routes/nintendo/eshop-jp.ts | 2 - lib/routes/nintendo/eshop-us.ts | 2 - lib/routes/nintendo/utils.ts | 7 +- lib/routes/njnu/jwc/jwc.ts | 4 +- lib/routes/nmtv/column.ts | 2 - lib/routes/notefolio/search.ts | 2 - lib/routes/npm/package.ts | 2 - lib/routes/nytimes/daily-briefing-chinese.ts | 2 - lib/routes/oceanengine/arithmetic-index.ts | 4 +- lib/routes/oeeee/app/channel.ts | 2 - lib/routes/oeeee/app/reporter.ts | 2 - lib/routes/oeeee/web.ts | 2 - lib/routes/oncc/index.ts | 2 - lib/routes/oncc/money18.ts | 2 - lib/routes/onet/news.ts | 2 - lib/routes/onet/utils.ts | 3 - lib/routes/openai/chatgpt.ts | 2 +- lib/routes/openai/common.ts | 3 - lib/routes/openrice/chart.ts | 2 - lib/routes/openrice/offers.ts | 2 - lib/routes/openrice/promos.ts | 2 - lib/routes/orcid/index.ts | 2 - lib/routes/oreno3d/main.ts | 2 - lib/routes/oschina/column.ts | 3 - lib/routes/oschina/event.ts | 3 - lib/routes/oshwhub/explore.ts | 2 - lib/routes/osu/beatmaps/latest-ranked.ts | 2 - lib/routes/otobanana/utils.ts | 3 - lib/routes/oup/index.ts | 2 - lib/routes/papers/category.ts | 3 - lib/routes/papers/query.ts | 2 - lib/routes/parliament.uk/petitions.ts | 3 - lib/routes/patagonia/new-arrivals.ts | 2 - lib/routes/patreon/feed.ts | 3 - lib/routes/penguin-random-house/utils.ts | 3 - lib/routes/phoronix/index.ts | 4 +- lib/routes/picnob/user.ts | 2 - lib/routes/picuki/profile.ts | 2 - lib/routes/pikabu/utils.ts | 3 - lib/routes/pixabay/search.ts | 2 - lib/routes/pnas/index.ts | 4 +- lib/routes/podwise/episodes.ts | 2 +- lib/routes/pornhub/utils.ts | 3 - lib/routes/producthunt/today.ts | 2 - lib/routes/ps/monthly-games.ts | 2 - lib/routes/psyche/utils.ts | 3 - lib/routes/pts/curations.ts | 2 - lib/routes/pts/index.ts | 2 - lib/routes/pts/live.ts | 2 - lib/routes/pts/projects.ts | 2 - lib/routes/pubmed/trending.ts | 2 - lib/routes/qidian/author.ts | 2 - lib/routes/qoo-app/apps/comment.ts | 2 - lib/routes/qoo-app/notes/note.ts | 2 - lib/routes/qoo-app/user/app-comment.ts | 2 - lib/routes/qq/ac/utils.ts | 3 - lib/routes/qq/fact/index.ts | 2 - lib/routes/questmobile/report.ts | 2 - lib/routes/qweather/3days.ts | 2 - lib/routes/qweather/now.ts | 2 - lib/routes/radio/album.ts | 2 - lib/routes/radio/index.ts | 2 - lib/routes/radio/zhibo.ts | 2 - lib/routes/raspberrypi/magazine.ts | 3 - lib/routes/rawkuma/manga.ts | 2 - lib/routes/readhub/index.ts | 2 - lib/routes/readhub/util.ts | 3 - lib/routes/reuters/common.ts | 2 - lib/routes/routledge/book-series.ts | 2 - lib/routes/rsc/journal.ts | 2 - lib/routes/saraba1st/digest.ts | 2 - lib/routes/science/cover.ts | 2 - lib/routes/science/utils.ts | 3 - lib/routes/sciencedirect/call-for-paper.ts | 2 - lib/routes/scientificamerican/podcast.ts | 3 - lib/routes/sctv/programme.ts | 2 - lib/routes/seekingalpha/index.ts | 2 - lib/routes/sensortower/blog.ts | 2 - lib/routes/shcstheatre/programs.ts | 2 - lib/routes/shiep/index.ts | 2 - lib/routes/shmtu/portal.ts | 2 - lib/routes/shoac/recent-show.ts | 2 - lib/routes/shuiguopai/index.ts | 2 - lib/routes/simpleinfo/index.ts | 2 - lib/routes/sina/utils.ts | 3 - lib/routes/sinchew/index.ts | 2 - lib/routes/sjtu/tongqu/activity.ts | 2 - lib/routes/skeb/utils.ts | 3 - lib/routes/snowpeak/us-new-arrivals.ts | 2 - lib/routes/sogou/search.ts | 2 - lib/routes/sohu/mp.ts | 2 - lib/routes/southcn/nfapp/column.ts | 2 - lib/routes/southcn/nfapp/reporter.ts | 2 - lib/routes/spankbang/new-videos.ts | 2 - lib/routes/springer/journal.ts | 2 - lib/routes/sse/inquire.ts | 2 - lib/routes/sse/renewal.ts | 6 +- lib/routes/ssm/news.ts | 2 - lib/routes/stdaily/digitalpaper.ts | 2 - lib/routes/steam/appcommunityfeed.ts | 2 - lib/routes/steam/curator.ts | 3 - lib/routes/steam/workshop-search.ts | 2 - lib/routes/storyfm/episodes.ts | 2 - lib/routes/straitstimes/index.ts | 2 - lib/routes/surfshark/blog.ts | 2 - lib/routes/swjtu/utils.ts | 3 - lib/routes/syosetu/ranking-isekai.ts | 5 +- lib/routes/syosetu/ranking-r18.ts | 5 +- lib/routes/syosetu/ranking.ts | 5 +- lib/routes/syosetu/search.ts | 5 +- lib/routes/szse/inquire.ts | 2 - lib/routes/szse/projectdynamic.ts | 2 - lib/routes/taobao/zhongchou.ts | 2 - lib/routes/taptap/utils.ts | 3 - lib/routes/techcrunch/news.ts | 2 - lib/routes/telegram/channel.ts | 3 - lib/routes/tencent/news/author.ts | 2 - lib/routes/tencent/news/coronavirus/data.ts | 2 - lib/routes/tencent/news/coronavirus/total.ts | 2 - lib/routes/tesla/cx.ts | 2 - lib/routes/tfc-taiwan/utils.ts | 3 - lib/routes/the/index.ts | 2 - lib/routes/theatlantic/utils.ts | 3 - lib/routes/theblockbeats/index.ts | 3 - lib/routes/theinitium/app.ts | 2 - lib/routes/themoviedb/utils.ts | 3 - lib/routes/thenewslens/index.ts | 2 - lib/routes/thepaper/factpaper.ts | 2 - lib/routes/thepaper/utils.ts | 3 - lib/routes/theverge/index.ts | 3 - lib/routes/thoughtco/index.ts | 2 - lib/routes/tiktok/user.ts | 2 - lib/routes/tingshuitz/shenzhen.ts | 2 - lib/routes/tingtingfm/program.ts | 2 - lib/routes/tmtpost/util.ts | 3 - lib/routes/tophub/list.ts | 2 - lib/routes/toutiao/user.ts | 5 +- lib/routes/tradingview/blog.ts | 2 - lib/routes/transcriptforest/index.ts | 2 - lib/routes/transformer-circuits/index.ts | 5 - lib/routes/trending/all-trending.ts | 6 +- lib/routes/tribalfootball/latest.ts | 2 - lib/routes/tvb/news.ts | 2 - lib/routes/tvtropes/featured.ts | 2 - lib/routes/twreporter/fetch-article.ts | 3 - lib/routes/txrjy/fornumtopic.ts | 2 - lib/routes/udn/breaking-news.ts | 2 - lib/routes/uptimerobot/rss.ts | 2 - lib/routes/urbandictionary/random.ts | 2 - lib/routes/utgd/utils.ts | 3 - lib/routes/vcb-s/category.ts | 2 - lib/routes/vcb-s/index.ts | 2 - lib/routes/vice/topic.ts | 4 +- lib/routes/vimeo/category.ts | 2 - lib/routes/vimeo/channel.ts | 2 - lib/routes/vimeo/usr-videos.ts | 2 - lib/routes/visionias/utils.ts | 3 - lib/routes/wainao/topics.ts | 3 - lib/routes/wallpaperhub/index.ts | 2 - lib/routes/wallstreetcn/live.ts | 2 - lib/routes/warthunder/news.ts | 2 - lib/routes/washingtonpost/app.ts | 8 +- lib/routes/weibo/search/hot.ts | 2 - lib/routes/wellcee/rent.ts | 4 +- lib/routes/whu/news.ts | 2 - lib/routes/whu/util.ts | 3 - lib/routes/winstall/update.ts | 2 - lib/routes/wise/pair.ts | 4 +- lib/routes/wmc-bj/publish.ts | 2 - lib/routes/wnacg/common.ts | 3 - lib/routes/wsj/utils.ts | 3 - lib/routes/x-mol/news.ts | 2 - lib/routes/xiaomiyoupin/crowdfunding.ts | 2 - lib/routes/xiaomiyoupin/utils.ts | 3 - lib/routes/xinpianchang/util.ts | 3 - lib/routes/xjtu/job.ts | 2 - lib/routes/xjtu/std.ts | 2 - lib/routes/xkb/index.ts | 2 - lib/routes/xueqiu/stock-comments.ts | 2 - lib/routes/xys/new.ts | 2 - lib/routes/xyzrank/index.ts | 2 - lib/routes/yahoo/news/utils.ts | 3 - lib/routes/ycwb/index.ts | 2 - lib/routes/yenpress/series.ts | 5 +- lib/routes/yicai/dt.ts | 2 - lib/routes/yicai/utils.ts | 3 - lib/routes/ymgal/game.ts | 2 - lib/routes/yoasobi-music/info.ts | 2 - lib/routes/yoasobi-music/live.ts | 2 - lib/routes/yoasobi-music/media.ts | 2 - lib/routes/youku/channel.ts | 2 - lib/routes/youtube/community.ts | 4 +- lib/routes/youtube/utils.ts | 3 - lib/routes/yxdzqb/index.ts | 2 - lib/routes/zagg/new-arrivals.ts | 2 - lib/routes/zaobao/util.ts | 3 - lib/routes/zcool/discover.ts | 2 - lib/routes/zcool/utils.ts | 3 - lib/routes/zhitongcaijing/index.ts | 2 - lib/routes/zhiy/post.ts | 2 - lib/routes/zhonglun/index.ts | 2 - lib/routes/zhubai/top20.ts | 2 - lib/routes/zodgame/forum.ts | 2 - lib/routes/zuvio/utils.ts | 3 - lib/routes/zyshow/index.ts | 2 - lib/utils/parse-date.ts | 8 +- package.json | 7 +- plugins/rollup-plugin-art-templates.ts | 83 ++ pnpm-lock.yaml | 866 ++++++++++++++++-- scripts/workflow/build-routes.ts | 2 + tsdown.config.ts | 10 + 597 files changed, 1003 insertions(+), 1472 deletions(-) create mode 100644 plugins/rollup-plugin-art-templates.ts create mode 100644 tsdown.config.ts diff --git a/.prettierignore b/.prettierignore index b6b684c5a..1edc3e478 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ lib/routes-deprecated lib/router.js babel.config.js scripts/docker/minify-docker.js +dist \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs index 9ac935974..844932dc3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -29,6 +29,7 @@ export default [{ 'lib/router.js', '**/babel.config.js', 'scripts/docker/minify-docker.js', + 'dist', ], }, ...compat.extends( 'eslint:recommended', diff --git a/lib/registry.ts b/lib/registry.ts index 3a8724d2a..0fcf7e680 100644 --- a/lib/registry.ts +++ b/lib/registry.ts @@ -27,8 +27,10 @@ let namespaces: Record< > = {}; switch (process.env.NODE_ENV) { - case 'test': case 'production': + namespaces = (await import('../assets/build/routes.js')).default; + break; + case 'test': // @ts-expect-error namespaces = await import('../assets/build/routes.json'); break; @@ -89,6 +91,7 @@ const sortRoutes = ( string, Route & { location: string; + module?: () => Promise<{ route: Route }>; } > ) => @@ -126,8 +129,13 @@ for (const namespace in namespaces) { const wrappedHandler: Handler = async (ctx) => { if (!ctx.get('data')) { if (typeof routeData.handler !== 'function') { - const { route } = await import(`./routes/${namespace}/${routeData.location}`); - routeData.handler = route.handler; + if (process.env.NODE_ENV === 'test') { + const { route } = await import(`./routes/${namespace}/${routeData.location}`); + routeData.handler = route.handler; + } else if (routeData.module) { + const { route } = await routeData.module(); + routeData.handler = route.handler; + } } ctx.set('data', await routeData.handler(ctx)); } diff --git a/lib/routes/005/index.ts b/lib/routes/005/index.ts index af4785a5d..f38e0782c 100644 --- a/lib/routes/005/index.ts +++ b/lib/routes/005/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/12306/index.ts b/lib/routes/12306/index.ts index 769af199a..c36ea80f2 100644 --- a/lib/routes/12306/index.ts +++ b/lib/routes/12306/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/141jav/index.ts b/lib/routes/141jav/index.ts index b7f58edad..c126778a5 100644 --- a/lib/routes/141jav/index.ts +++ b/lib/routes/141jav/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import got from '@/utils/got'; diff --git a/lib/routes/141ppv/index.ts b/lib/routes/141ppv/index.ts index fbf1239b4..43a54a0fb 100644 --- a/lib/routes/141ppv/index.ts +++ b/lib/routes/141ppv/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import got from '@/utils/got'; diff --git a/lib/routes/163/ds.ts b/lib/routes/163/ds.ts index befe94ab8..b35e1d9d2 100644 --- a/lib/routes/163/ds.ts +++ b/lib/routes/163/ds.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/163/exclusive.ts b/lib/routes/163/exclusive.ts index 715fbbf05..77b460133 100644 --- a/lib/routes/163/exclusive.ts +++ b/lib/routes/163/exclusive.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/163/music/artist-songs.ts b/lib/routes/163/music/artist-songs.ts index 8c572ec70..4f410effe 100644 --- a/lib/routes/163/music/artist-songs.ts +++ b/lib/routes/163/music/artist-songs.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/163/music/artist.ts b/lib/routes/163/music/artist.ts index c7c04ad12..fd4e9355a 100644 --- a/lib/routes/163/music/artist.ts +++ b/lib/routes/163/music/artist.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/163/music/djradio.ts b/lib/routes/163/music/djradio.ts index 665cbd3fd..09efda318 100644 --- a/lib/routes/163/music/djradio.ts +++ b/lib/routes/163/music/djradio.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/163/music/playlist.ts b/lib/routes/163/music/playlist.ts index 4c59cb0ca..198c4afef 100644 --- a/lib/routes/163/music/playlist.ts +++ b/lib/routes/163/music/playlist.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { config } from '@/config'; diff --git a/lib/routes/163/music/userevents.ts b/lib/routes/163/music/userevents.ts index 7971cf011..8ca7a06e5 100644 --- a/lib/routes/163/music/userevents.ts +++ b/lib/routes/163/music/userevents.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import path from 'node:path'; import got from '@/utils/got'; diff --git a/lib/routes/163/music/userplaylist.ts b/lib/routes/163/music/userplaylist.ts index add9b08e6..ff7ed8ff2 100644 --- a/lib/routes/163/music/userplaylist.ts +++ b/lib/routes/163/music/userplaylist.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/163/music/userplayrecords.ts b/lib/routes/163/music/userplayrecords.ts index 401a5c6cf..f2473d913 100644 --- a/lib/routes/163/music/userplayrecords.ts +++ b/lib/routes/163/music/userplayrecords.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { config } from '@/config'; diff --git a/lib/routes/163/open/vip.ts b/lib/routes/163/open/vip.ts index d30e5992d..70335db97 100644 --- a/lib/routes/163/open/vip.ts +++ b/lib/routes/163/open/vip.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/163/utils.ts b/lib/routes/163/utils.ts index 7a2e95cba..711e37728 100644 --- a/lib/routes/163/utils.ts +++ b/lib/routes/163/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; diff --git a/lib/routes/18comic/utils.ts b/lib/routes/18comic/utils.ts index e4ea27d1b..b74d0d4e9 100644 --- a/lib/routes/18comic/utils.ts +++ b/lib/routes/18comic/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/199it/index.ts b/lib/routes/199it/index.ts index be2d8c424..97c063fc4 100644 --- a/lib/routes/199it/index.ts +++ b/lib/routes/199it/index.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { category = 'newly' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/1point3acres/offer.ts b/lib/routes/1point3acres/offer.ts index 8bc81e459..2202802ce 100644 --- a/lib/routes/1point3acres/offer.ts +++ b/lib/routes/1point3acres/offer.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/1point3acres/utils.ts b/lib/routes/1point3acres/utils.ts index c90830d36..d55fd8c6e 100644 --- a/lib/routes/1point3acres/utils.ts +++ b/lib/routes/1point3acres/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/1x/index.ts b/lib/routes/1x/index.ts index 4d08f8a26..03f8d81ad 100644 --- a/lib/routes/1x/index.ts +++ b/lib/routes/1x/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; @@ -98,7 +96,7 @@ export const route: Route = { Fill in the field in the path with the part of the corresponding page URL after \`https://1x.com/gallery/\` or \`https://1x.com/photo/\`. Here are the examples: If you subscribe to [Abstract Awarded](https://1x.com/gallery/abstract/awarded), you should fill in the path with the part \`abstract/awarded\` from the page URL \`https://1x.com/gallery/abstract/awarded\`. In this case, the route will be [\`/1x/abstract/awarded\`](https://rsshub.app/1x/abstract/awarded). - + If you subscribe to [Wildlife Published](https://1x.com/gallery/wildlife/published), you should fill in the path with the part \`wildlife/published\` from the page URL \`https://1x.com/gallery/wildlife/published\`. In this case, the route will be [\`/1x/wildlife/published\`](https://rsshub.app/1x/wildlife/published). :::`, categories: ['design', 'picture'], diff --git a/lib/routes/2048/index.ts b/lib/routes/2048/index.ts index db9644d7a..95e51e39c 100644 --- a/lib/routes/2048/index.ts +++ b/lib/routes/2048/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/3kns/index.ts b/lib/routes/3kns/index.ts index d897afc1c..88503b317 100644 --- a/lib/routes/3kns/index.ts +++ b/lib/routes/3kns/index.ts @@ -1,12 +1,10 @@ import { Data, DataItem, Route } from '@/types'; import got from '@/utils/got'; -import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import { load } from 'cheerio'; import { Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/:filters?/:order?', diff --git a/lib/routes/423down/index.ts b/lib/routes/423down/index.ts index 1d18e5132..e24c8d9c6 100644 --- a/lib/routes/423down/index.ts +++ b/lib/routes/423down/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; @@ -135,23 +133,23 @@ export const route: Route = { | [安卓软件](https://www.423down.com/apk) | | --------------------------------------- | | [apk](https://rsshub.app/423down/apk) | - + #### 电脑软件 - + | [原创软件](https://www.423down.com/zd423) | [媒体播放](https://www.423down.com/multimedia) | [网页浏览](https://www.423down.com/browser) | [图形图像](https://www.423down.com/image) | [聊天软件](https://www.423down.com/im) | | ----------------------------------------- | --------------------------------------------------- | --------------------------------------------- | ----------------------------------------- | -------------------------------------- | | [zd423](https://rsshub.app/423down/zd423) | [multimedia](https://rsshub.app/423down/multimedia) | [browser](https://rsshub.app/423down/browser) | [image](https://rsshub.app/423down/image) | [im](https://rsshub.app/423down/im) | - + | [办公软件](https://www.423down.com/work) | [上传下载](https://www.423down.com/down) | [实用软件](https://www.423down.com/softtool) | [系统辅助](https://www.423down.com/systemsoft) | [系统必备](https://www.423down.com/systemplus) | | ---------------------------------------- | ---------------------------------------- | ----------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | | [work](https://rsshub.app/423down/work) | [down](https://rsshub.app/423down/down) | [softtool](https://rsshub.app/423down/softtool) | [systemsoft](https://rsshub.app/423down/systemsoft) | [systemplus](https://rsshub.app/423down/systemplus) | - + | [安全软件](https://www.423down.com/security) | [补丁相关](https://www.423down.com/patch) | [硬件相关](https://www.423down.com/hardware) | | ----------------------------------------------- | ----------------------------------------- | ----------------------------------------------- | | [security](https://rsshub.app/423down/security) | [patch](https://rsshub.app/423down/patch) | [hardware](https://rsshub.app/423down/hardware) | - + #### 操作系统 - + | [Windows 11](https://www.423down.com/win11) | [Windows 10](https://www.423down.com/win10) | [Windows 7](https://www.423down.com/win7) | [Windows XP](https://www.423down.com/win7/winxp) | [WinPE](https://www.423down.com/pe-system) | | ------------------------------------------- | ------------------------------------------- | ----------------------------------------- | --------------------------------------------------- | ------------------------------------------------- | | [win11](https://rsshub.app/423down/win11) | [win10](https://rsshub.app/423down/win10) | [win7](https://rsshub.app/423down/win7) | [win7/winxp](https://rsshub.app/423down/win7/winxp) | [pe-system](https://rsshub.app/423down/pe-system) | diff --git a/lib/routes/4gamers/utils.ts b/lib/routes/4gamers/utils.ts index b4a9d0619..946ab598f 100644 --- a/lib/routes/4gamers/utils.ts +++ b/lib/routes/4gamers/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import path from 'node:path'; import { art } from '@/utils/render'; diff --git a/lib/routes/4ksj/forum.ts b/lib/routes/4ksj/forum.ts index a5584cebe..b635e0dd2 100644 --- a/lib/routes/4ksj/forum.ts +++ b/lib/routes/4ksj/forum.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/500px/tribe-set.ts b/lib/routes/500px/tribe-set.ts index 72cb64676..41fc6b8e8 100644 --- a/lib/routes/500px/tribe-set.ts +++ b/lib/routes/500px/tribe-set.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/56kog/util.ts b/lib/routes/56kog/util.ts index 784921134..9eca66058 100644 --- a/lib/routes/56kog/util.ts +++ b/lib/routes/56kog/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import iconv from 'iconv-lite'; diff --git a/lib/routes/591/list.ts b/lib/routes/591/list.ts index df20ad6bf..8a84bb626 100644 --- a/lib/routes/591/list.ts +++ b/lib/routes/591/list.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import path from 'node:path'; diff --git a/lib/routes/78dm/index.ts b/lib/routes/78dm/index.ts index 2db355d7e..f45d6ebc0 100644 --- a/lib/routes/78dm/index.ts +++ b/lib/routes/78dm/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/7mmtv/index.ts b/lib/routes/7mmtv/index.ts index 170f74f03..c013ad22b 100644 --- a/lib/routes/7mmtv/index.ts +++ b/lib/routes/7mmtv/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/8264/list.ts b/lib/routes/8264/list.ts index acdb6ff2b..f5782c9c4 100644 --- a/lib/routes/8264/list.ts +++ b/lib/routes/8264/list.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/91porn/author.ts b/lib/routes/91porn/author.ts index fb6837f35..4d9d27e9b 100644 --- a/lib/routes/91porn/author.ts +++ b/lib/routes/91porn/author.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/91porn/index.ts b/lib/routes/91porn/index.ts index 43548beeb..51ae93bd0 100644 --- a/lib/routes/91porn/index.ts +++ b/lib/routes/91porn/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/95mm/utils.ts b/lib/routes/95mm/utils.ts index b374ad0a3..d07ed4e3a 100644 --- a/lib/routes/95mm/utils.ts +++ b/lib/routes/95mm/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/a9vg/index.ts b/lib/routes/a9vg/index.ts index a8921d642..91b904dde 100644 --- a/lib/routes/a9vg/index.ts +++ b/lib/routes/a9vg/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/abc/index.ts b/lib/routes/abc/index.ts index 001bb3ddd..919102581 100644 --- a/lib/routes/abc/index.ts +++ b/lib/routes/abc/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/accessbriefing/index.ts b/lib/routes/accessbriefing/index.ts index 76ffeec9a..dcc8c805d 100644 --- a/lib/routes/accessbriefing/index.ts +++ b/lib/routes/accessbriefing/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/acs/journal.ts b/lib/routes/acs/journal.ts index 5da7ff54e..f04f41e49 100644 --- a/lib/routes/acs/journal.ts +++ b/lib/routes/acs/journal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/adquan/case-library.ts b/lib/routes/adquan/case-library.ts index 19514c29e..003043fc7 100644 --- a/lib/routes/adquan/case-library.ts +++ b/lib/routes/adquan/case-library.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; @@ -11,8 +10,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '24', 10); diff --git a/lib/routes/adquan/index.ts b/lib/routes/adquan/index.ts index 5725762eb..6f88d983b 100644 --- a/lib/routes/adquan/index.ts +++ b/lib/routes/adquan/index.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; @@ -11,8 +10,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/aeaweb/index.ts b/lib/routes/aeaweb/index.ts index 78b8442c9..a75426e44 100644 --- a/lib/routes/aeaweb/index.ts +++ b/lib/routes/aeaweb/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/aeon/utils.ts b/lib/routes/aeon/utils.ts index e18421579..aed85eb99 100644 --- a/lib/routes/aeon/utils.ts +++ b/lib/routes/aeon/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import { load } from 'cheerio'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/agri/index.ts b/lib/routes/agri/index.ts index e77a8820a..bd4d4ef9f 100644 --- a/lib/routes/agri/index.ts +++ b/lib/routes/agri/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/aibase/util.ts b/lib/routes/aibase/util.ts index 066473c8b..0e3c98b07 100644 --- a/lib/routes/aibase/util.ts +++ b/lib/routes/aibase/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import ofetch from '@/utils/ofetch'; import { CheerioAPI } from 'cheerio'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/aicaijing/index.ts b/lib/routes/aicaijing/index.ts index 6ee739987..7e5820713 100644 --- a/lib/routes/aicaijing/index.ts +++ b/lib/routes/aicaijing/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/aip/utils.ts b/lib/routes/aip/utils.ts index 549378400..24895b6f6 100644 --- a/lib/routes/aip/utils.ts +++ b/lib/routes/aip/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import path from 'node:path'; import { art } from '@/utils/render'; diff --git a/lib/routes/ali213/news.ts b/lib/routes/ali213/news.ts index 0d0ecba9d..e1e112bdf 100644 --- a/lib/routes/ali213/news.ts +++ b/lib/routes/ali213/news.ts @@ -7,13 +7,10 @@ import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { category = 'new' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/ali213/zl.ts b/lib/routes/ali213/zl.ts index 47b9aaa39..43914b722 100644 --- a/lib/routes/ali213/zl.ts +++ b/lib/routes/ali213/zl.ts @@ -7,12 +7,9 @@ import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { category } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '1', 10); diff --git a/lib/routes/aljazeera/index.ts b/lib/routes/aljazeera/index.ts index 35c630407..b1aa2cd16 100644 --- a/lib/routes/aljazeera/index.ts +++ b/lib/routes/aljazeera/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/amazon/kindle-software-updates.ts b/lib/routes/amazon/kindle-software-updates.ts index ed497f0fd..652966f14 100644 --- a/lib/routes/amazon/kindle-software-updates.ts +++ b/lib/routes/amazon/kindle-software-updates.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/app-center/release.ts b/lib/routes/app-center/release.ts index fa8fcfa27..e5f014e90 100644 --- a/lib/routes/app-center/release.ts +++ b/lib/routes/app-center/release.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/appstorrent/programs.ts b/lib/routes/appstorrent/programs.ts index 1120e195f..75fc01bac 100644 --- a/lib/routes/appstorrent/programs.ts +++ b/lib/routes/appstorrent/programs.ts @@ -1,14 +1,12 @@ import { Data, DataItem, Route } from '@/types'; import cache from '@/utils/cache'; import got, { Options } from '@/utils/got'; -import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import { load } from 'cheerio'; import dayjs from 'dayjs'; import { Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/programs', diff --git a/lib/routes/aqara/post.ts b/lib/routes/aqara/post.ts index 6a803e680..326835cbf 100644 --- a/lib/routes/aqara/post.ts +++ b/lib/routes/aqara/post.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import got from '@/utils/got'; diff --git a/lib/routes/arcteryx/new-arrivals.ts b/lib/routes/arcteryx/new-arrivals.ts index bc7e48609..49f15c9b9 100644 --- a/lib/routes/arcteryx/new-arrivals.ts +++ b/lib/routes/arcteryx/new-arrivals.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/arcteryx/outlet.ts b/lib/routes/arcteryx/outlet.ts index 897cb35d4..4fbc66e79 100644 --- a/lib/routes/arcteryx/outlet.ts +++ b/lib/routes/arcteryx/outlet.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/arcteryx/regear-new-arrivals.ts b/lib/routes/arcteryx/regear-new-arrivals.ts index 6227b1d84..bdc1dc7a2 100644 --- a/lib/routes/arcteryx/regear-new-arrivals.ts +++ b/lib/routes/arcteryx/regear-new-arrivals.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/artstation/user.ts b/lib/routes/artstation/user.ts index 7f31b768d..29cb6c8fe 100644 --- a/lib/routes/artstation/user.ts +++ b/lib/routes/artstation/user.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/asiafruitchina/categories.ts b/lib/routes/asiafruitchina/categories.ts index 2e1c12584..34035a9af 100644 --- a/lib/routes/asiafruitchina/categories.ts +++ b/lib/routes/asiafruitchina/categories.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { category = 'all' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '10', 10); diff --git a/lib/routes/asiafruitchina/news.ts b/lib/routes/asiafruitchina/news.ts index 8cb1dcc99..8839f8821 100644 --- a/lib/routes/asiafruitchina/news.ts +++ b/lib/routes/asiafruitchina/news.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/asiantolick/index.ts b/lib/routes/asiantolick/index.ts index 1da7355af..27f968b13 100644 --- a/lib/routes/asiantolick/index.ts +++ b/lib/routes/asiantolick/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/asmr-200/index.ts b/lib/routes/asmr-200/index.ts index a26b6762c..e0ffa88fa 100644 --- a/lib/routes/asmr-200/index.ts +++ b/lib/routes/asmr-200/index.ts @@ -5,9 +5,8 @@ import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; -import { getCurrentPath } from '@/utils/helpers'; -const render = (work: Work, link: string) => art(path.join(getCurrentPath(import.meta.url), 'templates', 'work.art'), { work, link }); +const render = (work: Work, link: string) => art(path.join(__dirname, 'templates/work.art'), { work, link }); export const route: Route = { path: '/works/:order?/:subtitle?/:sort?', diff --git a/lib/routes/asus/bios.ts b/lib/routes/asus/bios.ts index 2bb541dff..aa74ef54d 100644 --- a/lib/routes/asus/bios.ts +++ b/lib/routes/asus/bios.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/baidu/gushitong/index.ts b/lib/routes/baidu/gushitong/index.ts index 452131d24..da8895fed 100644 --- a/lib/routes/baidu/gushitong/index.ts +++ b/lib/routes/baidu/gushitong/index.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/baidu/search.ts b/lib/routes/baidu/search.ts index 1d9bbdeb1..7c95c0d36 100644 --- a/lib/routes/baidu/search.ts +++ b/lib/routes/baidu/search.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/baidu/tieba/forum.ts b/lib/routes/baidu/tieba/forum.ts index 313c2a61b..fe432fcd3 100644 --- a/lib/routes/baidu/tieba/forum.ts +++ b/lib/routes/baidu/tieba/forum.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; diff --git a/lib/routes/baidu/tieba/post.ts b/lib/routes/baidu/tieba/post.ts index f1aa2cef7..3007720ac 100644 --- a/lib/routes/baidu/tieba/post.ts +++ b/lib/routes/baidu/tieba/post.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; diff --git a/lib/routes/baidu/tieba/search.ts b/lib/routes/baidu/tieba/search.ts index a8fc04f95..b2356b8eb 100644 --- a/lib/routes/baidu/tieba/search.ts +++ b/lib/routes/baidu/tieba/search.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/baidu/top.ts b/lib/routes/baidu/top.ts index 74feafc99..7ff72313b 100644 --- a/lib/routes/baidu/top.ts +++ b/lib/routes/baidu/top.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/bandcamp/weekly.ts b/lib/routes/bandcamp/weekly.ts index f070bc21e..687f5e9af 100644 --- a/lib/routes/bandcamp/weekly.ts +++ b/lib/routes/bandcamp/weekly.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/bangumi.online/online.ts b/lib/routes/bangumi.online/online.ts index 9312fc8b5..76ecccb68 100644 --- a/lib/routes/bangumi.online/online.ts +++ b/lib/routes/bangumi.online/online.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/bangumi.tv/calendar/today.ts b/lib/routes/bangumi.tv/calendar/today.ts index 2f12eaa9c..6055b44ad 100644 --- a/lib/routes/bangumi.tv/calendar/today.ts +++ b/lib/routes/bangumi.tv/calendar/today.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import getData from './_base'; diff --git a/lib/routes/bangumi.tv/subject/ep.ts b/lib/routes/bangumi.tv/subject/ep.ts index 04d41847b..503986f03 100644 --- a/lib/routes/bangumi.tv/subject/ep.ts +++ b/lib/routes/bangumi.tv/subject/ep.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/bangumi.tv/user/collections.ts b/lib/routes/bangumi.tv/user/collections.ts index dc4676445..4002c39c4 100644 --- a/lib/routes/bangumi.tv/user/collections.ts +++ b/lib/routes/bangumi.tv/user/collections.ts @@ -6,9 +6,6 @@ import { config } from '@/config'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - // 合并不同 subjectType 的 type 映射 const getTypeNames = (subjectType) => { const commonTypeNames = { diff --git a/lib/routes/baozimh/index.ts b/lib/routes/baozimh/index.ts index 9f3f9f22d..2885de28d 100644 --- a/lib/routes/baozimh/index.ts +++ b/lib/routes/baozimh/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/bc3ts/list.ts b/lib/routes/bc3ts/list.ts index 5b497e4c9..0325f3380 100644 --- a/lib/routes/bc3ts/list.ts +++ b/lib/routes/bc3ts/list.ts @@ -7,9 +7,6 @@ import path from 'node:path'; import { Media, PostResponse } from './types'; import { config } from '@/config'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/post/list/:sort?', example: '/bc3ts/post/list', @@ -31,7 +28,7 @@ export const route: Route = { const baseUrl = 'https://web.bc3ts.net'; -const renderMedia = (media: Media[]) => art(path.join(__dirname, 'templates', 'media.art'), { media }); +const renderMedia = (media: Media[]) => art(path.join(__dirname, 'templates/media.art'), { media }); async function handler(ctx) { const { sort = '1' } = ctx.req.param(); diff --git a/lib/routes/bdys/index.ts b/lib/routes/bdys/index.ts index 4b0aa0106..b3082c3fc 100644 --- a/lib/routes/bdys/index.ts +++ b/lib/routes/bdys/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/behance/user.ts b/lib/routes/behance/user.ts index f8eb132eb..31500fa56 100644 --- a/lib/routes/behance/user.ts +++ b/lib/routes/behance/user.ts @@ -5,9 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import crypto from 'node:crypto'; import path from 'node:path'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import { getAppreciatedQuery, getProfileProjectsAndSelectionsQuery, getProjectPageQuery } from './queries'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/:user/:type?', diff --git a/lib/routes/bgmlist/onair.ts b/lib/routes/bgmlist/onair.ts index e5c73f0f4..d44221cb4 100644 --- a/lib/routes/bgmlist/onair.ts +++ b/lib/routes/bgmlist/onair.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import path from 'node:path'; diff --git a/lib/routes/bilibili/utils.ts b/lib/routes/bilibili/utils.ts index d67213229..7035716eb 100644 --- a/lib/routes/bilibili/utils.ts +++ b/lib/routes/bilibili/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { config } from '@/config'; import md5 from '@/utils/md5'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/bing/search.ts b/lib/routes/bing/search.ts index fb15bace8..bd7628dc8 100644 --- a/lib/routes/bing/search.ts +++ b/lib/routes/bing/search.ts @@ -2,8 +2,8 @@ import { Route } from '@/types'; import parser from '@/utils/rss-parser'; import { parseDate } from '@/utils/parse-date'; import dayjs from 'dayjs'; -import localizedFormat from 'dayjs/plugin/localizedFormat'; -import 'dayjs/locale/zh-cn'; +import localizedFormat from 'dayjs/plugin/localizedFormat.js'; +import 'dayjs/locale/zh-cn.js'; dayjs.extend(localizedFormat); export const route: Route = { diff --git a/lib/routes/bloomberg/utils.ts b/lib/routes/bloomberg/utils.ts index 92daa603c..e9d25a07b 100644 --- a/lib/routes/bloomberg/utils.ts +++ b/lib/routes/bloomberg/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import { load } from 'cheerio'; import path from 'node:path'; diff --git a/lib/routes/booru/mmda.ts b/lib/routes/booru/mmda.ts index f67d45f60..02664b7c5 100644 --- a/lib/routes/booru/mmda.ts +++ b/lib/routes/booru/mmda.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import queryString from 'query-string'; diff --git a/lib/routes/bsky/feeds.ts b/lib/routes/bsky/feeds.ts index 268738f77..6480082cc 100644 --- a/lib/routes/bsky/feeds.ts +++ b/lib/routes/bsky/feeds.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/bsky/posts.ts b/lib/routes/bsky/posts.ts index 8beb29b1c..8f92022e6 100644 --- a/lib/routes/bsky/posts.ts +++ b/lib/routes/bsky/posts.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/btzj/index.ts b/lib/routes/btzj/index.ts index b665838cd..d18a042b8 100644 --- a/lib/routes/btzj/index.ts +++ b/lib/routes/btzj/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/buaa/lib/space/newbook.ts b/lib/routes/buaa/lib/space/newbook.ts index 810b8ef3c..add51285f 100644 --- a/lib/routes/buaa/lib/space/newbook.ts +++ b/lib/routes/buaa/lib/space/newbook.ts @@ -6,8 +6,6 @@ import timezone from '@/utils/timezone'; import cache from '@/utils/cache'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); interface Book { bibId: string; diff --git a/lib/routes/caai/utils.ts b/lib/routes/caai/utils.ts index ebf6671bf..47a57b593 100644 --- a/lib/routes/caai/utils.ts +++ b/lib/routes/caai/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/caareviews/utils.ts b/lib/routes/caareviews/utils.ts index 4fa9e2238..13f263dbb 100644 --- a/lib/routes/caareviews/utils.ts +++ b/lib/routes/caareviews/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/cahkms/index.ts b/lib/routes/cahkms/index.ts index 7f9d8f3fa..4f0258db7 100644 --- a/lib/routes/cahkms/index.ts +++ b/lib/routes/cahkms/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/caixin/database.ts b/lib/routes/caixin/database.ts index a6a8f6bcd..1cc8cfa9f 100644 --- a/lib/routes/caixin/database.ts +++ b/lib/routes/caixin/database.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/caixin/utils.ts b/lib/routes/caixin/utils.ts index 0bd0334e3..fd00ad4c1 100644 --- a/lib/routes/caixin/utils.ts +++ b/lib/routes/caixin/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; diff --git a/lib/routes/cankaoxiaoxi/index.ts b/lib/routes/cankaoxiaoxi/index.ts index 9ed772ea6..96388e0d1 100644 --- a/lib/routes/cankaoxiaoxi/index.ts +++ b/lib/routes/cankaoxiaoxi/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cara/likes.ts b/lib/routes/cara/likes.ts index bee254f5a..466584990 100644 --- a/lib/routes/cara/likes.ts +++ b/lib/routes/cara/likes.ts @@ -2,13 +2,10 @@ import type { Data, DataItem, Route } from '@/types'; import type { PostsResponse } from './types'; import { customFetch, parseUserData } from './utils'; import { API_HOST, CDN_HOST, HOST } from './constant'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: ['/likes/:user'], categories: ['social-media', 'popular'], diff --git a/lib/routes/cara/timeline.ts b/lib/routes/cara/timeline.ts index ebdd48580..cc2c321b9 100644 --- a/lib/routes/cara/timeline.ts +++ b/lib/routes/cara/timeline.ts @@ -2,13 +2,10 @@ import type { Data, DataItem, Route } from '@/types'; import type { PostsResponse } from './types'; import { customFetch, parseUserData } from './utils'; import { API_HOST, CDN_HOST, HOST } from './constant'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: ['/timeline/:user'], categories: ['social-media', 'popular'], diff --git a/lib/routes/cartoonmad/comic.ts b/lib/routes/cartoonmad/comic.ts index 89e055f6e..a72d7c44a 100644 --- a/lib/routes/cartoonmad/comic.ts +++ b/lib/routes/cartoonmad/comic.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/cbaigui/index.ts b/lib/routes/cbaigui/index.ts index c9443ef6b..81bc814dc 100644 --- a/lib/routes/cbaigui/index.ts +++ b/lib/routes/cbaigui/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import got from '@/utils/got'; diff --git a/lib/routes/ccf/ccfcv/index.ts b/lib/routes/ccf/ccfcv/index.ts index 13f99d4e9..902d88cfe 100644 --- a/lib/routes/ccf/ccfcv/index.ts +++ b/lib/routes/ccf/ccfcv/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/ccf/tfbd/utils.ts b/lib/routes/ccf/tfbd/utils.ts index 207e5b772..c7e9ddbd9 100644 --- a/lib/routes/ccf/tfbd/utils.ts +++ b/lib/routes/ccf/tfbd/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/ccfa/index.ts b/lib/routes/ccfa/index.ts index c52532a85..dfb7bf2b4 100644 --- a/lib/routes/ccfa/index.ts +++ b/lib/routes/ccfa/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cctv/xwlb.ts b/lib/routes/cctv/xwlb.ts index 121f94b68..e7f2fdc54 100644 --- a/lib/routes/cctv/xwlb.ts +++ b/lib/routes/cctv/xwlb.ts @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; +import customParseFormat from 'dayjs/plugin/customParseFormat.js'; dayjs.extend(customParseFormat); export const route: Route = { diff --git a/lib/routes/cde/xxgk.ts b/lib/routes/cde/xxgk.ts index 75208249d..72c539675 100644 --- a/lib/routes/cde/xxgk.ts +++ b/lib/routes/cde/xxgk.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -82,13 +80,30 @@ async function handler(ctx) { }, }); - const items = data.data.records.map((item) => ({ - title: item.drgnamecn, - guid: item.acceptid, - pubDate: item.endNoticeDate ? parseDate(item.endNoticeDate) : null, - description: art(path.join(__dirname, `templates/xxgk/${category}.art`), { item }), - link: xxgkMap.xxgk[category].url, - })); + const items = data.data.records.map((item) => { + let description = ''; + switch (category) { + case 'priorityApproval': + description = art(path.join(__dirname, 'templates/xxgk/priorityApproval.art'), { item }); + break; + case 'breakthroughCure': + description = art(path.join(__dirname, 'templates/xxgk/breakthroughCure.art'), { item }); + break; + case 'cliniCal': + description = art(path.join(__dirname, 'templates/xxgk/cliniCal.art'), { item }); + break; + default: + description = ''; + } + + return { + title: item.drgnamecn, + guid: item.acceptid, + pubDate: item.endNoticeDate ? parseDate(item.endNoticeDate) : null, + description, + link: xxgkMap.xxgk[category].url, + }; + }); return { title: `${xxgkMap.xxgk[category].title} - 国家药品监督管理局药品审评中心`, diff --git a/lib/routes/cdzjryb/project-list.ts b/lib/routes/cdzjryb/project-list.ts index 9096e7c35..f9cc192e3 100644 --- a/lib/routes/cdzjryb/project-list.ts +++ b/lib/routes/cdzjryb/project-list.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cebbank/all.ts b/lib/routes/cebbank/all.ts index 0f1fe3d1f..a22258fa1 100644 --- a/lib/routes/cebbank/all.ts +++ b/lib/routes/cebbank/all.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/cebbank/history.ts b/lib/routes/cebbank/history.ts index 35666f8b8..4f8503662 100644 --- a/lib/routes/cebbank/history.ts +++ b/lib/routes/cebbank/history.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/chaincatcher/home.ts b/lib/routes/chaincatcher/home.ts index ac15c18b7..199e9543a 100644 --- a/lib/routes/chaincatcher/home.ts +++ b/lib/routes/chaincatcher/home.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/changba/user.ts b/lib/routes/changba/user.ts index 0443cd036..3d95aae68 100644 --- a/lib/routes/changba/user.ts +++ b/lib/routes/changba/user.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/chaoxing/qk.ts b/lib/routes/chaoxing/qk.ts index a1caddeb6..1790f4b49 100644 --- a/lib/routes/chaoxing/qk.ts +++ b/lib/routes/chaoxing/qk.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/chinacdc/index.ts b/lib/routes/chinacdc/index.ts index bdfcf4408..a98d4b2b5 100644 --- a/lib/routes/chinacdc/index.ts +++ b/lib/routes/chinacdc/index.ts @@ -7,12 +7,9 @@ import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { category = 'zxyw' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '11', 10); diff --git a/lib/routes/chinadegrees/province.ts b/lib/routes/chinadegrees/province.ts index df6ca73ef..52d7f15f7 100644 --- a/lib/routes/chinadegrees/province.ts +++ b/lib/routes/chinadegrees/province.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/chuanliu/nice.ts b/lib/routes/chuanliu/nice.ts index a10502359..ed0cc0f84 100644 --- a/lib/routes/chuanliu/nice.ts +++ b/lib/routes/chuanliu/nice.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/cls/depth.ts b/lib/routes/cls/depth.ts index 9354905de..d80754cdb 100644 --- a/lib/routes/cls/depth.ts +++ b/lib/routes/cls/depth.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cls/hot.ts b/lib/routes/cls/hot.ts index bd5356d98..4da407fac 100644 --- a/lib/routes/cls/hot.ts +++ b/lib/routes/cls/hot.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cls/subject.ts b/lib/routes/cls/subject.ts index a5db95930..d0eb1f4f3 100644 --- a/lib/routes/cls/subject.ts +++ b/lib/routes/cls/subject.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cls/telegraph.ts b/lib/routes/cls/telegraph.ts index d831d75ba..ec0c4d09a 100644 --- a/lib/routes/cls/telegraph.ts +++ b/lib/routes/cls/telegraph.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/cma/channel.ts b/lib/routes/cma/channel.ts index 5b6aec7f3..dc9a13e5d 100644 --- a/lib/routes/cma/channel.ts +++ b/lib/routes/cma/channel.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/cngal/entry.ts b/lib/routes/cngal/entry.ts index 6e3181a77..d16a37238 100644 --- a/lib/routes/cngal/entry.ts +++ b/lib/routes/cngal/entry.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/cngal/weekly.ts b/lib/routes/cngal/weekly.ts index 487e7e801..c078c842b 100644 --- a/lib/routes/cngal/weekly.ts +++ b/lib/routes/cngal/weekly.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/cnjxol/index.ts b/lib/routes/cnjxol/index.ts index c28f69a10..453b3bf09 100644 --- a/lib/routes/cnjxol/index.ts +++ b/lib/routes/cnjxol/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cnki/debut.ts b/lib/routes/cnki/debut.ts index ab8c1f67e..fdeaae333 100644 --- a/lib/routes/cnki/debut.ts +++ b/lib/routes/cnki/debut.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cnki/utils.ts b/lib/routes/cnki/utils.ts index 62c6df3a9..a4676fb26 100644 --- a/lib/routes/cnki/utils.ts +++ b/lib/routes/cnki/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; diff --git a/lib/routes/cntheory/paper.ts b/lib/routes/cntheory/paper.ts index 49dfa4f8f..b545950f7 100644 --- a/lib/routes/cntheory/paper.ts +++ b/lib/routes/cntheory/paper.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/cntv/column.ts b/lib/routes/cntv/column.ts index dcc4002b1..8bf2d2d97 100644 --- a/lib/routes/cntv/column.ts +++ b/lib/routes/cntv/column.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/codeforces/contests.ts b/lib/routes/codeforces/contests.ts index 978ad8a49..cabbd8e7d 100644 --- a/lib/routes/codeforces/contests.ts +++ b/lib/routes/codeforces/contests.ts @@ -1,16 +1,14 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import path from 'node:path'; import { art } from '@/utils/render'; import dayjs from 'dayjs'; -import localizedFormat from 'dayjs/plugin/localizedFormat'; -import duration from 'dayjs/plugin/duration'; -import relativeTime from 'dayjs/plugin/relativeTime'; -import 'dayjs/locale/zh-cn'; +import localizedFormat from 'dayjs/plugin/localizedFormat.js'; +import duration from 'dayjs/plugin/duration.js'; +import relativeTime from 'dayjs/plugin/relativeTime.js'; +import 'dayjs/locale/zh-cn.js'; dayjs.extend(localizedFormat); dayjs.extend(duration); diff --git a/lib/routes/comicskingdom/index.ts b/lib/routes/comicskingdom/index.ts index ee4026017..ec6264ddf 100644 --- a/lib/routes/comicskingdom/index.ts +++ b/lib/routes/comicskingdom/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/coomer/index.ts b/lib/routes/coomer/index.ts index 70a52c830..8bcdf0fcc 100644 --- a/lib/routes/coomer/index.ts +++ b/lib/routes/coomer/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; @@ -84,7 +82,7 @@ async function handler(ctx) { extension: attachment.path.replace(/.*\./, '').toLowerCase(), }); } - const filesHTML = art(path.join(__dirname, 'templates', 'source.art'), { i }); + const filesHTML = art(path.join(__dirname, 'templates/source.art'), { i }); let $ = load(filesHTML); const coomerFiles = $('img, a, audio, video').map(function () { return $(this).prop('outerHTML')!; diff --git a/lib/routes/copymanga/comic.ts b/lib/routes/copymanga/comic.ts index eab05f7ce..58176816d 100644 --- a/lib/routes/copymanga/comic.ts +++ b/lib/routes/copymanga/comic.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/creative-comic/book.ts b/lib/routes/creative-comic/book.ts index 5edb198a5..b1fc0ab30 100644 --- a/lib/routes/creative-comic/book.ts +++ b/lib/routes/creative-comic/book.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/cuilingmag/index.ts b/lib/routes/cuilingmag/index.ts index 8434b2358..163236c87 100644 --- a/lib/routes/cuilingmag/index.ts +++ b/lib/routes/cuilingmag/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/curius/links.ts b/lib/routes/curius/links.ts index 8da702697..e491b4ce3 100644 --- a/lib/routes/curius/links.ts +++ b/lib/routes/curius/links.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/cztv/daily.ts b/lib/routes/cztv/daily.ts index 16c89e445..1ab73037c 100644 --- a/lib/routes/cztv/daily.ts +++ b/lib/routes/cztv/daily.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; diff --git a/lib/routes/cztv/zjxwlb.ts b/lib/routes/cztv/zjxwlb.ts index ce4d85435..3929a9649 100644 --- a/lib/routes/cztv/zjxwlb.ts +++ b/lib/routes/cztv/zjxwlb.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; diff --git a/lib/routes/daily/utils.ts b/lib/routes/daily/utils.ts index eb559762d..548adcca6 100644 --- a/lib/routes/daily/utils.ts +++ b/lib/routes/daily/utils.ts @@ -4,9 +4,7 @@ import cache from '@/utils/cache'; import { config } from '@/config'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { DataItem } from '@/types'; -const __dirname = getCurrentPath(import.meta.url); export const baseUrl = 'https://app.daily.dev'; const gqlUrl = `https://api.daily.dev/graphql`; diff --git a/lib/routes/damai/activity.ts b/lib/routes/damai/activity.ts index bcf0962bc..16036a77b 100644 --- a/lib/routes/damai/activity.ts +++ b/lib/routes/damai/activity.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/dcfever/utils.ts b/lib/routes/dcfever/utils.ts index c22231477..14fc30582 100644 --- a/lib/routes/dcfever/utils.ts +++ b/lib/routes/dcfever/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/deadline/posts.ts b/lib/routes/deadline/posts.ts index a3c5a0808..71dc880b2 100644 --- a/lib/routes/deadline/posts.ts +++ b/lib/routes/deadline/posts.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/dedao/knowledge.ts b/lib/routes/dedao/knowledge.ts index d6c6ca4ac..b124df12f 100644 --- a/lib/routes/dedao/knowledge.ts +++ b/lib/routes/dedao/knowledge.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/dedao/user.ts b/lib/routes/dedao/user.ts index c2b8fb4d9..c37347967 100644 --- a/lib/routes/dedao/user.ts +++ b/lib/routes/dedao/user.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/deeplearning/the-batch.ts b/lib/routes/deeplearning/the-batch.ts index 5abe989dc..fbdd5fa0e 100644 --- a/lib/routes/deeplearning/the-batch.ts +++ b/lib/routes/deeplearning/the-batch.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/dehenglaw/index.ts b/lib/routes/dehenglaw/index.ts index 630b9012c..16289792a 100644 --- a/lib/routes/dehenglaw/index.ts +++ b/lib/routes/dehenglaw/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/diershoubing/news.ts b/lib/routes/diershoubing/news.ts index 1dfddc193..855f9644f 100644 --- a/lib/routes/diershoubing/news.ts +++ b/lib/routes/diershoubing/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/discord/channel.ts b/lib/routes/discord/channel.ts index 47deff995..133e90fc2 100644 --- a/lib/routes/discord/channel.ts +++ b/lib/routes/discord/channel.ts @@ -1,6 +1,4 @@ import { DataItem, Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/discord/search.ts b/lib/routes/discord/search.ts index 5e36f35d8..633539f7d 100644 --- a/lib/routes/discord/search.ts +++ b/lib/routes/discord/search.ts @@ -3,7 +3,6 @@ import path from 'node:path'; import { config } from '@/config'; import InvalidParameterError from '@/errors/types/invalid-parameter'; import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import ConfigNotFoundError from '@/errors/types/config-not-found'; @@ -11,8 +10,6 @@ import { queryToBoolean } from '@/utils/readable-social'; import { baseUrl, getGuild, searchGuildMessages, SearchGuildMessagesParams, HasType, VALID_HAS_TYPES } from './discord-api'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/search/:guildId/:routeParams', categories: ['social-media'], diff --git a/lib/routes/dlnews/category.ts b/lib/routes/dlnews/category.ts index 20f531303..156db563f 100644 --- a/lib/routes/dlnews/category.ts +++ b/lib/routes/dlnews/category.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/dlsite/utils.ts b/lib/routes/dlsite/utils.ts index d08bbaa74..ecba7731a 100644 --- a/lib/routes/dlsite/utils.ts +++ b/lib/routes/dlsite/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { getSubPath } from '@/utils/common-utils'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/dn/news.ts b/lib/routes/dn/news.ts index ae9fdfe98..6eba13305 100644 --- a/lib/routes/dn/news.ts +++ b/lib/routes/dn/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/douban/movie/coming.ts b/lib/routes/douban/movie/coming.ts index 8c813fafd..f42108280 100644 --- a/lib/routes/douban/movie/coming.ts +++ b/lib/routes/douban/movie/coming.ts @@ -1,11 +1,8 @@ import { Route } from '@/types'; import got from '@/utils/got'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/movie/coming', categories: ['social-media'], diff --git a/lib/routes/douban/other/explore.ts b/lib/routes/douban/other/explore.ts index da20f2a5a..99aaf02f3 100644 --- a/lib/routes/douban/other/explore.ts +++ b/lib/routes/douban/other/explore.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/douban/other/list.ts b/lib/routes/douban/other/list.ts index b4c5f237a..3c9ac4df4 100644 --- a/lib/routes/douban/other/list.ts +++ b/lib/routes/douban/other/list.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import path from 'node:path'; diff --git a/lib/routes/douban/other/recommended.ts b/lib/routes/douban/other/recommended.ts index 840ed1e91..b2f534e94 100644 --- a/lib/routes/douban/other/recommended.ts +++ b/lib/routes/douban/other/recommended.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import path from 'node:path'; diff --git a/lib/routes/douban/other/weekly-best.ts b/lib/routes/douban/other/weekly-best.ts index fab2d55aa..04b47f983 100644 --- a/lib/routes/douban/other/weekly-best.ts +++ b/lib/routes/douban/other/weekly-best.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/douyin/utils.ts b/lib/routes/douyin/utils.ts index 938ae5355..8a5d6e72f 100644 --- a/lib/routes/douyin/utils.ts +++ b/lib/routes/douyin/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import path from 'node:path'; const templates = { diff --git a/lib/routes/douyu/group.ts b/lib/routes/douyu/group.ts index 7bd5df629..8271054d7 100644 --- a/lib/routes/douyu/group.ts +++ b/lib/routes/douyu/group.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/douyu/post.ts b/lib/routes/douyu/post.ts index e208d539c..b54b0dc30 100644 --- a/lib/routes/douyu/post.ts +++ b/lib/routes/douyu/post.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/dribbble/utils.ts b/lib/routes/dribbble/utils.ts index 53435b170..2e9fca4ec 100644 --- a/lib/routes/dribbble/utils.ts +++ b/lib/routes/dribbble/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; diff --git a/lib/routes/duozhuayu/search.ts b/lib/routes/duozhuayu/search.ts index 84c7a22fd..9f7267039 100644 --- a/lib/routes/duozhuayu/search.ts +++ b/lib/routes/duozhuayu/search.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import aesjs from 'aes-js'; diff --git a/lib/routes/dushu/fuzhou/index.ts b/lib/routes/dushu/fuzhou/index.ts index 50ab8c0e3..1124d1caa 100644 --- a/lib/routes/dushu/fuzhou/index.ts +++ b/lib/routes/dushu/fuzhou/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; diff --git a/lib/routes/dw/utils.ts b/lib/routes/dw/utils.ts index 87514c626..83a746dba 100644 --- a/lib/routes/dw/utils.ts +++ b/lib/routes/dw/utils.ts @@ -3,9 +3,7 @@ import got from '@/utils/got'; import { load, type CheerioAPI } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const formatId = '605'; const i18n = (word: string, lang: string) => { diff --git a/lib/routes/e-hentai/index.ts b/lib/routes/e-hentai/index.ts index 55a1291bf..28abec0a4 100644 --- a/lib/routes/e-hentai/index.ts +++ b/lib/routes/e-hentai/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/eastmoney/report/index.ts b/lib/routes/eastmoney/report/index.ts index a43d5c869..e94012407 100644 --- a/lib/routes/eastmoney/report/index.ts +++ b/lib/routes/eastmoney/report/index.ts @@ -1,5 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -8,8 +7,6 @@ import { art } from '@/utils/render'; import path from 'node:path'; import { getRatingChangeStr, getEpsOrPeStr } from '../utils'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/report/:category', categories: ['finance', 'popular'], diff --git a/lib/routes/ecnu/contest.ts b/lib/routes/ecnu/contest.ts index f3054f80e..1bf3e211a 100644 --- a/lib/routes/ecnu/contest.ts +++ b/lib/routes/ecnu/contest.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/elsevier/issue.ts b/lib/routes/elsevier/issue.ts index 1ffe2628a..22af78bdc 100644 --- a/lib/routes/elsevier/issue.ts +++ b/lib/routes/elsevier/issue.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/elsevier/journal.ts b/lib/routes/elsevier/journal.ts index 4c09769af..b9cd1609d 100644 --- a/lib/routes/elsevier/journal.ts +++ b/lib/routes/elsevier/journal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/epicgames/index.ts b/lib/routes/epicgames/index.ts index f2807f604..5d306ea3d 100644 --- a/lib/routes/epicgames/index.ts +++ b/lib/routes/epicgames/index.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/eprice/rss.ts b/lib/routes/eprice/rss.ts index 8a92673ca..cc648f1bd 100644 --- a/lib/routes/eprice/rss.ts +++ b/lib/routes/eprice/rss.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/eshukan/academic.ts b/lib/routes/eshukan/academic.ts index 3402bb938..9214a6838 100644 --- a/lib/routes/eshukan/academic.ts +++ b/lib/routes/eshukan/academic.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/espn/news.ts b/lib/routes/espn/news.ts index 0dc8d31db..51706facf 100644 --- a/lib/routes/espn/news.ts +++ b/lib/routes/espn/news.ts @@ -3,13 +3,10 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import * as cheerio from 'cheerio'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; -const __dirname = getCurrentPath(import.meta.url); - const renderMedia = (media) => - art(path.join(__dirname, 'templates', 'media.art'), { + art(path.join(__dirname, 'templates/media.art'), { video: { cover: media.posterImages?.full?.href || media.posterImages?.default?.href, src: media.links?.source.mezzanine?.href || media.links?.source.HD?.href || media.links?.source.full?.href || media.links?.source.href, diff --git a/lib/routes/esquirehk/tag.ts b/lib/routes/esquirehk/tag.ts index 5fdfa3e29..f47300b11 100644 --- a/lib/routes/esquirehk/tag.ts +++ b/lib/routes/esquirehk/tag.ts @@ -8,9 +8,6 @@ import { art } from '@/utils/render'; import path from 'node:path'; import { destr } from 'destr'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - const topics = new Set(['style', 'watches', 'lifestyle', 'health', 'money-investment', 'gear', 'people', 'watch', 'mens-talk']); const handler = async (ctx) => { @@ -65,7 +62,7 @@ const handler = async (ctx) => { item.description = response.intro.raw + - art(path.join(__dirname, 'templates', 'subpages.art'), { + art(path.join(__dirname, 'templates/subpages.art'), { subpages: response.subpages, }); item.pubDate = parseDate(response.date.published, 'X'); diff --git a/lib/routes/famitsu/category.ts b/lib/routes/famitsu/category.ts index 2d16f32d4..4cb7ac525 100644 --- a/lib/routes/famitsu/category.ts +++ b/lib/routes/famitsu/category.ts @@ -5,11 +5,9 @@ import * as cheerio from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { config } from '@/config'; import { ArticleDetail, Category, CategoryArticle } from './types'; -const __dirname = getCurrentPath(import.meta.url); const baseUrl = 'https://www.famitsu.com'; export const route: Route = { @@ -45,7 +43,7 @@ function getBuildId() { } function render(data) { - return art(path.join(__dirname, 'templates', 'description.art'), data); + return art(path.join(__dirname, 'templates/description.art'), data); } function renderJSON(c) { diff --git a/lib/routes/fanbox/utils.ts b/lib/routes/fanbox/utils.ts index c6fbf8361..c7c757d30 100644 --- a/lib/routes/fanbox/utils.ts +++ b/lib/routes/fanbox/utils.ts @@ -6,9 +6,6 @@ import { parseDate } from '@/utils/parse-date'; import cache from '@/utils/cache'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export function getHeaders() { const sessionid = config.fanbox.session; diff --git a/lib/routes/fangchan/list.ts b/lib/routes/fangchan/list.ts index 4f6e61bc1..8be42fda7 100644 --- a/lib/routes/fangchan/list.ts +++ b/lib/routes/fangchan/list.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; @@ -11,8 +10,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { id = 'datalist' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/fansly/utils.ts b/lib/routes/fansly/utils.ts index f30ec3b56..cb58ff59b 100644 --- a/lib/routes/fansly/utils.ts +++ b/lib/routes/fansly/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import path from 'node:path'; import { art } from '@/utils/render'; diff --git a/lib/routes/farmatters/index.ts b/lib/routes/farmatters/index.ts index c58071c0c..c69c94797 100644 --- a/lib/routes/farmatters/index.ts +++ b/lib/routes/farmatters/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/fashionnetwork/index.ts b/lib/routes/fashionnetwork/index.ts index 628240113..02c9ffc90 100644 --- a/lib/routes/fashionnetwork/index.ts +++ b/lib/routes/fashionnetwork/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/fastbull/news.ts b/lib/routes/fastbull/news.ts index d13d24036..85c4b2f75 100644 --- a/lib/routes/fastbull/news.ts +++ b/lib/routes/fastbull/news.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/feng/forum.ts b/lib/routes/feng/forum.ts index de49b4e8d..1c516c720 100644 --- a/lib/routes/feng/forum.ts +++ b/lib/routes/feng/forum.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { parseDate } from '@/utils/parse-date'; import { baseUrl, getForumMeta, getThreads, getThread } from './utils'; diff --git a/lib/routes/ff14/ff14-global.ts b/lib/routes/ff14/ff14-global.ts index d0a2122b6..b04ea7412 100644 --- a/lib/routes/ff14/ff14-global.ts +++ b/lib/routes/ff14/ff14-global.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/ff14/ff14-zh.ts b/lib/routes/ff14/ff14-zh.ts index f1f29c2a8..26f88cb17 100644 --- a/lib/routes/ff14/ff14-zh.ts +++ b/lib/routes/ff14/ff14-zh.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/fffdm/manhua/manhua.ts b/lib/routes/fffdm/manhua/manhua.ts index 4291d1c8c..bb48cba17 100644 --- a/lib/routes/fffdm/manhua/manhua.ts +++ b/lib/routes/fffdm/manhua/manhua.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/fisher-spb/news.ts b/lib/routes/fisher-spb/news.ts index 732736d2e..929896d7d 100644 --- a/lib/routes/fisher-spb/news.ts +++ b/lib/routes/fisher-spb/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/flyert/util.ts b/lib/routes/flyert/util.ts index 9538d0055..02feb1036 100644 --- a/lib/routes/flyert/util.ts +++ b/lib/routes/flyert/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { CheerioAPI } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/focustaiwan/index.ts b/lib/routes/focustaiwan/index.ts index 2162d09b0..46c8ca5e5 100644 --- a/lib/routes/focustaiwan/index.ts +++ b/lib/routes/focustaiwan/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/followin/utils.ts b/lib/routes/followin/utils.ts index 6a8875c8b..24e4e21e8 100644 --- a/lib/routes/followin/utils.ts +++ b/lib/routes/followin/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/foresightnews/util.ts b/lib/routes/foresightnews/util.ts index 4f22349be..be1bdfb16 100644 --- a/lib/routes/foresightnews/util.ts +++ b/lib/routes/foresightnews/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/fosshub/index.ts b/lib/routes/fosshub/index.ts index 5c8104d55..4870daacd 100644 --- a/lib/routes/fosshub/index.ts +++ b/lib/routes/fosshub/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/freecomputerbooks/index.ts b/lib/routes/freecomputerbooks/index.ts index 60d3667d6..e8de3825d 100644 --- a/lib/routes/freecomputerbooks/index.ts +++ b/lib/routes/freecomputerbooks/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/furstar/utils.ts b/lib/routes/furstar/utils.ts index 7c3583b71..2d104d27d 100644 --- a/lib/routes/furstar/utils.ts +++ b/lib/routes/furstar/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/futunn/main.ts b/lib/routes/futunn/main.ts index f5c553f9e..8945fbef0 100644 --- a/lib/routes/futunn/main.ts +++ b/lib/routes/futunn/main.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gameapps/index.ts b/lib/routes/gameapps/index.ts index d92812310..6a2db63c0 100644 --- a/lib/routes/gameapps/index.ts +++ b/lib/routes/gameapps/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/gamebase/news.ts b/lib/routes/gamebase/news.ts index 3970034c6..23beb4fc0 100644 --- a/lib/routes/gamebase/news.ts +++ b/lib/routes/gamebase/news.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import InvalidParameterError from '@/errors/types/invalid-parameter'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -12,8 +11,6 @@ import { type CheerioAPI, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - const types = { newslist: 'newsList', r18list: 'newsPornList', diff --git a/lib/routes/gcores/articles.ts b/lib/routes/gcores/articles.ts index 4052c4599..bc7a1f48e 100644 --- a/lib/routes/gcores/articles.ts +++ b/lib/routes/gcores/articles.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/gcores/categories.ts b/lib/routes/gcores/categories.ts index a095c01ea..d79dd2b5e 100644 --- a/lib/routes/gcores/categories.ts +++ b/lib/routes/gcores/categories.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - let viewType: ViewType = ViewType.Articles; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/gcores/collections.ts b/lib/routes/gcores/collections.ts index ba6237a8b..292f90c4a 100644 --- a/lib/routes/gcores/collections.ts +++ b/lib/routes/gcores/collections.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - let viewType: ViewType = ViewType.Articles; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/gcores/news.ts b/lib/routes/gcores/news.ts index ceed6a004..2a90bc655 100644 --- a/lib/routes/gcores/news.ts +++ b/lib/routes/gcores/news.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/gcores/parser.ts b/lib/routes/gcores/parser.ts index 815ba9bb0..1935cfaa5 100644 --- a/lib/routes/gcores/parser.ts +++ b/lib/routes/gcores/parser.ts @@ -1,10 +1,7 @@ import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - interface Style { [key: string]: string; } diff --git a/lib/routes/gcores/program-previews.ts b/lib/routes/gcores/program-previews.ts index 45e8f59a5..f8d571070 100644 --- a/lib/routes/gcores/program-previews.ts +++ b/lib/routes/gcores/program-previews.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/gcores/radio.ts b/lib/routes/gcores/radio.ts index 82f00763b..7d43de030 100644 --- a/lib/routes/gcores/radio.ts +++ b/lib/routes/gcores/radio.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/gcores/tags.ts b/lib/routes/gcores/tags.ts index 155690c87..9d558c4dd 100644 --- a/lib/routes/gcores/tags.ts +++ b/lib/routes/gcores/tags.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - let viewType: ViewType = ViewType.Articles; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/gcores/topics.ts b/lib/routes/gcores/topics.ts index cb2bcb6dd..6fbd8f9cb 100644 --- a/lib/routes/gcores/topics.ts +++ b/lib/routes/gcores/topics.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { id } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/gcores/util.ts b/lib/routes/gcores/util.ts index c068cf9de..85c036fa2 100644 --- a/lib/routes/gcores/util.ts +++ b/lib/routes/gcores/util.ts @@ -1,15 +1,12 @@ import { type Data, type DataItem } from '@/types'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { type CheerioAPI, load } from 'cheerio'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - import { parseContent } from './parser'; const baseUrl: string = 'https://www.gcores.com'; diff --git a/lib/routes/gcores/videos.ts b/lib/routes/gcores/videos.ts index 6b67ada1d..92d44b823 100644 --- a/lib/routes/gcores/videos.ts +++ b/lib/routes/gcores/videos.ts @@ -1,12 +1,9 @@ import { type Data, type Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { type Context } from 'hono'; import { baseUrl, processItems } from './util'; -export const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/geekpark/index.ts b/lib/routes/geekpark/index.ts index 99167d881..f98bc683e 100644 --- a/lib/routes/geekpark/index.ts +++ b/lib/routes/geekpark/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gelbooru/utils.ts b/lib/routes/gelbooru/utils.ts index eb67a61d6..bf74c2fa6 100644 --- a/lib/routes/gelbooru/utils.ts +++ b/lib/routes/gelbooru/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import path from 'node:path'; import { art } from '@/utils/render'; import { config } from '@/config'; diff --git a/lib/routes/gelonghui/live.ts b/lib/routes/gelonghui/live.ts index a22c7cdad..df0c24741 100644 --- a/lib/routes/gelonghui/live.ts +++ b/lib/routes/gelonghui/live.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/gettr/user.ts b/lib/routes/gettr/user.ts index b1c9c7726..dd8df360d 100644 --- a/lib/routes/gettr/user.ts +++ b/lib/routes/gettr/user.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/github/pulse.ts b/lib/routes/github/pulse.ts index e3b640a2a..fbcf6326c 100644 --- a/lib/routes/github/pulse.ts +++ b/lib/routes/github/pulse.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import path from 'node:path'; diff --git a/lib/routes/github/trending.ts b/lib/routes/github/trending.ts index bb10ea861..c4d3ca593 100644 --- a/lib/routes/github/trending.ts +++ b/lib/routes/github/trending.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { config } from '@/config'; import got from '@/utils/got'; diff --git a/lib/routes/gitpod/blog.ts b/lib/routes/gitpod/blog.ts index 2adc7618b..4ddf0f0f1 100644 --- a/lib/routes/gitpod/blog.ts +++ b/lib/routes/gitpod/blog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gofans/index.ts b/lib/routes/gofans/index.ts index a1eb3cd7b..bdcf83dd8 100644 --- a/lib/routes/gofans/index.ts +++ b/lib/routes/gofans/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/google/fonts.ts b/lib/routes/google/fonts.ts index e678005fb..edc6a5669 100644 --- a/lib/routes/google/fonts.ts +++ b/lib/routes/google/fonts.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { config } from '@/config'; diff --git a/lib/routes/google/news.ts b/lib/routes/google/news.ts index 457b9e088..f0674a7a5 100644 --- a/lib/routes/google/news.ts +++ b/lib/routes/google/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/google/search.ts b/lib/routes/google/search.ts index 2fb7e994f..c3d4bdecd 100644 --- a/lib/routes/google/search.ts +++ b/lib/routes/google/search.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gov/caac/cjwt.ts b/lib/routes/gov/caac/cjwt.ts index 979297470..48aba151f 100644 --- a/lib/routes/gov/caac/cjwt.ts +++ b/lib/routes/gov/caac/cjwt.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/gov/cmse/fxrw.ts b/lib/routes/gov/cmse/fxrw.ts index aef607f0c..d138bd1b0 100644 --- a/lib/routes/gov/cmse/fxrw.ts +++ b/lib/routes/gov/cmse/fxrw.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/gov/cmse/index.ts b/lib/routes/gov/cmse/index.ts index bffb1fab1..ef0f085bf 100644 --- a/lib/routes/gov/cmse/index.ts +++ b/lib/routes/gov/cmse/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/gov/csrc/news.ts b/lib/routes/gov/csrc/news.ts index 0d9f0f10a..f6f2a7757 100644 --- a/lib/routes/gov/csrc/news.ts +++ b/lib/routes/gov/csrc/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; @@ -43,7 +41,7 @@ async function handler(ctx) { out = data.data.data.results.map((item) => ({ title: item.title, - description: item.contentHtml + art(path.join(__dirname, 'templates', 'attachment.art'), { attachments: item.resList }), + description: item.contentHtml + art(path.join(__dirname, 'templates/attachment.art'), { attachments: item.resList }), pubDate: parseDate(item.publishedTime, 'x'), link: item.url, })); diff --git a/lib/routes/gov/forestry/gjlckjdjt.ts b/lib/routes/gov/forestry/gjlckjdjt.ts index b30e2dd1c..6fefefdd1 100644 --- a/lib/routes/gov/forestry/gjlckjdjt.ts +++ b/lib/routes/gov/forestry/gjlckjdjt.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gov/general/general.ts b/lib/routes/gov/general/general.ts index 8df95a3f3..d0848c0e9 100644 --- a/lib/routes/gov/general/general.ts +++ b/lib/routes/gov/general/general.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; // 来人拯救一下啊( >﹏<。) @@ -187,7 +184,7 @@ const gdgov = async (info, ctx) => { return { link, title: data.art_title, - description: art(__dirname + '/templates/zcjdpt.art', data), + description: art(path.join(__dirname, 'templates/zcjdpt.art'), data), pubDate: timezone(parseDate(data.pub_time), +8), author: /(本|本网|本站)/.test(data.pub_unite) ? authorisme : data.pub_unite, }; diff --git a/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts b/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts index 0fb81e0b7..3c7941f17 100644 --- a/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts +++ b/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/gov/guangdong/tqyb/tfxtq.ts b/lib/routes/gov/guangdong/tqyb/tfxtq.ts index 8e8549d11..d03bb0c2d 100644 --- a/lib/routes/gov/guangdong/tqyb/tfxtq.ts +++ b/lib/routes/gov/guangdong/tqyb/tfxtq.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/gov/hangzhou/zwfw.ts b/lib/routes/gov/hangzhou/zwfw.ts index 9c2c24eb6..f2adbd755 100644 --- a/lib/routes/gov/hangzhou/zwfw.ts +++ b/lib/routes/gov/hangzhou/zwfw.ts @@ -1,6 +1,5 @@ import { Route } from '@/types'; import { load } from 'cheerio'; -const __dirname = getCurrentPath(import.meta.url); import puppeteer from '@/utils/puppeteer'; import ofetch from '@/utils/ofetch'; @@ -11,7 +10,6 @@ import { crawler, analyzer } from './zjzwfw'; import timezone from '@/utils/timezone'; import path from 'node:path'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; export const route: Route = { path: '/hangzhou/zwfw', diff --git a/lib/routes/gov/jiangsu/wlt/index.ts b/lib/routes/gov/jiangsu/wlt/index.ts index 9bbcd0159..2b6cc0bf3 100644 --- a/lib/routes/gov/jiangsu/wlt/index.ts +++ b/lib/routes/gov/jiangsu/wlt/index.ts @@ -1,5 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import cache from '@/utils/cache'; import got from '@/utils/got'; @@ -8,8 +7,6 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/jiangsu/wlt/:page?', categories: ['government'], diff --git a/lib/routes/gov/safe/util.ts b/lib/routes/gov/safe/util.ts index 013d59e0c..19eaed7c5 100644 --- a/lib/routes/gov/safe/util.ts +++ b/lib/routes/gov/safe/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/gov/samr/xgzlyhd.ts b/lib/routes/gov/samr/xgzlyhd.ts index 3eca5ea91..b61b0776d 100644 --- a/lib/routes/gov/samr/xgzlyhd.ts +++ b/lib/routes/gov/samr/xgzlyhd.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/gov/sh/fgw/index.ts b/lib/routes/gov/sh/fgw/index.ts index 39e168a21..dbecd5785 100644 --- a/lib/routes/gov/sh/fgw/index.ts +++ b/lib/routes/gov/sh/fgw/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gov/sh/rsj/ksxm.ts b/lib/routes/gov/sh/rsj/ksxm.ts index 2c4569799..cb7999803 100644 --- a/lib/routes/gov/sh/rsj/ksxm.ts +++ b/lib/routes/gov/sh/rsj/ksxm.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/gov/sh/wgj/wgj.ts b/lib/routes/gov/sh/wgj/wgj.ts index 1e7357b31..5cfbc11c3 100644 --- a/lib/routes/gov/sh/wgj/wgj.ts +++ b/lib/routes/gov/sh/wgj/wgj.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gov/sichuan/deyang/govpublicinfo.ts b/lib/routes/gov/sichuan/deyang/govpublicinfo.ts index 2cce6fcfb..d54da662a 100644 --- a/lib/routes/gov/sichuan/deyang/govpublicinfo.ts +++ b/lib/routes/gov/sichuan/deyang/govpublicinfo.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gov/sichuan/deyang/mztoday.ts b/lib/routes/gov/sichuan/deyang/mztoday.ts index 4dd624782..f57aed81c 100644 --- a/lib/routes/gov/sichuan/deyang/mztoday.ts +++ b/lib/routes/gov/sichuan/deyang/mztoday.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gov/stats/index.ts b/lib/routes/gov/stats/index.ts index b03d1b4a8..241cebd6a 100644 --- a/lib/routes/gov/stats/index.ts +++ b/lib/routes/gov/stats/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/guduodata/daily.ts b/lib/routes/guduodata/daily.ts index f8dc6986c..3aa987b51 100644 --- a/lib/routes/guduodata/daily.ts +++ b/lib/routes/guduodata/daily.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/gumroad/index.ts b/lib/routes/gumroad/index.ts index 052f15bb1..bc4789c89 100644 --- a/lib/routes/gumroad/index.ts +++ b/lib/routes/gumroad/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/gzdaily/app.ts b/lib/routes/gzdaily/app.ts index 2dfaaf02d..1ddfd24df 100644 --- a/lib/routes/gzdaily/app.ts +++ b/lib/routes/gzdaily/app.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/hafu/utils.ts b/lib/routes/hafu/utils.ts index b1521abe3..7b7d6a896 100644 --- a/lib/routes/hafu/utils.ts +++ b/lib/routes/hafu/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/hashnode/blog.ts b/lib/routes/hashnode/blog.ts index ac5aed8ba..aa64170c4 100644 --- a/lib/routes/hashnode/blog.ts +++ b/lib/routes/hashnode/blog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts b/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts index e722d893c..232de22e8 100644 --- a/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts +++ b/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/hellogithub/report.ts b/lib/routes/hellogithub/report.ts index d639de80e..f2949c432 100644 --- a/lib/routes/hellogithub/report.ts +++ b/lib/routes/hellogithub/report.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/hellogithub/volume.ts b/lib/routes/hellogithub/volume.ts index 5e1f41b9b..ebd751877 100644 --- a/lib/routes/hellogithub/volume.ts +++ b/lib/routes/hellogithub/volume.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/hiring.cafe/jobs.ts b/lib/routes/hiring.cafe/jobs.ts index 30d492755..aacd10f58 100644 --- a/lib/routes/hiring.cafe/jobs.ts +++ b/lib/routes/hiring.cafe/jobs.ts @@ -2,11 +2,8 @@ import ofetch from '@/utils/ofetch'; import path from 'node:path'; import { art } from '@/utils/render'; import { Context } from 'hono'; -import { getCurrentPath } from '@/utils/helpers'; import { Route } from '@/types'; -const __dirname = getCurrentPath(import.meta.url); - const CONFIG = { DEFAULT_PAGE_SIZE: 20, MAX_PAGE_SIZE: 100, diff --git a/lib/routes/hitcon/zeroday.ts b/lib/routes/hitcon/zeroday.ts index 5cbd771a2..bd7263906 100644 --- a/lib/routes/hitcon/zeroday.ts +++ b/lib/routes/hitcon/zeroday.ts @@ -6,9 +6,6 @@ import logger from '@/utils/logger'; import { art } from '@/utils/render'; import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { name: '漏洞', diff --git a/lib/routes/hk01/utils.ts b/lib/routes/hk01/utils.ts index a4efa6033..cddf434d7 100644 --- a/lib/routes/hk01/utils.ts +++ b/lib/routes/hk01/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/hkej/index.ts b/lib/routes/hkej/index.ts index 08bab035e..1fd4e4cef 100644 --- a/lib/routes/hkej/index.ts +++ b/lib/routes/hkej/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/hket/index.ts b/lib/routes/hket/index.ts index 7abfa3633..5b9dad231 100644 --- a/lib/routes/hket/index.ts +++ b/lib/routes/hket/index.ts @@ -1,6 +1,4 @@ import { DataItem, Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/hostmonit/cloudflareyes.ts b/lib/routes/hostmonit/cloudflareyes.ts index ff1ce007e..989dff1cb 100644 --- a/lib/routes/hostmonit/cloudflareyes.ts +++ b/lib/routes/hostmonit/cloudflareyes.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/houxu/events.ts b/lib/routes/houxu/events.ts index 9e4d5770c..ca37a26ae 100644 --- a/lib/routes/houxu/events.ts +++ b/lib/routes/houxu/events.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/houxu/index.ts b/lib/routes/houxu/index.ts index fcac8b90f..72cea3991 100644 --- a/lib/routes/houxu/index.ts +++ b/lib/routes/houxu/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/houxu/memory.ts b/lib/routes/houxu/memory.ts index 6e108b978..2a807f903 100644 --- a/lib/routes/houxu/memory.ts +++ b/lib/routes/houxu/memory.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/hoyolab/news.ts b/lib/routes/hoyolab/news.ts index 1411d678d..e6ed922e3 100644 --- a/lib/routes/hoyolab/news.ts +++ b/lib/routes/hoyolab/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/hupu/all.ts b/lib/routes/hupu/all.ts index 08d745195..2226ae052 100644 --- a/lib/routes/hupu/all.ts +++ b/lib/routes/hupu/all.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/hupu/bbs.ts b/lib/routes/hupu/bbs.ts index e3cd3aee5..39ca3d457 100644 --- a/lib/routes/hupu/bbs.ts +++ b/lib/routes/hupu/bbs.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/huxiu/util.ts b/lib/routes/huxiu/util.ts index b69659dfd..73850e86f 100644 --- a/lib/routes/huxiu/util.ts +++ b/lib/routes/huxiu/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/i-cable/news.ts b/lib/routes/i-cable/news.ts index 067dacd86..6541ba565 100644 --- a/lib/routes/i-cable/news.ts +++ b/lib/routes/i-cable/news.ts @@ -1,14 +1,11 @@ import { Route } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; -import { getCurrentPath } from '@/utils/helpers'; import path from 'node:path'; import { art } from '@/utils/render'; import { config } from '@/config'; import InvalidParameterError from '@/errors/types/invalid-parameter'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/news/:category?', categories: ['traditional-media'], diff --git a/lib/routes/ianspriggs/index.ts b/lib/routes/ianspriggs/index.ts index f91b883c3..b652cc458 100644 --- a/lib/routes/ianspriggs/index.ts +++ b/lib/routes/ianspriggs/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/idaily/index.ts b/lib/routes/idaily/index.ts index 6845f898c..6fc9c5491 100644 --- a/lib/routes/idaily/index.ts +++ b/lib/routes/idaily/index.ts @@ -4,8 +4,6 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: ['/:language?'], diff --git a/lib/routes/ieee/author.ts b/lib/routes/ieee/author.ts index 78f1a8001..6afef6535 100644 --- a/lib/routes/ieee/author.ts +++ b/lib/routes/ieee/author.ts @@ -5,8 +5,6 @@ import { load } from 'cheerio'; import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { name: 'IEEE Author Articles', diff --git a/lib/routes/ieee/journal.ts b/lib/routes/ieee/journal.ts index c8ffa3471..a34632dab 100644 --- a/lib/routes/ieee/journal.ts +++ b/lib/routes/ieee/journal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import path from 'node:path'; diff --git a/lib/routes/ifeng/news.ts b/lib/routes/ifeng/news.ts index 515da9868..70c8d99ab 100644 --- a/lib/routes/ifeng/news.ts +++ b/lib/routes/ifeng/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/ifeng/utils.ts b/lib/routes/ifeng/utils.ts index 9e7e084f3..387c7c7d9 100644 --- a/lib/routes/ifeng/utils.ts +++ b/lib/routes/ifeng/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/ikea/cn/utils.ts b/lib/routes/ikea/cn/utils.ts index deef19138..75e8af590 100644 --- a/lib/routes/ikea/cn/utils.ts +++ b/lib/routes/ikea/cn/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import md5 from '@/utils/md5'; import path from 'node:path'; diff --git a/lib/routes/ikea/gb/new.ts b/lib/routes/ikea/gb/new.ts index cc67adc9d..8ad4219e8 100644 --- a/lib/routes/ikea/gb/new.ts +++ b/lib/routes/ikea/gb/new.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/ikea/gb/offer.ts b/lib/routes/ikea/gb/offer.ts index 1032596d1..8634a1066 100644 --- a/lib/routes/ikea/gb/offer.ts +++ b/lib/routes/ikea/gb/offer.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/iknowwhatyoudownload/daily.ts b/lib/routes/iknowwhatyoudownload/daily.ts index 953c64502..fda67f153 100644 --- a/lib/routes/iknowwhatyoudownload/daily.ts +++ b/lib/routes/iknowwhatyoudownload/daily.ts @@ -5,9 +5,6 @@ import dayjs from 'dayjs'; import got from '@/utils/got'; import { art } from '@/utils/render'; import path from 'path'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); interface TableData { key: string; diff --git a/lib/routes/imdb/chart.ts b/lib/routes/imdb/chart.ts index 4619f9a3a..5c14dace0 100644 --- a/lib/routes/imdb/chart.ts +++ b/lib/routes/imdb/chart.ts @@ -4,11 +4,9 @@ import * as cheerio from 'cheerio'; import type { Context } from 'hono'; import { ChartTitleSearchConnection } from './types'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; -const __dirname = getCurrentPath(import.meta.url); -const render = (data) => art(path.join(__dirname, 'templates', 'chart.art'), data); +const render = (data) => art(path.join(__dirname, 'templates/chart.art'), data); export const route: Route = { path: '/chart/:chart?', diff --git a/lib/routes/imiker/jinghua.ts b/lib/routes/imiker/jinghua.ts index 2a4ad34fc..ce2aeca23 100644 --- a/lib/routes/imiker/jinghua.ts +++ b/lib/routes/imiker/jinghua.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/infoq/presentations.ts b/lib/routes/infoq/presentations.ts index a7b4c91b5..b1aa66041 100644 --- a/lib/routes/infoq/presentations.ts +++ b/lib/routes/infoq/presentations.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/informs/index.ts b/lib/routes/informs/index.ts index 73f5ab7ea..d772d8896 100644 --- a/lib/routes/informs/index.ts +++ b/lib/routes/informs/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { config } from '@/config'; diff --git a/lib/routes/instagram/common-utils.ts b/lib/routes/instagram/common-utils.ts index d0a25b9c8..d99466a42 100644 --- a/lib/routes/instagram/common-utils.ts +++ b/lib/routes/instagram/common-utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/instagram/web-api/utils.ts b/lib/routes/instagram/web-api/utils.ts index 24a3a0845..cae877ac4 100644 --- a/lib/routes/instagram/web-api/utils.ts +++ b/lib/routes/instagram/web-api/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; diff --git a/lib/routes/ipsw.dev/index.ts b/lib/routes/ipsw.dev/index.ts index a5ad5fd1b..58b66dab2 100644 --- a/lib/routes/ipsw.dev/index.ts +++ b/lib/routes/ipsw.dev/index.ts @@ -3,7 +3,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; export const route: Route = { path: '/index/:productID', @@ -19,7 +18,6 @@ export const route: Route = { async function handler(ctx) { const { productID } = ctx.req.param(); - const __dirname = getCurrentPath(import.meta.url); const link = `https://ipsw.dev/product/version/${productID}`; const resp = await got({ diff --git a/lib/routes/iqilu/program.ts b/lib/routes/iqilu/program.ts index 5e0046baa..f6adb066c 100644 --- a/lib/routes/iqilu/program.ts +++ b/lib/routes/iqilu/program.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/iqiyi/album.ts b/lib/routes/iqiyi/album.ts index e2da0f4a2..58a3e233b 100644 --- a/lib/routes/iqiyi/album.ts +++ b/lib/routes/iqiyi/album.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/iresearch/chart.ts b/lib/routes/iresearch/chart.ts index 0dd82a878..0f36c40b6 100644 --- a/lib/routes/iresearch/chart.ts +++ b/lib/routes/iresearch/chart.ts @@ -6,13 +6,10 @@ import { type Context } from 'hono'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const __dirname = getCurrentPath(import.meta.url); - const categoryMap = { 媒体文娱: 59, 广告营销: 89, diff --git a/lib/routes/iresearch/report.ts b/lib/routes/iresearch/report.ts index 094875ddf..1a1688559 100644 --- a/lib/routes/iresearch/report.ts +++ b/lib/routes/iresearch/report.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/iresearch/weekly.ts b/lib/routes/iresearch/weekly.ts index d1668dde0..5fe4ba5b6 100644 --- a/lib/routes/iresearch/weekly.ts +++ b/lib/routes/iresearch/weekly.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/itch/devlog.ts b/lib/routes/itch/devlog.ts index 7f2a931bc..f947d609d 100644 --- a/lib/routes/itch/devlog.ts +++ b/lib/routes/itch/devlog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/itch/index.ts b/lib/routes/itch/index.ts index 24eace8ab..539b9f6ff 100644 --- a/lib/routes/itch/index.ts +++ b/lib/routes/itch/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/ithome/zt.ts b/lib/routes/ithome/zt.ts index 7c174365e..ebeb20ae3 100644 --- a/lib/routes/ithome/zt.ts +++ b/lib/routes/ithome/zt.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/iwara/subscriptions.ts b/lib/routes/iwara/subscriptions.ts index 5c637ecf9..83f5cf1cd 100644 --- a/lib/routes/iwara/subscriptions.ts +++ b/lib/routes/iwara/subscriptions.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/ixigua/user-video.ts b/lib/routes/ixigua/user-video.ts index d9bed9df0..71031fd0b 100644 --- a/lib/routes/ixigua/user-video.ts +++ b/lib/routes/ixigua/user-video.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/japanpost/track.ts b/lib/routes/japanpost/track.ts index 9f44377a0..c1d3c998a 100644 --- a/lib/routes/japanpost/track.ts +++ b/lib/routes/japanpost/track.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; diff --git a/lib/routes/japanpost/utils.ts b/lib/routes/japanpost/utils.ts index 92cdd855b..2e5d682f3 100644 --- a/lib/routes/japanpost/utils.ts +++ b/lib/routes/japanpost/utils.ts @@ -2,9 +2,9 @@ import crypto from 'crypto'; import cityTimezones from 'city-timezones'; import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; +import customParseFormat from 'dayjs/plugin/customParseFormat.js'; +import utc from 'dayjs/plugin/utc.js'; +import timezone from 'dayjs/plugin/timezone.js'; dayjs.extend(customParseFormat); dayjs.extend(utc); dayjs.extend(timezone); diff --git a/lib/routes/javbus/index.ts b/lib/routes/javbus/index.ts index f07d9b3eb..5b0ef2b2b 100644 --- a/lib/routes/javbus/index.ts +++ b/lib/routes/javbus/index.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/javlibrary/utils.ts b/lib/routes/javlibrary/utils.ts index 666fa1ee4..d26a13388 100644 --- a/lib/routes/javlibrary/utils.ts +++ b/lib/routes/javlibrary/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/javtiful/utils.ts b/lib/routes/javtiful/utils.ts index e3fe4c585..9408224d9 100644 --- a/lib/routes/javtiful/utils.ts +++ b/lib/routes/javtiful/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; import { parseRelativeDate } from '@/utils/parse-date'; diff --git a/lib/routes/javtrailers/utils.ts b/lib/routes/javtrailers/utils.ts index 5b8037bef..d4f05430a 100644 --- a/lib/routes/javtrailers/utils.ts +++ b/lib/routes/javtrailers/utils.ts @@ -4,8 +4,6 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); export const baseUrl = 'https://javtrailers.com'; export const headers = { diff --git a/lib/routes/jd/price.ts b/lib/routes/jd/price.ts index 4e44573b3..95e664e25 100644 --- a/lib/routes/jd/price.ts +++ b/lib/routes/jd/price.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/jiemian/lists.ts b/lib/routes/jiemian/lists.ts index a92bf9919..4e0ea0c8e 100644 --- a/lib/routes/jiemian/lists.ts +++ b/lib/routes/jiemian/lists.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/jimmyspa/books.ts b/lib/routes/jimmyspa/books.ts index d925acd21..d404b0d77 100644 --- a/lib/routes/jimmyspa/books.ts +++ b/lib/routes/jimmyspa/books.ts @@ -3,11 +3,9 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import cache from '@/utils/cache'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/books/:language', categories: ['design'], diff --git a/lib/routes/jimmyspa/news.ts b/lib/routes/jimmyspa/news.ts index 5d7788640..5b6b24cbd 100644 --- a/lib/routes/jimmyspa/news.ts +++ b/lib/routes/jimmyspa/news.ts @@ -3,8 +3,6 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import path from 'node:path'; export const route: Route = { diff --git a/lib/routes/jin10/category.ts b/lib/routes/jin10/category.ts index 52ff3c424..752493f1c 100644 --- a/lib/routes/jin10/category.ts +++ b/lib/routes/jin10/category.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/jin10/index.ts b/lib/routes/jin10/index.ts index ff4d02af6..6da464b81 100644 --- a/lib/routes/jin10/index.ts +++ b/lib/routes/jin10/index.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/jinse/catalogue.ts b/lib/routes/jinse/catalogue.ts index 931dc2b80..94c5961d6 100644 --- a/lib/routes/jinse/catalogue.ts +++ b/lib/routes/jinse/catalogue.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/jinse/lives.ts b/lib/routes/jinse/lives.ts index 13f8b7295..7777b7248 100644 --- a/lib/routes/jinse/lives.ts +++ b/lib/routes/jinse/lives.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/jinse/timeline.ts b/lib/routes/jinse/timeline.ts index f3d7a41ca..c58b80c59 100644 --- a/lib/routes/jinse/timeline.ts +++ b/lib/routes/jinse/timeline.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/jiuyangongshe/community.ts b/lib/routes/jiuyangongshe/community.ts index d739cd583..dba6cfb9e 100644 --- a/lib/routes/jiuyangongshe/community.ts +++ b/lib/routes/jiuyangongshe/community.ts @@ -5,11 +5,8 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import md5 from '@/utils/md5'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; -const __dirname = getCurrentPath(import.meta.url); - interface User { follow_type: number; investment_style_id: null | string; @@ -93,7 +90,7 @@ interface Community { serverTime: number; } -const render = (data) => art(path.join(__dirname, 'templates', 'community-description.art'), data); +const render = (data) => art(path.join(__dirname, 'templates/community-description.art'), data); export const route: Route = { path: '/community', diff --git a/lib/routes/jjwxc/author.ts b/lib/routes/jjwxc/author.ts index 5cbf9751f..99d32e746 100644 --- a/lib/routes/jjwxc/author.ts +++ b/lib/routes/jjwxc/author.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/jjwxc/book.ts b/lib/routes/jjwxc/book.ts index c111a1cfa..d31b1d65a 100644 --- a/lib/routes/jjwxc/book.ts +++ b/lib/routes/jjwxc/book.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/joins/chinese.ts b/lib/routes/joins/chinese.ts index 93be06161..de858ad1e 100644 --- a/lib/routes/joins/chinese.ts +++ b/lib/routes/joins/chinese.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/joneslanglasalle/index.ts b/lib/routes/joneslanglasalle/index.ts index 8c73a3eed..343bef215 100644 --- a/lib/routes/joneslanglasalle/index.ts +++ b/lib/routes/joneslanglasalle/index.ts @@ -7,12 +7,9 @@ import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -const __dirname = getCurrentPath(import.meta.url); - const cleanHtml = (html: string, preservedTags: string[]): string => { const $ = load(html); diff --git a/lib/routes/jpxgmn/utils.ts b/lib/routes/jpxgmn/utils.ts index 3efb133c3..6547a3f2a 100644 --- a/lib/routes/jpxgmn/utils.ts +++ b/lib/routes/jpxgmn/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; diff --git a/lib/routes/jump/discount.ts b/lib/routes/jump/discount.ts index 9e372cd4a..da3082dc5 100644 --- a/lib/routes/jump/discount.ts +++ b/lib/routes/jump/discount.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/kadokawa/blog.ts b/lib/routes/kadokawa/blog.ts index b44109db5..1ea17d02c 100644 --- a/lib/routes/kadokawa/blog.ts +++ b/lib/routes/kadokawa/blog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/kamen-rider-official/news.ts b/lib/routes/kamen-rider-official/news.ts index e360f7f61..7f2d79241 100644 --- a/lib/routes/kamen-rider-official/news.ts +++ b/lib/routes/kamen-rider-official/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/kantarworldpanel/index.ts b/lib/routes/kantarworldpanel/index.ts index 9b9e378c6..1efe29082 100644 --- a/lib/routes/kantarworldpanel/index.ts +++ b/lib/routes/kantarworldpanel/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/kcna/news.ts b/lib/routes/kcna/news.ts index f1bd2e6f2..7eac72a2e 100644 --- a/lib/routes/kcna/news.ts +++ b/lib/routes/kcna/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/keep/user.ts b/lib/routes/keep/user.ts index 0b4a82f0e..a02ddb55e 100644 --- a/lib/routes/keep/user.ts +++ b/lib/routes/keep/user.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/kemono/index.ts b/lib/routes/kemono/index.ts index 2d92eb5a1..82d5ffcdc 100644 --- a/lib/routes/kemono/index.ts +++ b/lib/routes/kemono/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; @@ -82,7 +80,7 @@ async function handler(ctx) { .slice(0, limit) .map((i) => ({ title: i.content, - description: art(path.join(__dirname, 'templates', 'discord.art'), { i }), + description: art(path.join(__dirname, 'templates/discord.art'), { i }), author: `${i.author.username}#${i.author.discriminator}`, pubDate: parseDate(i.published), category: channel.name, @@ -117,7 +115,7 @@ async function handler(ctx) { extension: attachment.path.replace(/.*\./, '').toLowerCase(), }); } - const filesHTML = art(path.join(__dirname, 'templates', 'source.art'), { i }); + const filesHTML = art(path.join(__dirname, 'templates/source.art'), { i }); let $ = load(filesHTML); const kemonoFiles = $('img, a, audio, video').map(function () { return $(this).prop('outerHTML')!; diff --git a/lib/routes/kepu/live.ts b/lib/routes/kepu/live.ts index dfbe66206..dad47ff24 100644 --- a/lib/routes/kepu/live.ts +++ b/lib/routes/kepu/live.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/kpmg/insights.ts b/lib/routes/kpmg/insights.ts index f5a87c46f..087185af8 100644 --- a/lib/routes/kpmg/insights.ts +++ b/lib/routes/kpmg/insights.ts @@ -7,8 +7,6 @@ import { Context } from 'hono'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const baseUrl = 'https://kpmg.com'; const payload = { diff --git a/lib/routes/kpopping/kpics.ts b/lib/routes/kpopping/kpics.ts index 420bfd380..05f36d9ac 100644 --- a/lib/routes/kpopping/kpics.ts +++ b/lib/routes/kpopping/kpics.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { filter } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/kpopping/news.ts b/lib/routes/kpopping/news.ts index 6c9e0f5bd..d35f9f37e 100644 --- a/lib/routes/kpopping/news.ts +++ b/lib/routes/kpopping/news.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; @@ -11,8 +10,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { filter } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '2', 10); diff --git a/lib/routes/kyodonews/index.ts b/lib/routes/kyodonews/index.ts index 8277b4b88..f46bd9c6e 100644 --- a/lib/routes/kyodonews/index.ts +++ b/lib/routes/kyodonews/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lang/room.ts b/lib/routes/lang/room.ts index d368cdd96..ba0ca0e85 100644 --- a/lib/routes/lang/room.ts +++ b/lib/routes/lang/room.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/lanqiao/utils.ts b/lib/routes/lanqiao/utils.ts index 71cb3e6b6..13e34d316 100644 --- a/lib/routes/lanqiao/utils.ts +++ b/lib/routes/lanqiao/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/learnku/topic.ts b/lib/routes/learnku/topic.ts index 12654175f..c53e3936f 100644 --- a/lib/routes/learnku/topic.ts +++ b/lib/routes/learnku/topic.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/leetcode/dailyquestion-cn.ts b/lib/routes/leetcode/dailyquestion-cn.ts index 66b018673..34335a1bd 100644 --- a/lib/routes/leetcode/dailyquestion-cn.ts +++ b/lib/routes/leetcode/dailyquestion-cn.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/leetcode/dailyquestion-en.ts b/lib/routes/leetcode/dailyquestion-en.ts index 3243aef2f..f0eddacbc 100644 --- a/lib/routes/leetcode/dailyquestion-en.ts +++ b/lib/routes/leetcode/dailyquestion-en.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/lfsyd/utils.ts b/lib/routes/lfsyd/utils.ts index df89c42dd..d2cf59ae9 100644 --- a/lib/routes/lfsyd/utils.ts +++ b/lib/routes/lfsyd/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { load } from 'cheerio'; import got from '@/utils/got'; import md5 from '@/utils/md5'; diff --git a/lib/routes/linkedin/cn/utils.ts b/lib/routes/linkedin/cn/utils.ts index 0b62b133b..ff06b141f 100644 --- a/lib/routes/linkedin/cn/utils.ts +++ b/lib/routes/linkedin/cn/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import crypto from 'crypto'; import path from 'node:path'; diff --git a/lib/routes/linkresearcher/index.ts b/lib/routes/linkresearcher/index.ts index 65da513d2..dcf01ae82 100644 --- a/lib/routes/linkresearcher/index.ts +++ b/lib/routes/linkresearcher/index.ts @@ -6,11 +6,9 @@ import crypto from 'crypto'; import type { Context } from 'hono'; import type { DetailResponse, SearchResultItem } from './types'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); const templatePath = path.join(__dirname, 'templates/bilingual.art'); const baseURL = 'https://www.linkresearcher.com'; diff --git a/lib/routes/lkong/forum.ts b/lib/routes/lkong/forum.ts index 0d811fe17..df31bbe15 100644 --- a/lib/routes/lkong/forum.ts +++ b/lib/routes/lkong/forum.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lkong/thread.ts b/lib/routes/lkong/thread.ts index 2905f5e07..b6ac57172 100644 --- a/lib/routes/lkong/thread.ts +++ b/lib/routes/lkong/thread.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/lmu/jobs.ts b/lib/routes/lmu/jobs.ts index a692727c0..33c38f598 100644 --- a/lib/routes/lmu/jobs.ts +++ b/lib/routes/lmu/jobs.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/logclub/index.ts b/lib/routes/logclub/index.ts index 0fa828af9..a3b114717 100644 --- a/lib/routes/logclub/index.ts +++ b/lib/routes/logclub/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/logclub/report.ts b/lib/routes/logclub/report.ts index a93d2a9c8..7ee2b4925 100644 --- a/lib/routes/logclub/report.ts +++ b/lib/routes/logclub/report.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/logonews/index.ts b/lib/routes/logonews/index.ts index b18e2fac7..0302e81b5 100644 --- a/lib/routes/logonews/index.ts +++ b/lib/routes/logonews/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/logrocket/index.ts b/lib/routes/logrocket/index.ts index 8a1f605b9..6c90e506c 100644 --- a/lib/routes/logrocket/index.ts +++ b/lib/routes/logrocket/index.ts @@ -3,10 +3,7 @@ import ofetch from '@/utils/ofetch'; // 统一使用的请求库 import { load } from 'cheerio'; // 类似 jQuery 的 API HTML 解析器 import { Route } from '@/types'; import cache from '@/utils/cache'; -// import { getCurrentPath } from '@/utils/helpers'; -// import { art } from '@/utils/render'; -// import path from 'node:path'; -// const __dirname = getCurrentPath(import.meta.url); + export const route: Route = { path: '/:type', categories: ['blog'], @@ -54,10 +51,6 @@ async function handler(ctx) { // $('div.content-max-width .sidebar-container div.code-block').remove(); item.description = $('div.content-max-width .sidebar-container').html(); - // item.description = art(path.join(__dirname, 'templates/description.art'), { - // // header: $('#post-header').html(), - // description: $('div.content-max-width .the-content-container').remove('.lr-content div.code-block.code-block-77').remove('.lr-content .code-block.code-block-57').html(), - // }); return item; }) ) diff --git a/lib/routes/loltw/news.ts b/lib/routes/loltw/news.ts index 45544dd30..3827a7fe2 100644 --- a/lib/routes/loltw/news.ts +++ b/lib/routes/loltw/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lorientlejour/index.ts b/lib/routes/lorientlejour/index.ts index 8a9bb6242..4a1a5d4c7 100644 --- a/lib/routes/lorientlejour/index.ts +++ b/lib/routes/lorientlejour/index.ts @@ -5,12 +5,10 @@ import { config } from '@/config'; import { FetchError } from 'ofetch'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import path from 'node:path'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -const __dirname = getCurrentPath(import.meta.url); const key = '3d5_f6A(S$G_FD=2S(Dr6%7BW_h37@rE'; export const route: Route = { @@ -48,7 +46,7 @@ export const route: Route = { maintainers: ['quiniapiezoelectricity'], handler, description: ` ::: tip -For example, the path for the sites https://today.lorientlejour.com/section/977-lebanon and https://www.lorientlejour.com/rubrique/1-liban would be /lorientlejour/977-lebanon and /lorientlejour/1-liban respectively. +For example, the path for the sites https://today.lorientlejour.com/section/977-lebanon and https://www.lorientlejour.com/rubrique/1-liban would be /lorientlejour/977-lebanon and /lorientlejour/1-liban respectively. Multiple categories seperated by '|' is also supported, e.g. /lorientlejour/977-lebanon|1-liban. :::`, radar: [ diff --git a/lib/routes/lovelive-anime/news.ts b/lib/routes/lovelive-anime/news.ts index 45af080bf..744860986 100644 --- a/lib/routes/lovelive-anime/news.ts +++ b/lib/routes/lovelive-anime/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lovelive-anime/schedules.ts b/lib/routes/lovelive-anime/schedules.ts index 046111b9a..c2ffef8da 100644 --- a/lib/routes/lovelive-anime/schedules.ts +++ b/lib/routes/lovelive-anime/schedules.ts @@ -1,14 +1,12 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import path from 'node:path'; import { art } from '@/utils/render'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/scheduleDesc.art'), desc); import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; +import utc from 'dayjs/plugin/utc.js'; +import timezone from 'dayjs/plugin/timezone.js'; dayjs.extend(utc); dayjs.extend(timezone); diff --git a/lib/routes/lovelive-anime/topics.ts b/lib/routes/lovelive-anime/topics.ts index 1b91f2ce1..e7dfa8b34 100644 --- a/lib/routes/lovelive-anime/topics.ts +++ b/lib/routes/lovelive-anime/topics.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/lrepacks/index.ts b/lib/routes/lrepacks/index.ts index e31a5ddca..2d54432c9 100644 --- a/lib/routes/lrepacks/index.ts +++ b/lib/routes/lrepacks/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/ltaaa/article.ts b/lib/routes/ltaaa/article.ts index 510bd4c0d..ad7d47550 100644 --- a/lib/routes/ltaaa/article.ts +++ b/lib/routes/ltaaa/article.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/luolei/index.ts b/lib/routes/luolei/index.ts index a8fced16a..21ced6a7f 100644 --- a/lib/routes/luolei/index.ts +++ b/lib/routes/luolei/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lvv2/news.ts b/lib/routes/lvv2/news.ts index ab142ade1..3aa9fafc3 100644 --- a/lib/routes/lvv2/news.ts +++ b/lib/routes/lvv2/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lvv2/top.ts b/lib/routes/lvv2/top.ts index 647c13721..9d21c9b53 100644 --- a/lib/routes/lvv2/top.ts +++ b/lib/routes/lvv2/top.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/lxixsxa/discography.ts b/lib/routes/lxixsxa/discography.ts index 2999199ba..fab9f7d3c 100644 --- a/lib/routes/lxixsxa/discography.ts +++ b/lib/routes/lxixsxa/discography.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/lxixsxa/information.ts b/lib/routes/lxixsxa/information.ts index 74a205c62..4967a7658 100644 --- a/lib/routes/lxixsxa/information.ts +++ b/lib/routes/lxixsxa/information.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/m4/index.ts b/lib/routes/m4/index.ts index 32c3d62a7..f10b132ab 100644 --- a/lib/routes/m4/index.ts +++ b/lib/routes/m4/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/maccms/index.ts b/lib/routes/maccms/index.ts index 8dddd1410..597448ca8 100644 --- a/lib/routes/maccms/index.ts +++ b/lib/routes/maccms/index.ts @@ -5,9 +5,8 @@ import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; -import { getCurrentPath } from '@/utils/helpers'; -const render = (vod: Vod, link: string) => art(path.join(getCurrentPath(import.meta.url), 'templates', 'vod.art'), { vod, link }); +const render = (vod: Vod, link: string) => art(path.join(__dirname, 'templates/vod.art'), { vod, link }); export const route: Route = { path: '/:domain/:type?/:size?', diff --git a/lib/routes/magazinelib/latest-magazine.ts b/lib/routes/magazinelib/latest-magazine.ts index 192821d12..6f25d157b 100644 --- a/lib/routes/magazinelib/latest-magazine.ts +++ b/lib/routes/magazinelib/latest-magazine.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/manhuagui/subscribe.ts b/lib/routes/manhuagui/subscribe.ts index be218a614..c958083fa 100644 --- a/lib/routes/manhuagui/subscribe.ts +++ b/lib/routes/manhuagui/subscribe.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseRelativeDate } from '@/utils/parse-date'; diff --git a/lib/routes/manyvids/video.ts b/lib/routes/manyvids/video.ts index 51b8e86e6..cc6d701e3 100644 --- a/lib/routes/manyvids/video.ts +++ b/lib/routes/manyvids/video.ts @@ -4,9 +4,6 @@ import cache from '@/utils/cache'; import { UserProfile, Videos } from './types'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/profile/vids/:uid', @@ -24,7 +21,7 @@ export const route: Route = { const getProfileById = (uid: string) => cache.tryGet(`manyvids:profile:${uid}`, () => ofetch(`https://www.manyvids.com/bff/profile/profiles/${uid}`)) as Promise; -const render = (data) => art(path.join(__dirname, 'templates', 'video.art'), data); +const render = (data) => art(path.join(__dirname, 'templates/video.art'), data); async function handler(ctx) { const { uid } = ctx.req.param(); diff --git a/lib/routes/mcmod/index.ts b/lib/routes/mcmod/index.ts index 91fbef4d9..ee1bf460b 100644 --- a/lib/routes/mcmod/index.ts +++ b/lib/routes/mcmod/index.ts @@ -6,9 +6,8 @@ import path from 'node:path'; import cache from '@/utils/cache'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; -const render = (mod) => art(path.join(getCurrentPath(import.meta.url), 'templates', 'mod.art'), { mod }); +const render = (mod) => art(path.join(__dirname, 'templates/mod.art'), { mod }); export const route: Route = { path: '/:type', diff --git a/lib/routes/mdpi/journal.ts b/lib/routes/mdpi/journal.ts index b1621c376..382ee41e0 100644 --- a/lib/routes/mdpi/journal.ts +++ b/lib/routes/mdpi/journal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/mercari/util.ts b/lib/routes/mercari/util.ts index b42e722da..7efc28692 100644 --- a/lib/routes/mercari/util.ts +++ b/lib/routes/mercari/util.ts @@ -8,8 +8,6 @@ import { art } from '@/utils/render'; import path from 'node:path'; import { DataItem } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const rootURL = 'https://api.mercari.jp/'; const rootProductURL = 'https://jp.mercari.com/item/'; const rootShopProductURL = 'https://jp.mercari.com/shops/product/'; diff --git a/lib/routes/metacritic/index.ts b/lib/routes/metacritic/index.ts index ba17895ac..4b4db19be 100644 --- a/lib/routes/metacritic/index.ts +++ b/lib/routes/metacritic/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/meteor/utils.ts b/lib/routes/meteor/utils.ts index 121fad291..55a9529ee 100644 --- a/lib/routes/meteor/utils.ts +++ b/lib/routes/meteor/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/mi/utils.ts b/lib/routes/mi/utils.ts index 2fc2c90d2..99ea22646 100644 --- a/lib/routes/mi/utils.ts +++ b/lib/routes/mi/utils.ts @@ -1,14 +1,11 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; import dayjs from 'dayjs'; -import 'dayjs/locale/zh-cn'; -import localizedFormat from 'dayjs/plugin/localizedFormat'; -import timezone from 'dayjs/plugin/timezone'; -import utc from 'dayjs/plugin/utc'; +import 'dayjs/locale/zh-cn.js'; +import localizedFormat from 'dayjs/plugin/localizedFormat.js'; +import timezone from 'dayjs/plugin/timezone.js'; +import utc from 'dayjs/plugin/utc.js'; import path from 'node:path'; import { CrowdfundingData, CrowdfundingDetailData, CrowdfundingDetailInfo, CrowdfundingItem, CrowdfundingList, DataResponse } from './types'; diff --git a/lib/routes/mihoyo/bbs/follow-list.ts b/lib/routes/mihoyo/bbs/follow-list.ts index c1c6c33ca..d2d6e5d7b 100644 --- a/lib/routes/mihoyo/bbs/follow-list.ts +++ b/lib/routes/mihoyo/bbs/follow-list.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/mihoyo/bbs/official.ts b/lib/routes/mihoyo/bbs/official.ts index a3121a2d8..48c28e907 100644 --- a/lib/routes/mihoyo/bbs/official.ts +++ b/lib/routes/mihoyo/bbs/official.ts @@ -4,9 +4,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; -import { getCurrentPath } from '@/utils/helpers'; import logger from '@/utils/logger'; -const __dirname = getCurrentPath(import.meta.url); // 游戏id const GITS_MAP = { diff --git a/lib/routes/mihoyo/bbs/utils.ts b/lib/routes/mihoyo/bbs/utils.ts index 1e7a36781..745c5c46c 100644 --- a/lib/routes/mihoyo/bbs/utils.ts +++ b/lib/routes/mihoyo/bbs/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/mihoyo/ys/news.ts b/lib/routes/mihoyo/ys/news.ts index 30fb94ccf..cf55c6e77 100644 --- a/lib/routes/mihoyo/ys/news.ts +++ b/lib/routes/mihoyo/ys/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/mindmeister/example.ts b/lib/routes/mindmeister/example.ts index 62a45c3f2..842101642 100644 --- a/lib/routes/mindmeister/example.ts +++ b/lib/routes/mindmeister/example.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/mingpao/index.ts b/lib/routes/mingpao/index.ts index b8f187884..f760205c6 100644 --- a/lib/routes/mingpao/index.ts +++ b/lib/routes/mingpao/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/missav/new.ts b/lib/routes/missav/new.ts index 45d078986..f3268f9e7 100644 --- a/lib/routes/missav/new.ts +++ b/lib/routes/missav/new.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import * as cheerio from 'cheerio'; diff --git a/lib/routes/misskey/utils.ts b/lib/routes/misskey/utils.ts index e295da074..9ad087eb5 100644 --- a/lib/routes/misskey/utils.ts +++ b/lib/routes/misskey/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/mittrchina/index.ts b/lib/routes/mittrchina/index.ts index 9a39fa15e..6f1421cfa 100644 --- a/lib/routes/mittrchina/index.ts +++ b/lib/routes/mittrchina/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/modelscope/community.ts b/lib/routes/modelscope/community.ts index c48c92dc7..c0db0a977 100644 --- a/lib/routes/modelscope/community.ts +++ b/lib/routes/modelscope/community.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/modelscope/datasets.ts b/lib/routes/modelscope/datasets.ts index 47a265ff9..eae2c4294 100644 --- a/lib/routes/modelscope/datasets.ts +++ b/lib/routes/modelscope/datasets.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/modelscope/studios.ts b/lib/routes/modelscope/studios.ts index 72382c389..5262cf1e9 100644 --- a/lib/routes/modelscope/studios.ts +++ b/lib/routes/modelscope/studios.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/modrinth/versions.ts b/lib/routes/modrinth/versions.ts index 3f851e43b..97880bb29 100644 --- a/lib/routes/modrinth/versions.ts +++ b/lib/routes/modrinth/versions.ts @@ -1,5 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; @@ -9,8 +8,6 @@ import MarkdownIt from 'markdown-it'; import type { Author, Project, Version } from '@/routes/modrinth/api'; import type { Context } from 'hono'; -const __dirname = getCurrentPath(import.meta.url); - const ofetch = _ofetch.create({ headers: { // https://docs.modrinth.com/#section/User-Agents diff --git a/lib/routes/mrdx/daily.ts b/lib/routes/mrdx/daily.ts index 6b63d1b96..e5861efe5 100644 --- a/lib/routes/mrdx/daily.ts +++ b/lib/routes/mrdx/daily.ts @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { getElementChildrenInnerText } from './utils'; import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; +import utc from 'dayjs/plugin/utc.js'; dayjs.extend(utc); import got from '@/utils/got'; diff --git a/lib/routes/mydrivers/index.ts b/lib/routes/mydrivers/index.ts index 843e5b653..0f2abef41 100644 --- a/lib/routes/mydrivers/index.ts +++ b/lib/routes/mydrivers/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/myfans/post.ts b/lib/routes/myfans/post.ts index fb1b6ea32..0a3ebefc1 100644 --- a/lib/routes/myfans/post.ts +++ b/lib/routes/myfans/post.ts @@ -3,9 +3,6 @@ import { parseDate } from '@/utils/parse-date'; import { showByUsername, getPostByAccountId, baseUrl } from './utils'; import path from 'node:path'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/user/:username', @@ -31,7 +28,7 @@ export const route: Route = { }; const render = (postImages, body) => - art(path.join(__dirname, 'templates', 'post.art'), { + art(path.join(__dirname, 'templates/post.art'), { postImages, body, }); diff --git a/lib/routes/myfigurecollection/activity.ts b/lib/routes/myfigurecollection/activity.ts index 6ccad02fa..f09101c4d 100644 --- a/lib/routes/myfigurecollection/activity.ts +++ b/lib/routes/myfigurecollection/activity.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/myfigurecollection/index.ts b/lib/routes/myfigurecollection/index.ts index 5abdeaad5..b2278b663 100644 --- a/lib/routes/myfigurecollection/index.ts +++ b/lib/routes/myfigurecollection/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/mymusicsheet/usersheets.ts b/lib/routes/mymusicsheet/usersheets.ts index 50a2b8feb..75d75c30a 100644 --- a/lib/routes/mymusicsheet/usersheets.ts +++ b/lib/routes/mymusicsheet/usersheets.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/natgeo/dailyphoto.ts b/lib/routes/natgeo/dailyphoto.ts index 88f2c5792..c87253b2a 100644 --- a/lib/routes/natgeo/dailyphoto.ts +++ b/lib/routes/natgeo/dailyphoto.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/nationalgeographic/latest-stories.ts b/lib/routes/nationalgeographic/latest-stories.ts index b87a60e01..fb29acb1e 100644 --- a/lib/routes/nationalgeographic/latest-stories.ts +++ b/lib/routes/nationalgeographic/latest-stories.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/nautil/topics.ts b/lib/routes/nautil/topics.ts index 82cecd704..ed714242f 100644 --- a/lib/routes/nautil/topics.ts +++ b/lib/routes/nautil/topics.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/nber/common.ts b/lib/routes/nber/common.ts index fcf5c558c..cf4789970 100644 --- a/lib/routes/nber/common.ts +++ b/lib/routes/nber/common.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/ncc-cma/cmdp.ts b/lib/routes/ncc-cma/cmdp.ts index 9c0571a7d..6f38836c6 100644 --- a/lib/routes/ncc-cma/cmdp.ts +++ b/lib/routes/ncc-cma/cmdp.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/netflav/index.ts b/lib/routes/netflav/index.ts index e6eeffca1..4de6e89ea 100644 --- a/lib/routes/netflav/index.ts +++ b/lib/routes/netflav/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/news/xhsxw.ts b/lib/routes/news/xhsxw.ts index 9866e0c2a..bc80aee0e 100644 --- a/lib/routes/news/xhsxw.ts +++ b/lib/routes/news/xhsxw.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/newzmz/util.ts b/lib/routes/newzmz/util.ts index 64ccce324..a8fadfe2b 100644 --- a/lib/routes/newzmz/util.ts +++ b/lib/routes/newzmz/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/nhentai/util.ts b/lib/routes/nhentai/util.ts index e59245404..6c068b922 100644 --- a/lib/routes/nhentai/util.ts +++ b/lib/routes/nhentai/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { load } from 'cheerio'; import got from '@/utils/got'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/nhk/news-web-easy.ts b/lib/routes/nhk/news-web-easy.ts index 682aede41..85e3ad12d 100644 --- a/lib/routes/nhk/news-web-easy.ts +++ b/lib/routes/nhk/news-web-easy.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/nhk/news.ts b/lib/routes/nhk/news.ts index 7ab05259f..4a2f8faa7 100644 --- a/lib/routes/nhk/news.ts +++ b/lib/routes/nhk/news.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/nicovideo/utils.ts b/lib/routes/nicovideo/utils.ts index 10b92a697..3e6c3f293 100644 --- a/lib/routes/nicovideo/utils.ts +++ b/lib/routes/nicovideo/utils.ts @@ -5,9 +5,6 @@ import cache from '@/utils/cache'; import { config } from '@/config'; import path from 'node:path'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export const getUserInfoById = (id: string) => cache.tryGet(`nicovideo:user:${id}`, () => ofetch(`https://embed.nicovideo.jp/users/${id}`)) as Promise; @@ -34,4 +31,4 @@ export const getUserVideosById = (id: string) => false ) as Promise; -export const renderVideo = (video: Essential, embed: boolean) => art(path.join(__dirname, 'templates', 'video.art'), { video, embed }); +export const renderVideo = (video: Essential, embed: boolean) => art(path.join(__dirname, 'templates/video.art'), { video, embed }); diff --git a/lib/routes/nikkei/news.ts b/lib/routes/nikkei/news.ts index c9e8a6722..5b5fed324 100644 --- a/lib/routes/nikkei/news.ts +++ b/lib/routes/nikkei/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/nintendo/direct.ts b/lib/routes/nintendo/direct.ts index ae8c7067a..587d71edd 100644 --- a/lib/routes/nintendo/direct.ts +++ b/lib/routes/nintendo/direct.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/nintendo/eshop-hk.ts b/lib/routes/nintendo/eshop-hk.ts index 5679f927b..3c1166301 100644 --- a/lib/routes/nintendo/eshop-hk.ts +++ b/lib/routes/nintendo/eshop-hk.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/nintendo/eshop-jp.ts b/lib/routes/nintendo/eshop-jp.ts index 4147d8fad..70e85451e 100644 --- a/lib/routes/nintendo/eshop-jp.ts +++ b/lib/routes/nintendo/eshop-jp.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/nintendo/eshop-us.ts b/lib/routes/nintendo/eshop-us.ts index 94fc1683d..322ff668b 100644 --- a/lib/routes/nintendo/eshop-us.ts +++ b/lib/routes/nintendo/eshop-us.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; import got from '@/utils/got'; diff --git a/lib/routes/nintendo/utils.ts b/lib/routes/nintendo/utils.ts index 7fa07bddd..8d87323d0 100644 --- a/lib/routes/nintendo/utils.ts +++ b/lib/routes/nintendo/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { JSDOM } from 'jsdom'; @@ -8,8 +5,8 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; import dayjs from 'dayjs'; -import localizedFormat from 'dayjs/plugin/localizedFormat'; -import 'dayjs/locale/zh-cn'; +import localizedFormat from 'dayjs/plugin/localizedFormat.js'; +import 'dayjs/locale/zh-cn.js'; dayjs.extend(localizedFormat); function nuxtReader(data) { diff --git a/lib/routes/njnu/jwc/jwc.ts b/lib/routes/njnu/jwc/jwc.ts index 00b65edc3..5de9a78d1 100644 --- a/lib/routes/njnu/jwc/jwc.ts +++ b/lib/routes/njnu/jwc/jwc.ts @@ -2,7 +2,7 @@ import { Route } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import util from './utils'; +import { ProcessFeed } from './utils'; export const route: Route = { path: '/jwc/:type', @@ -55,7 +55,7 @@ async function handler(ctx) { const list = $('.list_txt a').get(); - const result = await util.ProcessFeed(list, cache); + const result = await ProcessFeed(list, cache); return { title: '南京师范大学教务处 - ' + title, diff --git a/lib/routes/nmtv/column.ts b/lib/routes/nmtv/column.ts index 5a9c8589a..8545e979b 100644 --- a/lib/routes/nmtv/column.ts +++ b/lib/routes/nmtv/column.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/notefolio/search.ts b/lib/routes/notefolio/search.ts index f9bcbb700..1ce01eac1 100644 --- a/lib/routes/notefolio/search.ts +++ b/lib/routes/notefolio/search.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); // 导入所需模组 import got from '@/utils/got'; // 自订的 got diff --git a/lib/routes/npm/package.ts b/lib/routes/npm/package.ts index 9f2395ebe..15b3f1b4a 100644 --- a/lib/routes/npm/package.ts +++ b/lib/routes/npm/package.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; diff --git a/lib/routes/nytimes/daily-briefing-chinese.ts b/lib/routes/nytimes/daily-briefing-chinese.ts index c5f3078ed..7c4261d79 100644 --- a/lib/routes/nytimes/daily-briefing-chinese.ts +++ b/lib/routes/nytimes/daily-briefing-chinese.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/oceanengine/arithmetic-index.ts b/lib/routes/oceanengine/arithmetic-index.ts index d276793fd..b93e1cf5c 100644 --- a/lib/routes/oceanengine/arithmetic-index.ts +++ b/lib/routes/oceanengine/arithmetic-index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import dayjs from 'dayjs'; @@ -74,7 +72,7 @@ const searchLinkUrls = (keyword) => [ const searchLinkNames = ['今日热榜', '百度', '谷歌', '知乎', '微博', '抖音', '头条']; const createContent = (keyword, queryList, queryListText) => - art(path.join(__dirname, 'templates', 'content.art'), { + art(path.join(__dirname, 'templates/content.art'), { keyword, queryListText, queries: queryList.map((query) => ({ diff --git a/lib/routes/oeeee/app/channel.ts b/lib/routes/oeeee/app/channel.ts index d08281ea8..2c8bd0809 100644 --- a/lib/routes/oeeee/app/channel.ts +++ b/lib/routes/oeeee/app/channel.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/oeeee/app/reporter.ts b/lib/routes/oeeee/app/reporter.ts index 66e5f5d0e..d02180ca0 100644 --- a/lib/routes/oeeee/app/reporter.ts +++ b/lib/routes/oeeee/app/reporter.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/oeeee/web.ts b/lib/routes/oeeee/web.ts index 522a38ba2..1e55e33c0 100644 --- a/lib/routes/oeeee/web.ts +++ b/lib/routes/oeeee/web.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/oncc/index.ts b/lib/routes/oncc/index.ts index 5e4d2d6b8..c93c3f6e2 100644 --- a/lib/routes/oncc/index.ts +++ b/lib/routes/oncc/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/oncc/money18.ts b/lib/routes/oncc/money18.ts index aa0a96c88..0894c88f3 100644 --- a/lib/routes/oncc/money18.ts +++ b/lib/routes/oncc/money18.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/onet/news.ts b/lib/routes/onet/news.ts index ee2630e80..45cc597df 100644 --- a/lib/routes/onet/news.ts +++ b/lib/routes/onet/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import parser from '@/utils/rss-parser'; diff --git a/lib/routes/onet/utils.ts b/lib/routes/onet/utils.ts index c33597d20..4188281d0 100644 --- a/lib/routes/onet/utils.ts +++ b/lib/routes/onet/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/openai/chatgpt.ts b/lib/routes/openai/chatgpt.ts index 15aba9dde..7a43cae08 100644 --- a/lib/routes/openai/chatgpt.ts +++ b/lib/routes/openai/chatgpt.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; +import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; dayjs.extend(isSameOrBefore); export const route: Route = { diff --git a/lib/routes/openai/common.ts b/lib/routes/openai/common.ts index 75a1b8906..d7b7889b6 100644 --- a/lib/routes/openai/common.ts +++ b/lib/routes/openai/common.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/openrice/chart.ts b/lib/routes/openrice/chart.ts index 30a4a9377..c56026d3d 100644 --- a/lib/routes/openrice/chart.ts +++ b/lib/routes/openrice/chart.ts @@ -3,8 +3,6 @@ import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const baseUrl = 'https://www.openrice.com'; export const route: Route = { diff --git a/lib/routes/openrice/offers.ts b/lib/routes/openrice/offers.ts index 4d9919849..a41b49290 100644 --- a/lib/routes/openrice/offers.ts +++ b/lib/routes/openrice/offers.ts @@ -2,8 +2,6 @@ import { Route } from '@/types'; import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const baseUrl = 'https://www.openrice.com'; export const route: Route = { diff --git a/lib/routes/openrice/promos.ts b/lib/routes/openrice/promos.ts index d0d9b7b2b..161fbefab 100644 --- a/lib/routes/openrice/promos.ts +++ b/lib/routes/openrice/promos.ts @@ -3,8 +3,6 @@ import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const baseUrl = 'https://www.openrice.com'; export const route: Route = { diff --git a/lib/routes/orcid/index.ts b/lib/routes/orcid/index.ts index 678db2780..dcad980e6 100644 --- a/lib/routes/orcid/index.ts +++ b/lib/routes/orcid/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/oreno3d/main.ts b/lib/routes/oreno3d/main.ts index b43a60c84..baf858e2f 100644 --- a/lib/routes/oreno3d/main.ts +++ b/lib/routes/oreno3d/main.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/oschina/column.ts b/lib/routes/oschina/column.ts index 7a72c2881..65c3b7971 100644 --- a/lib/routes/oschina/column.ts +++ b/lib/routes/oschina/column.ts @@ -7,13 +7,10 @@ import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { id } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '10', 10); diff --git a/lib/routes/oschina/event.ts b/lib/routes/oschina/event.ts index 91ddd19bc..755c5e0e5 100644 --- a/lib/routes/oschina/event.ts +++ b/lib/routes/oschina/event.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { category = 'latest' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/oshwhub/explore.ts b/lib/routes/oshwhub/explore.ts index a962b81c8..702e18d66 100644 --- a/lib/routes/oshwhub/explore.ts +++ b/lib/routes/oshwhub/explore.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/osu/beatmaps/latest-ranked.ts b/lib/routes/osu/beatmaps/latest-ranked.ts index 9462c0fd1..79c4b38f0 100644 --- a/lib/routes/osu/beatmaps/latest-ranked.ts +++ b/lib/routes/osu/beatmaps/latest-ranked.ts @@ -6,8 +6,6 @@ import { parseDate } from '@/utils/parse-date'; import cache from '@/utils/cache'; import { config } from '@/config'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const actualParametersDescTable = ` | Name | Default | Description | diff --git a/lib/routes/otobanana/utils.ts b/lib/routes/otobanana/utils.ts index b27a02aaf..6138b14ab 100644 --- a/lib/routes/otobanana/utils.ts +++ b/lib/routes/otobanana/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/oup/index.ts b/lib/routes/oup/index.ts index 278efc592..4c4ce2b6e 100644 --- a/lib/routes/oup/index.ts +++ b/lib/routes/oup/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/papers/category.ts b/lib/routes/papers/category.ts index cac50309d..9a980e050 100644 --- a/lib/routes/papers/category.ts +++ b/lib/routes/papers/category.ts @@ -1,7 +1,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { id } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '50', 10); diff --git a/lib/routes/papers/query.ts b/lib/routes/papers/query.ts index 57eb4be9c..0212638a4 100644 --- a/lib/routes/papers/query.ts +++ b/lib/routes/papers/query.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/parliament.uk/petitions.ts b/lib/routes/parliament.uk/petitions.ts index 95eec4735..31110b7cd 100644 --- a/lib/routes/parliament.uk/petitions.ts +++ b/lib/routes/parliament.uk/petitions.ts @@ -4,13 +4,10 @@ import { type Context } from 'hono'; import { load, type CheerioAPI } from 'cheerio'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import ofetch from '@/utils/ofetch'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { state = 'all' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '50', 10); diff --git a/lib/routes/patagonia/new-arrivals.ts b/lib/routes/patagonia/new-arrivals.ts index 09a1b7a50..afd57b352 100644 --- a/lib/routes/patagonia/new-arrivals.ts +++ b/lib/routes/patagonia/new-arrivals.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/patreon/feed.ts b/lib/routes/patreon/feed.ts index faf814be5..286859add 100644 --- a/lib/routes/patreon/feed.ts +++ b/lib/routes/patreon/feed.ts @@ -6,12 +6,9 @@ import ofetch from '@/utils/ofetch'; import * as cheerio from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; import { config } from '@/config'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/:creator', categories: ['new-media'], diff --git a/lib/routes/penguin-random-house/utils.ts b/lib/routes/penguin-random-house/utils.ts index 9e8c1b45d..e4cb1ab44 100644 --- a/lib/routes/penguin-random-house/utils.ts +++ b/lib/routes/penguin-random-house/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; diff --git a/lib/routes/phoronix/index.ts b/lib/routes/phoronix/index.ts index 2893cd06d..c1978bc78 100644 --- a/lib/routes/phoronix/index.ts +++ b/lib/routes/phoronix/index.ts @@ -4,8 +4,8 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import got from '@/utils/got'; import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; +import utc from 'dayjs/plugin/utc.js'; +import timezone from 'dayjs/plugin/timezone.js'; dayjs.extend(utc); dayjs.extend(timezone); diff --git a/lib/routes/picnob/user.ts b/lib/routes/picnob/user.ts index d3fced83b..d2ae28b24 100644 --- a/lib/routes/picnob/user.ts +++ b/lib/routes/picnob/user.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/picuki/profile.ts b/lib/routes/picuki/profile.ts index a19cca234..c39312358 100644 --- a/lib/routes/picuki/profile.ts +++ b/lib/routes/picuki/profile.ts @@ -1,6 +1,4 @@ import { DataItem, Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; diff --git a/lib/routes/pikabu/utils.ts b/lib/routes/pikabu/utils.ts index 1173c01b5..4bbb4c243 100644 --- a/lib/routes/pikabu/utils.ts +++ b/lib/routes/pikabu/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/pixabay/search.ts b/lib/routes/pixabay/search.ts index 199287609..5a05c17ee 100644 --- a/lib/routes/pixabay/search.ts +++ b/lib/routes/pixabay/search.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/pnas/index.ts b/lib/routes/pnas/index.ts index f66160ae0..1e3516371 100644 --- a/lib/routes/pnas/index.ts +++ b/lib/routes/pnas/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; @@ -90,7 +88,7 @@ async function handler(ctx) { item.category = [...keywords, topic]; item.author = PNASdataLayer.page.pageInfo.author; item.doi = PNASdataLayer.page.pageInfo.DOI; - item.description = art(path.join(__dirname, 'templates', 'article.art'), { + item.description = art(path.join(__dirname, 'templates/article.art'), { access: PNASdataLayer.user.access === 'yes', // abstracts: $('#abstracts .core-container').html(), diff --git a/lib/routes/podwise/episodes.ts b/lib/routes/podwise/episodes.ts index 6066427cd..5a4ac23a3 100644 --- a/lib/routes/podwise/episodes.ts +++ b/lib/routes/podwise/episodes.ts @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import dayjs from 'dayjs'; -import duration from 'dayjs/plugin/duration'; +import duration from 'dayjs/plugin/duration.js'; dayjs.extend(duration); export const route: Route = { diff --git a/lib/routes/pornhub/utils.ts b/lib/routes/pornhub/utils.ts index e94989b24..48d996ac2 100644 --- a/lib/routes/pornhub/utils.ts +++ b/lib/routes/pornhub/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; import { parseRelativeDate } from '@/utils/parse-date'; diff --git a/lib/routes/producthunt/today.ts b/lib/routes/producthunt/today.ts index 02d59d972..04d8ebc72 100644 --- a/lib/routes/producthunt/today.ts +++ b/lib/routes/producthunt/today.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/ps/monthly-games.ts b/lib/routes/ps/monthly-games.ts index 277139be1..175a894f0 100644 --- a/lib/routes/ps/monthly-games.ts +++ b/lib/routes/ps/monthly-games.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/psyche/utils.ts b/lib/routes/psyche/utils.ts index 61bd61c46..52cba2aa3 100644 --- a/lib/routes/psyche/utils.ts +++ b/lib/routes/psyche/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; diff --git a/lib/routes/pts/curations.ts b/lib/routes/pts/curations.ts index 07b8a00cc..372090843 100644 --- a/lib/routes/pts/curations.ts +++ b/lib/routes/pts/curations.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/pts/index.ts b/lib/routes/pts/index.ts index 9a52bd5aa..ddd49bfc3 100644 --- a/lib/routes/pts/index.ts +++ b/lib/routes/pts/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/pts/live.ts b/lib/routes/pts/live.ts index 26cbd184d..5ecc57d8b 100644 --- a/lib/routes/pts/live.ts +++ b/lib/routes/pts/live.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/pts/projects.ts b/lib/routes/pts/projects.ts index 012f5dc3d..9452b8ac0 100644 --- a/lib/routes/pts/projects.ts +++ b/lib/routes/pts/projects.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/pubmed/trending.ts b/lib/routes/pubmed/trending.ts index 274bd76a0..5f114f74e 100644 --- a/lib/routes/pubmed/trending.ts +++ b/lib/routes/pubmed/trending.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/qidian/author.ts b/lib/routes/qidian/author.ts index cb21a69d6..ec9a1a6f1 100644 --- a/lib/routes/qidian/author.ts +++ b/lib/routes/qidian/author.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/qoo-app/apps/comment.ts b/lib/routes/qoo-app/apps/comment.ts index a90d74956..d8e13ba92 100644 --- a/lib/routes/qoo-app/apps/comment.ts +++ b/lib/routes/qoo-app/apps/comment.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/qoo-app/notes/note.ts b/lib/routes/qoo-app/notes/note.ts index d4eaf7feb..273e5fadc 100644 --- a/lib/routes/qoo-app/notes/note.ts +++ b/lib/routes/qoo-app/notes/note.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/qoo-app/user/app-comment.ts b/lib/routes/qoo-app/user/app-comment.ts index 2034bb227..83ecdfece 100644 --- a/lib/routes/qoo-app/user/app-comment.ts +++ b/lib/routes/qoo-app/user/app-comment.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/qq/ac/utils.ts b/lib/routes/qq/ac/utils.ts index ae2aa4245..62205ac25 100644 --- a/lib/routes/qq/ac/utils.ts +++ b/lib/routes/qq/ac/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/qq/fact/index.ts b/lib/routes/qq/fact/index.ts index 00c0dc677..67c45825e 100644 --- a/lib/routes/qq/fact/index.ts +++ b/lib/routes/qq/fact/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/questmobile/report.ts b/lib/routes/questmobile/report.ts index 7b5ff1e0e..144766812 100644 --- a/lib/routes/questmobile/report.ts +++ b/lib/routes/questmobile/report.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/qweather/3days.ts b/lib/routes/qweather/3days.ts index 7602d89d4..19511aab5 100644 --- a/lib/routes/qweather/3days.ts +++ b/lib/routes/qweather/3days.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/qweather/now.ts b/lib/routes/qweather/now.ts index 4233562d7..9f3a8bf3b 100644 --- a/lib/routes/qweather/now.ts +++ b/lib/routes/qweather/now.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/radio/album.ts b/lib/routes/radio/album.ts index babb63ded..37f6894a7 100644 --- a/lib/routes/radio/album.ts +++ b/lib/routes/radio/album.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/radio/index.ts b/lib/routes/radio/index.ts index 27135ceee..a0be7ef16 100644 --- a/lib/routes/radio/index.ts +++ b/lib/routes/radio/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/radio/zhibo.ts b/lib/routes/radio/zhibo.ts index f5d271cf8..85c17eae8 100644 --- a/lib/routes/radio/zhibo.ts +++ b/lib/routes/radio/zhibo.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/raspberrypi/magazine.ts b/lib/routes/raspberrypi/magazine.ts index 77401ecbc..39d9264e4 100644 --- a/lib/routes/raspberrypi/magazine.ts +++ b/lib/routes/raspberrypi/magazine.ts @@ -2,7 +2,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -10,8 +9,6 @@ import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '12', 10); diff --git a/lib/routes/rawkuma/manga.ts b/lib/routes/rawkuma/manga.ts index 1b8d71c85..91e7df397 100644 --- a/lib/routes/rawkuma/manga.ts +++ b/lib/routes/rawkuma/manga.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/readhub/index.ts b/lib/routes/readhub/index.ts index b6a0c257c..459db1f77 100644 --- a/lib/routes/readhub/index.ts +++ b/lib/routes/readhub/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/readhub/util.ts b/lib/routes/readhub/util.ts index fabad327a..a97f45548 100644 --- a/lib/routes/readhub/util.ts +++ b/lib/routes/readhub/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/reuters/common.ts b/lib/routes/reuters/common.ts index 22c9bab3b..79f07faa8 100644 --- a/lib/routes/reuters/common.ts +++ b/lib/routes/reuters/common.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/routledge/book-series.ts b/lib/routes/routledge/book-series.ts index 61f462a01..78bb418e6 100644 --- a/lib/routes/routledge/book-series.ts +++ b/lib/routes/routledge/book-series.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/rsc/journal.ts b/lib/routes/rsc/journal.ts index 7354846d3..7b1e924d0 100644 --- a/lib/routes/rsc/journal.ts +++ b/lib/routes/rsc/journal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/saraba1st/digest.ts b/lib/routes/saraba1st/digest.ts index 56acfd5b6..3a9e12433 100644 --- a/lib/routes/saraba1st/digest.ts +++ b/lib/routes/saraba1st/digest.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/science/cover.ts b/lib/routes/science/cover.ts index 732d84efa..bc5c8b5bb 100644 --- a/lib/routes/science/cover.ts +++ b/lib/routes/science/cover.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); // journals form AAAS publishing group // diff --git a/lib/routes/science/utils.ts b/lib/routes/science/utils.ts index 686e9b47b..a49e54526 100644 --- a/lib/routes/science/utils.ts +++ b/lib/routes/science/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { load } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/sciencedirect/call-for-paper.ts b/lib/routes/sciencedirect/call-for-paper.ts index b63e0df9c..290a9eb17 100644 --- a/lib/routes/sciencedirect/call-for-paper.ts +++ b/lib/routes/sciencedirect/call-for-paper.ts @@ -1,10 +1,8 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/call-for-paper/:subject', diff --git a/lib/routes/scientificamerican/podcast.ts b/lib/routes/scientificamerican/podcast.ts index c82c1bc21..40a95997b 100644 --- a/lib/routes/scientificamerican/podcast.ts +++ b/lib/routes/scientificamerican/podcast.ts @@ -7,13 +7,10 @@ import { type DataItem, type Route, type Data, ViewType } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { id } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '12', 10); diff --git a/lib/routes/sctv/programme.ts b/lib/routes/sctv/programme.ts index 4115037f9..e156f8923 100644 --- a/lib/routes/sctv/programme.ts +++ b/lib/routes/sctv/programme.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/seekingalpha/index.ts b/lib/routes/seekingalpha/index.ts index 291d3ef3c..dbc225a09 100644 --- a/lib/routes/seekingalpha/index.ts +++ b/lib/routes/seekingalpha/index.ts @@ -3,9 +3,7 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import { getCurrentPath } from '@/utils/helpers'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); const baseUrl = 'https://seekingalpha.com'; diff --git a/lib/routes/sensortower/blog.ts b/lib/routes/sensortower/blog.ts index bec9f9c2c..91778f280 100644 --- a/lib/routes/sensortower/blog.ts +++ b/lib/routes/sensortower/blog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/shcstheatre/programs.ts b/lib/routes/shcstheatre/programs.ts index 57fc8ff30..90ddc2257 100644 --- a/lib/routes/shcstheatre/programs.ts +++ b/lib/routes/shcstheatre/programs.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/shiep/index.ts b/lib/routes/shiep/index.ts index a962a7c65..83af844bf 100644 --- a/lib/routes/shiep/index.ts +++ b/lib/routes/shiep/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/shmtu/portal.ts b/lib/routes/shmtu/portal.ts index fd37cf692..76f223637 100644 --- a/lib/routes/shmtu/portal.ts +++ b/lib/routes/shmtu/portal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/shoac/recent-show.ts b/lib/routes/shoac/recent-show.ts index 5416a88fd..a6b43f4b1 100644 --- a/lib/routes/shoac/recent-show.ts +++ b/lib/routes/shoac/recent-show.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/shuiguopai/index.ts b/lib/routes/shuiguopai/index.ts index 1e2faa9a3..e59185fa8 100644 --- a/lib/routes/shuiguopai/index.ts +++ b/lib/routes/shuiguopai/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/simpleinfo/index.ts b/lib/routes/simpleinfo/index.ts index f091999e4..414d4b503 100644 --- a/lib/routes/simpleinfo/index.ts +++ b/lib/routes/simpleinfo/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/sina/utils.ts b/lib/routes/sina/utils.ts index e1280dabc..2251c8f00 100644 --- a/lib/routes/sina/utils.ts +++ b/lib/routes/sina/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/sinchew/index.ts b/lib/routes/sinchew/index.ts index f4c1726ff..8e8e61114 100644 --- a/lib/routes/sinchew/index.ts +++ b/lib/routes/sinchew/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/sjtu/tongqu/activity.ts b/lib/routes/sjtu/tongqu/activity.ts index 890ffbac9..e5f0490bf 100644 --- a/lib/routes/sjtu/tongqu/activity.ts +++ b/lib/routes/sjtu/tongqu/activity.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/skeb/utils.ts b/lib/routes/skeb/utils.ts index bb8275ed2..41d822ca4 100644 --- a/lib/routes/skeb/utils.ts +++ b/lib/routes/skeb/utils.ts @@ -4,9 +4,6 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export const baseUrl = 'https://skeb.jp'; diff --git a/lib/routes/snowpeak/us-new-arrivals.ts b/lib/routes/snowpeak/us-new-arrivals.ts index 9ebb56f2c..6b88744d5 100644 --- a/lib/routes/snowpeak/us-new-arrivals.ts +++ b/lib/routes/snowpeak/us-new-arrivals.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/sogou/search.ts b/lib/routes/sogou/search.ts index 5df85d561..6b2918069 100644 --- a/lib/routes/sogou/search.ts +++ b/lib/routes/sogou/search.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/sohu/mp.ts b/lib/routes/sohu/mp.ts index 865c0f653..020cef62f 100644 --- a/lib/routes/sohu/mp.ts +++ b/lib/routes/sohu/mp.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/southcn/nfapp/column.ts b/lib/routes/southcn/nfapp/column.ts index 10f4d8cbb..385a3ba63 100644 --- a/lib/routes/southcn/nfapp/column.ts +++ b/lib/routes/southcn/nfapp/column.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/southcn/nfapp/reporter.ts b/lib/routes/southcn/nfapp/reporter.ts index 4adb4401d..2d69ed61d 100644 --- a/lib/routes/southcn/nfapp/reporter.ts +++ b/lib/routes/southcn/nfapp/reporter.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/spankbang/new-videos.ts b/lib/routes/spankbang/new-videos.ts index 182de368a..f5cb4dd78 100644 --- a/lib/routes/spankbang/new-videos.ts +++ b/lib/routes/spankbang/new-videos.ts @@ -1,5 +1,4 @@ import { Data, Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import puppeteer from '@/utils/puppeteer'; import * as cheerio from 'cheerio'; @@ -9,7 +8,6 @@ import { config } from '@/config'; import logger from '@/utils/logger'; import cache from '@/utils/cache'; -const __dirname = getCurrentPath(import.meta.url); const render = (data) => art(path.join(__dirname, 'templates/video.art'), data); const handler = async () => { diff --git a/lib/routes/springer/journal.ts b/lib/routes/springer/journal.ts index e70cf16db..98e404b6d 100644 --- a/lib/routes/springer/journal.ts +++ b/lib/routes/springer/journal.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/sse/inquire.ts b/lib/routes/sse/inquire.ts index 43882c2c3..fbc2cc9f9 100644 --- a/lib/routes/sse/inquire.ts +++ b/lib/routes/sse/inquire.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/sse/renewal.ts b/lib/routes/sse/renewal.ts index ab3d6150c..12155e554 100644 --- a/lib/routes/sse/renewal.ts +++ b/lib/routes/sse/renewal.ts @@ -1,14 +1,12 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; import dayjs from 'dayjs'; -import localizedFormat from 'dayjs/plugin/localizedFormat'; -import 'dayjs/locale/zh-cn'; +import localizedFormat from 'dayjs/plugin/localizedFormat.js'; +import 'dayjs/locale/zh-cn.js'; dayjs.extend(localizedFormat); const currStatusName = ['全部', '已受理', '已询问', '通过', '未通过', '提交注册', '补充审核', '注册结果', '中止', '终止']; diff --git a/lib/routes/ssm/news.ts b/lib/routes/ssm/news.ts index d2da91ffd..5d9b3fc33 100644 --- a/lib/routes/ssm/news.ts +++ b/lib/routes/ssm/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/stdaily/digitalpaper.ts b/lib/routes/stdaily/digitalpaper.ts index edc2389f1..faf585703 100644 --- a/lib/routes/stdaily/digitalpaper.ts +++ b/lib/routes/stdaily/digitalpaper.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import path from 'node:path'; diff --git a/lib/routes/steam/appcommunityfeed.ts b/lib/routes/steam/appcommunityfeed.ts index 8c16bf0ad..44faf44ed 100644 --- a/lib/routes/steam/appcommunityfeed.ts +++ b/lib/routes/steam/appcommunityfeed.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import { art } from '@/utils/render'; diff --git a/lib/routes/steam/curator.ts b/lib/routes/steam/curator.ts index a99329bc5..ef109ff3f 100644 --- a/lib/routes/steam/curator.ts +++ b/lib/routes/steam/curator.ts @@ -2,12 +2,9 @@ import { Route } from '@/types'; import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import { getCurrentPath } from '@/utils/helpers'; import path from 'node:path'; import { art } from '@/utils/render'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/curator/:id/:routeParams?', categories: ['game'], diff --git a/lib/routes/steam/workshop-search.ts b/lib/routes/steam/workshop-search.ts index e8dee0b01..a4bf9ce8b 100644 --- a/lib/routes/steam/workshop-search.ts +++ b/lib/routes/steam/workshop-search.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; diff --git a/lib/routes/storyfm/episodes.ts b/lib/routes/storyfm/episodes.ts index d5bad3cf6..d5615e4c0 100644 --- a/lib/routes/storyfm/episodes.ts +++ b/lib/routes/storyfm/episodes.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/straitstimes/index.ts b/lib/routes/straitstimes/index.ts index f09952319..a72c26440 100644 --- a/lib/routes/straitstimes/index.ts +++ b/lib/routes/straitstimes/index.ts @@ -2,7 +2,6 @@ import { Route } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -import { getCurrentPath } from '@/utils/helpers'; import path from 'node:path'; import { art } from '@/utils/render'; @@ -62,7 +61,6 @@ async function handler(ctx) { const section = ctx.req.param('section') ? ctx.req.param('section').toLowerCase() : undefined; const apiKey = 'T9XUJM9rAZoLOd2CAx2wCBSTrm3xoyPw'; const platform = 'iosflex'; - const __dirname = getCurrentPath(import.meta.url); let feed; const response = await got({ method: 'get', diff --git a/lib/routes/surfshark/blog.ts b/lib/routes/surfshark/blog.ts index ce381b04a..8122bf07c 100644 --- a/lib/routes/surfshark/blog.ts +++ b/lib/routes/surfshark/blog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/swjtu/utils.ts b/lib/routes/swjtu/utils.ts index e6ed5e473..779f4a7d5 100644 --- a/lib/routes/swjtu/utils.ts +++ b/lib/routes/swjtu/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/syosetu/ranking-isekai.ts b/lib/routes/syosetu/ranking-isekai.ts index 09f05cd51..ddabc2470 100644 --- a/lib/routes/syosetu/ranking-isekai.ts +++ b/lib/routes/syosetu/ranking-isekai.ts @@ -2,13 +2,10 @@ import { Data, DataItem } from '@/types'; import { NarouNovelFetch, SearchBuilder, SearchParams, BigGenre } from 'narou'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import InvalidParameterError from '@/errors/types/invalid-parameter'; import { Join } from 'narou/util/type'; import { RankingPeriod, NovelType, periodToJapanese, novelTypeToJapanese, periodToOrder, periodToPointField, IsekaiCategory, isekaiCategoryToJapanese } from './types/ranking'; -const __dirname = getCurrentPath(import.meta.url); - export function parseIsekaiRankingType(type: string): { period: RankingPeriod; category: IsekaiCategory; novelType: NovelType } { const [periodStr, categoryStr, novelTypeStr = NovelType.TOTAL] = type.split('_'); @@ -77,7 +74,7 @@ export async function handleIsekaiRanking(type: string, limit: number): Promise< .map((novel, index) => ({ title: `#${index + 1} ${novel.title}`, link: `https://ncode.syosetu.com/${String(novel.ncode).toLowerCase()}`, - description: art(path.join(__dirname, 'templates', 'description.art'), { + description: art(path.join(__dirname, 'templates/description.art'), { novel, }), author: novel.writer, diff --git a/lib/routes/syosetu/ranking-r18.ts b/lib/routes/syosetu/ranking-r18.ts index bae375da5..cc09f0be3 100644 --- a/lib/routes/syosetu/ranking-r18.ts +++ b/lib/routes/syosetu/ranking-r18.ts @@ -4,11 +4,8 @@ import path from 'node:path'; import { Context } from 'hono'; import { SearchBuilderR18, SearchParams, NarouNovelFetch } from 'narou'; import InvalidParameterError from '@/errors/types/invalid-parameter'; -import { getCurrentPath } from '@/utils/helpers'; import { RankingPeriod, periodToJapanese, novelTypeToJapanese, periodToOrder, NovelType, SyosetuSub, syosetuSubToJapanese, syosetuSubToNocgenre } from './types/ranking-r18'; -const __dirname = getCurrentPath(import.meta.url); - /** * Implementation of "Syosetu" R18 Rankings * @@ -176,7 +173,7 @@ async function handler(ctx: Context): Promise { const items = result.values.map((novel, index) => ({ title: `#${index + 1} ${novel.title}`, link: `https://novel18.syosetu.com/${String(novel.ncode).toLowerCase()}`, - description: art(path.join(__dirname, 'templates', 'description.art'), { + description: art(path.join(__dirname, 'templates/description.art'), { novel, }), author: novel.writer, diff --git a/lib/routes/syosetu/ranking.ts b/lib/routes/syosetu/ranking.ts index 2c91406bf..7683a5074 100644 --- a/lib/routes/syosetu/ranking.ts +++ b/lib/routes/syosetu/ranking.ts @@ -4,12 +4,9 @@ import path from 'node:path'; import { Context } from 'hono'; import { Genre, SearchBuilder, SearchParams, NarouNovelFetch, GenreNotation } from 'narou'; import InvalidParameterError from '@/errors/types/invalid-parameter'; -import { getCurrentPath } from '@/utils/helpers'; import { handleIsekaiRanking } from './ranking-isekai'; import { RankingPeriod, periodToJapanese, novelTypeToJapanese, periodToOrder, RankingType, NovelType, isekaiCategoryToJapanese, IsekaiCategory } from './types/ranking'; -const __dirname = getCurrentPath(import.meta.url); - const getParameters = () => { // Generate ranking type options const rankingTypeOptions = [ @@ -269,7 +266,7 @@ async function handler(ctx: Context): Promise { const items = result.values.map((novel, index) => ({ title: `#${index + 1} ${novel.title}`, link: `https://ncode.syosetu.com/${String(novel.ncode).toLowerCase()}`, - description: art(path.join(__dirname, 'templates', 'description.art'), { + description: art(path.join(__dirname, 'templates/description.art'), { novel, }), author: novel.writer, diff --git a/lib/routes/syosetu/search.ts b/lib/routes/syosetu/search.ts index 676c60105..194f506c9 100644 --- a/lib/routes/syosetu/search.ts +++ b/lib/routes/syosetu/search.ts @@ -8,9 +8,6 @@ import { Join } from 'narou/util/type'; import InvalidParameterError from '@/errors/types/invalid-parameter'; import { SyosetuSub, NarouSearchParams, syosetuSubToJapanese } from './types/search'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/search/:sub/:query', categories: ['reading'], @@ -134,7 +131,7 @@ async function handler(ctx: Context): Promise { const items = result.values.map((novel) => ({ title: novel.title, link: `https://${isGeneral(sub) ? 'ncode' : 'novel18'}.syosetu.com/${String(novel.ncode).toLowerCase()}`, - description: art(path.join(__dirname, 'templates', 'description.art'), { + description: art(path.join(__dirname, 'templates/description.art'), { novel, genreText: GenreNotation[novel.genre], }), diff --git a/lib/routes/szse/inquire.ts b/lib/routes/szse/inquire.ts index f45fe99d1..70d19387c 100644 --- a/lib/routes/szse/inquire.ts +++ b/lib/routes/szse/inquire.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/szse/projectdynamic.ts b/lib/routes/szse/projectdynamic.ts index 3ad17deab..3660a9c2b 100644 --- a/lib/routes/szse/projectdynamic.ts +++ b/lib/routes/szse/projectdynamic.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/taobao/zhongchou.ts b/lib/routes/taobao/zhongchou.ts index 2573c34d9..9670e8ba8 100644 --- a/lib/routes/taobao/zhongchou.ts +++ b/lib/routes/taobao/zhongchou.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/taptap/utils.ts b/lib/routes/taptap/utils.ts index 602e91963..c020ea560 100644 --- a/lib/routes/taptap/utils.ts +++ b/lib/routes/taptap/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; import path from 'node:path'; diff --git a/lib/routes/techcrunch/news.ts b/lib/routes/techcrunch/news.ts index 604c74d61..724c66e45 100644 --- a/lib/routes/techcrunch/news.ts +++ b/lib/routes/techcrunch/news.ts @@ -4,8 +4,6 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const host = 'https://techcrunch.com'; export const route: Route = { diff --git a/lib/routes/telegram/channel.ts b/lib/routes/telegram/channel.ts index c59319c9c..cb43b7437 100644 --- a/lib/routes/telegram/channel.ts +++ b/lib/routes/telegram/channel.ts @@ -1,5 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; import cache from '@/utils/cache'; import { config } from '@/config'; import ofetch from '@/utils/ofetch'; @@ -11,8 +10,6 @@ import querystring from 'querystring'; import { fallback, queryToBoolean } from '@/utils/readable-social'; import tglibchannel from './tglib/channel'; -const __dirname = getCurrentPath(import.meta.url); - /* message types */ const REPLY = 'REPLY'; const FORWARDED = 'FORWARDED'; diff --git a/lib/routes/tencent/news/author.ts b/lib/routes/tencent/news/author.ts index 5d1fae1e6..0b36e938e 100644 --- a/lib/routes/tencent/news/author.ts +++ b/lib/routes/tencent/news/author.ts @@ -1,6 +1,4 @@ import { Route, Data } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/tencent/news/coronavirus/data.ts b/lib/routes/tencent/news/coronavirus/data.ts index bff3ed95f..4564d795a 100644 --- a/lib/routes/tencent/news/coronavirus/data.ts +++ b/lib/routes/tencent/news/coronavirus/data.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getData } from './utils'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/tencent/news/coronavirus/total.ts b/lib/routes/tencent/news/coronavirus/total.ts index acacede88..8e5b4e47f 100644 --- a/lib/routes/tencent/news/coronavirus/total.ts +++ b/lib/routes/tencent/news/coronavirus/total.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getData } from './utils'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/tesla/cx.ts b/lib/routes/tesla/cx.ts index e129181f0..0bd9b293d 100644 --- a/lib/routes/tesla/cx.ts +++ b/lib/routes/tesla/cx.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/tfc-taiwan/utils.ts b/lib/routes/tfc-taiwan/utils.ts index e2900bde4..b923fd5de 100644 --- a/lib/routes/tfc-taiwan/utils.ts +++ b/lib/routes/tfc-taiwan/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import path from 'node:path'; diff --git a/lib/routes/the/index.ts b/lib/routes/the/index.ts index f77478875..ed130546f 100644 --- a/lib/routes/the/index.ts +++ b/lib/routes/the/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/theatlantic/utils.ts b/lib/routes/theatlantic/utils.ts index cba3daa8d..3becfb7d9 100644 --- a/lib/routes/theatlantic/utils.ts +++ b/lib/routes/theatlantic/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import { load } from 'cheerio'; import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/theblockbeats/index.ts b/lib/routes/theblockbeats/index.ts index ad8a0a699..ae5482b96 100644 --- a/lib/routes/theblockbeats/index.ts +++ b/lib/routes/theblockbeats/index.ts @@ -5,9 +5,6 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import path from 'node:path'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); const domain = 'theblockbeats.info'; const rootUrl = `https://www.${domain}`; diff --git a/lib/routes/theinitium/app.ts b/lib/routes/theinitium/app.ts index f5b5bdcf1..20d721973 100644 --- a/lib/routes/theinitium/app.ts +++ b/lib/routes/theinitium/app.ts @@ -5,9 +5,7 @@ import { load, type CheerioAPI, type Element } from 'cheerio'; import { art } from '@/utils/render'; import path from 'node:path'; import { config } from '@/config'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); const appUrl = 'https://app.theinitium.com/'; const userAgent = 'PugpigBolt v4.1.8 (iPhone, iOS 18.2.1) on phone (model iPhone15,2)'; diff --git a/lib/routes/themoviedb/utils.ts b/lib/routes/themoviedb/utils.ts index d586870e9..9d618202c 100644 --- a/lib/routes/themoviedb/utils.ts +++ b/lib/routes/themoviedb/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/thenewslens/index.ts b/lib/routes/thenewslens/index.ts index 73fc3b133..da8779e37 100644 --- a/lib/routes/thenewslens/index.ts +++ b/lib/routes/thenewslens/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; diff --git a/lib/routes/thepaper/factpaper.ts b/lib/routes/thepaper/factpaper.ts index e2d59e34f..bb5afd27d 100644 --- a/lib/routes/thepaper/factpaper.ts +++ b/lib/routes/thepaper/factpaper.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/thepaper/utils.ts b/lib/routes/thepaper/utils.ts index 177f3ea24..4c9d6835f 100644 --- a/lib/routes/thepaper/utils.ts +++ b/lib/routes/thepaper/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/theverge/index.ts b/lib/routes/theverge/index.ts index 6d9a6b725..625f939ab 100644 --- a/lib/routes/theverge/index.ts +++ b/lib/routes/theverge/index.ts @@ -5,9 +5,6 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import path from 'node:path'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; - -const __dirname = getCurrentPath(import.meta.url); export const route: Route = { path: '/:hub?', diff --git a/lib/routes/thoughtco/index.ts b/lib/routes/thoughtco/index.ts index 39dc18e40..9d6e98341 100644 --- a/lib/routes/thoughtco/index.ts +++ b/lib/routes/thoughtco/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/tiktok/user.ts b/lib/routes/tiktok/user.ts index c54bd80f7..9c2927ed2 100644 --- a/lib/routes/tiktok/user.ts +++ b/lib/routes/tiktok/user.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { config } from '@/config'; diff --git a/lib/routes/tingshuitz/shenzhen.ts b/lib/routes/tingshuitz/shenzhen.ts index 8d7609ba5..8f3f5e1ae 100644 --- a/lib/routes/tingshuitz/shenzhen.ts +++ b/lib/routes/tingshuitz/shenzhen.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/tingtingfm/program.ts b/lib/routes/tingtingfm/program.ts index d6cb883a7..296d5b4b1 100644 --- a/lib/routes/tingtingfm/program.ts +++ b/lib/routes/tingtingfm/program.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/tmtpost/util.ts b/lib/routes/tmtpost/util.ts index ba28139bb..70a3d446c 100644 --- a/lib/routes/tmtpost/util.ts +++ b/lib/routes/tmtpost/util.ts @@ -2,15 +2,12 @@ import { type Data, type DataItem } from '@/types'; import { art } from '@/utils/render'; import cache from '@/utils/cache'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { type CheerioAPI, load } from 'cheerio'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - const baseUrl: string = 'https://www.tmtpost.com'; const apiBaseUrl: string = 'https://api.tmtpost.com'; const postApiUrl: string = new URL('v1/posts/', apiBaseUrl).href; diff --git a/lib/routes/tophub/list.ts b/lib/routes/tophub/list.ts index 48eac902b..4648792f1 100644 --- a/lib/routes/tophub/list.ts +++ b/lib/routes/tophub/list.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/toutiao/user.ts b/lib/routes/toutiao/user.ts index 21c66876e..636bf7d00 100644 --- a/lib/routes/toutiao/user.ts +++ b/lib/routes/toutiao/user.ts @@ -8,11 +8,8 @@ import { Feed } from './types'; import RejectError from '@/errors/types/reject'; import { config } from '@/config'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; -const __dirname = getCurrentPath(import.meta.url); - export const route: Route = { path: '/user/token/:token', categories: ['new-media'], @@ -63,7 +60,7 @@ async function handler(ctx) { const video = item.video.play_addr_list.sort((a, b) => b.bitrate - a.bitrate)[0]; return { title: item.title, - description: art(path.join(__dirname, 'templates', 'video.art'), { + description: art(path.join(__dirname, 'templates/video.art'), { poster: item.video.origin_cover.url_list[0], url: item.video.play_addr_list.sort((a, b) => b.bitrate - a.bitrate)[0].play_url_list[0], }), diff --git a/lib/routes/tradingview/blog.ts b/lib/routes/tradingview/blog.ts index 622dd83dc..484f9a92a 100644 --- a/lib/routes/tradingview/blog.ts +++ b/lib/routes/tradingview/blog.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/transcriptforest/index.ts b/lib/routes/transcriptforest/index.ts index 144c4209e..3bf8f75d5 100644 --- a/lib/routes/transcriptforest/index.ts +++ b/lib/routes/transcriptforest/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/transformer-circuits/index.ts b/lib/routes/transformer-circuits/index.ts index ef5d2aa86..f5a40235f 100644 --- a/lib/routes/transformer-circuits/index.ts +++ b/lib/routes/transformer-circuits/index.ts @@ -5,13 +5,8 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { fileURLToPath } from 'node:url'; import logger from '@/utils/logger'; -// 为ES模块创建__dirname等价物 -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - // Define the main route path export const route: Route = { path: '/', diff --git a/lib/routes/trending/all-trending.ts b/lib/routes/trending/all-trending.ts index a6cd7b99c..8b6f5fac4 100644 --- a/lib/routes/trending/all-trending.ts +++ b/lib/routes/trending/all-trending.ts @@ -1,11 +1,9 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; +import utc from 'dayjs/plugin/utc.js'; +import timezone from 'dayjs/plugin/timezone.js'; dayjs.extend(utc); dayjs.extend(timezone); import ofetch from '@/utils/ofetch'; diff --git a/lib/routes/tribalfootball/latest.ts b/lib/routes/tribalfootball/latest.ts index 96c022e2b..1b540814f 100644 --- a/lib/routes/tribalfootball/latest.ts +++ b/lib/routes/tribalfootball/latest.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/tvb/news.ts b/lib/routes/tvb/news.ts index 6222fd42a..df834931f 100644 --- a/lib/routes/tvb/news.ts +++ b/lib/routes/tvb/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/tvtropes/featured.ts b/lib/routes/tvtropes/featured.ts index 2b30e1343..c1b4cb9de 100644 --- a/lib/routes/tvtropes/featured.ts +++ b/lib/routes/tvtropes/featured.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/twreporter/fetch-article.ts b/lib/routes/twreporter/fetch-article.ts index 28713322f..4b3779f89 100644 --- a/lib/routes/twreporter/fetch-article.ts +++ b/lib/routes/twreporter/fetch-article.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/txrjy/fornumtopic.ts b/lib/routes/txrjy/fornumtopic.ts index e4e186930..7b7c7d0d1 100644 --- a/lib/routes/txrjy/fornumtopic.ts +++ b/lib/routes/txrjy/fornumtopic.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/udn/breaking-news.ts b/lib/routes/udn/breaking-news.ts index 04a007e5f..40fff2abd 100644 --- a/lib/routes/udn/breaking-news.ts +++ b/lib/routes/udn/breaking-news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/uptimerobot/rss.ts b/lib/routes/uptimerobot/rss.ts index 65bd97d94..fdbbe11fa 100644 --- a/lib/routes/uptimerobot/rss.ts +++ b/lib/routes/uptimerobot/rss.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import Parser from 'rss-parser'; import { art } from '@/utils/render'; diff --git a/lib/routes/urbandictionary/random.ts b/lib/routes/urbandictionary/random.ts index e6ec9a48f..0a2fc1360 100644 --- a/lib/routes/urbandictionary/random.ts +++ b/lib/routes/urbandictionary/random.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/utgd/utils.ts b/lib/routes/utgd/utils.ts index 06dd1acca..36a10ea8c 100644 --- a/lib/routes/utgd/utils.ts +++ b/lib/routes/utgd/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/vcb-s/category.ts b/lib/routes/vcb-s/category.ts index c2c846362..e2cb4a955 100644 --- a/lib/routes/vcb-s/category.ts +++ b/lib/routes/vcb-s/category.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/vcb-s/index.ts b/lib/routes/vcb-s/index.ts index 9e9106305..3d638bee8 100644 --- a/lib/routes/vcb-s/index.ts +++ b/lib/routes/vcb-s/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/vice/topic.ts b/lib/routes/vice/topic.ts index 51b0f977f..9658fdfbd 100644 --- a/lib/routes/vice/topic.ts +++ b/lib/routes/vice/topic.ts @@ -4,11 +4,9 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import cache from '@/utils/cache'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { art } from '@/utils/render'; -const __dirname = getCurrentPath(import.meta.url); -const render = (data) => art(path.join(__dirname, 'templates', 'article.art'), data); +const render = (data) => art(path.join(__dirname, 'templates/article.art'), data); export const route: Route = { path: '/topic/:topic/:language?', diff --git a/lib/routes/vimeo/category.ts b/lib/routes/vimeo/category.ts index c95f098cb..6c670d351 100644 --- a/lib/routes/vimeo/category.ts +++ b/lib/routes/vimeo/category.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/vimeo/channel.ts b/lib/routes/vimeo/channel.ts index 5578c640c..79340a289 100644 --- a/lib/routes/vimeo/channel.ts +++ b/lib/routes/vimeo/channel.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/vimeo/usr-videos.ts b/lib/routes/vimeo/usr-videos.ts index 9588a6fe3..af63df62f 100644 --- a/lib/routes/vimeo/usr-videos.ts +++ b/lib/routes/vimeo/usr-videos.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/visionias/utils.ts b/lib/routes/visionias/utils.ts index e9ebec22d..731599875 100644 --- a/lib/routes/visionias/utils.ts +++ b/lib/routes/visionias/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { DataItem } from '@/types'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/wainao/topics.ts b/lib/routes/wainao/topics.ts index 00ca95b29..6f98eb69c 100644 --- a/lib/routes/wainao/topics.ts +++ b/lib/routes/wainao/topics.ts @@ -1,7 +1,6 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import { art } from '@/utils/render'; -import { getCurrentPath } from '@/utils/helpers'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; @@ -9,8 +8,6 @@ import { type CheerioAPI, load } from 'cheerio'; import { type Context } from 'hono'; import path from 'node:path'; -const __dirname = getCurrentPath(import.meta.url); - export const handler = async (ctx: Context): Promise => { const { id = 'hotspot' } = ctx.req.param(); const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); diff --git a/lib/routes/wallpaperhub/index.ts b/lib/routes/wallpaperhub/index.ts index ea7371adb..67b7c733c 100644 --- a/lib/routes/wallpaperhub/index.ts +++ b/lib/routes/wallpaperhub/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/wallstreetcn/live.ts b/lib/routes/wallstreetcn/live.ts index 6044d8f93..dcf90ec96 100644 --- a/lib/routes/wallstreetcn/live.ts +++ b/lib/routes/wallstreetcn/live.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/warthunder/news.ts b/lib/routes/warthunder/news.ts index f86794648..25f266a36 100644 --- a/lib/routes/warthunder/news.ts +++ b/lib/routes/warthunder/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import ofetch from '@/utils/ofetch'; import { load } from 'cheerio'; diff --git a/lib/routes/washingtonpost/app.ts b/lib/routes/washingtonpost/app.ts index 40f4d3de3..80fef6ec3 100644 --- a/lib/routes/washingtonpost/app.ts +++ b/lib/routes/washingtonpost/app.ts @@ -3,12 +3,11 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; import { FetchError } from 'ofetch'; import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; -import advancedFormat from 'dayjs/plugin/advancedFormat'; +import utc from 'dayjs/plugin/utc.js'; +import timezone from 'dayjs/plugin/timezone.js'; +import advancedFormat from 'dayjs/plugin/advancedFormat.js'; export const route: Route = { path: '/app/:category{.+}?', @@ -48,7 +47,6 @@ function handleDuplicates(array) { async function handler(ctx) { const category = ctx.req.param('category') ?? ''; - const __dirname = getCurrentPath(import.meta.url); const headers = { Accept: '*/*', Connection: 'keep-alive', diff --git a/lib/routes/weibo/search/hot.ts b/lib/routes/weibo/search/hot.ts index 833baa82b..5665b4838 100644 --- a/lib/routes/weibo/search/hot.ts +++ b/lib/routes/weibo/search/hot.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/wellcee/rent.ts b/lib/routes/wellcee/rent.ts index 9c092b40d..ef84849b5 100644 --- a/lib/routes/wellcee/rent.ts +++ b/lib/routes/wellcee/rent.ts @@ -8,10 +8,8 @@ import { baseUrl, getCitys, getDistricts } from './utils'; import InvalidParameterError from '@/errors/types/invalid-parameter'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); -const render = (data) => art(path.join(__dirname, 'templates', 'house.art'), data); +const render = (data) => art(path.join(__dirname, 'templates/house.art'), data); export const route: Route = { path: '/rent/:city/:district?', diff --git a/lib/routes/whu/news.ts b/lib/routes/whu/news.ts index 5830ef403..b6fa154c0 100644 --- a/lib/routes/whu/news.ts +++ b/lib/routes/whu/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/whu/util.ts b/lib/routes/whu/util.ts index 811a1ace4..4e7a3c910 100644 --- a/lib/routes/whu/util.ts +++ b/lib/routes/whu/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/winstall/update.ts b/lib/routes/winstall/update.ts index 6e370c870..2269edea5 100644 --- a/lib/routes/winstall/update.ts +++ b/lib/routes/winstall/update.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/wise/pair.ts b/lib/routes/wise/pair.ts index e5eee6a7f..628a19f63 100644 --- a/lib/routes/wise/pair.ts +++ b/lib/routes/wise/pair.ts @@ -1,12 +1,10 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; +import customParseFormat from 'dayjs/plugin/customParseFormat.js'; dayjs.extend(customParseFormat); import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/wmc-bj/publish.ts b/lib/routes/wmc-bj/publish.ts index 80f1385ea..9bf21090c 100644 --- a/lib/routes/wmc-bj/publish.ts +++ b/lib/routes/wmc-bj/publish.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/wnacg/common.ts b/lib/routes/wnacg/common.ts index 7c88e5d45..4923d1f78 100644 --- a/lib/routes/wnacg/common.ts +++ b/lib/routes/wnacg/common.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/wsj/utils.ts b/lib/routes/wsj/utils.ts index 8951df13b..4310695ba 100644 --- a/lib/routes/wsj/utils.ts +++ b/lib/routes/wsj/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import asyncPool from 'tiny-async-pool'; import { load } from 'cheerio'; diff --git a/lib/routes/x-mol/news.ts b/lib/routes/x-mol/news.ts index 6a9209573..22ec371da 100644 --- a/lib/routes/x-mol/news.ts +++ b/lib/routes/x-mol/news.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/xiaomiyoupin/crowdfunding.ts b/lib/routes/xiaomiyoupin/crowdfunding.ts index 44a3b88b1..5070b9cd9 100644 --- a/lib/routes/xiaomiyoupin/crowdfunding.ts +++ b/lib/routes/xiaomiyoupin/crowdfunding.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/xiaomiyoupin/utils.ts b/lib/routes/xiaomiyoupin/utils.ts index adba9939f..c2bf17fcd 100644 --- a/lib/routes/xiaomiyoupin/utils.ts +++ b/lib/routes/xiaomiyoupin/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/xinpianchang/util.ts b/lib/routes/xinpianchang/util.ts index 0e4936b28..79f38814d 100644 --- a/lib/routes/xinpianchang/util.ts +++ b/lib/routes/xinpianchang/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/xjtu/job.ts b/lib/routes/xjtu/job.ts index db1b3461e..b03b00229 100644 --- a/lib/routes/xjtu/job.ts +++ b/lib/routes/xjtu/job.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/xjtu/std.ts b/lib/routes/xjtu/std.ts index 780277af3..21a35fef3 100644 --- a/lib/routes/xjtu/std.ts +++ b/lib/routes/xjtu/std.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/xkb/index.ts b/lib/routes/xkb/index.ts index 67ac526a3..c5581e9e8 100644 --- a/lib/routes/xkb/index.ts +++ b/lib/routes/xkb/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/xueqiu/stock-comments.ts b/lib/routes/xueqiu/stock-comments.ts index 401eca00e..b05155f0f 100644 --- a/lib/routes/xueqiu/stock-comments.ts +++ b/lib/routes/xueqiu/stock-comments.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/xys/new.ts b/lib/routes/xys/new.ts index 45c49d51c..3927f1772 100644 --- a/lib/routes/xys/new.ts +++ b/lib/routes/xys/new.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/xyzrank/index.ts b/lib/routes/xyzrank/index.ts index 0f6e0e706..2fd81bc4c 100644 --- a/lib/routes/xyzrank/index.ts +++ b/lib/routes/xyzrank/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/yahoo/news/utils.ts b/lib/routes/yahoo/news/utils.ts index 760f8ee3d..61955e9d7 100644 --- a/lib/routes/yahoo/news/utils.ts +++ b/lib/routes/yahoo/news/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/ycwb/index.ts b/lib/routes/ycwb/index.ts index d0d639fa2..09614c360 100644 --- a/lib/routes/ycwb/index.ts +++ b/lib/routes/ycwb/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/yenpress/series.ts b/lib/routes/yenpress/series.ts index e953ac205..c8c26ed6b 100644 --- a/lib/routes/yenpress/series.ts +++ b/lib/routes/yenpress/series.ts @@ -8,11 +8,8 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import path from 'node:path'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - -const render = (data) => art(path.join(__dirname, 'templates', 'series.art'), data); +const render = (data) => art(path.join(__dirname, 'templates/series.art'), data); export const route: Route = { path: '/series/:name', diff --git a/lib/routes/yicai/dt.ts b/lib/routes/yicai/dt.ts index a43e189df..de4b4dda5 100644 --- a/lib/routes/yicai/dt.ts +++ b/lib/routes/yicai/dt.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/yicai/utils.ts b/lib/routes/yicai/utils.ts index d1f58a7be..b74e85e22 100644 --- a/lib/routes/yicai/utils.ts +++ b/lib/routes/yicai/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/ymgal/game.ts b/lib/routes/ymgal/game.ts index 80df068ba..3ca4e4030 100644 --- a/lib/routes/ymgal/game.ts +++ b/lib/routes/ymgal/game.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/yoasobi-music/info.ts b/lib/routes/yoasobi-music/info.ts index 938b9e9d5..8e9d6e499 100644 --- a/lib/routes/yoasobi-music/info.ts +++ b/lib/routes/yoasobi-music/info.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/yoasobi-music/live.ts b/lib/routes/yoasobi-music/live.ts index 0555b451f..184f3a2ac 100644 --- a/lib/routes/yoasobi-music/live.ts +++ b/lib/routes/yoasobi-music/live.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseJSONP } from './jsonp-helper'; diff --git a/lib/routes/yoasobi-music/media.ts b/lib/routes/yoasobi-music/media.ts index 15c907913..99e71e833 100644 --- a/lib/routes/yoasobi-music/media.ts +++ b/lib/routes/yoasobi-music/media.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseJSONP } from './jsonp-helper'; diff --git a/lib/routes/youku/channel.ts b/lib/routes/youku/channel.ts index 6a21efe63..dfb9b7a38 100644 --- a/lib/routes/youku/channel.ts +++ b/lib/routes/youku/channel.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/youtube/community.ts b/lib/routes/youtube/community.ts index 78e372948..6fbebed82 100644 --- a/lib/routes/youtube/community.ts +++ b/lib/routes/youtube/community.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; @@ -51,7 +49,7 @@ async function handler(ctx) { const media = post.backstageAttachment?.postMultiImageRenderer?.images.map((i) => i.backstageImageRenderer.image.thumbnails.pop()) ?? [post.backstageAttachment?.backstageImageRenderer?.image.thumbnails.pop()]; return { title: post.contentText.runs[0].text, - description: art(path.join(__dirname, 'templates', 'community.art'), { + description: art(path.join(__dirname, 'templates/community.art'), { runs: post.contentText.runs, media, }), diff --git a/lib/routes/youtube/utils.ts b/lib/routes/youtube/utils.ts index d04c2af12..61872eeab 100644 --- a/lib/routes/youtube/utils.ts +++ b/lib/routes/youtube/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { google } from 'googleapis'; const { OAuth2 } = google.auth; import { art } from '@/utils/render'; diff --git a/lib/routes/yxdzqb/index.ts b/lib/routes/yxdzqb/index.ts index 42bdbacfd..e2c4c4c92 100644 --- a/lib/routes/yxdzqb/index.ts +++ b/lib/routes/yxdzqb/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/zagg/new-arrivals.ts b/lib/routes/zagg/new-arrivals.ts index 2e179f652..e14d6a4c5 100644 --- a/lib/routes/zagg/new-arrivals.ts +++ b/lib/routes/zagg/new-arrivals.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/zaobao/util.ts b/lib/routes/zaobao/util.ts index bbb0fb653..c18182678 100644 --- a/lib/routes/zaobao/util.ts +++ b/lib/routes/zaobao/util.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/zcool/discover.ts b/lib/routes/zcool/discover.ts index 6e4c653a3..7e176989f 100644 --- a/lib/routes/zcool/discover.ts +++ b/lib/routes/zcool/discover.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/zcool/utils.ts b/lib/routes/zcool/utils.ts index f9ed05419..a4ed7ec1a 100644 --- a/lib/routes/zcool/utils.ts +++ b/lib/routes/zcool/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; diff --git a/lib/routes/zhitongcaijing/index.ts b/lib/routes/zhitongcaijing/index.ts index b9d0e30d8..53897a344 100644 --- a/lib/routes/zhitongcaijing/index.ts +++ b/lib/routes/zhitongcaijing/index.ts @@ -1,6 +1,4 @@ import { Route, ViewType } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/zhiy/post.ts b/lib/routes/zhiy/post.ts index 949722646..25888e59e 100644 --- a/lib/routes/zhiy/post.ts +++ b/lib/routes/zhiy/post.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/zhonglun/index.ts b/lib/routes/zhonglun/index.ts index 5e62a39e5..960c6184b 100644 --- a/lib/routes/zhonglun/index.ts +++ b/lib/routes/zhonglun/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/zhubai/top20.ts b/lib/routes/zhubai/top20.ts index 275d36c96..8aff6dc2a 100644 --- a/lib/routes/zhubai/top20.ts +++ b/lib/routes/zhubai/top20.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/zodgame/forum.ts b/lib/routes/zodgame/forum.ts index 4a49c3370..eceec172a 100644 --- a/lib/routes/zodgame/forum.ts +++ b/lib/routes/zodgame/forum.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; diff --git a/lib/routes/zuvio/utils.ts b/lib/routes/zuvio/utils.ts index 86634e1bb..2644ae8c5 100644 --- a/lib/routes/zuvio/utils.ts +++ b/lib/routes/zuvio/utils.ts @@ -1,6 +1,3 @@ -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - import { art } from '@/utils/render'; import path from 'node:path'; import got from '@/utils/got'; diff --git a/lib/routes/zyshow/index.ts b/lib/routes/zyshow/index.ts index a6a840cae..01748bc5c 100644 --- a/lib/routes/zyshow/index.ts +++ b/lib/routes/zyshow/index.ts @@ -1,6 +1,4 @@ import { Route } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); import { getSubPath } from '@/utils/common-utils'; import got from '@/utils/got'; diff --git a/lib/utils/parse-date.ts b/lib/utils/parse-date.ts index 98b28143f..4bc2d2d6c 100644 --- a/lib/utils/parse-date.ts +++ b/lib/utils/parse-date.ts @@ -1,8 +1,8 @@ import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; -import duration from 'dayjs/plugin/duration'; -import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; -import weekday from 'dayjs/plugin/weekday'; +import customParseFormat from 'dayjs/plugin/customParseFormat.js'; +import duration from 'dayjs/plugin/duration.js'; +import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; +import weekday from 'dayjs/plugin/weekday.js'; dayjs.extend(customParseFormat); dayjs.extend(duration); diff --git a/package.json b/package.json index f8f65f618..0c8db1fc7 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lib" ], "scripts": { - "build": "tsx scripts/workflow/build-routes.ts", + "build": "tsx scripts/workflow/build-routes.ts && tsdown", "build:docs": "tsx scripts/workflow/build-docs.ts", "dev": "cross-env NODE_ENV=dev tsx watch --inspect --clear-screen=false lib/index.ts", "dev:cache": "cross-env NODE_ENV=production tsx watch --clear-screen=false lib/index.ts", @@ -31,7 +31,7 @@ "lint": "eslint --cache .", "prepare": "husky || true", "profiling": "cross-env NODE_ENV=production tsx --prof lib/index.ts", - "start": "cross-env NODE_ENV=production tsx lib/index.ts", + "start": "cross-env NODE_ENV=production node dist/index.js", "test": "npm run format:check && npm run vitest:coverage", "vitest": "cross-env NODE_ENV=test vitest", "vitest:coverage": "cross-env NODE_ENV=test vitest --coverage.enabled --reporter=junit", @@ -186,12 +186,14 @@ "husky": "9.1.7", "js-beautify": "1.15.4", "lint-staged": "15.5.1", + "magic-string": "0.30.17", "mockdate": "3.0.5", "msw": "2.4.3", "node-network-devtools": "1.0.25", "prettier": "3.5.3", "remark-parse": "11.0.0", "supertest": "7.1.0", + "tsdown": "0.9.2", "typescript": "5.8.3", "unified": "11.0.5", "vite-tsconfig-paths": "5.1.4", @@ -211,6 +213,7 @@ "msw", "protobufjs", "puppeteer", + "rolldown", "utf-8-validate", "vue-demi" ], diff --git a/plugins/rollup-plugin-art-templates.ts b/plugins/rollup-plugin-art-templates.ts new file mode 100644 index 000000000..3b9eed9d5 --- /dev/null +++ b/plugins/rollup-plugin-art-templates.ts @@ -0,0 +1,83 @@ +// rollup-plugin-art-templates.js +import fs from 'node:fs'; +import path from 'node:path'; +import { createHash } from 'node:crypto'; +import MagicString from 'magic-string'; + +/** + * @param {object} [opts] + * @param {string} [opts.outputDir='templates'] Sub‑folder inside your Rollup output where the + * cloned templates will live (e.g. dist/templates) + */ +export default function artTemplatesPlugin(opts = {}) { + const templatesDir = opts.outputDir || 'templates'; + /** Map */ + const emitted = new Map(); + + return { + name: 'art-template-assets', + + /** + * Scan every JS/TS file for `path.join(...'.art'...)` + * and rewrite it on the fly. + */ + transform(code, id) { + // Skip dependencies + if (id.includes('node_modules')) { + return null; + } + + // Quick pre‑check – bail fast for files with no “.art” + if (!code.includes('.art')) { + return null; + } + + const callRe = /path\.(join|resolve)\s*\(([^)]+)\)/g; // whole call + const strRe = /['"]([^'"]+\.art)['"]/g; // individual string literals + + let match, + mString = null; + + while ((match = callRe.exec(code))) { + const callSrc = match[0]; + + // Extract the **last** '.art' string literal in this call + let strMatch, + relPath = null; + while ((strMatch = strRe.exec(callSrc))) { + relPath = strMatch[1]; + } + if (!relPath) { + continue; + } // nothing to do + + // Resolve & hash the template file + const absPath = path.resolve(path.dirname(id), relPath); + const buf = fs.readFileSync(absPath); + const hash = createHash('sha256').update(buf).digest('hex').slice(0, 8); + const newName = `${path.basename(relPath, '.art')}-${hash}.art`; + const fileName = `${templatesDir}/${newName}`; + + // Emit only once per unique file + if (!emitted.has(absPath)) { + const refId = this.emitFile({ type: 'asset', name: newName, fileName, source: buf }); + emitted.set(absPath, { newName, fileName, refId }); + } + + // Replace the original string inside the call + const replacedCall = callSrc.replaceAll(strRe, `'${templatesDir}/${newName}'`); + mString ||= new MagicString(code); + mString.overwrite(match.index, match.index + callSrc.length, replacedCall); + } + + if (mString) { + return { + code: mString.toString(), + map: mString.generateMap({ hires: true }), + }; + } + + return null; // untouched + }, + }; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1998f3c19..e8cf946f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -299,7 +299,7 @@ importers: version: 3.1.0 '@stylistic/eslint-plugin': specifier: 4.2.0 - version: 4.2.0(eslint@9.25.0)(typescript@5.8.3) + version: 4.2.0(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) '@types/aes-js': specifier: 3.1.4 version: 3.1.4 @@ -368,10 +368,10 @@ importers: version: 10.0.0 '@typescript-eslint/eslint-plugin': specifier: 8.30.1 - version: 8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.25.0)(typescript@5.8.3))(eslint@9.25.0)(typescript@5.8.3) + version: 8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) '@typescript-eslint/parser': specifier: 8.30.1 - version: 8.30.1(eslint@9.25.0)(typescript@5.8.3) + version: 8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) '@vercel/nft': specifier: 0.29.2 version: 0.29.2(rollup@4.37.0) @@ -383,25 +383,25 @@ importers: version: 0.37.120 eslint: specifier: 9.25.0 - version: 9.25.0 + version: 9.25.0(jiti@2.4.2) eslint-config-prettier: specifier: 10.1.2 - version: 10.1.2(eslint@9.25.0) + version: 10.1.2(eslint@9.25.0(jiti@2.4.2)) eslint-nibble: specifier: 8.1.0 - version: 8.1.0(eslint@9.25.0) + version: 8.1.0(eslint@9.25.0(jiti@2.4.2)) eslint-plugin-n: specifier: 17.17.0 - version: 17.17.0(eslint@9.25.0) + version: 17.17.0(eslint@9.25.0(jiti@2.4.2)) eslint-plugin-prettier: specifier: 5.2.6 - version: 5.2.6(@types/eslint@9.6.1)(eslint-config-prettier@10.1.2(eslint@9.25.0))(eslint@9.25.0)(prettier@3.5.3) + version: 5.2.6(@types/eslint@9.6.1)(eslint-config-prettier@10.1.2(eslint@9.25.0(jiti@2.4.2)))(eslint@9.25.0(jiti@2.4.2))(prettier@3.5.3) eslint-plugin-unicorn: specifier: 58.0.0 - version: 58.0.0(eslint@9.25.0) + version: 58.0.0(eslint@9.25.0(jiti@2.4.2)) eslint-plugin-yml: specifier: 1.17.0 - version: 1.17.0(eslint@9.25.0) + version: 1.17.0(eslint@9.25.0(jiti@2.4.2)) fs-extra: specifier: 11.3.0 version: 11.3.0 @@ -420,6 +420,9 @@ importers: lint-staged: specifier: 15.5.1 version: 15.5.1 + magic-string: + specifier: 0.30.17 + version: 0.30.17 mockdate: specifier: 3.0.5 version: 3.0.5 @@ -438,6 +441,9 @@ importers: supertest: specifier: 7.1.0 version: 7.1.0 + tsdown: + specifier: 0.9.2 + version: 0.9.2(typescript@5.8.3) typescript: specifier: 5.8.3 version: 5.8.3 @@ -1059,6 +1065,15 @@ packages: '@dabh/diagnostics@2.0.3': resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} + '@emnapi/core@1.4.3': + resolution: {integrity: sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==} + + '@emnapi/runtime@1.4.3': + resolution: {integrity: sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==} + + '@emnapi/wasi-threads@1.0.2': + resolution: {integrity: sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==} + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -1353,8 +1368,8 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/eslint-utils@4.6.1': - resolution: {integrity: sha512-KTsJMmobmbrFLe3LDh0PC2FXpcSYJt/MLjlkh/9LEnmKYLSYmT/0EW9JWANjeoemiuZrmogti0tW5Ch+qNUYDw==} + '@eslint-community/eslint-utils@4.6.0': + resolution: {integrity: sha512-WhCn7Z7TauhBtmzhvKpoQs0Wwb/kBcy4CwpuI0/eEIr2Lx2auxmulAzLr91wVZJaz47iUZdkXOK7WlAfxGKCnA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 @@ -1543,6 +1558,9 @@ packages: resolution: {integrity: sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw==} engines: {node: '>=18'} + '@napi-rs/wasm-runtime@0.2.9': + resolution: {integrity: sha512-OKRBiajrrxB9ATokgEQoG87Z25c67pCpYcCwmXYX8PBftC9pBfN18gnm/fh1wurSLEKIAt+QRFLFCQISrb66Jg==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1858,6 +1876,195 @@ packages: '@otplib/preset-v11@12.0.1': resolution: {integrity: sha512-9hSetMI7ECqbFiKICrNa4w70deTUfArtwXykPUvSHWOdzOlfa9ajglu7mNCntlvxycTiOAXkQGwjQCzzDEMRMg==} + '@oxc-parser/binding-darwin-arm64@0.65.0': + resolution: {integrity: sha512-bML5ABR5XLYOF/xtIQLVWhus7j+e00DOUZ5enFVDlYlrCD3n72/FTrSodJGuLXRvqQvsZL42zSe5wWsWCAjGzw==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [darwin] + + '@oxc-parser/binding-darwin-x64@0.65.0': + resolution: {integrity: sha512-k6DNe28LjHTem8gjxjMoPye5gTGQQWzQG4oiyiq9qYMhnmAzGFN5m05kymPl3qi2wp0rbwUeWBJglcU9O3AROA==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [darwin] + + '@oxc-parser/binding-linux-arm-gnueabihf@0.65.0': + resolution: {integrity: sha512-VN63Gs/MEdsZ6LZ8vDjp/JY+3i557a/AFny1+z+NWUXSRhrnfsM3OWZBiKcjcKp9kauvDurVlGpAZjYiYKfcTg==} + engines: {node: '>=14.0.0'} + cpu: [arm] + os: [linux] + + '@oxc-parser/binding-linux-arm64-gnu@0.65.0': + resolution: {integrity: sha512-cAs9OGhnRb/bzulGK3BdgNcgOeAQa2lXT42zNgtnysTO9lZnxqNMnvWaCwFCC4tL0YA7lfxn1Uf2rSEvysyP1A==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [linux] + + '@oxc-parser/binding-linux-arm64-musl@0.65.0': + resolution: {integrity: sha512-3Rdg11QOir3YH9f3J0Ydo8zRWqmVAvrkAiIc/chRvozOZA+ajXP8fenfMOyuVks6SHvFvkyXnZWqEmhZ5TkfwA==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [linux] + + '@oxc-parser/binding-linux-x64-gnu@0.65.0': + resolution: {integrity: sha512-eZPtnxBZBe+5wsU3KMHTAnuqwYTIaS+bOX7c0FQZYZBUh00EoAzlgZKiwL2gKuDdTNJ3YEUB735UWs6B7I66uQ==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [linux] + + '@oxc-parser/binding-linux-x64-musl@0.65.0': + resolution: {integrity: sha512-hTsQRUqnbXYTUg+yMfiQ/jMokAW9AtR1jyibrodF4bdF3dYyRJzGpMaLs9TOfHIjWM5xRykZ2br0ajBfgNeZuw==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [linux] + + '@oxc-parser/binding-wasm32-wasi@0.65.0': + resolution: {integrity: sha512-V9WvM3iwgqohuGnNb01+agI+5TbpexZ55hpXfxl6YKhdjnGkCbV2c0qtaAw18enrjRsU0QeDqZ6SBPfjE0pi5g==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@oxc-parser/binding-win32-arm64-msvc@0.65.0': + resolution: {integrity: sha512-Q0GvYjgFOYliEvWkr4FjBtERuXSiv0DwLtv8CtKfMIbLWzzzBSvQBx60PVD8BcZDvZBkTgomaijZ+wHcH2tjaQ==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [win32] + + '@oxc-parser/binding-win32-x64-msvc@0.65.0': + resolution: {integrity: sha512-ymVMrxcsNxj8FNkuizoIwl49r5cv3Rmhvw3G3rOi/WqdlZdHi+nZ1PBYaf4rPPHwpijmIY+XnAs0dy1+ynAWtA==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.64.0': + resolution: {integrity: sha512-B0dxuEZFV6M4tXjPFwDSaED5/J55YUhODBaF09xNFNRrEyzQLKZuhKXAw1xYK8bO4K8Jn1d21TZfei3kAIE8dA==} + + '@oxc-project/types@0.65.0': + resolution: {integrity: sha512-7MpMzyXCcwxrTxJ4L0siy63Ds/LA8LAM4szumTFiynxTJkfrIZEV4PyR4Th0CqFZQ+oNi8WvW3Dr1MLy7o9qPQ==} + + '@oxc-resolver/binding-darwin-arm64@5.3.0': + resolution: {integrity: sha512-hXem5ZAguS7IlSiHg/LK0tEfLj4eUo+9U6DaFwwBEGd0L0VIF9LmuiHydRyOrdnnmi9iAAFMAn/wl2cUoiuruA==} + cpu: [arm64] + os: [darwin] + + '@oxc-resolver/binding-darwin-x64@5.3.0': + resolution: {integrity: sha512-wgSwfsZkRbuYCIBLxeg1bYrtKnirAy+IJF0lwfz4z08clgdNBDbfGECJe/cd0csIZPpRcvPFe8317yf31sWhtA==} + cpu: [x64] + os: [darwin] + + '@oxc-resolver/binding-freebsd-x64@5.3.0': + resolution: {integrity: sha512-kzeE2WHgcRMmWjB071RdwEV5Pwke4o0WWslCKoh8if1puvxIxfzu3o7g6P2+v77BP5qop4cri+uvLABSO0WZjg==} + cpu: [x64] + os: [freebsd] + + '@oxc-resolver/binding-linux-arm-gnueabihf@5.3.0': + resolution: {integrity: sha512-I8np34yZP/XfIkZNDbw3rweqVgfjmHYpNX3xnJZWg+f4mgO9/UNWBwetSaqXeDZqvIch/aHak+q4HVrQhQKCqg==} + cpu: [arm] + os: [linux] + + '@oxc-resolver/binding-linux-arm64-gnu@5.3.0': + resolution: {integrity: sha512-u2ndfeEUrW898eXM+qPxIN8TvTPjI90NDQBRgaxxkOfNw3xaotloeiZGz5+Yzlfxgvxr9DY9FdYkqhUhSnGhOw==} + cpu: [arm64] + os: [linux] + + '@oxc-resolver/binding-linux-arm64-musl@5.3.0': + resolution: {integrity: sha512-TzbjmFkcnESGuVItQ2diKacX8vu5G0bH3BHmIlmY4OSRLyoAlrJFwGKAHmh6C9+Amfcjo2rx8vdm7swzmsGC6Q==} + cpu: [arm64] + os: [linux] + + '@oxc-resolver/binding-linux-riscv64-gnu@5.3.0': + resolution: {integrity: sha512-NH3pjAqh8nuN29iRuRfTY42Vn03ctoR9VE8llfoUKUfhHUjFHYOXK5VSkhjj1usG8AeuesvqrQnLptCRQVTi/Q==} + cpu: [riscv64] + os: [linux] + + '@oxc-resolver/binding-linux-s390x-gnu@5.3.0': + resolution: {integrity: sha512-tuZtkK9sJYh2MC2uhol1M/8IMTB6ZQ5jmqP2+k5XNXnOb/im94Y5uV/u2lXwVyIuKHZZHtr+0d1HrOiNahoKpw==} + cpu: [s390x] + os: [linux] + + '@oxc-resolver/binding-linux-x64-gnu@5.3.0': + resolution: {integrity: sha512-VzhPYmZCtoES/ThcPdGSmMop7JlwgqtSvlgtKCW15ByV2JKyl8kHAHnPSBfpIooXb0ehFnRdxFtL9qtAEWy01g==} + cpu: [x64] + os: [linux] + + '@oxc-resolver/binding-linux-x64-musl@5.3.0': + resolution: {integrity: sha512-Hi39cWzul24rGljN4Vf1lxjXzQdCrdxO5oCT7KJP4ndSlqIUODJnfnMAP1YhcnIRvNvk+5E6sZtnEmFUd/4d8Q==} + cpu: [x64] + os: [linux] + + '@oxc-resolver/binding-wasm32-wasi@5.3.0': + resolution: {integrity: sha512-ddujvHhP3chmHnSXRlkPVUeYj4/B7eLZwL4yUid+df3WCbVh6DgoT9RmllZn21AhxgKtMdekDdyVJYKFd8tl4A==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@oxc-resolver/binding-win32-arm64-msvc@5.3.0': + resolution: {integrity: sha512-j1YYPLvUkMVNKmIFQZZJ7q6Do4cI3htUnyxNLwDSBVhSohvPIK2VG+IdtOAlWZGa7v+phEZsHfNbXVwB0oPYFQ==} + cpu: [arm64] + os: [win32] + + '@oxc-resolver/binding-win32-x64-msvc@5.3.0': + resolution: {integrity: sha512-LT9eOPPUqfZscQRd5mc08RBeDWOQf+dnOrKnanMallTGPe6g7+rcAlFTA8SWoJbcD45PV8yArFtCmSQSpzHZmg==} + cpu: [x64] + os: [win32] + + '@oxc-transform/binding-darwin-arm64@0.65.0': + resolution: {integrity: sha512-hHfhOKyH+8DOj0VUmWl6RPLy3F0jCMCUMuKICzfelvSEs5uu8YRJ7fmQSsQD9E0oTrbbdkNVjq/1mcAPHzIBsg==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [darwin] + + '@oxc-transform/binding-darwin-x64@0.65.0': + resolution: {integrity: sha512-MNeaCPBVB1oOdb4kMZnKej8kSoxqf4XqAfFIKgx2mV1gJnW3PfwAbpqhad+XH3QM49dB++Gyaw7SPNwQLpL3YQ==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [darwin] + + '@oxc-transform/binding-linux-arm-gnueabihf@0.65.0': + resolution: {integrity: sha512-YpmBf4AhtAdsLV7XYY9/UxVmgewumgVlNVcPXXXAQ5shMEYhu2K/fCvlWBFe6vYNXFmXAAnDihOjLrq8n+NhnA==} + engines: {node: '>=14.0.0'} + cpu: [arm] + os: [linux] + + '@oxc-transform/binding-linux-arm64-gnu@0.65.0': + resolution: {integrity: sha512-HbGl1QBvxCBVfRJdrcZliOsvjeoyMJQn6UUbYzQR8ud7SY2Ozp0Qf5VG0yjXvt/9BPcmOYMIxVCeKqSSkQ74XA==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [linux] + + '@oxc-transform/binding-linux-arm64-musl@0.65.0': + resolution: {integrity: sha512-80gSeSVY9fm+xoLBkTYdJT2RYCqMy/NAqT6azQoJj3DczoNKU/4GV4F6jpINRWYUqIUAZt3RSvAQtdW3tWAjfw==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [linux] + + '@oxc-transform/binding-linux-x64-gnu@0.65.0': + resolution: {integrity: sha512-Wsl+qLcaC3EeZT/ZjPuGTOtcHYu25HeEO1jCnZmIhFfz+1RWmaEK5P5xVVJbrAgNPMVOfqbUM0EwMCfvNmmPaQ==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [linux] + + '@oxc-transform/binding-linux-x64-musl@0.65.0': + resolution: {integrity: sha512-0kvRnt7EsKeGxxyt90l7yotSH5Ik5G9fbFJxkDCzPT23FzIQC8U4O1GzqNxnSj8VT/lRJGKcCL6KfSa6ttzQRQ==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [linux] + + '@oxc-transform/binding-wasm32-wasi@0.65.0': + resolution: {integrity: sha512-gKfpf5BY28Cq0scUV//oBlzXg+XFbi2tKpKDqE/ee4Z0ySeDQ66pwBUp3nnEG7EsVZjKhE8yksPN4YOCoZhG9g==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@oxc-transform/binding-win32-arm64-msvc@0.65.0': + resolution: {integrity: sha512-InHZNcL6hB2QLaiw3KNe+Aqnk+FRt4vuVmDXUibZ0fZSQorcFw/T267PtVVuWIzFNa6CQPU4ie0rxIdP0sHcFg==} + engines: {node: '>=14.0.0'} + cpu: [arm64] + os: [win32] + + '@oxc-transform/binding-win32-x64-msvc@0.65.0': + resolution: {integrity: sha512-qvLEPowed0OcSEgztGXw1QF53KhLYYYWGxOK2H+9PSXpkNcYaeUQ1XOngR9kO8yIhpBt1/EOrVFeNK8biy0c7g==} + engines: {node: '>=14.0.0'} + cpu: [x64] + os: [win32] + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1930,6 +2137,70 @@ packages: engines: {node: '>=18'} hasBin: true + '@quansync/fs@0.1.2': + resolution: {integrity: sha512-ezIadUb1aFhwJLd++WVqVpi9rnlX8vnd4ju7saPhwLHJN1mJgOv0puePTGV+FbtSnWtwoHDT8lAm4kagDZmpCg==} + engines: {node: '>=20.0.0'} + + '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-xPPvKH8KNHdFF0yJ7oiUBCbypO7kFHjRMZGO463bLG/BrnOAXSTSYxVrRLrR3RzEw7tNfp6Sd5bLLD0vb+tboQ==} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-66ogat51jFTRLuz0gHx5Idfl+O7XX400iTZJWVBqdyBLccDLODqhuFGyzGHA6L5O1iE/fktUr7eEGSXfkl8vhg==} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-i3n2fXT31WyyJjN7uKbYeBLBBUZl1G9LXINlM7+93kI+4BnqITNNtxZwFrlj87jkrQSvfamfYFrXYb7VP/kIxw==} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-OA6OsIUCRWXuMvD6Y8+ffRXcgYmqbPWoiKhCy28/SzxudPpNE77UbTXt1kL68+5XSJD1cmTujN3OlBN8yoRaXw==} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-Bzfq2bdUb24KvVvke/TS001RAn0Mg6zmvHQTaPaNQw+r2NuX9VsNfttoKcyYv9TMBrzZbgp1uNABClQeOoQ+uA==} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-2fUL+BQas1tXX70hp/a3usMpI7Dm/VsCevU9iSxuJ2tygM/xv2+AEHwUJMZti3rrQSFEKw5QsSC2fphk4NU9bQ==} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-vXMaxGcHudEG/WJyBey85cmmo2LO/KE7WhidU92/2mN7EQiv5dbimm+s7Q4Qa8OJ5YU1/geU329m4gI3CRFO1g==} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-aLmF2zHrG/yEfH6spsVBYnwnGiUWcaoBp9mzq4r2yXWnJ6YSXB5CSn6Abk/NsyQ15Wdsx5PNCUMchk03AiFa+w==} + cpu: [x64] + os: [linux] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-Y/8aOps6v3ecLqV5GlpCb4RfaKhMBKG2alWJEH+2tP63IspFI17fWK6Q7Xa2ebPmxIAALa2ZtIgyH1SKnI0d9Q==} + engines: {node: '>=14.21.3'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-syFlEaxhCcsbRnN7Z893OKZbItQUT4XSx4bSEQ6idgMVKGATx0JlHPnKdsO8SRFLZgDgOwQr3koeJO1eGYR0Cw==} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-+F0YfnIeeVgHmkZg1mEqJKRVTz1f8/mYNg0RyiBm1UfsKjLNFatiG+tZRJU1GKxtIJeQzcwggBaqP9mY+k3uQA==} + cpu: [ia32] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.c2596d3': + resolution: {integrity: sha512-vl9SiHViixGsreAF5j/B9fDlB02UseGUCrfPXU7hMJgd/xWCZJ3VhRS5X49udacx7sGtOdH20hjr6lVSXDfyIg==} + cpu: [x64] + os: [win32] + '@rollup/pluginutils@5.1.4': resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} engines: {node: '>=14.0.0'} @@ -2116,6 +2387,9 @@ packages: '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} + '@tybys/wasm-util@0.9.0': + resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} + '@types/aes-js@3.1.4': resolution: {integrity: sha512-v3D66IptpUqh+pHKVNRxY8yvp2ESSZXe0rTzsGdzUhEwag7ljVfgCllkWv2YgiYXDhWFBrEywll4A5JToyTNFA==} @@ -2362,6 +2636,11 @@ packages: '@unhead/schema@1.11.20': resolution: {integrity: sha512-0zWykKAaJdm+/Y7yi/Yds20PrUK7XabLe9c3IRcjnwYmSWY6z0Cr19VIs3ozCj8P+GhR+/TI2mwtGlueCEYouA==} + '@valibot/to-json-schema@1.0.0': + resolution: {integrity: sha512-/9crJgPptVsGCL6X+JPDQyaJwkalSZ/52WuF8DiRUxJgcmpNdzYRfZ+gqMEP8W3CTVfuMWPqqvIgfwJ97f9Etw==} + peerDependencies: + valibot: ^1.0.0 + '@vercel/nft@0.29.2': resolution: {integrity: sha512-A/Si4mrTkQqJ6EXJKv5EYCDQ3NL6nJXxG8VGXePsaiQigsomHYQC9xSpX8qGk7AEZk4b1ssbYIqJ0ISQQ7bfcA==} engines: {node: '>=18'} @@ -2483,6 +2762,10 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + ansis@3.17.0: + resolution: {integrity: sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==} + engines: {node: '>=14'} + arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -2736,6 +3019,10 @@ packages: resolution: {integrity: sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==} engines: {node: '>=18.17'} + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} + chownr@3.0.0: resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} engines: {node: '>=18'} @@ -3024,6 +3311,9 @@ packages: resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} engines: {node: '>=8'} + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + degenerator@5.0.1: resolution: {integrity: sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==} engines: {node: '>= 14'} @@ -3056,6 +3346,10 @@ packages: dezalgo@1.0.4: resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==} + diff@7.0.0: + resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==} + engines: {node: '>=0.3.1'} + difflib@https://codeload.github.com/postlight/difflib.js/tar.gz/32e8e38c7fcd935241b9baab71bb432fd9b166ed: resolution: {tarball: https://codeload.github.com/postlight/difflib.js/tar.gz/32e8e38c7fcd935241b9baab71bb432fd9b166ed} version: 0.2.6 @@ -3117,6 +3411,10 @@ packages: resolution: {integrity: sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==} engines: {node: '>=6'} + dts-resolver@1.0.0: + resolution: {integrity: sha512-BTW78HXK66TvRHBRkU91a7CGoD5/PWi8ovMXbKVHjhR5xCqt1dgwl6CVk3wxWLzhNVIGXDbGWPBlRKrgSHMzfw==} + engines: {node: '>=20.18.0'} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -3459,6 +3757,14 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + fdir@6.4.4: + resolution: {integrity: sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fecha@4.2.3: resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} @@ -4045,6 +4351,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jiti@2.4.2: + resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} + hasBin: true + js-beautify@1.15.4: resolution: {integrity: sha512-9/KXeZUKKJwqCXUdBxFJ3vPh467OCckSBmYDwSK/EtV090K+iMJ7zx2S3HLVDIWFQdqMIsZWbnaGiba18aWhaA==} engines: {node: '>=14'} @@ -4309,6 +4619,10 @@ packages: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true + magic-string-ast@0.9.1: + resolution: {integrity: sha512-18dv2ZlSSgJ/jDWlZGKfnDJx56ilNlYq9F7NnwuWTErsmYmqJ2TWE4l1o2zlUHBYUGBy3tIhPCC1gxq8M5HkMA==} + engines: {node: '>=20.18.0'} + magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} @@ -4715,6 +5029,17 @@ packages: outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} + oxc-parser@0.65.0: + resolution: {integrity: sha512-2u3iUChO386K2sBBxTPCKweoJfbo4qLGfOJN964yEg6KmHadp4daWklhS56UUaHT2Qj057brG/G7WuyIP10lUg==} + engines: {node: '>=14.0.0'} + + oxc-resolver@5.3.0: + resolution: {integrity: sha512-FHqtZx0idP5QRPSNcI5g2ItmADg7fhR3XIeWg5eRMGfp44xqRpfkdvo+EX4ZceqV9bxvl0Z8vaqMqY0gYaNYNA==} + + oxc-transform@0.65.0: + resolution: {integrity: sha512-TWAMi8zVvORQw545O1/1irpbMPDQGD6ernen5QyY5PCL9nj3RqgR1ULlQiHVDXEl2rW+OtHF8KS0ItAUyOfQ+Q==} + engines: {node: '>=14.0.0'} + p-cancelable@3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} @@ -4807,6 +5132,9 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + pathval@2.0.0: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} @@ -5022,6 +5350,9 @@ packages: resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} engines: {node: '>=0.6'} + quansync@0.2.10: + resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==} + query-string@7.1.3: resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} engines: {node: '>=6'} @@ -5061,6 +5392,10 @@ packages: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + real-cancellable-promise@1.2.1: resolution: {integrity: sha512-JwhiWJTMMyzFYfpKsiSb8CyQktCi1MZ8ZBn3wXvq28qXDh8Y5dM7RYzgW3r6SV22JTEcof8pRsvDp4GxLmGIxg==} @@ -5197,6 +5532,25 @@ packages: resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==} hasBin: true + rolldown-plugin-dts@0.8.3: + resolution: {integrity: sha512-gxRerZlmo+Rii6k4CeMYdSSvypdx/VJHf7bLnw/6IwbflNkjxRYq4dHYntCuYpdG6Si2n8xJGqnhE+Hh8I1DPQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + rolldown: ^1.0.0-beta.7 + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + rolldown@1.0.0-beta.7-commit.c2596d3: + resolution: {integrity: sha512-FFjtajrWaIDa9hM+gCSF58ys3scTuMxRNhzwhb6ADGBFzfFARjXOIj+1sPIcN/dTgPkYDjfuWAtIVQxDWTA7hg==} + hasBin: true + peerDependencies: + '@oxc-project/runtime': 0.64.0 + peerDependenciesMeta: + '@oxc-project/runtime': + optional: true + rollup@4.37.0: resolution: {integrity: sha512-iAtQy/L4QFU+rTJ1YUjXqJOJzuwEghqWzCEYD2FEghT7Gsy1VdABntrO4CLopA5IkflTyqNiLNwPcOJ3S7UKLg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -5532,6 +5886,13 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyexec@1.0.1: + resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} + + tinyglobby@0.2.13: + resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} + engines: {node: '>=12.0.0'} + tinypool@1.0.2: resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -5562,8 +5923,8 @@ packages: tldts-core@7.0.1: resolution: {integrity: sha512-EwrnW4fkFuTgNBPOI3i/j8168ftqogsIQG2IYz69KfF8XOjPy5O+nzu6Ep7kaugpdZrN2Y951VzAVSt/hbYp2g==} - tldts@6.1.86: - resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} + tldts@6.1.85: + resolution: {integrity: sha512-gBdZ1RjCSevRPFix/hpaUWeak2/RNUZB4/8frF1r5uYMHjFptkiT0JXIebWvgI/0ZHXvxaUDDJshiA0j6GdL3w==} hasBin: true tldts@7.0.1: @@ -5648,6 +6009,19 @@ packages: typescript: optional: true + tsdown@0.9.2: + resolution: {integrity: sha512-B0Vfgsi2Jcpa5MPGtx5z6W+HTj3xv+tPsukS4FfnX5+dwzuQUjgB2fbaM/IIYJGH2YZY2Hjb+TEZoQZ5MrefCw==} + engines: {node: '>=18.0.0'} + hasBin: true + peerDependencies: + publint: ^0.3.0 + unplugin-unused: ^0.4.0 + peerDependenciesMeta: + publint: + optional: true + unplugin-unused: + optional: true + tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} @@ -5724,6 +6098,9 @@ packages: unbzip2-stream@1.4.3: resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} + unconfig@7.3.1: + resolution: {integrity: sha512-LH5WL+un92tGAzWS87k7LkAfwpMdm7V0IXG2FxEjZz/QxiIW5J5LkcrKQThj0aRz6+h/lFmKI9EUXmK/T0bcrw==} + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -5826,6 +6203,14 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + valibot@1.0.0: + resolution: {integrity: sha512-1Hc0ihzWxBar6NGeZv7fPLY0QuxFMyxwYR2sF1Blu7Wq7EnremwY2W02tit2ij2VJT8HcSkHAQqmFfl77f73Yw==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + valid-url@1.0.9: resolution: {integrity: sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==} @@ -6887,6 +7272,22 @@ snapshots: enabled: 2.0.0 kuler: 2.0.0 + '@emnapi/core@1.4.3': + dependencies: + '@emnapi/wasi-threads': 1.0.2 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.4.3': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.0.2': + dependencies: + tslib: 2.8.1 + optional: true + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -7031,19 +7432,19 @@ snapshots: '@esbuild/win32-x64@0.25.1': optional: true - '@eslint-community/eslint-utils@4.5.1(eslint@9.25.0)': - dependencies: - eslint: 9.25.0 - eslint-visitor-keys: 3.4.3 - - '@eslint-community/eslint-utils@4.6.1(eslint@8.57.1)': + '@eslint-community/eslint-utils@4.5.1(eslint@8.57.1)': dependencies: eslint: 8.57.1 eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.6.1(eslint@9.25.0)': + '@eslint-community/eslint-utils@4.5.1(eslint@9.25.0(jiti@2.4.2))': dependencies: - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) + eslint-visitor-keys: 3.4.3 + + '@eslint-community/eslint-utils@4.6.0(eslint@9.25.0(jiti@2.4.2))': + dependencies: + eslint: 9.25.0(jiti@2.4.2) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} @@ -7261,6 +7662,13 @@ snapshots: outvariant: 1.4.3 strict-event-emitter: 0.5.1 + '@napi-rs/wasm-runtime@0.2.9': + dependencies: + '@emnapi/core': 1.4.3 + '@emnapi/runtime': 1.4.3 + '@tybys/wasm-util': 0.9.0 + optional: true + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -7643,6 +8051,115 @@ snapshots: '@otplib/plugin-crypto': 12.0.1 '@otplib/plugin-thirty-two': 12.0.1 + '@oxc-parser/binding-darwin-arm64@0.65.0': + optional: true + + '@oxc-parser/binding-darwin-x64@0.65.0': + optional: true + + '@oxc-parser/binding-linux-arm-gnueabihf@0.65.0': + optional: true + + '@oxc-parser/binding-linux-arm64-gnu@0.65.0': + optional: true + + '@oxc-parser/binding-linux-arm64-musl@0.65.0': + optional: true + + '@oxc-parser/binding-linux-x64-gnu@0.65.0': + optional: true + + '@oxc-parser/binding-linux-x64-musl@0.65.0': + optional: true + + '@oxc-parser/binding-wasm32-wasi@0.65.0': + dependencies: + '@napi-rs/wasm-runtime': 0.2.9 + optional: true + + '@oxc-parser/binding-win32-arm64-msvc@0.65.0': + optional: true + + '@oxc-parser/binding-win32-x64-msvc@0.65.0': + optional: true + + '@oxc-project/types@0.64.0': {} + + '@oxc-project/types@0.65.0': {} + + '@oxc-resolver/binding-darwin-arm64@5.3.0': + optional: true + + '@oxc-resolver/binding-darwin-x64@5.3.0': + optional: true + + '@oxc-resolver/binding-freebsd-x64@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-arm-gnueabihf@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-arm64-gnu@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-arm64-musl@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-riscv64-gnu@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-s390x-gnu@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-x64-gnu@5.3.0': + optional: true + + '@oxc-resolver/binding-linux-x64-musl@5.3.0': + optional: true + + '@oxc-resolver/binding-wasm32-wasi@5.3.0': + dependencies: + '@napi-rs/wasm-runtime': 0.2.9 + optional: true + + '@oxc-resolver/binding-win32-arm64-msvc@5.3.0': + optional: true + + '@oxc-resolver/binding-win32-x64-msvc@5.3.0': + optional: true + + '@oxc-transform/binding-darwin-arm64@0.65.0': + optional: true + + '@oxc-transform/binding-darwin-x64@0.65.0': + optional: true + + '@oxc-transform/binding-linux-arm-gnueabihf@0.65.0': + optional: true + + '@oxc-transform/binding-linux-arm64-gnu@0.65.0': + optional: true + + '@oxc-transform/binding-linux-arm64-musl@0.65.0': + optional: true + + '@oxc-transform/binding-linux-x64-gnu@0.65.0': + optional: true + + '@oxc-transform/binding-linux-x64-musl@0.65.0': + optional: true + + '@oxc-transform/binding-wasm32-wasi@0.65.0': + dependencies: + '@napi-rs/wasm-runtime': 0.2.9 + optional: true + + '@oxc-transform/binding-win32-arm64-msvc@0.65.0': + optional: true + + '@oxc-transform/binding-win32-x64-msvc@0.65.0': + optional: true + '@pkgjs/parseargs@0.11.0': optional: true @@ -7735,6 +8252,48 @@ snapshots: - bare-buffer - supports-color + '@quansync/fs@0.1.2': + dependencies: + quansync: 0.2.10 + + '@rolldown/binding-darwin-arm64@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.7-commit.c2596d3': + dependencies: + '@napi-rs/wasm-runtime': 0.2.9 + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.7-commit.c2596d3': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.7-commit.c2596d3': + optional: true + '@rollup/pluginutils@5.1.4(rollup@4.37.0)': dependencies: '@types/estree': 1.0.7 @@ -7901,10 +8460,10 @@ snapshots: '@sindresorhus/is@7.0.1': {} - '@stylistic/eslint-plugin@4.2.0(eslint@9.25.0)(typescript@5.8.3)': + '@stylistic/eslint-plugin@4.2.0(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: - '@typescript-eslint/utils': 8.28.0(eslint@9.25.0)(typescript@5.8.3) - eslint: 9.25.0 + '@typescript-eslint/utils': 8.28.0(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) + eslint: 9.25.0(jiti@2.4.2) eslint-visitor-keys: 4.2.0 espree: 10.3.0 estraverse: 5.3.0 @@ -7921,6 +8480,11 @@ snapshots: '@tootallnate/quickjs-emscripten@0.23.0': {} + '@tybys/wasm-util@0.9.0': + dependencies: + tslib: 2.8.1 + optional: true + '@types/aes-js@3.1.4': {} '@types/babel__preset-env@7.10.0': {} @@ -8099,15 +8663,15 @@ snapshots: '@types/node': 22.14.1 optional: true - '@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.25.0)(typescript@5.8.3))(eslint@9.25.0)(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.30.1(eslint@9.25.0)(typescript@5.8.3) + '@typescript-eslint/parser': 8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) '@typescript-eslint/scope-manager': 8.30.1 - '@typescript-eslint/type-utils': 8.30.1(eslint@9.25.0)(typescript@5.8.3) - '@typescript-eslint/utils': 8.30.1(eslint@9.25.0)(typescript@5.8.3) + '@typescript-eslint/type-utils': 8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) + '@typescript-eslint/utils': 8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) '@typescript-eslint/visitor-keys': 8.30.1 - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 @@ -8116,14 +8680,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.30.1(eslint@9.25.0)(typescript@5.8.3)': + '@typescript-eslint/parser@8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: '@typescript-eslint/scope-manager': 8.30.1 '@typescript-eslint/types': 8.30.1 '@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.3) '@typescript-eslint/visitor-keys': 8.30.1 debug: 4.4.0 - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -8138,12 +8702,12 @@ snapshots: '@typescript-eslint/types': 8.30.1 '@typescript-eslint/visitor-keys': 8.30.1 - '@typescript-eslint/type-utils@8.30.1(eslint@9.25.0)(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: '@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.3) - '@typescript-eslint/utils': 8.30.1(eslint@9.25.0)(typescript@5.8.3) + '@typescript-eslint/utils': 8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3) debug: 4.4.0 - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: @@ -8181,24 +8745,24 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.28.0(eslint@9.25.0)(typescript@5.8.3)': + '@typescript-eslint/utils@8.28.0(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: - '@eslint-community/eslint-utils': 4.6.1(eslint@9.25.0) + '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0(jiti@2.4.2)) '@typescript-eslint/scope-manager': 8.28.0 '@typescript-eslint/types': 8.28.0 '@typescript-eslint/typescript-estree': 8.28.0(typescript@5.8.3) - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.30.1(eslint@9.25.0)(typescript@5.8.3)': + '@typescript-eslint/utils@8.30.1(eslint@9.25.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: - '@eslint-community/eslint-utils': 4.6.1(eslint@9.25.0) + '@eslint-community/eslint-utils': 4.6.0(eslint@9.25.0(jiti@2.4.2)) '@typescript-eslint/scope-manager': 8.30.1 '@typescript-eslint/types': 8.30.1 '@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.3) - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -8220,6 +8784,10 @@ snapshots: hookable: 5.5.3 zhead: 2.2.4 + '@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.8.3))': + dependencies: + valibot: 1.0.0(typescript@5.8.3) + '@vercel/nft@0.29.2(rollup@4.37.0)': dependencies: '@mapbox/node-pre-gyp': 2.0.0 @@ -8353,6 +8921,8 @@ snapshots: ansi-styles@6.2.1: {} + ansis@3.17.0: {} + arg@5.0.2: {} argparse@2.0.1: {} @@ -8650,6 +9220,10 @@ snapshots: undici: 6.21.2 whatwg-mimetype: 4.0.0 + chokidar@4.0.3: + dependencies: + readdirp: 4.1.2 + chownr@3.0.0: {} chromium-bidi@0.5.16(devtools-protocol@0.0.1262051): @@ -8902,6 +9476,8 @@ snapshots: define-lazy-prop@2.0.0: {} + defu@6.1.4: {} + degenerator@5.0.1: dependencies: ast-types: 0.13.4 @@ -8929,6 +9505,8 @@ snapshots: asap: 2.0.6 wrappy: 1.0.2 + diff@7.0.0: {} + difflib@https://codeload.github.com/postlight/difflib.js/tar.gz/32e8e38c7fcd935241b9baab71bb432fd9b166ed: dependencies: heap: 0.2.7 @@ -9000,6 +9578,11 @@ snapshots: dotenv@6.2.0: {} + dts-resolver@1.0.0: + dependencies: + oxc-resolver: 5.3.0 + pathe: 2.0.3 + eastasianwidth@0.2.0: {} ecc-jsbn@0.1.2: @@ -9159,23 +9742,23 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-compat-utils@0.5.1(eslint@9.25.0): + eslint-compat-utils@0.5.1(eslint@9.25.0(jiti@2.4.2)): dependencies: - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) semver: 7.7.1 - eslint-compat-utils@0.6.4(eslint@9.25.0): + eslint-compat-utils@0.6.4(eslint@9.25.0(jiti@2.4.2)): dependencies: - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) semver: 7.7.1 - eslint-config-prettier@10.1.2(eslint@9.25.0): + eslint-config-prettier@10.1.2(eslint@9.25.0(jiti@2.4.2)): dependencies: - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) - eslint-filtered-fix@0.3.0(eslint@9.25.0): + eslint-filtered-fix@0.3.0(eslint@9.25.0(jiti@2.4.2)): dependencies: - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) optionator: 0.9.4 eslint-formatter-friendly@7.0.0: @@ -9186,55 +9769,55 @@ snapshots: strip-ansi: 5.2.0 text-table: 0.2.0 - eslint-nibble@8.1.0(eslint@9.25.0): + eslint-nibble@8.1.0(eslint@9.25.0(jiti@2.4.2)): dependencies: '@ianvs/eslint-stats': 2.0.0 chalk: 4.1.2 - eslint: 9.25.0 - eslint-filtered-fix: 0.3.0(eslint@9.25.0) + eslint: 9.25.0(jiti@2.4.2) + eslint-filtered-fix: 0.3.0(eslint@9.25.0(jiti@2.4.2)) eslint-formatter-friendly: 7.0.0 eslint-summary: 1.0.0 inquirer: 8.2.6 optionator: 0.9.4 - eslint-plugin-es-x@7.8.0(eslint@9.25.0): + eslint-plugin-es-x@7.8.0(eslint@9.25.0(jiti@2.4.2)): dependencies: - '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0) + '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0(jiti@2.4.2)) '@eslint-community/regexpp': 4.12.1 - eslint: 9.25.0 - eslint-compat-utils: 0.5.1(eslint@9.25.0) + eslint: 9.25.0(jiti@2.4.2) + eslint-compat-utils: 0.5.1(eslint@9.25.0(jiti@2.4.2)) - eslint-plugin-n@17.17.0(eslint@9.25.0): + eslint-plugin-n@17.17.0(eslint@9.25.0(jiti@2.4.2)): dependencies: - '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0) + '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0(jiti@2.4.2)) enhanced-resolve: 5.18.1 - eslint: 9.25.0 - eslint-plugin-es-x: 7.8.0(eslint@9.25.0) + eslint: 9.25.0(jiti@2.4.2) + eslint-plugin-es-x: 7.8.0(eslint@9.25.0(jiti@2.4.2)) get-tsconfig: 4.10.0 globals: 15.15.0 ignore: 5.3.2 minimatch: 9.0.5 semver: 7.7.1 - eslint-plugin-prettier@5.2.6(@types/eslint@9.6.1)(eslint-config-prettier@10.1.2(eslint@9.25.0))(eslint@9.25.0)(prettier@3.5.3): + eslint-plugin-prettier@5.2.6(@types/eslint@9.6.1)(eslint-config-prettier@10.1.2(eslint@9.25.0(jiti@2.4.2)))(eslint@9.25.0(jiti@2.4.2))(prettier@3.5.3): dependencies: - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) prettier: 3.5.3 prettier-linter-helpers: 1.0.0 synckit: 0.11.1 optionalDependencies: '@types/eslint': 9.6.1 - eslint-config-prettier: 10.1.2(eslint@9.25.0) + eslint-config-prettier: 10.1.2(eslint@9.25.0(jiti@2.4.2)) - eslint-plugin-unicorn@58.0.0(eslint@9.25.0): + eslint-plugin-unicorn@58.0.0(eslint@9.25.0(jiti@2.4.2)): dependencies: '@babel/helper-validator-identifier': 7.25.9 - '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0) + '@eslint-community/eslint-utils': 4.5.1(eslint@9.25.0(jiti@2.4.2)) '@eslint/plugin-kit': 0.2.7 ci-info: 4.2.0 clean-regexp: 1.0.0 core-js-compat: 3.41.0 - eslint: 9.25.0 + eslint: 9.25.0(jiti@2.4.2) esquery: 1.6.0 globals: 16.0.0 indent-string: 5.0.0 @@ -9247,12 +9830,12 @@ snapshots: semver: 7.7.1 strip-indent: 4.0.0 - eslint-plugin-yml@1.17.0(eslint@9.25.0): + eslint-plugin-yml@1.17.0(eslint@9.25.0(jiti@2.4.2)): dependencies: debug: 4.4.0 escape-string-regexp: 4.0.0 - eslint: 9.25.0 - eslint-compat-utils: 0.6.4(eslint@9.25.0) + eslint: 9.25.0(jiti@2.4.2) + eslint-compat-utils: 0.6.4(eslint@9.25.0(jiti@2.4.2)) natural-compare: 1.4.0 yaml-eslint-parser: 1.3.0 transitivePeerDependencies: @@ -9279,7 +9862,7 @@ snapshots: eslint@8.57.1: dependencies: - '@eslint-community/eslint-utils': 4.6.1(eslint@8.57.1) + '@eslint-community/eslint-utils': 4.5.1(eslint@8.57.1) '@eslint-community/regexpp': 4.12.1 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.57.1 @@ -9320,9 +9903,9 @@ snapshots: transitivePeerDependencies: - supports-color - eslint@9.25.0: + eslint@9.25.0(jiti@2.4.2): dependencies: - '@eslint-community/eslint-utils': 4.6.1(eslint@9.25.0) + '@eslint-community/eslint-utils': 4.6.0(eslint@9.25.0(jiti@2.4.2)) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.20.0 '@eslint/config-helpers': 0.2.1 @@ -9357,6 +9940,8 @@ snapshots: minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 + optionalDependencies: + jiti: 2.4.2 transitivePeerDependencies: - supports-color @@ -9489,6 +10074,10 @@ snapshots: dependencies: pend: 1.2.0 + fdir@6.4.4(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + fecha@4.2.3: {} figures@3.2.0: @@ -10135,6 +10724,8 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jiti@2.4.2: {} + js-beautify@1.15.4: dependencies: config-chain: 1.1.13 @@ -10404,6 +10995,10 @@ snapshots: lz-string@1.5.0: {} + magic-string-ast@0.9.1: + dependencies: + magic-string: 0.30.17 + magic-string@0.30.17: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -10900,6 +11495,50 @@ snapshots: outvariant@1.4.3: {} + oxc-parser@0.65.0: + dependencies: + '@oxc-project/types': 0.65.0 + optionalDependencies: + '@oxc-parser/binding-darwin-arm64': 0.65.0 + '@oxc-parser/binding-darwin-x64': 0.65.0 + '@oxc-parser/binding-linux-arm-gnueabihf': 0.65.0 + '@oxc-parser/binding-linux-arm64-gnu': 0.65.0 + '@oxc-parser/binding-linux-arm64-musl': 0.65.0 + '@oxc-parser/binding-linux-x64-gnu': 0.65.0 + '@oxc-parser/binding-linux-x64-musl': 0.65.0 + '@oxc-parser/binding-wasm32-wasi': 0.65.0 + '@oxc-parser/binding-win32-arm64-msvc': 0.65.0 + '@oxc-parser/binding-win32-x64-msvc': 0.65.0 + + oxc-resolver@5.3.0: + optionalDependencies: + '@oxc-resolver/binding-darwin-arm64': 5.3.0 + '@oxc-resolver/binding-darwin-x64': 5.3.0 + '@oxc-resolver/binding-freebsd-x64': 5.3.0 + '@oxc-resolver/binding-linux-arm-gnueabihf': 5.3.0 + '@oxc-resolver/binding-linux-arm64-gnu': 5.3.0 + '@oxc-resolver/binding-linux-arm64-musl': 5.3.0 + '@oxc-resolver/binding-linux-riscv64-gnu': 5.3.0 + '@oxc-resolver/binding-linux-s390x-gnu': 5.3.0 + '@oxc-resolver/binding-linux-x64-gnu': 5.3.0 + '@oxc-resolver/binding-linux-x64-musl': 5.3.0 + '@oxc-resolver/binding-wasm32-wasi': 5.3.0 + '@oxc-resolver/binding-win32-arm64-msvc': 5.3.0 + '@oxc-resolver/binding-win32-x64-msvc': 5.3.0 + + oxc-transform@0.65.0: + optionalDependencies: + '@oxc-transform/binding-darwin-arm64': 0.65.0 + '@oxc-transform/binding-darwin-x64': 0.65.0 + '@oxc-transform/binding-linux-arm-gnueabihf': 0.65.0 + '@oxc-transform/binding-linux-arm64-gnu': 0.65.0 + '@oxc-transform/binding-linux-arm64-musl': 0.65.0 + '@oxc-transform/binding-linux-x64-gnu': 0.65.0 + '@oxc-transform/binding-linux-x64-musl': 0.65.0 + '@oxc-transform/binding-wasm32-wasi': 0.65.0 + '@oxc-transform/binding-win32-arm64-msvc': 0.65.0 + '@oxc-transform/binding-win32-x64-msvc': 0.65.0 + p-cancelable@3.0.0: {} p-cancelable@4.0.1: {} @@ -10996,6 +11635,8 @@ snapshots: pathe@1.1.2: {} + pathe@2.0.3: {} + pathval@2.0.0: {} peberminta@0.9.0: {} @@ -11236,6 +11877,8 @@ snapshots: qs@6.5.3: {} + quansync@0.2.10: {} + query-string@7.1.3: dependencies: decode-uri-component: 0.2.2 @@ -11281,6 +11924,8 @@ snapshots: string_decoder: 1.3.0 util-deprecate: 1.0.2 + readdirp@4.1.2: {} + real-cancellable-promise@1.2.1: {} real-require@0.2.0: {} @@ -11425,6 +12070,42 @@ snapshots: dependencies: glob: 10.4.5 + rolldown-plugin-dts@0.8.3(rolldown@1.0.0-beta.7-commit.c2596d3(typescript@5.8.3))(typescript@5.8.3): + dependencies: + debug: 4.4.0 + dts-resolver: 1.0.0 + get-tsconfig: 4.10.0 + magic-string-ast: 0.9.1 + oxc-parser: 0.65.0 + oxc-transform: 0.65.0 + rolldown: 1.0.0-beta.7-commit.c2596d3(typescript@5.8.3) + optionalDependencies: + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + + rolldown@1.0.0-beta.7-commit.c2596d3(typescript@5.8.3): + dependencies: + '@oxc-project/types': 0.64.0 + '@valibot/to-json-schema': 1.0.0(valibot@1.0.0(typescript@5.8.3)) + ansis: 3.17.0 + valibot: 1.0.0(typescript@5.8.3) + optionalDependencies: + '@rolldown/binding-darwin-arm64': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-darwin-x64': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.7-commit.c2596d3 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.7-commit.c2596d3 + transitivePeerDependencies: + - typescript + rollup@4.37.0: dependencies: '@types/estree': 1.0.6 @@ -11804,6 +12485,13 @@ snapshots: tinyexec@0.3.2: {} + tinyexec@1.0.1: {} + + tinyglobby@0.2.13: + dependencies: + fdir: 6.4.4(picomatch@4.0.2) + picomatch: 4.0.2 + tinypool@1.0.2: {} tinyrainbow@1.2.0: {} @@ -11824,7 +12512,7 @@ snapshots: tldts-core@7.0.1: {} - tldts@6.1.86: + tldts@6.1.85: dependencies: tldts-core: 6.1.86 @@ -11866,7 +12554,7 @@ snapshots: tough-cookie@5.1.2: dependencies: - tldts: 6.1.86 + tldts: 6.1.85 tr46@0.0.3: {} @@ -11894,6 +12582,25 @@ snapshots: optionalDependencies: typescript: 5.8.3 + tsdown@0.9.2(typescript@5.8.3): + dependencies: + ansis: 3.17.0 + cac: 6.7.14 + chokidar: 4.0.3 + consola: 3.4.2 + debug: 4.4.0 + diff: 7.0.0 + find-up-simple: 1.0.1 + rolldown: 1.0.0-beta.7-commit.c2596d3(typescript@5.8.3) + rolldown-plugin-dts: 0.8.3(rolldown@1.0.0-beta.7-commit.c2596d3(typescript@5.8.3))(typescript@5.8.3) + tinyexec: 1.0.1 + tinyglobby: 0.2.13 + unconfig: 7.3.1 + transitivePeerDependencies: + - '@oxc-project/runtime' + - supports-color + - typescript + tslib@1.14.1: {} tslib@2.8.1: {} @@ -11954,6 +12661,13 @@ snapshots: buffer: 5.7.1 through: 2.3.8 + unconfig@7.3.1: + dependencies: + '@quansync/fs': 0.1.2 + defu: 6.1.4 + jiti: 2.4.2 + quansync: 0.2.10 + undici-types@6.21.0: {} undici@6.21.2: {} @@ -12033,6 +12747,10 @@ snapshots: uuid@9.0.1: {} + valibot@1.0.0(typescript@5.8.3): + optionalDependencies: + typescript: 5.8.3 + valid-url@1.0.9: {} validate-npm-package-license@3.0.4: diff --git a/scripts/workflow/build-routes.ts b/scripts/workflow/build-routes.ts index 9003f73e4..9807cfc4c 100644 --- a/scripts/workflow/build-routes.ts +++ b/scripts/workflow/build-routes.ts @@ -64,6 +64,7 @@ for (const namespace in namespaces) { } } } + data.module = `() => import('@/routes/${namespace}/${data.location}')`; } } @@ -71,3 +72,4 @@ fs.writeFileSync(path.join(__dirname, '../../assets/build/radar-rules.json'), JS fs.writeFileSync(path.join(__dirname, '../../assets/build/radar-rules.js'), `(${toSource(radar)})`); fs.writeFileSync(path.join(__dirname, '../../assets/build/maintainers.json'), JSON.stringify(maintainers, null, 2)); fs.writeFileSync(path.join(__dirname, '../../assets/build/routes.json'), JSON.stringify(namespaces, null, 2)); +fs.writeFileSync(path.join(__dirname, '../../assets/build/routes.js'), `export default ${JSON.stringify(namespaces, null, 2)}`.replaceAll(/"module": "(.*)"\n/g, `"module": $1\n`)); diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 000000000..ab2fe6a08 --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'tsdown'; +import artTemplatesPlugin from './plugins/rollup-plugin-art-templates.ts'; + +export default defineConfig({ + entry: ['./lib/index.ts'], + minify: true, + shims: true, + clean: true, + plugins: [artTemplatesPlugin()], +});