-
Notifications
You must be signed in to change notification settings - Fork 36
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
Multi-semantic-release changes the "workspace:^" while versioning #85
Comments
Thanks for the report. Here's how semrel npm plugin updates package version: module.exports = async (npmrc, {tarballDir, pkgRoot}, {cwd, env, stdout, stderr, nextRelease: {version}, logger}) => {
const basePath = pkgRoot ? path.resolve(cwd, pkgRoot) : cwd;
logger.log('Write version %s to package.json in %s', version, basePath);
const versionResult = execa(
'npm',
['version', version, '--userconfig', npmrc, '--no-git-tag-version', '--allow-same-version'],
{
cwd: basePath,
env,
}
); And here's the place, where msr can just override package.json.version value: const prepare = async (pluginOptions, context) => {
// Wait until the current pkg is ready to be tagged
getLucky("_readyForTagging", pkg);
await waitFor("_readyForTagging", pkg);
updateManifestDeps(pkg);
pkg._depsUpdated = true;
const res = await plugins.prepare(context);
pkg._prepared = true;
debug("prepared: %s", pkg.name);
return res;
}; But it may affect other plugins |
@antongolub Thank you ! |
While using PNPM workspace in monorepo, dependencies could be:
"somePkg" : "workspace:^"
However, semantic release will change it to 1.0.x when writing version back to package.json.
Expect Behavior:
Remain original string: "workspace:^", otherwise, pnpm install will resuilt in wrong module structure.
The text was updated successfully, but these errors were encountered: