Skip to content

Development

m1ngsama edited this page Dec 12, 2025 · 1 revision

Development

Prerequisites

  • Node.js >= 16.0.0

Setup

git clone https://github.com/nbtca/prompt.git
cd prompt
pnpm install

Commands

Command Description
pnpm run dev Run TypeScript source directly
pnpm run dev:watch Run with file watching
pnpm run build Compile TypeScript to JavaScript
pnpm start Run compiled code
pnpm run clean Remove dist directory

Quick Testing (Recommended)

pnpm run dev

Runs TypeScript source directly without auto-restart. Exit with menu option or Ctrl+C.

Watch Mode

pnpm run dev:watch

Auto-restarts on file changes. Not recommended for interactive testing.

Production Build

pnpm run build
pnpm start

Project Structure

src/
├── config/          # Configuration constants
│   ├── data.ts     # URLs and app info
│   └── theme.ts    # Color themes
├── core/           # Core functionality
│   ├── logo.ts     # Logo display logic
│   ├── menu.ts     # Main menu system
│   ├── ui.ts       # UI components
│   └── vim-keys.ts # Vim key bindings
├── features/       # Feature modules
│   ├── calendar.ts # Event calendar
│   ├── docs.ts     # Documentation viewer
│   ├── repair.ts   # Repair service
│   └── website.ts  # Website links
└── main.ts         # Application entry point

Technology Stack

Core Dependencies

  • axios - HTTP requests
  • ical.js - ICS calendar parsing
  • marked + marked-terminal - Markdown rendering
  • chalk - Terminal colors
  • inquirer - Interactive prompts
  • open - Browser integration

Development Dependencies

  • TypeScript 5.3+
  • tsx - TypeScript execution
  • @types/* - Type definitions

Code Standards

  • Use TypeScript strict mode
  • Add JSDoc comments for functions
  • Use .js extension in imports (even for .ts files)
  • Keep code simple and readable

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Follow existing code style
  4. Add appropriate comments
  5. Ensure build passes
  6. Submit pull request

Clone this wiki locally