build: switch back to turbo for speedz

This commit is contained in:
iCrawl
2022-08-15 14:19:17 +02:00
parent d56590a11d
commit d09ef1e425
10 changed files with 222 additions and 120 deletions

View File

@@ -1,13 +1,13 @@
{
"name": "@discordjs/docgen",
"version": "0.12.0",
"version": "0.12.1",
"description": "The docs.json generator for discord.js and its related projects",
"scripts": {
"build": "unbuild",
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
"fmt": "yarn format",
"prepack": "yarn lint && yarn test && yarn build",
"prepack": "yarn format && yarn build",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/docgen/*'",
"release": "cliff-jumper"
},
@@ -42,7 +42,6 @@
},
"homepage": "https://discord.js.org",
"dependencies": {
"@discordjs/collection": "^1.0.1",
"commander": "^9.4.0",
"jsdoc-to-markdown": "^7.1.1",
"tslib": "^2.4.0",
@@ -66,5 +65,8 @@
},
"engines": {
"node": ">=16.9.0"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -1,5 +1,4 @@
import { dirname, join, relative } from 'node:path';
import { Collection } from '@discordjs/collection';
import type { DeclarationReflection } from 'typedoc';
import type { ChildTypes, Class, Config, CustomDocs, RootTypes } from './interfaces/index.js';
import { DocumentedClass } from './types/class.js';
@@ -13,15 +12,15 @@ import { DocumentedTypeDef } from './types/typedef.js';
import packageFile from '../package.json';
export class Documentation {
public readonly classes = new Collection<string, DocumentedClass>();
public readonly classes = new Map<string, DocumentedClass>();
public readonly functions = new Collection<string, DocumentedMethod>();
public readonly functions = new Map<string, DocumentedMethod>();
public readonly interfaces = new Collection<string, DocumentedInterface>();
public readonly interfaces = new Map<string, DocumentedInterface>();
public readonly typedefs = new Collection<string, DocumentedTypeDef>();
public readonly typedefs = new Map<string, DocumentedTypeDef>();
public readonly externals = new Collection<string, DocumentedExternal>();
public readonly externals = new Map<string, DocumentedExternal>();
public constructor(
data: RootTypes[] | DeclarationReflection[],
@@ -244,11 +243,11 @@ export class Documentation {
format: Documentation.FORMAT_VERSION,
date: Date.now(),
},
classes: this.classes.map((c) => c.serialize()),
functions: this.functions.map((f) => f.serialize()),
interfaces: this.interfaces.map((i) => i.serialize()),
typedefs: this.typedefs.map((t) => t.serialize()),
externals: this.externals.map((e) => e.serialize()),
classes: [...this.classes.values()].map((c) => c.serialize()),
functions: [...this.functions.values()].map((f) => f.serialize()),
interfaces: [...this.interfaces.values()].map((i) => i.serialize()),
typedefs: [...this.typedefs.values()].map((t) => t.serialize()),
externals: [...this.externals.values()].map((e) => e.serialize()),
custom: this.custom,
};
}

View File

@@ -1,5 +1,4 @@
import { parse } from 'node:path';
import { Collection } from '@discordjs/collection';
import type { DeclarationReflection } from 'typedoc';
import { DocumentedConstructor } from './constructor.js';
import { DocumentedEvent } from './event.js';
@@ -12,11 +11,11 @@ import type { Class, Config } from '../interfaces/index.js';
import { parseType } from '../util/parseType.js';
export class DocumentedClass extends DocumentedItem<Class | DeclarationReflection> {
public readonly props = new Collection<string, DocumentedMember>();
public readonly props = new Map<string, DocumentedMember>();
public readonly methods = new Collection<string, DocumentedMethod>();
public readonly methods = new Map<string, DocumentedMethod>();
public readonly events = new Collection<string, DocumentedEvent>();
public readonly events = new Map<string, DocumentedEvent>();
public construct: DocumentedConstructor | null = null;
@@ -120,9 +119,9 @@ export class DocumentedClass extends DocumentedItem<Class | DeclarationReflectio
.trim() ?? true
: undefined,
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,
props: this.props.size ? [...this.props.values()].map((p) => p.serialize()) : undefined,
methods: this.methods.size ? [...this.methods.values()].map((m) => m.serialize()) : undefined,
events: this.events.size ? [...this.events.values()].map((e) => e.serialize()) : undefined,
meta,
};
}
@@ -138,9 +137,9 @@ export class DocumentedClass extends DocumentedItem<Class | DeclarationReflectio
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,
props: this.props.size ? [...this.props.values()].map((p) => p.serialize()) : undefined,
methods: this.methods.size ? [...this.methods.values()].map((m) => m.serialize()) : undefined,
events: this.events.size ? [...this.events.values()].map((e) => e.serialize()) : undefined,
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
};
}