1.0.4 โ€ข Published 9 months ago

great-dev v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

great-dev ๐Ÿš€

A powerful CLI tool for JavaScript and TypeScript development with hot reloading. ๐Ÿ”ฅ

Features ๐ŸŒŸ

  • ๐Ÿ”„ Hot reloading for JavaScript and TypeScript files
  • ๐Ÿงฐ Intelligent runtime detection and multi-runtime support
  • ๐Ÿ” Configurable file watching with debounce
  • ๐Ÿšฆ TypeScript compilation (file-based or in-memory)
  • ๐Ÿงต Worker thread support for improved performance
  • ๐Ÿง  Memory optimization
  • ๐Ÿ“Š Detailed logging with multiple levels
  • ๐Ÿ˜„ Optional meme mode for fun output

Installation ๐Ÿ“ฅ

npm install -g great-dev

Basic Usage ๐Ÿš€

great-dev -p ./src

This will start watching the ./src directory for changes and automatically reload your application.

Configuration โš™๏ธ

You can configure great-dev using command-line options or a configuration file.

Command-line Options ๐Ÿ–ฅ๏ธ

  • -p, --path <paths...>: Paths to watch for changes
  • -i, --ignore <patterns...>: Patterns to ignore
  • -w, --watch-delay <ms>: Debounce delay for file watching (ms)
  • -t, --ts-config <path>: Path to tsconfig.json
  • -l, --log-level <level>: Log level (info, debug, verbose)
  • -m, --meme-mode: Enable meme mode for fun output
  • --worker-threads <number>: Number of worker threads to use

Example:

great-dev -p ./src -i node_modules -w 500 -l debug --worker-threads 4

Configuration File ๐Ÿ“„

Create a .greatdevrc.json file in your project root:

{
  "paths": ["./src"],
  "ignore": ["node_modules/**", "**/*.test.ts"],
  "watchDelay": 300,
  "tsConfigPath": "tsconfig.json",
  "logLevel": "info",
  "memeMode": false,
  "workerThreads": 2
}

Advanced Features ๐Ÿง 

Logging Levels ๐Ÿ“Š

great-dev supports multiple logging levels:

  • info: Basic information (default)
  • debug: More detailed information for troubleshooting
  • verbose: Highly detailed logs for in-depth analysis

Set the log level using the -l, --log-level option or in the configuration file.

Worker Threads ๐Ÿงต

Improve performance by utilizing worker threads. Specify the number of worker threads using the --worker-threads option or in the configuration file.

Memory Optimization ๐Ÿ’พ

great-dev automatically optimizes memory usage by periodically running garbage collection and adjusting the heap size limit.

Meme Mode ๐Ÿ˜„

Enable meme mode for fun ASCII art output using the -m, --meme-mode option or in the configuration file.

Troubleshooting ๐Ÿ”ง

  • If you encounter any issues, check the console output for error messages.
  • Ensure that your project's dependencies are installed.
  • Verify that the specified paths and ignore patterns are correct.
  • Check if your tsconfig.json is correctly configured, especially the outDir setting.

Contributing ๐Ÿค

Contributions are welcome! Please feel free to submit a Pull Request.

License ๐Ÿ“„

This project is licensed under the MIT License.