Skip to content

Commit

Permalink
fix(analyze): follow dependency's release type for depndents
Browse files Browse the repository at this point in the history
fixes #10
  • Loading branch information
balazsorban44 committed Dec 14, 2023
1 parent 586f10b commit ffd50ce
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/monorepo-release/src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,22 @@ export async function analyze(config: Config): Promise<PackageToRelease[]> {
)

const { dependents } = grouppedPackages[pkgName]

// Dependent versioning follows the same release type as the dependency,
// except for dependents, we should always bump the major version
// if there are breaking changes in the dependency, regardless if the
// dependency's current version is 0.x.x or 1.x.x
const dependentReleaseType: semver.ReleaseType = pkg.breaking.length
? "major" // 1.x.x
: pkg.features.length
? "minor" // x.1.x
: "patch" // x.x.1

for (const dependent of dependents)
addToPackagesToRelease(
packageList,
dependent,
"patch",
dependentReleaseType,
packagesToRelease,
{
features: [],
Expand Down

0 comments on commit ffd50ce

Please sign in to comment.