Skip to content

Commit

Permalink
chore(deps): mark tosource as production dependency (#15356)
Browse files Browse the repository at this point in the history
Close #15093. Otherwise, `pnpm build` would fail after `pnpm install --production`
  • Loading branch information
wrvsrx authored Apr 25, 2024
1 parent c68e2b4 commit 9f0c08e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
11 changes: 4 additions & 7 deletions lib/routes/mckinsey/cn/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Route } from '@/types';
// use stock `got` package as a workaround for
// https://github.com/DIYgod/RSSHub/issues/8239
// https://github.com/DIYgod/RSSHub/pull/8288
import got from 'got';
import ofetch from '@/utils/ofetch';
import { parseDate } from '@/utils/parse-date';
import { categories } from './category-map';

Expand Down Expand Up @@ -53,12 +50,12 @@ async function handler(ctx) {
categories.find((c) => c.slug === category);
}

const posts = await got(`${endpoint}/wp/v2/posts`, {
searchParams: {
const posts = await ofetch(`${endpoint}/wp/v2/posts`, {
query: {
per_page: ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 50,
categories: category,
},
}).json();
});

const items = posts.map((item) => ({
title: item.title.rendered,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"tiny-async-pool": "2.1.0",
"title": "3.5.3",
"tldts": "6.1.18",
"tosource": "2.0.0-alpha.3",
"tough-cookie": "4.1.3",
"tsx": "4.7.2",
"twitter-api-v2": "1.16.3",
Expand Down Expand Up @@ -173,7 +174,6 @@
"prettier": "3.2.5",
"remark-parse": "11.0.0",
"supertest": "7.0.0",
"tosource": "2.0.0-alpha.3",
"typescript": "5.4.5",
"unified": "11.0.4",
"vite-tsconfig-paths": "4.3.2",
Expand Down
22 changes: 14 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f0c08e

Please sign in to comment.