Skip to content

Commit

Permalink
feat: use cdn url directly (#4)
Browse files Browse the repository at this point in the history
skip npm.taobao.org to redirect
  • Loading branch information
fengmk2 authored May 3, 2018
1 parent 8f064e1 commit 6d57c88
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ language: node_js
node_js:
- '4'
- '6'
- '7'
- '8'
- '10'
install:
- npm i npminstall && npminstall
script:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This software is licensed under the MIT License.

Copyright (c) 2016 cnpm and other contributors
Copyright (c) 2016 - present cnpm and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Binary mirror config for [prebuild](https://github.com/mafintosh/prebuild) and [

## Mirrors

- China: https://npm.taobao.org/mirrors
- China: https://npm.taobao.org/mirrors/
- CDN prefix: https://cdn.npm.taobao.org/dist/

## License

Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ environment:
matrix:
- nodejs_version: '4'
- nodejs_version: '6'
- nodejs_version: '7'
- nodejs_version: '8'
- nodejs_version: '10'

install:
- ps: Install-Product node $env:nodejs_version
Expand Down
63 changes: 31 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"web": "https://github.com/cnpm/binary-mirror-config"
},
"bugs": {
"url": "https://github.com/cnpm/binary-mirror-config/issues",
"email": "m@fengmk2.com"
"url": "https://github.com/cnpm/binary-mirror-config/issues"
},
"keywords": [
"binary-mirror-config",
Expand All @@ -38,84 +37,84 @@
"author": "fengmk2 <m@fengmk2.com> (http://fengmk2.com)",
"license": "MIT",
"ci": {
"version": "4, 6, 7"
"version": "4, 6, 8, 10"
},
"mirrors": {
"china": {
"ENVS": {
"NODEJS_ORG_MIRROR": "https://npm.taobao.org/mirrors/node",
"NVM_NODEJS_ORG_MIRROR": "https://npm.taobao.org/mirrors/node",
"NVM_IOJS_ORG_MIRROR": "https://npm.taobao.org/mirrors/iojs",
"PHANTOMJS_CDNURL": "https://npm.taobao.org/mirrors/phantomjs",
"CHROMEDRIVER_CDNURL": "https://tnpm-hz.oss-cn-hangzhou.aliyuncs.com/dist/chromedriver",
"OPERADRIVER_CDNURL": "https://npm.taobao.org/mirrors/operadriver",
"ELECTRON_MIRROR": "https://npm.taobao.org/mirrors/electron/",
"SASS_BINARY_SITE": "https://npm.taobao.org/mirrors/node-sass",
"NODEJS_ORG_MIRROR": "https://cdn.npm.taobao.org/dist/node",
"NVM_NODEJS_ORG_MIRROR": "https://cdn.npm.taobao.org/dist/node",
"NVM_IOJS_ORG_MIRROR": "https://cdn.npm.taobao.org/dist/iojs",
"PHANTOMJS_CDNURL": "https://cdn.npm.taobao.org/dist/phantomjs",
"CHROMEDRIVER_CDNURL": "https://cdn.npm.taobao.org/dist/chromedriver",
"OPERADRIVER_CDNURL": "https://cdn.npm.taobao.org/dist/operadriver",
"ELECTRON_MIRROR": "https://cdn.npm.taobao.org/dist/electron/",
"SASS_BINARY_SITE": "https://cdn.npm.taobao.org/dist/node-sass",
"FLOW_BINARY_MIRROR": "https://github.com/facebook/flow/releases/download/v",
"NWJS_URLBASE": "https://npm.taobao.org/mirrors/nwjs/v",
"NWJS_URLBASE": "https://cdn.npm.taobao.org/dist/nwjs/v",
"PUPPETEER_DOWNLOAD_HOST": "https://cdn.npm.taobao.org/dist"
},
"utf-8-validate": {
"host": "https://npm.taobao.org/mirrors/utf-8-validate/v{version}"
"host": "https://cdn.npm.taobao.org/dist/utf-8-validate/v{version}"
},
"leveldown": {
"host": "https://npm.taobao.org/mirrors/leveldown/v{version}"
"host": "https://cdn.npm.taobao.org/dist/leveldown/v{version}"
},
"leveldown-hyper": {
"host": "https://npm.taobao.org/mirrors/leveldown-hyper/v{version}"
"host": "https://cdn.npm.taobao.org/dist/leveldown-hyper/v{version}"
},
"mknod": {
"host": "https://npm.taobao.org/mirrors/mknod/v{version}"
"host": "https://cdn.npm.taobao.org/dist/mknod/v{version}"
},
"couchbase": {
"host": "https://npm.taobao.org/mirrors/couchbase/v{version}"
"host": "https://cdn.npm.taobao.org/dist/couchbase/v{version}"
},
"sodium-prebuilt": {
"host": "https://npm.taobao.org/mirrors/sodium-prebuilt/v{version}"
"host": "https://cdn.npm.taobao.org/dist/sodium-prebuilt/v{version}"
},
"utp-native": {
"host": "https://npm.taobao.org/mirrors/utp-native/v{version}"
"host": "https://cdn.npm.taobao.org/dist/utp-native/v{version}"
},
"node-tk5": {
"host": "https://npm.taobao.org/mirrors/node-tk5/v{version}"
"host": "https://cdn.npm.taobao.org/dist/node-tk5/v{version}"
},
"fuse-bindings": {
"host": "https://npm.taobao.org/mirrors/fuse-bindings/v{version}"
"host": "https://cdn.npm.taobao.org/dist/fuse-bindings/v{version}"
},
"zmq-prebuilt": {
"host": "https://npm.taobao.org/mirrors/zmq-prebuilt/v{version}"
"host": "https://cdn.npm.taobao.org/dist/zmq-prebuilt/v{version}"
},
"gl": {
"host": "https://npm.taobao.org/mirrors/gl/v{version}"
"host": "https://cdn.npm.taobao.org/dist/gl/v{version}"
},
"hackrf": {
"host": "https://npm.taobao.org/mirrors/hackrf/v{version}"
"host": "https://cdn.npm.taobao.org/dist/hackrf/v{version}"
},
"rabin": {
"host": "https://npm.taobao.org/mirrors/rabin/v{version}"
"host": "https://cdn.npm.taobao.org/dist/rabin/v{version}"
},
"v8-debug": {
"host": "https://npm.taobao.org/mirrors/node-inspector"
"host": "https://cdn.npm.taobao.org/dist/node-inspector"
},
"v8-profiler": {
"host": "https://npm.taobao.org/mirrors/node-inspector"
"host": "https://cdn.npm.taobao.org/dist/node-inspector"
},
"sqlite3": {
"host": "https://npm.taobao.org/mirrors"
"host": "https://cdn.npm.taobao.org/dist"
},
"grpc": {
"host": "https://npm.taobao.org/mirrors",
"host": "https://cdn.npm.taobao.org/dist",
"remote_path": "{name}/v{version}"
},
"fsevents": {
"host": "https://npm.taobao.org/mirrors/fsevents"
"host": "https://cdn.npm.taobao.org/dist/fsevents"
},
"nodegit": {
"host": "https://npm.taobao.org/mirrors/nodegit/v{version}"
"host": "https://cdn.npm.taobao.org/dist/nodegit/v{version}"
},
"flow-bin": {
"replaceHost": "https://github.com/facebook/flow/releases/download/v",
"host": "https://npm.taobao.org/mirrors/flow/v"
"host": "https://cdn.npm.taobao.org/dist/flow/v"
},
"jpegtran-bin": {
"replaceHost": [
Expand Down
8 changes: 4 additions & 4 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('test/index.test.js', () => {
it('should config exists', () => {
console.log(config);
assert.deepEqual(Object.keys(config), [ 'china' ]);
assert.equal(config.china.sqlite3.host, 'https://npm.taobao.org/mirrors');
assert.equal(config.china.fsevents.host, 'https://npm.taobao.org/mirrors/fsevents');
assert.equal(config.china['flow-bin'].host, 'https://npm.taobao.org/mirrors/flow/v');
assert.equal(config.china.ENVS.CHROMEDRIVER_CDNURL, 'https://tnpm-hz.oss-cn-hangzhou.aliyuncs.com/dist/chromedriver');
assert.equal(config.china.sqlite3.host, 'https://cdn.npm.taobao.org/dist');
assert.equal(config.china.fsevents.host, 'https://cdn.npm.taobao.org/dist/fsevents');
assert.equal(config.china['flow-bin'].host, 'https://cdn.npm.taobao.org/dist/flow/v');
assert.equal(config.china.ENVS.CHROMEDRIVER_CDNURL, 'https://cdn.npm.taobao.org/dist/chromedriver');
});
});

0 comments on commit 6d57c88

Please sign in to comment.