use_packs 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +65 -24
  3. data/lib/use_packs/cli.rb +29 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5450c6c78c1c7257449c5b3e9cd7e9301be0642af31a9324051cfd97cea5045f
4
- data.tar.gz: 13028e1163d760e183bff5d9840b11e1148ca9718900652fe9a4246ae040ad23
3
+ metadata.gz: e985f265dd9fc9a580f8ebe329bb89a41b3445a67ca4b4416cb627c7adf3ce6e
4
+ data.tar.gz: 31da3a703da54e26119c1075fb27b24aed4dd0b76c93af12c8b8de827b229d2e
5
5
  SHA512:
6
- metadata.gz: cf4115115841e5242ca58aafbf105e6c0cd35acf1e945a20f67b71e8163866705e03ac58ae9a0dfe412342b95b1e7ffe60e9662e61a1ef0f3aa7e182e0b8bf8a
7
- data.tar.gz: 9ae241757c61197ccda052f06263180ece2e907680125e69405a533d0063875eb43217ee078f22654f43e1a98c558db6ed29c0477964197946482b4bc417b16b
6
+ metadata.gz: 4ead72b2296e414cbc512c476ff11e0df9ac53b7407920534742d9039e917998d2e329758666c3a201a339b1c6359189303b8b5b1661265441246c67425d6ea1
7
+ data.tar.gz: e54e4771949e4d9ff229fd1c440e09a9ba042deebf1636a0e3bf1e8a2205078243dcb265d07f48357cb6e44babbd55dc1b6f8ce7013316eec7427f63ab8fb039
data/README.md CHANGED
@@ -5,47 +5,88 @@ UsePacks is a gem that helps in creating and maintaining packs. It exists to hel
5
5
  ## Usage
6
6
  Make sure to run `bundle binstub use_packs` to generate `bin/packs` within your application.
7
7
 
8
- ### General Help
9
- `bin/packs --help` or just `bin/packs` to enter interactive mode.
8
+ ## CLI Documentation
9
+ ## Describe available commands or one specific command
10
+ `bin/packs help [COMMAND]`
10
11
 
11
- ### Pack Creation
12
- `bin/packs create packs/your_pack_name_here`
12
+ ## Create pack with name packs/your_pack
13
+ `bin/packs create packs/your_pack`
13
14
 
14
- ### Moving files to packs
15
- `bin/packs move packs/your_pack_name_here path/to/file.rb path/to/directory`
16
- This is used for moving files into a pack (the pack must already exist).
17
- Note this works for moving files to packs from the monolith or from other packs
15
+ ## Add packs/to_pack to packs/from_pack/package.yml list of dependencies
16
+ `bin/packs add_dependency packs/from_pack packs/to_pack`
18
17
 
19
- Make sure there are no spaces between the comma-separated list of paths of directories.
18
+ Use this to add a dependency between packs.
20
19
 
21
- ### Moving a file to public API
22
- `bin/packs make_public path/to/file.rb,path/to/directory`
23
- This moves a file or directory to public API (that is -- the `app/public` folder).
20
+ When you use bin/packs add_dependency packs/from_pack packs/to_pack, this command will
21
+ modify packs/from_pack/package.yml's list of dependencies and add packs/to_pack.
24
22
 
25
- Make sure there are no spaces between the comma-separated list of paths of directories.
23
+ This command will also sort the list and make it unique.
24
+
25
+ ## List the top dependency violations of packs/your_pack
26
+ `bin/packs list_top_dependency_violations packs/your_pack`
27
+
28
+ Want to see who is depending on you? Not sure how your pack's code is being used in an unstated way
29
+
30
+ You can use this command to list the top dependency violations.
31
+
32
+ If no pack name is passed in, this will list out violations across all packs.
33
+
34
+ ## List the top privacy violations of packs/your_pack
35
+ `bin/packs list_top_privacy_violations packs/your_pack`
26
36
 
27
- ### Listing top privacy violations
28
- `bin/packs list_top_privacy_violations packs/my_pack`
29
37
  Want to create interfaces? Not sure how your pack's code is being used?
30
38
 
31
39
  You can use this command to list the top privacy violations.
32
40
 
33
41
  If no pack name is passed in, this will list out violations across all packs.
34
42
 
35
- ### Listing top dependency violations
36
- `bin/packs list_top_dependency_violations packs/my_pack`
37
- Want to see who is depending on you? Not sure how your pack's code is being used in an unstated way
43
+ ## Make files or directories public API
44
+ `bin/packs make_public path/to/file.rb path/to/directory`
38
45
 
39
- You can use this command to list the top dependency violations.
46
+ This moves a file or directory to public API (that is -- the `app/public` folder).
40
47
 
41
- If no pack name is passed in, this will list out violations across all packs.
48
+ Make sure there are no spaces between the comma-separated list of paths of directories.
49
+
50
+ ## Move files or directories from one pack to another
51
+ `bin/packs move packs/destination_pack path/to/file.rb path/to/directory`
52
+
53
+ This is used for moving files into a pack (the pack must already exist).
54
+ Note this works for moving files to packs from the monolith or from other packs
55
+
56
+ Make sure there are no spaces between the comma-separated list of paths of directories.
57
+
58
+ ## Lint `package_todo.yml` files to check for formatting issues
59
+ `bin/packs lint_package_todo_yml_files`
60
+
61
+ ## Lint `package.yml` files
62
+ `bin/packs lint_package_yml_files [ packs/my_pack packs/my_other_pack ]`
63
+
64
+ ## Run bin/packwerk validate (detects cycles)
65
+ `bin/packs validate`
66
+
67
+ ## Run bin/packwerk check
68
+ `bin/packs check [ packs/my_pack ]`
69
+
70
+ ## Run bin/packwerk update-todo
71
+ `bin/packs update`
72
+
73
+ ## Regenerate packs/*/package_rubocop_todo.yml for one or more packs
74
+ `bin/packs regenerate_rubocop_todo [ packs/my_pack packs/my_other_pack ]`
75
+
76
+ ## Get info about size and violations for packs
77
+ `bin/packs get_info [ packs/my_pack packs/my_other_pack ]`
78
+
79
+ ## Visualize packs
80
+ `bin/packs visualize [ packs/my_pack packs/my_other_pack ]`
81
+
82
+ ## Rename a pack
83
+ `bin/packs rename`
42
84
 
43
- ### Adding a dependency
44
- `bin/packs add_dependency packs/my_pack packs/dependency_pack_name`
85
+ ## Set packs/child_pack as a child of packs/parent_pack
86
+ `bin/packs move_to_parent packs/child_pack packs/parent_pack `
45
87
 
46
- 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.
47
88
 
48
- ### Releasing
89
+ ## Releasing
49
90
  Releases happen automatically through github actions once a version update is committed to `main`.
50
91
 
51
92
  ## Discussions, Issues, Questions, and More
data/lib/use_packs/cli.rb CHANGED
@@ -30,6 +30,13 @@ module UsePacks
30
30
  end
31
31
 
32
32
  desc 'list_top_dependency_violations packs/your_pack', 'List the top dependency violations of packs/your_pack'
33
+ long_desc <<~LONG_DESC
34
+ Want to see who is depending on you? Not sure how your pack's code is being used in an unstated way
35
+
36
+ You can use this command to list the top dependency violations.
37
+
38
+ If no pack name is passed in, this will list out violations across all packs.
39
+ LONG_DESC
33
40
  option :limit, type: :numeric, default: 10, aliases: :l, banner: 'Specify the limit of constants to analyze'
34
41
  sig { params(pack_name: String).void }
35
42
  def list_top_dependency_violations(pack_name)
@@ -40,6 +47,13 @@ module UsePacks
40
47
  end
41
48
 
42
49
  desc 'list_top_privacy_violations packs/your_pack', 'List the top privacy violations of packs/your_pack'
50
+ long_desc <<~LONG_DESC
51
+ Want to create interfaces? Not sure how your pack's code is being used?
52
+
53
+ You can use this command to list the top privacy violations.
54
+
55
+ If no pack name is passed in, this will list out violations across all packs.
56
+ LONG_DESC
43
57
  option :limit, type: :numeric, default: 10, aliases: :l, banner: 'Specify the limit of constants to analyze'
44
58
  sig { params(pack_name: String).void }
45
59
  def list_top_privacy_violations(pack_name)
@@ -49,7 +63,12 @@ module UsePacks
49
63
  )
50
64
  end
51
65
 
52
- desc 'make_public path/to/file.rb path/to/directory', 'Pass in a space-separated list of file or directory paths to make public'
66
+ desc 'make_public path/to/file.rb path/to/directory', 'Make files or directories public API'
67
+ long_desc <<~LONG_DESC
68
+ This moves a file or directory to public API (that is -- the `app/public` folder).
69
+
70
+ Make sure there are no spaces between the comma-separated list of paths of directories.
71
+ LONG_DESC
53
72
  sig { params(paths: String).void }
54
73
  def make_public(*paths)
55
74
  UsePacks.make_public!(
@@ -58,7 +77,13 @@ module UsePacks
58
77
  )
59
78
  end
60
79
 
61
- 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'
80
+ desc 'move packs/destination_pack path/to/file.rb path/to/directory', 'Move files or directories from one pack to another'
81
+ long_desc <<~LONG_DESC
82
+ This is used for moving files into a pack (the pack must already exist).
83
+ Note this works for moving files to packs from the monolith or from other packs
84
+
85
+ Make sure there are no spaces between the comma-separated list of paths of directories.
86
+ LONG_DESC
62
87
  sig { params(pack_name: String, paths: String).void }
63
88
  def move(pack_name, *paths)
64
89
  UsePacks.move_to_pack!(
@@ -68,7 +93,7 @@ module UsePacks
68
93
  )
69
94
  end
70
95
 
71
- desc 'lint_package_todo_yml_files', 'Ensures `package_todo.yml` files are up to date'
96
+ desc 'lint_package_todo_yml_files', 'Lint `package_todo.yml` files to check for formatting issues'
72
97
  sig { void }
73
98
  def lint_package_todo_yml_files
74
99
  UsePacks.lint_package_todo_yml_files!
@@ -122,7 +147,7 @@ module UsePacks
122
147
  puts Private.rename_pack
123
148
  end
124
149
 
125
- desc 'move_to_parent packs/child_pack packs/parent_pack ', 'Sets packs/child_pack as a child of packs/parent_pack'
150
+ desc 'move_to_parent packs/child_pack packs/parent_pack ', 'Set packs/child_pack as a child of packs/parent_pack'
126
151
  sig { params(child_pack_name: String, parent_pack_name: String).void }
127
152
  def move_to_parent(child_pack_name, parent_pack_name)
128
153
  UsePacks.move_to_parent!(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_packs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers