Skip to content

Conversation

@jchris
Copy link
Contributor

@jchris jchris commented Aug 9, 2025

No description provided.

@netlify
Copy link

netlify bot commented Aug 9, 2025

Deploy Preview for fireproof-ai-builder ready!

Name Link
🔨 Latest commit f000eb3
🔍 Latest deploy log https://app.netlify.com/projects/fireproof-ai-builder/deploys/689791b2aac24e00084c3cf6
😎 Deploy Preview https://deploy-preview-200--fireproof-ai-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jchris jchris marked this pull request as ready for review August 9, 2025 18:23
@charliecreates charliecreates bot requested a review from CharlieHelps August 9, 2025 18:23
Copy link
Contributor

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main concerns: 1) build scripts (DISABLE_REACT_ROUTER=true, cp -r) are Unix-specific and break cross-platform support; 2) Storybook cache-header patterns are overly narrow and may miss real output files, reducing caching effectiveness. Everything else looks reasonable.

Additional notes (1)
  • Performance | netlify.toml:90-99
    Storybook 7’s generated JS & CSS usually live directly under /storybook/ (e.g. sb-preview.<hash>.js) or /storybook/assets/*, not /storybook/static/js/*. The current header rules risk missing those files, so they may get default (short) caching instead of the intended 1-year immutable cache.
Summary of changes

What changed in this PR

  • netlify.toml
    • Switched build command to pnpm run build:all.
    • Added SPA–style redirects for /storybook and /storybook/* so Storybook is served correctly on Netlify.
    • Added caching headers for Storybook‐related HTML, JS, CSS, and media assets.
  • package.json
    • Re-wired build to run a new build:all script that builds the app and Storybook, then copies Storybook into the final publish directory.
    • Added build:app, build:storybook, and dev:with-storybook conveniences.
    • Build scripts now rely on an env-var flag (DISABLE_REACT_ROUTER) and cp -r to orchestrate the Storybook build/copy.

"build": "react-router build",
"build": "pnpm build:all",
"build:app": "react-router build",
"build:storybook": "DISABLE_REACT_ROUTER=true storybook build --output-dir storybook-static",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Unix-style env-var assignment (DISABLE_REACT_ROUTER=true …) will fail on Windows shells (cmd.exe, PowerShell). The team has been trying to keep scripts cross-platform, so this breaks that convention and may frustrate contributors on Windows.

Suggestion

Consider prepending the command with cross-env:

"build:storybook": "cross-env DISABLE_REACT_ROUTER=true storybook build --output-dir storybook-static"

cross-env is already a common dev dependency in many repos and makes the script platform-agnostic. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.

"build": "pnpm build:all",
"build:app": "react-router build",
"build:storybook": "DISABLE_REACT_ROUTER=true storybook build --output-dir storybook-static",
"build:all": "pnpm build:app && pnpm build:storybook && cp -r storybook-static build/client/storybook",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp -r is another Unix-only command; Windows users won’t have it. This undermines the goal of pnpm build:all being the single build script that works everywhere.

Suggestion

Use a cross-platform shim such as shx (shx cp -r …) or cpx instead of plain cp:

"build:all": "pnpm build:app && pnpm build:storybook && shx cp -r storybook-static build/client/storybook"

Add shx as a dev dependency if it’s not already present. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this change.

@charliecreates charliecreates bot removed the request for review from CharlieHelps August 9, 2025 18:23
@jchris jchris merged commit 5aae5bb into main Aug 9, 2025
5 checks passed
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.

2 participants