Closed cesalberca closed 2 years ago
@cesalberca,
is your beta
branch based on the latest master? Here's how msr tries to resolve a tag:
const getNextPreVersion = (pkg, tags) => {
const tagFilters = [pkg._preRelease];
const lastVersion = pkg._lastRelease && pkg._lastRelease.version;
// Extract tags:
// 1. Set filter to extract only package tags
// 2. Get tags from a branch considering the filters established
// 3. Resolve the versions from the tags
// TODO: replace {cwd: '.'} with multiContext.cwd
if (pkg.name) tagFilters.push(pkg.name);
if (!tags || !tags.length) {
tags = getTags(pkg._branch, { cwd: "." }, tagFilters);
}
const lastPreRelTag = getPreReleaseTag(lastVersion);
const isNewPreRelTag = lastPreRelTag && lastPreRelTag !== pkg._preRelease;
const versionToSet =
isNewPreRelTag || !lastVersion
? `1.0.0-${pkg._preRelease}.1`
: _nextPreVersionCases(
tags.map((tag) => getVersionFromTag(pkg, tag)).filter((tag) => tag),
lastVersion,
pkg._nextType,
pkg._preRelease
);
return versionToSet;
};
@cesalberca
semantic-release
does the same thing: they also fetched tags only on the specific branch.
Sorry for the late reply, we fixed it in the end by manually removing one of the tags, now we fully moved from Lerna 😊
https://github.com/archimedes-projects/archimedes-js/tree/7150e1d2f3bfe4257cada110f80c0541d3dd859b
We are currently migrating a monorepo from Lerna + Yarn + Rollup to Parcel + NPM + Multi Semantic Release and we have previously published up until version 1.5.0. We now want to publish the 2.0.0 beta version with the new system, however MSR always resolves to version 1.0.0-beta.X. How could we specify we want to start from version 2.0.0?
The configuration is as follows:
And the CLI command is the following:
We've tried tagging manually the following tags:
But it still resolves the 1.0.0 beta version.
You can access the whole project here: https://github.com/archimedes-projects/archimedes-js/tree/beta