Skip to content

Conversation

@NoahMelle
Copy link
Contributor

@NoahMelle NoahMelle commented Dec 2, 2025

This pull request makes a minor correction to the destination path used when copying flag assets for Gatsby projects in the copyFrameworkAware function. The change ensures the path gets treated as a relative path, instead of an absolute path which caused the postinstall script to fail in Gatsby projects.

  • Fixed the Gatsby-specific destination path in copyFrameworkAware to use ./static/flags instead of /static/flags in cli/flagpack.js.

Closes #83

Summary by Bito

  • Fixes a bug in the CLI by correcting the destination path for flag assets in Gatsby projects.
  • Replaces an absolute path with a relative path to prevent the postinstall script from failing.
  • Ensures that the Gatsby-specific logic in the CLI behaves as expected.
  • Overall, the changes fix a bug in the CLI for Gatsby projects by updating the asset copying process, enhancing reliability.

@bito-code-review
Copy link

bito-code-review bot commented Dec 2, 2025

Code Review Agent Run #0ae670

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: d6f9bf3..d6f9bf3
    • cli/flagpack.js
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review
Copy link

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - Bug Fix - Correct Gatsby Postinstall Path

flagpack.js - Replaced absolute path '/static/flags' with a relative path './static/flags' to ensure proper functionality in Gatsby projects.

@bito-code-review
Copy link

Interaction Diagram by Bito
sequenceDiagram
participant Dev as Developer
participant CLI as flagpack.js<br/>🔄 Updated | ●●○ Medium
participant Meow as Meow CLI Parser
participant CopyFunc as copyFrameworkAware<br/>🔄 Updated | ●●○ Medium
participant PathResolver as path.resolve
participant FSExtra as fs-extra.copy
participant FileSystem as Gatsby Project FileSystem
Dev->>CLI: Execute react-flagpack --framework=gatsby
CLI->>Meow: Parse CLI flags
Meow-->>CLI: Return parsed flags
CLI->>CopyFunc: Call with framework gatsby
CopyFunc->>PathResolver: Resolve ./static/flags (FIXED)
Note over CopyFunc, PathResolver: Changed from /static/flags<br/>to ./static/flags for relative path
PathResolver-->>CopyFunc: Return project-relative path
CopyFunc->>FSExtra: Copy dist/flags to destination
FSExtra->>FileSystem: Write flags to ./static/flags
FileSystem-->>FSExtra: Write complete
FSExtra-->>CopyFunc: Success callback
CopyFunc-->>Dev: Log success message
Loading

Critical path: Developer -> flagpack.js -> copyFrameworkAware -> path.resolve -> fs-extra.copy -> Gatsby Project FileSystem

Note: Fixed path resolution bug in Gatsby framework support. The CLI was using absolute path /static/flags instead of relative ./static/flags, causing flag assets to be copied to wrong location. This fix ensures flags are properly placed in the Gatsby project's static directory during postinstall.

If the interaction diagram doesn't appear, refresh the page to render it.

You can disable interaction diagrams by customizing agent settings. Refer to documentation.

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.

postinstall --framework gatsby fails due to not finding "/static"

2 participants