From 39673a2de67e5c27e10137ee5c68c1818a045124 Mon Sep 17 00:00:00 2001 From: Nick Wylynko Date: Fri, 7 Mar 2025 04:56:34 +0800 Subject: [PATCH] switch all terminology from guide over to doc --- scripts/build-docs.test.ts | 12 ++++++------ scripts/build-docs.ts | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/build-docs.test.ts b/scripts/build-docs.test.ts index 14b97b3d6a..94cf5f0b31 100644 --- a/scripts/build-docs.test.ts +++ b/scripts/build-docs.test.ts @@ -249,7 +249,7 @@ Authentication login documentation.`, ) await expect(promise).rejects.toThrow( - 'Guide "Login" is attempting to use ["react","python"] But its being filtered down to ["react"] in the manifest.json', + 'Doc "Login" is attempting to use ["react","python"] But its being filtered down to ["react"] in the manifest.json', ) }) @@ -385,7 +385,7 @@ title: Simple Test }), ) - expect(output).toContain(`warning Guide /docs/non-existent-page not found`) + expect(output).toContain(`warning Doc /docs/non-existent-page not found`) }) test('Validate link between two pages is valid', async () => { @@ -424,7 +424,7 @@ title: Core Page }), ) - expect(output).not.toContain(`warning Guide /docs/core-page not found`) + expect(output).not.toContain(`warning Doc /docs/core-page not found`) }) test('Warn if link is to existent page but with invalid hash', async () => { @@ -507,13 +507,13 @@ describe('Path and File Handling', () => { { path: './docs/manifest.json', content: JSON.stringify({ - navigation: [[{ title: 'React Guide', href: '/docs/react/conflict' }]], + navigation: [[{ title: 'React Doc', href: '/docs/react/conflict' }]], }), }, { path: './docs/react/conflict.mdx', content: `--- -title: React Guide +title: React Doc --- # This will cause a conflict because it's in a path that starts with "react"`, @@ -756,7 +756,7 @@ title: Document with Warnings ) // Check that warnings were reported - expect(output).toContain('warning Guide /docs/non-existent-document not found') + expect(output).toContain('warning Doc /docs/non-existent-document not found') expect(output).toContain('warning sdk "invalid-sdk" in is not a valid SDK') }) }) diff --git a/scripts/build-docs.ts b/scripts/build-docs.ts index 6ed680c822..5326a01185 100644 --- a/scripts/build-docs.ts +++ b/scripts/build-docs.ts @@ -465,7 +465,7 @@ const parseInMarkdownFile = .use(() => (tree, vfile) => { if (inManifest === false) { vfile.message( - 'This guide is not in the manifest.json, but will still be publicly accessible and other guides can link to it', + 'This doc is not in the manifest.json, but will still be publicly accessible and other docs can link to it', ) } @@ -703,7 +703,7 @@ export const build = async (config: BuildConfig) => { const coreVFiles = await Promise.all( docsArray.map(async (doc) => { const vfile = await markdownProcessor() - // Validate links between guides are valid + // Validate links between docs are valid .use(() => (tree: Node, vfile: VFile) => { return mdastVisit(tree, (node) => { if (node.type !== 'link') return @@ -717,15 +717,15 @@ export const build = async (config: BuildConfig) => { const ignore = config.ignorePaths.some((ignoreItem) => url.startsWith(ignoreItem)) if (ignore === true) return - const guide = docsMap.get(url) + const doc = docsMap.get(url) - if (guide === undefined) { - vfile.message(`Guide ${url} not found`, node.position) + if (doc === undefined) { + vfile.message(`Doc ${url} not found`, node.position) return } if (hash !== undefined) { - const hasHash = guide.headingsHashs.includes(hash) + const hasHash = doc.headingsHashs.includes(hash) if (hasHash === false) { vfile.message(`Hash "${hash}" not found in ${url}`, node.position) @@ -759,7 +759,7 @@ export const build = async (config: BuildConfig) => { if (available === false) { vfile.fail( - ` component is attempting to filter to sdk "${sdk}" but it is not available in the guides frontmatter ["${doc.sdk.join('", "')}"], if this is a mistake please remove it from the otherwise update the frontmatter to include "${sdk}"`, + ` component is attempting to filter to sdk "${sdk}" but it is not available in the docs frontmatter ["${doc.sdk.join('", "')}"], if this is a mistake please remove it from the otherwise update the frontmatter to include "${sdk}"`, node.position, ) }