Skip to content

Commit 1115d05

Browse files
committed
refactor: remove generatedAt timestamp from API JSON output
Remove generation timestamp from API documentation JSON files to eliminate unnecessary Git diff noise when regenerating docs. - Remove generatedAt field from PackageDoc and ApiDocsIndex types - Remove timestamp generation in generate-api-docs.ts script - Remove footer timestamp display in api-markdown.ts - Update tests to remove generatedAt references This makes API doc generation idempotent - same input produces identical output, improving CI/CD reliability.
1 parent 619b4a8 commit 1115d05

4 files changed

Lines changed: 0 additions & 21 deletions

File tree

lib/api-docs.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,11 @@ export interface PackageDoc {
330330
moduleDoc?: string;
331331
/** Exported items */
332332
exports: DocNode[];
333-
/** Generation timestamp */
334-
generatedAt: string;
335333
}
336334

337335
export interface ApiDocsIndex {
338336
/** All packages */
339337
packages: PackageInfo[];
340-
/** Generation timestamp */
341-
generatedAt: string;
342338
}
343339

344340
export interface ExportCounts {

lib/api-markdown.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function createPackageDoc(overrides: Partial<PackageDoc> = {}): PackageDoc {
2525
specifier: "@probitas/test-package",
2626
version: "1.0.0",
2727
exports: [],
28-
generatedAt: "2024-01-01T00:00:00Z",
2928
...overrides,
3029
};
3130
}
@@ -490,15 +489,6 @@ Deno.test("generateApiMarkdown - generates local type links", () => {
490489
assertStringIncludes(result, "`Config`");
491490
});
492491

493-
Deno.test("generateApiMarkdown - includes generation timestamp", () => {
494-
const pkg = createPackageDoc({
495-
generatedAt: "2024-03-15T10:30:00Z",
496-
});
497-
const result = generateApiMarkdown(pkg);
498-
499-
assertStringIncludes(result, "*Generated at: 2024-03-15T10:30:00Z*");
500-
});
501-
502492
Deno.test("generateApiMarkdown - includes examples from JSDoc", () => {
503493
const pkg = createPackageDoc({
504494
exports: [

lib/api-markdown.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,5 @@ export function generateApiMarkdown(
738738
}
739739
}
740740

741-
// Footer
742-
lines.push("---");
743-
lines.push("");
744-
lines.push(`*Generated at: ${pkg.generatedAt}*`);
745-
746741
return lines.join("\n");
747742
}

scripts/generate-api-docs.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ async function generatePackageDoc(pkg: JsrPackage): Promise<PackageDoc | null> {
134134
version: pkg.latestVersion,
135135
moduleDoc,
136136
exports,
137-
generatedAt: new Date().toISOString(),
138137
};
139138
}
140139

@@ -156,7 +155,6 @@ async function savePackageDoc(doc: PackageDoc): Promise<void> {
156155
async function saveIndex(packages: PackageInfo[]): Promise<void> {
157156
const index: ApiDocsIndex = {
158157
packages,
159-
generatedAt: new Date().toISOString(),
160158
};
161159

162160
const filename = new URL("index.json", API_DIR);

0 commit comments

Comments
 (0)