From de5e984fa089778518b27ec38a30c07ab6c68767 Mon Sep 17 00:00:00 2001 From: Tao Date: Tue, 17 Oct 2023 19:07:40 +0800 Subject: [PATCH] updated at 2023-10-17 19:07 by mc git-up --- package.json | 2 +- .../ui/src/{common => }/define/ClashConfig.ts | 2 +- .../src/{common/define.ts => define/index.ts} | 4 +- .../ui/src/page/current-config/ConfigDND.tsx | 2 +- packages/ui/src/page/current-config/model.ts | 2 +- .../ui/src/page/library-rule-list/index.tsx | 2 +- .../library-rule-list/model.auto-update.ts | 4 +- .../ui/src/page/library-rule-list/model.ts | 2 +- .../ui/src/page/library-subscribe/index.tsx | 14 +---- .../library-subscribe/model.auto-update.ts | 4 +- .../ui/src/page/library-subscribe/model.ts | 2 +- .../library-subscribe/special/nodefree.tsx | 2 +- .../page/preference/modal/SelectExport.tsx | 2 +- packages/ui/src/storage/config.ts | 2 +- packages/ui/src/storage/index.ts | 2 +- packages/ui/src/util/gen.ts | 4 +- packages/ui/src/util/remote-rules.ts | 2 +- packages/ui/src/util/subscribe.ts | 2 +- pnpm-lock.yaml | 62 ++++++++++++++----- tsconfig.json | 4 +- 20 files changed, 72 insertions(+), 50 deletions(-) rename packages/ui/src/{common => }/define/ClashConfig.ts (97%) rename packages/ui/src/{common/define.ts => define/index.ts} (95%) diff --git a/package.json b/package.json index a5659ad..16dd29c 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "fs-extra": "^11.1.1", "husky": "^8.0.3", "jake": "^10.8.7", - "lint-staged": "^15.0.1", + "lint-staged": "^14", "minimist": "^1.2.8", "napa": "^3.0.0", "nodemon": "^3.0.1", diff --git a/packages/ui/src/common/define/ClashConfig.ts b/packages/ui/src/define/ClashConfig.ts similarity index 97% rename from packages/ui/src/common/define/ClashConfig.ts rename to packages/ui/src/define/ClashConfig.ts index a9bcd81..819d38b 100644 --- a/packages/ui/src/common/define/ClashConfig.ts +++ b/packages/ui/src/define/ClashConfig.ts @@ -2,7 +2,7 @@ import { ClashProxyItem } from '$clash-utils' -export default interface ClashConfig { +export interface ClashConfig { 'proxies': ClashProxyItem[] 'proxy-groups': ProxyGroup[] 'proxy-providers': ProxyProviders | undefined diff --git a/packages/ui/src/common/define.ts b/packages/ui/src/define/index.ts similarity index 95% rename from packages/ui/src/common/define.ts rename to packages/ui/src/define/index.ts index 512b68b..bcb1bae 100644 --- a/packages/ui/src/common/define.ts +++ b/packages/ui/src/define/index.ts @@ -1,3 +1,5 @@ +export { ClashConfig } from './ClashConfig' + export interface Subscribe { id: string name: string @@ -70,5 +72,3 @@ export interface ConfigItem { id: string disabled?: boolean } - -export { default as ClashConfig } from './define/ClashConfig' diff --git a/packages/ui/src/page/current-config/ConfigDND.tsx b/packages/ui/src/page/current-config/ConfigDND.tsx index fd52807..80d1e89 100644 --- a/packages/ui/src/page/current-config/ConfigDND.tsx +++ b/packages/ui/src/page/current-config/ConfigDND.tsx @@ -1,4 +1,4 @@ -import { ConfigItem } from '$ui/common/define' +import { ConfigItem } from '$ui/define' import { cx } from '$ui/libs' import { rootState } from '$ui/store' import { limitLines } from '$ui/util/text-util' diff --git a/packages/ui/src/page/current-config/model.ts b/packages/ui/src/page/current-config/model.ts index 03c7fd9..2068383 100644 --- a/packages/ui/src/page/current-config/model.ts +++ b/packages/ui/src/page/current-config/model.ts @@ -1,5 +1,5 @@ -import { ConfigItem, RuleItem, Subscribe } from '$ui/common/define' import { valtioState } from '$ui/common/model/valtio-helper' +import { ConfigItem, RuleItem, Subscribe } from '$ui/define' import { onInit, onReload } from '$ui/page/global-model' import storage from '$ui/storage' import _ from 'lodash' diff --git a/packages/ui/src/page/library-rule-list/index.tsx b/packages/ui/src/page/library-rule-list/index.tsx index 04bf375..2b1a9ea 100644 --- a/packages/ui/src/page/library-rule-list/index.tsx +++ b/packages/ui/src/page/library-rule-list/index.tsx @@ -6,7 +6,7 @@ import { EditorRefInner, showCode, } from '$ui/common/code' -import { LocalRuleItem, RuleItem } from '$ui/common/define' +import { LocalRuleItem, RuleItem } from '$ui/define' import { message } from '$ui/store' import { useIsDarkMode } from '$ui/util/hooks/useIsDarkMode' import { getRuleItemContent } from '$ui/util/remote-rules' diff --git a/packages/ui/src/page/library-rule-list/model.auto-update.ts b/packages/ui/src/page/library-rule-list/model.auto-update.ts index 7ed37b4..39b57bd 100644 --- a/packages/ui/src/page/library-rule-list/model.auto-update.ts +++ b/packages/ui/src/page/library-rule-list/model.auto-update.ts @@ -3,13 +3,13 @@ */ import { runGenerate } from '$ui/commands/run' -import { RuleItem } from '$ui/common/define' +import { RuleItem } from '$ui/define' import { debounce, DebouncedFunc, once } from 'lodash' import ms from 'ms' import { currentConfigUsingAndEnabled } from '../current-config/model' import { state, updateRemote } from './model' -const timerRegistry: Record = {} +const timerRegistry: Record = {} const cleanupTimer = (timerKey: string) => { if (timerRegistry[timerKey]) { clearInterval(timerRegistry[timerKey]) diff --git a/packages/ui/src/page/library-rule-list/model.ts b/packages/ui/src/page/library-rule-list/model.ts index 7ff402a..86f834e 100644 --- a/packages/ui/src/page/library-rule-list/model.ts +++ b/packages/ui/src/page/library-rule-list/model.ts @@ -1,5 +1,5 @@ -import { RuleItem } from '$ui/common/define' import { valtioState } from '$ui/common/model/valtio-helper' +import { RuleItem } from '$ui/define' import { onInit, onReload } from '$ui/page/global-model' import storage from '$ui/storage' import { message } from '$ui/store' diff --git a/packages/ui/src/page/library-subscribe/index.tsx b/packages/ui/src/page/library-subscribe/index.tsx index 1aac31d..ece4955 100644 --- a/packages/ui/src/page/library-subscribe/index.tsx +++ b/packages/ui/src/page/library-subscribe/index.tsx @@ -1,4 +1,4 @@ -import { Subscribe, SubscribeSpecialType } from '$ui/common/define' +import { Subscribe, SubscribeSpecialType } from '$ui/define' import { message } from '$ui/store' import { EyeFilled, EyeInvisibleFilled, UnorderedListOutlined } from '@ant-design/icons' import { useMemoizedFn, useUpdateEffect } from 'ahooks' @@ -233,11 +233,7 @@ function SubscribeItem({ title={`节点列表(${servers?.length})`} content={
-
    - {servers?.map((s) => ( -
  • {s.name}
  • - ))} -
+
    {servers?.map((s) =>
  • {s.name}
  • )}
} trigger='click' @@ -251,11 +247,7 @@ function SubscribeItem({ title={`链接列表(${specialData?.recentDays})`} content={
-
    - {nodefreeGetUrls(item)?.map((url) => ( -
  • {url}
  • - ))} -
+
    {nodefreeGetUrls(item)?.map((url) =>
  • {url}
  • )}
} trigger='click' diff --git a/packages/ui/src/page/library-subscribe/model.auto-update.ts b/packages/ui/src/page/library-subscribe/model.auto-update.ts index 947b1e2..0a8d90c 100644 --- a/packages/ui/src/page/library-subscribe/model.auto-update.ts +++ b/packages/ui/src/page/library-subscribe/model.auto-update.ts @@ -3,13 +3,13 @@ */ import { runGenerate } from '$ui/commands/run' -import { Subscribe } from '$ui/common/define' +import { Subscribe } from '$ui/define' import { once } from 'lodash' import ms from 'ms' import { currentConfigUsingAndEnabled } from '../current-config/model' import { state, update } from './model' -const timerRegistry: Record = {} +const timerRegistry: Record = {} const cleanupTimer = (timerKey: string) => { if (timerRegistry[timerKey]) { clearInterval(timerRegistry[timerKey]) diff --git a/packages/ui/src/page/library-subscribe/model.ts b/packages/ui/src/page/library-subscribe/model.ts index 61fbe4c..2c9d00e 100644 --- a/packages/ui/src/page/library-subscribe/model.ts +++ b/packages/ui/src/page/library-subscribe/model.ts @@ -1,6 +1,6 @@ import { ClashProxyItem } from '$clash-utils' -import { Subscribe } from '$ui/common/define' import { valtioState } from '$ui/common/model/valtio-helper' +import { Subscribe } from '$ui/define' import { onInit, onReload } from '$ui/page/global-model' import storage from '$ui/storage' import { message } from '$ui/store' diff --git a/packages/ui/src/page/library-subscribe/special/nodefree.tsx b/packages/ui/src/page/library-subscribe/special/nodefree.tsx index d5e3b64..3b2682c 100644 --- a/packages/ui/src/page/library-subscribe/special/nodefree.tsx +++ b/packages/ui/src/page/library-subscribe/special/nodefree.tsx @@ -1,4 +1,4 @@ -import { Subscribe } from '$ui/common/define' +import { Subscribe } from '$ui/define' import moment from 'moment' export type NodefreeData = { diff --git a/packages/ui/src/page/preference/modal/SelectExport.tsx b/packages/ui/src/page/preference/modal/SelectExport.tsx index d654a53..c17ac40 100644 --- a/packages/ui/src/page/preference/modal/SelectExport.tsx +++ b/packages/ui/src/page/preference/modal/SelectExport.tsx @@ -1,4 +1,4 @@ -import { ConfigItem } from '$ui/common/define' +import { ConfigItem } from '$ui/define' import { ExportData, storageDataDisplayNames } from '$ui/storage' import { truthy } from '$ui/util/ts-filter' import { useMemoizedFn, useUpdateEffect } from 'ahooks' diff --git a/packages/ui/src/storage/config.ts b/packages/ui/src/storage/config.ts index 3f77b57..2217e04 100644 --- a/packages/ui/src/storage/config.ts +++ b/packages/ui/src/storage/config.ts @@ -1,4 +1,4 @@ -import { type StorageData } from '.' +import { type StorageData } from './index' export const keysToOmit = [ 'subscribe_detail' as const, diff --git a/packages/ui/src/storage/index.ts b/packages/ui/src/storage/index.ts index 1606d1e..0aef1b5 100644 --- a/packages/ui/src/storage/index.ts +++ b/packages/ui/src/storage/index.ts @@ -1,6 +1,6 @@ /* eslint camelcase: off */ -import { ConfigItem, RuleItem, Subscribe } from '$ui/common/define' +import { ConfigItem, RuleItem, Subscribe } from '$ui/define' import Store from 'electron-store' import { omit } from 'lodash' import { keysToOmit } from './config' diff --git a/packages/ui/src/util/gen.ts b/packages/ui/src/util/gen.ts index 6789a30..e4dd992 100644 --- a/packages/ui/src/util/gen.ts +++ b/packages/ui/src/util/gen.ts @@ -1,5 +1,5 @@ -import { ClashConfig, RuleItem, Subscribe } from '$ui/common/define' -import { ProxyGroupType } from '$ui/common/define/ClashConfig' +import { ClashConfig, RuleItem, Subscribe } from '$ui/define' +import { ProxyGroupType } from '$ui/define/ClashConfig' import { YAML, pmap } from '$ui/libs' import { rootActions, rootState } from '$ui/store' import fse from 'fs-extra' diff --git a/packages/ui/src/util/remote-rules.ts b/packages/ui/src/util/remote-rules.ts index 5227bf0..d787447 100644 --- a/packages/ui/src/util/remote-rules.ts +++ b/packages/ui/src/util/remote-rules.ts @@ -1,5 +1,5 @@ import { appCacheDir } from '$ui/common' -import { RemoteRuleItem, RemoteRuleProviderRuleItem } from '$ui/common/define' +import { RemoteRuleItem, RemoteRuleProviderRuleItem } from '$ui/define' import { YAML } from '$ui/libs' import fse from 'fs-extra' import path from 'path' diff --git a/packages/ui/src/util/subscribe.ts b/packages/ui/src/util/subscribe.ts index 63f568b..571583c 100644 --- a/packages/ui/src/util/subscribe.ts +++ b/packages/ui/src/util/subscribe.ts @@ -1,6 +1,6 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars import { md5 } from '$clash-utils' -import { ClashConfig } from '$ui/common/define' +import { ClashConfig } from '$ui/define' import bytes from 'bytes' import envPaths from 'env-paths' import fse from 'fs-extra' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63cf13b..837a1da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,8 +91,8 @@ importers: specifier: ^10.8.7 version: 10.8.7 lint-staged: - specifier: ^15.0.1 - version: 15.0.1 + specifier: ^14 + version: 14.0.1 minimist: specifier: ^1.2.8 version: 1.2.8 @@ -3028,8 +3028,8 @@ packages: dependencies: delayed-stream: 1.0.0 - /commander@11.1.0: - resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + /commander@11.0.0: + resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} engines: {node: '>=16'} dev: true @@ -4396,6 +4396,21 @@ packages: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + /execa@7.2.0: + resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} + engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 4.3.1 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 3.0.7 + strip-final-newline: 3.0.0 + dev: true + /execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} @@ -4409,6 +4424,7 @@ packages: onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 + dev: false /exenv@1.2.2: resolution: {integrity: sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==} @@ -5013,6 +5029,7 @@ packages: /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} + dev: false /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} @@ -5447,9 +5464,15 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + /human-signals@4.3.1: + resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} + engines: {node: '>=14.18.0'} + dev: true + /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} + dev: false /husky@8.0.3: resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} @@ -6255,28 +6278,34 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /lint-staged@15.0.1: - resolution: {integrity: sha512-2IU5OWmCaxch0X0+IBF4/v7sutpB+F3qoXbro43pYjQTOo5wumckjxoxn47pQBqqBsCWrD5HnI2uG/zJA7isew==} - engines: {node: '>=18.12.0'} + /lint-staged@14.0.1: + resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} + engines: {node: ^16.14.0 || >=18.0.0} hasBin: true dependencies: chalk: 5.3.0 - commander: 11.1.0 + commander: 11.0.0 debug: 4.3.4 - execa: 8.0.1 + execa: 7.2.0 lilconfig: 2.1.0 - listr2: 7.0.1 + listr2: 6.6.1 micromatch: 4.0.5 pidtree: 0.6.0 string-argv: 0.3.2 - yaml: 2.3.2 + yaml: 2.3.1 transitivePeerDependencies: + - enquirer - supports-color dev: true - /listr2@7.0.1: - resolution: {integrity: sha512-nz+7hwgbDp8eWNoDgzdl4hA/xDSLrNRzPu1TLgOYs6l5Y+Ma6zVWWy9Oyt9TQFONwKoSPoka3H50D3vD5EuNwg==} + /listr2@6.6.1: + resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==} engines: {node: '>=16.0.0'} + peerDependencies: + enquirer: '>= 2.3.0 < 3' + peerDependenciesMeta: + enquirer: + optional: true dependencies: cli-truncate: 3.1.0 colorette: 2.0.20 @@ -7342,7 +7371,7 @@ packages: lilconfig: 2.1.0 postcss: 8.4.31 ts-node: 10.9.1(@swc/core@1.3.93)(@types/node@20.8.6)(typescript@5.2.2) - yaml: 2.2.2 + yaml: 2.3.2 dev: true /postcss-modules-extract-imports@1.1.0: @@ -8885,6 +8914,7 @@ packages: /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + dev: false /simple-update-notifier@2.0.0: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} @@ -10475,8 +10505,8 @@ packages: engines: {node: '>= 6'} dev: true - /yaml@2.2.2: - resolution: {integrity: sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==} + /yaml@2.3.1: + resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} dev: true diff --git a/tsconfig.json b/tsconfig.json index c3d78ef..59f9f1e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,10 +12,10 @@ "$ui/*": ["ui/src/*"], "$clash-utils": ["clash-utils/src/"], "$clash-utils/*": ["clash-utils/src/*"] - } + }, + "noEmit": true }, "ts-node": { - "transpileOnly": true, "swc": true, "compilerOptions": { "module": "CommonJS"