Skip to content

V2 - Fix non-default frontend:dir in builds#5035

Open
Nifty255 wants to merge 8 commits intowailsapp:masterfrom
Nifty255:v2/fix-non-default-frontend-dir-build
Open

V2 - Fix non-default frontend:dir in builds#5035
Nifty255 wants to merge 8 commits intowailsapp:masterfrom
Nifty255:v2/fix-non-default-frontend-dir-build

Conversation

@Nifty255
Copy link

@Nifty255 Nifty255 commented Mar 1, 2026

Description

Introduce smarter handling of built frontend files when building an application. Previously, configuring frontend:dir to a folder other than one that was targeted by a go:embed directive would allow the application to be built but cause it to fail to launch due to a lack of embedded frontend assets. While simply retargeting the embed directive is the intended option, the build should be throwing at least a warning for this situation, and this workaround only works if the configured frontend:dir is inside the project's directory. Go's embed directives do not allow paths that start with ., .., or /, so projects with frontends that exist outside the project directory must copy the frontend's built files into the project. This change accomplishes that.

On build:

  1. If the frontend's configured path matches an embed directive, all proceeds as normal without the following steps.
  2. A warning is printed and the builder looks for an embed directive for frontend/dist.
  3. If it finds one, it attempts to copy the frontend's built files into frontend/dist.
  4. If the copy fails or an embed directive for frontend/dist was not found, the builder prints an error and halts.
  5. If the copy succeeds, the build proceeds as normal, but deletes the copied frontend build from frontend/dist afterward.

Changes were made to v2/internal/fs/fs.go to support copying to a preexisting directory. No tests were modified and all tests pass.

Fixes #5034

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Some changes reside in v2/internal/fs. go test was used:

wails\v2\internal\fs> go test
PASS
ok      github.com/wailsapp/wails/v2/internal/fs        0.128s

To test the build process which has no unit tests, I ran these steps.

  1. Create an empty directory and a new wails app inside that. wails init -n TestApp
  2. wails dev and the resulting executable from wails build should both work.
  3. Rename frontend to jsfrontend.
  4. Retarget embed: //go:embed all:jsfrontend/dist
  5. Add to config: `"frontend:dir": "jsfrontend"
  6. Ensure wails dev and the resulting executable from wails build both work.
  7. Retarget embed back to: //go:embed all:frontend/dist
  8. wails dev and the resulting executable from wails build should both work. The build process should show a warning:
  • Frontend directory "D:\...\jsfrontend" is not embedded by your application. Is this intentional? Attempting to copy built frontend assets to "frontend/dist"
  1. Rename jsfrontend back to frontend and move it outside the project directory.
  2. Set frontend:dir in config to "../jsfrontend"
  3. wails dev and the resulting executable from wails build should both work. The build process should show a warning:
  • Frontend directory "D:\...\frontend" is not embedded by your application. Is this intentional? Attempting to copy built frontend assets to "frontend/dist"
  1. Retarget embed: //go:embed all:myui/dist
  2. wails dev should work while wails build should fail with an error:
  • Configured custom frontend directory is not embedded and could not copy the build to the default dist. Custom frontend directories inside the project directory should match an embed directive in your app, and frontend directories outside should use the default embed directive targeting "frontend/dist".

  • Windows

  • macOS

  • Linux

Test Configuration

> wails doctor


          Wails Doctor



# Wails
Version  | v2.11.1
Revision | 4d0abeb37c7a5b0717c5d9f8985bac7c608b4fa6
Modified | true


# System
┌──────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                                |
| Version      | 2009 (Build: 19045)                                                           |
| ID           | 22H2                                                                          |
| Branding     | Windows 10 Pro                                                                |
| Go Version   | go1.22.2                                                                      |
| Platform     | windows                                                                       |
| Architecture | amd64                                                                         |
| CPU          | AMD Ryzen 9 7950X3D 16-Core Processor                                         |
| GPU          | AMD Radeon RX 7900 XTX (Advanced Micro Devices, Inc.) - Driver: 32.0.21032.24 |
| Memory       | 64GB                                                                          |
└──────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 145.0.3800.82 |
| Nodejs     | N/A          | Installed | 24.12.0       |
| npm        | N/A          | Installed | 11.6.2        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
|                                                       |
└─────────────── * - Optional Dependency ───────────────┘

# Diagnosis
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes

    • Improved frontend build handling: better validation and cleanup of built frontend artifacts and more tolerant directory copying when destinations already exist, reducing build failures for non-default frontend layouts.
  • Documentation

    • Clarified frontend:dir guidance across all locales, explaining fallback behavior and embed directive expectations.
  • Chores

    • Release: v2.11.1.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

📝 Walkthrough

Walkthrough

Patch release v2.11.1: ensures frontend built assets are copied into the expected embed location when frontend:dir is non-default, updates filesystem copy behavior, adds build-time assertions/cleanup, bumps version, and expands documentation/localizations.

Changes

Cohort / File(s) Summary
Version bumps
v2/cmd/wails/internal/version.txt, v2/examples/panic-recovery-test/go.mod
Bumped version and example module dependency from v2.11.0 to v2.11.1.
Frontend asset handling
v2/pkg/commands/build/build.go
Added AssertFrontendDist(cwd, buildOptions) error and CleanFrontendDist(cwd, buildOptions) error; integrated assertions and cleanup into the build flow to copy non-default frontend builds into the expected embed path and remove non-embedded artifacts.
Filesystem operations
v2/internal/fs/fs.go
Changed CopyDir() and CopyDirExtended() to create destination dir if missing and proceed when destination already exists; unified error handling for Mkdir/Stat cases.
Project configuration documentation
website/docs/reference/project-config.mdx, website/i18n/*/docusaurus-plugin-content-docs/*/reference/project-config.mdx, website/versioned_docs/*/reference/project-config.mdx (multiple locales/versions)
Extended frontend:dir comments across docs/locales to explain behavior when value doesn't match embed directive and guidance to use frontend/dist or align embed directive.
Changelog and localization
website/src/pages/changelog.mdx, website/i18n/en/docusaurus-plugin-content-docs/version-v2.11.1.json
Added v2.11.1 changelog entry and English localization metadata for the new version.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer/CLI
    participant BuildCmd as Build Command
    participant FrontendBuilder as Frontend Builder
    participant FS as Filesystem utils
    participant Embed as Embed Target (frontend/dist)

    Dev->>BuildCmd: run `wails build`
    BuildCmd->>FrontendBuilder: builder.BuildFrontend()
    FrontendBuilder-->>BuildCmd: frontend build artifacts
    BuildCmd->>BuildCmd: call AssertFrontendDist(cwd, opts)
    alt frontend dir != default
        BuildCmd->>FS: Copy frontend/dist (from configured dir) to Embed
        FS-->>BuildCmd: copy success/failure
    end
    BuildCmd->>BuildCmd: continue app build
    BuildCmd->>BuildCmd: call CleanFrontendDist(cwd, opts)
    CleanFrontendDist->>FS: remove non-embed artifacts (keep gitkeep)
    FS-->>CleanFrontendDist: cleanup result
    BuildCmd-->>Dev: final artifact
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

Documentation, cli, v2-only, lgtm

Suggested reviewers

  • leaanthony

Poem

🐰 In burrows and builds I hopped around,

Found misplaced assets that could not be found.
I copied and cleaned with a twitch of my nose,
Now embeds are snug where the frontend goes.
thump-thump 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the handling of non-default frontend:dir in builds, which is the core purpose of this PR.
Description check ✅ Passed The PR description includes all required sections: summary of changes, issue reference (Fixes #5034), type of change (Bug fix), testing details with steps and configuration, and completed checklist items.
Linked Issues check ✅ Passed The PR fully addresses issue #5034 by implementing smart frontend:dir handling: copying built frontend files to frontend/dist when not embedded, printing warnings/errors appropriately, and handling both internal and external frontend directories.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing issue #5034: modifications to fs.go for directory copying, new build functions (AssertFrontendDist and CleanFrontendDist), version bumps, documentation updates, and changelog entry—all in scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.16.1)
v2/pkg/commands/build/build.go

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
website/i18n/pt/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx (1)

21-21: Consider clarifying the automatic copy behavior.

The current phrasing "be sure to change your embed directive or target 'frontend/dist'" suggests manual user action. However, according to the PR objectives, v2.11.1 now automatically copies built frontend files to frontend/dist when the configured frontend:dir doesn't match embed directives. The documentation could be clearer about this automatic behavior.

📝 Suggested documentation improvement

Consider revising to something like:

-  // Relative path to the frontend directory. Defaults to 'frontend'. If not default, be sure to change your embed directive or target 'frontend/dist'
+  // Relative path to the frontend directory. Defaults to 'frontend'. If not default, Wails will automatically copy built assets to 'frontend/dist' for embedding (requires 'frontend/dist' embed directive)

This more accurately reflects that Wails handles the copying automatically rather than requiring manual user intervention.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/pt/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx`
at line 21, Update the sentence that currently reads "Relative path to the
frontend directory. Defaults to 'frontend'. If not default, be sure to change
your embed directive or target 'frontend/dist'" to clearly state the automatic
copy behavior introduced in v2.11.1: when the configured frontend:dir does not
match the embed directive, Wails will automatically copy built frontend files to
'frontend/dist' so no manual change to the embed directive is required;
reference the terms frontend:dir, embed directive, and 'frontend/dist' in the
revised sentence and mention v2.11.1 to make the behavior and version explicit.
website/src/pages/changelog.mdx (1)

35-35: Consider removing empty "Added" section.

The "### Added" section is empty. Consider removing it to keep the changelog concise, or leave it if you anticipate adding features before release.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/src/pages/changelog.mdx` at line 35, Remove the empty "### Added"
header from the changelog page to avoid an empty section; locate the "### Added"
heading in website/src/pages/changelog.mdx and delete that line (or replace it
with content if you intend to add items before release), ensuring the rest of
the markdown remains properly formatted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@v2/pkg/commands/build/build.go`:
- Line 191: The pterm warning uses pterm.Warning.Printf which doesn't append a
newline; replace the call in the build logic that references
buildOptions.ProjectData.GetFrontendDir() (the pterm.Warning.Printf invocation)
with pterm.Warning.Printfln to ensure the message ends with a newline and
remains consistent with other pterm calls in this file.
- Around line 219-228: The code currently hardcodes "./frontend/dist" and
creates "gitkeep" without using the function's cwd parameter; update the
cleanup/create logic to use the provided cwd (e.g., join cwd with
"frontend/dist" via filepath.Join) instead of the literal string, replace
os.RemoveAll("./frontend/dist"), os.MkdirAll("./frontend/dist", ...) and
os.Create("./frontend/dist/gitkeep") with operations against that joined path,
and create a hidden ".gitkeep" file (prefixed with a dot) when calling
os.Create; keep error handling around os.MkdirAll and file creation as-is and
ensure you close the file after creation.

In
`@website/i18n/fr/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx`:
- Line 21: Replace the English comment "Relative path to the frontend directory.
Defaults to 'frontend'. If not default, be sure to change your embed directive
or target 'frontend/dist'" with a French translation to restore localization
consistency; for example use: "Chemin relatif vers le répertoire frontend. Par
défaut : « frontend ». Si vous utilisez un chemin différent, pensez à mettre à
jour votre directive d'intégration ou à cibler « frontend/dist »." Locate and
update the exact comment string in the file (the line containing the quoted
English sentence) so the doc is fully French.

In
`@website/i18n/ru/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx`:
- Line 21: The Russian locale file
website/i18n/ru/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
currently contains English text (notably the "frontend:dir" comment) and should
be translated into Russian unless intentionally left in English; update the
entire document text and the inline comment string "frontend:dir" to fluent
Russian, keeping technical tokens (e.g., frontend, frontend/dist) unchanged, and
run the provided verification script to check other locale folders and ensure
parity with website/docs/reference/project-config.mdx before committing.

In `@website/src/pages/changelog.mdx`:
- Line 38: Locate the changelog entry containing the line starting with "Smarter
frontend build handling when \"frontend:dir\"..." and replace the literal
placeholder "**PR GOES HERE**" with the actual PR link
"[`#5035`](https://github.com/wailsapp/wails/pull/5035)". Ensure the final line
reads: Smarter frontend build handling when "frontend:dir" doesn't match an
embed directive (e.g. when the frontend is outside the project dir) by `@Nifty255`
in [`#5035`](https://github.com/wailsapp/wails/pull/5035).

---

Nitpick comments:
In
`@website/i18n/pt/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx`:
- Line 21: Update the sentence that currently reads "Relative path to the
frontend directory. Defaults to 'frontend'. If not default, be sure to change
your embed directive or target 'frontend/dist'" to clearly state the automatic
copy behavior introduced in v2.11.1: when the configured frontend:dir does not
match the embed directive, Wails will automatically copy built frontend files to
'frontend/dist' so no manual change to the embed directive is required;
reference the terms frontend:dir, embed directive, and 'frontend/dist' in the
revised sentence and mention v2.11.1 to make the behavior and version explicit.

In `@website/src/pages/changelog.mdx`:
- Line 35: Remove the empty "### Added" header from the changelog page to avoid
an empty section; locate the "### Added" heading in
website/src/pages/changelog.mdx and delete that line (or replace it with content
if you intend to add items before release), ensuring the rest of the markdown
remains properly formatted.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d0abeb and b520711.

📒 Files selected for processing (57)
  • v2/cmd/wails/internal/version.txt
  • v2/examples/panic-recovery-test/go.mod
  • v2/internal/fs/fs.go
  • v2/pkg/commands/build/build.go
  • website/docs/reference/project-config.mdx
  • website/i18n/ar/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/de/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/en/docusaurus-plugin-content-docs/version-v2.11.1.json
  • website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/ja/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.3.1/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.4.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.3.1/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.4.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.3.1/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.4.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/tr/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/vi/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.3.1/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.4.0/reference/project-config.mdx
  • website/src/pages/changelog.mdx
  • website/versioned_docs/version-v2.10/reference/project-config.mdx
  • website/versioned_docs/version-v2.11.0/reference/project-config.mdx

// The directory where the build files reside. Defaults to 'build'
"build:dir": "",
// Relative path to the frontend directory. Defaults to 'frontend'
// Relative path to the frontend directory. Defaults to 'frontend'. If not default, be sure to change your embed directive or target 'frontend/dist'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Localize the new guidance text to French.

Line 21 introduces an English sentence in the FR doc, which breaks localization consistency for end users. Please translate this comment to French.

✏️ Suggested wording
-  // Relative path to the frontend directory. Defaults to 'frontend'. If not default, be sure to change your embed directive or target 'frontend/dist'
+  // Chemin relatif vers le répertoire frontend. Valeur par défaut : 'frontend'. Si vous utilisez un autre chemin, veillez à adapter votre directive embed ou à cibler 'frontend/dist'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Relative path to the frontend directory. Defaults to 'frontend'. If not default, be sure to change your embed directive or target 'frontend/dist'
// Chemin relatif vers le répertoire frontend. Valeur par défaut : 'frontend'. Si vous utilisez un autre chemin, veillez à adapter votre directive embed ou à cibler 'frontend/dist'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/fr/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx`
at line 21, Replace the English comment "Relative path to the frontend
directory. Defaults to 'frontend'. If not default, be sure to change your embed
directive or target 'frontend/dist'" with a French translation to restore
localization consistency; for example use: "Chemin relatif vers le répertoire
frontend. Par défaut : « frontend ». Si vous utilisez un chemin différent,
pensez à mettre à jour votre directive d'intégration ou à cibler « frontend/dist
»." Locate and update the exact comment string in the file (the line containing
the quoted English sentence) so the doc is fully French.

// The directory where the build files reside. Defaults to 'build'
"build:dir": "",
// Relative path to the frontend directory. Defaults to 'frontend'
// Relative path to the frontend directory. Defaults to 'frontend'. If not default, be sure to change your embed directive or target 'frontend/dist'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Documentation appears untranslated in Russian locale folder.

The entire file, including this updated comment, is in English despite being located in the Russian locale directory (i18n/ru/). Russian-speaking users would expect this documentation to be in Russian.

Run the following script to check if similar documentation updates exist in other locale folders and identify translation status:

#!/bin/bash
# Description: Check if similar frontend:dir documentation changes exist in other locales
# and verify translation status across locale folders

echo "=== Checking frontend:dir comment in English docs ==="
rg -n "frontend:dir.*embed directive" website/docs/ -A1 -B1

echo -e "\n=== Checking frontend:dir comment in other locale folders ==="
rg -n "frontend:dir" website/i18n/*/docusaurus-plugin-content-docs/*/reference/project-config.mdx -A1 -B1

echo -e "\n=== Checking which locale folders exist ==="
fd -t d -d 1 . website/i18n/

echo -e "\n=== Comparing English vs Russian file content similarity ==="
if [ -f "website/docs/reference/project-config.mdx" ]; then
  echo "English version exists"
  head -5 website/docs/reference/project-config.mdx
else
  echo "English reference not found at expected path"
fi

Is the English content in the Russian locale folder intentional, or should this documentation be translated to Russian?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/ru/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx`
at line 21, The Russian locale file
website/i18n/ru/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
currently contains English text (notably the "frontend:dir" comment) and should
be translated into Russian unless intentionally left in English; update the
entire document text and the inline comment string "frontend:dir" to fluent
Russian, keeping technical tokens (e.g., frontend, frontend/dist) unchanged, and
run the provided verification script to check other locale folders and ensure
parity with website/docs/reference/project-config.mdx before committing.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (5)
website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx (1)

21-22: Minor version note: Feature is introduced in v2.11.1.

This v2.11.0 documentation describes the copy-to-frontend/dist behavior that's being introduced in v2.11.1. The impact is minimal given the close version proximity, but for accuracy, consider whether v2.11.0 docs should describe this behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx`
around lines 21 - 22, The documentation for the "frontend:dir" setting currently
lives under version-v2.11.0 but the behavior described was introduced in
v2.11.1; update the doc so the behavior is documented under the correct version
or add a clear note stating "Feature introduced in v2.11.1" next to the
"frontend:dir" description (and adjust any version frontmatter or filename from
version-v2.11.0 to version-v2.11.1 if appropriate) to ensure the change is
accurately attributed to v2.11.1.
website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx (1)

21-22: Documentation version mismatch with English versioned docs.

This v2.10 zh-Hans doc describes the new copy-to-frontend/dist behavior, but the English website/versioned_docs/version-v2.10 uses simpler text: "Ensure your embed directive matches this. Frontends outside the project directory are unsupported."

Consider aligning with the English versioned docs to maintain consistency and accuracy for v2.10 users.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx`
around lines 21 - 22, The zh-Hans v2.10 doc text for the "frontend:dir" setting
differs from the English v2.10 version; update the content around the
"frontend:dir" entry so it matches the English versioned docs' wording (e.g.,
replace the long explanation about copying to 'frontend/dist' with the simpler
sentence like "Ensure your embed directive matches this. Frontends outside the
project directory are unsupported.") so both versions are consistent for
version-v2.10.
website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx (1)

21-22: Same documentation version mismatch as other i18n versioned docs.

Consider aligning with the English website/versioned_docs/version-v2.10 text which uses simpler wording appropriate for v2.10.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx`
around lines 21 - 22, The Russian versioned doc uses wording that diverges from
the English v2.10 copy; update the text in
website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
to match the simpler English phrasing used in
website/versioned_docs/version-v2.10 (i.e., rephrase the sentence describing
"frontend:dir" to the same concise wording as the English version), keeping the
configuration key "frontend:dir" and its explanation semantically identical to
the English v2.10 doc so the versioned translations remain consistent.
website/i18n/ru/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx (1)

21-22: Documentation version mismatch: v2.7.0 docs describe v2.11.1 behavior.

Same issue as other i18n versioned docs. Consider using simpler text appropriate for v2.7.0 or removing this change from older version docs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@website/i18n/ru/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx`
around lines 21 - 22, The versioned doc version-v2.7.0's description for the
"frontend:dir" setting in project-config.mdx contains v2.11.1-specific behavior;
update the "frontend:dir" description to match v2.7.0 semantics (remove
references to embed directive behavior introduced later) or revert this change
from the v2.7.0 file so it matches the original simple text used in that
release; make the edit to the "frontend:dir" entry so the wording reflects
v2.7.0 (concise default = "frontend" and no v2.11.1-specific copy/embed
guidance).
v2/pkg/commands/build/build.go (1)

219-219: Consider handling os.RemoveAll error.

The error from os.RemoveAll is silently ignored. While RemoveAll returns nil when the path doesn't exist, it can fail due to permission issues. However, if removal fails due to permissions, the subsequent MkdirAll would likely also fail and that error is handled. This is a minor concern since the error path converges.

Optional: Log or check the error
-	os.RemoveAll(filepath.Join(cwd, "frontend/dist"))
+	if err := os.RemoveAll(filepath.Join(cwd, "frontend/dist")); err != nil {
+		// Log but continue - MkdirAll will fail if there's a real permission issue
+		pterm.Warning.Printfln("Could not remove frontend/dist: %v", err)
+	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@v2/pkg/commands/build/build.go` at line 219, The call to
os.RemoveAll(filepath.Join(cwd, "frontend/dist")) ignores its returned error;
capture the error (e.g., err := os.RemoveAll(...)) and handle it—either log it
with context (including cwd and path) using the existing logger or return/wrap
the error from the surrounding function so failures (like permission issues) are
visible; update the spot where os.RemoveAll is invoked in build.go to check the
error and act accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@v2/pkg/commands/build/build.go`:
- Line 219: The call to os.RemoveAll(filepath.Join(cwd, "frontend/dist"))
ignores its returned error; capture the error (e.g., err := os.RemoveAll(...))
and handle it—either log it with context (including cwd and path) using the
existing logger or return/wrap the error from the surrounding function so
failures (like permission issues) are visible; update the spot where
os.RemoveAll is invoked in build.go to check the error and act accordingly.

In
`@website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx`:
- Around line 21-22: The Russian versioned doc uses wording that diverges from
the English v2.10 copy; update the text in
website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
to match the simpler English phrasing used in
website/versioned_docs/version-v2.10 (i.e., rephrase the sentence describing
"frontend:dir" to the same concise wording as the English version), keeping the
configuration key "frontend:dir" and its explanation semantically identical to
the English v2.10 doc so the versioned translations remain consistent.

In
`@website/i18n/ru/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx`:
- Around line 21-22: The versioned doc version-v2.7.0's description for the
"frontend:dir" setting in project-config.mdx contains v2.11.1-specific behavior;
update the "frontend:dir" description to match v2.7.0 semantics (remove
references to embed directive behavior introduced later) or revert this change
from the v2.7.0 file so it matches the original simple text used in that
release; make the edit to the "frontend:dir" entry so the wording reflects
v2.7.0 (concise default = "frontend" and no v2.11.1-specific copy/embed
guidance).

In
`@website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx`:
- Around line 21-22: The zh-Hans v2.10 doc text for the "frontend:dir" setting
differs from the English v2.10 version; update the content around the
"frontend:dir" entry so it matches the English versioned docs' wording (e.g.,
replace the long explanation about copying to 'frontend/dist' with the simpler
sentence like "Ensure your embed directive matches this. Frontends outside the
project directory are unsupported.") so both versions are consistent for
version-v2.10.

In
`@website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx`:
- Around line 21-22: The documentation for the "frontend:dir" setting currently
lives under version-v2.11.0 but the behavior described was introduced in
v2.11.1; update the doc so the behavior is documented under the correct version
or add a clear note stating "Feature introduced in v2.11.1" next to the
"frontend:dir" description (and adjust any version frontmatter or filename from
version-v2.11.0 to version-v2.11.1 if appropriate) to ensure the change is
accurately attributed to v2.11.1.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b520711 and 6283acf.

📒 Files selected for processing (45)
  • v2/pkg/commands/build/build.go
  • website/docs/reference/project-config.mdx
  • website/i18n/ar/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/de/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/ja/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/tr/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/vi/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/src/pages/changelog.mdx
  • website/versioned_docs/version-v2.10/reference/project-config.mdx
  • website/versioned_docs/version-v2.11.0/reference/project-config.mdx
✅ Files skipped from review due to trivial changes (6)
  • website/i18n/de/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
🚧 Files skipped from review as they are similar to previous changes (25)
  • website/versioned_docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.10/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ja/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.5.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx
  • website/i18n/fr/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.9.0/reference/project-config.mdx
  • website/i18n/tr/docusaurus-plugin-content-docs/current/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.11.0/reference/project-config.mdx
  • website/i18n/ko/docusaurus-plugin-content-docs/version-v2.7.0/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.8.0/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/pt/docusaurus-plugin-content-docs/version-v2.8.1/reference/project-config.mdx
  • website/i18n/ru/docusaurus-plugin-content-docs/version-v2.6.0/reference/project-config.mdx

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.

[v2] Fully built apps fail to run when frontend:dir is not default

1 participant