mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
build: pnpm (#9806)
This commit is contained in:
@@ -24,4 +24,4 @@ const command = createCommand()
|
||||
const program = command.parse(process.argv);
|
||||
const options = program.opts<CLIOptions>();
|
||||
|
||||
build(options);
|
||||
void build(options);
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
"build": "tsup",
|
||||
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
|
||||
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
|
||||
"fmt": "yarn format",
|
||||
"prepack": "yarn format && yarn build"
|
||||
"fmt": "pnpm run format",
|
||||
"prepare": "pnpm run build",
|
||||
"prepack": "pnpm run format && pnpm run build"
|
||||
},
|
||||
"bin": "./dist/bin/index.js",
|
||||
"exports": {
|
||||
@@ -27,6 +28,7 @@
|
||||
"module": "./dist/src/index.mjs",
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"directories": {
|
||||
"bin": "bin",
|
||||
"lib": "src"
|
||||
},
|
||||
"files": [
|
||||
@@ -60,14 +62,14 @@
|
||||
"commander": "^11.0.0",
|
||||
"jsdoc-to-markdown": "^8.0.0",
|
||||
"tslib": "^2.6.2",
|
||||
"typedoc": "^0.24.8"
|
||||
"typedoc": "^0.25.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.1.1",
|
||||
"@types/jsdoc-to-markdown": "^7.0.3",
|
||||
"@types/node": "16.18.44",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.47.0",
|
||||
"eslint": "^8.48.0",
|
||||
"eslint-config-neon": "^0.1.56",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.2",
|
||||
|
||||
@@ -17,14 +17,12 @@ interface CustomFiles {
|
||||
path?: string;
|
||||
}
|
||||
|
||||
export function build({ input, custom: customDocs, root, output, typescript }: CLIOptions) {
|
||||
export async function build({ input, custom: customDocs, root, output, typescript }: CLIOptions) {
|
||||
let data: (ChildTypes & RootTypes)[] | DeclarationReflection[] = [];
|
||||
if (typescript) {
|
||||
console.log('Parsing Typescript in source files...');
|
||||
const app = new Application();
|
||||
app.options.addReader(new TSConfigReader());
|
||||
app.bootstrap({ entryPoints: input });
|
||||
const project = app.convert();
|
||||
const app = await Application.bootstrap({ entryPoints: input }, [new TSConfigReader()]);
|
||||
const project = await app.convert();
|
||||
if (project) {
|
||||
// @ts-expect-error: Types are lost with this method
|
||||
data = app.serializer.toObject(project).children!;
|
||||
|
||||
@@ -3,6 +3,4 @@ import { createTsupConfig } from '../../tsup.config.js';
|
||||
export default createTsupConfig({
|
||||
entry: ['src/index.ts', 'bin/index.ts'],
|
||||
minify: 'terser',
|
||||
keepNames: false,
|
||||
sourcemap: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user