Skip to content

Commit cf990d4

Browse files
committed
Rename api-extractor.json's "mainEntryPointFile" to "MainEntryPointFilePath" so all the settings have consistent names
1 parent 9682ac2 commit cf990d4

7 files changed

Lines changed: 24 additions & 24 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class CompilerState {
7171

7272
CompilerState._updateCommandLineForTypescriptPackage(commandLine, options);
7373

74-
const inputFilePaths: string[] = commandLine.fileNames.concat(extractorConfig.mainEntryPointFile);
74+
const inputFilePaths: string[] = commandLine.fileNames.concat(extractorConfig.mainEntryPointFilePath);
7575
if (options && options.additionalEntryPoints) {
7676
inputFilePaths.push(...options.additionalEntryPoints);
7777
}

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ interface IExtractorConfigParameters {
9393
projectFolder: string;
9494
packageJson: INodePackageJson | undefined;
9595
packageFolder: string | undefined;
96-
mainEntryPointFile: string;
96+
mainEntryPointFilePath: string;
9797
tsconfigFilePath: string;
9898
overrideTsconfig: { } | undefined;
9999
skipLibCheck: boolean;
@@ -148,8 +148,8 @@ export class ExtractorConfig {
148148
*/
149149
public readonly packageFolder: string | undefined;
150150

151-
/** {@inheritDoc IConfigFile.mainEntryPointFile} */
152-
public readonly mainEntryPointFile: string;
151+
/** {@inheritDoc IConfigFile.mainEntryPointFilePath} */
152+
public readonly mainEntryPointFilePath: string;
153153

154154
/** {@inheritDoc IConfigCompiler.tsconfigFilePath} */
155155
public readonly tsconfigFilePath: string;
@@ -197,7 +197,7 @@ export class ExtractorConfig {
197197
this.projectFolder = parameters.projectFolder;
198198
this.packageJson = parameters.packageJson;
199199
this.packageFolder = parameters.packageFolder;
200-
this.mainEntryPointFile = parameters.mainEntryPointFile;
200+
this.mainEntryPointFilePath = parameters.mainEntryPointFilePath;
201201
this.tsconfigFilePath = parameters.tsconfigFilePath;
202202
this.overrideTsconfig = parameters.overrideTsconfig;
203203
this.skipLibCheck = parameters.skipLibCheck;
@@ -342,9 +342,9 @@ export class ExtractorConfig {
342342
'projectFolder', configFile.projectFolder, currentConfigFolderPath);
343343
}
344344

345-
if (configFile.mainEntryPointFile) {
346-
configFile.mainEntryPointFile = ExtractorConfig._resolveConfigFileRelativePath(
347-
'mainEntryPointFile', configFile.mainEntryPointFile, currentConfigFolderPath);
345+
if (configFile.mainEntryPointFilePath) {
346+
configFile.mainEntryPointFilePath = ExtractorConfig._resolveConfigFileRelativePath(
347+
'mainEntryPointFilePath', configFile.mainEntryPointFilePath, currentConfigFolderPath);
348348
}
349349

350350
if (configFile.compiler) {
@@ -510,19 +510,19 @@ export class ExtractorConfig {
510510
tokenContext.unscopedPackageName = PackageName.getUnscopedName(packageJson.name);
511511
}
512512

513-
if (!configObject.mainEntryPointFile) {
513+
if (!configObject.mainEntryPointFilePath) {
514514
// A merged configuration should have this
515-
throw new Error('The "mainEntryPointFile" setting is missing');
515+
throw new Error('The "mainEntryPointFilePath" setting is missing');
516516
}
517-
const mainEntryPointFile: string = ExtractorConfig._resolvePathWithTokens('mainEntryPointFile',
518-
configObject.mainEntryPointFile, tokenContext);
517+
const mainEntryPointFilePath: string = ExtractorConfig._resolvePathWithTokens('mainEntryPointFilePath',
518+
configObject.mainEntryPointFilePath, tokenContext);
519519

520-
if (!ExtractorConfig.hasDtsFileExtension(mainEntryPointFile)) {
521-
throw new Error('The "mainEntryPointFile" value is not a declaration file: ' + mainEntryPointFile);
520+
if (!ExtractorConfig.hasDtsFileExtension(mainEntryPointFilePath)) {
521+
throw new Error('The "mainEntryPointFilePath" value is not a declaration file: ' + mainEntryPointFilePath);
522522
}
523523

524-
if (!FileSystem.exists(mainEntryPointFile)) {
525-
throw new Error('The "mainEntryPointFile" path does not exist: ' + mainEntryPointFile);
524+
if (!FileSystem.exists(mainEntryPointFilePath)) {
525+
throw new Error('The "mainEntryPointFilePath" path does not exist: ' + mainEntryPointFilePath);
526526
}
527527

528528
const tsconfigFilePath: string = ExtractorConfig._resolvePathWithTokens('tsconfigFilePath',
@@ -624,7 +624,7 @@ export class ExtractorConfig {
624624
projectFolder: projectFolder,
625625
packageJson,
626626
packageFolder,
627-
mainEntryPointFile,
627+
mainEntryPointFilePath,
628628
tsconfigFilePath,
629629
overrideTsconfig: configObject.compiler.overrideTsconfig,
630630
skipLibCheck: !!configObject.compiler.skipLibCheck,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export interface IConfigFile {
312312
* The file extension must be ".d.ts" and not ".ts".
313313
* The path is resolved relative to the "projectFolder" location.
314314
*/
315-
mainEntryPointFile: string;
315+
mainEntryPointFilePath: string;
316316

317317
/**
318318
* {@inheritDoc IConfigCompiler}

‎apps/api-extractor/src/collector/Collector.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ export class Collector {
8989
const extractorConfig: ExtractorConfig = options.extractorConfig;
9090

9191
const entryPointSourceFile: ts.SourceFile | undefined = options.program.getSourceFile(
92-
extractorConfig.mainEntryPointFile);
92+
extractorConfig.mainEntryPointFilePath);
9393

9494
if (!entryPointSourceFile) {
95-
throw new Error('Unable to load file: ' + extractorConfig.mainEntryPointFile);
95+
throw new Error('Unable to load file: ' + extractorConfig.mainEntryPointFilePath);
9696
}
9797

9898
if (!extractorConfig.packageFolder || !extractorConfig.packageJson) {

‎apps/api-extractor/src/schemas/api-extractor-defaults.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// ("mainEntryPointFile" is required)
2+
// ("mainEntryPointFilePath" is required)
33

44
"projectFolder": "<lookup>",
55

‎apps/api-extractor/src/schemas/api-extractor-template.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
4747
*/
48-
"mainEntryPointFile": "<projectFolder>/lib/index.d.ts",
48+
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
4949

5050
/**
5151
* Determines how the TypeScript compiler engine will be invoked by API Extractor.

‎apps/api-extractor/src/schemas/api-extractor.schema.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"type": "string"
1919
},
2020

21-
"mainEntryPointFile": {
21+
"mainEntryPointFilePath": {
2222
"description": "Specifies the .d.ts file to be used as the starting point for analysis. API Extractor analyzes the symbols exported by this module. The file extension must be \".d.ts\" and not \".ts\". The path is resolved relative to the folder of the config file that contains the setting; to change this, prepend a folder token such as \"<projectFolder>\".",
2323
"type": "string"
2424
},
@@ -155,7 +155,7 @@
155155
"type": "boolean"
156156
}
157157
},
158-
"required": [ "mainEntryPointFile" ],
158+
"required": [ "mainEntryPointFilePath" ],
159159
"additionalProperties": false,
160160

161161
"definitions": {

0 commit comments

Comments
 (0)