fix: ensure component dependencies are installed during import#10091
Closed
davidfirst wants to merge 2 commits intomasterfrom
Closed
fix: ensure component dependencies are installed during import#10091davidfirst wants to merge 2 commits intomasterfrom
davidfirst wants to merge 2 commits intomasterfrom
Conversation
Component dependencies from the model are now included during install even if dependency detection hasn't fully completed. This fixes an issue where Vue SFC and other file types with delayed dependency detection would result in missing component dependencies after import. The fix ensures newly imported components load fully before install to trigger dependency detection, and component dependencies from the model are always included when the component is being analyzed for missing packages. Fixes an issue where @learnbit-vue/graphql.composables.user was not installed during 'bit import learnbit-vue.graphql/user-app' but was detected as missing in 'bit status' and required running 'bit install' again.
Member
Author
|
Here is the issue with this approach: this fix includes ALL component dependencies from the model whenever ANY dependency is missing. This doesn't respect if a user actually removed a dependency from the source code. See #10095 for a different approach to fix it. |
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.
Summary
Fixes an issue where component dependencies were not installed during
bit importif their dependency detection hadn't completed before the install manifest was generated. This primarily affected Vue SFC files and other file types with delayed dependency analysis.Problem
When running
bit import learnbit-vue.graphql/user-app, the component@learnbit-vue/graphql.composables.userwas not installed even though it was a dependency in the model. Runningbit statusshowed it as missing, and a secondbit installwas required to install it.Root Cause
The issue occurred because:
Solution
Two changes were made:
Component Writer (
scopes/component/component-writer/component-writer.main.runtime.ts):Dependency List Factory (
scopes/dependencies/dependency-resolver/dependencies/dependency-list-factory.ts):Testing
Verified the fix by:
bit import learnbit-vue.graphql/user-appin a fresh workspace@learnbit-vue/graphql.composables.useris installed on first importbit statusshows no issuesbit installagainImpact