js_dependency 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a376c442837e1a87365b91b1f13b46e048f271078e691425350237066e1f567d
4
- data.tar.gz: 606813cc029e62b21c7073409c8312c27104adada8b3e3e33877075fde15d2cc
3
+ metadata.gz: e6ac19bdd54aa746f7e5f40bb7cf8c92660eb8384c074347734f8e484d60d878
4
+ data.tar.gz: a5f4a090fec3d3a4af1c8a8b5747efc830f8f92c4f29dce852e91348c0d867c6
5
5
  SHA512:
6
- metadata.gz: da8c831e0eec9e3251597874af4b067efb2079c651e46341beb5a8f34b70b857c2960f134cd0db6fc8e8cf380090b70d87732891d8161ecfbdfe7756179d7cba
7
- data.tar.gz: 3513921cc2068f220fcd5ca001d59339a361e36fe76c9bf9ca5f4bc4f5ba5cf91ac0f220c72814cad02a44e6ed9ddc11421721a6d20d1f1a010b7bec5422893f
6
+ metadata.gz: '0902a104039ef853937b3d1739ec0f1fe249d17f7428d23457124e66b16003a8f7a3136ceefb14a6f3122c99bfcbeeeec0f77d589066f6e0956d95e11b36b963'
7
+ data.tar.gz: 746f673194445bf43f180a2ec650bd2530795e9966e8cc6a35f5bb55d37ff8688187ceaff41475117bd166d6a788624a3bbb63555b52901231a5d46dace1f4dd
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-08-11 12:19:56 UTC using RuboCop version 1.34.1.
3
+ # on 2022-08-11 15:14:43 UTC using RuboCop version 1.34.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -9,12 +9,12 @@
9
9
  # Offense count: 3
10
10
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
11
11
  Metrics/AbcSize:
12
- Max: 31
12
+ Max: 33
13
13
 
14
14
  # Offense count: 3
15
15
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
16
16
  Metrics/CyclomaticComplexity:
17
- Max: 18
17
+ Max: 19
18
18
 
19
19
  # Offense count: 8
20
20
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
@@ -29,14 +29,14 @@ Metrics/ParameterLists:
29
29
  # Offense count: 3
30
30
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
31
31
  Metrics/PerceivedComplexity:
32
- Max: 19
32
+ Max: 20
33
33
 
34
34
  # Offense count: 1
35
35
  Style/MultilineBlockChain:
36
36
  Exclude:
37
37
  - 'lib/js_dependency/mermaid/root.rb'
38
38
 
39
- # Offense count: 6
39
+ # Offense count: 8
40
40
  # This cop supports safe autocorrection (--autocorrect).
41
41
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
42
42
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.9] - 2022-08-12
4
+
5
+ - Add alias_paths options of hash.
6
+
3
7
  ## [0.3.8] - 2022-08-11
4
8
 
5
9
  - `.js_dependecy.yaml` is arrowed for configuration file name.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- js_dependency (0.3.8)
4
+ js_dependency (0.3.9)
5
5
  pathname
6
6
  thor
7
7
  yaml
data/README.md CHANGED
@@ -56,6 +56,7 @@ parent_analyze_level -> -p
56
56
  name_level -> -n
57
57
  output_path -> -o
58
58
  exclude -> -e
59
+ alias_paths -> -a
59
60
  ```
60
61
 
61
62
  #### Export Mermaid Format
@@ -63,31 +64,31 @@ exclude -> -e
63
64
  ##### Single target path
64
65
 
65
66
  ```shell
66
- js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1
67
+ js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1 -a @:./pages
67
68
  ```
68
69
 
69
70
  ##### Multiple target paths
70
71
 
71
72
  ```shell
72
- js_dependency -s ./src -t ./src/App.vue ./src/components/Sub.vue -o ./mermaid.txt -c 2 -p 2 -n 1
73
+ js_dependency -s ./src -t ./src/App.vue ./src/components/Sub.vue -o ./mermaid.txt -c 2 -p 2 -n 1 -a @:./pages
73
74
  ```
74
75
 
75
- ##### Exclude path which iclude exclude words `-e` from output
76
+ ##### Exclude path which include exclude words `-e` from output
76
77
 
77
78
  ```shell
78
- js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1 -e excludeWord1 excludeWord2
79
+ js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1 -e excludeWord1 excludeWord2 -a @:./pages
79
80
  ```
80
81
 
81
82
  #### Export parents components list
82
83
 
83
84
  ```shell
84
- js_dependency parents -s ./src -t ./src/App.vue -o ./parents.txt -p 2
85
+ js_dependency parents -s ./src -t ./src/App.vue -o ./parents.txt -p 2 -a @:./pages
85
86
  ```
86
87
 
87
88
  #### Export children components list
88
89
 
89
90
  ```shell
90
- js_dependency childrent -s ./src -t ./src/App.vue -o ./children.txt -c 2
91
+ js_dependency childrent -s ./src -t ./src/App.vue -o ./children.txt -c 2 -a @:./pages
91
92
  ```
92
93
 
93
94
  #### Export orphan components list
@@ -95,7 +96,7 @@ js_dependency childrent -s ./src -t ./src/App.vue -o ./children.txt -c 2
95
96
  Components that are not used in other components.
96
97
 
97
98
  ```shell
98
- js_dependency orphan -s ./src
99
+ js_dependency orphan -s ./src -a @:./pages
99
100
  ```
100
101
 
101
102
  #### Export left components list
@@ -103,7 +104,7 @@ js_dependency orphan -s ./src
103
104
  Components that do not import other components.
104
105
 
105
106
  ```shell
106
- js_dependency leave -s ./src
107
+ js_dependency leave -s ./src -a @:./pages
107
108
  ```
108
109
 
109
110
  ### By ruby code
@@ -15,6 +15,7 @@ module JsDependency
15
15
  method_option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
16
16
  method_option :name_level, type: :numeric, aliases: "-n", desc: "Output name level"
17
17
  method_option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
18
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
18
19
 
19
20
  def export_mermaid
20
21
  args = JsDependency::CliUtils::Yaml.new.args
@@ -37,6 +38,7 @@ module JsDependency
37
38
  method_option :output_path, type: :string, aliases: "-o", desc: "Output file path"
38
39
  method_option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
39
40
  method_option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
41
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
40
42
 
41
43
  def parents
42
44
  args = JsDependency::CliUtils::Yaml.new.args
@@ -57,6 +59,7 @@ module JsDependency
57
59
  method_option :output_path, type: :string, aliases: "-o", desc: "Output file path"
58
60
  method_option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
59
61
  method_option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
62
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
60
63
 
61
64
  def children
62
65
  args = JsDependency::CliUtils::Yaml.new.args
@@ -73,6 +76,7 @@ module JsDependency
73
76
 
74
77
  desc "orphan", "export components than is not depended by others"
75
78
  method_option :src_path, type: :string, aliases: "-s", desc: "Root folder."
79
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
76
80
 
77
81
  def orphan
78
82
  args = JsDependency::CliUtils::Yaml.new.args
@@ -85,6 +89,7 @@ module JsDependency
85
89
 
86
90
  desc "leave", "export components than is not depended by others"
87
91
  method_option :src_path, type: :string, aliases: "-s", desc: "Root folder."
92
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
88
93
 
89
94
  def leave
90
95
  args = JsDependency::CliUtils::Yaml.new.args
@@ -15,7 +15,7 @@ module JsDependency
15
15
  @child_analyze_level = options[:child_analyze_level] || args[:child_analyze_level] || 2
16
16
  @parent_analyze_level = options[:parent_analyze_level] || args[:parent_analyze_level] || 2
17
17
  @output_path = options[:output_path] || args[:output_path] || nil
18
- @alias_paths = args[:alias_paths] || nil
18
+ @alias_paths = options[:alias_paths] || args[:alias_paths] || {}
19
19
  @name_level = options[:name_level] || args[:name_level] || 1
20
20
  @excludes = if options[:excludes]&.length&.positive?
21
21
  options[:excludes]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsDependency
4
- VERSION = "0.3.8"
4
+ VERSION = "0.3.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_dependency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - junara