diff --git a/packages/js/src/generators/release-version/release-version.ts b/packages/js/src/generators/release-version/release-version.ts index 2c61a92708..0334bc1257 100644 --- a/packages/js/src/generators/release-version/release-version.ts +++ b/packages/js/src/generators/release-version/release-version.ts @@ -94,7 +94,8 @@ Valid values are: ${validReleaseVersionPrefixes // Sort the projects topologically if update dependents is enabled // TODO: maybe move this sorting to the command level? const projects = - updateDependents === 'never' + updateDependents === 'never' || + options.releaseGroup.projectsRelationship !== 'independent' ? options.projects : sortProjectsTopologically(options.projectGraph, options.projects); const projectToDependencyBumps = new Map(); @@ -417,6 +418,7 @@ To fix this you will either need to add a package.json file at that location, or if (!specifier) { if ( updateDependents !== 'never' && + options.releaseGroup.projectsRelationship === 'independent' && projectToDependencyBumps.has(projectName) ) { // No applicable changes to the project directly by the user, but one or more dependencies have been bumped and updateDependents is enabled @@ -541,6 +543,7 @@ To fix this you will either need to add a package.json file at that location, or if (!specifier) { if ( updateDependents !== 'never' && + options.releaseGroup.projectsRelationship === 'independent' && projectToDependencyBumps.has(projectName) ) { // No applicable changes to the project directly by the user, but one or more dependencies have been bumped and updateDependents is enabled @@ -601,7 +604,9 @@ To fix this you will either need to add a package.json file at that location, or return localPackageDependency.target === project.name; }); - const includeTransitiveDependents = updateDependents !== 'never'; + const includeTransitiveDependents = + updateDependents !== 'never' && + options.releaseGroup.projectsRelationship === 'independent'; const transitiveLocalPackageDependents: LocalPackageDependency[] = []; if (includeTransitiveDependents) { for (const directDependent of allDependentProjects) { @@ -656,7 +661,10 @@ To fix this you will either need to add a package.json file at that location, or } // If not always updating dependents (when they don't already appear in the batch itself), print a warning to the user about what is being skipped and how to change it - if (updateDependents === 'never') { + if ( + updateDependents === 'never' || + options.releaseGroup.projectsRelationship !== 'independent' + ) { if (dependentProjectsOutsideCurrentBatch.length > 0) { let logMsg = `⚠️ Warning, the following packages depend on "${project.name}"`; const reason = @@ -689,7 +697,8 @@ To fix this you will either need to add a package.json file at that location, or currentVersion, newVersion: null, // will stay as null in the final result in the case that no changes are detected dependentProjects: - updateDependents === 'auto' + updateDependents === 'auto' && + options.releaseGroup.projectsRelationship === 'independent' ? allDependentProjects : dependentProjectsInCurrentBatch, }; @@ -723,7 +732,8 @@ To fix this you will either need to add a package.json file at that location, or if (allDependentProjects.length > 0) { const totalProjectsToUpdate = - updateDependents === 'auto' + updateDependents === 'auto' && + options.releaseGroup.projectsRelationship === 'independent' ? allDependentProjects.length + transitiveLocalPackageDependents.length - // There are two entries per circular dep @@ -855,7 +865,10 @@ To fix this you will either need to add a package.json file at that location, or }); } - if (updateDependents === 'auto') { + if ( + updateDependents === 'auto' && + options.releaseGroup.projectsRelationship === 'independent' + ) { for (const dependentProject of dependentProjectsOutsideCurrentBatch) { if ( options.specifierSource === 'version-plans' &&