Skip to content

Commit f05c2f4

Browse files
committed
Replace generated README with a static one
The pipeline no longer renders README.md from the catalog: src/render.ts and templates/README.hbs are gone, along with the --stdout flag that only existed to print the rendered output. README.md is now hand-written and documents the architecture, configuration and deployment instead of listing every star. The config section formerly named "readme" is now "catalog", since its title and description only ever fed data/catalog.json.
1 parent 45a6f82 commit f05c2f4

10 files changed

Lines changed: 209 additions & 1466 deletions

File tree

‎.github/workflows/deploy-pages.yml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Deploy Pages
22

33
on:
4-
push:
5-
branches:
6-
- main
74
schedule:
85
- cron: "17 5 * * 1"
96
workflow_dispatch:

‎README.md‎

Lines changed: 175 additions & 1166 deletions
Large diffs are not rendered by default.

‎config/config.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"readmeFallbackConfidenceThreshold": 0.4,
1616
"readmeCharacterLimit": 8000
1717
},
18-
"readme": {
18+
"catalog": {
1919
"title": "My Stars",
2020
"description": "A generated catalog of starred GitHub repositories, grouped into stable categories."
2121
},

‎config/config.schema.json‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "Stars Atlas App Config",
4-
"description": "Application, README, site, and classification settings for the generated stars atlas.",
4+
"description": "Application, catalog, site, and classification settings for the stars atlas generator.",
55
"type": "object",
66
"additionalProperties": false,
77
"properties": {
@@ -25,9 +25,9 @@
2525
"readmeFallbackConfidenceThreshold": 0.4
2626
}
2727
},
28-
"readme": {
29-
"$ref": "#/$defs/readmeConfig",
30-
"description": "Content settings used when regenerating the repository README."
28+
"catalog": {
29+
"$ref": "#/$defs/catalogConfig",
30+
"description": "Title and description written into the generated catalog manifest."
3131
},
3232
"site": {
3333
"$ref": "#/$defs/siteConfig",
@@ -145,21 +145,6 @@
145145
}
146146
}
147147
},
148-
"readmeConfig": {
149-
"title": "README Config",
150-
"type": "object",
151-
"additionalProperties": false,
152-
"properties": {
153-
"title": {
154-
"$ref": "#/$defs/trimmedString",
155-
"description": "Top-level title used in the generated README."
156-
},
157-
"description": {
158-
"$ref": "#/$defs/trimmedString",
159-
"description": "Short summary shown near the top of the generated README."
160-
}
161-
}
162-
},
163148
"siteSeoConfig": {
164149
"title": "Site SEO Config",
165150
"type": "object",
@@ -239,6 +224,21 @@
239224
"$ref": "#/$defs/siteManifestConfig"
240225
}
241226
}
227+
},
228+
"catalogConfig": {
229+
"title": "Catalog Config",
230+
"type": "object",
231+
"additionalProperties": false,
232+
"properties": {
233+
"title": {
234+
"$ref": "#/$defs/trimmedString",
235+
"description": "Catalog title written into data/catalog.json and used by the site."
236+
},
237+
"description": {
238+
"$ref": "#/$defs/trimmedString",
239+
"description": "Short catalog summary written into data/catalog.json."
240+
}
241+
}
242242
}
243243
}
244244
}

‎src/classify.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function formatAlternatives(alternatives: JevAlternative[]): string {
8686
.join(", ")}`;
8787
}
8888

89-
/** Decision logs go to stderr so --stdout keeps emitting only the README. */
89+
/** Decision logs go to stderr, so stdout stays reserved for the run summary. */
9090
function log(message: string): void {
9191
console.error(message);
9292
}

‎src/config.ts‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ export const paths = {
2020
classificationCache: new URL(".cache/jev-classifications.json", rootUrl),
2121
appConfig: new URL("config/config.json", rootUrl),
2222
categories: new URL("config/categories.json", rootUrl),
23-
template: new URL("templates/README.hbs", rootUrl),
24-
readme: new URL("README.md", rootUrl),
2523
};
2624

27-
const DEFAULT_README_TITLE = "My Stars";
28-
const DEFAULT_README_DESCRIPTION =
25+
const DEFAULT_CATALOG_TITLE = "My Stars";
26+
const DEFAULT_CATALOG_DESCRIPTION =
2927
"A generated catalog of starred GitHub repositories, grouped into stable categories.";
3028
const DEFAULT_README_FALLBACK_CONFIDENCE_THRESHOLD = 0.4;
3129
const DEFAULT_CLASSIFICATION_MODEL = "typesafe/jev-1.13";
@@ -198,9 +196,10 @@ export async function loadAppConfig(): Promise<AppConfig> {
198196
const avatarUrl = `${profileUrl}.png`;
199197
const classification = buildClassificationConfig(fileConfig);
200198

201-
const readmeTitle = fileConfig.readme?.title?.trim() || DEFAULT_README_TITLE;
202-
const readmeDescription =
203-
fileConfig.readme?.description?.trim() || DEFAULT_README_DESCRIPTION;
199+
const catalogTitle =
200+
fileConfig.catalog?.title?.trim() || DEFAULT_CATALOG_TITLE;
201+
const catalogDescription =
202+
fileConfig.catalog?.description?.trim() || DEFAULT_CATALOG_DESCRIPTION;
204203
const siteTitle = fileConfig.site?.title?.trim() || DEFAULT_SITE_TITLE;
205204
const siteUrl = (fileConfig.site?.url?.trim() || DEFAULT_SITE_URL).replace(
206205
/\/$/,
@@ -229,9 +228,9 @@ export async function loadAppConfig(): Promise<AppConfig> {
229228
avatarUrl,
230229
},
231230
classification,
232-
readme: {
233-
title: readmeTitle,
234-
description: readmeDescription,
231+
catalog: {
232+
title: catalogTitle,
233+
description: catalogDescription,
235234
},
236235
site: {
237236
title: siteTitle,
@@ -298,14 +297,13 @@ export async function loadRuntimeConfig(): Promise<RuntimeConfig> {
298297
app,
299298
username: app.github.username,
300299
dryRun: readFlag("--dry-run"),
301-
stdout: readFlag("--stdout"),
302300
forceRefresh: readFlag("--force") || readBooleanEnv("FORCE_REFRESH"),
303301
useCache: !readFlag("--no-cache") && !readBooleanEnv("NO_CACHE"),
304302
verbose: readFlag("--verbose") || readBooleanEnv("VERBOSE"),
305303
limit: readNumberFlag("--limit"),
306304
classification: app.classification,
307-
title: app.readme.title,
308-
description: app.readme.description,
305+
title: app.catalog.title,
306+
description: app.catalog.description,
309307
githubToken: Bun.env.GITHUB_TOKEN ?? Bun.env.GH_TOKEN,
310308
githubApiBaseUrl: GITHUB_API_BASE_URL,
311309
apiKey,

‎src/index.ts‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
fetchStarredRepositories,
1212
fetchStarredRepositoryCount,
1313
} from "./github.ts";
14-
import { renderReadme } from "./render.ts";
1514
import type {
1615
AppConfig,
1716
CatalogManifest,
@@ -153,7 +152,6 @@ function buildCatalogManifest(payload: {
153152
};
154153
}
155154
async function writeOutputs(payload: {
156-
readme: string;
157155
snapshot: StarsSnapshot;
158156
catalog: CatalogManifest;
159157
app: AppConfig;
@@ -169,7 +167,6 @@ async function writeOutputs(payload: {
169167
const canonicalUrl =
170168
payload.catalog.seo?.canonicalUrl ?? payload.app.site.url;
171169

172-
await Bun.write(paths.readme, payload.readme);
173170
await Bun.write(
174171
paths.catalog,
175172
`${JSON.stringify(payload.catalog, null, 2)}\n`,
@@ -262,24 +259,8 @@ async function main(): Promise<void> {
262259
recentCount: categoryConfig.recentCount,
263260
app: runtimeConfig.app,
264261
});
265-
const readme = await renderReadme(paths.template, {
266-
title: runtimeConfig.title,
267-
description: runtimeConfig.description,
268-
username: runtimeConfig.username,
269-
generatedAt,
270-
categories: classification.categories,
271-
recentCount: categoryConfig.recentCount,
272-
records: snapshot.items,
273-
changes,
274-
});
275-
276-
if (runtimeConfig.stdout) {
277-
console.log(readme);
278-
}
279-
280262
if (!runtimeConfig.dryRun) {
281263
await writeOutputs({
282-
readme,
283264
snapshot,
284265
catalog,
285266
app: runtimeConfig.app,

‎src/render.ts‎

Lines changed: 0 additions & 87 deletions
This file was deleted.

‎src/types.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export type AppConfigFile = {
6161
username: string;
6262
};
6363
classification?: ClassificationConfigFile;
64-
readme?: {
64+
catalog?: {
6565
title?: string;
6666
description?: string;
6767
};
@@ -134,7 +134,7 @@ export type AppConfig = {
134134
avatarUrl: string;
135135
};
136136
classification: ClassificationConfig;
137-
readme: {
137+
catalog: {
138138
title: string;
139139
description: string;
140140
};
@@ -292,7 +292,6 @@ export type RuntimeConfig = {
292292
app: AppConfig;
293293
username: string;
294294
dryRun: boolean;
295-
stdout: boolean;
296295
forceRefresh: boolean;
297296
useCache: boolean;
298297
/** Log every individual decision instead of periodic progress. */

0 commit comments

Comments
 (0)