mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat(api-extractor): support multiple entrypoints (#10829)
* feat(api-extractor): support multiple entrypoints * chore: initial support in generateSplitDocumentation * chore: bring in line with upstream * refactor: multiple entrypoints in scripts * fix: split docs * feat: website * fix: docs failing on next * fix: don't include dtypes for now * refactor: don't fetch entrypoint if there is none --------- Co-authored-by: iCrawl <buechler.noel@outlook.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// See LICENSE in the project root for license information.
|
||||
|
||||
import * as os from 'node:os';
|
||||
import process from 'node:process';
|
||||
import { InternalError } from '@rushstack/node-core-library';
|
||||
import { CommandLineParser, type CommandLineFlagParameter } from '@rushstack/ts-command-line';
|
||||
import colors from 'colors';
|
||||
@@ -30,23 +31,22 @@ export class ApiExtractorCommandLine extends CommandLineParser {
|
||||
});
|
||||
}
|
||||
|
||||
protected override async onExecute(): Promise<void> {
|
||||
protected override async onExecuteAsync(): Promise<void> {
|
||||
// override
|
||||
if (this._debugParameter.value) {
|
||||
InternalError.breakInDebugger = true;
|
||||
}
|
||||
|
||||
process.exitCode = 1;
|
||||
try {
|
||||
await super.onExecute();
|
||||
await super.onExecuteAsync();
|
||||
process.exitCode = 0;
|
||||
} catch (error: any) {
|
||||
if (this._debugParameter.value) {
|
||||
console.error(os.EOL + error.stack);
|
||||
} else {
|
||||
console.error(os.EOL + colors.red('ERROR: ' + error.message.trim()));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
process.exitCode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,7 @@ export class InitAction extends CommandLineAction {
|
||||
});
|
||||
}
|
||||
|
||||
protected async onExecute(): Promise<void> {
|
||||
// override
|
||||
protected override async onExecuteAsync(): Promise<void> {
|
||||
const inputFilePath: string = path.resolve(__dirname, './schemas/api-extractor-template.json');
|
||||
const outputFilePath: string = path.resolve(ExtractorConfig.FILENAME);
|
||||
|
||||
|
||||
@@ -83,8 +83,7 @@ export class RunAction extends CommandLineAction {
|
||||
});
|
||||
}
|
||||
|
||||
protected async onExecute(): Promise<void> {
|
||||
// override
|
||||
protected override async onExecuteAsync(): Promise<void> {
|
||||
const lookup: PackageJsonLookup = new PackageJsonLookup();
|
||||
let configFilename: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user