Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
refactor: change domain to npmmirror.com (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 1, 2021
1 parent ca17a73 commit 29f7e06
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- 8
- 10
- 12
- 14
- 16
script: "make test-travis-all"
after_script: "npm i codecov && codecov"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ TESTS = $(shell ls -S `find test -type f -name "*.test.js" -print`)
REPORTER = spec
TIMEOUT = 30000
MOCHA_OPTS =
REGISTRY = --registry=https://registry.npm.taobao.org
REGISTRY = --registry=https://registry.npmmirror.com
DB = sqlite

install:
@npm install --build-from-source $(REGISTRY) \
--disturl=https://npm.taobao.org/mirrors/node
--disturl=https://npmmirror.com/mirrors/node

install-production production:
@NODE_ENV=production $(MAKE) install
Expand Down
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
mirrors
---------------

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![David deps][david-image]][david-url]
[![node version][node-image]][node-url]
[![Gittip][gittip-image]][gittip-url]

[npm-image]: https://img.shields.io/npm/v/mirrors.svg?style=flat-square
[npm-url]: https://npmjs.org/package/mirrors
[travis-image]: https://img.shields.io/travis/cnpm/mirrors.svg?style=flat-square
[travis-url]: https://travis-ci.org/cnpm/mirrors
[coveralls-image]: https://img.shields.io/coveralls/cnpm/mirrors.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/cnpm/mirrors?branch=master
[david-image]: https://img.shields.io/david/cnpm/mirrors.svg?style=flat-square
[david-url]: https://david-dm.org/cnpm/mirrors
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.11.14-blue.svg?style=flat-square
[node-url]: https://nodejs.org/download/
[gittip-image]: https://img.shields.io/gittip/dead-horse.svg?style=flat-square
[gittip-url]: https://www.gittip.com/dead-horse/

mirrors everything

Expand All @@ -29,16 +17,16 @@ mirrors everything

```bash
# windows
ELECTRON_BUILDER_BINARIES_MIRROR=https://npm.taobao.org/mirrors/electron-builder-binaries/ \
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ electron-builder build --win
ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ electron-builder build --win

# linux
ELECTRON_BUILDER_BINARIES_MIRROR=https://npm.taobao.org/mirrors/electron-builder-binaries/ \
ELECTRON_MIRROR=http:https://npm.taobao.org/mirrors/electron/ electron-builder build --linux
ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \
ELECTRON_MIRROR=https:https://npmmirror.com/mirrors/electron/ electron-builder build --linux

# macOS
ELECTRON_BUILDER_BINARIES_MIRROR=https://npm.taobao.org/mirrors/electron-builder-binaries/ \
ELECTRON_MIRROR=http:https://npm.taobao.org/mirrors/electron/ electron-builder build --mac
ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \
ELECTRON_MIRROR=https:https://npmmirror.com/mirrors/electron/ electron-builder build --mac
```

## Contributing
Expand All @@ -55,8 +43,10 @@ For more information about how to run the project, see Makefile.
3. You can alternatively choose which one you wanna sync in `config.categories` in `config/index.js`
4. If you wanna visit 7001 port, change `bindingHost` to `0.0.0.0` in `config/index.js`

## Usage
## License

[MIT](LICENSE.txt)

### License
## Contributors

MIT
[![](https://badges.implements.io/api/contributors?org=cnpm&repo=mirrors&width=1250&size=96&padding=6)](https://github.com/cnpm/mirrors/graphs/contributors)
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var config = {

// sync by clone from other mirrors
cloneMode: false,
cloneUrl: 'https://npm.taobao.org/mirrors/apis',
cloneUrl: 'https://npmmirror.com/mirrors/apis',

// proxy nodesecurity advisories
nodesecurity: {
Expand Down
4 changes: 2 additions & 2 deletions controllers/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ function* download(category, name) {
var info = yield Dist.getfile(category, name);
if (!info || !info.url) {
// auto fix /vX.X.X => /X.X.X
// HTTPError: Response code 404 (Not Found) for https://npm.taobao.org/mirrors/electron/v8.2.0/electron-v8.2.0-darwin-x64.zip
// fix to => https://npm.taobao.org/mirrors/electron/8.2.0/electron-v8.2.0-darwin-x64.zip
// HTTPError: Response code 404 (Not Found) for https://npmmirror.com/mirrors/electron/v8.2.0/electron-v8.2.0-darwin-x64.zip
// fix to => https://npmmirror.com/mirrors/electron/8.2.0/electron-v8.2.0-darwin-x64.zip
if (/^\/v\d+\.\d+\.\d+/.test(name)) {
info = yield Dist.getfile(category, name.replace('/v', '/'));
} else if (/^\/\d+\.\d+\.\d+/.test(name)) {
Expand Down
2 changes: 1 addition & 1 deletion sync/sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ proto.formatDownloadItem = function(fileParent, pkg, nodeAbiVersion, nodePlatfor
proto.formatDownloadItemWithNAPI = function(fileParent, pkg, napiVersion, nodePlatform) {
// >= 5.0.0
// "package_name": "napi-v{napi_build_version}-{platform}-{arch}.tar.gz",
// https://cdn.npm.taobao.org/dist/sqlite3/v5.0.0/napi-v3-linux-x64.tar.gz
// https://oss.npmmirror.com/dist/sqlite3/v5.0.0/napi-v3-linux-x64.tar.gz
// https://github.com/mapbox/node-sqlite3/blob/29debf3ad7d052427541503d871d6c69ed8588a7/package.json#L16
// "napi_versions": [
// 3
Expand Down

0 comments on commit 29f7e06

Please sign in to comment.