js_dependency 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +3 -9
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +6 -0
- data/lib/js_dependency/cli.rb +11 -11
- data/lib/js_dependency/index_creator.rb +1 -3
- data/lib/js_dependency/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bcea60e75e368a74db588a569dcc71dac789988395940b9ae2ec8f8be965cef
|
4
|
+
data.tar.gz: 3760510a51085c9842eaf0a2b49989c3c400b130bde282d6150f4d986c38c36b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba4acdf96d74072a3e439647bdd5817f622d11393961127af5ee88d112a53c4d4231a31bf2a08129dc889cc59bf69e7057e0074554d3572cf9396457dc98e2cd
|
7
|
+
data.tar.gz: 285681ef4ebea7f2eb9a6cb8214316d0f7899bc275723bcf35be8bde33c2ae5824f3ba0be7e64d163fc3120971073f7c6bbe19bfc265eff0c44722ee2fd7d018
|
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-07-
|
3
|
+
# on 2022-07-25 14:50:54 UTC using RuboCop version 1.31.2.
|
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,7 +9,7 @@
|
|
9
9
|
# Offense count: 7
|
10
10
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
11
11
|
Metrics/AbcSize:
|
12
|
-
Max:
|
12
|
+
Max: 41
|
13
13
|
|
14
14
|
# Offense count: 5
|
15
15
|
# Configuration parameters: IgnoredMethods.
|
@@ -31,18 +31,12 @@ Metrics/ParameterLists:
|
|
31
31
|
Metrics/PerceivedComplexity:
|
32
32
|
Max: 17
|
33
33
|
|
34
|
-
# Offense count: 1
|
35
|
-
# This cop supports safe autocorrection (--autocorrect).
|
36
|
-
Style/IfUnlessModifier:
|
37
|
-
Exclude:
|
38
|
-
- 'lib/js_dependency/index_creator.rb'
|
39
|
-
|
40
34
|
# Offense count: 1
|
41
35
|
Style/MultilineBlockChain:
|
42
36
|
Exclude:
|
43
37
|
- 'lib/js_dependency/mermaid/root.rb'
|
44
38
|
|
45
|
-
# Offense count:
|
39
|
+
# Offense count: 7
|
46
40
|
# This cop supports safe autocorrection (--autocorrect).
|
47
41
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
48
42
|
# URISchemes: http, https
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -61,6 +61,12 @@ js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1
|
|
61
61
|
js_dependency -s ./src -t ./src/App.vue ./src/components/Sub.vue -o ./mermaid.txt -c 2 -p 2 -n 1
|
62
62
|
```
|
63
63
|
|
64
|
+
##### Exclude path which iclude exclude words `-e` from output
|
65
|
+
|
66
|
+
```shell
|
67
|
+
js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1 -e excludeWord1 excludeWord2
|
68
|
+
```
|
69
|
+
|
64
70
|
#### Export parents components list
|
65
71
|
|
66
72
|
```shell
|
data/lib/js_dependency/cli.rb
CHANGED
@@ -9,12 +9,12 @@ module JsDependency
|
|
9
9
|
|
10
10
|
desc "export_mermaid", "Output mermaid flowchart string."
|
11
11
|
option :src_path, type: :string, aliases: "-s", desc: "Root folder."
|
12
|
-
option :
|
12
|
+
option :target_paths, type: :array, aliases: "-t", desc: "Target file that you want to analyze."
|
13
13
|
option :output_path, type: :string, aliases: "-o", desc: "Output file path"
|
14
14
|
option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
|
15
15
|
option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
|
16
16
|
option :name_level, type: :numeric, aliases: "-n", desc: "Output name level"
|
17
|
-
option :
|
17
|
+
option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
|
18
18
|
|
19
19
|
def export_mermaid
|
20
20
|
pathname = Pathname.new(".js_dependency.yml")
|
@@ -22,14 +22,14 @@ module JsDependency
|
|
22
22
|
args = YAML.safe_load(pathname.read) if pathname.exist?
|
23
23
|
|
24
24
|
src_path = options[:src_path] || args["src_path"]
|
25
|
-
target_paths = options[:
|
25
|
+
target_paths = options[:target_paths] || (args["target_path"].is_a?(String) ? [args["target_path"]] : args["target_path"])
|
26
26
|
child_analyze_level = options[:child_analyze_level] || args["child_analyze_level"] || 2
|
27
27
|
parent_analyze_level = options[:parent_analyze_level] || args["parent_analyze_level"] || 2
|
28
28
|
output_path = options[:output_path] || args["output_path"] || nil
|
29
29
|
alias_paths = args["alias_paths"] || nil
|
30
30
|
name_level = options[:name_level] || args["name_level"] || 1
|
31
|
-
excludes = if options[:
|
32
|
-
|
31
|
+
excludes = if options[:excludes].length.positive?
|
32
|
+
options[:excludes]
|
33
33
|
elsif args["excludes"]
|
34
34
|
args["excludes"]
|
35
35
|
end
|
@@ -53,7 +53,7 @@ module JsDependency
|
|
53
53
|
option :target_path, type: :string, aliases: "-t", desc: "Target file that you want to analyze."
|
54
54
|
option :output_path, type: :string, aliases: "-o", desc: "Output file path"
|
55
55
|
option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
|
56
|
-
option :
|
56
|
+
option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
|
57
57
|
|
58
58
|
def parents
|
59
59
|
pathname = Pathname.new(".js_dependency.yml")
|
@@ -65,8 +65,8 @@ module JsDependency
|
|
65
65
|
parent_analyze_level = options[:parent_analyze_level] || args["parent_analyze_level"] || 1
|
66
66
|
output_path = options[:output_path] || args["output_path"] || nil
|
67
67
|
alias_paths = args["alias_paths"] || nil
|
68
|
-
excludes = if options[:
|
69
|
-
|
68
|
+
excludes = if options[:excludes].length.positive?
|
69
|
+
options[:excludes]
|
70
70
|
elsif args["excludes"]
|
71
71
|
args["excludes"]
|
72
72
|
end
|
@@ -88,7 +88,7 @@ module JsDependency
|
|
88
88
|
option :target_path, type: :string, aliases: "-t", desc: "Target file that you want to analyze."
|
89
89
|
option :output_path, type: :string, aliases: "-o", desc: "Output file path"
|
90
90
|
option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
|
91
|
-
option :
|
91
|
+
option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
|
92
92
|
|
93
93
|
def children
|
94
94
|
pathname = Pathname.new(".js_dependency.yml")
|
@@ -100,8 +100,8 @@ module JsDependency
|
|
100
100
|
child_analyze_level = options[:child_analyze_level] || args["child_analyze_level"] || 1
|
101
101
|
output_path = options[:output_path] || args["output_path"] || nil
|
102
102
|
alias_paths = args["alias_paths"] || nil
|
103
|
-
excludes = if options[:
|
104
|
-
|
103
|
+
excludes = if options[:excludes].length.positive?
|
104
|
+
options[:excludes]
|
105
105
|
elsif args["excludes"]
|
106
106
|
args["excludes"]
|
107
107
|
end
|
@@ -47,9 +47,7 @@ module JsDependency
|
|
47
47
|
import_pathnames = import_pathnames_from(component_pathname, alias_paths)
|
48
48
|
|
49
49
|
obj[component_pathname.to_s] = import_pathnames.map(&:to_s)
|
50
|
-
if component_pathname.basename.to_s == "index.js"
|
51
|
-
obj[component_pathname.dirname.to_s] = import_pathnames.map(&:to_s)
|
52
|
-
end
|
50
|
+
obj[component_pathname.dirname.to_s] = import_pathnames.map(&:to_s) if component_pathname.basename.to_s == "index.js"
|
53
51
|
end
|
54
52
|
end
|
55
53
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js_dependency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- junara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pathname
|