Update npm packages to latest versions
Fix JavaScript sourcemap paths to show full file locations Implement --build-debug flag and complete Build UI streaming Add xterm.js terminal UI and fix asset path routing Add RSpade Build UI service with WebSocket support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -502,12 +502,36 @@ class Debugger
|
||||
}
|
||||
}
|
||||
|
||||
// Check for environment variable overrides (use getenv for runtime putenv support)
|
||||
if (getenv('CONSOLE_DEBUG_CLI') !== false) {
|
||||
$config['outputs']['cli'] = filter_var(getenv('CONSOLE_DEBUG_CLI'), FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
if (getenv('CONSOLE_DEBUG_WEB') !== false) {
|
||||
$config['outputs']['web'] = filter_var(getenv('CONSOLE_DEBUG_WEB'), FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
if (getenv('CONSOLE_DEBUG_AJAX') !== false) {
|
||||
$config['outputs']['ajax'] = filter_var(getenv('CONSOLE_DEBUG_AJAX'), FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
static::$console_config = $config;
|
||||
}
|
||||
|
||||
return static::$console_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset cached console debug configuration
|
||||
*
|
||||
* Call this after modifying environment variables like CONSOLE_DEBUG_FILTER
|
||||
* or CONSOLE_DEBUG_CLI to force reconfiguration on next console_debug() call.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function reset_console_config(): void
|
||||
{
|
||||
static::$console_config = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure console debug based on HTTP headers from rsx:debug
|
||||
*
|
||||
@@ -671,9 +695,9 @@ class Debugger
|
||||
*/
|
||||
protected static function __should_output_channel(string $channel, array $config): bool
|
||||
{
|
||||
// Check environment override
|
||||
$env_filter = env('CONSOLE_DEBUG_FILTER');
|
||||
if ($env_filter !== null) {
|
||||
// Check environment override (use getenv for runtime putenv support)
|
||||
$env_filter = getenv('CONSOLE_DEBUG_FILTER');
|
||||
if ($env_filter !== false) {
|
||||
// Split comma-separated values and normalize
|
||||
$channels = array_map('trim', explode(',', $env_filter));
|
||||
$channels = array_map('strtoupper', $channels);
|
||||
@@ -730,20 +754,37 @@ class Debugger
|
||||
return;
|
||||
}
|
||||
|
||||
// Get configuration
|
||||
$config = static::__get_console_config();
|
||||
// Handle BUILD_DEBUG_MODE (check both constant and command-line flag)
|
||||
$build_debug_mode = (defined('BUILD_DEBUG_MODE') && BUILD_DEBUG_MODE) ||
|
||||
in_array('--build-debug', $_SERVER['argv'] ?? []);
|
||||
|
||||
// Check if completely disabled
|
||||
if (!$config['enabled']) {
|
||||
return;
|
||||
}
|
||||
if ($build_debug_mode) {
|
||||
// Force enable CLI output and filter to BUILD channel only
|
||||
$channel = static::__normalize_channel($channel);
|
||||
if ($channel !== 'BUILD') {
|
||||
return;
|
||||
}
|
||||
// Override config for this call
|
||||
$force_cli_output = true;
|
||||
$config = static::__get_console_config(); // Still need config for benchmark
|
||||
} else {
|
||||
$force_cli_output = false;
|
||||
|
||||
// Normalize channel name
|
||||
$channel = static::__normalize_channel($channel);
|
||||
// Get configuration
|
||||
$config = static::__get_console_config();
|
||||
|
||||
// Check if this channel should be output
|
||||
if (!static::__should_output_channel($channel, $config)) {
|
||||
return;
|
||||
// Check if completely disabled
|
||||
if (!$config['enabled']) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalize channel name
|
||||
$channel = static::__normalize_channel($channel);
|
||||
|
||||
// Check if this channel should be output
|
||||
if (!static::__should_output_channel($channel, $config)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Get caller information using debug_backtrace
|
||||
@@ -776,7 +817,7 @@ class Debugger
|
||||
// Handle based on context
|
||||
if (app()->runningInConsole()) {
|
||||
// CLI mode - check if CLI output is enabled
|
||||
if (!$config['outputs']['cli']) {
|
||||
if (!$force_cli_output && !$config['outputs']['cli']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user