feat: return a map of fetchers instead of a function

BREAKING CHANGE:

API changed
This commit is contained in:
Zoltan Kochan
2017-12-04 23:42:38 +02:00
parent d3bb3caa3e
commit 6ff952ef85
4 changed files with 48 additions and 241 deletions

View File

@@ -35,9 +35,7 @@
"dependencies": {
"@pnpm/git-fetcher": "^0.1.0",
"@pnpm/tarball-fetcher": "^0.2.0",
"@pnpm/types": "^1.2.1",
"package-store": "^0.9.0",
"unpack-stream": "^2.2.0"
"@pnpm/types": "^1.2.1"
},
"devDependencies": {
"@pnpm/logger": "^1.0.0",

View File

@@ -2,8 +2,6 @@ dependencies:
'@pnpm/git-fetcher': 0.1.0
'@pnpm/tarball-fetcher': 0.2.0
'@pnpm/types': 1.2.1
package-store: 0.9.0
unpack-stream: 2.2.0
devDependencies:
'@pnpm/logger': 1.0.0
'@types/tape': 4.2.31
@@ -98,6 +96,7 @@ packages:
resolution:
integrity: sha512-fOby+9vGOB15+6GsNI3maUx/Ig4lW3hOH9is0OsrKRyyeJ42gk2mUn4UoRko3kXVPj44TSxDx81Th3EisXx8rg==
/@types/load-json-file/2.0.7:
dev: true
resolution:
integrity: sha512-NrH6jPlV77QCVPhAHofWeiOr77TgpKt82c2RVxSBChWBJqyY/u4ngl3CA4mcsAg/w7rNLrkR7dkObMV0ihLLXw==
/@types/mem/1.1.2:
@@ -107,6 +106,7 @@ packages:
/@types/mz/0.0.31:
dependencies:
'@types/node': 8.0.54
dev: true
resolution:
integrity: sha1-pNgMCC/v5x5Ap8DwfR5lVbu8e1I=
/@types/mz/0.0.32:
@@ -119,10 +119,6 @@ packages:
'@types/events': 1.1.0
resolution:
integrity: sha512-qetMdTv3Ytz9u9ESLdcYs45LPI0mczYZIbC184n7kY0jczOqPNQsabBfVCh+na3B2shAfvC459JqHV771A8Rxg==
/@types/ramda/0.25.6:
dev: false
resolution:
integrity: sha512-txqMN+JUsJqL8BMYgQkfll3jIIE1mgFoM+eJLnxRUOs0Q5zC+E1UB6+yGpVzYP4kmw1Ywf6F1pywkGpm2032oA==
/@types/retry/0.10.2:
dev: false
resolution:
@@ -221,6 +217,7 @@ packages:
/argparse/1.0.9:
dependencies:
sprintf-js: 1.0.3
dev: true
resolution:
integrity: sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=
/arr-exclude/1.0.0:
@@ -456,11 +453,6 @@ packages:
optional: true
resolution:
integrity: sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=
/bindings/1.3.0:
dev: false
optional: true
resolution:
integrity: sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==
/bl/1.2.1:
dependencies:
readable-stream: 2.3.3
@@ -859,13 +851,6 @@ packages:
dev: true
resolution:
integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
/debug/3.1.0:
dependencies:
ms: 2.0.0
dev: false
optional: true
resolution:
integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
/decamelize-keys/1.1.0:
dependencies:
decamelize: 1.2.0
@@ -907,6 +892,7 @@ packages:
resolution:
integrity: sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=
/deep-extend/0.4.2:
dev: true
engines:
iojs: '>=1.0.0'
node: '>=0.12.0'
@@ -916,6 +902,7 @@ packages:
dependencies:
foreach: 2.0.5
object-keys: 1.0.11
dev: true
engines:
node: '>= 0.4'
resolution:
@@ -944,6 +931,7 @@ packages:
resolution:
integrity: sha1-920GQ1LN9Docts5hnE7jqUdd4gg=
/detect-indent/5.0.0:
dev: true
engines:
node: '>=4'
resolution:
@@ -979,32 +967,6 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-G3CK8JSknJoOfbyteQq6U52sEXc=
/drive-by-path/1.0.0:
dependencies:
is-subdir: 1.0.2
once: 1.4.0
ramda: 0.24.1
util.promisify: 1.0.0
dev: false
engines:
node: '>=4'
optionalDependencies:
drivelist: 5.2.7
resolution:
integrity: sha512-FSY6axBYIVfYz9Rj6c6ECzcSxoNgqZRfAQP0kDiCVa38gPDzVyPWcEvxfDnJ96xW4oXLZLpiOloxRnC1sUKksA==
/drivelist/5.2.7:
dependencies:
bindings: 1.3.0
debug: 3.1.0
js-yaml: 3.10.0
lodash: 4.17.4
nan: 2.8.0
prebuild-install: 2.3.0
engines:
node: '>=4'
optional: true
resolution:
integrity: sha512-TslD6xoCLUUxlP9vNCixEkIwRv/aoCjVrdxiw5jd2iVWBS631DhashXYZaUek8TgfKnE59Sox4Wo12jVuM+XIg==
/duplexer/0.1.1:
dev: true
resolution:
@@ -1037,14 +999,6 @@ packages:
dev: true
resolution:
integrity: sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4=
/encode-registry/1.1.0:
dependencies:
mem: 3.0.0
dev: false
engines:
node: '>=4'
resolution:
integrity: sha512-we1k9/KE1067YXEyJzPg+kXlNFLk9/LT2IFP3VZgmANNwf8Bx+KdAVd1wxLpG8y7v6EgplVGTstmVNICwiaCNA==
/end-of-stream/1.4.0:
dependencies:
once: 1.4.0
@@ -1053,6 +1007,7 @@ packages:
/error-ex/1.3.1:
dependencies:
is-arrayish: 0.2.1
dev: true
resolution:
integrity: sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=
/es-abstract/1.10.0:
@@ -1062,6 +1017,7 @@ packages:
has: 1.0.1
is-callable: 1.1.3
is-regex: 1.0.4
dev: true
engines:
node: '>= 0.4'
resolution:
@@ -1071,6 +1027,7 @@ packages:
is-callable: 1.1.3
is-date-object: 1.0.1
is-symbol: 1.0.1
dev: true
engines:
node: '>= 0.4'
resolution:
@@ -1082,6 +1039,7 @@ packages:
resolution:
integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
/esprima/4.0.0:
dev: true
engines:
node: '>=4'
resolution:
@@ -1114,11 +1072,6 @@ packages:
node: '>=4'
resolution:
integrity: sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=
/expand-template/1.1.0:
dev: false
optional: true
resolution:
integrity: sha512-kkjwkMqj0h4w/sb32ERCDxCQkREMCAgS39DscDnSwDsbxnwwM1BTZySdC3Bn1lhY7vL08n9GoO/fVTynjDgRyQ==
/extend/3.0.1:
dev: false
resolution:
@@ -1207,6 +1160,7 @@ packages:
resolution:
integrity: sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=
/foreach/2.0.5:
dev: true
resolution:
integrity: sha1-C+4AUBiusmDQo6865ljdATbsG5k=
/forever-agent/0.6.1:
@@ -1251,6 +1205,7 @@ packages:
resolution:
integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
/function-bind/1.1.1:
dev: true
resolution:
integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
/gauge/2.7.4:
@@ -1284,11 +1239,6 @@ packages:
dev: false
resolution:
integrity: sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
/github-from-package/0.0.0:
dev: false
optional: true
resolution:
integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=
/github-slugger/1.2.0:
dependencies:
emoji-regex: 6.1.1
@@ -1444,6 +1394,7 @@ packages:
/has/1.0.1:
dependencies:
function-bind: 1.1.1
dev: true
engines:
node: '>= 0.8.0'
resolution:
@@ -1550,6 +1501,7 @@ packages:
resolution:
integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
/ini/1.3.5:
dev: true
resolution:
integrity: sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
/into-stream/3.1.0:
@@ -1579,6 +1531,7 @@ packages:
resolution:
integrity: sha1-37SqTRCF4zvbYcLe6cgOnGwZ9Ts=
/is-arrayish/0.2.1:
dev: true
resolution:
integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
/is-builtin-module/1.0.0:
@@ -1594,11 +1547,13 @@ packages:
resolution:
integrity: sha1-XuWOqlounIDiFAe+3yOuWsCRs/w=
/is-callable/1.1.3:
dev: true
engines:
node: '>= 0.4'
resolution:
integrity: sha1-hut1OSgF3cM69xySoO7fdO52BLI=
/is-date-object/1.0.1:
dev: true
engines:
node: '>= 0.4'
resolution:
@@ -1655,6 +1610,7 @@ packages:
resolution:
integrity: sha1-iVJojF7C/9awPsyF52ngKQMINHA=
/is-plain-obj/1.1.0:
dev: true
engines:
node: '>=0.10.0'
resolution:
@@ -1672,6 +1628,7 @@ packages:
/is-regex/1.0.4:
dependencies:
has: 1.0.1
dev: true
engines:
node: '>= 0.4'
resolution:
@@ -1687,15 +1644,8 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
/is-subdir/1.0.2:
dependencies:
is-windows: 1.0.1
dev: false
engines:
node: '>=4'
resolution:
integrity: sha512-2H3vM92ez7TjW6T2e4G7AQVm/1/UA/qikNO0/aIi2SkouUU2wXW2CQ5Owiz8oaaFQpjNl74B5LIjTcM1htr2mQ==
/is-symbol/1.0.1:
dev: true
engines:
node: '>= 0.4'
resolution:
@@ -1713,6 +1663,7 @@ packages:
resolution:
integrity: sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=
/is-windows/1.0.1:
dev: true
engines:
node: '>=0.10.0'
resolution:
@@ -1752,6 +1703,7 @@ packages:
dependencies:
argparse: 1.0.9
esprima: 4.0.0
dev: true
resolution:
integrity: sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==
/jsbn/0.1.1:
@@ -1768,6 +1720,7 @@ packages:
resolution:
integrity: sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
/json-parse-better-errors/1.0.1:
dev: true
resolution:
integrity: sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==
/json-schema-traverse/0.3.1:
@@ -1841,6 +1794,7 @@ packages:
parse-json: 4.0.0
pify: 3.0.0
strip-bom: 3.0.0
dev: true
engines:
node: '>=4'
resolution:
@@ -1859,6 +1813,7 @@ packages:
resolution:
integrity: sha1-o45GtzRp4EILDaEhLmbUFL42S6Q=
/lodash/4.17.4:
dev: true
resolution:
integrity: sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=
/longest-streak/1.0.0:
@@ -1901,6 +1856,7 @@ packages:
/make-dir/1.1.0:
dependencies:
pify: 3.0.0
dev: true
engines:
node: '>=4'
resolution:
@@ -2023,6 +1979,7 @@ packages:
resolution:
integrity: sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
/minimist/1.2.0:
dev: true
resolution:
integrity: sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
/mkdirp-promise/5.0.1:
@@ -2277,6 +2234,7 @@ packages:
resolution:
integrity: sha1-t+m8RNw22I6vHVgmBn54ySEeqVE=
/ms/2.0.0:
dev: true
resolution:
integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
/mz/2.7.0:
@@ -2286,11 +2244,6 @@ packages:
thenify-all: 1.6.0
resolution:
integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==
/nan/2.8.0:
dev: false
optional: true
resolution:
integrity: sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=
/ndjson/1.5.0:
dependencies:
json-stringify-safe: 5.0.1
@@ -2310,24 +2263,12 @@ packages:
node: '>=6'
resolution:
integrity: sha1-gixFgNer54PfGZZbeJYiyoAWA+Q=
/node-abi/2.1.2:
dependencies:
semver: 5.4.1
dev: false
optional: true
resolution:
integrity: sha512-hmUtb8m75RSi7N+zZLYqe75XDvZB+6LyTBPkj2DConvNgQet2e3BIqEwe1LLvqMrfyjabuT5ZOrTioLCH1HTdA==
/node-status-codes/1.0.0:
dev: true
engines:
node: '>=0.10.0'
resolution:
integrity: sha1-WuVUHQJGRdMqWPzdyc7s6nrjrC8=
/noop-logger/0.1.1:
dev: false
optional: true
resolution:
integrity: sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=
/normalize-newline/2.0.0:
dev: true
engines:
@@ -2351,14 +2292,11 @@ packages:
/normalize-path/2.1.1:
dependencies:
remove-trailing-separator: 1.1.0
dev: true
engines:
node: '>=0.10.0'
resolution:
integrity: sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=
/normalize-registry-url/1.0.0:
dev: false
resolution:
integrity: sha512-0v6T4851b72ykk5zEtFoN4QX/Fqyk7pouIj9xZyAvAe9jlDhAwT4z6FlwsoQCHjeuK2EGUoAwy/F4y4B1uZq9A==
/normalize-url/2.0.0:
dependencies:
prepend-http: 2.0.0
@@ -2436,19 +2374,11 @@ packages:
resolution:
integrity: sha512-OHHnLgLNXpM++GnJRyyhbr2bwl3pPVm4YvaraHrRvDt/N3r+s/gDVHciA7EJBTkijKXj61ssgSAikq1fb0IBRg==
/object-keys/1.0.11:
dev: true
engines:
node: '>= 0.4'
resolution:
integrity: sha1-xUYBd4rVYPEULODgG8yotW0TQm0=
/object.getownpropertydescriptors/2.0.3:
dependencies:
define-properties: 1.1.2
es-abstract: 1.10.0
dev: false
engines:
node: '>= 0.8'
resolution:
integrity: sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=
/once/1.4.0:
dependencies:
wrappy: 1.0.2
@@ -2495,6 +2425,7 @@ packages:
resolution:
integrity: sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=
/p-limit/1.1.0:
dev: true
engines:
node: '>=4'
resolution:
@@ -2513,12 +2444,6 @@ packages:
node: '>=4'
resolution:
integrity: sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==
/p-queue/2.3.0:
dev: false
engines:
node: '>=4'
resolution:
integrity: sha1-ZdVecbwVAPxBMSLamK5Ff/inwDg=
/p-timeout/2.0.1:
dependencies:
p-finally: 1.0.0
@@ -2562,43 +2487,6 @@ packages:
node: '>=4'
resolution:
integrity: sha512-V85iWedhni2ptcNjdTryAd0PjqxiYi0BQgRZDJKVQBD9NuPF/shyOmn0A8OYIipIKMQ6QNKImeVd849KbH31hQ==
/package-store/0.9.0:
dependencies:
'@pnpm/types': 1.2.1
'@types/load-json-file': 2.0.7
'@types/node': 8.0.54
'@types/ramda': 0.25.6
'@types/retry': 0.10.2
dint: 1.0.0
drive-by-path: 1.0.0
encode-registry: 1.1.0
execa: 0.8.0
load-json-file: 4.0.0
mkdirp-promise: 5.0.1
mz: 2.7.0
normalize-path: 2.1.1
normalize-registry-url: 1.0.0
os-homedir: 1.0.2
p-limit: 1.1.0
p-queue: 2.3.0
path-absolute: 1.0.0
path-exists: 3.0.0
ramda: 0.25.0
read-package-json: 2.0.12
rename-overwrite: 1.0.0
retry: 0.10.1
rimraf-then: 1.0.1
symlink-dir: 1.1.0
thenify: 3.3.0
unpack-stream: 2.2.0
write-json-file: 2.3.0
dev: false
engines:
node: '>=4'
peerDependencies:
'@pnpm/logger': ^1.0.0
resolution:
integrity: sha512-ywAzY4eF9DT7j8u1vE+0a8KWSz+xDaGQl+nCpc5UYzgq2Xqe3XPJepwL2tfiLujmlS6THe9FyOt0llPevoDNTw==
/pako/0.2.9:
resolution:
integrity: sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=
@@ -2625,6 +2513,7 @@ packages:
dependencies:
error-ex: 1.3.1
json-parse-better-errors: 1.0.1
dev: true
engines:
node: '>=4'
resolution:
@@ -2641,12 +2530,6 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=
/path-absolute/1.0.0:
dependencies:
os-homedir: 1.0.2
dev: false
resolution:
integrity: sha512-s0wa8oTU0s+jtq9C/xfNIRDp/8s6E2oeRvsATw1b6EZ1GNKxUCapwyBKdSzVm/2wkARh4KnyxTt3avOP4MwvnQ==
/path-exists/2.1.0:
dependencies:
pinkie-promise: 2.0.1
@@ -2656,6 +2539,7 @@ packages:
resolution:
integrity: sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=
/path-exists/3.0.0:
dev: true
engines:
node: '>=4'
resolution:
@@ -2710,6 +2594,7 @@ packages:
resolution:
integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
/pify/3.0.0:
dev: true
engines:
node: '>=4'
resolution:
@@ -2734,26 +2619,6 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=
/prebuild-install/2.3.0:
dependencies:
expand-template: 1.1.0
github-from-package: 0.0.0
minimist: 1.2.0
mkdirp: 0.5.1
node-abi: 2.1.2
noop-logger: 0.1.1
npmlog: 4.1.2
os-homedir: 1.0.2
pump: 1.0.3
rc: 1.2.2
simple-get: 1.4.3
tar-fs: 1.16.0
tunnel-agent: 0.6.0
xtend: 4.0.1
dev: false
optional: true
resolution:
integrity: sha512-gzjq2oHB8oMbzJSsSh9MQ64zrXZGt092/uT4TLZlz2qnrPxpWqp4vYB7LZrDxnlxf5RfbCjkgDI/z0EIVuYzAw==
/prepend-http/1.0.4:
dev: true
engines:
@@ -2832,20 +2697,13 @@ packages:
node: '>=4'
resolution:
integrity: sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=
/ramda/0.24.1:
dev: false
resolution:
integrity: sha1-w7d1UZfzW43DUCIoJixMkd22uFc=
/ramda/0.25.0:
dev: false
resolution:
integrity: sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==
/rc/1.2.2:
dependencies:
deep-extend: 0.4.2
ini: 1.3.5
minimist: 1.2.0
strip-json-comments: 2.0.1
dev: true
resolution:
integrity: sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=
/rcfile/1.0.3:
@@ -2871,17 +2729,6 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=
/read-package-json/2.0.12:
dependencies:
glob: 7.1.2
json-parse-better-errors: 1.0.1
normalize-package-data: 2.4.0
slash: 1.0.0
dev: false
optionalDependencies:
graceful-fs: 4.1.11
resolution:
integrity: sha512-m7/I0+tP6D34EVvSlzCtuVA4D/dHL6OpLcn2e4XVP5X57pCKGUy1JjRSBVKHWpB+vUU91sL85h84qX0MdXzBSw==
/read-pkg-up/1.0.1:
dependencies:
find-up: 1.1.2
@@ -2991,17 +2838,9 @@ packages:
resolution:
integrity: sha1-Rxt5AU16SWvboB0BihJvj3ctiMY=
/remove-trailing-separator/1.1.0:
dev: true
resolution:
integrity: sha1-wkvOKig62tW8P1jg1IJJuSN52O8=
/rename-overwrite/1.0.0:
dependencies:
graceful-fs: 4.1.11
rimraf: 2.6.2
thenify: 3.3.0
timeout-then: 1.1.0
dev: false
resolution:
integrity: sha1-tFp0zrk9EHPjHFtwHEKN5XllI9g=
/repeat-string/1.6.1:
dev: true
engines:
@@ -3189,16 +3028,8 @@ packages:
/signal-exit/3.0.2:
resolution:
integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
/simple-get/1.4.3:
dependencies:
once: 1.4.0
unzip-response: 1.0.2
xtend: 4.0.1
dev: false
optional: true
resolution:
integrity: sha1-6XVe2kB+ltpAxeUVjJ6jezO+y+s=
/slash/1.0.0:
dev: true
engines:
node: '>=0.10.0'
resolution:
@@ -3225,6 +3056,7 @@ packages:
/sort-keys/2.0.0:
dependencies:
is-plain-obj: 1.1.0
dev: true
engines:
node: '>=4'
resolution:
@@ -3279,6 +3111,7 @@ packages:
resolution:
integrity: sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==
/sprintf-js/1.0.3:
dev: true
resolution:
integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
/sshpk/1.13.1:
@@ -3378,6 +3211,7 @@ packages:
resolution:
integrity: sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=
/strip-bom/3.0.0:
dev: true
engines:
node: '>=4'
resolution:
@@ -3403,6 +3237,7 @@ packages:
resolution:
integrity: sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=
/strip-json-comments/2.0.1:
dev: true
engines:
node: '>=0.10.0'
resolution:
@@ -3435,6 +3270,7 @@ packages:
is-windows: 1.0.1
mkdirp-promise: 5.0.1
mz: 2.7.0
dev: true
engines:
node: '>=4'
resolution:
@@ -3539,12 +3375,6 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=
/timeout-then/1.1.0:
dependencies:
any-promise: 1.3.0
dev: false
resolution:
integrity: sha1-AUWwYHAVnBfiFG/SkrAaG9geX7w=
/to-fast-properties/1.0.3:
dev: true
engines:
@@ -3699,6 +3529,7 @@ packages:
resolution:
integrity: sha512-UU/97pTZMXBpWGRJLmmDq2mN3v3dBbFgrUNH26UpfvyVwbO1i0ZZnzQvm7YEoTcMJpFpuX9LWGYNu2rmh6K4Jg==
/unzip-response/1.0.2:
dev: true
engines:
node: '>=0.10'
resolution:
@@ -3743,13 +3574,6 @@ packages:
/util-deprecate/1.0.2:
resolution:
integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
/util.promisify/1.0.0:
dependencies:
define-properties: 1.1.2
object.getownpropertydescriptors: 2.0.3
dev: false
resolution:
integrity: sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==
/uuid/2.0.3:
dev: true
resolution:
@@ -3824,6 +3648,7 @@ packages:
graceful-fs: 4.1.11
imurmurhash: 0.1.4
signal-exit: 3.0.2
dev: true
resolution:
integrity: sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==
/write-json-file/1.2.0:
@@ -3848,6 +3673,7 @@ packages:
pify: 3.0.0
sort-keys: 2.0.0
write-file-atomic: 2.3.0
dev: true
engines:
node: '>=4'
resolution:
@@ -3894,10 +3720,8 @@ specifiers:
mos: ^2.0.0-alpha.3
mos-plugin-readme: ^1.0.4
package-preview: ^1.0.1
package-store: ^0.9.0
rimraf: ^2.6.2
tape: ^4.8.0
ts-node: ^3.3.0
tslint: ^5.8.0
typescript: ^2.6.1
unpack-stream: ^2.2.0

View File

@@ -1,25 +1,10 @@
import fetchFromGit from '@pnpm/git-fetcher'
import createTarballFetcher from '@pnpm/tarball-fetcher'
import {PnpmOptions} from '@pnpm/types'
import {FetchFunction, FetchOptions, Resolution} from 'package-store'
import * as unpackStream from 'unpack-stream'
export default function (opts: PnpmOptions & {alwaysAuth: boolean, registry: string, strictSsl: boolean, rawNpmConfig: object}) {
return fetcher.bind(null, {
return {
...createTarballFetcher(opts),
git: fetchFromGit,
})
}
async function fetcher (
fetcherByHostingType: {[hostingType: string]: FetchFunction},
resolution: Resolution,
target: string,
opts: FetchOptions,
): Promise<unpackStream.Index> {
const fetch = fetcherByHostingType[resolution.type || 'tarball']
if (!fetch) {
throw new Error(`Fetching for dependency type "${resolution.type}" is not supported`)
}
return await fetch(resolution, target, opts)
}

View File

@@ -8,6 +8,6 @@ test('createFetcher()', t => {
strictSsl: false,
rawNpmConfig: {},
})
t.equal(typeof fetcher, 'function')
t.equal(typeof fetcher, 'object')
t.end()
})