Skip to content

Commit 619f866

Browse files
committed
fixup!
1 parent 5ab7aa1 commit 619f866

File tree

9 files changed

+15
-12
lines changed

9 files changed

+15
-12
lines changed

src/generators/ast/generate.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function processChunk(inputSlice, itemIndices) {
3838
tree: remarkProcessor.parse(value),
3939
// The path is the relative path minus the extension
4040
path: relativePath,
41-
base: basename(relativePath),
41+
basename: basename(relativePath),
4242
});
4343
}
4444

src/generators/jsx-ast/utils/__tests__/buildBarProps.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('extractTextContent', () => {
6969
describe('buildMetaBarProps', () => {
7070
it('creates meta bar properties from entries', () => {
7171
const head = {
72-
base: 'fs',
72+
basename: 'fs',
7373
path: 'fs',
7474
added: 'v1.0.0',
7575
};

src/generators/jsx-ast/utils/buildBarProps.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ export const buildMetaBarProps = (head, entries) => {
9090
addedIn: head.added || head.introduced_in || '',
9191
readingTime: readingTime(extractTextContent(entries)).text,
9292
viewAs: [
93-
['JSON', `${head.base}.json`],
94-
['MD', `${head.base}.md`],
93+
['JSON', `${head.basename}.json`],
94+
['MD', `${head.basename}.md`],
9595
],
9696
editThisPage: `${populate(GITHUB_EDIT_URL, config)}${head.path}.md`,
9797
};

src/generators/legacy-html/generate.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function processChunk(slicedInput, itemIndices, navigation) {
5050
const template = {
5151
api: head.api,
5252
path: head.path,
53-
base: head.base,
53+
basename: head.basename,
5454
added: head.introduced_in ?? '',
5555
section: head.heading.data.name || apiAsHeading,
5656
toc,

src/generators/legacy-html/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { MetadataEntry } from '../metadata/types';
33
export interface TemplateValues {
44
api: string;
55
path: string;
6-
base: string;
6+
basename: string;
77
added: string;
88
section: string;
99
toc: string;

src/generators/legacy-html/utils/replaceTemplateValues.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import {
2222
*/
2323
export const replaceTemplateValues = (
2424
apiTemplate,
25-
{ api, base, path, added, section, toc, nav, content },
25+
{ api, basename, path, added, section, toc, nav, content },
2626
config,
2727
{ skipGitHub = false, skipGtocPicker = false } = {}
2828
) => {
2929
return apiTemplate
3030
.replace('__ID__', api)
31-
.replace(/__FILENAME__/g, base)
31+
.replace(/__FILENAME__/g, basename)
3232
.replace('__SECTION__', section)
3333
.replace(/__VERSION__/g, `v${config.version.version}`)
3434
.replace(/__TOC__/g, tableOfContents.wrapToC(toc))

src/generators/metadata/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export interface MetadataEntry extends YAMLProperties {
136136
/** Path + API identification */
137137
api: string;
138138
path: string; // Note: this is extensionless
139-
base: string;
139+
basename: string;
140140
/** Processed heading with metadata */
141141
heading: HeadingNode;
142142
/** Stability classification information */

src/generators/metadata/utils/parse.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
import { basename } from 'node:path';
4+
35
import { u as createTree } from 'unist-builder';
46
import { findAfter } from 'unist-util-find-after';
57
import { remove } from 'unist-util-remove';
@@ -67,7 +69,7 @@ export const parseApiDoc = ({ path, tree }, typeMap) => {
6769

6870
// On "About this Documentation", we define the stability indices, and thus
6971
// we don't need to check it for stability references
70-
const ignoreStability = IGNORE_STABILITY_STEMS.includes(api);
72+
const ignoreStability = IGNORE_STABILITY_STEMS.includes();
7173

7274
// Process each heading and create metadata entries
7375
visit(tree, UNIST.isHeading, (headingNode, index) => {
@@ -77,6 +79,7 @@ export const parseApiDoc = ({ path, tree }, typeMap) => {
7779
const metadata = /** @type {import('../types').MetadataEntry} */ ({
7880
api,
7981
path,
82+
basename: basename(path),
8083
heading: headingNode,
8184
});
8285

src/generators/web/utils/processing.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ export async function processJSXEntries(
110110

111111
// Step 3: Create final HTML (could be parallelized in workers)
112112
const results = await Promise.all(
113-
entries.map(async ({ data: { base, path, heading } }) => {
113+
entries.map(async ({ data: { basename, path, heading } }) => {
114114
const title = `${heading.data.name} | ${titleSuffix}`;
115115

116116
// Replace template placeholders with actual content
117117
const renderedHtml = template
118118
.replace('{{title}}', title)
119119
.replace('{{dehydrated}}', serverBundle.pages.get(`${path}.js`) ?? '')
120120
.replace('{{importMap}}', clientBundle.importMap ?? '')
121-
.replace('{{entrypoint}}', `./${base}.js?${randomUUID()}`)
121+
.replace('{{entrypoint}}', `./${basename}.js?${randomUUID()}`)
122122
.replace('{{speculationRules}}', SPECULATION_RULES)
123123
.replace('{{ogTitle}}', title);
124124

0 commit comments

Comments
 (0)