renaming(getMkDocsYml): Renamed to getMkdocsYml
Suggested by kmatyukhin on https://github.com/backstage/backstage/pull/15417 Signed-off-by: Renan Mendes Carvalho <aitherios@gmail.com> Co-authored-by: Konstantin Matyukhin <kmatyukhin@gmail.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import { ParsedLocationAnnotation } from '../../helpers';
|
||||
import {
|
||||
createOrUpdateMetadata,
|
||||
getGeneratorKey,
|
||||
getMkDocsYml,
|
||||
getMkdocsYml,
|
||||
getRepoUrlFromLocationAnnotation,
|
||||
patchIndexPreBuild,
|
||||
storeEtagMetadata,
|
||||
@@ -517,7 +517,7 @@ describe('helpers', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getMkDocsYml', () => {
|
||||
describe('getMkdocsYml', () => {
|
||||
const inputDir = resolvePath(__filename, '../__fixtures__/');
|
||||
const siteOptions = {
|
||||
name: mockEntity.metadata.title,
|
||||
@@ -530,7 +530,7 @@ describe('helpers', () => {
|
||||
path: mkdocsPath,
|
||||
content,
|
||||
configIsTemporary,
|
||||
} = await getMkDocsYml(inputDir, siteOptions);
|
||||
} = await getMkdocsYml(inputDir, siteOptions);
|
||||
|
||||
expect(mkdocsPath).toBe(key);
|
||||
expect(content).toBe(mkdocsYml.toString());
|
||||
@@ -544,7 +544,7 @@ describe('helpers', () => {
|
||||
path: mkdocsPath,
|
||||
content,
|
||||
configIsTemporary,
|
||||
} = await getMkDocsYml(inputDir, siteOptions);
|
||||
} = await getMkdocsYml(inputDir, siteOptions);
|
||||
expect(mkdocsPath).toBe(key);
|
||||
expect(content).toBe(mkdocsYml.toString());
|
||||
expect(configIsTemporary).toBe(false);
|
||||
@@ -562,7 +562,7 @@ describe('helpers', () => {
|
||||
path: mkdocsPath,
|
||||
content,
|
||||
configIsTemporary,
|
||||
} = await getMkDocsYml(inputDir, defaultSiteOptions);
|
||||
} = await getMkdocsYml(inputDir, defaultSiteOptions);
|
||||
|
||||
expect(mkdocsPath).toBe(key);
|
||||
expect(content).toBe(mkdocsDefaultYml.toString());
|
||||
@@ -571,7 +571,7 @@ describe('helpers', () => {
|
||||
|
||||
it('throws when neither .yml nor .yaml nor default file is present', async () => {
|
||||
const invalidInputDir = resolvePath(__filename);
|
||||
await expect(getMkDocsYml(invalidInputDir, siteOptions)).rejects.toThrow(
|
||||
await expect(getMkdocsYml(invalidInputDir, siteOptions)).rejects.toThrow(
|
||||
/Could not read MkDocs YAML config file mkdocs.yml or mkdocs.yaml or default for validation/,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -193,7 +193,7 @@ export const generateMkdocsYml = async (
|
||||
* @param siteOptions - options for the site: `name` property will be used in mkdocs.yml for the
|
||||
* required `site_name` property, default value is "Documentation Site"
|
||||
*/
|
||||
export const getMkDocsYml = async (
|
||||
export const getMkdocsYml = async (
|
||||
inputDir: string,
|
||||
siteOptions?: { name?: string },
|
||||
): Promise<{ path: string; content: string; configIsTemporary: boolean }> => {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
export { TechdocsGenerator } from './techdocs';
|
||||
export { Generators } from './generators';
|
||||
export { getMkDocsYml } from './helpers';
|
||||
export { getMkdocsYml } from './helpers';
|
||||
export type {
|
||||
GeneratorBase,
|
||||
GeneratorOptions,
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
} from '@backstage/integration';
|
||||
import {
|
||||
createOrUpdateMetadata,
|
||||
getMkDocsYml,
|
||||
getMkdocsYml,
|
||||
patchIndexPreBuild,
|
||||
runCommand,
|
||||
storeEtagMetadata,
|
||||
@@ -100,7 +100,7 @@ export class TechdocsGenerator implements GeneratorBase {
|
||||
} = options;
|
||||
|
||||
// Do some updates to mkdocs.yml before generating docs e.g. adding repo_url
|
||||
const { path: mkdocsYmlPath, content } = await getMkDocsYml(
|
||||
const { path: mkdocsYmlPath, content } = await getMkdocsYml(
|
||||
inputDir,
|
||||
siteOptions,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user