use_packwerk 0.61.0 → 0.62.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/lib/use_packwerk/private/file_move_operation.rb +3 -3
- data/lib/use_packwerk/private/pack_relationship_analyzer.rb +2 -2
- data/lib/use_packwerk/private/packwerk_wrapper.rb +1 -1
- data/lib/use_packwerk/private.rb +2 -20
- data/lib/use_packwerk/user_event_logger.rb +1 -1
- data/lib/use_packwerk.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 821209b6fb9f46c62a5e83f3bd0786566c681ddd5368fac0650ec09dc591c0ac
|
4
|
+
data.tar.gz: da79d2c1b40b423a53c9cc8d4342c865e0c1f9381a6f4c6170c8f6338af2e817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d7a941489a3dd4f1cb6fe177bef70d98c28e1ad086c18c55473798ef267f92ab1302e7821c8ca8aadb49eecba32f07c69d1144e912719bd88a54e8696d308ab
|
7
|
+
data.tar.gz: abaee25e63f8361985c3bd3b628d5ea50e50b47d23f7cdc7746cf2598991415f4bbaba34b33af80914a3c17c921888fe2d696cd0647d5c2ba27050b7fc820a04
|
@@ -11,12 +11,12 @@ module UsePackwerk
|
|
11
11
|
|
12
12
|
sig { returns(ParsePackwerk::Package) }
|
13
13
|
def origin_pack
|
14
|
-
|
14
|
+
ParsePackwerk.package_from_path(origin_pathname)
|
15
15
|
end
|
16
16
|
|
17
17
|
sig { params(origin_pathname: Pathname, new_package_root: Pathname).returns(Pathname) }
|
18
18
|
def self.destination_pathname_for_package_move(origin_pathname, new_package_root)
|
19
|
-
origin_pack =
|
19
|
+
origin_pack = ParsePackwerk.package_from_path(origin_pathname)
|
20
20
|
|
21
21
|
if origin_pack.name == ParsePackwerk::ROOT_PACKAGE_NAME
|
22
22
|
new_package_root.join(origin_pathname).cleanpath
|
@@ -27,7 +27,7 @@ module UsePackwerk
|
|
27
27
|
|
28
28
|
sig { params(origin_pathname: Pathname).returns(Pathname) }
|
29
29
|
def self.destination_pathname_for_new_public_api(origin_pathname)
|
30
|
-
origin_pack =
|
30
|
+
origin_pack = ParsePackwerk.package_from_path(origin_pathname)
|
31
31
|
if origin_pack.name == ParsePackwerk::ROOT_PACKAGE_NAME
|
32
32
|
filepath_without_pack_name = origin_pathname.to_s
|
33
33
|
else
|
@@ -35,7 +35,7 @@ module UsePackwerk
|
|
35
35
|
|
36
36
|
# TODO: This is a copy of the implementation below. We may want to refactor out this implementation detail before making changes that apply to both.
|
37
37
|
all_packages.each do |client_package|
|
38
|
-
|
38
|
+
client_package.violations.select(&:privacy?).each do |violation|
|
39
39
|
next unless to_package_names.include?(violation.to_package_name)
|
40
40
|
|
41
41
|
if pack_name.nil?
|
@@ -99,7 +99,7 @@ module UsePackwerk
|
|
99
99
|
|
100
100
|
# TODO: This is a copy of the implementation above. We may want to refactor out this implementation detail before making changes that apply to both.
|
101
101
|
all_packages.each do |client_package|
|
102
|
-
|
102
|
+
client_package.violations.select(&:dependency?).each do |violation|
|
103
103
|
next unless to_package_names.include?(violation.to_package_name)
|
104
104
|
|
105
105
|
if pack_name.nil?
|
@@ -64,7 +64,7 @@ module UsePackwerk
|
|
64
64
|
|
65
65
|
sig { params(files: T::Array[String]).returns(T::Array[String]) }
|
66
66
|
def self.package_names_for_files(files)
|
67
|
-
files.map { |f| ParsePackwerk.package_from_path(f)
|
67
|
+
files.map { |f| ParsePackwerk.package_from_path(f).name }.compact.uniq
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
data/lib/use_packwerk/private.rb
CHANGED
@@ -228,7 +228,7 @@ module UsePackwerk
|
|
228
228
|
end
|
229
229
|
|
230
230
|
file_move_operations = file_paths.map do |path|
|
231
|
-
package =
|
231
|
+
package = ParsePackwerk.package_from_path(path)
|
232
232
|
origin_pathname = Pathname.new(path).cleanpath
|
233
233
|
|
234
234
|
FileMoveOperation.new(
|
@@ -361,8 +361,7 @@ module UsePackwerk
|
|
361
361
|
)
|
362
362
|
|
363
363
|
ParsePackwerk.write_package_yml!(package)
|
364
|
-
|
365
|
-
package = rewrite_package_with_original_packwerk_values(package)
|
364
|
+
RuboCop::Packs.set_default_rubocop_yml(packs: [package])
|
366
365
|
|
367
366
|
current_contents = package.yml.read
|
368
367
|
new_contents = current_contents.gsub('MyTeam', 'MyTeam # specify your team here, or delete this key if this package is not owned by one team')
|
@@ -373,23 +372,6 @@ module UsePackwerk
|
|
373
372
|
existing_package
|
374
373
|
end
|
375
374
|
|
376
|
-
sig { params(original_package: ParsePackwerk::Package).returns(ParsePackwerk::Package) }
|
377
|
-
def self.rewrite_package_with_original_packwerk_values(original_package)
|
378
|
-
ParsePackwerk.bust_cache!
|
379
|
-
package_with_protection_defaults = T.must(ParsePackwerk.all.find { |p| p.name == original_package.name })
|
380
|
-
# PackageProtections also sets `enforce_privacy` and `enforce_dependency` to be true, so we set these back down to their original values
|
381
|
-
package = ParsePackwerk::Package.new(
|
382
|
-
enforce_dependencies: original_package.enforce_dependencies,
|
383
|
-
enforce_privacy: original_package.enforce_privacy,
|
384
|
-
dependencies: original_package.dependencies,
|
385
|
-
metadata: package_with_protection_defaults.metadata,
|
386
|
-
name: original_package.name
|
387
|
-
)
|
388
|
-
|
389
|
-
ParsePackwerk.write_package_yml!(package)
|
390
|
-
package
|
391
|
-
end
|
392
|
-
|
393
375
|
sig { void }
|
394
376
|
def self.load_client_configuration
|
395
377
|
@loaded_client_configuration ||= T.let(false, T.nilable(T::Boolean))
|
@@ -122,7 +122,7 @@ module UsePackwerk
|
|
122
122
|
Anything that is considered private should go in other folders.
|
123
123
|
|
124
124
|
If another pack uses classes, constants, or modules that are not in your public folder, it will be considered a "privacy violation" by packwerk.
|
125
|
-
You can prevent other packs from using private API by using
|
125
|
+
You can prevent other packs from using private API by using packwerk.
|
126
126
|
|
127
127
|
Want to find how your private API is being used today?
|
128
128
|
Try running: `bin/use_packwerk list_top_privacy_violations #{pack_name}`
|
data/lib/use_packwerk.rb
CHANGED
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.
|
4
|
+
version: 0.62.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-11-
|
11
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: code_ownership
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: package_protections
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: packwerk
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|