use_packwerk 0.60.1 → 0.61.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: b89e9d11b71005c2908d2fd78c021fe0b9ea2d126558811ac0947c3d835e1c3d
4
- data.tar.gz: 5102a8a031920ca3d8573ef3bad99033b22eadb0304baa3287c328e3ff6eb3fc
3
+ metadata.gz: 6c4a14c7a607d7c5778ec8dc79c199dbcb3dd5698db1e7d5f7c70e5b0deff5fa
4
+ data.tar.gz: 73022ab6fa41370d82ab39610528ba393bc3559de7a764832c7107ec6048f408
5
5
  SHA512:
6
- metadata.gz: dd544d69805e4a771b15a4a4311a094d7957df495e9f8f197604916641e844dfab711019951513e6a9bda283e25886c91a8c5028d1b0f75085c7b23890268a2b
7
- data.tar.gz: eae73ccc82d61a086e7cf88068c7710ac47e1259a64fb1ff4bf3e14e8f230fc98ffc8b80dd9d90bed3016198b75cd52d32f2dbb971a5566a274504b925205687
6
+ metadata.gz: 98721b214ca79437c0dd5f4fa617df51cd2ea00d6373f01a28ee51a8799b281965d58aa68cc1c36100d79f639c30cb68e47acfbaebc3c8b57812a702c1ef798f
7
+ data.tar.gz: 38e8aafc4cbd3b0e38bfda5f24087efbc33185f2e787568088e8afb98e67441eb62ebaf42c27b0e4d489637949316a6834989d2f8d99e5fd7ee8e002ab580e64
data/bin/rubocop ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+
29
+ load Gem.bin_path('rubocop', 'rubocop')
data/bin/tapioca ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'tapioca' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+
29
+ load Gem.bin_path('tapioca', 'tapioca')
@@ -0,0 +1,44 @@
1
+ # typed: strict
2
+
3
+ require 'visualize_packwerk'
4
+
5
+ module UsePackwerk
6
+ module Private
7
+ module InteractiveCli
8
+ module UseCases
9
+ class Visualize
10
+ extend T::Sig
11
+ extend T::Helpers
12
+ include Interface
13
+
14
+ sig { override.params(prompt: TTY::Prompt).void }
15
+ def perform!(prompt)
16
+ teams_or_packs = prompt.select('Do you want the graph nodes to be teams or packs?', %w[Teams Packs])
17
+
18
+ if teams_or_packs == 'Teams'
19
+ teams = TeamSelector.multi_select(prompt)
20
+ VisualizePackwerk.team_graph!(teams)
21
+ else
22
+ by_name_or_by_owner = prompt.select('Do you select packs by name or by owner?', ['By name', 'By owner'])
23
+ if by_name_or_by_owner == 'By owner'
24
+ teams = TeamSelector.multi_select(prompt)
25
+ selected_packs = ParsePackwerk.all.select do |p|
26
+ teams.map(&:name).include?(CodeOwnership.for_package(p)&.name)
27
+ end
28
+ else
29
+ selected_packs = PackSelector.single_or_all_pack_multi_select(prompt)
30
+ end
31
+
32
+ VisualizePackwerk.package_graph!(selected_packs)
33
+ end
34
+ end
35
+
36
+ sig { override.returns(String) }
37
+ def user_facing_name
38
+ 'Visualize pack relationships'
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -18,6 +18,7 @@ require 'use_packwerk/private/interactive_cli/use_cases/update_deprecations'
18
18
  require 'use_packwerk/private/interactive_cli/use_cases/validate'
19
19
  require 'use_packwerk/private/interactive_cli/use_cases/regenerate_rubocop_todo'
20
20
  require 'use_packwerk/private/interactive_cli/use_cases/lint_package_yml'
21
+ require 'use_packwerk/private/interactive_cli/use_cases/visualize'
21
22
 
22
23
  module UsePackwerk
23
24
  module Private
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.60.1
4
+ version: 0.61.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-10-31 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: visualize_packwerk
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: bundler
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -288,6 +302,8 @@ extra_rdoc_files: []
288
302
  files:
289
303
  - README.md
290
304
  - bin/packs
305
+ - bin/rubocop
306
+ - bin/tapioca
291
307
  - bin/use_packwerk
292
308
  - lib/use_packwerk.rb
293
309
  - lib/use_packwerk/cli.rb
@@ -314,6 +330,7 @@ files:
314
330
  - lib/use_packwerk/private/interactive_cli/use_cases/rename.rb
315
331
  - lib/use_packwerk/private/interactive_cli/use_cases/update_deprecations.rb
316
332
  - lib/use_packwerk/private/interactive_cli/use_cases/validate.rb
333
+ - lib/use_packwerk/private/interactive_cli/use_cases/visualize.rb
317
334
  - lib/use_packwerk/private/pack_relationship_analyzer.rb
318
335
  - lib/use_packwerk/private/packwerk_wrapper.rb
319
336
  - lib/use_packwerk/private/packwerk_wrapper/offenses_aggregator_formatter.rb