Skip to content

Commit df8b13d

Browse files
committed
fix(dialtone-docs): DLT-3109 address PR review feedback
- Fix non-deterministic date serialization: String(Date) is timezone-dependent, use toISOString().split('T')[0] for stable YYYY-MM-DD output - Remove redundant null assertion in type field test
1 parent 208c3b3 commit df8b13d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/dialtone-docs/src/generators/build-ai-docs.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ function buildEntry(absolutePath) {
4949
keywords: Array.isArray(frontmatter.keywords) ? frontmatter.keywords : [],
5050
summary: frontmatter.ai_summary ?? null,
5151
content,
52-
lastUpdated: frontmatter.last_updated ? String(frontmatter.last_updated) : null,
52+
lastUpdated: frontmatter.last_updated instanceof Date
53+
? frontmatter.last_updated.toISOString().split('T')[0]
54+
: (frontmatter.last_updated ?? null),
5355
relatedPackages: Array.isArray(frontmatter.related_packages) ? frontmatter.related_packages : [],
5456
filePath,
5557
};

packages/dialtone-docs/tests/tests/build-output.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ describe('Build output — dist/ai-docs.json', () => {
4343

4444
test('type field uses allowed values', () => {
4545
for (const doc of docs) {
46-
expect(doc.type, `"${doc.id}" type is null`).not.toBeNull();
4746
expect(ALLOWED_TYPES, `"${doc.id}" invalid type "${doc.type}"`).toContain(doc.type);
4847
}
4948
});

0 commit comments

Comments
 (0)