-
Notifications
You must be signed in to change notification settings - Fork 744
feat(sync): enable none syncModel proxy all public packages #590
Conversation
"none" 同步模式下,非 scoped 模块的读请求,全部302跳转到 npm 源上去 |
这应该是默认模式,这样搭建私有 npm 的成本最低,一个 sqlite3和本地文件存储就 ok 了。 |
var debug = require('debug')('cnpmjs.org:middleware:proxy_to_npm'); | ||
var config = require('../config'); | ||
|
||
var proxyUrls = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
兼容一下支持配置一个私有模块列表?
可能有需求是需要发布一个私有版本的包来覆盖官方的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或者还是检查一下这个包是否是私有的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,我再改改。
国内就让他们使用淘宝npm,
国外就让他们使用官方npm
Sent from my iPhone
On Feb 3, 2015, at 1:11 AM, Yiyu He [email protected] wrote:
In middleware/proxy_to_npm.js:
- * Copyright(c) Alibaba Group Holding Limited.
- * Authors:
- * 苏千 [email protected] (http://fengmk2.com)
- /
+
+'use strict';
+
+/*- * Module dependencies.
- */
+
+var debug = require('debug')('cnpmjs.org:middleware:proxy_to_npm');
+var config = require('../config');
+
+var proxyUrls = [
或者还是检查一下这个包是否是私有的—
Reply to this email directly or view it on GitHub.
其实这个模式下确实就和 https://github.com/rlidwka/sinopia 有点像了 |
在国内跑的前提是.. 有镜像扛着 |
|
@@ -146,6 +146,10 @@ SyncModuleWorker.prototype.start = function () { | |||
return; | |||
} | |||
|
|||
if (config.syncModel === 'none') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是 none 的话,不做任何同步,只触发上游源站同步
9ae6bbe
to
249cd23
Compare
249cd23
to
af8ae63
Compare
👍 🚢 |
feat(sync): enable none syncModel proxy all public packages
Fixes #589 #581
enablePrivate = false
by defaultsyncModel = "none"
by default