It might not be a good idea. Semantic versioning is, well, semantic, and using libraries as a development pattern might pollute your library releases and cause additional versioning and specification problems in the future.
There is, in my opinion, one point to consider:
- Does each library have its own individual logic, with no interaction between other libraries?
- OR does one logic affect all libraries, and can you preserve a meaningful and consistent versioning between these libraries?
If not, you will likely mess up versioning.
If libraries are not independent: for example if a business logic affects both lib-a@1.1.0 and lib-b@1.3.0, it will be incredibly tedious to document the CHANGELOG. If a bug is present and discovered only after a couple of versions, or a force revert is required, it will be extremely error-prone to revert and/or cherry-pick each library to the exact required version.
This is why libraries that are dependent on another (@typescript-eslint/parser
and @typescript-eslint/eslint-plugin
, rxjs
and rxjs-compat
) strictly requires you to use the exact same version number for each library - for example, you will have to install rxjs@6.3.3
and rxjs-compat@6.3.3
in the same project. You cannot safely use rxjs@6.2.3
and rxjs-compat@6.3.3
together. You are also recommended to install the same version numbers of core Angular framework libraries.
However, consistent versioning will likely can only be applied if each library is (most of the time) affected by the same business logic change. It will be meaningless to force consistent versioning even though no relevant changes have taken place.
My opinion
- If you are able to preserve a meaningful and consistent versioning system and install the same version number consistently for each library
OR
- If each library will have its own strictly individual logic with no interaction with other libraries
Then sure, try it.
Consistency, or independency. Take your pick.
Otherwise, just use git flow or trunk-based development, with strict code review and pre/post-commit lint checking and testing. Just my opinion.