mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(docgen): typescript support
This commit is contained in:
2
packages/builders/.gitignore
vendored
2
packages/builders/.gitignore
vendored
@@ -19,7 +19,7 @@ dist/
|
|||||||
typings/
|
typings/
|
||||||
|
|
||||||
docs/**/*
|
docs/**/*
|
||||||
!docs/index.yml
|
!docs/index.json
|
||||||
!docs/README.md
|
!docs/README.md
|
||||||
!docs/examples/
|
!docs/examples/
|
||||||
!docs/examples/*.md
|
!docs/examples/*.md
|
||||||
|
|||||||
1
packages/builders/docs/index.json
Normal file
1
packages/builders/docs/index.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{ "name": "General", "files": [{ "name": "Welcome", "id": "welcome", "path": "../../README.md" }] }]
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
- name: General
|
|
||||||
files:
|
|
||||||
- name: Welcome
|
|
||||||
id: welcome
|
|
||||||
path: ../../README.md
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && ts-docgen -i docs/typedoc-out.json -c docs/index.yml -o docs/docs.json",
|
"docs": "docgen -i src/index.ts -c docs/index.json -o docs/docs.json --typescript",
|
||||||
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
@@ -60,6 +60,7 @@
|
|||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@discordjs/docgen": "workspace:^",
|
||||||
"@discordjs/scripts": "workspace:^",
|
"@discordjs/scripts": "workspace:^",
|
||||||
"@favware/cliff-jumper": "^1.8.3",
|
"@favware/cliff-jumper": "^1.8.3",
|
||||||
"@types/node": "^16.11.38",
|
"@types/node": "^16.11.38",
|
||||||
@@ -71,7 +72,6 @@
|
|||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"tsup": "^6.1.0",
|
"tsup": "^6.1.0",
|
||||||
"typedoc": "^0.22.17",
|
|
||||||
"typescript": "^4.7.3"
|
"typescript": "^4.7.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
2
packages/collection/.gitignore
vendored
2
packages/collection/.gitignore
vendored
@@ -18,7 +18,7 @@ pids
|
|||||||
dist/
|
dist/
|
||||||
typings/
|
typings/
|
||||||
docs/**/*
|
docs/**/*
|
||||||
!docs/index.yml
|
!docs/index.json
|
||||||
!docs/README.md
|
!docs/README.md
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
|
|||||||
1
packages/collection/docs/index.json
Normal file
1
packages/collection/docs/index.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{ "name": "General", "files": [{ "name": "Welcome", "id": "welcome", "path": "../../README.md" }] }]
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
- name: General
|
|
||||||
files:
|
|
||||||
- name: Welcome
|
|
||||||
id: welcome
|
|
||||||
path: ../../README.md
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && ts-docgen -i docs/typedoc-out.json -c docs/index.yml -o docs/docs.json",
|
"docs": "docgen -i src/index.ts -c docs/index.json -o docs/docs.json --typescript",
|
||||||
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@discordjs/docgen": "workspace:^",
|
||||||
"@discordjs/scripts": "workspace:^",
|
"@discordjs/scripts": "workspace:^",
|
||||||
"@favware/cliff-jumper": "^1.8.3",
|
"@favware/cliff-jumper": "^1.8.3",
|
||||||
"@types/node": "^16.11.38",
|
"@types/node": "^16.11.38",
|
||||||
@@ -59,7 +60,6 @@
|
|||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"tsup": "^6.1.0",
|
"tsup": "^6.1.0",
|
||||||
"typedoc": "^0.22.17",
|
|
||||||
"typescript": "^4.7.3"
|
"typescript": "^4.7.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -49,10 +49,11 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/collection": "workspace:^",
|
"@discordjs/collection": "^0.7.0",
|
||||||
"commander": "^9.3.0",
|
"commander": "^9.3.0",
|
||||||
"jsdoc-to-markdown": "^7.1.1",
|
"jsdoc-to-markdown": "^7.1.1",
|
||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0",
|
||||||
|
"typedoc": "^0.22.17"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^1.8.3",
|
"@favware/cliff-jumper": "^1.8.3",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { join } from 'node:path';
|
import { dirname, join } from 'node:path';
|
||||||
import { Collection } from '@discordjs/collection';
|
import { Collection } from '@discordjs/collection';
|
||||||
|
import type { DeclarationReflection } from 'typedoc';
|
||||||
import type { ChildTypes, Class, Config, CustomDocs, RootTypes } from './interfaces/index.js';
|
import type { ChildTypes, Class, Config, CustomDocs, RootTypes } from './interfaces/index.js';
|
||||||
import { DocumentedClass } from './types/class.js';
|
import { DocumentedClass } from './types/class.js';
|
||||||
import { DocumentedConstructor } from './types/constructor.js';
|
import { DocumentedConstructor } from './types/constructor.js';
|
||||||
@@ -23,11 +24,44 @@ export class Documentation {
|
|||||||
public readonly externals = new Collection<string, DocumentedExternal>();
|
public readonly externals = new Collection<string, DocumentedExternal>();
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
data: RootTypes[],
|
data: RootTypes[] | DeclarationReflection[],
|
||||||
private readonly config: Config,
|
private readonly config: Config,
|
||||||
private readonly custom?: Record<string, CustomDocs>,
|
private readonly custom?: Record<string, CustomDocs>,
|
||||||
) {
|
) {
|
||||||
let items = data;
|
if (config.typescript) {
|
||||||
|
const items = data as DeclarationReflection[];
|
||||||
|
|
||||||
|
for (const item of items) {
|
||||||
|
switch (item.kindString) {
|
||||||
|
case 'Class': {
|
||||||
|
this.classes.set(item.name, new DocumentedClass(item, config));
|
||||||
|
if (item.children) {
|
||||||
|
this.parse(item.children, item.name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 'Function': {
|
||||||
|
this.functions.set(item.name, new DocumentedMethod(item, config));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 'Interface':
|
||||||
|
case 'Type alias':
|
||||||
|
case 'Enumeration':
|
||||||
|
this.typedefs.set(item.name, new DocumentedTypeDef(item, config));
|
||||||
|
if (item.children) {
|
||||||
|
this.parse(item.children, item.name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let items = data as RootTypes[];
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
switch (item.kind) {
|
switch (item.kind) {
|
||||||
case 'class': {
|
case 'class': {
|
||||||
@@ -64,9 +98,71 @@ export class Documentation {
|
|||||||
|
|
||||||
this.parse(items as ChildTypes[]);
|
this.parse(items as ChildTypes[]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public parse(items: ChildTypes[]) {
|
public parse(items: ChildTypes[] | DeclarationReflection[], memberOf = '') {
|
||||||
for (const member of items) {
|
if (this.config.typescript) {
|
||||||
|
const it = items as DeclarationReflection[];
|
||||||
|
|
||||||
|
for (const member of it) {
|
||||||
|
let item: DocumentedMethod | DocumentedConstructor | DocumentedMember | DocumentedEvent | null = null;
|
||||||
|
|
||||||
|
switch (member.kindString) {
|
||||||
|
case 'Constructor': {
|
||||||
|
item = new DocumentedConstructor(member, this.config);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Method': {
|
||||||
|
item = new DocumentedMethod(member, this.config);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Property': {
|
||||||
|
item = new DocumentedMember(member, this.config);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'event': {
|
||||||
|
item = new DocumentedEvent(member, this.config);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
|
console.warn(`- Unknown documentation kind "${member.kindString}" - \n${JSON.stringify(member)}\n`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const parent = this.classes.get(memberOf) ?? this.interfaces.get(memberOf);
|
||||||
|
if (parent) {
|
||||||
|
if (item) {
|
||||||
|
parent.add(item);
|
||||||
|
} else {
|
||||||
|
console.warn(
|
||||||
|
`- Documentation item could not be constructed for "${member.name}" - \n${JSON.stringify(member)}\n`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const info = [];
|
||||||
|
const name = (member.name || item?.data.name) ?? 'UNKNOWN';
|
||||||
|
const meta =
|
||||||
|
member.kindString === 'constructor'
|
||||||
|
? null
|
||||||
|
: {
|
||||||
|
file: member.sources?.[0]?.fileName,
|
||||||
|
line: member.sources?.[0]?.line,
|
||||||
|
path: dirname(member.sources?.[0]?.fileName ?? ''),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (memberOf) info.push(`member of "${memberOf}"`);
|
||||||
|
if (meta) info.push(`${join(meta.path, meta.file ?? '')}${meta.line ? `:${meta.line}` : ''}`);
|
||||||
|
|
||||||
|
console.warn(`- "${name}"${info.length ? ` (${info.join(', ')})` : ''} has no accessible parent.`);
|
||||||
|
if (!name && !info.length) console.warn('Raw object:', member);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const it = items as ChildTypes[];
|
||||||
|
|
||||||
|
for (const member of it) {
|
||||||
let item: DocumentedMethod | DocumentedConstructor | DocumentedMember | DocumentedEvent | null = null;
|
let item: DocumentedMethod | DocumentedConstructor | DocumentedMember | DocumentedEvent | null = null;
|
||||||
|
|
||||||
switch (member.kind) {
|
switch (member.kind) {
|
||||||
@@ -107,19 +203,22 @@ export class Documentation {
|
|||||||
|
|
||||||
const info = [];
|
const info = [];
|
||||||
const name = (member.name || item?.data.name) ?? 'UNKNOWN';
|
const name = (member.name || item?.data.name) ?? 'UNKNOWN';
|
||||||
const memberof = member.memberof ?? item?.data.memberof;
|
// @ts-expect-error
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unnecessary-condition
|
||||||
|
const memberof = member.memberof ?? item?.data?.memberof;
|
||||||
const meta =
|
const meta =
|
||||||
member.kind === 'constructor'
|
member.kind === 'constructor'
|
||||||
? null
|
? null
|
||||||
: { file: member.meta.filename, line: member.meta.lineno, path: member.meta.path };
|
: { file: member.meta.filename, line: member.meta.lineno, path: member.meta.path };
|
||||||
|
|
||||||
if (memberof) info.push(`member of "${memberof}"`);
|
if (memberof) info.push(`member of "${memberof as string}"`);
|
||||||
if (meta) info.push(`${join(meta.path, meta.file)}${meta.line ? `:${meta.line}` : ''}`);
|
if (meta) info.push(`${join(meta.path, meta.file)}${meta.line ? `:${meta.line}` : ''}`);
|
||||||
|
|
||||||
console.warn(`- "${name}"${info.length ? ` (${info.join(', ')})` : ''} has no accessible parent.`);
|
console.warn(`- "${name}"${info.length ? ` (${info.join(', ')})` : ''} has no accessible parent.`);
|
||||||
if (!name && !info.length) console.warn('Raw object:', member);
|
if (!name && !info.length) console.warn('Raw object:', member);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public serialize() {
|
public serialize() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { readFileSync, writeFileSync } from 'node:fs';
|
|||||||
import { join, basename, extname, dirname, relative } from 'node:path';
|
import { join, basename, extname, dirname, relative } from 'node:path';
|
||||||
import { createCommand } from 'commander';
|
import { createCommand } from 'commander';
|
||||||
import jsdoc2md from 'jsdoc-to-markdown';
|
import jsdoc2md from 'jsdoc-to-markdown';
|
||||||
|
import { Application, DeclarationReflection, TSConfigReader } from 'typedoc';
|
||||||
import { Documentation } from './documentation.js';
|
import { Documentation } from './documentation.js';
|
||||||
import type { ChildTypes, CustomDocs, RootTypes } from './interfaces/index.js';
|
import type { ChildTypes, CustomDocs, RootTypes } from './interfaces/index.js';
|
||||||
import packageFile from '../package.json';
|
import packageFile from '../package.json';
|
||||||
@@ -12,6 +13,7 @@ interface CLIOptions {
|
|||||||
custom: string;
|
custom: string;
|
||||||
root: string;
|
root: string;
|
||||||
output: string;
|
output: string;
|
||||||
|
typescript: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CustomFiles {
|
interface CustomFiles {
|
||||||
@@ -30,14 +32,29 @@ const command = createCommand()
|
|||||||
.option('-i, --input <string...>', 'Source directories to parse JSDocs in')
|
.option('-i, --input <string...>', 'Source directories to parse JSDocs in')
|
||||||
.option('-c, --custom <string>', 'Custom docs definition file to use')
|
.option('-c, --custom <string>', 'Custom docs definition file to use')
|
||||||
.option('-r, --root [string]', 'Root directory of the project', '.')
|
.option('-r, --root [string]', 'Root directory of the project', '.')
|
||||||
.option('-o, --output <string>', 'Path to output file');
|
.option('-o, --output <string>', 'Path to output file')
|
||||||
|
.option('--typescript', '', false);
|
||||||
|
|
||||||
const program = command.parse(process.argv);
|
const program = command.parse(process.argv);
|
||||||
const options = program.opts<CLIOptions>();
|
const options = program.opts<CLIOptions>();
|
||||||
|
|
||||||
|
let data: (RootTypes & ChildTypes)[] | DeclarationReflection[] = [];
|
||||||
|
if (options.typescript) {
|
||||||
|
console.log('Parsing Typescript in source files...');
|
||||||
|
const app = new Application();
|
||||||
|
app.options.addReader(new TSConfigReader());
|
||||||
|
app.bootstrap({ entryPoints: options.input });
|
||||||
|
const project = app.convert();
|
||||||
|
if (project) {
|
||||||
|
// @ts-expect-error
|
||||||
|
data = app.serializer.toObject(project).children!;
|
||||||
|
console.log(`${data.length} items parsed.`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
console.log('Parsing JSDocs in source files...');
|
console.log('Parsing JSDocs in source files...');
|
||||||
const data = jsdoc2md.getTemplateDataSync({ files: options.input }) as (RootTypes & ChildTypes)[];
|
data = jsdoc2md.getTemplateDataSync({ files: options.input }) as (RootTypes & ChildTypes)[];
|
||||||
console.log(`${data.length} JSDoc items parsed.`);
|
console.log(`${data.length} JSDoc items parsed.`);
|
||||||
|
}
|
||||||
|
|
||||||
const custom: Record<string, CustomDocs> = {};
|
const custom: Record<string, CustomDocs> = {};
|
||||||
if (options.custom) {
|
if (options.custom) {
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
export interface Config {
|
export interface Config {
|
||||||
|
input: string[];
|
||||||
|
custom: string;
|
||||||
root: string;
|
root: string;
|
||||||
|
output: string;
|
||||||
|
typescript: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import { parse } from 'node:path';
|
||||||
import { Collection } from '@discordjs/collection';
|
import { Collection } from '@discordjs/collection';
|
||||||
|
import type { DeclarationReflection } from 'typedoc';
|
||||||
import { DocumentedConstructor } from './constructor.js';
|
import { DocumentedConstructor } from './constructor.js';
|
||||||
import { DocumentedEvent } from './event.js';
|
import { DocumentedEvent } from './event.js';
|
||||||
import { DocumentedItemMeta } from './item-meta.js';
|
import { DocumentedItemMeta } from './item-meta.js';
|
||||||
@@ -7,8 +9,9 @@ import { DocumentedMember } from './member.js';
|
|||||||
import { DocumentedMethod } from './method.js';
|
import { DocumentedMethod } from './method.js';
|
||||||
import { DocumentedVarType } from './var-type.js';
|
import { DocumentedVarType } from './var-type.js';
|
||||||
import type { Class, Config } from '../interfaces/index.js';
|
import type { Class, Config } from '../interfaces/index.js';
|
||||||
|
import { parseType } from '../util/parseType.js';
|
||||||
|
|
||||||
export class DocumentedClass extends DocumentedItem<Class> {
|
export class DocumentedClass extends DocumentedItem<Class | DeclarationReflection> {
|
||||||
public readonly props = new Collection<string, DocumentedMember>();
|
public readonly props = new Collection<string, DocumentedMember>();
|
||||||
|
|
||||||
public readonly methods = new Collection<string, DocumentedMethod>();
|
public readonly methods = new Collection<string, DocumentedMethod>();
|
||||||
@@ -21,15 +24,29 @@ export class DocumentedClass extends DocumentedItem<Class> {
|
|||||||
|
|
||||||
public implements: DocumentedVarType | null = null;
|
public implements: DocumentedVarType | null = null;
|
||||||
|
|
||||||
public constructor(data: Class, config: Config) {
|
public constructor(data: Class | DeclarationReflection, config: Config) {
|
||||||
super(data, config);
|
super(data, config);
|
||||||
|
|
||||||
if (data.augments) {
|
if (config.typescript) {
|
||||||
this.extends = new DocumentedVarType({ names: data.augments }, this.config);
|
const d = data as DeclarationReflection;
|
||||||
|
const extended = d.extendedTypes?.[0];
|
||||||
|
if (extended) {
|
||||||
|
this.extends = new DocumentedVarType({ names: [parseType(extended)] }, this.config);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.implements) {
|
const implemented = d.implementedTypes?.[0];
|
||||||
this.implements = new DocumentedVarType({ names: data.implements }, this.config);
|
if (implemented) {
|
||||||
|
this.implements = new DocumentedVarType({ names: [parseType(implemented)] }, this.config);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const d = data as Class;
|
||||||
|
if (d.augments) {
|
||||||
|
this.extends = new DocumentedVarType({ names: d.augments }, this.config);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d.implements) {
|
||||||
|
this.implements = new DocumentedVarType({ names: d.implements }, this.config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +55,9 @@ export class DocumentedClass extends DocumentedItem<Class> {
|
|||||||
if (this.construct) throw new Error(`Doc ${this.data.name} already has constructor`);
|
if (this.construct) throw new Error(`Doc ${this.data.name} already has constructor`);
|
||||||
this.construct = item;
|
this.construct = item;
|
||||||
} else if (item instanceof DocumentedMethod) {
|
} else if (item instanceof DocumentedMethod) {
|
||||||
const prefix = item.data.scope === 'static' ? 's-' : '';
|
// @ts-expect-error
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||||
|
const prefix = item.data.scope === 'static' || item.data.flags?.isStatic ? 's-' : '';
|
||||||
if (this.methods.has(prefix + item.data.name)) {
|
if (this.methods.has(prefix + item.data.name)) {
|
||||||
throw new Error(`Doc ${this.data.name} already has method ${item.data.name}`);
|
throw new Error(`Doc ${this.data.name} already has method ${item.data.name}`);
|
||||||
}
|
}
|
||||||
@@ -57,20 +76,57 @@ export class DocumentedClass extends DocumentedItem<Class> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as DeclarationReflection;
|
||||||
|
let meta;
|
||||||
|
|
||||||
|
const sources = data.sources?.[0];
|
||||||
|
if (sources) {
|
||||||
|
meta = new DocumentedItemMeta(sources, this.config).serialize();
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
// @ts-expect-error
|
||||||
description: this.data.description,
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||||
see: this.data.see,
|
name: data.name === 'default' ? parse(meta?.file ?? 'default').name : data.name,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
description: data.comment?.shortText?.trim(),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
see: data.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
extends: this.extends?.serialize(),
|
extends: this.extends?.serialize(),
|
||||||
implements: this.implements?.serialize(),
|
implements: this.implements?.serialize(),
|
||||||
access: this.data.access,
|
access:
|
||||||
abstract: this.data.virtual,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
deprecated: this.data.deprecated,
|
data.flags.isPrivate || data.comment?.tags?.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
|
? 'private'
|
||||||
|
: undefined,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
abstract: data.comment?.tags?.some((t) => t.tagName === 'abstract'),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
deprecated: data.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||||
construct: this.construct?.serialize(),
|
construct: this.construct?.serialize(),
|
||||||
props: this.props.size ? this.props.map((p) => p.serialize()) : undefined,
|
props: this.props.size ? this.props.map((p) => p.serialize()) : undefined,
|
||||||
methods: this.methods.size ? this.methods.map((m) => m.serialize()) : undefined,
|
methods: this.methods.size ? this.methods.map((m) => m.serialize()) : undefined,
|
||||||
events: this.events.size ? this.events.map((e) => e.serialize()) : undefined,
|
events: this.events.size ? this.events.map((e) => e.serialize()) : undefined,
|
||||||
meta: new DocumentedItemMeta(this.data.meta, this.config).serialize(),
|
meta,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Class;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
see: data.see,
|
||||||
|
extends: this.extends?.serialize(),
|
||||||
|
implements: this.implements?.serialize(),
|
||||||
|
access: data.access,
|
||||||
|
abstract: data.virtual,
|
||||||
|
deprecated: data.deprecated,
|
||||||
|
construct: this.construct?.serialize(),
|
||||||
|
props: this.props.size ? this.props.map((p) => p.serialize()) : undefined,
|
||||||
|
methods: this.methods.size ? this.methods.map((m) => m.serialize()) : undefined,
|
||||||
|
events: this.events.size ? this.events.map((e) => e.serialize()) : undefined,
|
||||||
|
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,40 @@
|
|||||||
|
import type { DeclarationReflection, SignatureReflection } from 'typedoc';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import { DocumentedParam } from './param.js';
|
import { DocumentedParam } from './param.js';
|
||||||
import type { Constructor } from '../interfaces/index.js';
|
import type { Constructor } from '../interfaces/index.js';
|
||||||
|
|
||||||
export class DocumentedConstructor extends DocumentedItem<Constructor> {
|
export class DocumentedConstructor extends DocumentedItem<Constructor | DeclarationReflection> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as DeclarationReflection;
|
||||||
|
const signature = (data.signatures ?? [])[0] ?? data;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
name: data.name,
|
||||||
description: this.data.description,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
see: this.data.see,
|
description: signature.comment?.shortText?.trim(),
|
||||||
access: this.data.access,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
params: this.data.params?.length
|
see: signature.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
? this.data.params.map((p) => new DocumentedParam(p, this.config).serialize())
|
access:
|
||||||
|
data.flags.isPrivate ||
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
signature.comment?.tags?.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
|
? 'private'
|
||||||
|
: undefined,
|
||||||
|
// @ts-expect-error
|
||||||
|
params: signature.parameters
|
||||||
|
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config))
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const data = this.data as Constructor;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
see: data.see,
|
||||||
|
access: data.access,
|
||||||
|
params: data.params?.length ? data.params.map((p) => new DocumentedParam(p, this.config).serialize()) : undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,45 @@
|
|||||||
|
import type { DeclarationReflection, SignatureReflection } from 'typedoc';
|
||||||
import { DocumentedItemMeta } from './item-meta.js';
|
import { DocumentedItemMeta } from './item-meta.js';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import { DocumentedParam } from './param.js';
|
import { DocumentedParam } from './param.js';
|
||||||
import type { Event } from '../interfaces/index.js';
|
import type { Event } from '../interfaces/index.js';
|
||||||
|
|
||||||
export class DocumentedEvent extends DocumentedItem<Event> {
|
export class DocumentedEvent extends DocumentedItem<Event | DeclarationReflection> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as DeclarationReflection;
|
||||||
|
const signature = (data.signatures ?? [])[0] ?? data;
|
||||||
|
let meta;
|
||||||
|
|
||||||
|
const sources = data.sources?.[0];
|
||||||
|
if (sources) {
|
||||||
|
meta = new DocumentedItemMeta(sources, this.config).serialize();
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
name: data.name,
|
||||||
description: this.data.description,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
see: this.data.see,
|
description: signature.comment?.shortText?.trim(),
|
||||||
deprecated: this.data.deprecated,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
params: this.data.params?.length
|
see: signature.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
? this.data.params.map((p) => new DocumentedParam(p, this.config).serialize())
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
deprecated: signature.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||||
|
// @ts-expect-error
|
||||||
|
params: signature.parameters
|
||||||
|
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config))
|
||||||
: undefined,
|
: undefined,
|
||||||
meta: new DocumentedItemMeta(this.data.meta, this.config).serialize(),
|
meta,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Event;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
see: data.see,
|
||||||
|
deprecated: data.deprecated,
|
||||||
|
params: data.params?.length ? data.params.map((p) => new DocumentedParam(p, this.config).serialize()) : undefined,
|
||||||
|
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
import { relative } from 'node:path';
|
import { basename, dirname, relative } from 'node:path';
|
||||||
|
import type { SourceReference } from 'typedoc';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import type { Meta } from '../interfaces/index.js';
|
import type { Meta } from '../interfaces/index.js';
|
||||||
|
|
||||||
export class DocumentedItemMeta extends DocumentedItem<Meta> {
|
export class DocumentedItemMeta extends DocumentedItem<Meta | SourceReference> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as SourceReference;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
line: this.data.lineno,
|
line: data.line,
|
||||||
file: this.data.filename,
|
file: basename(data.fileName),
|
||||||
path: relative(this.config.root, this.data.path).replace(/\\/g, '/'),
|
path: dirname(data.fileName),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Meta;
|
||||||
|
return {
|
||||||
|
line: data.lineno,
|
||||||
|
file: data.filename,
|
||||||
|
path: relative(this.config.root, data.path).replace(/\\/g, '/'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
import type { DeclarationReflection } from 'typedoc';
|
||||||
import type { Config, Item } from '../interfaces/index.js';
|
import type { Config, Item } from '../interfaces/index.js';
|
||||||
|
|
||||||
export class DocumentedItem<T = Item> {
|
export class DocumentedItem<T = Item | DeclarationReflection> {
|
||||||
public constructor(public readonly data: T, public readonly config: Config) {}
|
public constructor(public readonly data: T, public readonly config: Config) {}
|
||||||
|
|
||||||
public serialize() {
|
public serialize(): unknown {
|
||||||
try {
|
try {
|
||||||
return this.serializer();
|
return this.serializer();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -1,27 +1,101 @@
|
|||||||
|
import type { DeclarationReflection } from 'typedoc';
|
||||||
import { DocumentedItemMeta } from './item-meta.js';
|
import { DocumentedItemMeta } from './item-meta.js';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import { DocumentedParam } from './param.js';
|
import { DocumentedParam } from './param.js';
|
||||||
import { DocumentedVarType } from './var-type.js';
|
import { DocumentedVarType } from './var-type.js';
|
||||||
import type { Member } from '../interfaces/index.js';
|
import type { Member } from '../interfaces/index.js';
|
||||||
|
import { parseType } from '../util/parseType.js';
|
||||||
|
|
||||||
export class DocumentedMember extends DocumentedItem<Member> {
|
export class DocumentedMember extends DocumentedItem<Member | DeclarationReflection> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
return {
|
if (this.config.typescript) {
|
||||||
name: this.data.name,
|
const data = this.data as DeclarationReflection;
|
||||||
description: this.data.description,
|
let meta;
|
||||||
see: this.data.see,
|
|
||||||
scope: this.data.scope,
|
const sources = data.sources?.[0];
|
||||||
access: this.data.access,
|
if (sources) {
|
||||||
readonly: this.data.readonly,
|
meta = new DocumentedItemMeta(sources, this.config).serialize();
|
||||||
nullable: this.data.nullable,
|
}
|
||||||
abstract: this.data.virtual,
|
|
||||||
deprecated: this.data.deprecated,
|
const base = {
|
||||||
default: this.data.default,
|
name: data.name,
|
||||||
type: new DocumentedVarType(this.data.type, this.config).serialize(),
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
props: this.data.properties?.length
|
description: data.comment?.shortText?.trim(),
|
||||||
? this.data.properties.map((p) => new DocumentedParam(p, this.config).serialize())
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
see: data.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
|
scope: data.flags.isStatic ? 'static' : undefined,
|
||||||
|
access:
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
data.flags.isPrivate || data.comment?.tags?.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
|
? 'private'
|
||||||
: undefined,
|
: undefined,
|
||||||
meta: new DocumentedItemMeta(this.data.meta, this.config).serialize(),
|
readonly: data.flags.isReadonly,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
abstract: data.comment?.tags?.some((t) => t.tagName === 'abstract'),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
deprecated: data.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||||
|
default:
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
data.comment?.tags?.find((t) => t.tagName === 'default')?.text.trim() ??
|
||||||
|
(data.defaultValue === '...' ? undefined : data.defaultValue),
|
||||||
|
type: data.type ? new DocumentedVarType({ names: [parseType(data.type)] }, this.config).serialize() : undefined,
|
||||||
|
meta,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (data.kindString === 'Accessor') {
|
||||||
|
const getter = data.getSignature;
|
||||||
|
const hasSetter = data.setSignature;
|
||||||
|
|
||||||
|
if (!getter) {
|
||||||
|
throw new Error("Can't parse accessor without getter.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasSetter) base.readonly = true;
|
||||||
|
|
||||||
|
return {
|
||||||
|
...base,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
description: getter.comment?.shortText?.trim(),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
see: getter.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
|
access:
|
||||||
|
getter.flags.isPrivate ||
|
||||||
|
getter.comment?.tags.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
|
? 'private'
|
||||||
|
: undefined,
|
||||||
|
readonly: base.readonly || !hasSetter,
|
||||||
|
abstract: getter.comment?.tags.some((t) => t.tagName === 'abstract'),
|
||||||
|
deprecated: getter.comment?.tags.some((t) => t.tagName === 'deprecated'),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
|
default:
|
||||||
|
base.default ??
|
||||||
|
getter.comment?.tags.find((t) => t.tagName === 'default')?.text.trim() ??
|
||||||
|
// @ts-expect-error
|
||||||
|
getter.defaultValue,
|
||||||
|
type: getter.type ? parseType(getter.type) : undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Member;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
see: data.see,
|
||||||
|
scope: data.scope,
|
||||||
|
access: data.access,
|
||||||
|
readonly: data.readonly,
|
||||||
|
nullable: data.nullable,
|
||||||
|
abstract: data.virtual,
|
||||||
|
deprecated: data.deprecated,
|
||||||
|
default: data.default,
|
||||||
|
type: new DocumentedVarType(data.type, this.config).serialize(),
|
||||||
|
props: data.properties?.length
|
||||||
|
? data.properties.map((p) => new DocumentedParam(p, this.config).serialize())
|
||||||
|
: undefined,
|
||||||
|
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,86 @@
|
|||||||
|
import type { DeclarationReflection, SignatureReflection } from 'typedoc';
|
||||||
import { DocumentedItemMeta } from './item-meta.js';
|
import { DocumentedItemMeta } from './item-meta.js';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import { DocumentedParam } from './param.js';
|
import { DocumentedParam } from './param.js';
|
||||||
import { DocumentedVarType } from './var-type.js';
|
import { DocumentedVarType } from './var-type.js';
|
||||||
import type { Method } from '../interfaces/index.js';
|
import type { Method } from '../interfaces/index.js';
|
||||||
|
import { parseType } from '../util/parseType.js';
|
||||||
|
|
||||||
export class DocumentedMethod extends DocumentedItem<Method> {
|
export class DocumentedMethod extends DocumentedItem<Method | DeclarationReflection> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as DeclarationReflection;
|
||||||
|
const signature = (data.signatures ?? [])[0] ?? data;
|
||||||
|
let meta;
|
||||||
|
|
||||||
|
const sources = data.sources?.[0];
|
||||||
|
if (sources) {
|
||||||
|
meta = new DocumentedItemMeta(sources, this.config).serialize();
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
name: data.name,
|
||||||
description: this.data.description,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
see: this.data.see,
|
description: signature.comment?.shortText?.trim(),
|
||||||
scope: this.data.scope,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
access: this.data.access,
|
see: signature.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
inherits: this.data.inherits,
|
scope: data.flags.isStatic ? 'static' : undefined,
|
||||||
inherited: this.data.inherited,
|
access:
|
||||||
implements: this.data.implements,
|
data.flags.isPrivate ||
|
||||||
examples: this.data.examples,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
abstract: this.data.virtual && !this.data.inherited,
|
signature.comment?.tags?.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
deprecated: this.data.deprecated,
|
? 'private'
|
||||||
emits: this.data.fires,
|
|
||||||
throws: this.data.exceptions,
|
|
||||||
params: this.data.params?.length
|
|
||||||
? this.data.params.map((p) => new DocumentedParam(p, this.config).serialize())
|
|
||||||
: undefined,
|
: undefined,
|
||||||
async: this.data.async,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
generator: this.data.generator,
|
examples: signature.comment?.tags?.filter((t) => t.tagName === 'example').map((t) => t.text.trim()),
|
||||||
returns: this.data.returns?.length
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
? this.data.returns.map((p) =>
|
abstract: signature.comment?.tags?.some((t) => t.tagName === 'abstract'),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
deprecated: signature.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
emits: signature.comment?.tags?.filter((t) => t.tagName === 'emits').map((t) => t.text.trim()),
|
||||||
|
// @ts-expect-error
|
||||||
|
params: signature.parameters
|
||||||
|
? (signature as SignatureReflection).parameters?.map((p) => new DocumentedParam(p, this.config))
|
||||||
|
: undefined,
|
||||||
|
returns: signature.type
|
||||||
|
? new DocumentedVarType(
|
||||||
|
{ names: [parseType(signature.type)], description: signature.comment?.returns?.trim() },
|
||||||
|
this.config,
|
||||||
|
).serialize()
|
||||||
|
: undefined,
|
||||||
|
returnsDescription: signature.comment?.returns?.trim(),
|
||||||
|
meta,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Method;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
see: data.see,
|
||||||
|
scope: data.scope,
|
||||||
|
access: data.access,
|
||||||
|
inherits: data.inherits,
|
||||||
|
inherited: data.inherited,
|
||||||
|
implements: data.implements,
|
||||||
|
examples: data.examples,
|
||||||
|
abstract: data.virtual && !data.inherited,
|
||||||
|
deprecated: data.deprecated,
|
||||||
|
emits: data.fires,
|
||||||
|
throws: data.exceptions,
|
||||||
|
params: data.params?.length ? data.params.map((p) => new DocumentedParam(p, this.config).serialize()) : undefined,
|
||||||
|
async: data.async,
|
||||||
|
generator: data.generator,
|
||||||
|
returns: data.returns?.length
|
||||||
|
? data.returns.map((p) =>
|
||||||
new DocumentedVarType(
|
new DocumentedVarType(
|
||||||
{ names: p.type.names, description: p.description, nullable: p.nullable },
|
{ names: p.type.names, description: p.description, nullable: p.nullable },
|
||||||
this.config,
|
this.config,
|
||||||
).serialize(),
|
).serialize(),
|
||||||
)
|
)
|
||||||
: undefined,
|
: undefined,
|
||||||
meta: new DocumentedItemMeta(this.data.meta, this.config).serialize(),
|
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,37 @@
|
|||||||
|
import type { ParameterReflection } from 'typedoc';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import { DocumentedVarType } from './var-type.js';
|
import { DocumentedVarType } from './var-type.js';
|
||||||
import type { Param } from '../interfaces/index.js';
|
import type { Param } from '../interfaces/index.js';
|
||||||
|
import { parseType } from '../util/parseType.js';
|
||||||
|
|
||||||
export class DocumentedParam extends DocumentedItem<Param> {
|
export class DocumentedParam extends DocumentedItem<Param | ParameterReflection> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as ParameterReflection;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
name: data.name,
|
||||||
description: this.data.description,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
optional: this.data.optional,
|
description: data.comment?.shortText?.trim() ?? data.comment?.text.trim(),
|
||||||
default: this.data.defaultvalue,
|
optional: data.flags.isOptional || typeof data.defaultValue != 'undefined',
|
||||||
variable: this.data.variable,
|
default:
|
||||||
nullable: this.data.nullable,
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
type: new DocumentedVarType(this.data.type, this.config).serialize(),
|
data.comment?.tags?.find((t) => t.tagName === 'default')?.text.trim() ??
|
||||||
|
(data.defaultValue === '...' ? undefined : data.defaultValue),
|
||||||
|
type: data.type ? new DocumentedVarType({ names: [parseType(data.type)] }, this.config).serialize() : undefined,
|
||||||
|
variable: data.flags.isRest,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Param;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
optional: data.optional,
|
||||||
|
default: data.defaultvalue,
|
||||||
|
variable: data.variable,
|
||||||
|
nullable: data.nullable,
|
||||||
|
type: new DocumentedVarType(data.type, this.config).serialize(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,156 @@
|
|||||||
|
import type { DeclarationReflection } from 'typedoc';
|
||||||
import { DocumentedItemMeta } from './item-meta.js';
|
import { DocumentedItemMeta } from './item-meta.js';
|
||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import { DocumentedParam } from './param.js';
|
import { DocumentedParam } from './param.js';
|
||||||
import { DocumentedVarType } from './var-type.js';
|
import { DocumentedVarType } from './var-type.js';
|
||||||
import type { Typedef } from '../interfaces/index.js';
|
import type { Typedef } from '../interfaces/index.js';
|
||||||
|
import { parseType } from '../util/parseType.js';
|
||||||
|
import { isReflectionType } from '../util/types.js';
|
||||||
|
|
||||||
export class DocumentedTypeDef extends DocumentedItem<Typedef> {
|
export class DocumentedTypeDef extends DocumentedItem<Typedef | DeclarationReflection> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
|
if (this.config.typescript) {
|
||||||
|
const data = this.data as DeclarationReflection;
|
||||||
|
let meta;
|
||||||
|
|
||||||
|
const sources = data.sources?.[0];
|
||||||
|
if (sources) {
|
||||||
|
meta = new DocumentedItemMeta(sources, this.config).serialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseReturn = {
|
||||||
|
name: data.name,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
description: data.comment?.shortText?.trim(),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
see: data.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
|
access:
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
data.flags.isPrivate || data.comment?.tags?.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
|
? 'private'
|
||||||
|
: undefined,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
deprecated: data.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||||
|
type: data.type ? new DocumentedVarType({ names: [parseType(data.type)] }, this.config).serialize() : undefined,
|
||||||
|
meta,
|
||||||
|
};
|
||||||
|
|
||||||
|
let typeDef: DeclarationReflection | undefined;
|
||||||
|
if (isReflectionType(data.type)) {
|
||||||
|
typeDef = data.type.declaration;
|
||||||
|
} else if (data.kindString === 'Interface') {
|
||||||
|
typeDef = data;
|
||||||
|
} else if (data.kindString === 'Enumeration') {
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
...baseReturn,
|
||||||
description: this.data.description,
|
props: data.children?.length
|
||||||
see: this.data.see,
|
? data.children.map((child) => ({
|
||||||
access: this.data.access,
|
name: child.name,
|
||||||
deprecated: this.data.deprecated,
|
description: child.comment?.shortText.trim(),
|
||||||
type: new DocumentedVarType(this.data.type, this.config).serialize(),
|
type: typeof child.defaultValue == 'undefined' ? undefined : [[[child.defaultValue]]],
|
||||||
props: this.data.properties?.length
|
}))
|
||||||
? this.data.properties.map((p) => new DocumentedParam(p, this.config).serialize())
|
|
||||||
: undefined,
|
: undefined,
|
||||||
params: this.data.params?.length
|
};
|
||||||
? this.data.params.map((p) => new DocumentedParam(p, this.config).serialize())
|
}
|
||||||
|
|
||||||
|
if (typeDef) {
|
||||||
|
const { children, signatures } = typeDef;
|
||||||
|
|
||||||
|
if (children && children.length > 0) {
|
||||||
|
const props = children.map((child) => ({
|
||||||
|
name: child.name,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
description: child.comment?.shortText?.trim() ?? child.signatures?.[0]?.comment?.shortText?.trim(),
|
||||||
|
optional: child.flags.isOptional || typeof child.defaultValue != 'undefined',
|
||||||
|
default:
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
child.comment?.tags?.find((t) => t.tagName === 'default')?.text.trim() ??
|
||||||
|
(child.defaultValue === '...' ? undefined : child.defaultValue),
|
||||||
|
type: child.type
|
||||||
|
? new DocumentedVarType({ names: [parseType(child.type)] }, this.config).serialize()
|
||||||
|
: child.kindString === 'Method'
|
||||||
|
? new DocumentedVarType(
|
||||||
|
{
|
||||||
|
names: [
|
||||||
|
parseType({
|
||||||
|
type: 'reflection',
|
||||||
|
declaration: child,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
this.config,
|
||||||
|
).serialize()
|
||||||
: undefined,
|
: undefined,
|
||||||
returns: this.data.returns?.length
|
}));
|
||||||
? this.data.returns.map((p) => new DocumentedVarType(p, this.config).serialize())
|
|
||||||
|
return {
|
||||||
|
...baseReturn,
|
||||||
|
props,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signatures && signatures.length > 0) {
|
||||||
|
const sig = signatures[0];
|
||||||
|
|
||||||
|
const params = sig?.parameters?.map((param) => ({
|
||||||
|
name: param.name,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
description: param.comment?.shortText?.trim(),
|
||||||
|
optional: param.flags.isOptional || typeof param.defaultValue != 'undefined',
|
||||||
|
default:
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
param.comment?.tags?.find((t) => t.tagName === 'default')?.text.trim() ??
|
||||||
|
(param.defaultValue === '...' ? undefined : param.defaultValue),
|
||||||
|
type: param.type
|
||||||
|
? new DocumentedVarType({ names: [parseType(param.type)] }, this.config).serialize()
|
||||||
: undefined,
|
: undefined,
|
||||||
meta: new DocumentedItemMeta(this.data.meta, this.config).serialize(),
|
}));
|
||||||
|
|
||||||
|
return {
|
||||||
|
...baseReturn,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
description: sig?.comment?.shortText?.trim(),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
see: sig?.comment?.tags?.filter((t) => t.tagName === 'see').map((t) => t.text.trim()),
|
||||||
|
access:
|
||||||
|
sig?.flags.isPrivate ||
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
sig?.comment?.tags?.some((t) => t.tagName === 'private' || t.tagName === 'internal')
|
||||||
|
? 'private'
|
||||||
|
: undefined,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
deprecated: sig?.comment?.tags?.some((t) => t.tagName === 'deprecated'),
|
||||||
|
params,
|
||||||
|
returns: sig?.type
|
||||||
|
? new DocumentedVarType(
|
||||||
|
{ names: [parseType(sig.type)], description: sig.comment?.returns?.trim() },
|
||||||
|
this.config,
|
||||||
|
).serialize()
|
||||||
|
: undefined,
|
||||||
|
returnsDescription: sig?.comment?.returns?.trim(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data as Typedef;
|
||||||
|
return {
|
||||||
|
name: data.name,
|
||||||
|
description: data.description,
|
||||||
|
see: data.see,
|
||||||
|
access: data.access,
|
||||||
|
deprecated: data.deprecated,
|
||||||
|
type: new DocumentedVarType(data.type, this.config).serialize(),
|
||||||
|
props: data.properties?.length
|
||||||
|
? data.properties.map((p) => new DocumentedParam(p, this.config).serialize())
|
||||||
|
: undefined,
|
||||||
|
params: data.params?.length ? data.params.map((p) => new DocumentedParam(p, this.config).serialize()) : undefined,
|
||||||
|
returns: data.returns?.length
|
||||||
|
? data.returns.map((p) => new DocumentedVarType(p, this.config).serialize())
|
||||||
|
: undefined,
|
||||||
|
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,36 @@
|
|||||||
import { DocumentedItem } from './item.js';
|
import { DocumentedItem } from './item.js';
|
||||||
import type { VarType } from '../interfaces/index.js';
|
import type { VarType } from '../interfaces/index.js';
|
||||||
|
import { parseType } from '../util/parseType.js';
|
||||||
|
import { splitVarName } from '../util/splitVarName.js';
|
||||||
|
|
||||||
export class DocumentedVarType extends DocumentedItem<VarType> {
|
export class DocumentedVarType extends DocumentedItem<VarType> {
|
||||||
public override serializer() {
|
public override serializer() {
|
||||||
const names = this.data.names?.map((name) => this.splitVarName(name));
|
if (this.config.typescript) {
|
||||||
|
const data = this.data;
|
||||||
|
const names = data.names?.map((name) => splitVarName(parseType(name)));
|
||||||
|
|
||||||
if (!this.data.description && !this.data.nullable) {
|
if (!data.description && !data.nullable) {
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
types: names,
|
types: names,
|
||||||
description: this.data.description,
|
description: data.description,
|
||||||
nullable: this.data.nullable,
|
nullable: data.nullable,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private splitVarName(str: string) {
|
const data = this.data;
|
||||||
const res: string[][] = [];
|
const names = data.names?.map((name) => splitVarName(name));
|
||||||
let currGroup: string[] = [];
|
|
||||||
let currStr = '';
|
|
||||||
|
|
||||||
const isASymbol = (char: string) => '-!$%^&*()_+|~=`{}[]:;<>?, '.includes(char);
|
if (!data.description && !data.nullable) {
|
||||||
|
return names;
|
||||||
for (const char of str) {
|
|
||||||
const currentlyInASymbolSection = isASymbol(currStr[0]!);
|
|
||||||
const charIsASymbol = isASymbol(char);
|
|
||||||
|
|
||||||
if (currStr.length && currentlyInASymbolSection !== charIsASymbol) {
|
|
||||||
currGroup.push(currStr);
|
|
||||||
currStr = char;
|
|
||||||
|
|
||||||
if (!charIsASymbol) {
|
|
||||||
res.push(currGroup);
|
|
||||||
currGroup = [];
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
currStr += char;
|
return {
|
||||||
}
|
types: names,
|
||||||
}
|
description: data.description,
|
||||||
currGroup.push(currStr);
|
nullable: data.nullable,
|
||||||
res.push(currGroup);
|
};
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
112
packages/docgen/src/util/parseType.ts
Normal file
112
packages/docgen/src/util/parseType.ts
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
import type { JSONOutput } from 'typedoc';
|
||||||
|
import {
|
||||||
|
isArrayType,
|
||||||
|
isConditionalType,
|
||||||
|
isIndexedAccessType,
|
||||||
|
isIntersectionType,
|
||||||
|
isPredicateType,
|
||||||
|
isReferenceType,
|
||||||
|
isReflectionType,
|
||||||
|
isLiteralType,
|
||||||
|
isTupleType,
|
||||||
|
isTypeOperatorType,
|
||||||
|
isUnionType,
|
||||||
|
isQueryType,
|
||||||
|
isInferredType,
|
||||||
|
isIntrinsicType,
|
||||||
|
isUnknownType,
|
||||||
|
} from './types';
|
||||||
|
|
||||||
|
export function parseType(t: JSONOutput.SomeType | JSONOutput.Type | string): string {
|
||||||
|
if (typeof t === 'string') {
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isArrayType(t)) {
|
||||||
|
return `Array<${parseType(t.elementType)}>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isConditionalType(t)) {
|
||||||
|
const { checkType, extendsType, trueType, falseType } = t;
|
||||||
|
return `${parseType(checkType)} extends ${parseType(extendsType)} ? ${parseType(trueType)} : ${parseType(
|
||||||
|
falseType,
|
||||||
|
)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isIndexedAccessType(t)) {
|
||||||
|
return `${parseType(t.objectType)}[${parseType(t.indexType)}]`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isIntersectionType(t)) {
|
||||||
|
return t.types.map(parseType).join(' & ');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPredicateType(t)) {
|
||||||
|
return (t.asserts ? 'asserts ' : '') + t.name + (t.targetType ? ` is ${parseType(t.targetType)}` : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isReferenceType(t)) {
|
||||||
|
return t.name + (t.typeArguments ? `<${t.typeArguments.map(parseType).join(', ')}>` : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isReflectionType(t)) {
|
||||||
|
const obj: Record<string, any> = {};
|
||||||
|
|
||||||
|
const { children, signatures } = t.declaration!;
|
||||||
|
|
||||||
|
// This is run when we're parsing interface-like declaration
|
||||||
|
if (children && children.length > 0) {
|
||||||
|
for (const child of children) {
|
||||||
|
const { type } = child;
|
||||||
|
if (type) {
|
||||||
|
obj[child.name] = parseType(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return `{\n${Object.entries(obj)
|
||||||
|
.map(([key, value]) => `${key}: ${value as string}`)
|
||||||
|
.join(',\n')}\n}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is run if we're parsing a function type
|
||||||
|
if (signatures && signatures.length > 0) {
|
||||||
|
const s = signatures[0];
|
||||||
|
const params = s?.parameters?.map((p) => `${p.name}: ${p.type ? parseType(p.type) : 'unknown'}`);
|
||||||
|
return `(${params?.join(', ') ?? '...args: unknown[]'}) => ${s?.type ? parseType(s.type) : 'unknown'}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '{}';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isLiteralType(t)) {
|
||||||
|
if (typeof t.value == 'string') {
|
||||||
|
return `'${t.value}'`;
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
|
return `${t.value}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isTupleType(t)) {
|
||||||
|
return `[${(t.elements ?? []).map(parseType).join(', ')}]`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isTypeOperatorType(t)) {
|
||||||
|
return `${t.operator} ${parseType(t.target)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isUnionType(t)) {
|
||||||
|
return t.types
|
||||||
|
.map(parseType)
|
||||||
|
.filter((s) => Boolean(s) && s.trim().length > 0)
|
||||||
|
.join(' | ');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isQueryType(t)) {
|
||||||
|
return `(typeof ${parseType(t.queryType)})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isInferredType(t) || isIntrinsicType(t) || isUnknownType(t)) {
|
||||||
|
return t.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
28
packages/docgen/src/util/splitVarName.ts
Normal file
28
packages/docgen/src/util/splitVarName.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
export function splitVarName(str: string) {
|
||||||
|
const res: string[][] = [];
|
||||||
|
let currGroup: string[] = [];
|
||||||
|
let currStr = '';
|
||||||
|
|
||||||
|
const isASymbol = (char: string) => '-!$%^&*()_+|~=`{}[]:;<>?, '.includes(char);
|
||||||
|
|
||||||
|
for (const char of str) {
|
||||||
|
const currentlyInASymbolSection = isASymbol(currStr[0]!);
|
||||||
|
const charIsASymbol = isASymbol(char);
|
||||||
|
|
||||||
|
if (currStr.length && currentlyInASymbolSection !== charIsASymbol) {
|
||||||
|
currGroup.push(currStr);
|
||||||
|
currStr = char;
|
||||||
|
|
||||||
|
if (!charIsASymbol) {
|
||||||
|
res.push(currGroup);
|
||||||
|
currGroup = [];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currStr += char;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
currGroup.push(currStr);
|
||||||
|
res.push(currGroup);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
67
packages/docgen/src/util/types.ts
Normal file
67
packages/docgen/src/util/types.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
|
import type { JSONOutput } from 'typedoc';
|
||||||
|
|
||||||
|
interface QueryType {
|
||||||
|
type: 'query';
|
||||||
|
queryType: JSONOutput.SomeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isArrayType(value: any): value is JSONOutput.ArrayType {
|
||||||
|
return typeof value == 'object' && value.type === 'array';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isConditionalType(value: any): value is JSONOutput.ConditionalType {
|
||||||
|
return typeof value == 'object' && value.type === 'conditional';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isIndexedAccessType(value: any): value is JSONOutput.IndexedAccessType {
|
||||||
|
return typeof value == 'object' && value.type === 'indexedAccess';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isInferredType(value: any): value is JSONOutput.InferredType {
|
||||||
|
return typeof value == 'object' && value.type === 'inferred';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isIntersectionType(value: any): value is JSONOutput.IntersectionType {
|
||||||
|
return typeof value == 'object' && value.type === 'intersection';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isIntrinsicType(value: any): value is JSONOutput.IntrinsicType {
|
||||||
|
return typeof value == 'object' && value.type === 'intrinsic';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isPredicateType(value: any): value is JSONOutput.PredicateType {
|
||||||
|
return typeof value == 'object' && value.type === 'predicate';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isReferenceType(value: any): value is JSONOutput.ReferenceType {
|
||||||
|
return typeof value == 'object' && value.type === 'reference';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isReflectionType(value: any): value is JSONOutput.ReflectionType {
|
||||||
|
return typeof value == 'object' && value.type === 'reflection';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isLiteralType(value: any): value is JSONOutput.LiteralType {
|
||||||
|
return typeof value == 'object' && value.type === 'literal';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isTupleType(value: any): value is JSONOutput.TupleType {
|
||||||
|
return typeof value == 'object' && value.type === 'tuple';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isTypeOperatorType(value: any): value is JSONOutput.TypeOperatorType {
|
||||||
|
return typeof value == 'object' && value.type === 'typeOperator';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isUnionType(value: any): value is JSONOutput.UnionType {
|
||||||
|
return typeof value == 'object' && value.type === 'union';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isUnknownType(value: any): value is JSONOutput.UnknownType {
|
||||||
|
return typeof value == 'object' && value.type === 'unknown';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isQueryType(value: any): value is QueryType {
|
||||||
|
return typeof value == 'object' && value.type === 'query';
|
||||||
|
}
|
||||||
2
packages/proxy/.gitignore
vendored
2
packages/proxy/.gitignore
vendored
@@ -18,7 +18,7 @@ pids
|
|||||||
dist/
|
dist/
|
||||||
typings/
|
typings/
|
||||||
docs/**/*
|
docs/**/*
|
||||||
!docs/index.yml
|
!docs/index.json
|
||||||
!docs/README.md
|
!docs/README.md
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
|
|||||||
1
packages/proxy/docs/index.json
Normal file
1
packages/proxy/docs/index.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{ "name": "General", "files": [{ "name": "Welcome", "id": "welcome", "path": "../../README.md" }] }]
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
- name: General
|
|
||||||
files:
|
|
||||||
- name: Welcome
|
|
||||||
id: welcome
|
|
||||||
path: ../../README.md
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && ts-docgen -i docs/typedoc-out.json -c docs/index.yml -o docs/docs.json",
|
"docs": "docgen -i src/index.ts -c docs/index.json -o docs/docs.json --typescript",
|
||||||
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
"undici": "^5.4.0"
|
"undici": "^5.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@discordjs/docgen": "workspace:^",
|
||||||
"@discordjs/scripts": "workspace:^",
|
"@discordjs/scripts": "workspace:^",
|
||||||
"@favware/cliff-jumper": "^1.8.3",
|
"@favware/cliff-jumper": "^1.8.3",
|
||||||
"@types/node": "^16.11.38",
|
"@types/node": "^16.11.38",
|
||||||
@@ -70,7 +71,6 @@
|
|||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"supertest": "^6.2.3",
|
"supertest": "^6.2.3",
|
||||||
"tsup": "^6.1.0",
|
"tsup": "^6.1.0",
|
||||||
"typedoc": "^0.22.17",
|
|
||||||
"typescript": "^4.7.3"
|
"typescript": "^4.7.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
2
packages/rest/.gitignore
vendored
2
packages/rest/.gitignore
vendored
@@ -18,7 +18,7 @@ pids
|
|||||||
dist/
|
dist/
|
||||||
typings/
|
typings/
|
||||||
docs/**/*
|
docs/**/*
|
||||||
!docs/index.yml
|
!docs/index.json
|
||||||
!docs/README.md
|
!docs/README.md
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
|
|||||||
1
packages/rest/docs/index.json
Normal file
1
packages/rest/docs/index.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{ "name": "General", "files": [{ "name": "Welcome", "id": "welcome", "path": "../../README.md" }] }]
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
- name: General
|
|
||||||
files:
|
|
||||||
- name: Welcome
|
|
||||||
id: welcome
|
|
||||||
path: ../../README.md
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && ts-docgen -i docs/typedoc-out.json -c docs/index.yml -o docs/docs.json",
|
"docs": "docgen -i src/index.ts -c docs/index.json -o docs/docs.json --typescript",
|
||||||
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
@@ -58,6 +58,7 @@
|
|||||||
"undici": "^5.4.0"
|
"undici": "^5.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@discordjs/docgen": "workspace:^",
|
||||||
"@discordjs/scripts": "workspace:^",
|
"@discordjs/scripts": "workspace:^",
|
||||||
"@favware/cliff-jumper": "^1.8.3",
|
"@favware/cliff-jumper": "^1.8.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
||||||
@@ -68,7 +69,6 @@
|
|||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"tsup": "^6.1.0",
|
"tsup": "^6.1.0",
|
||||||
"typedoc": "^0.22.17",
|
|
||||||
"typescript": "^4.7.3"
|
"typescript": "^4.7.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix"
|
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix"
|
||||||
},
|
},
|
||||||
"bin": {
|
|
||||||
"ts-docgen": "./dist/docs.js"
|
|
||||||
},
|
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -45,7 +42,6 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/ts-docgen": "^0.4.1",
|
|
||||||
"commander": "^9.3.0",
|
"commander": "^9.3.0",
|
||||||
"tslib": "^2.4.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';
|
import { createTsupConfig } from '../../tsup.config';
|
||||||
|
|
||||||
export default createTsupConfig({
|
export default createTsupConfig({
|
||||||
entry: ['src/docs.ts'],
|
|
||||||
minify: true,
|
minify: true,
|
||||||
});
|
});
|
||||||
|
|||||||
3
packages/voice/.gitignore
vendored
3
packages/voice/.gitignore
vendored
@@ -14,8 +14,9 @@ pids
|
|||||||
# Dist
|
# Dist
|
||||||
dist/
|
dist/
|
||||||
typings/
|
typings/
|
||||||
|
|
||||||
docs/**/*
|
docs/**/*
|
||||||
!docs/index.yml
|
!docs/index.json
|
||||||
!docs/README.md
|
!docs/README.md
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
|
|||||||
1
packages/voice/docs/index.json
Normal file
1
packages/voice/docs/index.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{ "name": "General", "files": [{ "name": "Welcome", "id": "welcome", "path": "../../README.md" }] }]
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
- name: General
|
|
||||||
files:
|
|
||||||
- name: Welcome
|
|
||||||
id: welcome
|
|
||||||
path: ../../README.md
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"test": "jest --pass-with-no-tests --collect-coverage",
|
"test": "jest --pass-with-no-tests --collect-coverage",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && ts-docgen -i docs/typedoc-out.json -c docs/index.yml -o docs/docs.json",
|
"docs": "docgen -i src/index.ts -c docs/index.json -o docs/docs.json --typescript",
|
||||||
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
"prepublishOnly": "yarn build && yarn lint && yarn test",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/voice/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/voice/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
"@babel/core": "^7.18.2",
|
"@babel/core": "^7.18.2",
|
||||||
"@babel/preset-env": "^7.18.2",
|
"@babel/preset-env": "^7.18.2",
|
||||||
"@babel/preset-typescript": "^7.17.12",
|
"@babel/preset-typescript": "^7.17.12",
|
||||||
|
"@discordjs/docgen": "workspace:^",
|
||||||
"@discordjs/scripts": "workspace:^",
|
"@discordjs/scripts": "workspace:^",
|
||||||
"@favware/cliff-jumper": "^1.8.3",
|
"@favware/cliff-jumper": "^1.8.3",
|
||||||
"@types/jest": "^28.1.1",
|
"@types/jest": "^28.1.1",
|
||||||
@@ -78,7 +79,6 @@
|
|||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"tsup": "^6.1.0",
|
"tsup": "^6.1.0",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"typedoc": "^0.22.17",
|
|
||||||
"typescript": "^4.7.3"
|
"typescript": "^4.7.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
52
yarn.lock
52
yarn.lock
@@ -1608,6 +1608,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@discordjs/builders@workspace:packages/builders"
|
resolution: "@discordjs/builders@workspace:packages/builders"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@discordjs/docgen": "workspace:^"
|
||||||
"@discordjs/scripts": "workspace:^"
|
"@discordjs/scripts": "workspace:^"
|
||||||
"@favware/cliff-jumper": ^1.8.3
|
"@favware/cliff-jumper": ^1.8.3
|
||||||
"@sapphire/shapeshift": ^3.1.0
|
"@sapphire/shapeshift": ^3.1.0
|
||||||
@@ -1625,15 +1626,22 @@ __metadata:
|
|||||||
ts-mixer: ^6.0.1
|
ts-mixer: ^6.0.1
|
||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
typedoc: ^0.22.17
|
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
|
"@discordjs/collection@npm:^0.7.0":
|
||||||
|
version: 0.7.0
|
||||||
|
resolution: "@discordjs/collection@npm:0.7.0"
|
||||||
|
checksum: 141aa35a5433bacba3617b533557b4948388c7b59cdaecee51ccd721c1b9242e50d95bdef53ee2491535a017095f5072ace3c3e9e594193f67a1c5a8a4b7db93
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@discordjs/collection@workspace:^, @discordjs/collection@workspace:packages/collection":
|
"@discordjs/collection@workspace:^, @discordjs/collection@workspace:packages/collection":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@discordjs/collection@workspace:packages/collection"
|
resolution: "@discordjs/collection@workspace:packages/collection"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@discordjs/docgen": "workspace:^"
|
||||||
"@discordjs/scripts": "workspace:^"
|
"@discordjs/scripts": "workspace:^"
|
||||||
"@favware/cliff-jumper": ^1.8.3
|
"@favware/cliff-jumper": ^1.8.3
|
||||||
"@types/node": ^16.11.38
|
"@types/node": ^16.11.38
|
||||||
@@ -1645,7 +1653,6 @@ __metadata:
|
|||||||
eslint-plugin-import: ^2.26.0
|
eslint-plugin-import: ^2.26.0
|
||||||
prettier: ^2.6.2
|
prettier: ^2.6.2
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
typedoc: ^0.22.17
|
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
@@ -1671,7 +1678,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@discordjs/docgen@workspace:packages/docgen"
|
resolution: "@discordjs/docgen@workspace:packages/docgen"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@discordjs/collection": "workspace:^"
|
"@discordjs/collection": ^0.7.0
|
||||||
"@favware/cliff-jumper": ^1.8.3
|
"@favware/cliff-jumper": ^1.8.3
|
||||||
"@types/jsdoc-to-markdown": ^7.0.3
|
"@types/jsdoc-to-markdown": ^7.0.3
|
||||||
"@types/node": ^16.11.38
|
"@types/node": ^16.11.38
|
||||||
@@ -1686,6 +1693,7 @@ __metadata:
|
|||||||
prettier: ^2.6.2
|
prettier: ^2.6.2
|
||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
|
typedoc: ^0.22.17
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
bin:
|
bin:
|
||||||
docgen: ./dist/index.js
|
docgen: ./dist/index.js
|
||||||
@@ -1696,6 +1704,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@discordjs/proxy@workspace:packages/proxy"
|
resolution: "@discordjs/proxy@workspace:packages/proxy"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@discordjs/docgen": "workspace:^"
|
||||||
"@discordjs/rest": "workspace:^"
|
"@discordjs/rest": "workspace:^"
|
||||||
"@discordjs/scripts": "workspace:^"
|
"@discordjs/scripts": "workspace:^"
|
||||||
"@favware/cliff-jumper": ^1.8.3
|
"@favware/cliff-jumper": ^1.8.3
|
||||||
@@ -1711,7 +1720,6 @@ __metadata:
|
|||||||
supertest: ^6.2.3
|
supertest: ^6.2.3
|
||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
typedoc: ^0.22.17
|
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
undici: ^5.4.0
|
undici: ^5.4.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
@@ -1722,6 +1730,7 @@ __metadata:
|
|||||||
resolution: "@discordjs/rest@workspace:packages/rest"
|
resolution: "@discordjs/rest@workspace:packages/rest"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@discordjs/collection": "workspace:^"
|
"@discordjs/collection": "workspace:^"
|
||||||
|
"@discordjs/docgen": "workspace:^"
|
||||||
"@discordjs/scripts": "workspace:^"
|
"@discordjs/scripts": "workspace:^"
|
||||||
"@favware/cliff-jumper": ^1.8.3
|
"@favware/cliff-jumper": ^1.8.3
|
||||||
"@sapphire/async-queue": ^1.3.1
|
"@sapphire/async-queue": ^1.3.1
|
||||||
@@ -1736,7 +1745,6 @@ __metadata:
|
|||||||
prettier: ^2.6.2
|
prettier: ^2.6.2
|
||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
typedoc: ^0.22.17
|
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
undici: ^5.4.0
|
undici: ^5.4.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
@@ -1746,7 +1754,6 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@discordjs/scripts@workspace:packages/scripts"
|
resolution: "@discordjs/scripts@workspace:packages/scripts"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@discordjs/ts-docgen": ^0.4.1
|
|
||||||
"@types/node": ^16.11.38
|
"@types/node": ^16.11.38
|
||||||
"@typescript-eslint/eslint-plugin": ^5.27.1
|
"@typescript-eslint/eslint-plugin": ^5.27.1
|
||||||
"@typescript-eslint/parser": ^5.27.1
|
"@typescript-eslint/parser": ^5.27.1
|
||||||
@@ -1759,21 +1766,9 @@ __metadata:
|
|||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
bin:
|
|
||||||
ts-docgen: ./dist/docs.js
|
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@discordjs/ts-docgen@npm:^0.4.1":
|
|
||||||
version: 0.4.1
|
|
||||||
resolution: "@discordjs/ts-docgen@npm:0.4.1"
|
|
||||||
dependencies:
|
|
||||||
js-yaml: ^4.1.0
|
|
||||||
typedoc: ^0.22.15
|
|
||||||
checksum: fbb8c7041812ae0130043451501b73d732a05afaec01136f3c877dae08d7fe9bb913c9763b60010b28bbc50c0043354ae01f5bc2626e1a24a767cb337a29a9a9
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"@discordjs/voice@workspace:packages/voice":
|
"@discordjs/voice@workspace:packages/voice":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@discordjs/voice@workspace:packages/voice"
|
resolution: "@discordjs/voice@workspace:packages/voice"
|
||||||
@@ -1781,6 +1776,7 @@ __metadata:
|
|||||||
"@babel/core": ^7.18.2
|
"@babel/core": ^7.18.2
|
||||||
"@babel/preset-env": ^7.18.2
|
"@babel/preset-env": ^7.18.2
|
||||||
"@babel/preset-typescript": ^7.17.12
|
"@babel/preset-typescript": ^7.17.12
|
||||||
|
"@discordjs/docgen": "workspace:^"
|
||||||
"@discordjs/scripts": "workspace:^"
|
"@discordjs/scripts": "workspace:^"
|
||||||
"@favware/cliff-jumper": ^1.8.3
|
"@favware/cliff-jumper": ^1.8.3
|
||||||
"@types/jest": ^28.1.1
|
"@types/jest": ^28.1.1
|
||||||
@@ -1802,7 +1798,6 @@ __metadata:
|
|||||||
tslib: ^2.4.0
|
tslib: ^2.4.0
|
||||||
tsup: ^6.1.0
|
tsup: ^6.1.0
|
||||||
tweetnacl: ^1.0.3
|
tweetnacl: ^1.0.3
|
||||||
typedoc: ^0.22.17
|
|
||||||
typescript: ^4.7.3
|
typescript: ^4.7.3
|
||||||
ws: ^8.7.0
|
ws: ^8.7.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
@@ -6027,7 +6022,7 @@ dts-critic@latest:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"glob@npm:^7.1.1, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.2.0":
|
"glob@npm:^7.1.1, glob@npm:^7.1.3, glob@npm:^7.1.4":
|
||||||
version: 7.2.0
|
version: 7.2.0
|
||||||
resolution: "glob@npm:7.2.0"
|
resolution: "glob@npm:7.2.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -10609,23 +10604,6 @@ dts-critic@latest:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"typedoc@npm:^0.22.15":
|
|
||||||
version: 0.22.15
|
|
||||||
resolution: "typedoc@npm:0.22.15"
|
|
||||||
dependencies:
|
|
||||||
glob: ^7.2.0
|
|
||||||
lunr: ^2.3.9
|
|
||||||
marked: ^4.0.12
|
|
||||||
minimatch: ^5.0.1
|
|
||||||
shiki: ^0.10.1
|
|
||||||
peerDependencies:
|
|
||||||
typescript: 4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x || 4.6.x
|
|
||||||
bin:
|
|
||||||
typedoc: bin/typedoc
|
|
||||||
checksum: 3f5f1cb9288bf811f42df59750c7062a026a23257b38dfe227515a30007a28e3d8139187949fcd19300fd6b2ef76bcdc4cf54549100bff3e000e61bb19958fb2
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"typedoc@npm:^0.22.17":
|
"typedoc@npm:^0.22.17":
|
||||||
version: 0.22.17
|
version: 0.22.17
|
||||||
resolution: "typedoc@npm:0.22.17"
|
resolution: "typedoc@npm:0.22.17"
|
||||||
|
|||||||
Reference in New Issue
Block a user