diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b48d5f..b6ede65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,9 @@ jobs: with: node-version: lts/* + - name: setup pnpm + run: npm install -g pnpm + - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: @@ -48,7 +51,7 @@ jobs: # You can remove the one that doesn't apply to your app to speed up the workflow a bit. - name: install frontend dependencies - run: yarn install # change this to npm, pnpm or bun depending on which one you use. + run: pnpm install # change this to npm, pnpm or bun depending on which one you use. - uses: tauri-apps/tauri-action@v0 env: diff --git a/modern.config.ts b/modern.config.ts index d8bbe57..7e1f82b 100644 --- a/modern.config.ts +++ b/modern.config.ts @@ -52,4 +52,7 @@ export default defineConfig({ disableNodePolyfill: false, disableSourceMap: process.env.NODE_ENV === 'production', }, + performance: { + transformLodash: false, + }, }); diff --git a/src/utils/rss.ts b/src/utils/rss.ts index 483a4d6..45a32b9 100644 --- a/src/utils/rss.ts +++ b/src/utils/rss.ts @@ -3,7 +3,7 @@ import RSSParser from 'rss-parser'; import { ResponseType, fetch } from '@tauri-apps/api/http'; import { open, confirm } from '@tauri-apps/api/dialog'; import { exists, createDir } from '@tauri-apps/api/fs'; -import * as _ from 'lodash-es'; +import { intersection } from 'lodash-es'; import { fileNameLimitRegExp } from './format'; import { QbApiWrapper } from './qb-api'; import { recordLog } from './log'; @@ -93,7 +93,7 @@ export async function injectRuleData( const rssLinkList = await qbApiWrapper.rssGetAllLink(); const subItemLinkList = subList.map(v => v.link); - const sameLinkList = _.intersection(rssLinkList, subItemLinkList); + const sameLinkList = intersection(rssLinkList, subItemLinkList); if (sameLinkList.length > 0) { throw new Error( `qb 中含有相同地址的 rss 订阅:${sameLinkList.join(' ; ')}`, @@ -101,7 +101,7 @@ export async function injectRuleData( } const ruleList = await qbApiWrapper.rssRuleGetAll(); const ruleTitleList = Object.keys(ruleList); - const sameTitleList = _.intersection(ruleTitleList, titleList); + const sameTitleList = intersection(ruleTitleList, titleList); if (sameTitleList.length > 0) { throw new Error( `qb 中含有相同标题的下载规则:${sameTitleList.join(' ; ')}`,