Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aspect-load), filter out core-aspects even when passed with versions #7344

Merged
merged 4 commits into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scopes/workspace/workspace/workspace-aspects-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ needed-for: ${neededFor || '<unknown>'}. using opts: ${JSON.stringify(mergedOpts
const idsToResolve = componentIds ? componentIds.map((id) => id.toString()) : this.harmony.extensionsIds;
const coreAspectsIds = this.aspectLoader.getCoreAspectIds();
const configuredAspects = this.aspectLoader.getConfiguredAspects();
const userAspectsIds: string[] = difference(idsToResolve, coreAspectsIds);
// it's possible that componentIds are core-aspects that got version for some reason, remove the version to
// correctly filter them out later.
const userAspectsIds: string[] = componentIds
? componentIds.filter((id) => !coreAspectsIds.includes(id.toStringWithoutVersion())).map((id) => id.toString())
: difference(this.harmony.extensionsIds, coreAspectsIds);
const rootAspectsIds: string[] = difference(configuredAspects, coreAspectsIds);
const componentIdsToResolve = await this.workspace.resolveMultipleComponentIds(userAspectsIds);
const components = await this.importAndGetAspects(componentIdsToResolve);
Expand Down