diff --git a/README.md b/README.md index 0718b63..bc7b866 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # QueryPackwerk -QueryPackwerk is a Ruby gem for querying and analyzing Packwerk violations in Ruby applications. -It provides a friendly API for exploring package.yml and package_todo.yml files, making it easier to manage module boundaries and dependencies in your codebase. +QueryPackwerk is a Ruby gem for querying and analyzing [Packwerk](https://github.com/Shopify/packwerk) violations in Ruby applications. +It provides a friendly API for exploring `package.yml` and `package_todo.yml` files, making it easier to manage module boundaries and dependencies in your codebase. ## Installation -This gem provides a cli interface that can be used independently from your application. +This gem provides a CLI interface that can be used independently from your application. ```bash gem install query_packwerk @@ -21,19 +21,32 @@ bundle add query_packwerk --group=development ### Console Interface -The easiest way to use QueryPackwerk is through its interactive console: +The easiest way to use QueryPackwerk is through its interactive console. This will use the local directory Packwerk context and provide you with all QueryPackwerk methods. ```bash query_packwerk console ``` -When the console loads, it will print a welcome message. You can access it any time with `help`: +The CLI includes a welcome message with a list of commands. You can access it any time with `welcome`: ``` -query_packwerk:001:0> help +query_packwerk:001:0> welcome ``` -The console will use the local directory Packwerk context and provide you with all QueryPackwerk methods. +Find packages to work with: + +```ruby +# Get a package +query_packwerk:001:0> package("pack_name") + +# Get all packages +query_packwerk:001:0> Packages.all + +# Find a package +query_packwerk:001:0> Packages.where(name: /service/) +``` + +Explore violations: ```ruby # Get all violations for a pack @@ -54,28 +67,21 @@ query_packwerk:001:0> anonymous_violation_counts_for("pack_name") # Get who consumes this pack query_packwerk:001:0> consumers("pack_name") -# Get a package -query_packwerk:001:0> package("pack_name") - -# Get all packages -query_packwerk:001:0> Packages.all - -# Find a package -query_packwerk:001:0> Packages.where(name: /service/) - # Get all violations query_packwerk:001:0> Violations.all -# Find violations -query_packwerk:001:0> Packages.where(constant_name: /Feature/, producing_pack: /service/) +``` + +If you change any of the package.yml or package_todo.yml files, you can reload the running console: +```ruby # Reset the cache query_packwerk:001:0> reload! ``` ### Ruby API -You can also use QueryPackwerk programmatically in your Ruby code: +QueryPackwerk can also be used programmatically from Ruby: ```ruby require 'query_packwerk' diff --git a/query_packwerk.gemspec b/query_packwerk.gemspec index 329c878..a97d4e4 100644 --- a/query_packwerk.gemspec +++ b/query_packwerk.gemspec @@ -10,15 +10,15 @@ Gem::Specification.new do |spec| spec.summary = 'Query Packwerk' spec.description = 'Query Packwerk violations and dependencies.' - spec.homepage = 'https://github.com/gusto/query_packwerk' + spec.homepage = 'https://github.com/rubyatscale/query_packwerk' spec.license = 'MIT' spec.required_ruby_version = '>= 3.1.0' spec.metadata['allowed_push_host'] = 'https://rubygems.org' spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = 'https://github.com/gusto/query_packwerk' - spec.metadata['changelog_uri'] = 'https://github.com/gusto/query_packwerk/blob/main/CHANGELOG.md' + spec.metadata['source_code_uri'] = 'https://github.com/rubyatscale/query_packwerk' + spec.metadata['changelog_uri'] = 'https://github.com/rubyatscale/query_packwerk/blob/main/CHANGELOG.md' # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. diff --git a/sig/query_packwerk.rbs b/sig/query_packwerk.rbs deleted file mode 100644 index d1aa1ec..0000000 --- a/sig/query_packwerk.rbs +++ /dev/null @@ -1,4 +0,0 @@ -module QueryPackwerk - VERSION: String - # See the writing guide of rbs: https://github.com/ruby/rbs#guides -end