From 595669cb886f5aeef22acceff5327693fceff6bd Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:06:42 -0400 Subject: [PATCH 01/10] link to packwerk --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0718b63..f193675 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # QueryPackwerk -QueryPackwerk is a Ruby gem for querying and analyzing Packwerk violations in Ruby applications. +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 From 73a1cff66f8ceb3d4457abd5004b624f1f3445bd Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:07:21 -0400 Subject: [PATCH 02/10] make filenames into preformatted text --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f193675..6ef4b1e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # QueryPackwerk 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. +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 From 7d941c6264b301f1d3e46e2e8b89a870b363e11a Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:21:03 -0400 Subject: [PATCH 03/10] Move query methods up front --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6ef4b1e..48d69aa 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It provides a friendly API for exploring `package.yml` and `package_todo.yml` fi ## 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 @@ -35,7 +35,19 @@ query_packwerk:001:0> help The console will use the local directory Packwerk context and provide you with all QueryPackwerk methods. +The console can help you find a package to query: + + ```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/) + # Get all violations for a pack query_packwerk:001:0> violations_for("pack_name") @@ -54,21 +66,9 @@ 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/) - # Reset the cache query_packwerk:001:0> reload! ``` From 67f3cd8fefbde9f9839fb47d74e506fc6f824f4f Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:21:57 -0400 Subject: [PATCH 04/10] Consolidate the way to use it, and how it loads local context --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 48d69aa..b0a4ee2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ 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 @@ -33,11 +33,6 @@ When the console loads, it will print a welcome message. You can access it any t query_packwerk:001:0> help ``` -The console will use the local directory Packwerk context and provide you with all QueryPackwerk methods. - -The console can help you find a package to query: - - ```ruby # Get a package query_packwerk:001:0> package("pack_name") From 2d579473a95c2ceccbb37188650a9cd72a1964e3 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:24:48 -0400 Subject: [PATCH 05/10] Break out commands to 3 sections --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0a4ee2..a2f57dd 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,14 @@ The easiest way to use QueryPackwerk is through its interactive console. This wi 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 `help`: ``` query_packwerk:001:0> help ``` +Find packages to work with: + ```ruby # Get a package query_packwerk:001:0> package("pack_name") @@ -42,7 +44,11 @@ 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 query_packwerk:001:0> violations_for("pack_name") @@ -64,6 +70,11 @@ query_packwerk:001:0> consumers("pack_name") # Get all violations query_packwerk:001:0> Violations.all +``` + +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! ``` From 866abbe62aac42f8f82ef53f328728d8e982bc67 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:25:59 -0400 Subject: [PATCH 06/10] sentence structure --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2f57dd..7c14074 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ 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' From 37d28745405be633bb010f2b153ce01195acd54e Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:30:45 -0400 Subject: [PATCH 07/10] Fix github urls --- query_packwerk.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. From 64c25be6af1a215f6cdd853bab097fbbb31a39ff Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:32:01 -0400 Subject: [PATCH 08/10] remove rbs if we aren't using it --- sig/query_packwerk.rbs | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 sig/query_packwerk.rbs 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 From 709a907a5d08d5233fce45c9ee0653141f0c5e79 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 09:52:35 -0400 Subject: [PATCH 09/10] Fix reference to welcome --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c14074..5fec73b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The easiest way to use QueryPackwerk is through its interactive console. This wi query_packwerk console ``` -The CLI includes a welcome message with a list of commands. 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 From a88a0701d336ca3ed346e54dee8905a888dafea1 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Mon, 7 Apr 2025 10:15:01 -0400 Subject: [PATCH 10/10] another help reference --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5fec73b..bc7b866 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ query_packwerk console 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 ``` Find packages to work with: