packwerk 1.0.2 → 1.2.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/.github/workflows/ci.yml +14 -5
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +129 -111
- data/README.md +8 -1
- data/USAGE.md +39 -17
- data/dev.yml +1 -1
- data/exe/packwerk +1 -1
- data/gemfiles/Gemfile-rails-6-0 +22 -0
- data/lib/packwerk.rb +73 -34
- data/lib/packwerk/application_load_paths.rb +3 -2
- data/lib/packwerk/application_validator.rb +85 -69
- data/lib/packwerk/association_inspector.rb +23 -11
- data/lib/packwerk/checker.rb +4 -7
- data/lib/packwerk/cli.rb +36 -93
- data/lib/packwerk/configuration.rb +10 -2
- data/lib/packwerk/const_node_inspector.rb +13 -14
- data/lib/packwerk/constant_discovery.rb +2 -0
- data/lib/packwerk/constant_name_inspector.rb +0 -1
- data/lib/packwerk/dependency_checker.rb +12 -17
- data/lib/packwerk/deprecated_references.rb +25 -8
- data/lib/packwerk/file_processor.rb +0 -4
- data/lib/packwerk/formatters/offenses_formatter.rb +43 -0
- data/lib/packwerk/formatters/progress_formatter.rb +9 -4
- data/lib/packwerk/generators/configuration_file.rb +0 -1
- data/lib/packwerk/inflector.rb +0 -2
- data/lib/packwerk/node.rb +9 -2
- data/lib/packwerk/node_processor.rb +15 -32
- data/lib/packwerk/node_processor_factory.rb +0 -5
- data/lib/packwerk/node_visitor.rb +1 -4
- data/lib/packwerk/offense.rb +2 -8
- data/lib/packwerk/offense_collection.rb +84 -0
- data/lib/packwerk/offenses_formatter.rb +15 -0
- data/lib/packwerk/output_style.rb +20 -0
- data/lib/packwerk/output_styles/coloured.rb +29 -0
- data/lib/packwerk/output_styles/plain.rb +26 -0
- data/lib/packwerk/package.rb +8 -0
- data/lib/packwerk/package_set.rb +8 -5
- data/lib/packwerk/parse_run.rb +104 -0
- data/lib/packwerk/parsed_constant_definitions.rb +2 -4
- data/lib/packwerk/parsers.rb +0 -2
- data/lib/packwerk/parsers/erb.rb +4 -2
- data/lib/packwerk/parsers/factory.rb +10 -3
- data/lib/packwerk/privacy_checker.rb +22 -17
- data/lib/packwerk/reference_extractor.rb +0 -8
- data/lib/packwerk/reference_offense.rb +49 -0
- data/lib/packwerk/result.rb +9 -0
- data/lib/packwerk/run_context.rb +4 -20
- data/lib/packwerk/sanity_checker.rb +1 -3
- data/lib/packwerk/spring_command.rb +1 -1
- data/lib/packwerk/version.rb +1 -1
- data/lib/packwerk/violation_type.rb +0 -2
- data/library.yml +1 -1
- data/packwerk.gemspec +1 -0
- data/service.yml +1 -4
- data/shipit.rubygems.yml +5 -1
- data/sorbet/rbi/gems/{actioncable@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actioncable@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +56 -36
- data/sorbet/rbi/gems/{actionmailbox@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionmailbox@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +25 -28
- data/sorbet/rbi/gems/{actionmailer@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionmailer@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +43 -24
- data/sorbet/rbi/gems/{actionpack@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionpack@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +382 -284
- data/sorbet/rbi/gems/{actiontext@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actiontext@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +76 -40
- data/sorbet/rbi/gems/{actionview@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → actionview@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +206 -195
- data/sorbet/rbi/gems/{activejob@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activejob@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +64 -75
- data/sorbet/rbi/gems/{activemodel@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activemodel@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +103 -56
- data/sorbet/rbi/gems/{activerecord@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activerecord@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +1250 -898
- data/sorbet/rbi/gems/{activestorage@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activestorage@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +92 -120
- data/sorbet/rbi/gems/{activesupport@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → activesupport@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +292 -193
- data/sorbet/rbi/gems/{ast@2.4.1.rbi → ast@2.4.2.rbi} +2 -1
- data/sorbet/rbi/gems/{better_html@1.0.15.rbi → better_html@1.0.16.rbi} +2 -2
- data/sorbet/rbi/gems/{concurrent-ruby@1.1.6.rbi → concurrent-ruby@1.1.8.rbi} +12 -9
- data/sorbet/rbi/gems/{erubi@1.9.0.rbi → erubi@1.10.0.rbi} +3 -1
- data/sorbet/rbi/gems/{i18n@1.8.2.rbi → i18n@1.8.10.rbi} +19 -52
- data/sorbet/rbi/gems/{loofah@2.5.0.rbi → loofah@2.9.0.rbi} +3 -1
- data/sorbet/rbi/gems/marcel@1.0.0.rbi +70 -0
- data/sorbet/rbi/gems/{mini_mime@1.0.2.rbi → mini_mime@1.0.3.rbi} +6 -6
- data/sorbet/rbi/gems/{mini_portile2@2.4.0.rbi → minitest-focus@1.2.1.rbi} +2 -2
- data/sorbet/rbi/gems/{minitest@5.14.0.rbi → minitest@5.14.4.rbi} +31 -29
- data/sorbet/rbi/gems/{mocha@1.11.2.rbi → mocha@1.12.0.rbi} +25 -36
- data/sorbet/rbi/gems/{nio4r@2.5.2.rbi → nio4r@2.5.7.rbi} +21 -20
- data/sorbet/rbi/gems/{nokogiri@1.10.9.rbi → nokogiri@1.11.2.rbi} +193 -154
- data/sorbet/rbi/gems/parallel@1.20.1.rbi +117 -0
- data/sorbet/rbi/gems/parlour@6.0.0.rbi +1272 -0
- data/sorbet/rbi/gems/{parser@2.7.1.4.rbi → parser@3.0.0.0.rbi} +287 -174
- data/sorbet/rbi/gems/{pry@0.13.1.rbi → pry@0.14.0.rbi} +1 -1
- data/sorbet/rbi/gems/racc@1.5.2.rbi +57 -0
- data/sorbet/rbi/gems/{rack@2.2.2.rbi → rack@2.2.3.rbi} +23 -35
- data/sorbet/rbi/gems/{rails@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → rails@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +1 -1
- data/sorbet/rbi/gems/{railties@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi → railties@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi} +132 -121
- data/sorbet/rbi/gems/{rake@13.0.1.rbi → rake@13.0.3.rbi} +16 -20
- data/sorbet/rbi/gems/{parallel@1.19.1.rbi → regexp_parser@2.1.1.rbi} +2 -2
- data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +8 -0
- data/sorbet/rbi/gems/{rubocop-performance@1.5.2.rbi → rubocop-performance@1.10.2.rbi} +1 -1
- data/sorbet/rbi/gems/{rubocop-shopify@1.0.2.rbi → rubocop-shopify@2.0.1.rbi} +1 -1
- data/sorbet/rbi/gems/{rubocop-sorbet@0.3.7.rbi → rubocop-sorbet@0.6.1.rbi} +1 -1
- data/sorbet/rbi/gems/{rubocop@0.82.0.rbi → rubocop@1.12.0.rbi} +1 -1
- data/sorbet/rbi/gems/{ruby-progressbar@1.10.1.rbi → ruby-progressbar@1.11.0.rbi} +1 -1
- data/sorbet/rbi/gems/spoom@1.1.0.rbi +1061 -0
- data/sorbet/rbi/gems/{spring@2.1.0.rbi → spring@2.1.1.rbi} +7 -7
- data/sorbet/rbi/gems/{sprockets-rails@3.2.1.rbi → sprockets-rails@3.2.2.rbi} +88 -68
- data/sorbet/rbi/gems/{sprockets@4.0.0.rbi → sprockets@4.0.2.rbi} +8 -7
- data/sorbet/rbi/gems/{tapioca@0.4.5.rbi → tapioca@0.4.19.rbi} +109 -24
- data/sorbet/rbi/gems/{thor@1.0.1.rbi → thor@1.1.0.rbi} +16 -15
- data/sorbet/rbi/gems/{tzinfo@2.0.2.rbi → tzinfo@2.0.4.rbi} +21 -2
- data/sorbet/rbi/gems/{unicode-display_width@1.7.0.rbi → unicode-display_width@2.0.0.rbi} +1 -1
- data/sorbet/rbi/gems/{websocket-driver@0.7.1.rbi → websocket-driver@0.7.3.rbi} +29 -29
- data/sorbet/rbi/gems/{websocket-extensions@0.1.4.rbi → websocket-extensions@0.1.5.rbi} +2 -2
- data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +177 -0
- data/sorbet/tapioca/require.rb +1 -0
- metadata +78 -57
- data/lib/packwerk/checking_deprecated_references.rb +0 -40
- data/lib/packwerk/output_styles.rb +0 -41
- data/lib/packwerk/reference_lister.rb +0 -23
- data/lib/packwerk/updating_deprecated_references.rb +0 -51
- data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +0 -8
- data/sorbet/rbi/gems/marcel@0.3.3.rbi +0 -30
- data/sorbet/rbi/gems/mimemagic@0.3.5.rbi +0 -47
- data/sorbet/rbi/gems/parlour@4.0.1.rbi +0 -561
- data/sorbet/rbi/gems/spoom@1.0.4.rbi +0 -418
- data/sorbet/rbi/gems/zeitwerk@2.3.0.rbi +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ced63ca0995c039913777f3e8ba1aac428970d8fc515b1629c9212f71baab34b
|
4
|
+
data.tar.gz: 331b0a5f30e7104b4eb3e44920739ea592e7e3dc7df3dca339a74260fa13d62b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a487a501ca28d341a888eea2e0ec13c4831897680ce1d17bef2a4943408ff718d75cffe9a50030fd93d7a2388d161c7a3cd946a0764930f89016c2f2c81e5306
|
7
|
+
data.tar.gz: d4685f869617c8b1141125fcaacbde96839be3d239aa2422db6f76dbcb485f42fcde97e0c6aaa580ef4abcd847ebbfd9979fe4896f0bc5c7421d104673346981
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,10 +7,19 @@ jobs:
|
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
+
gemfile:
|
11
|
+
- Gemfile
|
12
|
+
- gemfiles/Gemfile-rails-6-0
|
10
13
|
ruby:
|
11
14
|
- 2.6
|
12
15
|
- 2.7
|
13
|
-
|
16
|
+
- 3.0
|
17
|
+
exclude:
|
18
|
+
- ruby: 2.6
|
19
|
+
gemfile: Gemfile
|
20
|
+
env:
|
21
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
22
|
+
name: "Tests: Ruby ${{ matrix.ruby }} ${{ matrix.gemfile }}"
|
14
23
|
steps:
|
15
24
|
- uses: actions/checkout@v1
|
16
25
|
- name: Set up Ruby ${{ matrix.ruby }}
|
@@ -26,10 +35,10 @@ jobs:
|
|
26
35
|
runs-on: ubuntu-latest
|
27
36
|
steps:
|
28
37
|
- uses: actions/checkout@v1
|
29
|
-
- name: Set up Ruby
|
38
|
+
- name: Set up Ruby
|
30
39
|
uses: actions/setup-ruby@v1
|
31
40
|
with:
|
32
|
-
ruby-version:
|
41
|
+
ruby-version: 3.0.x
|
33
42
|
- name: Run style checks
|
34
43
|
run: |
|
35
44
|
gem install bundler
|
@@ -39,10 +48,10 @@ jobs:
|
|
39
48
|
runs-on: ubuntu-latest
|
40
49
|
steps:
|
41
50
|
- uses: actions/checkout@v1
|
42
|
-
- name: Set up Ruby
|
51
|
+
- name: Set up Ruby
|
43
52
|
uses: actions/setup-ruby@v1
|
44
53
|
with:
|
45
|
-
ruby-version:
|
54
|
+
ruby-version: 3.0.x
|
46
55
|
- name: Run static type checks
|
47
56
|
run: |
|
48
57
|
gem install bundler
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ gemspec
|
|
8
8
|
# Specify the same dependency sources as the application Gemfile
|
9
9
|
|
10
10
|
gem("spring")
|
11
|
-
gem("rails", github: "rails/rails")
|
11
|
+
gem("rails", github: "rails/rails", branch: "main")
|
12
12
|
gem("constant_resolver", require: false)
|
13
13
|
gem("sorbet-runtime", require: false)
|
14
14
|
gem("rubocop-performance", require: false)
|
data/Gemfile.lock
CHANGED
@@ -1,103 +1,106 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/rails/rails.git
|
3
|
-
revision:
|
3
|
+
revision: d612542336d9a61381311c95a27d801bb4094779
|
4
|
+
branch: main
|
4
5
|
specs:
|
5
|
-
actioncable (
|
6
|
-
actionpack (=
|
7
|
-
activesupport (=
|
6
|
+
actioncable (7.0.0.alpha)
|
7
|
+
actionpack (= 7.0.0.alpha)
|
8
|
+
activesupport (= 7.0.0.alpha)
|
8
9
|
nio4r (~> 2.0)
|
9
10
|
websocket-driver (>= 0.6.1)
|
10
|
-
actionmailbox (
|
11
|
-
actionpack (=
|
12
|
-
activejob (=
|
13
|
-
activerecord (=
|
14
|
-
activestorage (=
|
15
|
-
activesupport (=
|
11
|
+
actionmailbox (7.0.0.alpha)
|
12
|
+
actionpack (= 7.0.0.alpha)
|
13
|
+
activejob (= 7.0.0.alpha)
|
14
|
+
activerecord (= 7.0.0.alpha)
|
15
|
+
activestorage (= 7.0.0.alpha)
|
16
|
+
activesupport (= 7.0.0.alpha)
|
16
17
|
mail (>= 2.7.1)
|
17
|
-
actionmailer (
|
18
|
-
actionpack (=
|
19
|
-
actionview (=
|
20
|
-
activejob (=
|
21
|
-
activesupport (=
|
18
|
+
actionmailer (7.0.0.alpha)
|
19
|
+
actionpack (= 7.0.0.alpha)
|
20
|
+
actionview (= 7.0.0.alpha)
|
21
|
+
activejob (= 7.0.0.alpha)
|
22
|
+
activesupport (= 7.0.0.alpha)
|
22
23
|
mail (~> 2.5, >= 2.5.4)
|
23
24
|
rails-dom-testing (~> 2.0)
|
24
|
-
actionpack (
|
25
|
-
actionview (=
|
26
|
-
activesupport (=
|
25
|
+
actionpack (7.0.0.alpha)
|
26
|
+
actionview (= 7.0.0.alpha)
|
27
|
+
activesupport (= 7.0.0.alpha)
|
27
28
|
rack (~> 2.0, >= 2.0.9)
|
28
29
|
rack-test (>= 0.6.3)
|
29
30
|
rails-dom-testing (~> 2.0)
|
30
31
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
31
|
-
actiontext (
|
32
|
-
actionpack (=
|
33
|
-
activerecord (=
|
34
|
-
activestorage (=
|
35
|
-
activesupport (=
|
32
|
+
actiontext (7.0.0.alpha)
|
33
|
+
actionpack (= 7.0.0.alpha)
|
34
|
+
activerecord (= 7.0.0.alpha)
|
35
|
+
activestorage (= 7.0.0.alpha)
|
36
|
+
activesupport (= 7.0.0.alpha)
|
36
37
|
nokogiri (>= 1.8.5)
|
37
|
-
actionview (
|
38
|
-
activesupport (=
|
38
|
+
actionview (7.0.0.alpha)
|
39
|
+
activesupport (= 7.0.0.alpha)
|
39
40
|
builder (~> 3.1)
|
40
41
|
erubi (~> 1.4)
|
41
42
|
rails-dom-testing (~> 2.0)
|
42
43
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
43
|
-
activejob (
|
44
|
-
activesupport (=
|
44
|
+
activejob (7.0.0.alpha)
|
45
|
+
activesupport (= 7.0.0.alpha)
|
45
46
|
globalid (>= 0.3.6)
|
46
|
-
activemodel (
|
47
|
-
activesupport (=
|
48
|
-
activerecord (
|
49
|
-
activemodel (=
|
50
|
-
activesupport (=
|
51
|
-
activestorage (
|
52
|
-
actionpack (=
|
53
|
-
activejob (=
|
54
|
-
activerecord (=
|
55
|
-
activesupport (=
|
56
|
-
marcel (~> 0.
|
57
|
-
|
47
|
+
activemodel (7.0.0.alpha)
|
48
|
+
activesupport (= 7.0.0.alpha)
|
49
|
+
activerecord (7.0.0.alpha)
|
50
|
+
activemodel (= 7.0.0.alpha)
|
51
|
+
activesupport (= 7.0.0.alpha)
|
52
|
+
activestorage (7.0.0.alpha)
|
53
|
+
actionpack (= 7.0.0.alpha)
|
54
|
+
activejob (= 7.0.0.alpha)
|
55
|
+
activerecord (= 7.0.0.alpha)
|
56
|
+
activesupport (= 7.0.0.alpha)
|
57
|
+
marcel (~> 1.0.0)
|
58
|
+
mini_mime (~> 1.0.2)
|
59
|
+
activesupport (7.0.0.alpha)
|
58
60
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
59
61
|
i18n (>= 1.6, < 2)
|
60
|
-
minitest (
|
62
|
+
minitest (>= 5.1)
|
61
63
|
tzinfo (~> 2.0)
|
62
64
|
zeitwerk (~> 2.3)
|
63
|
-
rails (
|
64
|
-
actioncable (=
|
65
|
-
actionmailbox (=
|
66
|
-
actionmailer (=
|
67
|
-
actionpack (=
|
68
|
-
actiontext (=
|
69
|
-
actionview (=
|
70
|
-
activejob (=
|
71
|
-
activemodel (=
|
72
|
-
activerecord (=
|
73
|
-
activestorage (=
|
74
|
-
activesupport (=
|
75
|
-
bundler (>= 1.
|
76
|
-
railties (=
|
65
|
+
rails (7.0.0.alpha)
|
66
|
+
actioncable (= 7.0.0.alpha)
|
67
|
+
actionmailbox (= 7.0.0.alpha)
|
68
|
+
actionmailer (= 7.0.0.alpha)
|
69
|
+
actionpack (= 7.0.0.alpha)
|
70
|
+
actiontext (= 7.0.0.alpha)
|
71
|
+
actionview (= 7.0.0.alpha)
|
72
|
+
activejob (= 7.0.0.alpha)
|
73
|
+
activemodel (= 7.0.0.alpha)
|
74
|
+
activerecord (= 7.0.0.alpha)
|
75
|
+
activestorage (= 7.0.0.alpha)
|
76
|
+
activesupport (= 7.0.0.alpha)
|
77
|
+
bundler (>= 1.15.0)
|
78
|
+
railties (= 7.0.0.alpha)
|
77
79
|
sprockets-rails (>= 2.0.0)
|
78
|
-
railties (
|
79
|
-
actionpack (=
|
80
|
-
activesupport (=
|
80
|
+
railties (7.0.0.alpha)
|
81
|
+
actionpack (= 7.0.0.alpha)
|
82
|
+
activesupport (= 7.0.0.alpha)
|
81
83
|
method_source
|
82
|
-
rake (>= 0.
|
84
|
+
rake (>= 0.13)
|
83
85
|
thor (~> 1.0)
|
84
86
|
|
85
87
|
PATH
|
86
88
|
remote: .
|
87
89
|
specs:
|
88
|
-
packwerk (1.0
|
90
|
+
packwerk (1.2.0)
|
89
91
|
activesupport (>= 5.2)
|
90
92
|
ast
|
91
93
|
better_html
|
92
94
|
constant_resolver
|
95
|
+
parallel
|
93
96
|
parser
|
94
97
|
sorbet-runtime
|
95
98
|
|
96
99
|
GEM
|
97
100
|
remote: https://rubygems.org/
|
98
101
|
specs:
|
99
|
-
ast (2.4.
|
100
|
-
better_html (1.0.
|
102
|
+
ast (2.4.2)
|
103
|
+
better_html (1.0.16)
|
101
104
|
actionview (>= 4.0)
|
102
105
|
activesupport (>= 4.0)
|
103
106
|
ast (~> 2.0)
|
@@ -111,18 +114,17 @@ GEM
|
|
111
114
|
colorize (0.8.1)
|
112
115
|
commander (4.5.2)
|
113
116
|
highline (~> 2.0.0)
|
114
|
-
concurrent-ruby (1.1.
|
117
|
+
concurrent-ruby (1.1.8)
|
115
118
|
constant_resolver (0.1.5)
|
116
119
|
crass (1.0.6)
|
117
|
-
erubi (1.
|
120
|
+
erubi (1.10.0)
|
118
121
|
globalid (0.4.2)
|
119
122
|
activesupport (>= 4.2.0)
|
120
123
|
highline (2.0.3)
|
121
124
|
html_tokenizer (0.0.7)
|
122
|
-
i18n (1.8.
|
125
|
+
i18n (1.8.10)
|
123
126
|
concurrent-ruby (~> 1.0)
|
124
|
-
|
125
|
-
loofah (2.5.0)
|
127
|
+
loofah (2.9.0)
|
126
128
|
crass (~> 1.0.2)
|
127
129
|
nokogiri (>= 1.5.9)
|
128
130
|
m (1.5.1)
|
@@ -130,31 +132,33 @@ GEM
|
|
130
132
|
rake (>= 0.9.2.2)
|
131
133
|
mail (2.7.1)
|
132
134
|
mini_mime (>= 0.1.1)
|
133
|
-
marcel (0.
|
134
|
-
mimemagic (~> 0.3.2)
|
135
|
+
marcel (1.0.0)
|
135
136
|
method_source (1.0.0)
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
minitest (5.14.0)
|
137
|
+
mini_mime (1.0.3)
|
138
|
+
mini_portile2 (2.5.1)
|
139
|
+
minitest (5.14.4)
|
140
140
|
minitest-focus (1.2.1)
|
141
141
|
minitest (>= 4, < 6)
|
142
|
-
mocha (1.
|
143
|
-
nio4r (2.5.
|
144
|
-
nokogiri (1.
|
145
|
-
mini_portile2 (~> 2.
|
146
|
-
|
147
|
-
|
142
|
+
mocha (1.12.0)
|
143
|
+
nio4r (2.5.7)
|
144
|
+
nokogiri (1.11.5)
|
145
|
+
mini_portile2 (~> 2.5.0)
|
146
|
+
racc (~> 1.4)
|
147
|
+
nokogiri (1.11.5-x86_64-darwin)
|
148
|
+
racc (~> 1.4)
|
149
|
+
parallel (1.20.1)
|
150
|
+
parlour (6.0.0)
|
148
151
|
commander (~> 4.5)
|
149
152
|
parser
|
150
153
|
rainbow (~> 3.0)
|
151
154
|
sorbet-runtime (>= 0.5)
|
152
|
-
parser (
|
155
|
+
parser (3.0.0.0)
|
153
156
|
ast (~> 2.4.1)
|
154
|
-
pry (0.
|
157
|
+
pry (0.14.0)
|
155
158
|
coderay (~> 1.1)
|
156
159
|
method_source (~> 1.0)
|
157
|
-
|
160
|
+
racc (1.5.2)
|
161
|
+
rack (2.2.3)
|
158
162
|
rack-test (1.1.0)
|
159
163
|
rack (>= 1.0, < 3)
|
160
164
|
rails-dom-testing (2.0.3)
|
@@ -163,59 +167,73 @@ GEM
|
|
163
167
|
rails-html-sanitizer (1.3.0)
|
164
168
|
loofah (~> 2.3)
|
165
169
|
rainbow (3.0.0)
|
166
|
-
rake (13.0.
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
+
rake (13.0.3)
|
171
|
+
regexp_parser (2.1.1)
|
172
|
+
rexml (3.2.5)
|
173
|
+
rubocop (1.12.0)
|
170
174
|
parallel (~> 1.10)
|
171
|
-
parser (>=
|
175
|
+
parser (>= 3.0.0.0)
|
172
176
|
rainbow (>= 2.2.2, < 4.0)
|
177
|
+
regexp_parser (>= 1.8, < 3.0)
|
173
178
|
rexml
|
179
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
174
180
|
ruby-progressbar (~> 1.7)
|
175
|
-
unicode-display_width (>= 1.4.0, <
|
176
|
-
rubocop-
|
177
|
-
|
178
|
-
rubocop-
|
179
|
-
rubocop (
|
180
|
-
|
181
|
-
|
181
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
182
|
+
rubocop-ast (1.4.1)
|
183
|
+
parser (>= 2.7.1.5)
|
184
|
+
rubocop-performance (1.10.2)
|
185
|
+
rubocop (>= 0.90.0, < 2.0)
|
186
|
+
rubocop-ast (>= 0.4.0)
|
187
|
+
rubocop-shopify (2.0.1)
|
188
|
+
rubocop (~> 1.11)
|
189
|
+
rubocop-sorbet (0.6.1)
|
190
|
+
rubocop
|
191
|
+
ruby-progressbar (1.11.0)
|
182
192
|
smart_properties (1.15.0)
|
183
|
-
sorbet (0.5.
|
184
|
-
sorbet-static (= 0.5.
|
185
|
-
sorbet-runtime (0.5.
|
186
|
-
sorbet-static (0.5.
|
187
|
-
|
193
|
+
sorbet (0.5.6360)
|
194
|
+
sorbet-static (= 0.5.6360)
|
195
|
+
sorbet-runtime (0.5.6360)
|
196
|
+
sorbet-static (0.5.6360-universal-darwin-14)
|
197
|
+
sorbet-static (0.5.6360-universal-darwin-15)
|
198
|
+
sorbet-static (0.5.6360-universal-darwin-16)
|
199
|
+
sorbet-static (0.5.6360-universal-darwin-17)
|
200
|
+
sorbet-static (0.5.6360-universal-darwin-18)
|
201
|
+
sorbet-static (0.5.6360-universal-darwin-19)
|
202
|
+
sorbet-static (0.5.6360-universal-darwin-20)
|
203
|
+
sorbet-static (0.5.6360-x86_64-linux)
|
204
|
+
spoom (1.1.0)
|
188
205
|
colorize
|
189
|
-
sorbet (
|
206
|
+
sorbet (>= 0.5.6347)
|
190
207
|
sorbet-runtime
|
191
208
|
thor (>= 0.19.2)
|
192
|
-
spring (2.1.
|
193
|
-
sprockets (4.0.
|
209
|
+
spring (2.1.1)
|
210
|
+
sprockets (4.0.2)
|
194
211
|
concurrent-ruby (~> 1.0)
|
195
212
|
rack (> 1, < 3)
|
196
|
-
sprockets-rails (3.2.
|
213
|
+
sprockets-rails (3.2.2)
|
197
214
|
actionpack (>= 4.0)
|
198
215
|
activesupport (>= 4.0)
|
199
216
|
sprockets (>= 3.0.0)
|
200
|
-
tapioca (0.4.
|
217
|
+
tapioca (0.4.19)
|
218
|
+
bundler (>= 1.17.3)
|
201
219
|
parlour (>= 2.1.0)
|
202
220
|
pry (>= 0.12.2)
|
203
221
|
sorbet-runtime
|
204
222
|
sorbet-static (>= 0.4.4471)
|
205
223
|
spoom
|
206
224
|
thor (>= 0.19.2)
|
207
|
-
thor (1.0
|
208
|
-
tzinfo (2.0.
|
225
|
+
thor (1.1.0)
|
226
|
+
tzinfo (2.0.4)
|
209
227
|
concurrent-ruby (~> 1.0)
|
210
|
-
unicode-display_width (
|
211
|
-
websocket-driver (0.7.
|
228
|
+
unicode-display_width (2.0.0)
|
229
|
+
websocket-driver (0.7.3)
|
212
230
|
websocket-extensions (>= 0.1.0)
|
213
|
-
websocket-extensions (0.1.
|
214
|
-
zeitwerk (2.
|
231
|
+
websocket-extensions (0.1.5)
|
232
|
+
zeitwerk (2.4.2)
|
215
233
|
|
216
234
|
PLATFORMS
|
217
235
|
ruby
|
218
|
-
x86_64-darwin-
|
236
|
+
x86_64-darwin-20
|
219
237
|
|
220
238
|
DEPENDENCIES
|
221
239
|
bundler
|
@@ -236,4 +254,4 @@ DEPENDENCIES
|
|
236
254
|
tapioca
|
237
255
|
|
238
256
|
BUNDLED WITH
|
239
|
-
2.
|
257
|
+
2.2.14
|
data/README.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
# Packwerk [](https://github.com/Shopify/packwerk/actions?query=workflow%3ACI)
|
2
2
|
|
3
|
+
## NOTE: Packwerk is considered to be feature-complete for Shopify's uses. We are currently accepting bug fixes only, and it is not being actively developed. Please fork this project if you are interested in adding new features.
|
4
|
+
|
5
|
+
> "I know who you are and because of that I know what you do."
|
6
|
+
> This knowledge is a dependency that raises the cost of change.
|
7
|
+
|
8
|
+
-- _Sandi Metz, Practical Object-Oriented Design in Ruby_
|
9
|
+
|
3
10
|
Packwerk is a Ruby gem used to enforce boundaries and modularize Rails applications.
|
4
11
|
|
5
12
|
Packwerk can be used to:
|
6
|
-
* Combine
|
13
|
+
* Combine groups of files into packages
|
7
14
|
* Define package-level constant visibility (i.e. have publicly accessible constants)
|
8
15
|
* Enforce privacy (inbound) and dependency (outbound) boundaries between packages
|
9
16
|
* Help existing codebases to become more modular without obstructing development
|
data/USAGE.md
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# Packwerk usage
|
2
2
|
|
3
3
|
## Table of Contents
|
4
|
-
* [What problem does Packwerk solve?](#
|
5
|
-
* [What is a package?](#
|
6
|
-
* [Package principles](#
|
7
|
-
* [Getting started](#
|
8
|
-
* [Setting up the configuration file](#
|
9
|
-
* [Inflections](#
|
10
|
-
* [Validating the package system](#
|
11
|
-
* [Defining packages](#
|
12
|
-
* [Package metadata](#
|
13
|
-
* [Types of boundary checks](#
|
14
|
-
* [Enforcing privacy boundary](#
|
15
|
-
* [Using public folders](#
|
16
|
-
* [Enforcing dependency boundary](#
|
17
|
-
* [Checking for violations](#
|
18
|
-
* [Recording existing violations](#
|
19
|
-
* [Understanding the list of deprecated references](#
|
4
|
+
* [What problem does Packwerk solve?](#what-problem-does-packwerk-solve)
|
5
|
+
* [What is a package?](#what-is-a-package)
|
6
|
+
* [Package principles](#package-principles)
|
7
|
+
* [Getting started](#getting-started)
|
8
|
+
* [Setting up the configuration file](#setting-up-the-configuration-file)
|
9
|
+
* [Inflections](#inflections)
|
10
|
+
* [Validating the package system](#validating-the-package-system)
|
11
|
+
* [Defining packages](#defining-packages)
|
12
|
+
* [Package metadata](#package-metadata)
|
13
|
+
* [Types of boundary checks](#types-of-boundary-checks)
|
14
|
+
* [Enforcing privacy boundary](#enforcing-privacy-boundary)
|
15
|
+
* [Using public folders](#using-public-folders)
|
16
|
+
* [Enforcing dependency boundary](#enforcing-dependency-boundary)
|
17
|
+
* [Checking for violations](#checking-for-violations)
|
18
|
+
* [Recording existing violations](#recording-existing-violations)
|
19
|
+
* [Understanding the list of deprecated references](#understanding-the-list-of-deprecated-references)
|
20
20
|
|
21
21
|
## What problem does Packwerk solve?
|
22
22
|
Large applications need clear boundaries to avoid turning into a [ball of mud](https://en.wikipedia.org/wiki/Big_ball_of_mud). However, Ruby does not provide a good solution to enforcing boundaries between code.
|
@@ -63,10 +63,32 @@ Packwerk reads from the `packwerk.yml` configuration file in the root directory.
|
|
63
63
|
|----------------------|-------------------------------------------|--------------|
|
64
64
|
| include | **/*.{rb,rake,erb} | list of patterns for folder paths to include |
|
65
65
|
| exclude | {bin,node_modules,script,tmp,vendor}/**/* | list of patterns for folder paths to exclude |
|
66
|
-
| package_paths | **/ | patterns to find package configuration files, see: Defining packages |
|
66
|
+
| package_paths | **/ | a single pattern or a list of patterns to find package configuration files, see: [Defining packages](#Defining-packages) |
|
67
67
|
| load_paths | All application autoload paths | list of load paths |
|
68
68
|
| custom_associations | N/A | list of custom associations, if any |
|
69
|
+
| parallel | true | when true, fork code parsing out to subprocesses |
|
69
70
|
|
71
|
+
### Using a custom ERB parser
|
72
|
+
|
73
|
+
You can specify a custom ERB parser if needed. For example, if you're using `<%graphql>` tags from https://github.com/github/graphql-client in your ERBs, you can use a custom parser subclass to comment them out so that Packwerk can parse the rest of the file:
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
class CustomParser < Packwerk::Parsers::Erb
|
77
|
+
def parse_buffer(buffer, file_path:)
|
78
|
+
preprocessed_source = buffer.source
|
79
|
+
|
80
|
+
# Comment out <%graphql ... %> tags. They won't contain any object
|
81
|
+
# references anyways.
|
82
|
+
preprocessed_source = preprocessed_source.gsub(/<%graphql/, "<%#")
|
83
|
+
|
84
|
+
preprocessed_buffer = Parser::Source::Buffer.new(file_path)
|
85
|
+
preprocessed_buffer.source = preprocessed_source
|
86
|
+
super(preprocessed_buffer, file_path: file_path)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
Packwerk::Parsers::Factory.instance.erb_parser_class = CustomParser
|
91
|
+
```
|
70
92
|
|
71
93
|
### Inflections
|
72
94
|
|