Rename name to absolutePath for clarity

This commit is contained in:
Mario Campos
2026-09-21 16:31:55 -05:00
parent 598cda36cf
commit c496c6cceb

View File

@@ -21,7 +21,7 @@ import { CHANGENOTES_DIR } from "./config";
* Describes a changenote file, including its file path, frontmatter, and content. * Describes a changenote file, including its file path, frontmatter, and content.
*/ */
interface ChangenoteFile { interface ChangenoteFile {
name: string; absolutePath: string;
data: Record<string, any>; data: Record<string, any>;
content: string; content: string;
} }
@@ -42,10 +42,10 @@ function listUnreleasedChangenoteDir(): string[] {
* and returns a parsed listing of those changenote files. * and returns a parsed listing of those changenote files.
*/ */
function getChangenotes(): ChangenoteFile[] { function getChangenotes(): ChangenoteFile[] {
return listUnreleasedChangenoteDir().map((name) => { return listUnreleasedChangenoteDir().map((absolutePath) => {
return { return {
name, absolutePath,
...matter(fs.readFileSync(name, "utf-8")), ...matter(fs.readFileSync(absolutePath, "utf-8")),
}; };
}); });
} }
@@ -93,7 +93,7 @@ function assemble(): ExitCode {
try { try {
const changenotes = getChangenotes(); const changenotes = getChangenotes();
const changenoteBodies = changenotes.map((c) => c.content); const changenoteBodies = changenotes.map((c) => c.content);
const changenotePaths = changenotes.map((c) => c.name); const changenotePaths = changenotes.map((c) => c.absolutePath);
withChangelog((contents) => { withChangelog((contents) => {
const changelog = parseChangelog(contents); const changelog = parseChangelog(contents);