Some build process stuff

This commit is contained in:
2024-12-18 13:32:15 -06:00
parent e85083035e
commit 5f038026d3
5 changed files with 11 additions and 7 deletions
+6 -2
View File
@@ -1,5 +1,6 @@
{ {
"name": "discord.ts", "name": "discord.ts",
"version": "0.0.1",
"module": "src/index.ts", "module": "src/index.ts",
"type": "module", "type": "module",
"main": "out/index.js", "main": "out/index.js",
@@ -7,8 +8,11 @@
"test": "bun run testing/demo.test.ts", "test": "bun run testing/demo.test.ts",
"test:inspect": "bun --inspect testing/demo.test.ts", "test:inspect": "bun --inspect testing/demo.test.ts",
"build": "bun run build:types && bun build src/index.ts --outdir out", "build": "bun run build:types && bun build src/index.ts --outdir out",
"build:types": "tsc --emitDeclarationOnly --project tsconfig.json --noCheck", "build:packages": "bun run build:types && bun build src/index.ts --packages external --outdir out",
"build:watch": "concurrently \"tsc --emitDeclarationOnly --project tsconfig.json --noCheck --watch\" \"bun build src/index.ts --outdir out --watch\"" "build:nocheck": "bun run build:types:nocheck && bun build src/index.ts --outdir out --noCheck",
"build:types": "tsc --emitDeclarationOnly --project tsconfig.json",
"build:types:nocheck": "tsc --emitDeclarationOnly --project tsconfig.json --noCheck",
"build:watch": "concurrently \"tsc --emitDeclarationOnly --project tsconfig.json --watch\" \"bun build src/index.ts --outdir out --watch\""
}, },
"devDependencies": { "devDependencies": {
"@types/bun": "latest", "@types/bun": "latest",
-1
View File
@@ -8,7 +8,6 @@ import { Context } from '../../types/context';
import { type DiscordMessage, Message } from '../../types/message'; import { type DiscordMessage, Message } from '../../types/message';
import { DiscordUser, User } from '../../types/user'; import { DiscordUser, User } from '../../types/user';
import { Guild } from '../../types/guild'; import { Guild } from '../../types/guild';
import { Channel } from '../../types/channel';
import type { Emitter } from '../bus'; import type { Emitter } from '../bus';
export class Gateway { export class Gateway {
+1
View File
@@ -66,6 +66,7 @@ export class Processor {
await Promise.resolve(handler[Trait.execute](context!, resolvedArgs)); await Promise.resolve(handler[Trait.execute](context!, resolvedArgs));
} else { } else {
// TODO: Fix ts error // TODO: Fix ts error
// @ts-ignore - Haven't figured out how to type narrow this yet
await Promise.resolve(handler(context, argsOrPayload)); await Promise.resolve(handler(context, argsOrPayload));
} }
} }
+2 -2
View File
@@ -1,4 +1,4 @@
import type { Message } from './message'; import { Message } from './message';
type EmbedFooter = { type EmbedFooter = {
text: string; text: string;
@@ -42,7 +42,7 @@ export class Embed {
author?: EmbedImage & { author?: EmbedImage & {
name?: string; name?: string;
}; };
fields?: EmbedField[]; fields: EmbedField[];
constructor() { constructor() {
this.fields = []; this.fields = [];
+2 -2
View File
@@ -1,9 +1,9 @@
import { exists, isNil } from '../utils'; import { exists, isNil } from '../utils';
import { GatewayObject } from './base'; import { GatewayObject } from './base';
import { fromDiscord, Trait, type Expectation, type Expects } from './common'; import { fromDiscord, Trait, type Expectation, type Expects } from './common';
import { Embed } from './embed'; import type { Embed } from './embed';
import type { Guild } from './guild'; import type { Guild } from './guild';
import { DiscordUser, User } from './user'; import { type DiscordUser, User } from './user';
export type Component = Partial<Button | SelectMenu> & { export type Component = Partial<Button | SelectMenu> & {
type: ComponentType; type: ComponentType;