use_packwerk 0.63.0 → 0.65.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebe18edb1b17a40a2ad1815cc4482d6dfcfac0817e8900ff775cbcacc5c1bcd5
4
- data.tar.gz: edcba665142d63a40373126b85d5bbcb92ca98123bd599f8eff7ed56accc8014
3
+ metadata.gz: '09fba875e35dbc9bec54523ce0d6b778624029daa850c4daf2320dc753064205'
4
+ data.tar.gz: f56b46f76d3111e04f1a09f642843fd48be5a656c336366ecfe2db796f26f0ff
5
5
  SHA512:
6
- metadata.gz: 2421e5530d6534eb6592bc04278afb9a0276bd0446081483ff346f9d30864970edb13f7b2a01ee38682a183b1cb4d498f6fe726081a4783200d5c8aa38946e64
7
- data.tar.gz: 8723efa393e952179f670818b99dacedcfd0be341d49447d01906a4c512150d819967cc4b2b2a28edf124eeb59d491347b688f0525a95a327c8b4341207712f8
6
+ metadata.gz: e39623119c6f9f1507ebb1a1f7ef7a5eb979ce10af57ee86ac517d74a46f0f96560b333688948a88cac0ac0fcedd43711fdd07f23490de20ea324da924b3a786
7
+ data.tar.gz: aa492df65946f5d872a28c2328d609a4873c0c6c0183dd0d730de657ca42215d1a7be78e298ac8ca040bbef5432e8d5ce16dc8631364df153dbf8006178dc569
data/README.md CHANGED
@@ -4,26 +4,26 @@ UsePackwerk is a gem that helps in creating and maintaining packs. It exists to
4
4
 
5
5
  ## Usage
6
6
  ### General Help
7
- `bin/use_packwerk --help`
7
+ `bin/packs --help` or just `bin/packs` to enter interactive mode.
8
8
 
9
9
  ### Pack Creation
10
- `bin/use_packwerk create packs/your_pack_name_here`
10
+ `bin/packs create packs/your_pack_name_here`
11
11
 
12
12
  ### Moving files to packs
13
- `bin/use_packwerk move packs/your_pack_name_here path/to/file.rb path/to/directory`
13
+ `bin/packs move packs/your_pack_name_here path/to/file.rb path/to/directory`
14
14
  This is used for moving files into a pack (the pack must already exist).
15
15
  Note this works for moving files to packs from the monolith or from other packs
16
16
 
17
17
  Make sure there are no spaces between the comma-separated list of paths of directories.
18
18
 
19
19
  ### Moving a file to public API
20
- `bin/use_packwerk make_public path/to/file.rb,path/to/directory`
20
+ `bin/packs make_public path/to/file.rb,path/to/directory`
21
21
  This moves a file or directory to public API (that is -- the `app/public` folder).
22
22
 
23
23
  Make sure there are no spaces between the comma-separated list of paths of directories.
24
24
 
25
25
  ### Listing top privacy violations
26
- `bin/use_packwerk list_top_privacy_violations packs/my_pack`
26
+ `bin/packs list_top_privacy_violations packs/my_pack`
27
27
  Want to create interfaces? Not sure how your pack's code is being used?
28
28
 
29
29
  You can use this command to list the top privacy violations.
@@ -31,7 +31,7 @@ You can use this command to list the top privacy violations.
31
31
  If no pack name is passed in, this will list out violations across all packs.
32
32
 
33
33
  ### Listing top dependency violations
34
- `bin/use_packwerk list_top_dependency_violations packs/my_pack`
34
+ `bin/packs list_top_dependency_violations packs/my_pack`
35
35
  Want to see who is depending on you? Not sure how your pack's code is being used in an unstated way
36
36
 
37
37
  You can use this command to list the top dependency violations.
@@ -39,7 +39,7 @@ You can use this command to list the top dependency violations.
39
39
  If no pack name is passed in, this will list out violations across all packs.
40
40
 
41
41
  ### Adding a dependency
42
- `bin/use_packwerk add_dependency packs/my_pack packs/dependency_pack_name`
42
+ `bin/packs add_dependency packs/my_pack packs/dependency_pack_name`
43
43
 
44
44
  This can be used to quickly modify a `package.yml` file and add a dependency. It also cleans up the list of dependencies to sort the list and remove redundant entries.
45
45
 
data/bin/packs CHANGED
@@ -2,4 +2,9 @@
2
2
  # typed: strict
3
3
 
4
4
  require_relative '../lib/use_packwerk'
5
- UsePackwerk.start_interactive_mode!
5
+
6
+ if ARGV.empty?
7
+ UsePackwerk.start_interactive_mode!
8
+ else
9
+ UsePackwerk::CLI.start(ARGV)
10
+ end
@@ -16,7 +16,7 @@ module UsePackwerk
16
16
  long_desc <<~LONG_DESC
17
17
  Use this to add a dependency between packs.
18
18
 
19
- When you use bin/use_packwerk add_dependency packs/from_pack packs/to_pack, this command will
19
+ When you use bin/packs add_dependency packs/from_pack packs/to_pack, this command will
20
20
  modify packs/from_pack/package.yml's list of dependencies and add packs/to_pack.
21
21
 
22
22
  This command will also sort the list and make it unique.
@@ -11,13 +11,13 @@ module UsePackwerk
11
11
 
12
12
  sig { override.params(prompt: TTY::Prompt).void }
13
13
  def perform!(prompt)
14
- packs = PackSelector.single_or_all_pack_multi_select(prompt, question_text: 'Please select the packs you want to regenerate `.rubocop_todo.yml` for')
14
+ packs = PackSelector.single_or_all_pack_multi_select(prompt, question_text: "Please select the packs you want to regenerate `#{RuboCop::Packs::PACK_LEVEL_RUBOCOP_TODO_YML}` for")
15
15
  RuboCop::Packs.auto_generate_rubocop_todo(packs: packs)
16
16
  end
17
17
 
18
18
  sig { override.returns(String) }
19
19
  def user_facing_name
20
- 'Regenerate packs/*/.rubocop_todo.yml for one or more packs'
20
+ "Regenerate packs/*/#{RuboCop::Packs::PACK_LEVEL_RUBOCOP_TODO_YML} for one or more packs"
21
21
  end
22
22
  end
23
23
  end
@@ -25,9 +25,9 @@ module UsePackwerk
25
25
  module InteractiveCli
26
26
  extend T::Sig
27
27
 
28
- sig { void }
29
- def self.start!
30
- prompt = TTY::Prompt.new(interrupt: lambda {
28
+ sig { params(prompt: T.nilable(TTY::Prompt)).void }
29
+ def self.start!(prompt: nil)
30
+ prompt ||= TTY::Prompt.new(interrupt: lambda {
31
31
  puts "\n\nGoodbye! I hope you have a good day."
32
32
  exit 1 })
33
33
  help_text = '(Press ↑/↓ arrow to move, Enter to select and letters to filter)'
@@ -20,7 +20,7 @@ module UsePackwerk
20
20
  end
21
21
 
22
22
  if file_move_operation.origin_pack.name != ParsePackwerk::ROOT_PACKAGE_NAME && file_move_operation.destination_pack.name != ParsePackwerk::ROOT_PACKAGE_NAME
23
- origin_rubocop_todo = file_move_operation.origin_pack.directory.join('.rubocop_todo.yml')
23
+ origin_rubocop_todo = file_move_operation.origin_pack.directory.join(RuboCop::Packs::PACK_LEVEL_RUBOCOP_TODO_YML)
24
24
  if origin_rubocop_todo.exist?
25
25
  loaded_origin_rubocop_todo = YAML.load_file(origin_rubocop_todo)
26
26
  new_origin_rubocop_todo = loaded_origin_rubocop_todo.dup
@@ -31,7 +31,7 @@ module UsePackwerk
31
31
  new_origin_rubocop_todo[cop_name]['Exclude'] = cop_config['Exclude'] - [relative_path_to_origin.to_s]
32
32
  origin_rubocop_todo.write(YAML.dump(new_origin_rubocop_todo))
33
33
 
34
- destination_rubocop_todo = file_move_operation.destination_pack.directory.join('.rubocop_todo.yml')
34
+ destination_rubocop_todo = file_move_operation.destination_pack.directory.join(RuboCop::Packs::PACK_LEVEL_RUBOCOP_TODO_YML)
35
35
  if destination_rubocop_todo.exist?
36
36
  new_destination_rubocop_todo = YAML.load_file(destination_rubocop_todo).dup
37
37
  else
@@ -19,13 +19,13 @@ module UsePackwerk
19
19
  <<~MSG
20
20
  Your next steps might be:
21
21
 
22
- 1) Move files into your pack with `bin/use_packwerk move #{pack_name} path/to/file.rb`
22
+ 1) Move files into your pack with `bin/packs move #{pack_name} path/to/file.rb`
23
23
 
24
24
  2) Run `bin/packwerk update-deprecations` to update the violations. Make sure to run `spring stop` if you've added new load paths (new top-level directories) in your pack.
25
25
 
26
26
  3) Update TODO lists for rubocop implemented protections. See #{documentation_link} for more info
27
27
 
28
- 4) Expose public API in #{pack_name}/app/public. Try `bin/use_packwerk make_public #{pack_name}/path/to/file.rb`
28
+ 4) Expose public API in #{pack_name}/app/public. Try `bin/packs make_public #{pack_name}/path/to/file.rb`
29
29
 
30
30
  5) Update your readme at #{pack_name}/README.md
31
31
  MSG
@@ -49,7 +49,7 @@ module UsePackwerk
49
49
 
50
50
  3) Touch base with each team who owns files involved in this move
51
51
 
52
- 4) Expose public API in #{pack_name}/app/public. Try `bin/use_packwerk make_public #{pack_name}/path/to/file.rb`
52
+ 4) Expose public API in #{pack_name}/app/public. Try `bin/packs make_public #{pack_name}/path/to/file.rb`
53
53
 
54
54
  5) Update your readme at #{pack_name}/README.md
55
55
  MSG
@@ -125,10 +125,10 @@ module UsePackwerk
125
125
  You can prevent other packs from using private API by using packwerk.
126
126
 
127
127
  Want to find how your private API is being used today?
128
- Try running: `bin/use_packwerk list_top_privacy_violations #{pack_name}`
128
+ Try running: `bin/packs list_top_privacy_violations #{pack_name}`
129
129
 
130
130
  Want to move something into this folder?
131
- Try running: `bin/use_packwerk make_public #{pack_name}/path/to/file.rb`
131
+ Try running: `bin/packs make_public #{pack_name}/path/to/file.rb`
132
132
 
133
133
  One more thing -- feel free to delete this file and replace it with a README.md describing your package in the main package directory.
134
134
 
@@ -170,7 +170,7 @@ module UsePackwerk
170
170
  else
171
171
  pack_specific_content = <<~PACK_CONTENT
172
172
  You are listing top #{limit} dependency violations for #{pack_name}. See #{documentation_link} for other utilities!
173
- Pass in a limit to display more or less, e.g. `bin/use_packwerk list_top_dependency_violations #{pack_name} -l 1000`
173
+ Pass in a limit to display more or less, e.g. `bin/packs list_top_dependency_violations #{pack_name} -l 1000`
174
174
 
175
175
  This script is intended to help you find which of YOUR pack's private classes, constants, or modules other packs are using the most.
176
176
  Anything not in #{pack_name}/app/public is considered private API.
@@ -211,7 +211,7 @@ module UsePackwerk
211
211
  if pack_name.nil?
212
212
  pack_specific_content = <<~PACK_CONTENT
213
213
  You are listing top #{limit} privacy violations for all packs. See #{documentation_link} for other utilities!
214
- Pass in a limit to display more or less, e.g. `bin/use_packwerk list_top_privacy_violations #{pack_name} -l 1000`
214
+ Pass in a limit to display more or less, e.g. `bin/packs list_top_privacy_violations #{pack_name} -l 1000`
215
215
 
216
216
  This script is intended to help you find which of YOUR pack's private classes, constants, or modules other packs are using the most.
217
217
  Anything not in pack_name/app/public is considered private API.
@@ -219,7 +219,7 @@ module UsePackwerk
219
219
  else
220
220
  pack_specific_content = <<~PACK_CONTENT
221
221
  You are listing top #{limit} privacy violations for #{pack_name}. See #{documentation_link} for other utilities!
222
- Pass in a limit to display more or less, e.g. `bin/use_packwerk list_top_privacy_violations #{pack_name} -l 1000`
222
+ Pass in a limit to display more or less, e.g. `bin/packs list_top_privacy_violations #{pack_name} -l 1000`
223
223
 
224
224
  This script is intended to help you find which of YOUR pack's private classes, constants, or modules other packs are using the most.
225
225
  Anything not in #{pack_name}/app/public is considered private API.
@@ -253,7 +253,7 @@ module UsePackwerk
253
253
  - packs/other_pack_a: 1
254
254
  - packs/other_pack_b: 1
255
255
 
256
- Lastly, remember you can use `bin/use_packwerk make_public #{pack_name}/path/to/file.rb` to make your class, constant, or module public API.
256
+ Lastly, remember you can use `bin/packs make_public #{pack_name}/path/to/file.rb` to make your class, constant, or module public API.
257
257
  MSG
258
258
  end
259
259
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.0
4
+ version: 0.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-15 00:00:00.000000000 Z
11
+ date: 2022-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership
@@ -281,7 +281,6 @@ description: UsePackwerk is a gem that helps in creating and maintaining packwer
281
281
  email:
282
282
  - dev@gusto.com
283
283
  executables:
284
- - use_packwerk
285
284
  - packs
286
285
  extensions: []
287
286
  extra_rdoc_files: []
@@ -290,7 +289,6 @@ files:
290
289
  - bin/packs
291
290
  - bin/rubocop
292
291
  - bin/tapioca
293
- - bin/use_packwerk
294
292
  - lib/use_packwerk.rb
295
293
  - lib/use_packwerk/cli.rb
296
294
  - lib/use_packwerk/code_ownership_post_processor.rb
data/bin/use_packwerk DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # typed: strict
3
-
4
- require_relative '../lib/use_packwerk'
5
- UsePackwerk::CLI.start(ARGV)