nusje2000/composer-monolith
Composer 安装命令:
composer require nusje2000/composer-monolith
包简介
Provides commands to validate dependencies within a monolithic repository structure
README 文档
README
Installation
Using composer:
composer require nusje2000/composer-monolith --dev
Validation rules
IncompatibleVersionRule
This rule checks the version constraint of dependencies in subpackages and compares them with the version constraint on that same dependency in the root composer.json file. Example:
- Sub-package
foo/foo-packagehas a dependency onbar/bar-package ^1.0 - Root composer.json defines a dependency on
bar/bar-package ^2.0 - Rule will trigger because version
^1.0is not compatible with version^2.0
MissingDependencyRule
This rule will check if the dependencies of sub-packages are all present in the root composer definition.
MissingReplaceRule
This rule will check if all the sub-packages are defined as replaced in the root composer definition. See: https://getcomposer.org/doc/04-schema.md#replace.
Commands
Validating project structure
Within the root of your project you can use vendor/bin/composer-monolith validate
to validate the project structure.
Autofixing
When running vendor/bin/composer-monolith validate you can add the
--autofix option and then the validator will try to fix the
problems outputed by the validator.
Version equalizer
When in a monolithic repository it might come in helpfull to equalize
the version of a dependency across all sub packages. To do this, you
can use vendor/bin/composer-monolith equalize. This can only be used
on dependencies with inconsistent versions.
Version updater
To update a dependency you can use
vendor/bin/composer-monolith update <dependency_name> <version_constraint>.
This will make sure the version constraints in all sub- and rootpackages
match the provided version_constraint. This will not actually update the
package using composer, this must still be done manually.
CODEOWNERS file
In large monolithic repositories, the maintainability can be difficult. Using a CODEOWNERS file can let
you VCS make sure that the correct team members must approve things like PR's before it gets merged. There
is a command that lets you generate and validate a CODEOWNERS file so you don't have to maintain this.
This command reads the authors from different internal packages and puts them in a central CODEOWNERS
file located in the root of you project. To generate a CODEOWNERS file, just run vendor/bin/composer-monolith codeowners:generate.
To make sure that the CODEOWNERS file is always up to date you could use the validate command in your CI system
to validate the CODEOWNERS file and to make sure no one is missing. To validate the CODEOWNERS file, just run
vendor/bin/composer-monolith codeowners:validate
nusje2000/composer-monolith 适用场景与选型建议
nusje2000/composer-monolith 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21.83k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 01 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nusje2000/composer-monolith 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nusje2000/composer-monolith 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-05