How inbestigator/dressed works
Project type and purpose
• This is a TypeScript-based monorepo (managed with Turborepo) that produces three interrelated NPM packages plus a Next.js–based documentation site.
• The core package (“dressed”) is a Discord-interaction framework: it provides a CLI, component definitions, request-handling server machinery, type definitions, utilities, and a build pipeline for Discord bots.
• Two support packages extend its functionality:
• “dressed-matcher” – a small library for matching interaction payloads or commands.
• “dressed-next” – Next.js adapter for serverless Discord webhook endpoints.
• The “www” folder is the documentation website built on Next.js, consuming dressed-next (and possibly dressed) to render interactive docs.
File structure
• Root: CI workflows (.github/workflows), lint/bundle configs, turbo.json, and three main folders: packages, www.
• packages/dressed
• src/bin/dressed.ts: CLI entry point (scaffold, generate, deploy).
• src/bot: Components (buttons, menus, etc.) + rate-limit logic + resource definitions (Discord REST endpoints).
• src/server: Build pipeline (parsers, bundlers) → HTTP server handlers (commands, components, events) → signature verification & utils for Express-style request handling.
• src/types & src/utils: Shared type definitions and helper functions (env, HTTP calls).
• packages/dressed-matcher: Minimal library with its own src/index.ts + tests.
• packages/dressed-next: Exposes a Next.js–style request handler (src/index.ts) plus configuration (turbo.json).
• www: A Next.js application that
• Uses dressed-next’s handler to mount Discord endpoints (example).
• Renders Markdown docs under /src/app/docs → static site generation.
• Has custom UI components, Tailwind CSS, and client-side hooks.
README for additional insights
• (Assuming the README describes the core workflow) The CLI boots up, scans source code for command definitions, compiles them into a webhook server, and deploys to a hosting provider or local environment.
• Dependencies: Node.js, Bun (optional), Next.js, Discord API.
Elements
– Clear labels: Developer, CLI, Build System, Package: dressed, Package: matcher, Package: next, Hosting, Discord, Documentation Site.
• Code flow (edit → build → publish → install)
• Runtime flow (Discord → HTTP server → handler → Discord)
• Documentation flow (packages → docs site)
• Rectangles for code modules (packages)