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

Dependent bumps are missing from changelog with workspace: versions #981

Open
ecraig12345 opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@ecraig12345
Copy link
Member

ecraig12345 commented Sep 6, 2024

If dependencies within the repo are specified as workspace:*, workspace:^, or workspace:~, this causes dependent bumps to be missed from the changelog (only) because the version range doesn't change.

(The actual package versions are still bumped by updateRelatedChangeType, and the workspace: dependencies will be replaced with the current versions during publishing; the Bump X to Y entries are just missing from the changelog.)

BumpInfo.dependentChangedBy is the property that's used to generate the Bump X to Y entries. It's generated here:

const bumpedVersionRange = bumpMinSemverRange(packageInfo.version, existingVersionRange);
if (existingVersionRange !== bumpedVersionRange) {
deps[dep] = bumpedVersionRange;
dependentChangedBy[pkgName] ??= new Set<string>();
dependentChangedBy[pkgName].add(dep);

This is the bumping logic for workspace:*/^/~ ranges in dependencies. Since the string never changes, the dependent bump won't be included in dependentChangedBy above.

if (['workspace:*', 'workspace:~', 'workspace:^'].includes(semverRange)) {
// For basic workspace ranges we can just preserve current value and replace during publish
// https://pnpm.io/workspaces#workspace-protocol-workspace
return semverRange;
}

Possibly this could be fixed by passing modifiedPackages through to setDependentVersions and adding an extra condition to the check in setDependentVersions (for deps with those workspace versions).

bumpInfo.dependentChangedBy = setDependentVersions(packageInfos, scopedPackages, options);
Object.keys(bumpInfo.dependentChangedBy).forEach(pkg => modifiedPackages.add(pkg));

@ecraig12345 ecraig12345 changed the title Dependent bumps are missed with workspace: versions Dependent bumps are missing from changelog with workspace: versions Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant