packwerk
1,928
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Ruby
语言
—
创建时间
最近更新
项目能做什么
Shopify 出品的代码解耦与模块化边界检查工具。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Packwerk [](https://github.com/Shopify/packwerk/actions?query=workflow%3ACI)
> "I know who you are and because of that I know what you do."
> This knowledge is a dependency that raises the cost of change.
-- _Sandi Metz, Practical Object-Oriented Design in Ruby_
Packwerk is a Ruby gem used to enforce boundaries and modularize Rails applications.
Packwerk can be used to:
* Combine groups of files into packages
* Define package-level constant visibility (i.e. have publicly accessible constants)
* Help existing codebases to become more modular without obstructing development
## Prerequisites
Packwerk needs [Zeitwerk](https://github.com/fxn/zeitwerk) enabled, which comes with Rails 6.
Packwerk supports MRI versions 2.7 and above.
## Demo
Watch a [1-minute video demo](https://www.youtube.com/watch?v=NwqlyBAxVpQ&feature=youtu.be) on how Packwerk works.
[](https://www.youtube.com/watch?v=NwqlyBAxVpQ&feature=youtu.be)
## Installation
1. Add this line to your application's Gemfile:
```ruby
gem 'packwerk'
```
2. Install the gem
Execute:
$ bundle install
Or install it yourself as:
$ gem install packwerk
2. Run `bundle binstub packwerk` to generate the binstub
3. Run `bin/packwerk init` to generate the configuration files
## Usage
Read [USAGE.md](USAGE.md) for usage once Packwerk is installed on your project.
## Pronunciation
"Packwerk" is pronounced [[ˈpakvɛʁk]](https://cdn.shopify.com/s/files/1/0258/7469/files/packwerk.mp3).
## Ecosystem
Various third parties have built tooling on top of packwerk. Here's a selection of some that might prove useful:
- https://github.com/bellroy/graphwerk draws a graph of your package dependencies
- https://github.com/rubyatscale/packwerk-vscode integrates packwerk into Visual Studio Code so you can see violations right in your editor
- https://github.com/vinted/packwerk-intellij integrates packwerk into RubyMine so you can see violations right in your editor
- https://github.com/rubyatscale/packs-rails sets up Rails autoloading, as well as `rspec` and `FactoryBot` integration, for packages arranged in a flat list. packs-rails is quite convenient, but for autoloading we recommend to use `Rails::Engine`s instead.
- https://github.com/rubyatscale/danger-packwerk integrates packwerk with [danger.systems](https://danger.systems) to provide packwerk feedback as Github inline PR comments
- https://github.com/rubyatscale/packwerk-extensions contains extensions for packwerk, including a checker for packwerk that allows you to enforce public API boundaries. This was originally extracted from `packwerk` itself.
- https://github.com/alexevanczuk/packs is a Rust implementation of packwerk that has experimental support for non-Rails, non-Zeitwerk applications.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can
阅读完整原文
项目深度分析 AI 生成
Rails 架构模块化与依赖治理 SaaS 平台
| 产品构想 | 基于 Packwerk 及其生态输出,提供开箱即用的 Web 界面,用于团队查看架构依赖图谱、跨包边界违规趋势、技术债燃尽图,并集成 GitHub PR 自动审查。 |
| 核心功能 | 依赖关系拓扑图交互展示、CI/CD 集成门禁、违规边界 PR 自动警告与归因、模块归属权(Code Owners)映射。 |
| 目标用户 | 大型 Rails 团队的技术总监、工程效率架构师。 |
| 难度/周期 | 中等 · 2-3 个月 · 成本:低(基础云服务器、GitHub App 托管) |
| 收费模式 | B2B SaaS 订阅制(按仓库数或活跃开发者席位收费) |
| 竞争风险 | 开源生态已有部分免费插件(如 graphwerk、danger-packwerk),需提供更深度的团队协作与治理分析价值。 |
| 依据 | 已验证事实(生态中已存在 graphwerk 和 danger-packwerk 工具,说明可视化和 PR 检查有明确需求) |
Rails 单体架构拆分与治理专家咨询服务
| 产品构想 | 为受困于巨石单体(Monolith)维护困难的企业提供 Packwerk 落地实操咨询、架构边界划分设计及违规消除外包服务。 |
| 核心功能 | 代码库静态依赖健康诊断报告、模块化演进路线规划、Packwerk 规则定制落地与团队培训、违规重构指引。 |
| 目标用户 | 拥有庞大历史 Rails 系统(通常千人天以上研发量)且缺乏重构经验的中大型企业。 |
| 难度/周期 | 高(依赖深厚的 Rails 与架构经验) · 按项目周期(通常每项目 2-6 周) · 成本:极低(主要为人力时间成本) |
| 收费模式 | 高客单价专家咨询费或项目制交付服务费 |
| 竞争风险 | 依赖个人专业背书与销售渠道,交付无法完全规模化复制。 |
| 依据 | AI推测(Shopify 研发该工具用于大型单体治理,此类重构在业界通常客单价高但难度极大) |
企业级架构规范门禁与智能解耦建议 CLI 增强工具
| 产品构想 | 开发针对 Packwerk 的商用扩展 CLI 插件,结合规则引擎或 AI 自动化提供“破坏边界代码的重构建议”及智能边界修复建议,提升开发者在本地修复违规的效率。 |
| 核心功能 | 一键自动生成公共 API 边界接口桩、基于静态分析的违规快速修复方案推荐、多仓库边界协同校验。 |
| 目标用户 | 日常在大型单体中开发业务的 Rails 软件工程师、工程效能团队。 |
| 难度/周期 | 中等 · 1-2 个月 · 成本:低 |
| 收费模式 | 企业级 CLI 商业 License 授权或团队席位收费 |
| 竞争风险 | 目标用户可能偏好开源社区原生生态或内部自研脚本,付费意愿需要验证。 |
| 依据 | 尚需验证的假设 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建时间待补全,最近推送 ,发布过 28 个 Release |
| 社区活跃 | Star 1,928 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。