Skip to content

Commit dfc5a9d

Browse files
committed
Rename all the api-extractor.json config interfaces to start with "IConfig"
1 parent 98a1ebe commit dfc5a9d

6 files changed

Lines changed: 113 additions & 113 deletions

File tree

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import {
1616
InternalError
1717
} from '@microsoft/node-core-library';
1818
import {
19-
IExtractorConfig,
19+
IConfigFile,
2020
IExtractorMessagesConfig
21-
} from './IExtractorConfig';
21+
} from './IConfigFile';
2222
import { PackageMetadataManager } from '../analyzer/PackageMetadataManager';
2323

2424
/**
@@ -53,7 +53,7 @@ export interface IExtractorConfigParseConfigObjectOptions {
5353
/**
5454
* An already prepared configuration object as returned by {@link ExtractorConfig.loadJsonFileWithInheritance}.
5555
*/
56-
configObject: IExtractorConfig;
56+
configObject: IConfigFile;
5757

5858
/**
5959
* The absolute path of the file that the `configObject` object was loaded from. This is used for error messages
@@ -126,12 +126,12 @@ export class ExtractorConfig {
126126
*/
127127
public static readonly FILENAME: string = 'api-extractor.json';
128128

129-
private static readonly _defaultConfig: Partial<IExtractorConfig> = JsonFile.load(path.join(__dirname,
129+
private static readonly _defaultConfig: Partial<IConfigFile> = JsonFile.load(path.join(__dirname,
130130
'../schemas/api-extractor-defaults.json'));
131131

132132
private static readonly _declarationFileExtensionRegExp: RegExp = /\.d\.ts$/i;
133133

134-
/** {@inheritDoc IExtractorCompilerConfig.rootFolder} */
134+
/** {@inheritDoc IConfigCompiler.rootFolder} */
135135
public readonly rootFolder: string;
136136

137137
/**
@@ -146,46 +146,46 @@ export class ExtractorConfig {
146146
*/
147147
public readonly packageJsonFullPath: string | undefined;
148148

149-
/** {@inheritDoc IExtractorConfig.mainEntryPointFile} */
149+
/** {@inheritDoc IConfigFile.mainEntryPointFile} */
150150
public readonly mainEntryPointFile: string;
151151

152-
/** {@inheritDoc IExtractorCompilerConfig.overrideTsconfig} */
152+
/** {@inheritDoc IConfigCompiler.overrideTsconfig} */
153153
public readonly overrideTsconfig: { } | undefined;
154154

155-
/** {@inheritDoc IExtractorCompilerConfig.skipLibCheck} */
155+
/** {@inheritDoc IConfigCompiler.skipLibCheck} */
156156
public readonly skipLibCheck: boolean;
157157

158-
/** {@inheritDoc IExtractorApiReportConfig.enabled} */
158+
/** {@inheritDoc IConfigApiReport.enabled} */
159159
public readonly apiReportEnabled: boolean;
160160

161161
/** The `reportFolder` path combined with the `reportFileName`. */
162162
public readonly reportFilePath: string;
163163
/** The `tempFolder` path combined with the `reportFileName`. */
164164
public readonly tempReportFilePath: string;
165165

166-
/** {@inheritDoc IExtractorDocModelConfig.enabled} */
166+
/** {@inheritDoc IConfigDocModel.enabled} */
167167
public readonly docModelEnabled: boolean;
168-
/** {@inheritDoc IExtractorDocModelConfig.apiJsonFilePath} */
168+
/** {@inheritDoc IConfigDocModel.apiJsonFilePath} */
169169
public readonly apiJsonFilePath: string;
170170

171-
/** {@inheritDoc IExtractorDtsRollupConfig.enabled} */
171+
/** {@inheritDoc IConfigDtsRollup.enabled} */
172172
public readonly rollupEnabled: boolean;
173-
/** {@inheritDoc IExtractorDtsRollupConfig.untrimmedFilePath} */
173+
/** {@inheritDoc IConfigDtsRollup.untrimmedFilePath} */
174174
public readonly untrimmedFilePath: string;
175-
/** {@inheritDoc IExtractorDtsRollupConfig.betaTrimmedFilePath} */
175+
/** {@inheritDoc IConfigDtsRollup.betaTrimmedFilePath} */
176176
public readonly betaTrimmedFilePath: string;
177-
/** {@inheritDoc IExtractorDtsRollupConfig.publicTrimmedFilePath} */
177+
/** {@inheritDoc IConfigDtsRollup.publicTrimmedFilePath} */
178178
public readonly publicTrimmedFilePath: string;
179179

180-
/** {@inheritDoc IExtractorTsdocMetadataConfig.enabled} */
180+
/** {@inheritDoc IConfigTsdocMetadata.enabled} */
181181
public readonly tsdocMetadataEnabled: boolean;
182-
/** {@inheritDoc IExtractorTsdocMetadataConfig.tsdocMetadataFilePath} */
182+
/** {@inheritDoc IConfigTsdocMetadata.tsdocMetadataFilePath} */
183183
public readonly tsdocMetadataFilePath: string;
184184

185-
/** {@inheritDoc IExtractorConfig.messages} */
185+
/** {@inheritDoc IConfigFile.messages} */
186186
public readonly messages: IExtractorMessagesConfig;
187187

188-
/** {@inheritDoc IExtractorConfig.testMode} */
188+
/** {@inheritDoc IConfigFile.testMode} */
189189
public readonly testMode: boolean;
190190

191191
private constructor(parameters: IExtractorConfigParameters) {
@@ -232,7 +232,7 @@ export class ExtractorConfig {
232232
*/
233233
public static loadAndParseConfig(configJsonFilePath: string): ExtractorConfig {
234234
const configObjectFullPath: string = path.resolve(configJsonFilePath);
235-
const configObject: IExtractorConfig = ExtractorConfig.loadJsonFileWithInheritance(configObjectFullPath);
235+
const configObject: IConfigFile = ExtractorConfig.loadJsonFileWithInheritance(configObjectFullPath);
236236

237237
const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();
238238
const packageJsonFullPath: string | undefined = packageJsonLookup.tryGetPackageJsonFilePathFor(
@@ -257,14 +257,14 @@ export class ExtractorConfig {
257257
* If the "extends" field is present, the referenced file(s) will be merged,
258258
* along with the API Extractor defaults.
259259
*/
260-
public static loadJsonFileWithInheritance(jsonFilePath: string): IExtractorConfig {
260+
public static loadJsonFileWithInheritance(jsonFilePath: string): IConfigFile {
261261
// Set to keep track of config files which have been processed.
262262
const visitedPaths: Set<string> = new Set<string>();
263263

264264
// Get absolute path of config file.
265265
let currentConfigFilePath: string = path.resolve(process.cwd(), jsonFilePath);
266266

267-
let configObject: Partial<IExtractorConfig> = JsonFile.load(currentConfigFilePath);
267+
let configObject: Partial<IConfigFile> = JsonFile.load(currentConfigFilePath);
268268

269269
try {
270270
while (configObject.extends) {
@@ -293,7 +293,7 @@ export class ExtractorConfig {
293293
}
294294

295295
// Load the extractor config defined in extends property.
296-
const baseConfig: IExtractorConfig = JsonFile.load(currentConfigFilePath);
296+
const baseConfig: IConfigFile = JsonFile.load(currentConfigFilePath);
297297

298298
// Delete the "extends" field, since we've already expanded it
299299
delete configObject.extends;
@@ -312,8 +312,8 @@ export class ExtractorConfig {
312312

313313
ExtractorConfig.jsonSchema.validateObject(configObject, jsonFilePath);
314314

315-
// The schema validation should ensure that this object conforms to IExtractorConfig
316-
return configObject as IExtractorConfig;
315+
// The schema validation should ensure that this object conforms to IConfigFile
316+
return configObject as IConfigFile;
317317
}
318318

319319
/**
@@ -322,7 +322,7 @@ export class ExtractorConfig {
322322
*/
323323
public static parseConfigObject(options: IExtractorConfigParseConfigObjectOptions): ExtractorConfig {
324324
const filenameForErrors: string = options.configObjectFullPath || 'the configuration object';
325-
const configObject: Partial<IExtractorConfig> = options.configObject;
325+
const configObject: Partial<IConfigFile> = options.configObject;
326326

327327
if (options.configObjectFullPath) {
328328
if (!path.isAbsolute(options.configObjectFullPath)) {

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
66
*
77
* @remarks
8-
* This is part of the {@link IExtractorConfig} structure.
8+
* This is part of the {@link IConfigFile} structure.
99
*
1010
* @public
1111
*/
12-
export interface IExtractorCompilerConfig {
12+
export interface IConfigCompiler {
1313

1414
/**
1515
* The root folder for the project. This folder typically contains the tsconfig.json and package.json
@@ -54,11 +54,11 @@ export interface IExtractorCompilerConfig {
5454
* Configures how the API review files (*.api.md) will be generated.
5555
*
5656
* @remarks
57-
* This is part of the {@link IExtractorConfig} structure.
57+
* This is part of the {@link IConfigFile} structure.
5858
*
5959
* @public
6060
*/
61-
export interface IExtractorApiReportConfig {
61+
export interface IConfigApiReport {
6262
/**
6363
* Whether to generate an API report.
6464
*/
@@ -102,11 +102,11 @@ export interface IExtractorApiReportConfig {
102102
* Configures how the doc model file (*.api.json) will be generated.
103103
*
104104
* @remarks
105-
* This is part of the {@link IExtractorConfig} structure.
105+
* This is part of the {@link IConfigFile} structure.
106106
*
107107
* @public
108108
*/
109-
export interface IExtractorDocModelConfig {
109+
export interface IConfigDocModel {
110110
/**
111111
* Whether to generate doc model file.
112112
*/
@@ -126,11 +126,11 @@ export interface IExtractorDocModelConfig {
126126
* Configures how the .d.ts rollup file will be generated.
127127
*
128128
* @remarks
129-
* This is part of the {@link IExtractorConfig} structure.
129+
* This is part of the {@link IConfigFile} structure.
130130
*
131131
* @public
132132
*/
133-
export interface IExtractorDtsRollupConfig {
133+
export interface IConfigDtsRollup {
134134
/**
135135
* Whether to generate the .d.ts rollup file.
136136
*/
@@ -177,11 +177,11 @@ export interface IExtractorDtsRollupConfig {
177177
* Configures how the tsdoc-metadata.json file will be generated.
178178
*
179179
* @remarks
180-
* This is part of the {@link IExtractorConfig} structure.
180+
* This is part of the {@link IConfigFile} structure.
181181
*
182182
* @public
183183
*/
184-
export interface IExtractorTsdocMetadataConfig {
184+
export interface IConfigTsdocMetadata {
185185
/**
186186
* Whether to generate the tsdoc-metadata.json file.
187187
*/
@@ -199,10 +199,10 @@ export interface IExtractorTsdocMetadataConfig {
199199
}
200200

201201
/**
202-
* Used with {@link IExtractorMessageReportingRuleConfig.logLevel}.
202+
* Used with {@link IConfigMessageReportingRule.logLevel}.
203203
*
204204
* @remarks
205-
* This is part of the {@link IExtractorConfig} structure.
205+
* This is part of the {@link IConfigFile} structure.
206206
*
207207
* @public
208208
*/
@@ -234,11 +234,11 @@ export const enum ExtractorMessageLogLevel {
234234
* Configures reporting for a given message identifier.
235235
*
236236
* @remarks
237-
* This is part of the {@link IExtractorConfig} structure.
237+
* This is part of the {@link IConfigFile} structure.
238238
*
239239
* @public
240240
*/
241-
export interface IExtractorMessageReportingRuleConfig {
241+
export interface IConfigMessageReportingRule {
242242
/**
243243
* Specifies whether the message should be written to the the tool's output log.
244244
*
@@ -260,24 +260,24 @@ export interface IExtractorMessageReportingRuleConfig {
260260
* identifiers that do not appear in the table.
261261
*
262262
* @remarks
263-
* This is part of the {@link IExtractorConfig} structure.
263+
* This is part of the {@link IConfigFile} structure.
264264
*
265265
* @public
266266
*/
267-
export interface IExtractorMessageReportingTableConfig {
267+
export interface IConfigMessageReportingTable {
268268
/**
269269
* The key is a message identifier for the associated type of message, or "default" to specify the default policy.
270270
* For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),
271271
* or `ae-extra-release-tag` (a message related to the API Extractor analysis).
272272
*/
273-
[messageId: string]: IExtractorMessageReportingRuleConfig;
273+
[messageId: string]: IConfigMessageReportingRule;
274274
}
275275

276276
/**
277277
* Configures how API Extractor reports error and warning messages produced during analysis.
278278
*
279279
* @remarks
280-
* This is part of the {@link IExtractorConfig} structure.
280+
* This is part of the {@link IConfigFile} structure.
281281
*
282282
* @public
283283
*/
@@ -286,17 +286,17 @@ export interface IExtractorMessagesConfig {
286286
* Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the
287287
* input .d.ts files.
288288
*/
289-
compilerMessageReporting?: IExtractorMessageReportingTableConfig;
289+
compilerMessageReporting?: IConfigMessageReportingTable;
290290

291291
/**
292292
* Configures handling of messages reported by API Extractor during its analysis.
293293
*/
294-
extractorMessageReporting?: IExtractorMessageReportingTableConfig;
294+
extractorMessageReporting?: IConfigMessageReportingTable;
295295

296296
/**
297297
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
298298
*/
299-
tsdocMessageReporting?: IExtractorMessageReportingTableConfig;
299+
tsdocMessageReporting?: IConfigMessageReportingTable;
300300
}
301301

302302
/**
@@ -305,7 +305,7 @@ export interface IExtractorMessagesConfig {
305305
*
306306
* @public
307307
*/
308-
export interface IExtractorConfig {
308+
export interface IConfigFile {
309309
/**
310310
* Path to json config file from which config should extend.
311311
* The path specified in this field is relative to current config file path.
@@ -324,31 +324,31 @@ export interface IExtractorConfig {
324324
mainEntryPointFile: string;
325325

326326
/**
327-
* {@inheritDoc IExtractorCompilerConfig}
327+
* {@inheritDoc IConfigCompiler}
328328
*/
329-
compiler?: IExtractorCompilerConfig;
329+
compiler?: IConfigCompiler;
330330

331331
/**
332-
* {@inheritDoc IExtractorApiReportConfig}
332+
* {@inheritDoc IConfigApiReport}
333333
*/
334-
apiReport?: IExtractorApiReportConfig;
334+
apiReport?: IConfigApiReport;
335335

336336
/**
337-
* {@inheritDoc IExtractorDocModelConfig}
337+
* {@inheritDoc IConfigDocModel}
338338
*/
339-
docModel?: IExtractorDocModelConfig;
339+
docModel?: IConfigDocModel;
340340

341341
/**
342-
* {@inheritDoc IExtractorDtsRollupConfig}
342+
* {@inheritDoc IConfigDtsRollup}
343343
* @beta
344344
*/
345-
dtsRollup?: IExtractorDtsRollupConfig;
345+
dtsRollup?: IConfigDtsRollup;
346346

347347
/**
348-
* {@inheritDoc IExtractorTsdocMetadataConfig}
348+
* {@inheritDoc IConfigTsdocMetadata}
349349
* @beta
350350
*/
351-
tsdocMetadata?: IExtractorTsdocMetadataConfig;
351+
tsdocMetadata?: IConfigTsdocMetadata;
352352

353353
/**
354354
* {@inheritDoc IExtractorMessagesConfig}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from '@microsoft/ts-command-line';
1818

1919
import { Extractor, ExtractorResult } from '../api/Extractor';
20-
import { IExtractorConfig } from '../api/IExtractorConfig';
20+
import { IConfigFile } from '../api/IConfigFile';
2121

2222
import { ApiExtractorCommandLine } from './ApiExtractorCommandLine';
2323
import { ExtractorConfig } from '../api/ExtractorConfig';
@@ -123,7 +123,7 @@ export class RunAction extends CommandLineAction {
123123
}
124124

125125
const configFullPath: string = path.resolve(configFilename);
126-
const mergedConfig: IExtractorConfig = ExtractorConfig.loadJsonFileWithInheritance(configFullPath);
126+
const mergedConfig: IConfigFile = ExtractorConfig.loadJsonFileWithInheritance(configFullPath);
127127

128128
const extractorConfig: ExtractorConfig = ExtractorConfig.parseConfigObject({
129129
configObject: mergedConfig,

apps/api-extractor/src/collector/MessageRouter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import { ExtractorMessageId, allExtractorMessageIds } from '../api/ExtractorMess
1919
import {
2020
IExtractorMessagesConfig,
2121
ExtractorMessageLogLevel,
22-
IExtractorMessageReportingRuleConfig
23-
} from '../api/IExtractorConfig';
22+
IConfigMessageReportingRule
23+
} from '../api/IConfigFile';
2424
import { ILogger } from '../api/ILogger';
2525
import { SourceMapper } from './SourceMapper';
2626

@@ -118,7 +118,7 @@ export class MessageRouter {
118118
}
119119
}
120120

121-
private static _getNormalizedRule(rule: IExtractorMessageReportingRuleConfig): IReportingRule {
121+
private static _getNormalizedRule(rule: IConfigMessageReportingRule): IReportingRule {
122122
return {
123123
logLevel: rule.logLevel || 'none',
124124
addToApiReviewFile: rule.addToApiReviewFile || false

0 commit comments

Comments
 (0)