use_packwerk 0.53.0 → 0.54.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/use_packwerk/private.rb +27 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e5318956ac8b8fef165830d798565e79f0ef230686671fd0f66b81074b3d369
4
- data.tar.gz: 8902e5d32f23d10916829928a1eff0c4d6e2b48163bf55a06f52fb32bdcfb544
3
+ metadata.gz: f058e80dcae7e5bc36702bf0ccf3d0e81b044c9f162ac66e74c99eec6bcc8cdb
4
+ data.tar.gz: 9536a0e463e7d7708e7843bdcefdd892e32343cf1a5ae670024eed1b116546a4
5
5
  SHA512:
6
- metadata.gz: 672a7e528294e21fe993ebeb2c9c22c048163374d15483a7cdc203a1c14f336a768538c68ab75febb77ee3eb1da0bd694aec1f32ea80ca621ddcade02798abb4
7
- data.tar.gz: bcd5e51dfe5d3060babca2c650534ed1f8c55acb9e61f5e492c2adcd10a70998fbaa3b2cc014f3c5c9732159188b82b2e6bd6115d2b3cd155e15771ab5dee5f4
6
+ metadata.gz: 703bbd5300f6565a690563b9bf86ee8d23d91d52a0a48a75b162350aeac3a6455d6ec8fb38c22a43c334700890c0ccb5d5bcffdabe7672b064e295932dcf9df2
7
+ data.tar.gz: 61302158b9f8afba60a256079350e03c9484ec97a5e241e516ab33031593b36882910b7e32d1fb5e9044575d5e3b79c68eb98b4cd1026a0eafcd2dbcdac55b9e
@@ -195,8 +195,33 @@ module UsePackwerk
195
195
  deprecated_references_file = ParsePackwerk::DeprecatedReferences.for(package).pathname
196
196
  deprecated_references_file.delete if deprecated_references_file.exist?
197
197
 
198
- # Add a dependency from parent to child
199
- self.add_dependency!(pack_name: parent_name, dependency_name: new_package_name)
198
+ ParsePackwerk.bust_cache!
199
+
200
+ ParsePackwerk.all.each do |other_package|
201
+ new_dependencies = other_package.dependencies.map{|d| d == pack_name ? new_package_name : d}
202
+ if other_package.name == parent_name && !new_dependencies.include?(new_package_name)
203
+ new_dependencies += [new_package_name]
204
+ end
205
+
206
+ new_other_package = ParsePackwerk::Package.new(
207
+ name: other_package.name,
208
+ enforce_privacy: other_package.enforce_dependencies,
209
+ enforce_dependencies: other_package.enforce_dependencies,
210
+ dependencies: new_dependencies.uniq.sort,
211
+ metadata: other_package.metadata,
212
+ )
213
+
214
+ ParsePackwerk.write_package_yml!(new_other_package)
215
+ end
216
+
217
+ sorbet_config = Pathname.new('sorbet/config')
218
+ if sorbet_config.exist?
219
+ UsePackwerk.replace_in_file(
220
+ file: sorbet_config.to_s,
221
+ find: package.directory.join('spec'),
222
+ replace_with: new_package.directory.join('spec'),
223
+ )
224
+ end
200
225
  end
201
226
 
202
227
  sig do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.53.0
4
+ version: 0.54.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize