fix(website): remove several obsolete special handling of dtypes (#10898)

* fix(website): remove several obsolete special handling of dtypes

* fix: reduce hardcoded places

* chore: api-extractor.json setting mainEntryPointName
This commit is contained in:
Qjuh
2025-05-13 20:40:41 +02:00
committed by GitHub
parent aa533efe26
commit 14e226b72b
12 changed files with 49 additions and 94 deletions

View File

@@ -209,6 +209,7 @@ interface IExtractorConfigParameters {
docModelIncludeForgottenExports: boolean;
enumMemberOrder: EnumMemberOrder;
mainEntryPointFilePath: string;
mainEntryPointName: string;
messages: IExtractorMessagesConfig;
newlineKind: NewlineKind;
omitTrimmingComments: boolean;
@@ -474,6 +475,7 @@ export class ExtractorConfig {
projectFolder,
packageJson,
packageFolder,
mainEntryPointName,
mainEntryPointFilePath,
additionalEntryPoints,
bundledPackages,
@@ -509,7 +511,7 @@ export class ExtractorConfig {
this.packageJson = packageJson;
this.packageFolder = packageFolder;
this.mainEntryPointFilePath = {
modulePath: '',
modulePath: mainEntryPointName,
filePath: mainEntryPointFilePath,
};
this.additionalEntryPoints = additionalEntryPoints;
@@ -1003,6 +1005,8 @@ export class ExtractorConfig {
tokenContext,
);
const mainEntryPointName = configObject.mainEntryPointName ?? '';
if (!ExtractorConfig.hasDtsFileExtension(mainEntryPointFilePath)) {
throw new Error('The "mainEntryPointFilePath" value is not a declaration file: ' + mainEntryPointFilePath);
}
@@ -1289,6 +1293,7 @@ export class ExtractorConfig {
packageJson,
packageFolder,
mainEntryPointFilePath,
mainEntryPointName,
additionalEntryPoints,
bundledPackages,
tsconfigFilePath,

View File

@@ -491,6 +491,11 @@ export interface IConfigFile {
*/
mainEntryPointFilePath: string;
/**
* Specifies the import path of the entrypoint used as the starting point for analysis.
*/
mainEntryPointName: string;
/**
* {@inheritDoc IExtractorMessagesConfig}
*/

View File

@@ -291,6 +291,7 @@ export class ApiModelGenerator {
docComment: packageDocComment,
tsdocConfiguration: this._collector.extractorConfig.tsdocConfiguration,
projectFolderUrl: this._collector.extractorConfig.projectFolderUrl,
preserveMemberOrder: true,
});
this._apiModel.addMember(apiPackage);

View File

@@ -3,6 +3,8 @@
// ("mainEntryPointFilePath" is required)
"mainEntryPointName": "",
"bundledPackages": [],
"newlineKind": "crlf",

View File

@@ -47,6 +47,11 @@
*/
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
/**
* Specifies the import path of the entrypoint used as the starting point for analysis.
*/
// "mainEntryPointName": "",
/**
* A list of NPM package names whose exports should be treated as part of this package.
*

View File

@@ -23,6 +23,11 @@
"type": "string"
},
"mainEntryPointName": {
"description": "Specifies the import path of the entrypoint used as the starting point for analysis.",
"type": "string"
},
"additionalEntryPoints": {
"description": "Specifies the .d.ts files to be used as the starting points for analysis.",
"type": "array",