dsh-plugin 1.3.11 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +9 -9
- package/README.md +21 -21
- package/client/client.js +370 -342
- package/client/client.js.map +1 -1
- package/lib/http/routes.js +4 -4
- package/package.json +1 -1
- package/src/client/components/PluginHubSection.tsx +3 -4
- package/src/client/components/modals/NotificationsModal.tsx +10 -0
- package/src/client/components/modals/modals.tsx +9 -2
- package/src/client/components/ui/icons.tsx +1 -1
- package/src/client/components/views/DiagnosticsView.tsx +6 -4
- package/src/client/components/views/InstalledView.tsx +1 -1
- package/src/client/hooks/useCatalog.ts +15 -1
- package/src/client/hooks/useIncrementalList.ts +1 -1
- package/src/client/hooks/useLanguage.ts +14 -10
- package/src/client/locales.ts +20 -16
- package/src/client/logic/constants.ts +2 -2
- package/src/client/logic/failures.ts +29 -5
- package/src/client/logic/urls.ts +3 -3
- package/src/client/styles/InstalledView.module.css +2 -2
- package/src/client/styles/Modal.module.css +8 -8
- package/src/client/types.ts +4 -3
- package/src/server/http/routes.ts +4 -4
|
@@ -93,7 +93,7 @@ const PROFILE_RE = /^[A-Za-z0-9_-]+$/
|
|
|
93
93
|
const BODY_LIMIT_BYTES = 4 * 1024
|
|
94
94
|
const COMMAND_TIMEOUT_MS = 5 * 60 * 1000
|
|
95
95
|
|
|
96
|
-
/** 目录/统计数据代理的本地缓存时长:1
|
|
96
|
+
/** 目录/统计数据代理的本地缓存时长:1 小时内重复打开插件市场直接读盘,
|
|
97
97
|
* 不重复走 curl 拉远程 —— 重启宿主后首次打开同样秒开(缓存跨重启存活)。 */
|
|
98
98
|
const CATALOG_CACHE_TTL_MS = 60 * 60 * 1000
|
|
99
99
|
|
|
@@ -519,8 +519,8 @@ export function mountPluginHubRoutes(webServer: WebServerService, profile: strin
|
|
|
519
519
|
{ key: 'npm', url: `${registry}/dsh-plugin`, display: settings.npmRegistry !== '' ? registry : '', cmd: `npm view dsh-plugin version --registry ${registry}` },
|
|
520
520
|
// GitHub 行用真实 git 克隆握手(git ls-remote)打 dshplugin/hello-dsh 小仓库:
|
|
521
521
|
// 「网页能打开」和「git 能克隆」是两码事,握手成功才算通道通;小仓库秒级完成,不打 17MB 的 dsh-plugin-hub。
|
|
522
|
-
{ key: 'github', url: 'https://github.com/dshplugin/hello-dsh', display: 'github.com
|
|
523
|
-
{ key: 'catalog', url: 'https://api.dsh-plugin.org/stats.json', display: '
|
|
522
|
+
{ key: 'github', url: 'https://github.com/dshplugin/hello-dsh', display: 'github.com', cmd: 'git ls-remote https://github.com/dshplugin/hello-dsh', git: true },
|
|
523
|
+
{ key: 'catalog', url: 'https://api.dsh-plugin.org/stats.json', display: '', cmd: 'curl -s https://api.dsh-plugin.org/stats.json' },
|
|
524
524
|
]
|
|
525
525
|
// 配置了 HTTP 代理:追加一行代理诊断 —— 用该代理打 github.com(安装通道真实访问的地址),
|
|
526
526
|
// 验证「代理能不能把请求带出去」。与安装同口径:curl 子进程注入该代理 env。
|
|
@@ -617,7 +617,7 @@ export function mountPluginHubRoutes(webServer: WebServerService, profile: strin
|
|
|
617
617
|
const target = isStats
|
|
618
618
|
? 'https://api.dsh-plugin.org/stats.json'
|
|
619
619
|
: `https://api.dsh-plugin.org/plugins.${lang}.json`
|
|
620
|
-
// 1
|
|
620
|
+
// 1 小时本地缓存:命中直接返回(跨重启生效,插件市场秒开),未命中才走 curl 拉远程
|
|
621
621
|
const cacheFile = catalogCacheFile(profile, isStats ? 'stats' : `plugins-${lang}`)
|
|
622
622
|
const cached = readCatalogCache(cacheFile)
|
|
623
623
|
if (cached !== null) {
|