Enforcing Modularity in Rails Apps with Packwerk - Shopify
Sep 23, 2020

Summary
This post introduces Packwerk, a new open-source tool for enforcing code boundaries in Rails applications. It details the problem of low cohesion and high coupling in large Rails monoliths, explores existing boundary enforcement solutions (private_constant, gems, tests, Modulation), and explains why a custom solution was necessary. Packwerk enforces dependency and privacy violations by analyzing constant references between packages.
More from the Code Modularity and Boundary Enforcement trail
- A Packwerk Retrospective - Shopify
- Focus On Behavior, Not State, for a More Maintainable Codebase - Shopify
- Building a Business System Integration and Automation Platform at Shopify - Shopify
- Shopify-Made Patterns in Our Rails Apps - Shopify
- Remove Circular Dependencies by Using Dependency Injection and the Repository Pattern in Ruby - Shopify