mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
fix: minify mainlib docs json (#9963)
* fix: minify mainlib docs json * fix: minify them all
This commit is contained in:
@@ -41,6 +41,11 @@ export interface IExtractorInvokeOptions {
|
||||
*/
|
||||
compilerState?: CompilerState;
|
||||
|
||||
/**
|
||||
* Whether to minify the resulting doc model JSON, i.e. without any indentation or newlines.
|
||||
*/
|
||||
docModelMinify?: boolean;
|
||||
|
||||
/**
|
||||
* Indicates that API Extractor is running as part of a local build, e.g. on developer's
|
||||
* machine.
|
||||
@@ -270,7 +275,7 @@ export class Extractor {
|
||||
apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {
|
||||
toolPackage: Extractor.packageName,
|
||||
toolVersion: Extractor.version,
|
||||
|
||||
minify: options?.docModelMinify ?? false,
|
||||
newlineConversion: extractorConfig.newlineKind,
|
||||
ensureFolderExists: true,
|
||||
testMode: extractorConfig.testMode,
|
||||
|
||||
@@ -27,6 +27,8 @@ export class RunAction extends CommandLineAction {
|
||||
|
||||
private readonly _typescriptCompilerFolder: CommandLineStringParameter;
|
||||
|
||||
private readonly _minify: CommandLineFlagParameter;
|
||||
|
||||
public constructor(_parser: ApiExtractorCommandLine) {
|
||||
super({
|
||||
actionName: 'run',
|
||||
@@ -57,6 +59,12 @@ export class RunAction extends CommandLineAction {
|
||||
description: 'Show additional informational messages in the output.',
|
||||
});
|
||||
|
||||
this._minify = this.defineFlagParameter({
|
||||
parameterLongName: '--minify',
|
||||
parameterShortName: '-m',
|
||||
description: 'Minify the resulting doc model JSON, i.e. without any indentation or newlines.',
|
||||
});
|
||||
|
||||
this._diagnosticsParameter = this.defineFlagParameter({
|
||||
parameterLongName: '--diagnostics',
|
||||
description:
|
||||
@@ -136,6 +144,7 @@ export class RunAction extends CommandLineAction {
|
||||
|
||||
const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {
|
||||
localBuild: this._localParameter.value,
|
||||
docModelMinify: this._minify.value,
|
||||
showVerboseMessages: this._verboseParameter.value,
|
||||
showDiagnostics: this._diagnosticsParameter.value,
|
||||
typescriptCompilerFolder,
|
||||
|
||||
Reference in New Issue
Block a user