mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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,
|
||||
|
||||
@@ -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}
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
// ("mainEntryPointFilePath" is required)
|
||||
|
||||
"mainEntryPointName": "",
|
||||
|
||||
"bundledPackages": [],
|
||||
|
||||
"newlineKind": "crlf",
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user