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.
- checksums.yaml +4 -4
- data/README.md +65 -24
- data/lib/use_packs/cli.rb +29 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e985f265dd9fc9a580f8ebe329bb89a41b3445a67ca4b4416cb627c7adf3ce6e
|
4
|
+
data.tar.gz: 31da3a703da54e26119c1075fb27b24aed4dd0b76c93af12c8b8de827b229d2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
9
|
-
|
8
|
+
## CLI Documentation
|
9
|
+
## Describe available commands or one specific command
|
10
|
+
`bin/packs help [COMMAND]`
|
10
11
|
|
11
|
-
|
12
|
-
`bin/packs create packs/
|
12
|
+
## Create pack with name packs/your_pack
|
13
|
+
`bin/packs create packs/your_pack`
|
13
14
|
|
14
|
-
|
15
|
-
`bin/packs
|
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
|
-
|
18
|
+
Use this to add a dependency between packs.
|
20
19
|
|
21
|
-
|
22
|
-
|
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
|
-
|
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
|
-
|
36
|
-
`bin/packs
|
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
|
-
|
46
|
+
This moves a file or directory to public API (that is -- the `app/public` folder).
|
40
47
|
|
41
|
-
|
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
|
-
|
44
|
-
`bin/packs
|
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
|
-
|
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', '
|
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', '
|
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', '
|
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 ', '
|
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!(
|