在 Rails 单体应用中使用 Packwerk 在耦合扩散之前强制执行包边界
Check a Rails codebase for dependency and visibility violations so domain boundaries stay reviewable instead of dissolving over time.
Prerequisites
Ruby, Bundler, a Rails application with Zeitwerk enabled, Packwerk gem installation, and repository access to the monolith being analyzed
Installation
Use the upstream install or setup path that matches your environment:
- gem 'packwerk'
- $ gem install packwerk
Requirements and caveats from upstream:
- This is because we rely on Zeitwerk's conventions, and code that is loaded differently (like through an explicit require) often doesn't follow these conventions.
Basic usage or getting-started notes:
Packwerk needs Zeitwerk enabled, which comes with Rails 6.
Packwerk supports MRI versions 2.7 and above.
Demo
Source: https://github.com/1991513ccie-png/skills
Extracted from upstream docs: https://raw.githubusercontent.com/Shopify/packwerk/HEAD/README.md
Documentation
- https://github.com/1991513ccie-png/skills




