npmdc 0.2.4 → 0.2.5
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/CHANGELOG.md +10 -1
- data/README.md +6 -1
- data/lib/npmdc/checker.rb +3 -5
- data/lib/npmdc/cli.rb +4 -0
- data/lib/npmdc/config.rb +4 -1
- data/lib/npmdc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 537a9fb442684ccc9060002f319790fee0e957de
|
4
|
+
data.tar.gz: 4790c3f98f4df7ba95c919741d10cec5efad8f68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e600166b3f97c343ed26f5529cb3cb1cba64ec767127c7e37eda61f182718241e0f78fb7b3a24d8a273ec160e5934ad1d49a7011a9a16d077c2e96cb402c1254
|
7
|
+
data.tar.gz: a76611ac04b63bd4077d435703e0aee7dafc72a734d22db8cdaeb1eebcdf52e503aae45a0ad461e7ca4b2bde7f43b859ab3d0a7427007580a663b24dc6701cf4
|
data/CHANGELOG.md
CHANGED
@@ -54,7 +54,7 @@ Thanks to @palkan !
|
|
54
54
|
|
55
55
|
* Add Rails integration specs
|
56
56
|
|
57
|
-
* Minor
|
57
|
+
* Minor improvements
|
58
58
|
|
59
59
|
|
60
60
|
### 0.2.4
|
@@ -62,3 +62,12 @@ Thanks to @palkan !
|
|
62
62
|
* Fixed Rails integration
|
63
63
|
|
64
64
|
* Fixed options handling from config
|
65
|
+
|
66
|
+
|
67
|
+
### 0.2.5
|
68
|
+
|
69
|
+
Thanks to @aderyabin !
|
70
|
+
|
71
|
+
* Added new `types` option
|
72
|
+
|
73
|
+
* Added specs for 'short' formatter
|
data/README.md
CHANGED
@@ -5,13 +5,16 @@
|
|
5
5
|
npmdc
|
6
6
|
=========
|
7
7
|
|
8
|
+

|
9
|
+
|
10
|
+
|
8
11
|
**NPM Dependency Checker** is a simple tool which can check for missed dependencies based on your `package.json` file.
|
9
12
|
|
13
|
+
|
10
14
|
<a href="https://evilmartians.com/?utm_source=npmdc">
|
11
15
|
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54">
|
12
16
|
</a>
|
13
17
|
|
14
|
-
|
15
18
|
## Installation
|
16
19
|
|
17
20
|
Add this line to your application's Gemfile:
|
@@ -37,6 +40,7 @@ YourApp::Application.configure do
|
|
37
40
|
config.npmdc.path = "/path/to/your/frontend/code/dir" # `Rails.root` by default
|
38
41
|
config.npmdc.format = "doc" # `short`, `doc`, `progress`. `short` by default
|
39
42
|
config.npmdc.color = false # `true` by default
|
43
|
+
config.npmdc.types = ["dependencies"] # `["dependencies", "devDependencies"]` by default
|
40
44
|
end
|
41
45
|
```
|
42
46
|
|
@@ -55,6 +59,7 @@ _Options:_
|
|
55
59
|
|
56
60
|
* -f, --format FORMAT - Set format of output
|
57
61
|
|
62
|
+
* -t, --types dependencies devDependencies - Dependency types to check
|
58
63
|
|
59
64
|
## Development
|
60
65
|
|
data/lib/npmdc/checker.rb
CHANGED
@@ -9,12 +9,11 @@ module Npmdc
|
|
9
9
|
extend Forwardable
|
10
10
|
include Npmdc::Errors
|
11
11
|
|
12
|
-
attr_reader :path, :formatter
|
13
|
-
|
14
|
-
DEPENDENCIES = %w(dependencies devDependencies).freeze
|
12
|
+
attr_reader :path, :formatter, :types
|
15
13
|
|
16
14
|
def initialize(options)
|
17
15
|
@path = options.fetch('path', Npmdc.config.path)
|
16
|
+
@types = options.fetch('types', Npmdc.config.types)
|
18
17
|
@formatter = Npmdc::Formatter.(options)
|
19
18
|
@dependencies_count = 0
|
20
19
|
@missing_dependencies = Set.new
|
@@ -26,8 +25,7 @@ module Npmdc
|
|
26
25
|
begin
|
27
26
|
success = false
|
28
27
|
package_json_data = package_json(path)
|
29
|
-
|
30
|
-
DEPENDENCIES.each do |dep|
|
28
|
+
@types.each do |dep|
|
31
29
|
check_dependencies(package_json_data[dep], dep) if package_json_data[dep]
|
32
30
|
end
|
33
31
|
|
data/lib/npmdc/cli.rb
CHANGED
@@ -8,6 +8,10 @@ module Npmdc
|
|
8
8
|
desc 'check', 'Run check'
|
9
9
|
method_option :path, desc: 'Path to package.json config'
|
10
10
|
method_option :color, desc: 'Enable color', type: :boolean, default: true
|
11
|
+
method_option :types, aliases: [:t],
|
12
|
+
desc: 'types for check',
|
13
|
+
type: :array,
|
14
|
+
default: Npmdc::Config::DEPEPENDENCY_TYPES
|
11
15
|
method_option :format, aliases: [:f],
|
12
16
|
desc: "Output format,
|
13
17
|
possible values: #{Npmdc::Formatter::FORMATTERS.keys.join(", ")}"
|
data/lib/npmdc/config.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
module Npmdc
|
2
2
|
class Config
|
3
|
-
|
3
|
+
DEPEPENDENCY_TYPES = %w(dependencies devDependencies).freeze
|
4
|
+
|
5
|
+
attr_accessor :color, :format, :output, :types
|
4
6
|
attr_writer :path
|
5
7
|
|
6
8
|
def initialize
|
7
9
|
@color = true
|
8
10
|
@format = :short
|
9
11
|
@output = STDOUT
|
12
|
+
@types = DEPEPENDENCY_TYPES
|
10
13
|
end
|
11
14
|
|
12
15
|
def path
|
data/lib/npmdc/version.rb
CHANGED