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: always link harmony from bvm unless it is in root policy #7460

Merged
merged 3 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions scopes/component/isolator/isolator.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ export class IsolatorMain {
rootComponentsForCapsules: this.dependencyResolver.hasRootComponents(),
useNesting: isolateInstallOptions.useNesting,
keepExistingModulesDir: this.dependencyResolver.hasRootComponents(),
hasHarmonyInRootPolicy: this.dependencyResolver.hasHarmonyInRootPolicy(),
};
await installer.install(
capsulesDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ export class DependencyInstaller {
delete linkedDependencies[finalRootDir][manifest.name];
}
}
if (!packageManagerOptions.hasHarmonyInRootPolicy) {
delete manifests[finalRootDir].dependencies!['@teambit/harmony'];
}
}
Object.entries(linkedDependencies).forEach(([dir, linkedDeps]) => {
if (!manifests[dir]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ export class DependencyResolverMain {
return Boolean(this.config.rootComponents);
}

hasHarmonyInRootPolicy(): boolean {
const rootPolicy = this.getWorkspacePolicyFromConfig();
return rootPolicy.entries.some(({ dependencyId }) => dependencyId === '@teambit/harmony');
}

nodeLinker(): 'hoisted' | 'isolated' {
if (this.config.nodeLinker) return this.config.nodeLinker;
if (this.config.packageManager === 'teambit.dependencies/pnpm') return 'isolated';
Expand Down
2 changes: 2 additions & 0 deletions scopes/dependencies/dependency-resolver/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export type PackageManagerInstallOptions = {
hidePackageManagerOutput?: boolean;

neverBuiltDependencies?: string[];

hasHarmonyInRootPolicy?: boolean;
};

export type PackageManagerGetPeerDependencyIssuesOptions = PackageManagerInstallOptions;
Expand Down
1 change: 1 addition & 0 deletions scopes/workspace/install/install.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export class InstallMain {
packageImportMethod: this.dependencyResolver.config.packageImportMethod,
rootComponents: hasRootComponents,
updateAll: options?.updateAll,
hasHarmonyInRootPolicy: this.dependencyResolver.hasHarmonyInRootPolicy(),
};
const prevManifests = new Set<string>();
// TODO: this make duplicate
Expand Down