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:
Renan Mendes Carvalho
2023-02-08 15:10:41 +01:00
parent 289e2faac8
commit d746d81bdd
8 changed files with 17 additions and 17 deletions
@@ -21,7 +21,7 @@ import Docker from 'dockerode';
import {
TechdocsGenerator,
ParsedLocationAnnotation,
getMkDocsYml,
getMkdocsYml,
} from '@backstage/plugin-techdocs-node';
import {
ContainerRunner,
@@ -55,7 +55,7 @@ export default async function generate(opts: OptionValues) {
await fs.ensureDir(outputDir);
const { path: mkDocsYmlPath, configIsTemporary } = await getMkDocsYml(
const { path: mkDocsYmlPath, configIsTemporary } = await getMkdocsYml(
sourceDir,
);
@@ -19,7 +19,7 @@ import openBrowser from 'react-dev-utils/openBrowser';
import { createLogger } from '../../lib/utility';
import { runMkdocsServer } from '../../lib/mkdocsServer';
import { LogFunc, waitForSignal } from '../../lib/run';
import { getMkDocsYml } from '@backstage/plugin-techdocs-node';
import { getMkdocsYml } from '@backstage/plugin-techdocs-node';
import fs from 'fs-extra';
export default async function serveMkdocs(opts: OptionValues) {
@@ -29,7 +29,7 @@ export default async function serveMkdocs(opts: OptionValues) {
const localAddr = `http://127.0.0.1:${opts.port}`;
const expectedDevAddr = opts.docker ? dockerAddr : localAddr;
const { path: mkDocsYmlPath, configIsTemporary } = await getMkDocsYml(
const { path: mkDocsYmlPath, configIsTemporary } = await getMkdocsYml(
'./',
opts.siteName,
);
@@ -22,7 +22,7 @@ import HTTPServer from '../../lib/httpServer';
import { runMkdocsServer } from '../../lib/mkdocsServer';
import { LogFunc, waitForSignal } from '../../lib/run';
import { createLogger } from '../../lib/utility';
import { getMkDocsYml } from '@backstage/plugin-techdocs-node';
import { getMkdocsYml } from '@backstage/plugin-techdocs-node';
import fs from 'fs-extra';
function findPreviewBundlePath(): string {
@@ -66,7 +66,7 @@ export default async function serve(opts: OptionValues) {
? mkdocsDockerAddr
: mkdocsLocalAddr;
const { path: mkDocsYmlPath, configIsTemporary } = await getMkDocsYml(
const { path: mkDocsYmlPath, configIsTemporary } = await getMkdocsYml(
'./',
opts.siteName,
);
+1 -1
View File
@@ -89,7 +89,7 @@ export const getLocationForEntity: (
) => ParsedLocationAnnotation;
// @public
export const getMkDocsYml: (
export const getMkdocsYml: (
inputDir: string,
siteOptions?: {
name?: string;
@@ -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,
);