dependabot-npm_and_yarn 0.95.84 → 0.95.85
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/helpers/.eslintrc +1 -1
- data/helpers/build +3 -2
- data/helpers/{npm/lib → lib/npm}/helpers.js +0 -0
- data/helpers/{npm/lib → lib/npm}/index.js +3 -3
- data/helpers/{npm/lib → lib/npm}/peer-dependency-checker.js +0 -0
- data/helpers/{npm/lib → lib/npm}/subdependency-updater.js +0 -0
- data/helpers/{npm/lib → lib/npm}/updater.js +0 -0
- data/helpers/{yarn/lib → lib/yarn}/fix-duplicates.js +0 -0
- data/helpers/{yarn/lib → lib/yarn}/helpers.js +0 -0
- data/helpers/lib/yarn/index.js +11 -0
- data/helpers/{yarn/lib → lib/yarn}/lockfile-parser.js +0 -0
- data/helpers/{yarn/lib → lib/yarn}/peer-dependency-checker.js +0 -0
- data/helpers/{yarn/lib → lib/yarn}/replace-lockfile-declaration.js +0 -0
- data/helpers/{yarn/lib → lib/yarn}/subdependency-updater.js +0 -0
- data/helpers/{yarn/lib → lib/yarn}/updater.js +0 -0
- data/helpers/package-lock.json +9204 -0
- data/helpers/package.json +10 -5
- data/helpers/{npm/bin/run.js → run.js} +3 -3
- data/helpers/{npm/test → test/npm}/fixtures/npm-left-pad.json +0 -0
- data/helpers/{npm/test → test/npm}/fixtures/updater/original/package-lock.json +0 -0
- data/helpers/{npm/test → test/npm}/fixtures/updater/original/package.json +0 -0
- data/helpers/{npm/test → test/npm}/fixtures/updater/updated/package-lock.json +0 -0
- data/helpers/{npm/test → test/npm}/helpers.js +0 -0
- data/helpers/{npm/test → test/npm}/updater.test.js +1 -1
- data/helpers/{yarn/test → test/yarn}/fixtures/updater/original/package.json +0 -0
- data/helpers/{yarn/test → test/yarn}/fixtures/updater/original/yarn.lock +0 -0
- data/helpers/{yarn/test → test/yarn}/fixtures/updater/updated/yarn.lock +0 -0
- data/helpers/{yarn/test → test/yarn}/fixtures/updater/with-version-comments/package.json +0 -0
- data/helpers/{yarn/test → test/yarn}/fixtures/updater/with-version-comments/yarn.lock +0 -0
- data/helpers/{yarn/test → test/yarn}/fixtures/yarnpkg-is-positive.json +0 -0
- data/helpers/{yarn/test → test/yarn}/fixtures/yarnpkg-left-pad.json +0 -0
- data/helpers/{yarn/test → test/yarn}/helpers.js +0 -0
- data/helpers/{yarn/test → test/yarn}/updater.test.js +1 -1
- data/helpers/yarn.lock +264 -298
- data/lib/dependabot/npm_and_yarn/file_fetcher/path_dependency_builder.rb +2 -6
- data/lib/dependabot/npm_and_yarn/file_parser/lockfile_parser.rb +17 -10
- data/lib/dependabot/npm_and_yarn/file_updater/npm_lockfile_updater.rb +4 -8
- data/lib/dependabot/npm_and_yarn/file_updater/yarn_lockfile_updater.rb +4 -8
- data/lib/dependabot/npm_and_yarn/native_helpers.rb +5 -26
- data/lib/dependabot/npm_and_yarn/update_checker/subdependency_version_resolver.rb +4 -12
- data/lib/dependabot/npm_and_yarn/update_checker/version_resolver.rb +4 -12
- metadata +34 -36
- data/helpers/npm/package.json +0 -12
- data/helpers/yarn/bin/run.js +0 -28
- data/helpers/yarn/lib/index.js +0 -11
- data/helpers/yarn/package.json +0 -12
|
@@ -120,8 +120,8 @@ module Dependabot
|
|
|
120
120
|
File.write("yarn.lock", yarn_lock.content)
|
|
121
121
|
|
|
122
122
|
SharedHelpers.run_helper_subprocess(
|
|
123
|
-
command:
|
|
124
|
-
function: "parseLockfile",
|
|
123
|
+
command: NativeHelpers.helper_path,
|
|
124
|
+
function: "yarn:parseLockfile",
|
|
125
125
|
args: [Dir.pwd]
|
|
126
126
|
)
|
|
127
127
|
end
|
|
@@ -136,10 +136,6 @@ module Dependabot
|
|
|
136
136
|
".."
|
|
137
137
|
end.join("/")
|
|
138
138
|
end
|
|
139
|
-
|
|
140
|
-
def yarn_helper_path
|
|
141
|
-
NativeHelpers.yarn_helper_path
|
|
142
|
-
end
|
|
143
139
|
end
|
|
144
140
|
end
|
|
145
141
|
end
|
|
@@ -61,7 +61,7 @@ module Dependabot
|
|
|
61
61
|
|
|
62
62
|
yarn_locks.each do |yarn_lock|
|
|
63
63
|
parse_yarn_lock(yarn_lock).each do |req, details|
|
|
64
|
-
next unless details["version"]
|
|
64
|
+
next unless semver_version_for(details["version"])
|
|
65
65
|
|
|
66
66
|
# Note: The DependencySet will de-dupe our dependencies, so they
|
|
67
67
|
# end up unique by name. That's not a perfect representation of
|
|
@@ -69,7 +69,7 @@ module Dependabot
|
|
|
69
69
|
# comparably to other flat-resolution strategies
|
|
70
70
|
dependency_set << Dependency.new(
|
|
71
71
|
name: req.split(/(?<=\w)\@/).first,
|
|
72
|
-
version: details["version"],
|
|
72
|
+
version: semver_version_for(details["version"]),
|
|
73
73
|
package_manager: "npm_and_yarn",
|
|
74
74
|
requirements: []
|
|
75
75
|
)
|
|
@@ -116,11 +116,11 @@ module Dependabot
|
|
|
116
116
|
|
|
117
117
|
object_with_dependencies.
|
|
118
118
|
fetch("dependencies", {}).each do |name, details|
|
|
119
|
-
next unless details["version"]
|
|
119
|
+
next unless semver_version_for(details["version"])
|
|
120
120
|
|
|
121
121
|
dependency_set << Dependency.new(
|
|
122
122
|
name: name,
|
|
123
|
-
version: details["version"],
|
|
123
|
+
version: semver_version_for(details["version"]),
|
|
124
124
|
package_manager: "npm_and_yarn",
|
|
125
125
|
requirements: []
|
|
126
126
|
)
|
|
@@ -131,6 +131,17 @@ module Dependabot
|
|
|
131
131
|
dependency_set
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
def semver_version_for(version_string)
|
|
135
|
+
return unless version_string
|
|
136
|
+
return if version_string == ""
|
|
137
|
+
return if version_string.include?("://")
|
|
138
|
+
return if version_string.include?("file:")
|
|
139
|
+
return if version_string.include?("link:")
|
|
140
|
+
return if version_string.include?("#")
|
|
141
|
+
|
|
142
|
+
version_string
|
|
143
|
+
end
|
|
144
|
+
|
|
134
145
|
def parse_package_lock(package_lock)
|
|
135
146
|
@parse_package_lock ||= {}
|
|
136
147
|
@parse_package_lock[package_lock.name] ||=
|
|
@@ -154,8 +165,8 @@ module Dependabot
|
|
|
154
165
|
File.write("yarn.lock", yarn_lock.content)
|
|
155
166
|
|
|
156
167
|
SharedHelpers.run_helper_subprocess(
|
|
157
|
-
command:
|
|
158
|
-
function: "parseLockfile",
|
|
168
|
+
command: NativeHelpers.helper_path,
|
|
169
|
+
function: "yarn:parseLockfile",
|
|
159
170
|
args: [Dir.pwd]
|
|
160
171
|
)
|
|
161
172
|
rescue SharedHelpers::HelperSubprocessFailed
|
|
@@ -163,10 +174,6 @@ module Dependabot
|
|
|
163
174
|
end
|
|
164
175
|
end
|
|
165
176
|
|
|
166
|
-
def yarn_helper_path
|
|
167
|
-
NativeHelpers.yarn_helper_path
|
|
168
|
-
end
|
|
169
|
-
|
|
170
177
|
def package_locks
|
|
171
178
|
@package_locks ||=
|
|
172
179
|
dependency_files.
|
|
@@ -147,8 +147,8 @@ module Dependabot
|
|
|
147
147
|
def run_npm_top_level_updater(lockfile_name:,
|
|
148
148
|
top_level_dependency_updates:)
|
|
149
149
|
SharedHelpers.run_helper_subprocess(
|
|
150
|
-
command:
|
|
151
|
-
function: "update",
|
|
150
|
+
command: NativeHelpers.helper_path,
|
|
151
|
+
function: "npm:update",
|
|
152
152
|
args: [
|
|
153
153
|
Dir.pwd,
|
|
154
154
|
top_level_dependency_updates,
|
|
@@ -159,8 +159,8 @@ module Dependabot
|
|
|
159
159
|
|
|
160
160
|
def run_npm_subdependency_updater(lockfile_name:)
|
|
161
161
|
SharedHelpers.run_helper_subprocess(
|
|
162
|
-
command:
|
|
163
|
-
function: "updateSubdependency",
|
|
162
|
+
command: NativeHelpers.helper_path,
|
|
163
|
+
function: "npm:updateSubdependency",
|
|
164
164
|
args: [Dir.pwd, lockfile_name]
|
|
165
165
|
)
|
|
166
166
|
end
|
|
@@ -537,10 +537,6 @@ module Dependabot
|
|
|
537
537
|
gsub(%r{^\s*//.*}, " ") # comments are not allowed
|
|
538
538
|
end
|
|
539
539
|
|
|
540
|
-
def npm_helper_path
|
|
541
|
-
NativeHelpers.npm_helper_path
|
|
542
|
-
end
|
|
543
|
-
|
|
544
540
|
def package_locks
|
|
545
541
|
@package_locks ||=
|
|
546
542
|
dependency_files.
|
|
@@ -136,8 +136,8 @@ module Dependabot
|
|
|
136
136
|
|
|
137
137
|
def run_yarn_top_level_updater(top_level_dependency_updates:)
|
|
138
138
|
SharedHelpers.run_helper_subprocess(
|
|
139
|
-
command:
|
|
140
|
-
function: "update",
|
|
139
|
+
command: NativeHelpers.helper_path,
|
|
140
|
+
function: "yarn:update",
|
|
141
141
|
args: [
|
|
142
142
|
Dir.pwd,
|
|
143
143
|
top_level_dependency_updates
|
|
@@ -147,8 +147,8 @@ module Dependabot
|
|
|
147
147
|
|
|
148
148
|
def run_yarn_subdependency_updater(lockfile_name:)
|
|
149
149
|
SharedHelpers.run_helper_subprocess(
|
|
150
|
-
command:
|
|
151
|
-
function: "updateSubdependency",
|
|
150
|
+
command: NativeHelpers.helper_path,
|
|
151
|
+
function: "yarn:updateSubdependency",
|
|
152
152
|
args: [Dir.pwd, lockfile_name]
|
|
153
153
|
)
|
|
154
154
|
end
|
|
@@ -506,10 +506,6 @@ module Dependabot
|
|
|
506
506
|
def package_files
|
|
507
507
|
dependency_files.select { |f| f.name.end_with?("package.json") }
|
|
508
508
|
end
|
|
509
|
-
|
|
510
|
-
def yarn_helper_path
|
|
511
|
-
NativeHelpers.yarn_helper_path
|
|
512
|
-
end
|
|
513
509
|
end
|
|
514
510
|
end
|
|
515
511
|
end
|
|
@@ -3,34 +3,13 @@
|
|
|
3
3
|
module Dependabot
|
|
4
4
|
module NpmAndYarn
|
|
5
5
|
module NativeHelpers
|
|
6
|
-
def self.
|
|
7
|
-
File.join(
|
|
6
|
+
def self.helper_path
|
|
7
|
+
"node #{File.join(native_helpers_root, 'npm_and_yarn/run.js')}"
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def self.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return File.join(helpers_root, "npm_and_yarn/npm")
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
File.join(default_helpers_dir, "npm")
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def self.yarn_helper_path
|
|
20
|
-
File.join(yarn_helpers_dir, "bin/run.js")
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def self.yarn_helpers_dir
|
|
24
|
-
helpers_root = ENV["DEPENDABOT_NATIVE_HELPERS_PATH"]
|
|
25
|
-
unless helpers_root.nil?
|
|
26
|
-
return File.join(helpers_root, "npm_and_yarn/yarn")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
File.join(default_helpers_dir, "yarn")
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def self.default_helpers_dir
|
|
33
|
-
File.join(__dir__, "../../../../npm_and_yarn/helpers")
|
|
10
|
+
def self.native_helpers_root
|
|
11
|
+
default_path = File.join(__dir__, "../../../helpers/install-dir")
|
|
12
|
+
ENV.fetch("DEPENDABOT_NATIVE_HELPERS_PATH", default_path)
|
|
34
13
|
end
|
|
35
14
|
end
|
|
36
15
|
end
|
|
@@ -87,8 +87,8 @@ module Dependabot
|
|
|
87
87
|
SharedHelpers.with_git_configured(credentials: credentials) do
|
|
88
88
|
Dir.chdir(path) do
|
|
89
89
|
SharedHelpers.run_helper_subprocess(
|
|
90
|
-
command:
|
|
91
|
-
function: "updateSubdependency",
|
|
90
|
+
command: NativeHelpers.helper_path,
|
|
91
|
+
function: "yarn:updateSubdependency",
|
|
92
92
|
args: [Dir.pwd, lockfile_name]
|
|
93
93
|
)
|
|
94
94
|
end
|
|
@@ -113,8 +113,8 @@ module Dependabot
|
|
|
113
113
|
SharedHelpers.with_git_configured(credentials: credentials) do
|
|
114
114
|
Dir.chdir(path) do
|
|
115
115
|
SharedHelpers.run_helper_subprocess(
|
|
116
|
-
command:
|
|
117
|
-
function: "updateSubdependency",
|
|
116
|
+
command: NativeHelpers.helper_path,
|
|
117
|
+
function: "npm:updateSubdependency",
|
|
118
118
|
args: [Dir.pwd, lockfile_name]
|
|
119
119
|
)
|
|
120
120
|
end
|
|
@@ -234,14 +234,6 @@ module Dependabot
|
|
|
234
234
|
dependency_files.
|
|
235
235
|
select { |f| f.name.end_with?("package.json") }
|
|
236
236
|
end
|
|
237
|
-
|
|
238
|
-
def yarn_helper_path
|
|
239
|
-
NativeHelpers.yarn_helper_path
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
def npm_helper_path
|
|
243
|
-
NativeHelpers.npm_helper_path
|
|
244
|
-
end
|
|
245
237
|
end
|
|
246
238
|
end
|
|
247
239
|
end
|
|
@@ -339,8 +339,8 @@ module Dependabot
|
|
|
339
339
|
SharedHelpers.with_git_configured(credentials: credentials) do
|
|
340
340
|
Dir.chdir(path) do
|
|
341
341
|
SharedHelpers.run_helper_subprocess(
|
|
342
|
-
command:
|
|
343
|
-
function: "checkPeerDependencies",
|
|
342
|
+
command: NativeHelpers.helper_path,
|
|
343
|
+
function: "yarn:checkPeerDependencies",
|
|
344
344
|
args: [
|
|
345
345
|
Dir.pwd,
|
|
346
346
|
dependency.name,
|
|
@@ -356,8 +356,8 @@ module Dependabot
|
|
|
356
356
|
SharedHelpers.with_git_configured(credentials: credentials) do
|
|
357
357
|
Dir.chdir(path) do
|
|
358
358
|
SharedHelpers.run_helper_subprocess(
|
|
359
|
-
command:
|
|
360
|
-
function: "checkPeerDependencies",
|
|
359
|
+
command: NativeHelpers.helper_path,
|
|
360
|
+
function: "npm:checkPeerDependencies",
|
|
361
361
|
args: [
|
|
362
362
|
Dir.pwd,
|
|
363
363
|
dependency.name,
|
|
@@ -469,14 +469,6 @@ module Dependabot
|
|
|
469
469
|
).package_files_requiring_update
|
|
470
470
|
end
|
|
471
471
|
|
|
472
|
-
def yarn_helper_path
|
|
473
|
-
NativeHelpers.yarn_helper_path
|
|
474
|
-
end
|
|
475
|
-
|
|
476
|
-
def npm_helper_path
|
|
477
|
-
NativeHelpers.npm_helper_path
|
|
478
|
-
end
|
|
479
|
-
|
|
480
472
|
def version_for_dependency(dep)
|
|
481
473
|
if dep.version && version_class.correct?(dep.version)
|
|
482
474
|
return version_class.new(dep.version)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-npm_and_yarn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.95.
|
|
4
|
+
version: 0.95.85
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-03-
|
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dependabot-common
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.95.
|
|
19
|
+
version: 0.95.85
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - '='
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.95.
|
|
26
|
+
version: 0.95.85
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: byebug
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -145,40 +145,38 @@ extra_rdoc_files: []
|
|
|
145
145
|
files:
|
|
146
146
|
- helpers/.eslintrc
|
|
147
147
|
- helpers/build
|
|
148
|
-
- helpers/npm/
|
|
149
|
-
- helpers/npm/
|
|
150
|
-
- helpers/npm/
|
|
151
|
-
- helpers/npm/
|
|
152
|
-
- helpers/npm/
|
|
153
|
-
- helpers/
|
|
154
|
-
- helpers/
|
|
155
|
-
- helpers/
|
|
156
|
-
- helpers/
|
|
157
|
-
- helpers/
|
|
158
|
-
- helpers/
|
|
159
|
-
- helpers/
|
|
160
|
-
- helpers/
|
|
148
|
+
- helpers/lib/npm/helpers.js
|
|
149
|
+
- helpers/lib/npm/index.js
|
|
150
|
+
- helpers/lib/npm/peer-dependency-checker.js
|
|
151
|
+
- helpers/lib/npm/subdependency-updater.js
|
|
152
|
+
- helpers/lib/npm/updater.js
|
|
153
|
+
- helpers/lib/yarn/fix-duplicates.js
|
|
154
|
+
- helpers/lib/yarn/helpers.js
|
|
155
|
+
- helpers/lib/yarn/index.js
|
|
156
|
+
- helpers/lib/yarn/lockfile-parser.js
|
|
157
|
+
- helpers/lib/yarn/peer-dependency-checker.js
|
|
158
|
+
- helpers/lib/yarn/replace-lockfile-declaration.js
|
|
159
|
+
- helpers/lib/yarn/subdependency-updater.js
|
|
160
|
+
- helpers/lib/yarn/updater.js
|
|
161
|
+
- helpers/package-lock.json
|
|
161
162
|
- helpers/package.json
|
|
163
|
+
- helpers/run.js
|
|
164
|
+
- helpers/test/npm/fixtures/npm-left-pad.json
|
|
165
|
+
- helpers/test/npm/fixtures/updater/original/package-lock.json
|
|
166
|
+
- helpers/test/npm/fixtures/updater/original/package.json
|
|
167
|
+
- helpers/test/npm/fixtures/updater/updated/package-lock.json
|
|
168
|
+
- helpers/test/npm/helpers.js
|
|
169
|
+
- helpers/test/npm/updater.test.js
|
|
170
|
+
- helpers/test/yarn/fixtures/updater/original/package.json
|
|
171
|
+
- helpers/test/yarn/fixtures/updater/original/yarn.lock
|
|
172
|
+
- helpers/test/yarn/fixtures/updater/updated/yarn.lock
|
|
173
|
+
- helpers/test/yarn/fixtures/updater/with-version-comments/package.json
|
|
174
|
+
- helpers/test/yarn/fixtures/updater/with-version-comments/yarn.lock
|
|
175
|
+
- helpers/test/yarn/fixtures/yarnpkg-is-positive.json
|
|
176
|
+
- helpers/test/yarn/fixtures/yarnpkg-left-pad.json
|
|
177
|
+
- helpers/test/yarn/helpers.js
|
|
178
|
+
- helpers/test/yarn/updater.test.js
|
|
162
179
|
- helpers/yarn.lock
|
|
163
|
-
- helpers/yarn/bin/run.js
|
|
164
|
-
- helpers/yarn/lib/fix-duplicates.js
|
|
165
|
-
- helpers/yarn/lib/helpers.js
|
|
166
|
-
- helpers/yarn/lib/index.js
|
|
167
|
-
- helpers/yarn/lib/lockfile-parser.js
|
|
168
|
-
- helpers/yarn/lib/peer-dependency-checker.js
|
|
169
|
-
- helpers/yarn/lib/replace-lockfile-declaration.js
|
|
170
|
-
- helpers/yarn/lib/subdependency-updater.js
|
|
171
|
-
- helpers/yarn/lib/updater.js
|
|
172
|
-
- helpers/yarn/package.json
|
|
173
|
-
- helpers/yarn/test/fixtures/updater/original/package.json
|
|
174
|
-
- helpers/yarn/test/fixtures/updater/original/yarn.lock
|
|
175
|
-
- helpers/yarn/test/fixtures/updater/updated/yarn.lock
|
|
176
|
-
- helpers/yarn/test/fixtures/updater/with-version-comments/package.json
|
|
177
|
-
- helpers/yarn/test/fixtures/updater/with-version-comments/yarn.lock
|
|
178
|
-
- helpers/yarn/test/fixtures/yarnpkg-is-positive.json
|
|
179
|
-
- helpers/yarn/test/fixtures/yarnpkg-left-pad.json
|
|
180
|
-
- helpers/yarn/test/helpers.js
|
|
181
|
-
- helpers/yarn/test/updater.test.js
|
|
182
180
|
- lib/dependabot/npm_and_yarn.rb
|
|
183
181
|
- lib/dependabot/npm_and_yarn/dependency_files_filterer.rb
|
|
184
182
|
- lib/dependabot/npm_and_yarn/file_fetcher.rb
|
data/helpers/npm/package.json
DELETED
data/helpers/yarn/bin/run.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const functionMap = require("../lib");
|
|
4
|
-
|
|
5
|
-
function output(obj) {
|
|
6
|
-
process.stdout.write(JSON.stringify(obj));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const input = [];
|
|
10
|
-
process.stdin.on("data", data => input.push(data));
|
|
11
|
-
process.stdin.on("end", () => {
|
|
12
|
-
const request = JSON.parse(input.join(""));
|
|
13
|
-
const func = functionMap[request.function];
|
|
14
|
-
if (!func) {
|
|
15
|
-
output({ error: `Invalid function ${request.function}` });
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
func
|
|
20
|
-
.apply(null, request.args)
|
|
21
|
-
.then(result => {
|
|
22
|
-
output({ result: result });
|
|
23
|
-
})
|
|
24
|
-
.catch(error => {
|
|
25
|
-
output({ error: error.message });
|
|
26
|
-
process.exit(1);
|
|
27
|
-
});
|
|
28
|
-
});
|
data/helpers/yarn/lib/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const lockfileParser = require("../lib/lockfile-parser");
|
|
2
|
-
const updater = require("../lib/updater");
|
|
3
|
-
const subdependencyUpdater = require("../lib/subdependency-updater");
|
|
4
|
-
const peerDependencyChecker = require("../lib/peer-dependency-checker");
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
parseLockfile: lockfileParser.parse,
|
|
8
|
-
update: updater.updateDependencyFiles,
|
|
9
|
-
updateSubdependency: subdependencyUpdater.updateDependencyFile,
|
|
10
|
-
checkPeerDependencies: peerDependencyChecker.checkPeerDependencies
|
|
11
|
-
};
|