github-search-cli 9.8.2 → 9.9.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 +129 -0
- package/README.md +65 -26
- package/dist/cli.js +898 -184
- package/docs/HOW-TO.md +254 -0
- package/package.json +2 -1
- package/release-notes/9.8.3.md +98 -0
- package/release-notes/9.9.0.md +193 -0
- package/src/cli.ts +13 -11
- package/src/errors.ts +56 -5
- package/src/help.ts +11 -0
- package/src/image-loader.ts +57 -2
- package/src/markdown-images.ts +93 -4
- package/src/markdown-view.ts +49 -20
- package/src/mcp-server.ts +34 -2
- package/src/search-state.ts +8 -10
- package/src/search.ts +701 -12
- package/src/session.ts +58 -2
- package/src/trending.ts +2 -6
- package/src/tui.ts +236 -50
- package/src/types.ts +11 -1
- package/src/update-check.ts +72 -6
- package/src/watch.ts +16 -11
package/src/watch.ts
CHANGED
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
applyFlagFilters,
|
|
9
9
|
rankRepos,
|
|
10
10
|
createGitHubSearch,
|
|
11
|
+
validateQuery,
|
|
11
12
|
} from "./search";
|
|
12
|
-
import { createTrendingSearch } from "./search";
|
|
13
|
+
import { createTrendingSearch, trendingQuery } from "./search";
|
|
13
14
|
|
|
14
15
|
export interface WatchOptions {
|
|
15
16
|
query: string;
|
|
@@ -32,6 +33,13 @@ export async function runWatch(
|
|
|
32
33
|
let failCount = 0;
|
|
33
34
|
let intervalId: ReturnType<typeof setInterval> | null = null;
|
|
34
35
|
|
|
36
|
+
// Validate once, before the poll loop starts. A malformed query is not
|
|
37
|
+
// transient, so letting it reach the tick would burn the retry budget and
|
|
38
|
+
// report the same error five times instead of failing fast.
|
|
39
|
+
if (!opts.trending) {
|
|
40
|
+
validateQuery(applyFlagFilters(parseQuery(opts.query), {}));
|
|
41
|
+
}
|
|
42
|
+
|
|
35
43
|
const tick = async () => {
|
|
36
44
|
try {
|
|
37
45
|
let repos: Repo[];
|
|
@@ -43,16 +51,13 @@ export async function runWatch(
|
|
|
43
51
|
? "monthly"
|
|
44
52
|
: "daily";
|
|
45
53
|
const trendingSearch = createTrendingSearch();
|
|
46
|
-
const response = await trendingSearch.search(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
trendingSince: since,
|
|
54
|
-
},
|
|
55
|
-
);
|
|
54
|
+
const response = await trendingSearch.search(trendingQuery(), {
|
|
55
|
+
limit: opts.limit,
|
|
56
|
+
sort: opts.sort,
|
|
57
|
+
json: false,
|
|
58
|
+
verbose: false,
|
|
59
|
+
trendingSince: since,
|
|
60
|
+
});
|
|
56
61
|
repos = response.repos;
|
|
57
62
|
} else {
|
|
58
63
|
const parsed = applyFlagFilters(parseQuery(opts.query), {});
|