auto
auto copied to clipboard
versionBranches throws when version is set to "independent" in lerna.json
Describe the bug
When versionBranches
has a value in .autorc
and "version"
is set to "independent"
in lerna.json
, the version produced here is an empty string (from this ternary), causing SemVer to throw TypeError: Invalid Version:
.
To Reproduce
- Set
versionBranches
to any string value in yourautorc
. - Set
"version": "independent"
in yourlerna.json
. - Run
auto shipit
in ci by merging a PR with themajor
version label to thebaseBranch
.
Expected behavior
shipit
is successful and a branch is created to version the major release.
Screenshots
.autorc
# only publish/release if a PR has the 'release' label
onlyPublishWithReleaseLabel: true
# when a major version is released, a branch prefixed 'release/' will be created and the release tag created from it
versionBranches: 'release/'
lerna.json
{
"packages": ["core", "hotkeys", "ui", "timestamps"],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": "true"
}
Stack Trace:
info Using monorepo to calculate previous release
ℹ info NPM: Got previous version from package.json
ℹ info Adding new changes to changelog.
ℹ info Old changelog exists, prepending changes.
ℹ info Wrote new changelog to filesystem.
ℹ info Using monorepo to calculate previous release
ℹ info NPM: Got previous version from package.json
TypeError: Invalid Version:
at new SemVer (/home/runner/work/frost-packages/frost-packages/node_modules/@auto-it/core/node_modules/semver/classes/semver.js:38:13)
at Object.major (/home/runner/work/frost-packages/frost-packages/node_modules/@auto-it/core/node_modules/semver/functions/major.js:2:29)
at /home/runner/work/frost-packages/frost-packages/node_modules/@auto-it/core/src/auto.ts:464:59
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Additional context
As I linked in the description, this ternary seems very suspicious. Why does it produces the package list on new lines in dryrun
and an empty string otherwise?
I am running into this bug as well! Is there a temporary workaround?
did anybody figure this out? any workarounds? @Domitnator, @jonathantredway, mom, God...? Anybody?
Version branches might get kinda hectic with independent mode. Currently this is not supported and I don't think I have the time to dig into it