use_packwerk 0.64.0 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/bin/packs +6 -1
- data/lib/use_packwerk/cli.rb +1 -1
- data/lib/use_packwerk/private/interactive_cli.rb +3 -3
- data/lib/use_packwerk/user_event_logger.rb +9 -9
- metadata +1 -3
- data/bin/use_packwerk +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09fba875e35dbc9bec54523ce0d6b778624029daa850c4daf2320dc753064205'
|
4
|
+
data.tar.gz: f56b46f76d3111e04f1a09f642843fd48be5a656c336366ecfe2db796f26f0ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
7
|
+
`bin/packs --help` or just `bin/packs` to enter interactive mode.
|
8
8
|
|
9
9
|
### Pack Creation
|
10
|
-
`bin/
|
10
|
+
`bin/packs create packs/your_pack_name_here`
|
11
11
|
|
12
12
|
### Moving files to packs
|
13
|
-
`bin/
|
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/
|
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/
|
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/
|
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/
|
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
data/lib/use_packwerk/cli.rb
CHANGED
@@ -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/
|
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.
|
@@ -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
|
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)'
|
@@ -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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_packwerk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.65.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
@@ -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
|