From c92981941c2207eca4eff779d84ab2fdf4226678 Mon Sep 17 00:00:00 2001 From: Alex Evanczuk Date: Fri, 9 Dec 2022 14:59:51 -0500 Subject: [PATCH] Rename UsePackwerk to UsePacks (#62) * Rename UsePackwerk to UsePacks * Version reset * Change name --- CHANGELOG.md | 2 +- Gemfile | 2 +- Gemfile.lock | 12 +- README.md | 18 +- advanced_usage.md | 4 +- bin/packs | 6 +- lib/{use_packwerk.rb => use_packs.rb} | 38 +-- lib/{use_packwerk => use_packs}/cli.rb | 26 +- .../code_ownership_post_processor.rb | 4 +- .../configuration.rb | 6 +- .../default_user_event_logger.rb | 2 +- lib/{use_packwerk => use_packs}/logging.rb | 2 +- .../per_file_processor_interface.rb | 2 +- lib/{use_packwerk => use_packs}/private.rb | 38 +-- .../private/file_move_operation.rb | 2 +- lib/use_packs/private/interactive_cli.rb | 52 ++++ .../private/interactive_cli/pack_selector.rb | 2 +- .../private/interactive_cli/team_selector.rb | 2 +- .../use_cases/add_dependency.rb | 4 +- .../interactive_cli/use_cases/check.rb | 2 +- .../interactive_cli/use_cases/create.rb | 4 +- .../interactive_cli/use_cases/get_info.rb | 2 +- .../interactive_cli/use_cases/interface.rb | 2 +- .../use_cases/lint_package_yml.rb | 4 +- .../interactive_cli/use_cases/make_public.rb | 6 +- .../private/interactive_cli/use_cases/move.rb | 6 +- .../private/interactive_cli/use_cases/nest.rb | 6 +- .../interactive_cli/use_cases/query.rb | 6 +- .../use_cases/regenerate_rubocop_todo.rb | 2 +- .../interactive_cli/use_cases/rename.rb | 2 +- .../use_cases/update_deprecations.rb | 2 +- .../interactive_cli/use_cases/validate.rb | 2 +- .../interactive_cli/use_cases/visualize.rb | 2 +- .../private/pack_relationship_analyzer.rb | 6 +- .../private/packwerk_wrapper.rb | 4 +- .../offenses_aggregator_formatter.rb | 2 +- .../rubocop_post_processor.rb | 4 +- .../spring_command.rb | 4 +- .../user_event_logger.rb | 6 +- lib/use_packwerk/private/interactive_cli.rb | 52 ---- spec/spec_helper.rb | 2 +- .../private/interactive_cli_spec.rb | 14 +- ...use_packwerk_spec.rb => use_packs_spec.rb} | 240 +++++++++--------- use_packwerk.gemspec => use_packs.gemspec | 14 +- 44 files changed, 310 insertions(+), 310 deletions(-) rename lib/{use_packwerk.rb => use_packs.rb} (87%) rename lib/{use_packwerk => use_packs}/cli.rb (84%) rename lib/{use_packwerk => use_packs}/code_ownership_post_processor.rb (97%) rename lib/{use_packwerk => use_packs}/configuration.rb (92%) rename lib/{use_packwerk => use_packs}/default_user_event_logger.rb (81%) rename lib/{use_packwerk => use_packs}/logging.rb (97%) rename lib/{use_packwerk => use_packs}/per_file_processor_interface.rb (95%) rename lib/{use_packwerk => use_packs}/private.rb (91%) rename lib/{use_packwerk => use_packs}/private/file_move_operation.rb (99%) create mode 100644 lib/use_packs/private/interactive_cli.rb rename lib/{use_packwerk => use_packs}/private/interactive_cli/pack_selector.rb (98%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/team_selector.rb (98%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/add_dependency.rb (93%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/check.rb (96%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/create.rb (86%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/get_info.rb (99%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/interface.rb (97%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/lint_package_yml.rb (89%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/make_public.rb (83%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/move.rb (84%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/nest.rb (81%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/query.rb (92%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb (97%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/rename.rb (98%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/update_deprecations.rb (96%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/validate.rb (96%) rename lib/{use_packwerk => use_packs}/private/interactive_cli/use_cases/visualize.rb (98%) rename lib/{use_packwerk => use_packs}/private/pack_relationship_analyzer.rb (95%) rename lib/{use_packwerk => use_packs}/private/packwerk_wrapper.rb (96%) rename lib/{use_packwerk => use_packs}/private/packwerk_wrapper/offenses_aggregator_formatter.rb (98%) rename lib/{use_packwerk => use_packs}/rubocop_post_processor.rb (98%) rename lib/{use_packwerk => use_packs}/spring_command.rb (92%) rename lib/{use_packwerk => use_packs}/user_event_logger.rb (98%) delete mode 100644 lib/use_packwerk/private/interactive_cli.rb rename spec/{use_packwerk => use_packs}/private/interactive_cli_spec.rb (83%) rename spec/{use_packwerk_spec.rb => use_packs_spec.rb} (90%) rename use_packwerk.gemspec => use_packs.gemspec (81%) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb5ff20..071626e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -See https://github.com/rubyatscale/use_packwerk/releases +See https://github.com/rubyatscale/use_packs/releases diff --git a/Gemfile b/Gemfile index 817a0e2..eac0dee 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in use_packwerk.gemspec +# Specify your gem's dependencies in use_packs.gemspec gemspec diff --git a/Gemfile.lock b/Gemfile.lock index e1cff02..932429b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - use_packwerk (0.70.0) + use_packs (0.0.1) code_ownership colorize packwerk (>= 2.2.1) @@ -36,7 +36,7 @@ GEM smart_properties builder (3.2.4) byebug (11.1.3) - code_ownership (1.29.0) + code_ownership (1.29.1) code_teams (~> 1.0) parse_packwerk sorbet-runtime @@ -58,7 +58,7 @@ GEM method_source (1.0.0) mini_portile2 (2.8.0) minitest (5.16.3) - nokogiri (1.13.9) + nokogiri (1.13.10) mini_portile2 (~> 2.8.0) racc (~> 1.4) packwerk (2.2.2) @@ -84,7 +84,7 @@ GEM pry-byebug (3.9.0) byebug (~> 11.0) pry (~> 0.13.0) - racc (1.6.0) + racc (1.6.1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) @@ -124,7 +124,7 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.21.0) parser (>= 3.1.1.0) - rubocop-packs (0.0.29) + rubocop-packs (0.0.30) activesupport parse_packwerk rubocop @@ -209,7 +209,7 @@ DEPENDENCIES sorbet sorbet-static tapioca - use_packwerk! + use_packs! BUNDLED WITH 2.2.29 diff --git a/README.md b/README.md index 2254313..5af1b2c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# UsePackwerk +# UsePacks -UsePackwerk is a gem that helps in creating and maintaining packs. It exists to help perform some basic operations needed for pack setup and configuration. It provides a basic ruby file packager utility for [`packwerk`](https://github.com/Shopify/packwerk/). It assumes you are using [`stimpack`](https://github.com/rubyatscale/stimpack) to organize your packages. +UsePacks is a gem that helps in creating and maintaining packs. It exists to help perform some basic operations needed for pack setup and configuration. It provides a basic ruby file packager utility for [`packwerk`](https://github.com/Shopify/packwerk/). It assumes you are using [`stimpack`](https://github.com/rubyatscale/stimpack) to organize your packages. ## Usage ### General Help @@ -45,8 +45,8 @@ This can be used to quickly modify a `package.yml` file and add a dependency. It ### Setting up Spring -[Spring](https://github.com/rails/spring) is a preloader for Rails. Although `use_packwerk` itself does not use `Rails`, this can help speed up running commands like `bin/packs` by caching the bundle. -Firstly, spring needs to know about the `bin/packs` command when spring is loading. To do that, add `require 'use_packwerk/spring_command'` to `config/spring.rb` in your application. +[Spring](https://github.com/rails/spring) is a preloader for Rails. Although `use_packs` itself does not use `Rails`, this can help speed up running commands like `bin/packs` by caching the bundle. +Firstly, spring needs to know about the `bin/packs` command when spring is loading. To do that, add `require 'use_packs/spring_command'` to `config/spring.rb` in your application. Secondly, to enable Spring, first run `bin/spring binstub packs` which will "springify" the generated binstub. ### Releasing @@ -56,16 +56,16 @@ Releases happen automatically through github actions once a version update is co To keep things organized, here are some recommended homes: ### Issues: -https://github.com/Gusto/use_packwerk/issues +https://github.com/Gusto/use_packs/issues ### Questions: -https://github.com/Gusto/use_packwerk/discussions/categories/q-a +https://github.com/Gusto/use_packs/discussions/categories/q-a ### General discussions: -https://github.com/Gusto/use_packwerk/discussions/categories/general +https://github.com/Gusto/use_packs/discussions/categories/general ### Ideas, new features, requests for change: -https://github.com/Gusto/use_packwerk/discussions/categories/ideas +https://github.com/Gusto/use_packs/discussions/categories/ideas ### Showcasing your work: -https://github.com/Gusto/use_packwerk/discussions/categories/show-and-tell +https://github.com/Gusto/use_packs/discussions/categories/show-and-tell diff --git a/advanced_usage.md b/advanced_usage.md index f81cbb1..7840bcb 100644 --- a/advanced_usage.md +++ b/advanced_usage.md @@ -2,7 +2,7 @@ ## Pack Maintenance ### Setting Privacy ```ruby -UsePackwerk.create_pack!( +UsePacks.create_pack!( # This determines whether your package.yml in your new package will enforce privacy. See packwerk documentation for more details on this attribute. # This is an optional parameter (default is true). See https://github.com/Gusto/packs/discussions/19 enforce_privacy: false, @@ -11,7 +11,7 @@ UsePackwerk.create_pack!( ``` ### Per-file Processors -Your application may have specific needs when moving files. `UsePackwerk` gives a way to inject application-specific behavior into the file move process. +Your application may have specific needs when moving files. `UsePacks` gives a way to inject application-specific behavior into the file move process. You can pass in an array of application specific behavior into the `per_file_processors` parameter of the main method. diff --git a/bin/packs b/bin/packs index d8f52a8..7efcc5c 100755 --- a/bin/packs +++ b/bin/packs @@ -1,10 +1,10 @@ #!/usr/bin/env ruby # typed: strict -require_relative '../lib/use_packwerk' +require_relative '../lib/use_packs' if ARGV.empty? - UsePackwerk.start_interactive_mode! + UsePacks.start_interactive_mode! else - UsePackwerk::CLI.start(ARGV) + UsePacks::CLI.start(ARGV) end diff --git a/lib/use_packwerk.rb b/lib/use_packs.rb similarity index 87% rename from lib/use_packwerk.rb rename to lib/use_packs.rb index 5748927..0b31226 100644 --- a/lib/use_packwerk.rb +++ b/lib/use_packs.rb @@ -13,15 +13,15 @@ require 'rubocop-packs' # Private implementation requires -require 'use_packwerk/private' -require 'use_packwerk/per_file_processor_interface' -require 'use_packwerk/rubocop_post_processor' -require 'use_packwerk/code_ownership_post_processor' -require 'use_packwerk/logging' -require 'use_packwerk/configuration' -require 'use_packwerk/cli' - -module UsePackwerk +require 'use_packs/private' +require 'use_packs/per_file_processor_interface' +require 'use_packs/rubocop_post_processor' +require 'use_packs/code_ownership_post_processor' +require 'use_packs/logging' +require 'use_packs/configuration' +require 'use_packs/cli' + +module UsePacks extend T::Sig PERMITTED_PACK_LOCATIONS = T.let(%w[ @@ -70,7 +70,7 @@ def self.move_to_pack!( per_file_processors: [] ) Logging.section('👋 Hi!') do - intro = UsePackwerk.config.user_event_logger.before_move_to_pack(pack_name) + intro = UsePacks.config.user_event_logger.before_move_to_pack(pack_name) Logging.print_bold_green(intro) end @@ -81,7 +81,7 @@ def self.move_to_pack!( ) Logging.section('Next steps') do - next_steps = UsePackwerk.config.user_event_logger.after_move_to_pack(pack_name) + next_steps = UsePacks.config.user_event_logger.after_move_to_pack(pack_name) Logging.print_bold_green(next_steps) end end @@ -97,7 +97,7 @@ def self.make_public!( per_file_processors: [] ) Logging.section('Making files public') do - intro = UsePackwerk.config.user_event_logger.before_make_public + intro = UsePacks.config.user_event_logger.before_make_public Logging.print_bold_green(intro) end @@ -107,7 +107,7 @@ def self.make_public!( ) Logging.section('Next steps') do - next_steps = UsePackwerk.config.user_event_logger.after_make_public + next_steps = UsePacks.config.user_event_logger.after_make_public Logging.print_bold_green(next_steps) end end @@ -123,7 +123,7 @@ def self.add_dependency!( dependency_name: ) Logging.section('Adding a dependency') do - intro = UsePackwerk.config.user_event_logger.before_add_dependency(pack_name) + intro = UsePacks.config.user_event_logger.before_add_dependency(pack_name) Logging.print_bold_green(intro) end @@ -133,7 +133,7 @@ def self.add_dependency!( ) Logging.section('Next steps') do - next_steps = UsePackwerk.config.user_event_logger.after_add_dependency(pack_name) + next_steps = UsePacks.config.user_event_logger.after_add_dependency(pack_name) Logging.print_bold_green(next_steps) end end @@ -151,7 +151,7 @@ def self.move_to_parent!( per_file_processors: [] ) Logging.section('👋 Hi!') do - intro = UsePackwerk.config.user_event_logger.before_move_to_parent(pack_name) + intro = UsePacks.config.user_event_logger.before_move_to_parent(pack_name) Logging.print_bold_green(intro) end @@ -162,7 +162,7 @@ def self.move_to_parent!( ) Logging.section('Next steps') do - next_steps = UsePackwerk.config.user_event_logger.after_move_to_parent(pack_name) + next_steps = UsePacks.config.user_event_logger.after_move_to_parent(pack_name) Logging.print_bold_green(next_steps) end @@ -249,7 +249,7 @@ def self.get_offenses_for_files_by_package(files) sig { void } def self.lint_deprecated_references_yml_files! contents_before = Private.get_deprecated_references_contents - UsePackwerk.execute(['update-deprecations']) + UsePacks.execute(['update-deprecations']) contents_after = Private.get_deprecated_references_contents diff = Private.diff_deprecated_references_yml(contents_before, contents_after) @@ -276,7 +276,7 @@ def self.lint_deprecated_references_yml_files! OUTPUT puts output - UsePackwerk.config.on_deprecated_references_lint_failure.call(output) + UsePacks.config.on_deprecated_references_lint_failure.call(output) exit 1 end diff --git a/lib/use_packwerk/cli.rb b/lib/use_packs/cli.rb similarity index 84% rename from lib/use_packwerk/cli.rb rename to lib/use_packs/cli.rb index 4633bfc..3e6faa8 100644 --- a/lib/use_packwerk/cli.rb +++ b/lib/use_packs/cli.rb @@ -2,14 +2,14 @@ require 'thor' -module UsePackwerk +module UsePacks class CLI < Thor extend T::Sig desc 'create packs/your_pack', 'Create pack with name packs/your_pack' sig { params(pack_name: String).void } def create(pack_name) - UsePackwerk.create_pack!(pack_name: pack_name) + UsePacks.create_pack!(pack_name: pack_name) end desc 'add_dependency packs/from_pack packs/to_pack', 'Add packs/to_pack to packs/from_pack/package.yml list of dependencies' @@ -23,7 +23,7 @@ def create(pack_name) LONG_DESC sig { params(from_pack: String, to_pack: String).void } def add_dependency(from_pack, to_pack) - UsePackwerk.add_dependency!( + UsePacks.add_dependency!( pack_name: from_pack, dependency_name: to_pack ) @@ -33,7 +33,7 @@ def add_dependency(from_pack, to_pack) option :limit, type: :numeric, default: 10, aliases: :l, banner: 'Specify the limit of constants to analyze' sig { params(pack_name: String).void } def list_top_dependency_violations(pack_name) - UsePackwerk.list_top_dependency_violations( + UsePacks.list_top_dependency_violations( pack_name: pack_name, limit: options[:limit] ) @@ -43,7 +43,7 @@ def list_top_dependency_violations(pack_name) option :limit, type: :numeric, default: 10, aliases: :l, banner: 'Specify the limit of constants to analyze' sig { params(pack_name: String).void } def list_top_privacy_violations(pack_name) - UsePackwerk.list_top_privacy_violations( + UsePacks.list_top_privacy_violations( pack_name: pack_name, limit: options[:limit] ) @@ -52,42 +52,42 @@ def list_top_privacy_violations(pack_name) desc 'make_public path/to/file.rb path/to/directory', 'Pass in a space-separated list of file or directory paths to make public' sig { params(paths: String).void } def make_public(*paths) - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: paths, - per_file_processors: [UsePackwerk::RubocopPostProcessor.new, UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new] ) end desc 'move packs/destination_pack path/to/file.rb path/to/directory', 'Pass in a destination pack and a space-separated list of file or directory paths to move to the destination pack' sig { params(pack_name: String, paths: String).void } def move(pack_name, *paths) - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: pack_name, paths_relative_to_root: paths, - per_file_processors: [UsePackwerk::RubocopPostProcessor.new, UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new] ) end desc 'move_to_parent packs/parent_pack packs/child_pack', 'Pass in a parent pack and another pack to be made as a child to the parent pack!' sig { params(parent_name: String, pack_name: String).void } def move_to_parent(parent_name, pack_name) - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( parent_name: parent_name, pack_name: pack_name, - per_file_processors: [UsePackwerk::RubocopPostProcessor.new, UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new] ) end desc 'lint_deprecated_references_yml_files', 'Ensures `deprecated_references.yml` files are up to date' sig { void } def lint_deprecated_references_yml_files - UsePackwerk.lint_deprecated_references_yml_files! + UsePacks.lint_deprecated_references_yml_files! end desc 'lint_package_yml_files [ packs/my_pack packs/my_other_pack ]', 'Lint `package.yml` files' sig { params(pack_names: String).void } def lint_package_yml_files(*pack_names) - UsePackwerk.lint_package_yml_files!(parse_pack_names(pack_names)) + UsePacks.lint_package_yml_files!(parse_pack_names(pack_names)) end desc 'validate', 'Run bin/packwerk validate (detects cycles)' diff --git a/lib/use_packwerk/code_ownership_post_processor.rb b/lib/use_packs/code_ownership_post_processor.rb similarity index 97% rename from lib/use_packwerk/code_ownership_post_processor.rb rename to lib/use_packs/code_ownership_post_processor.rb index 1673df8..9c0156a 100644 --- a/lib/use_packwerk/code_ownership_post_processor.rb +++ b/lib/use_packs/code_ownership_post_processor.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks class CodeOwnershipPostProcessor include PerFileProcessorInterface extend T::Sig @@ -19,7 +19,7 @@ def before_move_file!(file_move_operation) code_owners_allow_list_file = Pathname.new('config/code_ownership.yml') if code_owners_allow_list_file.exist? - UsePackwerk.replace_in_file( + UsePacks.replace_in_file( file: code_owners_allow_list_file.to_s, find: relative_path_to_origin, replace_with: relative_path_to_destination diff --git a/lib/use_packwerk/configuration.rb b/lib/use_packs/configuration.rb similarity index 92% rename from lib/use_packwerk/configuration.rb rename to lib/use_packs/configuration.rb index d930a0f..754a313 100644 --- a/lib/use_packwerk/configuration.rb +++ b/lib/use_packs/configuration.rb @@ -1,9 +1,9 @@ # typed: strict -require 'use_packwerk/user_event_logger' -require 'use_packwerk/default_user_event_logger' +require 'use_packs/user_event_logger' +require 'use_packs/default_user_event_logger' -module UsePackwerk +module UsePacks class Configuration extend T::Sig diff --git a/lib/use_packwerk/default_user_event_logger.rb b/lib/use_packs/default_user_event_logger.rb similarity index 81% rename from lib/use_packwerk/default_user_event_logger.rb rename to lib/use_packs/default_user_event_logger.rb index 7a70916..61028eb 100644 --- a/lib/use_packwerk/default_user_event_logger.rb +++ b/lib/use_packs/default_user_event_logger.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks class DefaultUserEventLogger include UserEventLogger end diff --git a/lib/use_packwerk/logging.rb b/lib/use_packs/logging.rb similarity index 97% rename from lib/use_packwerk/logging.rb rename to lib/use_packs/logging.rb index 2f1ccfa..9618403 100644 --- a/lib/use_packwerk/logging.rb +++ b/lib/use_packs/logging.rb @@ -2,7 +2,7 @@ require 'colorized_string' -module UsePackwerk +module UsePacks module Logging extend T::Sig diff --git a/lib/use_packwerk/per_file_processor_interface.rb b/lib/use_packs/per_file_processor_interface.rb similarity index 95% rename from lib/use_packwerk/per_file_processor_interface.rb rename to lib/use_packs/per_file_processor_interface.rb index d755b6d..7968244 100644 --- a/lib/use_packwerk/per_file_processor_interface.rb +++ b/lib/use_packs/per_file_processor_interface.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module PerFileProcessorInterface extend T::Sig extend T::Helpers diff --git a/lib/use_packwerk/private.rb b/lib/use_packs/private.rb similarity index 91% rename from lib/use_packwerk/private.rb rename to lib/use_packs/private.rb index 4e5a456..ed05bdf 100644 --- a/lib/use_packwerk/private.rb +++ b/lib/use_packs/private.rb @@ -5,12 +5,12 @@ require 'colorized_string' require 'sorbet-runtime' -require 'use_packwerk/private/file_move_operation' -require 'use_packwerk/private/pack_relationship_analyzer' -require 'use_packwerk/private/interactive_cli' -require 'use_packwerk/private/packwerk_wrapper' +require 'use_packs/private/file_move_operation' +require 'use_packs/private/pack_relationship_analyzer' +require 'use_packs/private/interactive_cli' +require 'use_packs/private/packwerk_wrapper' -module UsePackwerk +module UsePacks module Private extend T::Sig @@ -52,7 +52,7 @@ def self.replace_in_file(file:, find:, replace_with:) end def self.create_pack!(pack_name:, enforce_privacy:, enforce_dependencies:, team:) Logging.section('👋 Hi!') do - intro = UsePackwerk.config.user_event_logger.before_create_pack(pack_name) + intro = UsePacks.config.user_event_logger.before_create_pack(pack_name) Logging.print_bold_green(intro) end @@ -63,7 +63,7 @@ def self.create_pack!(pack_name:, enforce_privacy:, enforce_dependencies:, team: add_readme_todo(package) Logging.section('Next steps') do - next_steps = UsePackwerk.config.user_event_logger.after_create_pack(pack_name) + next_steps = UsePacks.config.user_event_logger.after_create_pack(pack_name) Logging.print_bold_green(next_steps) end @@ -73,7 +73,7 @@ def self.create_pack!(pack_name:, enforce_privacy:, enforce_dependencies:, team: params( pack_name: String, paths_relative_to_root: T::Array[String], - per_file_processors: T::Array[UsePackwerk::PerFileProcessorInterface] + per_file_processors: T::Array[UsePacks::PerFileProcessorInterface] ).void end def self.move_to_pack!(pack_name:, paths_relative_to_root:, per_file_processors: []) @@ -208,7 +208,7 @@ def self.move_to_parent!( sorbet_config = Pathname.new('sorbet/config') if sorbet_config.exist? - UsePackwerk.replace_in_file( + UsePacks.replace_in_file( file: sorbet_config.to_s, find: package.directory.join('spec'), replace_with: new_package.directory.join('spec') @@ -219,7 +219,7 @@ def self.move_to_parent!( sig do params( paths_relative_to_root: T::Array[String], - per_file_processors: T::Array[UsePackwerk::PerFileProcessorInterface] + per_file_processors: T::Array[UsePacks::PerFileProcessorInterface] ).void end def self.make_public!(paths_relative_to_root:, per_file_processors:) @@ -294,7 +294,7 @@ def self.add_dependency!(pack_name:, dependency_name:) ParsePackwerk.write_package_yml!(new_package) end - sig { params(file_move_operation: FileMoveOperation, per_file_processors: T::Array[UsePackwerk::PerFileProcessorInterface]).void } + sig { params(file_move_operation: FileMoveOperation, per_file_processors: T::Array[UsePacks::PerFileProcessorInterface]).void } def self.package_filepath(file_move_operation, per_file_processors) per_file_processors.each do |per_file_processor| if file_move_operation.origin_pathname.exist? @@ -330,7 +330,7 @@ def self.add_public_directory(package) if public_directory.glob('**/**.rb').none? FileUtils.mkdir_p(public_directory) - todo_md = UsePackwerk.config.user_event_logger.on_create_public_directory_todo(package.name) + todo_md = UsePacks.config.user_event_logger.on_create_public_directory_todo(package.name) public_directory.join('TODO.md').write(todo_md) end end @@ -340,7 +340,7 @@ def self.add_readme_todo(package) pack_directory = package.directory if !pack_directory.join('README.md').exist? - readme_todo_md = UsePackwerk.config.user_event_logger.on_create_readme_todo(package.name) + readme_todo_md = UsePacks.config.user_event_logger.on_create_readme_todo(package.name) pack_directory.join('README_TODO.md').write(readme_todo_md) end end @@ -355,12 +355,12 @@ def self.add_readme_todo(package) end def self.create_pack_if_not_exists!(pack_name:, enforce_privacy:, enforce_dependencies:, team: nil) if PERMITTED_PACK_LOCATIONS.none? { |permitted_location| pack_name.start_with?(permitted_location) } - raise StandardError, "UsePackwerk only supports packages in the the following directories: #{PERMITTED_PACK_LOCATIONS.inspect}. Please make sure to pass in the name of the pack including the full directory path, e.g. `packs/my_pack`." + raise StandardError, "UsePacks only supports packages in the the following directories: #{PERMITTED_PACK_LOCATIONS.inspect}. Please make sure to pass in the name of the pack including the full directory path, e.g. `packs/my_pack`." end existing_package = ParsePackwerk.all.find { |p| p.name == pack_name } if existing_package.nil? - should_enforce_dependenceies = enforce_dependencies.nil? ? UsePackwerk.config.enforce_dependencies : enforce_dependencies + should_enforce_dependenceies = enforce_dependencies.nil? ? UsePacks.config.enforce_dependencies : enforce_dependencies package = ParsePackwerk::Package.new( enforce_dependencies: should_enforce_dependenceies, @@ -390,15 +390,15 @@ def self.load_client_configuration return if @loaded_client_configuration @loaded_client_configuration = true - client_configuration = Pathname.pwd.join('config/use_packwerk.rb') + client_configuration = Pathname.pwd.join('config/use_packs.rb') require client_configuration.to_s if client_configuration.exist? end sig { void } def self.bust_cache! - UsePackwerk.config.bust_cache! - # This comes explicitly after `UsePackwerk.config.bust_cache!` because - # otherwise `UsePackwerk.config` will attempt to reload the client configuratoin. + UsePacks.config.bust_cache! + # This comes explicitly after `UsePacks.config.bust_cache!` because + # otherwise `UsePacks.config` will attempt to reload the client configuratoin. @loaded_client_configuration = false end diff --git a/lib/use_packwerk/private/file_move_operation.rb b/lib/use_packs/private/file_move_operation.rb similarity index 99% rename from lib/use_packwerk/private/file_move_operation.rb rename to lib/use_packs/private/file_move_operation.rb index cc1fc1c..5301476 100644 --- a/lib/use_packwerk/private/file_move_operation.rb +++ b/lib/use_packs/private/file_move_operation.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private class FileMoveOperation < T::Struct extend T::Sig diff --git a/lib/use_packs/private/interactive_cli.rb b/lib/use_packs/private/interactive_cli.rb new file mode 100644 index 0000000..0c4b4bb --- /dev/null +++ b/lib/use_packs/private/interactive_cli.rb @@ -0,0 +1,52 @@ +# typed: strict + +# https://github.com/piotrmurach/tty-prompt +require 'tty-prompt' + +require 'use_packs/private/interactive_cli/team_selector' +require 'use_packs/private/interactive_cli/pack_selector' +require 'use_packs/private/interactive_cli/use_cases/interface' +require 'use_packs/private/interactive_cli/use_cases/create' +require 'use_packs/private/interactive_cli/use_cases/move' +require 'use_packs/private/interactive_cli/use_cases/add_dependency' +require 'use_packs/private/interactive_cli/use_cases/get_info' +require 'use_packs/private/interactive_cli/use_cases/query' +require 'use_packs/private/interactive_cli/use_cases/make_public' +require 'use_packs/private/interactive_cli/use_cases/nest' +require 'use_packs/private/interactive_cli/use_cases/rename' +require 'use_packs/private/interactive_cli/use_cases/check' +require 'use_packs/private/interactive_cli/use_cases/update_deprecations' +require 'use_packs/private/interactive_cli/use_cases/validate' +require 'use_packs/private/interactive_cli/use_cases/regenerate_rubocop_todo' +require 'use_packs/private/interactive_cli/use_cases/lint_package_yml' +require 'use_packs/private/interactive_cli/use_cases/visualize' + +module UsePacks + module Private + module InteractiveCli + extend T::Sig + + sig { params(prompt: T.nilable(TTY::Prompt)).void } + def self.start!(prompt: nil) + prompt ||= TTY::Prompt.new(interrupt: lambda { + puts "\n\nGoodbye! I hope you have a good day." + exit 1 }) + help_text = '(Press ↑/↓ arrow to move, Enter to select and letters to filter)' + choice = prompt.select('Hello! What would you like to do?', + cycle: true, + filter: true, + help: help_text, + show_help: :always, + per_page: 15) do |menu| + menu.enum '.' + + UseCases::Interface.all.each do |use_case| + menu.choice use_case.user_facing_name, use_case + end + end + + choice.perform!(prompt) + end + end + end +end diff --git a/lib/use_packwerk/private/interactive_cli/pack_selector.rb b/lib/use_packs/private/interactive_cli/pack_selector.rb similarity index 98% rename from lib/use_packwerk/private/interactive_cli/pack_selector.rb rename to lib/use_packs/private/interactive_cli/pack_selector.rb index 70aab15..08b2dbe 100644 --- a/lib/use_packwerk/private/interactive_cli/pack_selector.rb +++ b/lib/use_packs/private/interactive_cli/pack_selector.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli class PackSelector diff --git a/lib/use_packwerk/private/interactive_cli/team_selector.rb b/lib/use_packs/private/interactive_cli/team_selector.rb similarity index 98% rename from lib/use_packwerk/private/interactive_cli/team_selector.rb rename to lib/use_packs/private/interactive_cli/team_selector.rb index a890e7f..1bb9d36 100644 --- a/lib/use_packwerk/private/interactive_cli/team_selector.rb +++ b/lib/use_packs/private/interactive_cli/team_selector.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli class TeamSelector diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/add_dependency.rb b/lib/use_packs/private/interactive_cli/use_cases/add_dependency.rb similarity index 93% rename from lib/use_packwerk/private/interactive_cli/use_cases/add_dependency.rb rename to lib/use_packs/private/interactive_cli/use_cases/add_dependency.rb index 8dda0da..b502a38 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/add_dependency.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/add_dependency.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -13,7 +13,7 @@ class AddDependency def perform!(prompt) dependent_pack = PackSelector.single_pack_select(prompt, question_text: 'Please select the pack you are adding a dependency to.') dependency_pack = PackSelector.single_pack_select(prompt, question_text: "Please select the pack that #{dependent_pack.name} should depend on.") - UsePackwerk.add_dependency!( + UsePacks.add_dependency!( pack_name: dependent_pack.name, dependency_name: dependency_pack.name ) diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/check.rb b/lib/use_packs/private/interactive_cli/use_cases/check.rb similarity index 96% rename from lib/use_packwerk/private/interactive_cli/use_cases/check.rb rename to lib/use_packs/private/interactive_cli/use_cases/check.rb index bedb3fd..9ad466d 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/check.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/check.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/create.rb b/lib/use_packs/private/interactive_cli/use_cases/create.rb similarity index 86% rename from lib/use_packwerk/private/interactive_cli/use_cases/create.rb rename to lib/use_packs/private/interactive_cli/use_cases/create.rb index eecffc4..dfa5963 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/create.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/create.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -13,7 +13,7 @@ class Create def perform!(prompt) pack_name = prompt.ask('What should the name of your pack be?', value: 'packs/') team = TeamSelector.single_select(prompt) - UsePackwerk.create_pack!(pack_name: pack_name, team: team) + UsePacks.create_pack!(pack_name: pack_name, team: team) end sig { override.returns(String) } diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/get_info.rb b/lib/use_packs/private/interactive_cli/use_cases/get_info.rb similarity index 99% rename from lib/use_packwerk/private/interactive_cli/use_cases/get_info.rb rename to lib/use_packs/private/interactive_cli/use_cases/get_info.rb index a3caa13..51acde9 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/get_info.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/get_info.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/interface.rb b/lib/use_packs/private/interactive_cli/use_cases/interface.rb similarity index 97% rename from lib/use_packwerk/private/interactive_cli/use_cases/interface.rb rename to lib/use_packs/private/interactive_cli/use_cases/interface.rb index 04b9f97..77e33c9 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/interface.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/interface.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/lint_package_yml.rb b/lib/use_packs/private/interactive_cli/use_cases/lint_package_yml.rb similarity index 89% rename from lib/use_packwerk/private/interactive_cli/use_cases/lint_package_yml.rb rename to lib/use_packs/private/interactive_cli/use_cases/lint_package_yml.rb index 8eef190..fdd1042 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/lint_package_yml.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/lint_package_yml.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -12,7 +12,7 @@ class LintPackageYml sig { override.params(prompt: TTY::Prompt).void } def perform!(prompt) packs = PackSelector.single_or_all_pack_multi_select(prompt, question_text: 'Please select the packs you want to lint package.yml files for') - UsePackwerk.lint_package_yml_files!(packs) + UsePacks.lint_package_yml_files!(packs) end sig { override.returns(String) } diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/make_public.rb b/lib/use_packs/private/interactive_cli/use_cases/make_public.rb similarity index 83% rename from lib/use_packwerk/private/interactive_cli/use_cases/make_public.rb rename to lib/use_packs/private/interactive_cli/use_cases/make_public.rb index 5dfc19a..d263b1b 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/make_public.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/make_public.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -22,9 +22,9 @@ def perform!(prompt) paths_relative_to_root += path.chomp.split end - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: paths_relative_to_root, - per_file_processors: [UsePackwerk::RubocopPostProcessor.new, UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new] ) end end diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/move.rb b/lib/use_packs/private/interactive_cli/use_cases/move.rb similarity index 84% rename from lib/use_packwerk/private/interactive_cli/use_cases/move.rb rename to lib/use_packs/private/interactive_cli/use_cases/move.rb index 9005c16..b7dcee9 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/move.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/move.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -18,10 +18,10 @@ def perform!(prompt) paths_relative_to_root += path.chomp.split end - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: pack.name, paths_relative_to_root: paths_relative_to_root, - per_file_processors: [UsePackwerk::RubocopPostProcessor.new, UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new] ) end diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/nest.rb b/lib/use_packs/private/interactive_cli/use_cases/nest.rb similarity index 81% rename from lib/use_packwerk/private/interactive_cli/use_cases/nest.rb rename to lib/use_packs/private/interactive_cli/use_cases/nest.rb index 84afe91..724f9c6 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/nest.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/nest.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -13,10 +13,10 @@ class Nest def perform!(prompt) child_pack = PackSelector.single_pack_select(prompt, question_text: 'Please select the pack that will be nested') parent_pack = PackSelector.single_pack_select(prompt, question_text: 'Please select the pack that will be the parent') - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( parent_name: parent_pack.name, pack_name: child_pack.name, - per_file_processors: [UsePackwerk::RubocopPostProcessor.new, UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new, UsePacks::CodeOwnershipPostProcessor.new] ) end diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/query.rb b/lib/use_packs/private/interactive_cli/use_cases/query.rb similarity index 92% rename from lib/use_packwerk/private/interactive_cli/use_cases/query.rb rename to lib/use_packs/private/interactive_cli/use_cases/query.rb index da73726..5eb9f11 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/query.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/query.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases @@ -33,12 +33,12 @@ def perform!(prompt) selection = prompt.select('Are you interested in dependency or privacy violations?', %w[Dependency Privacy], default: 'Privacy') if selection == 'Dependency' - UsePackwerk.list_top_dependency_violations( + UsePacks.list_top_dependency_violations( pack_name: selected_pack, limit: limit ) else - UsePackwerk.list_top_privacy_violations( + UsePacks.list_top_privacy_violations( pack_name: selected_pack, limit: limit ) diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb b/lib/use_packs/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb similarity index 97% rename from lib/use_packwerk/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb rename to lib/use_packs/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb index 650ae65..e86d6ce 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/rename.rb b/lib/use_packs/private/interactive_cli/use_cases/rename.rb similarity index 98% rename from lib/use_packwerk/private/interactive_cli/use_cases/rename.rb rename to lib/use_packs/private/interactive_cli/use_cases/rename.rb index b7eedcd..8f6003f 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/rename.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/rename.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/update_deprecations.rb b/lib/use_packs/private/interactive_cli/use_cases/update_deprecations.rb similarity index 96% rename from lib/use_packwerk/private/interactive_cli/use_cases/update_deprecations.rb rename to lib/use_packs/private/interactive_cli/use_cases/update_deprecations.rb index d795cb6..3c4e5b8 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/update_deprecations.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/update_deprecations.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/validate.rb b/lib/use_packs/private/interactive_cli/use_cases/validate.rb similarity index 96% rename from lib/use_packwerk/private/interactive_cli/use_cases/validate.rb rename to lib/use_packs/private/interactive_cli/use_cases/validate.rb index 444dda0..15c7ca5 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/validate.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/validate.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/interactive_cli/use_cases/visualize.rb b/lib/use_packs/private/interactive_cli/use_cases/visualize.rb similarity index 98% rename from lib/use_packwerk/private/interactive_cli/use_cases/visualize.rb rename to lib/use_packs/private/interactive_cli/use_cases/visualize.rb index c4d63b4..248dc94 100644 --- a/lib/use_packwerk/private/interactive_cli/use_cases/visualize.rb +++ b/lib/use_packs/private/interactive_cli/use_cases/visualize.rb @@ -2,7 +2,7 @@ require 'visualize_packwerk' -module UsePackwerk +module UsePacks module Private module InteractiveCli module UseCases diff --git a/lib/use_packwerk/private/pack_relationship_analyzer.rb b/lib/use_packs/private/pack_relationship_analyzer.rb similarity index 95% rename from lib/use_packwerk/private/pack_relationship_analyzer.rb rename to lib/use_packs/private/pack_relationship_analyzer.rb index d8262c3..ec5f261 100644 --- a/lib/use_packwerk/private/pack_relationship_analyzer.rb +++ b/lib/use_packs/private/pack_relationship_analyzer.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module PackRelationshipAnalyzer extend T::Sig @@ -29,7 +29,7 @@ def self.list_top_privacy_violations(pack_name, limit) total_pack_violation_count = 0 Logging.section('👋 Hi there') do - intro = UsePackwerk.config.user_event_logger.before_list_top_privacy_violations(pack_name, limit) + intro = UsePacks.config.user_event_logger.before_list_top_privacy_violations(pack_name, limit) Logging.print_bold_green(intro) end @@ -90,7 +90,7 @@ def self.list_top_dependency_violations(pack_name, limit) end Logging.section('👋 Hi there') do - intro = UsePackwerk.config.user_event_logger.before_list_top_dependency_violations(pack_name, limit) + intro = UsePacks.config.user_event_logger.before_list_top_dependency_violations(pack_name, limit) Logging.print_bold_green(intro) end diff --git a/lib/use_packwerk/private/packwerk_wrapper.rb b/lib/use_packs/private/packwerk_wrapper.rb similarity index 96% rename from lib/use_packwerk/private/packwerk_wrapper.rb rename to lib/use_packs/private/packwerk_wrapper.rb index 4525ceb..903c632 100644 --- a/lib/use_packwerk/private/packwerk_wrapper.rb +++ b/lib/use_packs/private/packwerk_wrapper.rb @@ -1,9 +1,9 @@ # typed: strict require 'packwerk' -require 'use_packwerk/private/packwerk_wrapper/offenses_aggregator_formatter' +require 'use_packs/private/packwerk_wrapper/offenses_aggregator_formatter' -module UsePackwerk +module UsePacks module Private module PackwerkWrapper extend T::Sig diff --git a/lib/use_packwerk/private/packwerk_wrapper/offenses_aggregator_formatter.rb b/lib/use_packs/private/packwerk_wrapper/offenses_aggregator_formatter.rb similarity index 98% rename from lib/use_packwerk/private/packwerk_wrapper/offenses_aggregator_formatter.rb rename to lib/use_packs/private/packwerk_wrapper/offenses_aggregator_formatter.rb index b20e40d..343444b 100644 --- a/lib/use_packwerk/private/packwerk_wrapper/offenses_aggregator_formatter.rb +++ b/lib/use_packs/private/packwerk_wrapper/offenses_aggregator_formatter.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module Private module PackwerkWrapper # diff --git a/lib/use_packwerk/rubocop_post_processor.rb b/lib/use_packs/rubocop_post_processor.rb similarity index 98% rename from lib/use_packwerk/rubocop_post_processor.rb rename to lib/use_packs/rubocop_post_processor.rb index 00fd4e4..f8be8e1 100644 --- a/lib/use_packwerk/rubocop_post_processor.rb +++ b/lib/use_packs/rubocop_post_processor.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks class RubocopPostProcessor include PerFileProcessorInterface extend T::Sig @@ -12,7 +12,7 @@ def before_move_file!(file_move_operation) rubocop_todo = Pathname.new('.rubocop_todo.yml') if rubocop_todo.exist? - UsePackwerk.replace_in_file( + UsePacks.replace_in_file( file: rubocop_todo.to_s, find: relative_path_to_origin, replace_with: relative_path_to_destination diff --git a/lib/use_packwerk/spring_command.rb b/lib/use_packs/spring_command.rb similarity index 92% rename from lib/use_packwerk/spring_command.rb rename to lib/use_packs/spring_command.rb index 179f3f5..d96aed6 100644 --- a/lib/use_packwerk/spring_command.rb +++ b/lib/use_packs/spring_command.rb @@ -3,7 +3,7 @@ require 'spring/commands' -module UsePackwerk +module UsePacks class SpringCommand def env(*) # Packwerk needs to run in a test environment, which has a set of autoload paths that are @@ -16,7 +16,7 @@ def exec_name end def gem_name - 'use_packwerk' + 'use_packs' end def call diff --git a/lib/use_packwerk/user_event_logger.rb b/lib/use_packs/user_event_logger.rb similarity index 98% rename from lib/use_packwerk/user_event_logger.rb rename to lib/use_packs/user_event_logger.rb index 18266fa..ca91e90 100644 --- a/lib/use_packwerk/user_event_logger.rb +++ b/lib/use_packs/user_event_logger.rb @@ -1,6 +1,6 @@ # typed: strict -module UsePackwerk +module UsePacks module UserEventLogger extend T::Sig extend T::Helpers @@ -156,7 +156,7 @@ def before_list_top_dependency_violations(pack_name, limit) if pack_name.nil? pack_specific_content = <<~PACK_CONTENT You are listing top #{limit} dependency violations for all packs. See #{documentation_link} for other utilities! - Pass in a limit to display more or less, e.g. `use_packwerk list_top_dependency_violations #{pack_name} -l 1000` + Pass in a limit to display more or less, e.g. `use_packs list_top_dependency_violations #{pack_name} -l 1000` This script is intended to help you find which of YOUR pack's private classes, constants, or modules other packs are using the most. Anything not in pack_name/app/public is considered private API. @@ -253,7 +253,7 @@ def before_list_top_privacy_violations(pack_name, limit) sig { returns(String) } def documentation_link - 'https://github.com/rubyatscale/use_packwerk#readme' + 'https://github.com/rubyatscale/use_packs#readme' end end end diff --git a/lib/use_packwerk/private/interactive_cli.rb b/lib/use_packwerk/private/interactive_cli.rb deleted file mode 100644 index 38f2488..0000000 --- a/lib/use_packwerk/private/interactive_cli.rb +++ /dev/null @@ -1,52 +0,0 @@ -# typed: strict - -# https://github.com/piotrmurach/tty-prompt -require 'tty-prompt' - -require 'use_packwerk/private/interactive_cli/team_selector' -require 'use_packwerk/private/interactive_cli/pack_selector' -require 'use_packwerk/private/interactive_cli/use_cases/interface' -require 'use_packwerk/private/interactive_cli/use_cases/create' -require 'use_packwerk/private/interactive_cli/use_cases/move' -require 'use_packwerk/private/interactive_cli/use_cases/add_dependency' -require 'use_packwerk/private/interactive_cli/use_cases/get_info' -require 'use_packwerk/private/interactive_cli/use_cases/query' -require 'use_packwerk/private/interactive_cli/use_cases/make_public' -require 'use_packwerk/private/interactive_cli/use_cases/nest' -require 'use_packwerk/private/interactive_cli/use_cases/rename' -require 'use_packwerk/private/interactive_cli/use_cases/check' -require 'use_packwerk/private/interactive_cli/use_cases/update_deprecations' -require 'use_packwerk/private/interactive_cli/use_cases/validate' -require 'use_packwerk/private/interactive_cli/use_cases/regenerate_rubocop_todo' -require 'use_packwerk/private/interactive_cli/use_cases/lint_package_yml' -require 'use_packwerk/private/interactive_cli/use_cases/visualize' - -module UsePackwerk - module Private - module InteractiveCli - extend T::Sig - - sig { params(prompt: T.nilable(TTY::Prompt)).void } - def self.start!(prompt: nil) - prompt ||= TTY::Prompt.new(interrupt: lambda { - puts "\n\nGoodbye! I hope you have a good day." - exit 1 }) - help_text = '(Press ↑/↓ arrow to move, Enter to select and letters to filter)' - choice = prompt.select('Hello! What would you like to do?', - cycle: true, - filter: true, - help: help_text, - show_help: :always, - per_page: 15) do |menu| - menu.enum '.' - - UseCases::Interface.all.each do |use_case| - menu.choice use_case.user_facing_name, use_case - end - end - - choice.perform!(prompt) - end - end - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8b16c22..08c4f6a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,7 @@ # typed: strict # frozen_string_literal: true -require 'use_packwerk' +require 'use_packs' require 'tmpdir' RSpec.configure do |config| diff --git a/spec/use_packwerk/private/interactive_cli_spec.rb b/spec/use_packs/private/interactive_cli_spec.rb similarity index 83% rename from spec/use_packwerk/private/interactive_cli_spec.rb rename to spec/use_packs/private/interactive_cli_spec.rb index 921d39c..b78bdb6 100644 --- a/spec/use_packwerk/private/interactive_cli_spec.rb +++ b/spec/use_packs/private/interactive_cli_spec.rb @@ -2,7 +2,7 @@ require 'tty/prompt/test' -module UsePackwerk +module UsePacks RSpec.describe Private::InteractiveCli do let(:prompt) { TTY::Prompt::Test.new } subject do @@ -13,7 +13,7 @@ module UsePackwerk it 'allows creating a new pack interactively' do write_file('config/teams/artists.yml', 'name: Artists') - expect(UsePackwerk).to receive(:create_pack!).with(pack_name: 'packs/my_new_pack', team: CodeTeams.find('Artists')) + expect(UsePacks).to receive(:create_pack!).with(pack_name: 'packs/my_new_pack', team: CodeTeams.find('Artists')) prompt.input << "Create\r" prompt.input << "my_new_pack\r" prompt.input << "Artists\r" @@ -26,7 +26,7 @@ module UsePackwerk write_file('config/teams/artists.yml', 'name: Artists') write_file('config/teams/bbs.yml', 'name: BBs') - expect(UsePackwerk).to receive(:create_pack!).with(pack_name: 'packs/my_new_pack', team: CodeTeams.find('Zebras')) + expect(UsePacks).to receive(:create_pack!).with(pack_name: 'packs/my_new_pack', team: CodeTeams.find('Zebras')) prompt.input << "Create\r" prompt.input << "my_new_pack\r" prompt.input << "\e[B" # down arrow @@ -39,7 +39,7 @@ module UsePackwerk it 'allows adding a dependency interactively' do write_package_yml('packs/my_dependent_pack') write_package_yml('packs/my_dependency') - expect(UsePackwerk).to receive(:add_dependency!).with(pack_name: 'packs/my_dependent_pack', dependency_name: 'packs/my_dependency') + expect(UsePacks).to receive(:add_dependency!).with(pack_name: 'packs/my_dependent_pack', dependency_name: 'packs/my_dependency') prompt.input << "Add a dependency\r" prompt.input << "my_dependent_pack\r" prompt.input << "my_dependency\r" @@ -53,7 +53,7 @@ module UsePackwerk prompt.input << "packs/my_pack/path/to/other_file.rb\r" prompt.input << "\C-d" prompt.input.rewind - expect(UsePackwerk).to receive(:make_public!).with( + expect(UsePacks).to receive(:make_public!).with( paths_relative_to_root: ['packs/my_pack/path/to/file.rb', 'packs/my_pack/path/to/other_file.rb'], per_file_processors: anything ) @@ -68,7 +68,7 @@ module UsePackwerk prompt.input << "packs/my_pack/path/to/other_file.rb\r" prompt.input << "\C-d" prompt.input.rewind - expect(UsePackwerk).to receive(:move_to_pack!).with( + expect(UsePacks).to receive(:move_to_pack!).with( pack_name: 'packs/my_destination_pack', paths_relative_to_root: ['packs/my_pack/path/to/file.rb', 'packs/my_pack/path/to/other_file.rb'], per_file_processors: anything @@ -84,7 +84,7 @@ module UsePackwerk prompt.input << "packs/my_pack/path/to/other_file.rb\r" prompt.input << "\C-d" prompt.input.rewind - expect(UsePackwerk).to receive(:move_to_pack!).with( + expect(UsePacks).to receive(:move_to_pack!).with( pack_name: 'packs/my_destination_pack', paths_relative_to_root: ['packs/my_pack/path/to/file.rb', 'packs/my_pack/path/to/other_file.rb'], per_file_processors: anything diff --git a/spec/use_packwerk_spec.rb b/spec/use_packs_spec.rb similarity index 90% rename from spec/use_packwerk_spec.rb rename to spec/use_packs_spec.rb index 223f559..b3715f5 100644 --- a/spec/use_packwerk_spec.rb +++ b/spec/use_packs_spec.rb @@ -1,6 +1,6 @@ # typed: false -RSpec.describe UsePackwerk do +RSpec.describe UsePacks do def expect_files_to_exist(files) files.each do |file| expect(File.file?(file)).to (eq true), "Test failed: expected #{file} to now exist, but it does not" @@ -14,23 +14,23 @@ def expect_files_to_not_exist(files) end before do - UsePackwerk.bust_cache! + UsePacks.bust_cache! CodeTeams.bust_caches! # Always add the root package for every spec write_package_yml('.') allow(RuboCop::Packs).to receive(:regenerate_todo) - allow(UsePackwerk::Logging).to receive(:out) - allow(UsePackwerk::Logging).to receive(:print) + allow(UsePacks::Logging).to receive(:out) + allow(UsePacks::Logging).to receive(:print) end describe '.create_pack!' do - # Right now, `UsePackwerk` only supports `packs`, `gems`, or `components` as the home for packwerk packages + # Right now, `UsePacks` only supports `packs`, `gems`, or `components` as the home for packwerk packages context 'pack name does not include `packs` prefix' do let(:pack_name) { 'my_pack' } it 'errors' do - expect { UsePackwerk.create_pack!(pack_name: 'foo/my_pack') }.to raise_error( - 'UsePackwerk only supports packages in the the following directories: ["gems", "components", "packs"]. Please make sure to pass in the name of the pack including the full directory path, e.g. `packs/my_pack`.' + expect { UsePacks.create_pack!(pack_name: 'foo/my_pack') }.to raise_error( + 'UsePacks only supports packages in the the following directories: ["gems", "components", "packs"]. Please make sure to pass in the name of the pack including the full directory path, e.g. `packs/my_pack`.' ) end end @@ -40,7 +40,7 @@ def expect_files_to_not_exist(files) config.required_pack_level_cops = ['Department/SomeCop'] end - UsePackwerk.create_pack!(pack_name: 'packs/my_pack') + UsePacks.create_pack!(pack_name: 'packs/my_pack') ParsePackwerk.bust_cache! package = ParsePackwerk.find('packs/my_pack') expect(package.name).to eq('packs/my_pack') @@ -65,8 +65,8 @@ def expect_files_to_not_exist(files) context 'use packwerk is configured to not enforce dependencies by default' do it 'creates a package.yml correctly' do - UsePackwerk.configure { |config| config.enforce_dependencies = false } - UsePackwerk.create_pack!(pack_name: 'packs/my_pack') + UsePacks.configure { |config| config.enforce_dependencies = false } + UsePacks.create_pack!(pack_name: 'packs/my_pack') expected_package = ParsePackwerk::Package.new( name: 'packs/my_pack', enforce_privacy: true, @@ -90,7 +90,7 @@ def expect_files_to_not_exist(files) it 'is idempotent' do write_package_yml('packs/food', enforce_privacy: false, enforce_dependencies: true, dependencies: ['packs/some_other_pack']) expect(ParsePackwerk.all.count).to eq 2 - UsePackwerk.create_pack!(pack_name: 'packs/food/') + UsePacks.create_pack!(pack_name: 'packs/food/') ParsePackwerk.bust_cache! expect(ParsePackwerk.all.count).to eq 2 package = ParsePackwerk.find('packs/food') @@ -103,7 +103,7 @@ def expect_files_to_not_exist(files) end it 'automatically adds the owner metadata key' do - UsePackwerk.create_pack!(pack_name: 'packs/my_pack') + UsePacks.create_pack!(pack_name: 'packs/my_pack') ParsePackwerk.bust_cache! package = ParsePackwerk.find('packs/my_pack') expect(package.metadata['owner']).to eq 'MyTeam' @@ -114,7 +114,7 @@ def expect_files_to_not_exist(files) context 'team owner is provided' do it 'automatically adds the owner metadata key' do write_file('config/teams/artists.yml', 'name: Artists') - UsePackwerk.create_pack!(pack_name: 'packs/my_pack', team: CodeTeams.find('Artists')) + UsePacks.create_pack!(pack_name: 'packs/my_pack', team: CodeTeams.find('Artists')) ParsePackwerk.bust_cache! package = ParsePackwerk.find('packs/my_pack') expect(package.metadata['owner']).to eq 'Artists' @@ -127,7 +127,7 @@ def expect_files_to_not_exist(files) let(:pack_name) { 'gems/my_pack' } it 'creates the pack' do - UsePackwerk.create_pack!(pack_name: 'gems/my_pack') + UsePacks.create_pack!(pack_name: 'gems/my_pack') ParsePackwerk.bust_cache! expect(ParsePackwerk.find('gems/my_pack').name).to eq('gems/my_pack') end @@ -141,7 +141,7 @@ def expect_files_to_not_exist(files) config.required_pack_level_cops = ['Department/SomeCop'] end - UsePackwerk.create_pack!(pack_name: 'packs/fruits/apples') + UsePacks.create_pack!(pack_name: 'packs/fruits/apples') ParsePackwerk.bust_cache! package = ParsePackwerk.find('packs/fruits/apples') expect(package.name).to eq('packs/fruits/apples') @@ -184,13 +184,13 @@ def expect_files_to_not_exist(files) One more thing -- feel free to delete this file and replace it with a README.md describing your package in the main package directory. - See https://github.com/rubyatscale/use_packwerk#readme for more info! + See https://github.com/rubyatscale/use_packs#readme for more info! TODO end context 'app has no public dir' do it 'adds a TODO.md file letting someone know what to do with it' do - UsePackwerk.create_pack!(pack_name: 'packs/organisms') + UsePacks.create_pack!(pack_name: 'packs/organisms') actual_todo = Pathname.new('packs/organisms/app/public/TODO.md').read expect(actual_todo).to eq expected_todo end @@ -199,7 +199,7 @@ def expect_files_to_not_exist(files) context 'app with one file in public dir' do it 'does not add a TODO.md file' do write_file('packs/organisms/app/public/my_public_api.rb') - UsePackwerk.create_pack!(pack_name: 'packs/organisms') + UsePacks.create_pack!(pack_name: 'packs/organisms') todo_file = Pathname.new('packs/organisms/app/public/TODO.md') expect(todo_file.exist?).to eq false end @@ -223,12 +223,12 @@ def expect_files_to_not_exist(files) README.md files are under version control and should change as your public API changes.#{' '} - See https://github.com/rubyatscale/use_packwerk#readme for more info! + See https://github.com/rubyatscale/use_packs#readme for more info! EXPECTED end it 'adds a README_TODO.md file as a placeholder' do - UsePackwerk.create_pack!(pack_name: 'packs/organisms') + UsePacks.create_pack!(pack_name: 'packs/organisms') ParsePackwerk.bust_cache! actual_readme_todo = ParsePackwerk.find('packs/organisms').directory.join('README_TODO.md') expect(actual_readme_todo.read).to eq expected_readme_todo @@ -240,7 +240,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/organisms') actual_readme_todo = ParsePackwerk.find('packs/organisms').directory.join('README_TODO.md') expect(actual_readme_todo.read).to eq 'This is outdated' - UsePackwerk.create_pack!(pack_name: 'packs/organisms') + UsePacks.create_pack!(pack_name: 'packs/organisms') expect(actual_readme_todo.read).to eq expected_readme_todo end end @@ -250,7 +250,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/organisms') write_file('packs/organisms/README.md') actual_readme_todo = ParsePackwerk.find('packs/organisms').directory.join('README_TODO.md') - UsePackwerk.create_pack!(pack_name: 'packs/organisms') + UsePacks.create_pack!(pack_name: 'packs/organisms') expect(actual_readme_todo.exist?).to eq false end end @@ -264,7 +264,7 @@ def expect_files_to_not_exist(files) write_file('app/services/foo.rb') expect { - UsePackwerk.move_to_pack!(pack_name: 'packs/animals', paths_relative_to_root: ['app/services/foo.rb']) + UsePacks.move_to_pack!(pack_name: 'packs/animals', paths_relative_to_root: ['app/services/foo.rb']) }.to raise_error('Can not find package with name packs/animals. Make sure the argument is of the form `packs/my_pack/`') end end @@ -273,7 +273,7 @@ def expect_files_to_not_exist(files) write_file('app/services/horse_like/donkey.rb') write_file('spec/services/horse_like/donkey_spec.rb') write_package_yml('packs/animals') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/animals', paths_relative_to_root: ['app/services/horse_like/donkey.rb'] ) @@ -293,7 +293,7 @@ def expect_files_to_not_exist(files) write_file('app/services/horse_like/donkey.rb') write_file('spec/services/horse_like/donkey_spec.rb') write_package_yml('packs/animals') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/animals', paths_relative_to_root: ['app/services/horse_like'] ) @@ -316,7 +316,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/app/services/horse_like/donkey.rb') write_file('packs/organisms/spec/services/horse_like/donkey_spec.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/animals', paths_relative_to_root: ['packs/organisms/app/services/horse_like/donkey.rb'] ) @@ -339,7 +339,7 @@ def expect_files_to_not_exist(files) write_file('packs/animals/horse_like/app/services/horse_like/donkey.rb') write_file('packs/animals/horse_like/spec/services/horse_like/donkey_spec.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/animals', paths_relative_to_root: ['packs/animals/horse_like/app/services/horse_like/donkey.rb'] ) @@ -363,7 +363,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/app/services/horse_like/donkey.rb') write_file('packs/organisms/spec/services/horse_like/donkey_spec.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/animals', paths_relative_to_root: ['packs/organisms/app/services/horse_like/'] ) @@ -389,7 +389,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/app/services/apple.rb') write_file('packs/organisms/app/services/sunflower.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/food', paths_relative_to_root: [ 'packs/organisms/app/services' @@ -417,7 +417,7 @@ def expect_files_to_not_exist(files) write_file('packs/food/app/services/salad.rb') write_file('packs/organisms/app/services/salad.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/food', paths_relative_to_root: [ 'packs/organisms/app/services' @@ -440,7 +440,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/lib/tasks/my_other_task.rake') write_file('packs/organisms/spec/lib/tasks/my_other_task_spec.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/my_pack', paths_relative_to_root: [ 'lib/tasks/my_task.rake', @@ -479,13 +479,13 @@ def expect_files_to_not_exist(files) expect(before_rubocop_todo).to eq({ 'Layout/BeginEndAlignment' => { 'Exclude' => ['packs/foo/app/services/foo.rb'] } }) write_file('packs/foo/app/services/foo.rb') - UsePackwerk.create_pack!(pack_name: 'packs/bar') - UsePackwerk.create_pack!(pack_name: 'packs/foo') + UsePacks.create_pack!(pack_name: 'packs/bar') + UsePacks.create_pack!(pack_name: 'packs/foo') ParsePackwerk.bust_cache! - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/bar', paths_relative_to_root: ['packs/foo/app/services/foo.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) after_rubocop_todo = YAML.load_file(Pathname.new('.rubocop_todo.yml')) @@ -507,13 +507,13 @@ def expect_files_to_not_exist(files) expect(Pathname.new('packs/barpack_package_rubocop_todo.yml')).to_not exist write_file('packs/foo/app/services/foo.rb') - UsePackwerk.create_pack!(pack_name: 'packs/bar') - UsePackwerk.create_pack!(pack_name: 'packs/foo') + UsePacks.create_pack!(pack_name: 'packs/bar') + UsePacks.create_pack!(pack_name: 'packs/foo') ParsePackwerk.bust_cache! - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/bar', paths_relative_to_root: ['packs/foo/app/services/foo.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) after_rubocop_todo_foo = YAML.load_file(Pathname.new('packs/foo/package_rubocop_todo.yml')) @@ -545,13 +545,13 @@ def expect_files_to_not_exist(files) expect(before_rubocop_todo_bar).to eq({ 'Layout/BeginEndAlignment' => { 'Exclude' => ['packs/bar/app/services/bar.rb'] } }) write_file('packs/foo/app/services/foo.rb') - UsePackwerk.create_pack!(pack_name: 'packs/bar') - UsePackwerk.create_pack!(pack_name: 'packs/foo') + UsePacks.create_pack!(pack_name: 'packs/bar') + UsePacks.create_pack!(pack_name: 'packs/foo') ParsePackwerk.bust_cache! - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/bar', paths_relative_to_root: ['packs/foo/app/services/foo.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) after_rubocop_todo_foo = YAML.load_file(Pathname.new('packs/foo/package_rubocop_todo.yml')) @@ -583,13 +583,13 @@ def expect_files_to_not_exist(files) expect(before_rubocop_todo_bar).to eq({ 'Layout/OtherCop' => { 'Exclude' => ['packs/bar/app/services/bar.rb'] } }) write_file('packs/foo/app/services/foo.rb') - UsePackwerk.create_pack!(pack_name: 'packs/bar') - UsePackwerk.create_pack!(pack_name: 'packs/foo') + UsePacks.create_pack!(pack_name: 'packs/bar') + UsePacks.create_pack!(pack_name: 'packs/foo') ParsePackwerk.bust_cache! - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/bar', paths_relative_to_root: ['packs/foo/app/services/foo.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) after_rubocop_todo_foo = YAML.load_file(Pathname.new('packs/foo/package_rubocop_todo.yml')) @@ -603,15 +603,15 @@ def expect_files_to_not_exist(files) end it 'runs rubocop on the changed files' do - UsePackwerk.create_pack!(pack_name: 'packs/fruits/apples') + UsePacks.create_pack!(pack_name: 'packs/fruits/apples') ParsePackwerk.bust_cache! write_file('packs/fruits/apples/app/services/apple.rb') expect(RuboCop::Packs).to receive(:regenerate_todo).with(files: ['packs/fruits/apples/app/public/apple.rb']) - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['packs/fruits/apples/app/services/apple.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) end end @@ -630,10 +630,10 @@ def expect_files_to_not_exist(files) write_file('spec/services/horse_like/donkey_spec.rb') write_package_yml('packs/animals') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/animals', paths_relative_to_root: ['app/services/horse_like'], - per_file_processors: [UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::CodeOwnershipPostProcessor.new] ) after_codeownership_yml = File.read(Pathname.new('config/code_ownership.yml')) @@ -651,15 +651,15 @@ def expect_files_to_not_exist(files) logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: '.', paths_relative_to_root: ['packs/owned_by_artists/app/services/foo.rb'], - per_file_processors: [UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::CodeOwnershipPostProcessor.new] ) expected_logged_output = <<~OUTPUT @@ -678,15 +678,15 @@ def expect_files_to_not_exist(files) logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/owned_by_artists', paths_relative_to_root: ['app/services/foo.rb'], - per_file_processors: [UsePackwerk::CodeOwnershipPostProcessor.new] + per_file_processors: [UsePacks::CodeOwnershipPostProcessor.new] ) expected_logged_output = <<~OUTPUT @@ -708,7 +708,7 @@ def expect_files_to_not_exist(files) context 'pack not yet created' do it 'errors' do expect { - UsePackwerk.move_to_pack!(paths_relative_to_root: ['packs/fruits/apples/app/services/mcintosh.rb'], pack_name: 'packs/fruits/apples') + UsePacks.move_to_pack!(paths_relative_to_root: ['packs/fruits/apples/app/services/mcintosh.rb'], pack_name: 'packs/fruits/apples') }.to raise_error('Can not find package with name packs/fruits/apples. Make sure the argument is of the form `packs/my_pack/`') end end @@ -718,7 +718,7 @@ def expect_files_to_not_exist(files) write_file('app/services/mcintosh.rb') write_file('spec/services/mcintosh_spec.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( paths_relative_to_root: ['app/services/mcintosh.rb'], pack_name: 'packs/fruits/apples' ) @@ -739,7 +739,7 @@ def expect_files_to_not_exist(files) write_file('packs/fruits/app/services/mcintosh.rb') write_file('packs/fruits/spec/services/mcintosh_spec.rb') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( paths_relative_to_root: ['packs/fruits/app/services/mcintosh.rb'], pack_name: 'packs/fruits/apples' ) @@ -774,7 +774,7 @@ def expect_files_to_not_exist(files) One more thing -- feel free to delete this file and replace it with a README.md describing your package in the main package directory. - See https://github.com/rubyatscale/use_packwerk#readme for more info! + See https://github.com/rubyatscale/use_packs#readme for more info! TODO end @@ -782,7 +782,7 @@ def expect_files_to_not_exist(files) it 'adds a TODO.md file letting someone know what to do with it' do write_file('app/services/foo.rb') write_package_yml('packs/organisms') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/organisms', paths_relative_to_root: ['app/services/foo.rb'] ) @@ -797,7 +797,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/app/public/my_public_api.rb') write_file('app/services/foo.rb') write_package_yml('packs/organisms') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/organisms', paths_relative_to_root: ['app/services/foo.rb'] ) @@ -825,14 +825,14 @@ def expect_files_to_not_exist(files) README.md files are under version control and should change as your public API changes.#{' '} - See https://github.com/rubyatscale/use_packwerk#readme for more info! + See https://github.com/rubyatscale/use_packs#readme for more info! EXPECTED end it 'adds a README_TODO.md file as a placeholder' do write_file('app/services/foo.rb') write_package_yml('packs/organisms') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/organisms', paths_relative_to_root: ['app/services/foo.rb'] ) @@ -848,7 +848,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/README_TODO.md', 'This is outdated') actual_readme_todo = ParsePackwerk.find('packs/organisms').directory.join('README_TODO.md') expect(actual_readme_todo.read).to eq 'This is outdated' - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/organisms', paths_relative_to_root: ['app/services/foo.rb'] ) @@ -862,7 +862,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/organisms') write_file('packs/organisms/README.md') actual_readme_todo = ParsePackwerk.find('packs/organisms').directory.join('README_TODO.md') - UsePackwerk.move_to_pack!( + UsePacks.move_to_pack!( pack_name: 'packs/organisms', paths_relative_to_root: ['app/services/foo.rb'] ) @@ -877,7 +877,7 @@ def expect_files_to_not_exist(files) write_file('app/services/horse_like/donkey.rb') write_file('spec/services/horse_like/donkey_spec.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['app/services/horse_like/donkey.rb'] ) @@ -898,7 +898,7 @@ def expect_files_to_not_exist(files) write_file('app/services/fish_like/big_ones/whale.rb') write_file('spec/services/fish_like/big_ones/whale_spec.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['app/services/fish_like'] ) @@ -918,12 +918,12 @@ def expect_files_to_not_exist(files) end it 'can make files in a nested pack public' do - UsePackwerk.create_pack!(pack_name: 'packs/fruits/apples') + UsePacks.create_pack!(pack_name: 'packs/fruits/apples') ParsePackwerk.bust_cache! write_file('packs/fruits/apples/app/services/apple.rb') write_file('packs/fruits/apples/spec/services/apple_spec.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['packs/fruits/apples/app/services/apple.rb'] ) @@ -944,7 +944,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/app/services/other_bird.rb') write_file('packs/organisms/spec/services/other_bird_spec.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['packs/organisms/app/services/other_bird.rb'] ) @@ -977,9 +977,9 @@ def expect_files_to_not_exist(files) expect(rubocop_todo.read).to include 'packs/organisms/app/services/other_bird.rb' expect(rubocop_todo.read).to_not include 'packs/organisms/app/public/other_bird.rb' - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['packs/organisms/app/services/other_bird.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) expect(rubocop_todo.read).to_not include 'packs/organisms/app/services/other_bird.rb' @@ -1004,9 +1004,9 @@ def expect_files_to_not_exist(files) expect(rubocop_todo.read).to include 'packs/organisms/app/services/other_bird.rb' expect(rubocop_todo.read).to_not include 'packs/organisms/app/public/other_bird.rb' - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['packs/organisms/app/services/other_bird.rb'], - per_file_processors: [UsePackwerk::RubocopPostProcessor.new] + per_file_processors: [UsePacks::RubocopPostProcessor.new] ) expect(rubocop_todo.read).to_not include 'packs/organisms/app/services/other_bird.rb' @@ -1021,7 +1021,7 @@ def expect_files_to_not_exist(files) write_file('packs/organisms/app/services/other_bird.rb') write_file('packs/organisms/spec/services/other_bird_spec.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['packs/organisms/app/services/other_bird.rb'] ) @@ -1043,7 +1043,7 @@ def expect_files_to_not_exist(files) write_package_yml('gems/my_gem') write_file('gems/my_gem/app/public/my_gem_service.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: ['gems/my_gem/app/services/my_gem_service.rb'] ) @@ -1063,7 +1063,7 @@ def expect_files_to_not_exist(files) write_file('packs/food/app/services/salad_dressing.rb') write_file('packs/food/spec/services/salads/dressing_spec.rb') - UsePackwerk.make_public!( + UsePacks.make_public!( paths_relative_to_root: [ 'packs/food/app/services/salad.rb', 'packs/food/app/services/salad_dressing.rb' @@ -1093,7 +1093,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/other_pack') expect(ParsePackwerk.find('.').dependencies).to eq([]) - UsePackwerk.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') + UsePacks.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') ParsePackwerk.bust_cache! expect(ParsePackwerk.find('.').dependencies).to eq(['packs/other_pack']) end @@ -1104,7 +1104,7 @@ def expect_files_to_not_exist(files) write_package_yml('.', dependencies: ['packs/foo']) write_package_yml('packs/other_pack') expect(ParsePackwerk.find('.').dependencies).to eq(['packs/foo']) - UsePackwerk.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') + UsePacks.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') ParsePackwerk.bust_cache! expect(ParsePackwerk.find('.').dependencies).to eq(['packs/foo', 'packs/other_pack']) end @@ -1115,7 +1115,7 @@ def expect_files_to_not_exist(files) write_package_yml('.', dependencies: ['packs/foo', 'packs/foo', 'packs/foo']) write_package_yml('packs/other_pack') expect(ParsePackwerk.find('.').dependencies).to eq(['packs/foo', 'packs/foo', 'packs/foo']) - UsePackwerk.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') + UsePacks.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') ParsePackwerk.bust_cache! expect(ParsePackwerk.find('.').dependencies).to eq(['packs/foo', 'packs/other_pack']) end @@ -1127,7 +1127,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/other_pack') expect(ParsePackwerk.find('.').dependencies).to eq(['packs/foo', 'packs/zoo', 'packs/boo']) - UsePackwerk.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') + UsePacks.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') ParsePackwerk.bust_cache! expect(ParsePackwerk.find('.').dependencies).to eq(['packs/boo', 'packs/foo', 'packs/other_pack', 'packs/zoo']) end @@ -1136,7 +1136,7 @@ def expect_files_to_not_exist(files) context 'new dependency does not exist' do it 'raises an error' do expect(ParsePackwerk.find('.').dependencies).to eq([]) - expect { UsePackwerk.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') }.to raise_error do |e| + expect { UsePacks.add_dependency!(pack_name: '.', dependency_name: 'packs/other_pack') }.to raise_error do |e| expect(e.message).to eq 'Can not find package with name packs/other_pack. Make sure the argument is of the form `packs/my_pack/`' end end @@ -1144,7 +1144,7 @@ def expect_files_to_not_exist(files) context 'pack does not exist' do it 'raises an error' do - expect { UsePackwerk.add_dependency!(pack_name: 'packs/other_pack', dependency_name: '.') }.to raise_error do |e| + expect { UsePacks.add_dependency!(pack_name: 'packs/other_pack', dependency_name: '.') }.to raise_error do |e| expect(e.message).to eq 'Can not find package with name packs/other_pack. Make sure the argument is of the form `packs/my_pack/`' end end @@ -1171,7 +1171,7 @@ def expect_files_to_not_exist(files) write_file('packs/apples/app/services/apples/foo.rb') write_file('packs/apples/README.md') - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( pack_name: 'packs/apples', parent_name: 'packs/fruits' ) @@ -1208,12 +1208,12 @@ def expect_files_to_not_exist(files) it 'gives some helpful output to users' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:out).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:out).at_least(:once) do |string| logged_output += ColorizedString.new(string).uncolorize logged_output += "\n" end - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += ColorizedString.new(string).uncolorize logged_output += "\n" end @@ -1222,7 +1222,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/apples') write_file('packs/apples/app/services/apples/foo.rb') - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( pack_name: 'packs/apples', parent_name: 'packs/fruits' ) @@ -1232,7 +1232,7 @@ def expect_files_to_not_exist(files) 👋 Hi! - You are moving one pack to be a child of a different pack. Check out https://github.com/rubyatscale/use_packwerk#readme for more info! + You are moving one pack to be a child of a different pack. Check out https://github.com/rubyatscale/use_packs#readme for more info! ==================================================================================================== File Operations @@ -1258,7 +1258,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/other_pack', dependencies: ['packs/apples', 'packs/something_else']) write_package_yml('packs/apples') - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( pack_name: 'packs/apples', parent_name: 'packs/fruits' ) @@ -1279,7 +1279,7 @@ def expect_files_to_not_exist(files) --ignore=/packs/apples/spec CONTENTS - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( pack_name: 'packs/apples', parent_name: 'packs/fruits' ) @@ -1301,7 +1301,7 @@ def expect_files_to_not_exist(files) write_package_yml('packs/apples') - UsePackwerk.move_to_parent!( + UsePacks.move_to_parent!( pack_name: 'packs/apples', parent_name: 'packs/fruits' ) @@ -1319,9 +1319,9 @@ def expect_files_to_not_exist(files) context 'no diff after running update-deprecations' do it 'exits successfully' do expect_any_instance_of(Packwerk::Cli).to receive(:execute_command).with(['update-deprecations']) - expect(UsePackwerk).to receive(:exit).with(0) - expect(UsePackwerk).to_not receive(:puts) - UsePackwerk.lint_deprecated_references_yml_files! + expect(UsePacks).to receive(:exit).with(0) + expect(UsePacks).to_not receive(:puts) + UsePacks.lint_deprecated_references_yml_files! end end @@ -1355,7 +1355,7 @@ def expect_files_to_not_exist(files) CONTENTS end - expect(UsePackwerk).to receive(:puts).with(<<~EXPECTED) + expect(UsePacks).to receive(:puts).with(<<~EXPECTED) All `deprecated_references.yml` files must be up-to-date and that no diff is generated when running `bin/packwerk update-deprecations`. This helps ensure a high quality signal in other engineers' PRs when inspecting new violations by ensuring there are no unrelated changes. @@ -1376,15 +1376,15 @@ def expect_files_to_not_exist(files) EXPECTED - expect(UsePackwerk).to receive(:exit).with(1) - UsePackwerk.lint_deprecated_references_yml_files! + expect(UsePacks).to receive(:exit).with(1) + UsePacks.lint_deprecated_references_yml_files! end end context 'some formatting changes after running update-deprecations' do it 'exits in a failure' do callback_invocation = false - UsePackwerk.configure do |config| + UsePacks.configure do |config| config.on_deprecated_references_lint_failure = ->(output) { callback_invocation = output } end write_file('packs/my_pack/package.yml', <<~CONTENTS) @@ -1416,7 +1416,7 @@ def expect_files_to_not_exist(files) CONTENTS end - expect(UsePackwerk).to receive(:puts).with(<<~EXPECTED) + expect(UsePacks).to receive(:puts).with(<<~EXPECTED) All `deprecated_references.yml` files must be up-to-date and that no diff is generated when running `bin/packwerk update-deprecations`. This helps ensure a high quality signal in other engineers' PRs when inspecting new violations by ensuring there are no unrelated changes. @@ -1439,8 +1439,8 @@ def expect_files_to_not_exist(files) EXPECTED - expect(UsePackwerk).to receive(:exit).with(1) - UsePackwerk.lint_deprecated_references_yml_files! + expect(UsePacks).to receive(:exit).with(1) + UsePacks.lint_deprecated_references_yml_files! expect(callback_invocation).to include('All `deprecated_references.yml` files must be up-to-date') end end @@ -1541,7 +1541,7 @@ def expect_files_to_not_exist(files) describe '.list_top_privacy_violations' do let(:list_top_privacy_violations) do - UsePackwerk.list_top_privacy_violations( + UsePacks.list_top_privacy_violations( pack_name: pack_name, limit: limit ) @@ -1554,7 +1554,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1578,7 +1578,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1602,7 +1602,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1632,7 +1632,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1660,7 +1660,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1682,12 +1682,12 @@ def expect_files_to_not_exist(files) context 'analyzing all packs' do it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end - UsePackwerk.list_top_privacy_violations( + UsePacks.list_top_privacy_violations( pack_name: nil, limit: limit ) @@ -1724,7 +1724,7 @@ def expect_files_to_not_exist(files) describe '.list_top_dependency_violations' do let(:list_top_dependency_violations) do - UsePackwerk.list_top_dependency_violations( + UsePacks.list_top_dependency_violations( pack_name: pack_name, limit: limit ) @@ -1737,7 +1737,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1761,7 +1761,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1788,7 +1788,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1818,7 +1818,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1846,7 +1846,7 @@ def expect_files_to_not_exist(files) it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end @@ -1871,12 +1871,12 @@ def expect_files_to_not_exist(files) context 'analyzing all packs' do it 'has the right output' do logged_output = '' - expect(UsePackwerk::Logging).to receive(:print).at_least(:once) do |string| + expect(UsePacks::Logging).to receive(:print).at_least(:once) do |string| logged_output += string logged_output += "\n" end - UsePackwerk.list_top_dependency_violations( + UsePacks.list_top_dependency_violations( pack_name: nil, limit: limit ) diff --git a/use_packwerk.gemspec b/use_packs.gemspec similarity index 81% rename from use_packwerk.gemspec rename to use_packs.gemspec index 02105bb..a869451 100644 --- a/use_packwerk.gemspec +++ b/use_packs.gemspec @@ -1,18 +1,18 @@ Gem::Specification.new do |spec| - spec.name = 'use_packwerk' - spec.version = '0.70.0' + spec.name = 'use_packs' + spec.version = '0.0.1' spec.authors = ['Gusto Engineers'] spec.email = ['dev@gusto.com'] - spec.summary = 'UsePackwerk is a gem that helps in creating and maintaining packwerk packages.' - spec.description = 'UsePackwerk is a gem that helps in creating and maintaining packwerk packages.' - spec.homepage = 'https://github.com/rubyatscale/use_packwerk' + spec.summary = 'UsePacks is a gem that helps in creating and maintaining packwerk packages.' + spec.description = 'UsePacks is a gem that helps in creating and maintaining packwerk packages.' + spec.homepage = 'https://github.com/rubyatscale/use_packs' spec.license = 'MIT' if spec.respond_to?(:metadata) spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = 'https://github.com/rubyatscale/use_packwerk' - spec.metadata['changelog_uri'] = 'https://github.com/rubyatscale/use_packwerk/releases' + spec.metadata['source_code_uri'] = 'https://github.com/rubyatscale/use_packs' + spec.metadata['changelog_uri'] = 'https://github.com/rubyatscale/use_packs/releases' spec.metadata['allowed_push_host'] = 'https://rubygems.org' else raise 'RubyGems 2.0 or newer is required to protect against ' \