Skip to content

Commit 1e720e6

Browse files
authored
Merge pull request #4191 from microsoft/revert-4049-main
Revert "[api-documenter] Read config when generating markdown files"
2 parents a93a973 + 4dc8b66 commit 1e720e6

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

apps/api-documenter/src/cli/MarkdownAction.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import { ApiDocumenterCommandLine } from './ApiDocumenterCommandLine';
55
import { BaseAction } from './BaseAction';
66
import { MarkdownDocumenter } from '../documenters/MarkdownDocumenter';
7-
import path from 'path';
8-
import { DocumenterConfig } from '../documenters/DocumenterConfig';
9-
import { FileSystem } from '@rushstack/node-core-library';
107

118
export class MarkdownAction extends BaseAction {
129
public constructor(parser: ApiDocumenterCommandLine) {
@@ -20,26 +17,12 @@ export class MarkdownAction extends BaseAction {
2017
}
2118

2219
protected async onExecute(): Promise<void> {
23-
let configFilePath: string | undefined = path.join(process.cwd(), DocumenterConfig.FILENAME);
24-
25-
// First try the current folder
26-
if (!FileSystem.exists(configFilePath)) {
27-
// Otherwise try the standard "config" subfolder
28-
configFilePath = path.join(process.cwd(), 'config', DocumenterConfig.FILENAME);
29-
if (!FileSystem.exists(configFilePath)) {
30-
console.warn(
31-
`Unable to find ${DocumenterConfig.FILENAME} in the current folder or in a "config" subfolder`
32-
);
33-
configFilePath = undefined;
34-
}
35-
}
36-
37-
const documenterConfig: DocumenterConfig | undefined = configFilePath ? DocumenterConfig.loadFile(configFilePath) : undefined;
20+
// override
3821
const { apiModel, outputFolder } = this.buildApiModel();
3922

4023
const markdownDocumenter: MarkdownDocumenter = new MarkdownDocumenter({
4124
apiModel,
42-
documenterConfig,
25+
documenterConfig: undefined,
4326
outputFolder
4427
});
4528
markdownDocumenter.generateFiles();

common/changes/@microsoft/api-documenter/main_2023-04-04-16-09.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)