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

{projectName} interpolation by Nx causes wrong dependencies versions in changelogs #790

Open
jsulpis opened this issue Mar 14, 2024 · 0 comments

Comments

@jsulpis
Copy link

jsulpis commented Mar 14, 2024

Hi,
I could not reopen #725 but I think the issue is still there, because this interpolation causes wrong dependencies versions in the changelogs:

when setting "tagPrefix": "{projectName}@" in the config file, the versionTagPrefix that comes as argument of the version function is already interpolated as the project name:

versionTagPrefix: options.tagPrefix,

So all the calls to formatTagPrefix do nothing because the {projectName} has already been interpolated. In particular when searching for the latest version of the dependencies, since the tagPrefix is the one of the parent and not the dependency (as it should be), all dependencies versions get resolved to the one of the parent :

/* Get dependency version changes since last project version */
const tagPrefix = formatTagPrefix({
versionTagPrefix,
projectName: dependencyName,
syncVersions,
});
const { lastVersion$, commits$ } = getProjectVersion({
tagPrefix,
projectRoot,
releaseType,
since: lastVersionGitRef,
projectName,
preid,
});

This causes wrong versions in the changelog: {dependency} updated to version {latest version of parent}.

The easy workaround is to not override the tagPrefix in the config.
I guess the fix might not be trivial, if not breaking, but I think at least mentioning the issue in the docs would prevent a few headaches. Thanks !

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