CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-electron-debug

Adds useful debug features to your Electron app

86

1.19x
Overview
Eval results
Files

task.mdevals/scenario-6/

Electron Debug Configuration Manager

Build a simple Electron application with a debug configuration system that automatically detects the environment and conditionally enables debugging features based on whether the app is running in development or production mode.

Requirements

Create an Electron application with the following components:

1. Main Process Setup

Create a main process (main.js) that:

  • Creates a single BrowserWindow on startup
  • Implements environment-aware debug initialization
  • Ensures debugging is automatically enabled in development but disabled in production by default
  • Provides a mechanism to override the automatic detection when needed

2. Environment Detection

Your solution must:

  • Automatically detect whether the application is running in development or production mode
  • Enable debugging features in development mode without requiring explicit configuration
  • Disable debugging features in production mode unless explicitly overridden
  • Support force-enabling debug features even in production environments when needed for troubleshooting

3. Configuration Options

Implement a configuration system that supports:

  • Automatic environment detection (default behavior)
  • Explicit enabling of debug features regardless of environment
  • Explicit disabling of debug features regardless of environment

4. Test Cases

Write test cases that verify:

  • When running in development mode with no explicit configuration, debugging features are automatically enabled @test
  • When running in production mode with no explicit configuration, debugging features are automatically disabled @test
  • When explicitly setting debug to enabled, debugging features are enabled regardless of environment @test
  • When explicitly setting debug to disabled, debugging features are disabled regardless of environment @test

@generates

API

/**
 * Initializes debug features for the Electron application
 * @param {Object} options - Configuration options
 * @param {boolean|null} options.isEnabled - Enable/disable debug (null for auto-detect)
 */
function initDebug(options);

Dependencies { .dependencies }

electron-debug { .dependency }

Provides debug features for Electron applications with automatic environment detection.

electron { .dependency }

Electron framework for building cross-platform desktop applications.

Install with Tessl CLI

npx tessl i tessl/npm-electron-debug

tile.json