Skip to content

[ef-12] fix: default binary to production mode and fix standalone next start#10

Merged
NiveditJain merged 1 commit into
mainfrom
ef-12
Apr 6, 2026
Merged

[ef-12] fix: default binary to production mode and fix standalone next start#10
NiveditJain merged 1 commit into
mainfrom
ef-12

Conversation

@NiveditJain

@NiveditJain NiveditJain commented Apr 6, 2026

Copy link
Copy Markdown
Member

Summary

  • failproofai binary now defaults to production dashboard (was incorrectly defaulting to dev mode); --start flag removed as it's no longer needed
  • scripts/launch.ts now uses node .next/standalone/server.js for production mode, fixing the "next start" does not work with "output: standalone" warning
  • package.json adds predev/prestart lifecycle hooks to auto-run bun link, so which failproofai resolves correctly during local development without a manual step

Test plan

  • bun run build — builds .next/standalone/ successfully
  • bun run start — auto-links binary, starts production server at http://localhost:8020 without the standalone warning
  • bun run dev — auto-links binary, starts dev server with HMR
  • which failproofai → returns ~/.bun/bin/failproofai after running either script
  • failproofai → launches production dashboard (no longer dev mode)
  • Visit install page in dashboard → no "binary not found" error

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • The dashboard now defaults to production mode instead of development mode on launch.
    • Production environment utilizes an optimized standalone server deployment with configurable port settings.
  • Chores

    • Development workflow enhanced with automatic dependency linking integration before running dev and start commands, streamlining the setup process.

- `failproofai` now launches production dashboard by default (was dev mode)
- Removes `--start` flag from binary (production is the only mode for end users)
- `scripts/launch.ts`: use `node .next/standalone/server.js` for start mode,
  fixing the "next start does not work with output: standalone" warning
- `package.json`: add `predev`/`prestart` hooks to auto-run `bun link` so
  `which failproofai` resolves during local development without a manual step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: b7cbc509-3d74-4e64-b8e0-9ef074620afe

📥 Commits

Reviewing files that changed from the base of the PR and between 3d8f45f and 735d84a.

📒 Files selected for processing (3)
  • bin/failproofai.mjs
  • package.json
  • scripts/launch.ts

📝 Walkthrough

Walkthrough

The CLI now defaults to production dashboard launch instead of dev mode. The launch script implements mode-specific behavior: "start" mode spawns Node with a standalone server and sets network environment variables, while "dev" mode continues using bunx with Next.js. Pre-scripts are added to run bun link before development and production startup.

Changes

Cohort / File(s) Summary
CLI Entry Point
bin/failproofai.mjs
Updated help text to reflect production dashboard as default; removed conditional mode selection logic, now unconditionally invokes launch("start").
Package Configuration
package.json
Added predev and prestart npm scripts that execute bun link before their respective main scripts.
Launch Script
scripts/launch.ts
Implemented mode-specific process spawning: "start" mode uses Node with standalone server and sets PORT/HOSTNAME environment variables; "dev" mode continues using bunx with Next.js dev, replacing generic mode-based execution.

Sequence Diagram

sequenceDiagram
    participant CLI as CLI (failproofai.mjs)
    participant Launch as Launch Script
    participant Env as Environment
    participant Node as Node.js
    participant Bunx as bunx/Next.js

    CLI->>Launch: launch("start")
    Launch->>Launch: Check mode === "start"
    Launch->>Env: Set PORT=8020 (or from args)
    Launch->>Env: Set HOSTNAME=0.0.0.0
    Launch->>Node: Spawn node [.next/standalone/server.js]
    Node->>Node: Start production server

    alt Dev Mode
        CLI->>Launch: launch("dev")
        Launch->>Launch: Check mode === "dev"
        Launch->>Bunx: Spawn bunx [--bun, next, dev, ...args]
        Bunx->>Bunx: Start development server
    end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The dashboard now springs to production by default,
Mode-specific launches guide the way forward,
Pre-scripts link dependencies with care,
A hoppy infrastructure change, light and fair! ✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@NiveditJain NiveditJain merged commit 365f60e into main Apr 6, 2026
8 checks passed
@NiveditJain NiveditJain deleted the ef-12 branch April 21, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant