fix: post-process parent directories of unpacked files#9419
fix: post-process parent directories of unpacked files#9419
Conversation
🦋 Changeset detectedLatest commit: f354823 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…f a matching node module
# Conflicts: # test/snapshots/HoistedNodeModuleTest.js.snap
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where parent directories were incorrectly marked as unpacked when packaging ASAR archives. The fix removes the automatic propagation of the unpacked flag to parent directories, allowing the electron/asar library to determine directory unpacked status automatically based on their contents.
Key Changes:
- Refactored the two-pass directory processing logic to first create parent directories with
unpacked: false, then propagate the flag (though this second step appears to be unintentionally retained) - Simplified the
isUnpackedcheck to take additional parameters (file and stat) for more accurate unpacking decisions - Refactored helper methods and code organization for better clarity
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
packages/app-builder-lib/src/asar/asarUtil.ts |
Refactored ASAR packaging logic to use a Map-based approach instead of arrays, changed how parent directories are marked as unpacked, and simplified various helper methods |
test/snapshots/globTest.js.snap |
Removed "unpacked": true flags from parent directories in multiple test cases, confirming that only files (not their parent directories) should be explicitly marked as unpacked |
test/snapshots/HoistedNodeModuleTest.js.snap |
Removed "unpacked": true flag from parent directory, consistent with other snapshot changes |
.changeset/light-flies-count.md |
Added changeset documenting the fix as a patch-level change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes: #9242