mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
refactor: docs (#10126)
This commit is contained in:
@@ -7,25 +7,24 @@ import packageFile from '../package.json';
|
||||
import { generateSplitDocumentation } from '../src/index.js';
|
||||
|
||||
export interface CLIOptions {
|
||||
custom: string;
|
||||
input: string[];
|
||||
newOutput: string;
|
||||
output: string;
|
||||
root: string;
|
||||
typescript: boolean;
|
||||
all: boolean;
|
||||
}
|
||||
|
||||
const command = createCommand().version(packageFile.version);
|
||||
const command = createCommand().version(packageFile.version).option('-A, --all', 'Build all available versions', false);
|
||||
|
||||
const program = command.parse(process.argv);
|
||||
program.opts<CLIOptions>();
|
||||
const opts = program.opts<CLIOptions>();
|
||||
|
||||
console.log('Generating split documentation...');
|
||||
void generateSplitDocumentation({
|
||||
fetchPackageVersions: async (_) => {
|
||||
return ['main'];
|
||||
},
|
||||
fetchPackageVersionDocs: async (_, __) => {
|
||||
return JSON.parse(await readFile(`${process.cwd()}/docs/docs.api.json`, 'utf8'));
|
||||
},
|
||||
}).then(() => console.log('Generated split documentation.'));
|
||||
void generateSplitDocumentation(
|
||||
opts.all
|
||||
? {}
|
||||
: {
|
||||
fetchPackageVersions: async (_) => {
|
||||
return ['main'];
|
||||
},
|
||||
fetchPackageVersionDocs: async (_, __) => {
|
||||
return JSON.parse(await readFile(`${process.cwd()}/docs/docs.api.json`, 'utf8'));
|
||||
},
|
||||
},
|
||||
).then(() => console.log('Generated split documentation.'));
|
||||
|
||||
Reference in New Issue
Block a user