软件包主要版本更改是否意味着子软件包主要版本更改? [英] Should a package major version change mean a sub-package major version change?

查看:100
本文介绍了软件包主要版本更改是否意味着子软件包主要版本更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个核心CMS,它已从 v4.8.7 升级到 v5.0.0

Let's say I have a core CMS which has been upgraded from v4.8.7 to v5.0.0

我还有一个事件模块程序包,它的版本号是 1.2.4 ,它在 composer.json 文件:

I also have an events module package with it's own version number 1.2.4 which imports this core CMS package in it's composer.json file:

    "company-name/cms": "^4.3",

我将此软件包上的composer.json文件升级为:

I upgrade the composer.json file on this package to become:

    "company-name/cms": "^5.0",

但是我该如何用语义版本控制来标记此更改?

But how do I mark this change with semantic versioning?

应将其标记为重大更改,从而表示子模块版本号将变为 2.0.0 还是应将其标记为次要/补丁?

Should it be marked as a breaking change and thus mean the submodule version number would become 2.0.0 or should it be marked as a minor/patch?

我是认为需要将其标记为重大更改,否则在使用该软件包的项目上运行 composer update 可能会导致错误,如果父软件包已过期但只是想集会

I'm thinking it would need to be marked as a major change otherwise running composer update on projects that use the package may cause an error if the parent package is out of date but just wanted to gather opinions.

推荐答案

来自纯从SemVer 角度来看,这确实取决于工具链的功能和约定以及打破传递性依赖项中的更改的类型。

From a purely SemVer perspective, this is really dependent on tool chain capabilities and conventions, as well as the kind(s) of breaking changes in your transitive dependencies.

有些如果,工具链将阻止包含中断传递依赖项的不中断更新,发出警告,并且不会中断客户的获取和构建过程。他们可以跳过不间断的更新来完成构建的依赖关系图。其他人将抛出错误,并阻止构建完成。

Some tool chains will block a non-breaking update that contains breaking transitive dependencies, issue a warning, and not break your customers ingestion and build processes, if; they can complete the build's dependency graph, by skipping the non-breaking update. Others will throw an error, and prevent the build from completing.

构建中断并不是唯一的传递依赖项。如果引入传递性行为(该行为会修改组件的有效功能),以致客户代码在运行时会中断,则会造成痛苦。当然,对于防止这种更新发生的工具链来说,不必担心。

Build breaks aren't the only transitive dependency issue however. You will cause pain if you introduce a transitive behavior, that modifies the effective functionality of your component, to the extent that your customers code will break when it runs. This of course would not be a concern with a tool chain that prevents such an update from taking place.

将自己放在客户的鞋子中,考虑一下他们可能使用的工具链用于摄取您的包裹。您愿意给他们带来多少痛苦?

Put yourself in your customer's shoes and think about the tool chains they might be using to ingest your package. How much pain are you willing to inflict on them?

这篇关于软件包主要版本更改是否意味着子软件包主要版本更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆