feat(environment-variables): implement environment variable analysis for build-time issues
- Added EnvironmentVariableAnalyzer trait to analyze and warn about problematic environment variables during the build process. - Integrated analysis into ApplicationDeploymentJob and Livewire components to provide feedback on potential build issues. - Introduced a new Blade component for displaying warnings related to environment variables in the UI.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
@props(['problematicVariables' => []])
|
||||
|
||||
<template x-data="{
|
||||
problematicVars: @js($problematicVariables),
|
||||
get showWarning() {
|
||||
const currentKey = $wire.key;
|
||||
const isBuildtime = $wire.is_buildtime;
|
||||
|
||||
if (!isBuildtime || !currentKey) return false;
|
||||
if (!this.problematicVars.hasOwnProperty(currentKey)) return false;
|
||||
|
||||
// Always show warning for known problematic variables when set as buildtime
|
||||
return true;
|
||||
},
|
||||
get warningMessage() {
|
||||
if (!this.showWarning) return null;
|
||||
const config = this.problematicVars[$wire.key];
|
||||
if (!config) return null;
|
||||
return config.issue;
|
||||
},
|
||||
get recommendation() {
|
||||
if (!this.showWarning) return null;
|
||||
const config = this.problematicVars[$wire.key];
|
||||
if (!config) return null;
|
||||
return `Recommendation: ${config.recommendation}`;
|
||||
}
|
||||
}" x-if="showWarning">
|
||||
<div class="p-3 rounded-lg bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800">
|
||||
<div class="text-sm text-yellow-700 dark:text-yellow-300" x-text="warningMessage"></div>
|
||||
<div class="text-sm text-yellow-700 dark:text-yellow-300" x-text="recommendation"></div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user