Skip to content

Commit 0e6907d

Browse files
committed
Improve some doc comments
1 parent 37bc452 commit 0e6907d

3 files changed

Lines changed: 19 additions & 20 deletions

File tree

apps/api-extractor/src/api/ExtractorConfig.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ interface IExtractorConfigTokenContext {
5151
*/
5252
export interface IExtractorConfigPrepareOptions {
5353
/**
54-
* An already prepared configuration object as returned by {@link ExtractorConfig.loadFile}.
54+
* A configuration object as returned by {@link ExtractorConfig.loadFile}.
5555
*/
5656
configObject: IConfigFile;
5757

@@ -222,13 +222,13 @@ export class ExtractorConfig {
222222
}
223223

224224
/**
225-
* Loads the api-extractor.json config file from the specified file path, and returns the parsed result.
225+
* Loads the api-extractor.json config file from the specified file path, and prepares an `ExtractorConfig` object.
226226
*
227227
* @remarks
228-
* Loads the api-extractor.json config file from the specified file path.
229-
* If the "extends" field is present, the referenced file(s) will be merged,
230-
* along with the API Extractor defaults.
231-
* The result is parsed and returned.
228+
* Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
229+
* the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
230+
*
231+
* The result is prepared using `ExtractorConfig.prepare()`.
232232
*/
233233
public static loadFileAndPrepare(configJsonFilePath: string): ExtractorConfig {
234234
const configObjectFullPath: string = path.resolve(configJsonFilePath);
@@ -249,13 +249,11 @@ export class ExtractorConfig {
249249

250250
/**
251251
* Performs only the first half of {@link ExtractorConfig.loadFileAndPrepare}, providing an opportunity to
252-
* modify the object before it is pssed to {@link ExtractorConfig.prepare}.
252+
* modify the object before it is passed to {@link ExtractorConfig.prepare}.
253253
*
254254
* @remarks
255-
*
256-
* Loads the api-extractor.json config file from the specified file path.
257-
* If the "extends" field is present, the referenced file(s) will be merged,
258-
* along with the API Extractor defaults.
255+
* Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
256+
* the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
259257
*/
260258
public static loadFile(jsonFilePath: string): IConfigFile {
261259
// Set to keep track of config files which have been processed.
@@ -317,8 +315,9 @@ export class ExtractorConfig {
317315
}
318316

319317
/**
320-
* Parses the api-extractor.json configuration provided as a runtime object, rather than reading it from disk.
321-
* This allows configurations to be customized or constructed programmatically.
318+
* Prepares an `ExtractorConfig` object using a configuration that is provided as a runtime object,
319+
* rather than reading it from disk. This allows configurations to be constructed programmatically,
320+
* loaded from an alternate source, and/or customized after loading.
322321
*/
323322
public static prepare(options: IExtractorConfigPrepareOptions): ExtractorConfig {
324323
const filenameForErrors: string = options.configObjectFullPath || 'the configuration object';

apps/api-extractor/src/api/IConfigFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ export interface IExtractorMessagesConfig {
300300
}
301301

302302
/**
303-
* Configuration options for the API Extractor tool. These options can be loaded
304-
* from a JSON config file.
303+
* Configuration options for the API Extractor tool. These options can be constructed programmatically
304+
* or loaded from the api-extractor.json config file using the {@link ExtractorConfig} class.
305305
*
306306
* @public
307307
*/

apps/api-extractor/src/cli/RunAction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ export class RunAction extends CommandLineAction {
122122
console.log(`Using configuration from ${configFilename}` + os.EOL + os.EOL);
123123
}
124124

125-
const configFullPath: string = path.resolve(configFilename);
126-
const mergedConfig: IConfigFile = ExtractorConfig.loadFile(configFullPath);
125+
const configObjectFullPath: string = path.resolve(configFilename);
126+
const configObject: IConfigFile = ExtractorConfig.loadFile(configObjectFullPath);
127127

128128
const extractorConfig: ExtractorConfig = ExtractorConfig.prepare({
129-
configObject: mergedConfig,
130-
configObjectFullPath: configFullPath,
131-
packageJsonFullPath: lookup.tryGetPackageJsonFilePathFor(configFullPath)
129+
configObject: configObject,
130+
configObjectFullPath: configObjectFullPath,
131+
packageJsonFullPath: lookup.tryGetPackageJsonFilePathFor(configObjectFullPath)
132132
});
133133

134134
const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig,

0 commit comments

Comments
 (0)