Skip to content

Commit 050c28d

Browse files
author
Alex Evanczuk
authored
Bump packwerk and use new load paths API (#36)
1 parent 588b4c1 commit 050c28d

File tree

9 files changed

+72
-51
lines changed

9 files changed

+72
-51
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ source 'https://rubygems.org'
66
gemspec
77

88
gem 'packwerk', github: 'Shopify/packwerk', branch: 'main'
9+
gem 'railties'

Gemfile.lock

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/Shopify/packwerk.git
3-
revision: 7428f23e243a4a172ddb4e28021a732e2c9abc1a
3+
revision: e998ef65194de398f0baaf03a0ba33390b30351e
44
branch: main
55
specs:
66
packwerk (2.2.1)
@@ -17,7 +17,7 @@ GIT
1717
PATH
1818
remote: .
1919
specs:
20-
danger-packwerk (0.12.0)
20+
danger-packwerk (0.13.0)
2121
code_ownership
2222
danger-plugin-api (~> 1.0)
2323
packwerk
@@ -27,6 +27,13 @@ PATH
2727
GEM
2828
remote: https://rubygems.org/
2929
specs:
30+
actionpack (7.0.4)
31+
actionview (= 7.0.4)
32+
activesupport (= 7.0.4)
33+
rack (~> 2.0, >= 2.2.0)
34+
rack-test (>= 0.6.3)
35+
rails-dom-testing (~> 2.0)
36+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
3037
actionview (7.0.4)
3138
activesupport (= 7.0.4)
3239
builder (~> 3.1)
@@ -145,11 +152,21 @@ GEM
145152
method_source (~> 1.0)
146153
public_suffix (5.0.1)
147154
racc (1.6.1)
155+
rack (2.2.4)
156+
rack-test (2.0.2)
157+
rack (>= 1.3)
148158
rails-dom-testing (2.0.3)
149159
activesupport (>= 4.2.0)
150160
nokogiri (>= 1.6)
151161
rails-html-sanitizer (1.4.4)
152162
loofah (~> 2.19, >= 2.19.1)
163+
railties (7.0.4)
164+
actionpack (= 7.0.4)
165+
activesupport (= 7.0.4)
166+
method_source
167+
rake (>= 12.2)
168+
thor (~> 1.0)
169+
zeitwerk (~> 2.5)
153170
rainbow (3.1.1)
154171
rake (13.0.6)
155172
rbi (0.0.16)
@@ -246,6 +263,7 @@ DEPENDENCIES
246263
danger-packwerk!
247264
packwerk!
248265
pry
266+
railties
249267
rake
250268
rspec (~> 3.0)
251269
rubocop

lib/danger-packwerk/private.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Private
1414
def self.constant_resolver
1515
@constant_resolver = T.let(@constant_resolver, T.nilable(ConstantResolver))
1616
@constant_resolver ||= begin
17-
load_paths = Packwerk::ApplicationLoadPaths.extract_relevant_paths(Dir.pwd, 'test')
17+
load_paths = Packwerk::RailsLoadPaths.for(Dir.pwd, environment: 'test')
1818
ConstantResolver.new(
1919
root_path: Dir.pwd,
2020
load_paths: T.unsafe(load_paths).keys

lib/danger-packwerk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# frozen_string_literal: true
33

44
module DangerPackwerk
5-
VERSION = '0.12.0'
5+
VERSION = '0.13.0'
66
end
Lines changed: 44 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sorbet/tapioca/require.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
require 'packwerk'
22
require 'danger'
3+
# This triggers the autoload in packwerk so types for this constant are defined
4+
Packwerk::RailsLoadPaths

spec/danger_packwerk/danger_package_todo_yml_changes_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module DangerPackwerk
6868
'packs/some_pack/some_class_with_new_name.rb',
6969
'packs/some_pack/some_class_with_old_name.rb'
7070
].each { |path| write_file(path) }
71-
allow(Packwerk::ApplicationLoadPaths).to receive(:extract_relevant_paths).and_return(load_paths)
71+
allow(Packwerk::RailsLoadPaths).to receive(:for).and_return(load_paths)
7272
end
7373

7474
context 'when no package_todo.yml files have been added or modified' do

spec/danger_packwerk/danger_packwerk_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module DangerPackwerk
1818
'packs/some_pack/some_class_with_new_name.rb',
1919
'packs/some_pack/some_class_with_old_name.rb'
2020
].each { |path| write_file(path) }
21-
allow(Packwerk::ApplicationLoadPaths).to receive(:extract_relevant_paths).and_return(load_paths)
21+
allow(Packwerk::RailsLoadPaths).to receive(:for).and_return(load_paths)
2222
write_package_yml('packs/some_pack')
2323
end
2424

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def testing_dangerfile
5757

5858
config.before do |_example|
5959
ParsePackwerk.bust_cache!
60-
allow(Packwerk::ApplicationLoadPaths).to receive(:extract_relevant_paths).and_return({})
60+
allow(Packwerk::RailsLoadPaths).to receive(:extract_relevant_paths).and_return({})
6161
end
6262

6363
config.around do |example|

0 commit comments

Comments
 (0)