docs: Add Gemini response to build pipeline consultation
This commit is contained in:
@@ -167,3 +167,85 @@ Thanks Gemini. We're exhausted and the panel is stable but half-upgraded. Help u
|
||||
|
||||
— Michael (The Wizard) + Claude (Chronicler #84 — The Meridian)
|
||||
**Firefrost Gaming | Fire + Frost + Foundation = Where Love Builds Legacy** 💙🔥❄️
|
||||
|
||||
---
|
||||
|
||||
## Gemini's Response (April 13, 2026)
|
||||
|
||||
**Summary:** React's ErrorBoundary is the immediate fix. set -e + tsc --noEmit pre-flight in build.sh. Pre-commit PHP lint hook. Blueprint install is the canonical path — no manual file copying.
|
||||
|
||||
### The Silent Assassin Explained
|
||||
React unmounts the ENTIRE component tree when an uncaught error occurs during rendering. ModpackChecker's new widget crashed at runtime (missing prop, undefined variable, or failed import), React swallowed the error silently, and nuked the server card. This is React's intended behavior without an ErrorBoundary.
|
||||
|
||||
### Key Decisions
|
||||
|
||||
**1. ErrorBoundary FIRST (before anything else)**
|
||||
```tsx
|
||||
// views/server/ErrorBoundary.tsx
|
||||
class ModpackErrorBoundary extends Component<Props, State> {
|
||||
public static getDerivedStateFromError(_: Error): State {
|
||||
return { hasError: true };
|
||||
}
|
||||
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
console.error("ModpackChecker Component Error:", error, errorInfo);
|
||||
}
|
||||
public render() {
|
||||
if (this.state.hasError) {
|
||||
return this.props.fallback || <div className="text-red-500 text-sm">Modpack module unavailable.</div>;
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
```
|
||||
Inject as: `<ModpackErrorBoundary><ModpackVersionCard /></ModpackErrorBoundary>`
|
||||
|
||||
**2. build.sh: Add set -e + tsc --noEmit pre-flight**
|
||||
```bash
|
||||
set -e # Exit immediately on any failure
|
||||
set -u # Treat unset variables as errors
|
||||
|
||||
# Before yarn build:production:
|
||||
echo "Running pre-flight TypeScript check..."
|
||||
yarn tsc --noEmit resources/scripts/components/server/ModpackVersionCard.tsx || exit 1
|
||||
```
|
||||
|
||||
**3. Pre-commit PHP lint hook (fixes */6 forever)**
|
||||
```bash
|
||||
# .git/hooks/pre-commit
|
||||
FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep ".php$")
|
||||
for FILE in $FILES; do
|
||||
php -l "$FILE" || { echo "Aborting: PHP syntax error in $FILE"; exit 1; }
|
||||
done
|
||||
```
|
||||
|
||||
**4. Canonical deployment path: ALWAYS blueprint -install**
|
||||
Never manually copy files to live panel. Push to `.blueprint/extensions/modpackchecker/` first, then trigger Blueprint install. Treat Blueprint extension folder as staging ground.
|
||||
|
||||
**5. Blueprint controller: Use find instead of hardcoded path**
|
||||
```bash
|
||||
BP_CONTROLLER=$(find app/Http/Controllers/Admin/Extensions/modpackchecker -name "*Controller.php" | head -n 1)
|
||||
cp "$EXT_DIR/admin/controller.php" "$BP_CONTROLLER"
|
||||
```
|
||||
|
||||
**6. Pre-compiled JS bundle: Still NO**
|
||||
No safe way to hook pre-compiled React into Pterodactyl's existing React Router and Context providers without breaking other extensions. Must require yarn build.
|
||||
|
||||
**7. Industry standard confirmed**
|
||||
Physical file copies + sed injections + yarn build:production IS the industry standard for complex Blueprint extensions. Slow but correct.
|
||||
|
||||
---
|
||||
|
||||
## Conclusion
|
||||
|
||||
**Immediate actions for Code:**
|
||||
1. Create `ErrorBoundary.tsx` and wrap widget injection
|
||||
2. Add `set -e`, `set -u` to build.sh
|
||||
3. Add `tsc --noEmit` pre-flight check before yarn build
|
||||
4. Add pre-commit PHP lint hook to repo
|
||||
5. Use `find` for Blueprint controller path
|
||||
|
||||
**Next Steps:**
|
||||
1. Code implements ErrorBoundary + build.sh hardening
|
||||
2. Re-test v1.1.0 widget deploy on Dev Panel first
|
||||
3. Verify ErrorBoundary catches errors gracefully (no card disappearing)
|
||||
4. Deploy to live panel only after Dev Panel confirms stable
|
||||
|
||||
Reference in New Issue
Block a user