@morehao/dsh-github-trending 0.2.0 → 0.3.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/CHANGELOG.md +34 -0
- package/README.md +24 -11
- package/client.js +1987 -186
- package/lib/{chunk-HIJIQJCZ.js → chunk-X4PBXIZE.js} +376 -80
- package/lib/index.js +29 -11
- package/lib/internal.d.ts +137 -86
- package/lib/internal.js +3 -1
- package/package.json +7 -6
- package/contract/CONTRACT.sha256 +0 -10
- package/contract/UPSTREAM.json +0 -37
- package/contract/fixtures/digest-degraded.json +0 -39
- package/contract/fixtures/digest-empty-lang.json +0 -39
- package/contract/fixtures/digest-normal.json +0 -91
- package/contract/schema/api.v1.yaml +0 -70
- package/contract/schema/digest.v1.json +0 -24
- package/contract/schema/ipc.v1.json +0 -104
- package/contract/schema/model.v1.json +0 -46
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": 1,
|
|
3
|
-
"date": "2026-10-30",
|
|
4
|
-
"period": "daily",
|
|
5
|
-
"languages": ["all", "go"],
|
|
6
|
-
"count": 2,
|
|
7
|
-
"degraded": true,
|
|
8
|
-
"contentHash": "sha256:b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2",
|
|
9
|
-
"coreVersion": "0.1.0",
|
|
10
|
-
"generatedAt": "2026-10-30T00:05:00Z",
|
|
11
|
-
"repos": [
|
|
12
|
-
{
|
|
13
|
-
"fullName": "golang/go",
|
|
14
|
-
"url": "https://github.com/golang/go",
|
|
15
|
-
"description": "The Go programming language",
|
|
16
|
-
"language": "go",
|
|
17
|
-
"stars": 126000,
|
|
18
|
-
"starsInPeriod": 0,
|
|
19
|
-
"forks": 17800,
|
|
20
|
-
"rank": 1,
|
|
21
|
-
"source": "search-api",
|
|
22
|
-
"summaryZh": "[原文] The Go programming language",
|
|
23
|
-
"summarySource": "original"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"fullName": "gin-gonic/gin",
|
|
27
|
-
"url": "https://github.com/gin-gonic/gin",
|
|
28
|
-
"description": "HTTP web framework written in Go",
|
|
29
|
-
"language": "go",
|
|
30
|
-
"stars": 80200,
|
|
31
|
-
"starsInPeriod": 0,
|
|
32
|
-
"forks": 8100,
|
|
33
|
-
"rank": 2,
|
|
34
|
-
"source": "search-api",
|
|
35
|
-
"summaryZh": "[原文] HTTP web framework written in Go",
|
|
36
|
-
"summarySource": "original"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": 1,
|
|
3
|
-
"date": "2026-10-30",
|
|
4
|
-
"period": "daily",
|
|
5
|
-
"languages": ["all", "unknown"],
|
|
6
|
-
"count": 2,
|
|
7
|
-
"degraded": false,
|
|
8
|
-
"contentHash": "sha256:c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
|
|
9
|
-
"coreVersion": "0.1.0",
|
|
10
|
-
"generatedAt": "2026-10-30T00:05:00Z",
|
|
11
|
-
"repos": [
|
|
12
|
-
{
|
|
13
|
-
"fullName": "someorg/no-language",
|
|
14
|
-
"url": "https://github.com/someorg/no-language",
|
|
15
|
-
"description": "A repo whose primary language could not be detected",
|
|
16
|
-
"language": "unknown",
|
|
17
|
-
"stars": 1200,
|
|
18
|
-
"starsInPeriod": 40,
|
|
19
|
-
"forks": 30,
|
|
20
|
-
"rank": 1,
|
|
21
|
-
"source": "trending-html",
|
|
22
|
-
"summaryZh": "语言未知的仓库,热度进入榜单。",
|
|
23
|
-
"summarySource": "model"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"fullName": "someorg/aggregate-only",
|
|
27
|
-
"url": "https://github.com/someorg/aggregate-only",
|
|
28
|
-
"description": "Repo surfaced only in the all-languages list",
|
|
29
|
-
"language": "unknown",
|
|
30
|
-
"stars": 980,
|
|
31
|
-
"starsInPeriod": 33,
|
|
32
|
-
"forks": 12,
|
|
33
|
-
"rank": 2,
|
|
34
|
-
"source": "trending-html",
|
|
35
|
-
"summaryZh": "仅在全局榜单出现的仓库。",
|
|
36
|
-
"summarySource": "model"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": 1,
|
|
3
|
-
"date": "2026-10-30",
|
|
4
|
-
"period": "daily",
|
|
5
|
-
"languages": ["all", "go", "python", "rust"],
|
|
6
|
-
"count": 6,
|
|
7
|
-
"degraded": false,
|
|
8
|
-
"contentHash": "sha256:3f7a2c9e1b4d5a6f8c0e2d4b6a8f0c2e4d6b8a0f2c4e6d8b0a2f4c6e8d0b2a4f",
|
|
9
|
-
"coreVersion": "0.1.0",
|
|
10
|
-
"generatedAt": "2026-10-30T00:05:00Z",
|
|
11
|
-
"repos": [
|
|
12
|
-
{
|
|
13
|
-
"fullName": "golang/go",
|
|
14
|
-
"url": "https://github.com/golang/go",
|
|
15
|
-
"description": "The Go programming language",
|
|
16
|
-
"language": "go",
|
|
17
|
-
"stars": 126000,
|
|
18
|
-
"starsInPeriod": 320,
|
|
19
|
-
"forks": 17800,
|
|
20
|
-
"rank": 1,
|
|
21
|
-
"source": "trending-html",
|
|
22
|
-
"summaryZh": "Go 官方仓库,今日新增 star 位居榜单前列。",
|
|
23
|
-
"summarySource": "model"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"fullName": "gin-gonic/gin",
|
|
27
|
-
"url": "https://github.com/gin-gonic/gin",
|
|
28
|
-
"description": "HTTP web framework written in Go",
|
|
29
|
-
"language": "go",
|
|
30
|
-
"stars": 80200,
|
|
31
|
-
"starsInPeriod": 210,
|
|
32
|
-
"forks": 8100,
|
|
33
|
-
"rank": 2,
|
|
34
|
-
"source": "trending-html",
|
|
35
|
-
"summaryZh": "流行的 Go Web 框架,热度持续。",
|
|
36
|
-
"summarySource": "model"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"fullName": "python/cpython",
|
|
40
|
-
"url": "https://github.com/python/cpython",
|
|
41
|
-
"description": "The Python programming language",
|
|
42
|
-
"language": "python",
|
|
43
|
-
"stars": 64500,
|
|
44
|
-
"starsInPeriod": 180,
|
|
45
|
-
"forks": 30500,
|
|
46
|
-
"rank": 3,
|
|
47
|
-
"source": "trending-html",
|
|
48
|
-
"summaryZh": "CPython 官方实现,今日关注度上升。",
|
|
49
|
-
"summarySource": "model"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"fullName": "psf/requests",
|
|
53
|
-
"url": "https://github.com/psf/requests",
|
|
54
|
-
"description": "A simple, yet elegant HTTP library",
|
|
55
|
-
"language": "python",
|
|
56
|
-
"stars": 52500,
|
|
57
|
-
"starsInPeriod": 95,
|
|
58
|
-
"forks": 9400,
|
|
59
|
-
"rank": 4,
|
|
60
|
-
"source": "trending-html",
|
|
61
|
-
"summaryZh": "经典 Python HTTP 库,稳居热榜。",
|
|
62
|
-
"summarySource": "model"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"fullName": "rust-lang/rust",
|
|
66
|
-
"url": "https://github.com/rust-lang/rust",
|
|
67
|
-
"description": "Empowering everyone to build reliable and efficient software",
|
|
68
|
-
"language": "rust",
|
|
69
|
-
"stars": 102000,
|
|
70
|
-
"starsInPeriod": 260,
|
|
71
|
-
"forks": 13200,
|
|
72
|
-
"rank": 5,
|
|
73
|
-
"source": "trending-html",
|
|
74
|
-
"summaryZh": "Rust 语言主仓库,社区活跃。",
|
|
75
|
-
"summarySource": "model"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"fullName": "tokio-rs/tokio",
|
|
79
|
-
"url": "https://github.com/tokio-rs/tokio",
|
|
80
|
-
"description": "A runtime for writing reliable asynchronous applications with Rust",
|
|
81
|
-
"language": "rust",
|
|
82
|
-
"stars": 28600,
|
|
83
|
-
"starsInPeriod": 120,
|
|
84
|
-
"forks": 2650,
|
|
85
|
-
"rank": 6,
|
|
86
|
-
"source": "trending-html",
|
|
87
|
-
"summaryZh": "Rust 异步运行时,性能方向关注度高。",
|
|
88
|
-
"summarySource": "model"
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
openapi: 3.1.0
|
|
2
|
-
info:
|
|
3
|
-
title: trendradar serve API
|
|
4
|
-
version: 1.0.0
|
|
5
|
-
description: |
|
|
6
|
-
Read-only HTTP surface exposed by `trendradar serve`. All payloads reuse the
|
|
7
|
-
digest.v1 schema, so the plugin can consume the same shape whether data comes
|
|
8
|
-
from the filesystem or over HTTP.
|
|
9
|
-
servers:
|
|
10
|
-
- url: http://127.0.0.1:8787
|
|
11
|
-
paths:
|
|
12
|
-
/api/v1/digests/{date}:
|
|
13
|
-
get:
|
|
14
|
-
operationId: getDigest
|
|
15
|
-
summary: Fetch one day's digest
|
|
16
|
-
parameters:
|
|
17
|
-
- name: date
|
|
18
|
-
in: path
|
|
19
|
-
required: true
|
|
20
|
-
schema:
|
|
21
|
-
type: string
|
|
22
|
-
format: date
|
|
23
|
-
responses:
|
|
24
|
-
"200":
|
|
25
|
-
description: The digest document
|
|
26
|
-
content:
|
|
27
|
-
application/json:
|
|
28
|
-
schema:
|
|
29
|
-
$ref: "./digest.v1.json"
|
|
30
|
-
"404":
|
|
31
|
-
description: No digest for that date
|
|
32
|
-
/api/v1/manifest:
|
|
33
|
-
get:
|
|
34
|
-
operationId: getManifest
|
|
35
|
-
summary: List available dates and their contentHash
|
|
36
|
-
responses:
|
|
37
|
-
"200":
|
|
38
|
-
description: Manifest of available digests
|
|
39
|
-
content:
|
|
40
|
-
application/json:
|
|
41
|
-
schema:
|
|
42
|
-
type: object
|
|
43
|
-
required: [entries]
|
|
44
|
-
properties:
|
|
45
|
-
coreVersion:
|
|
46
|
-
type: string
|
|
47
|
-
entries:
|
|
48
|
-
type: array
|
|
49
|
-
items:
|
|
50
|
-
type: object
|
|
51
|
-
required: [date, contentHash]
|
|
52
|
-
properties:
|
|
53
|
-
date:
|
|
54
|
-
type: string
|
|
55
|
-
format: date
|
|
56
|
-
contentHash:
|
|
57
|
-
type: string
|
|
58
|
-
degraded:
|
|
59
|
-
type: boolean
|
|
60
|
-
/feed.xml:
|
|
61
|
-
get:
|
|
62
|
-
operationId: getFeed
|
|
63
|
-
summary: RSS feed of the most recent digests
|
|
64
|
-
responses:
|
|
65
|
-
"200":
|
|
66
|
-
description: RSS 2.0 feed
|
|
67
|
-
content:
|
|
68
|
-
application/rss+xml:
|
|
69
|
-
schema:
|
|
70
|
-
type: string
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.v1.json",
|
|
4
|
-
"title": "trendradar digest v1",
|
|
5
|
-
"description": "One day's rendered digest document. contentHash is stable across runs (generatedAt/coreVersion excluded).",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": true,
|
|
8
|
-
"required": ["schema", "date", "period", "languages", "count", "degraded", "contentHash", "repos"],
|
|
9
|
-
"properties": {
|
|
10
|
-
"schema": { "const": 1 },
|
|
11
|
-
"date": { "type": "string", "format": "date" },
|
|
12
|
-
"period": { "type": "string", "enum": ["daily", "weekly", "monthly"] },
|
|
13
|
-
"languages": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
14
|
-
"count": { "type": "integer", "minimum": 0 },
|
|
15
|
-
"degraded": { "type": "boolean" },
|
|
16
|
-
"contentHash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
|
|
17
|
-
"coreVersion": { "type": "string" },
|
|
18
|
-
"generatedAt": { "type": "string", "format": "date-time" },
|
|
19
|
-
"repos": {
|
|
20
|
-
"type": "array",
|
|
21
|
-
"items": { "$ref": "model.v1.json#/$defs/RepoDigest" }
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v1.json",
|
|
4
|
-
"title": "trendradar ipc v1",
|
|
5
|
-
"description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields.",
|
|
6
|
-
"oneOf": [
|
|
7
|
-
{ "$ref": "#/$defs/RunRequest" },
|
|
8
|
-
{ "$ref": "#/$defs/RunResult" }
|
|
9
|
-
],
|
|
10
|
-
"$defs": {
|
|
11
|
-
"ErrorCode": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"enum": [
|
|
14
|
-
"INTERNAL",
|
|
15
|
-
"CONFIG_INVALID",
|
|
16
|
-
"PAYLOAD_TOO_LARGE",
|
|
17
|
-
"FETCH_FAILED",
|
|
18
|
-
"FETCH_RATE_LIMITED",
|
|
19
|
-
"PARSE_FAILED",
|
|
20
|
-
"MODEL_UNAUTHORIZED",
|
|
21
|
-
"MODEL_RATE_LIMITED",
|
|
22
|
-
"MODEL_TIMEOUT",
|
|
23
|
-
"MODEL_FAILED",
|
|
24
|
-
"MODEL_BAD_OUTPUT",
|
|
25
|
-
"GIT_NOT_INSTALLED",
|
|
26
|
-
"REPO_NOT_GIT",
|
|
27
|
-
"REPO_DIRTY",
|
|
28
|
-
"GIT_OPERATION_FAILED",
|
|
29
|
-
"PR_FAILED",
|
|
30
|
-
"NOT_MERGEABLE"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"ErrorInfo": {
|
|
34
|
-
"type": "object",
|
|
35
|
-
"additionalProperties": true,
|
|
36
|
-
"required": ["code", "message", "retriable"],
|
|
37
|
-
"properties": {
|
|
38
|
-
"code": { "$ref": "#/$defs/ErrorCode" },
|
|
39
|
-
"message": { "type": "string" },
|
|
40
|
-
"retriable": { "type": "boolean" },
|
|
41
|
-
"details": { "type": "object", "additionalProperties": true }
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"FileArtifact": {
|
|
45
|
-
"type": "object",
|
|
46
|
-
"additionalProperties": true,
|
|
47
|
-
"required": ["path", "bytes", "sha256"],
|
|
48
|
-
"properties": {
|
|
49
|
-
"path": { "type": "string" },
|
|
50
|
-
"bytes": { "type": "integer", "minimum": 0 },
|
|
51
|
-
"sha256": { "type": "string" }
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"RunRequest": {
|
|
55
|
-
"type": "object",
|
|
56
|
-
"additionalProperties": false,
|
|
57
|
-
"required": ["ipcSchema", "command"],
|
|
58
|
-
"properties": {
|
|
59
|
-
"ipcSchema": { "const": 1 },
|
|
60
|
-
"command": { "type": "string", "enum": ["run", "serve", "config", "version"] },
|
|
61
|
-
"configPath": { "type": "string" },
|
|
62
|
-
"date": { "type": "string", "format": "date" },
|
|
63
|
-
"dryRun": { "type": "boolean" },
|
|
64
|
-
"outputDir": { "type": "string" }
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"RunResult": {
|
|
68
|
-
"type": "object",
|
|
69
|
-
"additionalProperties": true,
|
|
70
|
-
"required": ["ipcSchema", "ok", "command", "startedAt", "finishedAt", "skipped", "files"],
|
|
71
|
-
"properties": {
|
|
72
|
-
"ipcSchema": { "const": 1 },
|
|
73
|
-
"ok": { "type": "boolean" },
|
|
74
|
-
"command": { "type": "string", "enum": ["run", "serve", "config", "version"] },
|
|
75
|
-
"startedAt": { "type": "string", "format": "date-time" },
|
|
76
|
-
"finishedAt": { "type": "string", "format": "date-time" },
|
|
77
|
-
"skipped": { "type": "boolean" },
|
|
78
|
-
"files": { "type": "array", "items": { "$ref": "#/$defs/FileArtifact" } },
|
|
79
|
-
"error": { "$ref": "#/$defs/ErrorInfo" },
|
|
80
|
-
"warnings": { "type": "array", "items": { "type": "string" } }
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"StateRun": {
|
|
84
|
-
"type": "object",
|
|
85
|
-
"additionalProperties": true,
|
|
86
|
-
"required": ["date", "contentHash", "runAt"],
|
|
87
|
-
"properties": {
|
|
88
|
-
"date": { "type": "string", "format": "date" },
|
|
89
|
-
"contentHash": { "type": "string" },
|
|
90
|
-
"outputDir": { "type": "string" },
|
|
91
|
-
"runAt": { "type": "string", "format": "date-time" }
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
"State": {
|
|
95
|
-
"type": "object",
|
|
96
|
-
"additionalProperties": true,
|
|
97
|
-
"required": ["ipcSchema"],
|
|
98
|
-
"properties": {
|
|
99
|
-
"ipcSchema": { "const": 1 },
|
|
100
|
-
"lastRun": { "$ref": "#/$defs/StateRun" }
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/model.v1.json",
|
|
4
|
-
"title": "trendradar model v1",
|
|
5
|
-
"description": "Domain model: a scraped repository snapshot and its digested form.",
|
|
6
|
-
"$ref": "#/$defs/RepoSnapshot",
|
|
7
|
-
"$defs": {
|
|
8
|
-
"RepoSnapshot": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"additionalProperties": true,
|
|
11
|
-
"required": ["fullName", "url", "language", "stars", "starsInPeriod", "rank", "source"],
|
|
12
|
-
"properties": {
|
|
13
|
-
"fullName": { "type": "string", "pattern": "^[^/]+/[^/]+$" },
|
|
14
|
-
"url": { "type": "string", "format": "uri" },
|
|
15
|
-
"description": { "type": "string" },
|
|
16
|
-
"language": { "type": "string" },
|
|
17
|
-
"stars": { "type": "integer", "minimum": 0 },
|
|
18
|
-
"starsInPeriod": { "type": "integer", "minimum": 0 },
|
|
19
|
-
"forks": { "type": "integer", "minimum": 0 },
|
|
20
|
-
"rank": { "type": "integer", "minimum": 1 },
|
|
21
|
-
"source": { "type": "string", "enum": ["trending-html", "search-api"] }
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"RepoDigest": {
|
|
25
|
-
"type": "object",
|
|
26
|
-
"additionalProperties": true,
|
|
27
|
-
"required": [
|
|
28
|
-
"fullName", "url", "language", "stars", "starsInPeriod", "rank",
|
|
29
|
-
"source", "summaryZh", "summarySource"
|
|
30
|
-
],
|
|
31
|
-
"properties": {
|
|
32
|
-
"fullName": { "type": "string", "pattern": "^[^/]+/[^/]+$" },
|
|
33
|
-
"url": { "type": "string", "format": "uri" },
|
|
34
|
-
"description": { "type": "string" },
|
|
35
|
-
"language": { "type": "string" },
|
|
36
|
-
"stars": { "type": "integer", "minimum": 0 },
|
|
37
|
-
"starsInPeriod": { "type": "integer", "minimum": 0 },
|
|
38
|
-
"forks": { "type": "integer", "minimum": 0 },
|
|
39
|
-
"rank": { "type": "integer", "minimum": 1 },
|
|
40
|
-
"source": { "type": "string", "enum": ["trending-html", "search-api"] },
|
|
41
|
-
"summaryZh": { "type": "string" },
|
|
42
|
-
"summarySource": { "type": "string", "enum": ["model", "original"] }
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|