Skip to content

Commit bf6a97f

Browse files
committed
Rename Extractor.config --> Extractor.actualConfig
1 parent 659fbb3 commit bf6a97f

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎apps/api-extractor/src/DebugRun.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const extractor: Extractor = new Extractor(
5555
}
5656
);
5757

58-
console.log('CONFIG:' + JSON.stringify(extractor.config, undefined, ' '));
58+
console.log('CONFIG:' + JSON.stringify(extractor.actualConfig, undefined, ' '));
5959

6060
if (!extractor.processProject()) {
6161
console.log('processProject() failed the build');

‎apps/api-extractor/src/extractor/Extractor.ts‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class Extractor {
8181
logError: (message: string) => console.error(colors.red(message))
8282
};
8383

84-
private readonly _config: IExtractorConfig;
84+
private readonly _actualConfig: IExtractorConfig;
8585
private readonly _program: ts.Program;
8686
private readonly _localBuild: boolean;
8787
private readonly _monitoredLogger: MonitoredLogger;
@@ -104,24 +104,24 @@ export class Extractor {
104104
}
105105
this._monitoredLogger = new MonitoredLogger(mergedLogger);
106106

107-
this._config = Extractor._applyConfigDefaults(config);
107+
this._actualConfig = Extractor._applyConfigDefaults(config);
108108

109109
if (!options) {
110110
options = { };
111111
}
112112

113113
this._localBuild = options.localBuild || false;
114114

115-
switch (this._config.compiler.configType) {
115+
switch (this._actualConfig.compiler.configType) {
116116
case 'tsconfig':
117-
const rootFolder: string = this._config.compiler.rootFolder;
117+
const rootFolder: string = this._actualConfig.compiler.rootFolder;
118118
if (!fsx.existsSync(rootFolder)) {
119119
throw new Error('The root folder does not exist: ' + rootFolder);
120120
}
121121

122122
this._absoluteRootFolder = path.normalize(path.resolve(rootFolder));
123123

124-
let tsconfig: {} | undefined = this._config.compiler.overrideTsconfig;
124+
let tsconfig: {} | undefined = this._actualConfig.compiler.overrideTsconfig;
125125
if (!tsconfig) {
126126
// If it wasn't overridden, then load it from disk
127127
tsconfig = JsonFile.load(path.join(this._absoluteRootFolder, 'tsconfig.json'));
@@ -167,8 +167,8 @@ export class Extractor {
167167
* It is provided for diagnostic purposes. For example, a build script could write
168168
* this object to a JSON file to report the final configuration options used by API Extractor.
169169
*/
170-
public get config(): IExtractorConfig {
171-
return this._config;
170+
public get actualConfig(): IExtractorConfig {
171+
return this._actualConfig;
172172
}
173173

174174
/**
@@ -193,20 +193,20 @@ export class Extractor {
193193
}
194194

195195
const projectConfig: IExtractorProjectConfig = options.projectConfig ?
196-
options.projectConfig : this._config.project;
196+
options.projectConfig : this._actualConfig.project;
197197

198198
// This helps strict-null-checks to understand that _applyConfigDefaults() eliminated
199199
// any undefined members
200-
if (!(this._config.policies && this._config.apiJsonFile && this._config.apiReviewFile
201-
&& this._config.packageTypings)) {
200+
if (!(this._actualConfig.policies && this._actualConfig.apiJsonFile && this._actualConfig.apiReviewFile
201+
&& this._actualConfig.packageTypings)) {
202202
throw new Error('The configuration object wasn\'t normalized properly');
203203
}
204204

205205
const context: ExtractorContext = new ExtractorContext({
206206
program: this._program,
207207
entryPointFile: path.resolve(this._absoluteRootFolder, projectConfig.entryPointSourceFile),
208208
logger: this._monitoredLogger,
209-
policies: this._config.policies
209+
policies: this._actualConfig.policies
210210
});
211211

212212
for (const externalJsonFileFolder of projectConfig.externalJsonFileFolders || []) {
@@ -215,7 +215,7 @@ export class Extractor {
215215

216216
const packageBaseName: string = path.basename(context.packageName);
217217

218-
const apiJsonFileConfig: IExtractorApiJsonFileConfig = this._config.apiJsonFile;
218+
const apiJsonFileConfig: IExtractorApiJsonFileConfig = this._actualConfig.apiJsonFile;
219219

220220
if (apiJsonFileConfig.enabled) {
221221
const outputFolder: string = path.resolve(this._absoluteRootFolder,
@@ -229,16 +229,16 @@ export class Extractor {
229229
jsonGenerator.writeJsonFile(apiJsonFilename, context);
230230
}
231231

232-
if (this._config.apiReviewFile.enabled) {
232+
if (this._actualConfig.apiReviewFile.enabled) {
233233
const generator: ApiFileGenerator = new ApiFileGenerator();
234234
const apiReviewFilename: string = packageBaseName + '.api.ts';
235235

236236
const actualApiReviewPath: string = path.resolve(this._absoluteRootFolder,
237-
this._config.apiReviewFile.tempFolder, apiReviewFilename);
237+
this._actualConfig.apiReviewFile.tempFolder, apiReviewFilename);
238238
const actualApiReviewShortPath: string = this._getShortFilePath(actualApiReviewPath);
239239

240240
const expectedApiReviewPath: string = path.resolve(this._absoluteRootFolder,
241-
this._config.apiReviewFile.apiReviewFolder, apiReviewFilename);
241+
this._actualConfig.apiReviewFile.apiReviewFolder, apiReviewFilename);
242242
const expectedApiReviewShortPath: string = this._getShortFilePath(expectedApiReviewPath);
243243

244244
const actualApiReviewContent: string = generator.generateApiFileContent(context);
@@ -280,11 +280,11 @@ export class Extractor {
280280
}
281281
}
282282

283-
if (this._config.packageTypings.enabled) {
283+
if (this._actualConfig.packageTypings.enabled) {
284284
const packageTypingsGenerator: PackageTypingsGenerator = new PackageTypingsGenerator(context);
285285

286286
const dtsFilename: string = path.resolve(this._absoluteRootFolder,
287-
this._config.packageTypings.outputFolder, this._config.packageTypings.internalFilename);
287+
this._actualConfig.packageTypings.outputFolder, this._actualConfig.packageTypings.internalFilename);
288288
this._monitoredLogger.logVerbose(`Writing package typings: ${dtsFilename}`);
289289

290290
fsx.mkdirsSync(path.dirname(dtsFilename));

‎common/reviews/api/api-extractor.api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class ExternalApiHelper {
1313
// @public
1414
class Extractor {
1515
public constructor(config: IExtractorConfig, options?: IExtractorOptions);
16+
public readonly actualConfig: IExtractorConfig;
1617
// @deprecated
1718
public analyzeProject(options?: IAnalyzeProjectOptions): void;
18-
public readonly config: IExtractorConfig;
1919
public static jsonSchema: JsonSchema;
2020
public processProject(options?: IAnalyzeProjectOptions): boolean;
2121
}

0 commit comments

Comments
 (0)