frontend: remove unused ArduPilot parameter files from build#3760
Merged
patrickelectric merged 1 commit intobluerobotics:masterfrom Feb 4, 2026
Merged
Conversation
Only keep JSON files from the ArduPilot-Parameter-Repository, removing XML, RST, MD, and HTML documentation files that are not used by the frontend.
Reviewer's GuideAdds a Vite build plugin to remove non-JSON ArduPilot parameter repository files from the frontend build output and simplifies asset inclusion patterns to rely on the cleaned output. Sequence diagram for Vite build cleanup of ArduPilot parameter filessequenceDiagram
participant ViteBuild
participant CleanupArdupilotPlugin
participant FileSystem
ViteBuild->>CleanupArdupilotPlugin: closeBundle()
CleanupArdupilotPlugin->>FileSystem: existsSync(dist/assets/ArduPilot-Parameter-Repository)
alt repoPath exists
CleanupArdupilotPlugin->>CleanupArdupilotPlugin: removeNonJson(repoPath)
loop traverse_directory_tree
CleanupArdupilotPlugin->>FileSystem: readdirSync(dir, withFileTypes)
alt entry isDirectory
CleanupArdupilotPlugin->>CleanupArdupilotPlugin: removeNonJson(subdirectory)
else entry isFile
alt name endsWith .json or .json.gz
CleanupArdupilotPlugin-->>FileSystem: keep file
else
CleanupArdupilotPlugin->>FileSystem: unlinkSync(file)
end
end
end
else repoPath missing
CleanupArdupilotPlugin-->>ViteBuild: return without changes
end
CleanupArdupilotPlugin-->>ViteBuild: closeBundle complete
ViteBuild->>ViteBuild: produce final frontend assets
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In the cleanup-ardupilot-files plugin, the synchronous fs operations inside closeBundle (readdirSync/unlinkSync) run without any error handling, so a single IO error could fail the entire build; consider wrapping the traversal in try/catch and logging a warning instead of throwing.
- By removing the ArduPilot JSON pattern from assetsInclude, JSON files that are no longer explicitly imported might not be available in dev/preview; double-check whether this pattern is still required for your dev server behavior and, if so, constrain it more narrowly instead of removing it entirely.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the cleanup-ardupilot-files plugin, the synchronous fs operations inside closeBundle (readdirSync/unlinkSync) run without any error handling, so a single IO error could fail the entire build; consider wrapping the traversal in try/catch and logging a warning instead of throwing.
- By removing the ArduPilot JSON pattern from assetsInclude, JSON files that are no longer explicitly imported might not be available in dev/preview; double-check whether this pattern is still required for your dev server behavior and, if so, constrain it more narrowly instead of removing it entirely.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
patrickelectric
left a comment
There was a problem hiding this comment.
I tested the PR but the dist folder is still full of files:
eae8241f ± ls dist/assets/ArduPilot-Parameter-Repository/Plane-4.1
apm.pdef.json apm.pdef.xml MAVLinkMessages.rst ParameterMetaData.xml Parameters.html Parameters.md Parameters.rst
Member
Author
patrickelectric
approved these changes
Feb 4, 2026
Member
|
just tested, the final assets folder does not contain such files, the dist folder should not be used to check them |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Only keep JSON files from the ArduPilot-Parameter-Repository, removing XML, RST, MD, and HTML documentation files that are not used by the frontend.
Summary by Sourcery
Limit frontend build artifacts from the ArduPilot parameter repository to JSON-only assets to reduce bundle size.
Build: