mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
feat(docgen): typescript support
This commit is contained in:
@@ -8,9 +8,6 @@
|
||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix"
|
||||
},
|
||||
"bin": {
|
||||
"ts-docgen": "./dist/docs.js"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -45,7 +42,6 @@
|
||||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"dependencies": {
|
||||
"@discordjs/ts-docgen": "^0.4.1",
|
||||
"commander": "^9.3.0",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
import { runGenerator } from '@discordjs/ts-docgen';
|
||||
import { createCommand } from 'commander';
|
||||
import packageFile from '../package.json';
|
||||
|
||||
interface CLIOptions {
|
||||
input: string;
|
||||
custom: string;
|
||||
output: string;
|
||||
}
|
||||
|
||||
const command = createCommand()
|
||||
.version(packageFile.version)
|
||||
.option('-i, --input <string>', 'Path to an existing TypeDoc JSON output file')
|
||||
.option('-c, --custom <string>', 'Custom docs definition file to use')
|
||||
.option('-o, --output <string>', 'Path to output file');
|
||||
|
||||
const program = command.parse(process.argv);
|
||||
const options = program.opts<CLIOptions>();
|
||||
|
||||
runGenerator({
|
||||
existingOutput: options.input,
|
||||
custom: options.custom,
|
||||
output: options.output,
|
||||
});
|
||||
1
packages/scripts/src/index.ts
Normal file
1
packages/scripts/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createTsupConfig } from '../../tsup.config';
|
||||
|
||||
export default createTsupConfig({
|
||||
entry: ['src/docs.ts'],
|
||||
minify: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user