dsh-pick 0.7.1 → 0.7.3
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.md +10 -3
- package/data/catalog.json +1 -1
- package/lib/boards.js +20 -3
- package/lib/engine.js +55 -13
- package/lib/overall.js +19 -1
- package/package.json +1 -1
- package/plugin/client.js +12 -3
- package/plugin/index.js +2 -0
- package/plugin/tools.js +1 -1
- package/web/panel.html +60 -8
- package/web/panel.js +358 -58
package/lib/boards.js
CHANGED
|
@@ -148,12 +148,29 @@ async function loadOfficial(fetchImpl) {
|
|
|
148
148
|
return { total: rows.length, rows }
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
/** 下载插件商店的目录和星标表。构建时只下一次,补目录和商店榜共用 */
|
|
152
|
+
export async function loadShopDocs(fetchImpl = globalThis.fetch) {
|
|
152
153
|
const index = await getJson(fetchImpl, `${SHOP_BASE}index.json`, 30000)
|
|
153
154
|
const [plugins, stars] = await Promise.all([
|
|
154
155
|
getJson(fetchImpl, SHOP_BASE + index.plugins.url, 180000),
|
|
155
156
|
getJson(fetchImpl, SHOP_BASE + index.stars.url, 60000),
|
|
156
157
|
])
|
|
158
|
+
return { plugins, stars }
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** 插件商店里发到 npm 的包(包名校验过):补进 npm 目录用。商店不给下载量 */
|
|
162
|
+
export function shopPackages(plugins) {
|
|
163
|
+
const list = Array.isArray(plugins) ? plugins : (plugins && plugins.plugins) || []
|
|
164
|
+
const out = new Map()
|
|
165
|
+
for (const p of list) {
|
|
166
|
+
const n = p && p.source === 'npm' ? npmName(p.name) : null
|
|
167
|
+
if (n && !out.has(n)) out.set(n, { n, m: 0, repo: repoUrl(p.repository) })
|
|
168
|
+
}
|
|
169
|
+
return [...out.values()]
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async function loadShop(fetchImpl, members, docs) {
|
|
173
|
+
const { plugins, stars } = docs || await loadShopDocs(fetchImpl)
|
|
157
174
|
const board = shopBoard(plugins, stars)
|
|
158
175
|
members.shop = board.all
|
|
159
176
|
delete board.all
|
|
@@ -182,7 +199,7 @@ export function picksMembers(doc) {
|
|
|
182
199
|
* @param {object} [opt.previous] 上一次的 boards
|
|
183
200
|
* @param {object} [opt.communityDoc] 已经下载好的社区目录,有就不再下一次
|
|
184
201
|
*/
|
|
185
|
-
export async function buildBoards({ fetchImpl = globalThis.fetch, previous = {}, communityDoc = null, members = {}, onProgress = () => {} } = {}) {
|
|
202
|
+
export async function buildBoards({ fetchImpl = globalThis.fetch, previous = {}, communityDoc = null, shopDocs = null, members = {}, onProgress = () => {} } = {}) {
|
|
186
203
|
// members:各市场的完整收录名单(综合榜算「收录于」要用),不落盘;抓不到的那个市场留 null
|
|
187
204
|
members.community = null
|
|
188
205
|
members.shop = null
|
|
@@ -201,7 +218,7 @@ export async function buildBoards({ fetchImpl = globalThis.fetch, previous = {},
|
|
|
201
218
|
delete board.all
|
|
202
219
|
return board
|
|
203
220
|
},
|
|
204
|
-
shop: () => loadShop(fetchImpl, members),
|
|
221
|
+
shop: () => loadShop(fetchImpl, members, shopDocs),
|
|
205
222
|
}
|
|
206
223
|
try {
|
|
207
224
|
members.picks = picksMembers(await getJson(fetchImpl, PICKS_URL, 30000))
|
package/lib/engine.js
CHANGED
|
@@ -13,7 +13,7 @@ import { classify } from './classify.js'
|
|
|
13
13
|
import { expandWords } from './words.js'
|
|
14
14
|
import { baselineWithStart, growth, cadence, ageDays, score, sum } from './metrics.js'
|
|
15
15
|
import { parseRepo, fetchRepos, fetchRepoLive, countsForPlugin } from './github.js'
|
|
16
|
-
import { buildBoards, communityPackages, loadCommunity, repoUrl } from './boards.js'
|
|
16
|
+
import { buildBoards, communityPackages, loadCommunity, loadShopDocs, shopPackages, repoUrl } from './boards.js'
|
|
17
17
|
import { buildOverall } from './overall.js'
|
|
18
18
|
|
|
19
19
|
const PKG_ROOT = fileURLToPath(new URL('..', import.meta.url))
|
|
@@ -165,6 +165,7 @@ export async function buildCatalog({ deep = 200, max = 2250, pages = 9, deepOnly
|
|
|
165
165
|
const records = new Map()
|
|
166
166
|
const previous = await readJson(CATALOG_PATH)
|
|
167
167
|
let communityDoc = null
|
|
168
|
+
let shopDocs = null
|
|
168
169
|
|
|
169
170
|
if (deepOnly) {
|
|
170
171
|
const prev = await loadCatalog()
|
|
@@ -206,10 +207,19 @@ export async function buildCatalog({ deep = 200, max = 2250, pages = 9, deepOnly
|
|
|
206
207
|
} catch (e) {
|
|
207
208
|
onProgress(`社区目录抓不到(${e.message}),沿用上次目录里的包`)
|
|
208
209
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
// 插件商店里发到 npm 的包也补进来:商店收录的比社区目录还多,只看社区目录覆盖不全
|
|
211
|
+
try {
|
|
212
|
+
shopDocs = await loadShopDocs()
|
|
213
|
+
} catch (e) {
|
|
214
|
+
onProgress(`插件商店抓不到(${e.message}),沿用上次目录里的包`)
|
|
215
|
+
}
|
|
216
|
+
const fromPrevious = () => Object.values((previous && previous.packages) || {}).map(r => ({ n: r.n, m: r.m, repo: repoUrl(r.repo) }))
|
|
217
|
+
const merged = new Map()
|
|
218
|
+
for (const r of [
|
|
219
|
+
...(communityDoc ? communityPackages(communityDoc) : fromPrevious()),
|
|
220
|
+
...(shopDocs ? shopPackages(shopDocs.plugins) : fromPrevious()),
|
|
221
|
+
]) if (!merged.has(r.n)) merged.set(r.n, r)
|
|
222
|
+
await addCommunity(records, [...merged.values()], { previous: previous && previous.packages, onProgress })
|
|
213
223
|
}
|
|
214
224
|
|
|
215
225
|
// 分类:**全部**目录都要有(v1 只给深挖目标分了类,导致其余全是 undefined)
|
|
@@ -325,7 +335,7 @@ export async function buildCatalog({ deep = 200, max = 2250, pages = 9, deepOnly
|
|
|
325
335
|
// npm、GitHub 之外的榜单:官方、社区、插件商店(抓不到的沿用上次)
|
|
326
336
|
onProgress('其他榜单…')
|
|
327
337
|
const members = {}
|
|
328
|
-
const boards = await buildBoards({ previous: previous && previous.boards, communityDoc, members, onProgress })
|
|
338
|
+
const boards = await buildBoards({ previous: previous && previous.boards, communityDoc, shopDocs, members, onProgress })
|
|
329
339
|
|
|
330
340
|
// 综合榜:几个市场合成一个榜,一个插件一行;顺带给每个 npm 包写上综合分 sc 和「收录于」src
|
|
331
341
|
const previousSrc = {}
|
|
@@ -364,13 +374,27 @@ export async function buildCatalog({ deep = 200, max = 2250, pages = 9, deepOnly
|
|
|
364
374
|
* @param {string} [opt.today] YYYY-MM-DD,决定今天轮到哪些带 scope 的包(见 weeklyDue)
|
|
365
375
|
* @returns {Promise<number>} 补进去几个
|
|
366
376
|
*/
|
|
367
|
-
export async function addCommunity(records, rows, {
|
|
377
|
+
export async function addCommunity(records, rows, {
|
|
378
|
+
previous = {}, today = new Date().toISOString().slice(0, 10), wait = 800, onProgress = () => {},
|
|
379
|
+
manifestRotation = MANIFEST_ROTATION, newPerDay = NEW_PER_DAY, newScopedWeekly = NEW_SCOPED_WEEKLY,
|
|
380
|
+
} = {}) {
|
|
368
381
|
const missing = rows.filter(r => !records.has(r.n))
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
382
|
+
// npm 注册表对 GitHub Actions 限流很狠(四千多个 manifest 要读四十分钟),不能每天全读:
|
|
383
|
+
// 上次目录里有完整记录的,按包名分 manifestRotation 组轮着重读,没轮到的沿用上次的;
|
|
384
|
+
// 第一次见到的,每天最多读 newPerDay 个(按插件市场给的下载量从高到低),其余明天接着补
|
|
385
|
+
const complete = r => Boolean(r && r.v && r.inst)
|
|
386
|
+
const reuse = missing.filter(r => complete(previous[r.n]) && !rotationDue(r.n, today, manifestRotation))
|
|
387
|
+
const known = missing.filter(r => complete(previous[r.n]) && rotationDue(r.n, today, manifestRotation))
|
|
388
|
+
const fresh = missing.filter(r => !complete(previous[r.n])).sort((a, b) => (b.m || 0) - (a.m || 0))
|
|
389
|
+
const freshToday = fresh.slice(0, newPerDay)
|
|
390
|
+
const deferred = fresh.length - freshToday.length
|
|
391
|
+
const toRead = [...known, ...freshToday]
|
|
392
|
+
onProgress(`插件市场里 ${rows.length} 个 npm 包,其中 ${missing.length} 个搜索接口没翻到:` +
|
|
393
|
+
`${reuse.length} 个沿用上次的(轮着重读),读 manifest ${toRead.length} 个(新的 ${freshToday.length} 个${deferred ? `,另有 ${deferred} 个新的明天再补` : ''})…`)
|
|
394
|
+
const got = await fetchManifests(toRead.map(r => r.n), { wait, onProgress })
|
|
395
|
+
const added = reuse.map(r => ({ ...previous[r.n] }))
|
|
372
396
|
let gone = 0, reused = 0, lost = 0
|
|
373
|
-
for (const row of
|
|
397
|
+
for (const row of toRead) {
|
|
374
398
|
const res = got.get(row.n)
|
|
375
399
|
if (res.status === 'ok') {
|
|
376
400
|
const rec = communityRecord(row, res.data)
|
|
@@ -393,7 +417,9 @@ export async function addCommunity(records, rows, { previous = {}, today = new D
|
|
|
393
417
|
// 不带 scope 的批量查,每天全查;带 scope 的只能逐个查,下载量接口经不起(几百个包在 Actions 上要排队二十多分钟),
|
|
394
418
|
// 所以每天只查轮到的那组和上次没有数的,其余沿用上次的
|
|
395
419
|
const prevW = n => previous?.[n]?.w
|
|
396
|
-
|
|
420
|
+
// 第一次见到的带 scope 包也有上限:一下子几千个逐个查要排好几个小时;没轮到的先记 0,几天内轮到
|
|
421
|
+
let newScoped = 0
|
|
422
|
+
const due = added.filter(r => !r.n.startsWith('@') || weeklyDue(r.n, today) || (prevW(r.n) == null && newScoped++ < newScopedWeekly))
|
|
397
423
|
onProgress(` 周下载 ${due.length} 个(带 scope 的 ${added.length - due.length} 个今天没轮到,沿用上次的)…`)
|
|
398
424
|
const weekly = await fetchWeekly(due.map(r => r.n), onProgress)
|
|
399
425
|
let stale = 0
|
|
@@ -465,7 +491,23 @@ async function fetchWeekly(names, onProgress = () => {}) {
|
|
|
465
491
|
}
|
|
466
492
|
|
|
467
493
|
/** 带 scope 的包分几天轮着查周下载 */
|
|
468
|
-
export const WEEKLY_ROTATION =
|
|
494
|
+
export const WEEKLY_ROTATION = 5
|
|
495
|
+
/** 插件市场补进来的包分几天轮着重读 manifest(版本、说明、安装信息) */
|
|
496
|
+
export const MANIFEST_ROTATION = 4
|
|
497
|
+
/** 每天最多读几个第一次见到的包的 manifest */
|
|
498
|
+
export const NEW_PER_DAY = 3000
|
|
499
|
+
/** 每天最多逐个查几个第一次见到、还没轮到的带 scope 包的周下载 */
|
|
500
|
+
export const NEW_SCOPED_WEEKLY = 300
|
|
501
|
+
|
|
502
|
+
/** 按包名分进 n 组,今天轮不轮到这一组(不记状态,每隔 n 天正好轮到一次) */
|
|
503
|
+
export function rotationDue(name, today, n) {
|
|
504
|
+
if (n <= 1) return true
|
|
505
|
+
let h = 0
|
|
506
|
+
for (const ch of name) h = (h * 31 + ch.codePointAt(0)) >>> 0
|
|
507
|
+
const day = Math.floor(Date.parse(today + 'T00:00:00Z') / 86400000)
|
|
508
|
+
// 和周下载的轮换错开(同一个哈希会让两件事总落在同一天)
|
|
509
|
+
return (h >>> 3) % n === day % n
|
|
510
|
+
}
|
|
469
511
|
|
|
470
512
|
/**
|
|
471
513
|
* 这个带 scope 的包今天轮不轮到查周下载:按包名分进 WEEKLY_ROTATION 组,一天查一组。
|
package/lib/overall.js
CHANGED
|
@@ -102,6 +102,7 @@ export function stableScore({ firstDays, cadence, license, issues, stars }) {
|
|
|
102
102
|
*/
|
|
103
103
|
export function buildOverall({ packages, members, previousSrc = {}, now = Date.now() }) {
|
|
104
104
|
const cands = new Map() // key → 候选
|
|
105
|
+
const uncataloged = new Set()
|
|
105
106
|
const npmKey = n => `npm:${n}`
|
|
106
107
|
for (const rec of Object.values(packages)) {
|
|
107
108
|
cands.set(npmKey(rec.n), { key: npmKey(rec.n), n: rec.n, rec, src: new Set(), stars: rec.gh ? rec.gh.s : null, repo: rec.ghUrl || rec.repo || null })
|
|
@@ -136,7 +137,11 @@ export function buildOverall({ packages, members, previousSrc = {}, now = Date.n
|
|
|
136
137
|
c = { key: npmKey(m.n), n: m.n, rec, src: new Set(), stars: null, repo: null, outside: true }
|
|
137
138
|
cands.set(c.key, c)
|
|
138
139
|
}
|
|
139
|
-
if (!c)
|
|
140
|
+
if (!c) {
|
|
141
|
+
// npm 名字不在目录里:每日构建一天只补一部分新包,或者 npm 上已经没有了。算进覆盖数,暂时不参与排名
|
|
142
|
+
if (m.n) uncataloged.add(m.n)
|
|
143
|
+
continue
|
|
144
|
+
}
|
|
140
145
|
c.src.add(market)
|
|
141
146
|
if (c.stars == null && Number.isFinite(m.s)) c.stars = m.s
|
|
142
147
|
// 第一次被市场收录的日期(「新上架」「稳定可靠」要用)
|
|
@@ -144,6 +149,18 @@ export function buildOverall({ packages, members, previousSrc = {}, now = Date.n
|
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
|
|
152
|
+
// 覆盖范围:几个市场 + npm 搜索合起来、去重后一共多少个插件(一票否决之前),其中多少发到了 npm
|
|
153
|
+
const all = [...cands.values()]
|
|
154
|
+
const cover = {
|
|
155
|
+
all: all.length + uncataloged.size,
|
|
156
|
+
npm: all.filter(c => c.n).length + uncataloged.size,
|
|
157
|
+
gh: all.filter(c => !c.n).length,
|
|
158
|
+
pending: uncataloged.size, // 市场里有、npm 目录还没补进来的
|
|
159
|
+
|
|
160
|
+
// 每个市场自己收录了多少条(市场里同一个插件可能占好几条,比如一个仓库里好几个插件);这次抓不到的不写
|
|
161
|
+
markets: Object.fromEntries(MARKETS.map(m => [m, members[MEMBER_KEY[m]] ? members[MEMBER_KEY[m]].length : null]).filter(([, v]) => v != null)),
|
|
162
|
+
}
|
|
163
|
+
|
|
147
164
|
// 一票否决
|
|
148
165
|
const excluded = {}
|
|
149
166
|
const out = []
|
|
@@ -224,6 +241,7 @@ export function buildOverall({ packages, members, previousSrc = {}, now = Date.n
|
|
|
224
241
|
const pct = v => Math.round(v * 100)
|
|
225
242
|
return {
|
|
226
243
|
total: out.length,
|
|
244
|
+
cover,
|
|
227
245
|
excluded,
|
|
228
246
|
weights: WEIGHTS,
|
|
229
247
|
angles: ANGLES,
|
package/package.json
CHANGED
package/plugin/client.js
CHANGED
|
@@ -297,9 +297,18 @@ window.__ModuleLoader__.load({
|
|
|
297
297
|
const catalog = !meta
|
|
298
298
|
? L('正在读取目录…', 'Loading catalog…')
|
|
299
299
|
: meta.total
|
|
300
|
-
?
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
? meta.cover
|
|
301
|
+
// 几个插件市场 + npm 去重后的总数;旧目录没有,就只说 npm 上的包数
|
|
302
|
+
? L(
|
|
303
|
+
`收录 ${meta.cover.all.toLocaleString()} 个插件(dshmarket、dsh-plugin-shop、dsh-m 精选、DeepSeek 官方和 npm 合起来去重),` +
|
|
304
|
+
`其中 ${meta.cover.npm.toLocaleString()} 个发布在 npm、能一键安装,${meta.cover.gh.toLocaleString()} 个只在 GitHub;` +
|
|
305
|
+
`npm 上下载最多的 ${meta.deepCount} 个有去噪指标。每天更新,数据截止 ${meta.anchor}。`,
|
|
306
|
+
`${meta.cover.all.toLocaleString()} plugins across dshmarket, dsh-plugin-shop, dsh-m picks, DeepSeek official and npm (deduplicated): ` +
|
|
307
|
+
`${meta.cover.npm.toLocaleString()} on npm (one-click install), ${meta.cover.gh.toLocaleString()} GitHub-only; ` +
|
|
308
|
+
`the ${meta.deepCount} most-downloaded have denoised metrics. Updated daily; data as of ${meta.anchor}.`)
|
|
309
|
+
: L(
|
|
310
|
+
`npm 上收录 ${meta.total.toLocaleString()} 个插件包(每天更新),其中下载最多的 ${meta.deepCount} 个有去噪指标;数据截止 ${meta.anchor}。`,
|
|
311
|
+
`${meta.total.toLocaleString()} plugin packages on npm (updated daily); the ${meta.deepCount} most-downloaded have denoised metrics; data as of ${meta.anchor}.`)
|
|
303
312
|
: L('目录未生成:在 dsh-pick 目录跑一次 dsh-pick build', 'Catalog not built yet: run `dsh-pick build`')
|
|
304
313
|
|
|
305
314
|
return h('div', { style: { color: C.text } },
|
package/plugin/index.js
CHANGED
|
@@ -230,6 +230,8 @@ async function catalogMeta() {
|
|
|
230
230
|
anchor: cat.anchor || null,
|
|
231
231
|
total: cat.total || Object.keys(packages).length,
|
|
232
232
|
deepCount: Object.values(packages).filter(p => p && p.deep).length,
|
|
233
|
+
// 几个插件市场 + npm 合起来去重后的覆盖数(每日目录用新代码构建后才有)
|
|
234
|
+
cover: (cat.boards && cat.boards.overall && cat.boards.overall.cover) || null,
|
|
233
235
|
source: cat.source || 'bundled',
|
|
234
236
|
checkedAt: state.checkedAt || null,
|
|
235
237
|
}
|
package/plugin/tools.js
CHANGED
|
@@ -130,7 +130,7 @@ export async function buildToolDefinitions(deps = {}) {
|
|
|
130
130
|
const installed = async () => {
|
|
131
131
|
try { return deps.installed ? await deps.installed() : new Set() } catch { return new Set() }
|
|
132
132
|
}
|
|
133
|
-
const header = cat => `目录数据截止 ${cat.anchor || '未知'}(npm 最近有数据的一天;npm
|
|
133
|
+
const header = cat => `目录数据截止 ${cat.anchor || '未知'}(npm 最近有数据的一天;npm 每日下载只在一天结束后汇总,常晚几天),npm 上共 ${num(cat.total)} 个插件包。`
|
|
134
134
|
const CATS = allCategories()
|
|
135
135
|
|
|
136
136
|
return [
|
package/web/panel.html
CHANGED
|
@@ -124,6 +124,8 @@ table.rank td.nm .desc{min-width:150px;display:-webkit-box;-webkit-line-clamp:2;
|
|
|
124
124
|
.addwrap{position:relative;flex:1;min-width:160px}
|
|
125
125
|
.addwrap input{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:8px;padding:6px 10px;font-size:12.5px;font-family:inherit;background:var(--input);color:var(--text)}
|
|
126
126
|
.addwrap input:focus{outline:none;border-color:var(--accent)}
|
|
127
|
+
.watchadd{display:flex;gap:8px;align-items:center;margin:2px 0 12px}
|
|
128
|
+
.watchadd .btn.sm{height:30px}
|
|
127
129
|
.sug{position:absolute;left:0;right:0;top:100%;margin-top:4px;z-index:50;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 18px var(--shadow);max-height:300px;overflow:auto}
|
|
128
130
|
.sug .opt{padding:7px 10px;cursor:pointer;border-bottom:1px solid var(--soft)}
|
|
129
131
|
.sug .opt:last-child{border-bottom:none}
|
|
@@ -240,6 +242,49 @@ table.cmp.wd .ch{display:block;font-size:10.5px;font-weight:600}
|
|
|
240
242
|
table.cmp.wd .ch.up{color:var(--ok)}table.cmp.wd .ch.down{color:var(--bad)}table.cmp.wd .ch.flat{color:var(--t3);font-weight:400}
|
|
241
243
|
table.cmp.wd .grp td{background:var(--soft);color:var(--t3);font-size:10.5px;font-weight:700;padding:4px 9px;text-align:left}
|
|
242
244
|
table.cmp.wd svg.spark{display:block;margin-left:auto}
|
|
245
|
+
/* 监控详情:变化提醒 · 指标选单 · 我的产品和对手的差距 · 排名横条 · 单个插件的全部数据(窄屏) */
|
|
246
|
+
.wdch{margin:0 0 12px;padding:9px 11px;border-radius:9px;background:var(--accent-bg);font-size:12px;line-height:1.7;color:var(--text)}
|
|
247
|
+
.wdch b{font-weight:650}
|
|
248
|
+
.wdch .ln{margin-top:3px}
|
|
249
|
+
.wdch .it{display:inline-block;margin-left:8px;white-space:nowrap}
|
|
250
|
+
.wdch .it + .it::before{content:'·';margin-right:8px;color:var(--t3)}
|
|
251
|
+
.wdch .it .up{color:var(--ok)}.wdch .it .down{color:var(--bad)}
|
|
252
|
+
.wdch.quiet{background:var(--soft);color:var(--t3)}
|
|
253
|
+
.wdm{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 10px}
|
|
254
|
+
.wdm button{appearance:none;border:1px solid var(--line);background:var(--panel);color:var(--t2);font-family:inherit;font-size:11.5px;padding:3px 9px;border-radius:12px;cursor:pointer}
|
|
255
|
+
.wdm button.on{background:var(--accent);border-color:var(--accent);color:#fff}
|
|
256
|
+
.wdmine{margin:0 0 8px;font-size:12px;line-height:1.7;color:var(--t2)}
|
|
257
|
+
.wdmine div{padding:6px 10px;border-radius:8px;background:color-mix(in srgb,var(--warn,#f5a623) 12%,var(--panel));margin-bottom:4px}
|
|
258
|
+
.wdmine b{color:var(--text)}
|
|
259
|
+
.wdbars .wb{padding:6px 6px 7px;border-radius:8px;cursor:pointer}
|
|
260
|
+
.wdbars .wb:hover{background:var(--row-hover)}
|
|
261
|
+
.wdbars .wb.sel{background:var(--soft)}
|
|
262
|
+
.wdbars .wb.mine{box-shadow:inset 3px 0 0 #f5a623}
|
|
263
|
+
.wdbars .wbt{display:flex;align-items:center;gap:6px;font-size:12px;min-width:0}
|
|
264
|
+
.wdbars .wbr{flex:none;width:22px;color:var(--t3);font-variant-numeric:tabular-nums;font-size:11px}
|
|
265
|
+
.wdbars .wbn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text);font-weight:600}
|
|
266
|
+
.wdbars .wbn i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:6px}
|
|
267
|
+
.wdbars .wbv{flex:none;font-variant-numeric:tabular-nums;font-weight:650;color:var(--text)}
|
|
268
|
+
.wdbars .wbv .ch{font-size:10.5px;font-weight:600;margin-left:5px}
|
|
269
|
+
.wdbars .wbb{margin:4px 0 0 28px;height:6px;border-radius:3px;background:var(--soft)}
|
|
270
|
+
.wdbars .wbb i{display:block;height:100%;border-radius:3px}
|
|
271
|
+
.wdbars .none .wbv{color:var(--t3);font-weight:400}
|
|
272
|
+
.ch.up{color:var(--ok)}.ch.down{color:var(--bad)}.ch.flat{color:var(--t3);font-weight:400}
|
|
273
|
+
.mtag{display:inline-block;font-size:10px;font-weight:700;color:#b26b00;background:color-mix(in srgb,#f5a623 22%,transparent);border-radius:4px;padding:0 4px;margin-left:5px;vertical-align:1px}
|
|
274
|
+
button.star{appearance:none;border:none;background:none;padding:0 3px 0 0;margin:0;font-size:13px;line-height:1;cursor:pointer;color:var(--mute);font-family:inherit}
|
|
275
|
+
button.star.on{color:#f5a623}
|
|
276
|
+
.wdnote{margin-top:6px}
|
|
277
|
+
.wdone{border-top:1px solid var(--line);margin-top:6px;padding-top:10px}
|
|
278
|
+
.wdone .hd{display:flex;align-items:center;gap:6px;font-size:13.5px;font-weight:700;color:var(--text);margin-bottom:6px}
|
|
279
|
+
.wdone .hd i{display:inline-block;width:9px;height:9px;border-radius:2px}
|
|
280
|
+
.wdone .grp{margin:10px 0 2px;padding:3px 8px;border-radius:6px;background:var(--soft);color:var(--t3);font-size:10.5px;font-weight:700}
|
|
281
|
+
.wdone .kv{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:5px 2px;border-bottom:1px solid var(--soft);font-size:12px}
|
|
282
|
+
.wdone .kv:last-child{border-bottom:none}
|
|
283
|
+
.wdone .k{color:var(--t3);flex:none}
|
|
284
|
+
.wdone .v{text-align:right;color:var(--text);display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:4px 6px}
|
|
285
|
+
.wdone .v .ch{font-size:10.5px;font-weight:600}
|
|
286
|
+
.wdone .v .up{color:var(--ok)}.wdone .v .down{color:var(--bad)}
|
|
287
|
+
table.cmp.wd th.sel,table.cmp.wd td.sel{background:var(--soft)}
|
|
243
288
|
td.best{color:var(--ok);font-weight:700}
|
|
244
289
|
td.best::after{content:' ★';font-size:9px}
|
|
245
290
|
.miss{color:var(--mute)}
|
|
@@ -505,19 +550,26 @@ td.down{color:var(--bad);font-weight:600}
|
|
|
505
550
|
<!-- ============ Tab 3:监控 ============ -->
|
|
506
551
|
<div id="tab-watch" class="hidden">
|
|
507
552
|
<div class="section">
|
|
508
|
-
<h2>我的监控<span class="h2-acts"><button class="btn ghost sm" id="btnWatchRefresh" title="去 npm 实时查这些插件的最新数据">↻ 刷新</button><button class="ai hidden" id="aiWatch" title="把监控列表发到对话里,让 AI 看看谁在涨、谁停更了">+AI 看看近况</button></span></h2>
|
|
553
|
+
<h2>我的监控<span class="h2-acts"><button class="btn sm" id="btnWatchAdd" title="输入插件名或 GitHub 地址,加到我的监控" aria-expanded="false">+ 添加</button><button class="btn ghost sm" id="btnWatchRefresh" title="去 npm 实时查这些插件的最新数据">↻ 刷新</button><button class="ai hidden" id="aiWatch" title="把监控列表发到对话里,让 AI 看看谁在涨、谁停更了">+AI 看看近况</button></span></h2>
|
|
509
554
|
<p class="cap"><span id="watchAsOf"></span>监控列表存在浏览器本地,不上传。点「刷新」去 npm 和 GitHub 查最新:版本号、发版时间、GitHub 数据是即时的;周下载 npm 大约一天更新一次;日常基线和环比按 npm 已经出数据的最近 30 天算(npm 只在一天结束后才汇总,最近还常晚几天)。</p>
|
|
555
|
+
<div class="watchadd hidden" id="watchAdd">
|
|
556
|
+
<span class="addwrap">
|
|
557
|
+
<input id="addWatch" placeholder="输入插件名、npm 包名或 GitHub 地址" autocomplete="off" aria-label="输入插件名,加入我的监控">
|
|
558
|
+
<div id="watchSug" class="sug hidden" role="listbox"></div>
|
|
559
|
+
</span>
|
|
560
|
+
<button class="btn sm" id="watchAddGo">添加</button>
|
|
561
|
+
</div>
|
|
510
562
|
<div id="watchList"></div>
|
|
511
563
|
</div>
|
|
512
564
|
<div class="section" id="secWatchDetail">
|
|
513
565
|
<h2>监控详情 <span style="font-size:11.5px;color:var(--t3);font-weight:500" id="wdAsOf"></span></h2>
|
|
514
|
-
<
|
|
515
|
-
<div
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
<
|
|
519
|
-
<
|
|
520
|
-
<div id="
|
|
566
|
+
<div id="wdChanges" class="wdch hidden"></div>
|
|
567
|
+
<div id="wdMetrics" class="wdm" role="tablist" aria-label="按哪一项排"></div>
|
|
568
|
+
<div id="wdMine" class="wdmine hidden"></div>
|
|
569
|
+
<div id="wdBars" class="wdbars"></div>
|
|
570
|
+
<p class="cap wdnote">横条按名次比长短,数值差太大时(下载量)用对数刻度。点 ☆ 把自家产品标成「我的」,排名时算出和对手的差距。「较上次」和上一次刷新比:每次刷新都在本机存一份快照。</p>
|
|
571
|
+
<div class="tblwrap" id="wdTable"><table class="cmp wd"><thead id="wdHead"></thead><tbody id="wdBody"></tbody></table></div>
|
|
572
|
+
<div id="wdOne" class="wdone hidden"></div>
|
|
521
573
|
</div>
|
|
522
574
|
</div>
|
|
523
575
|
|