pxnpm 3.0.6 → 3.0.7-0
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.
- package/lib/config.js +76 -77
- package/package.json +1 -2
package/lib/config.js
CHANGED
|
@@ -30,88 +30,87 @@ try {
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
// =====
|
|
33
|
-
const ping = require("connection-tester");
|
|
33
|
+
// const ping = require("connection-tester");
|
|
34
34
|
const rawArgs = process.argv && process.argv.slice(2);
|
|
35
35
|
const rawAction = rawArgs && rawArgs[0];
|
|
36
36
|
const isPublish = rawAction === "login" || rawAction === "publish";
|
|
37
37
|
|
|
38
|
-
process.env.outerAddr = JSON.stringify({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const outerAddr = JSON.parse(process.env.outerAddr);
|
|
82
|
-
|
|
83
|
-
const getAddr = function(type) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
let addr = getAddr("io");
|
|
38
|
+
// process.env.outerAddr = JSON.stringify({
|
|
39
|
+
// inner: {
|
|
40
|
+
// proxy: {
|
|
41
|
+
// protocol: "http:",
|
|
42
|
+
// host: "green-90.inner.px.nfjbill.ren",
|
|
43
|
+
// port: 20022
|
|
44
|
+
// },
|
|
45
|
+
// registry: {
|
|
46
|
+
// protocol: "http:",
|
|
47
|
+
// host: "green-90.inner.px.nfjbill.ren",
|
|
48
|
+
// port: isPublish ? 20023 : 20021
|
|
49
|
+
// }
|
|
50
|
+
// },[
|
|
51
|
+
// outer: {
|
|
52
|
+
// proxy: {
|
|
53
|
+
// protocol: "http:",
|
|
54
|
+
// host: "npm.taobao.org",
|
|
55
|
+
// port: 80
|
|
56
|
+
// },
|
|
57
|
+
// registry: {
|
|
58
|
+
// protocol: "http:",
|
|
59
|
+
// host: "pip.xt.nfjbill.ren",
|
|
60
|
+
// port: isPublish ? 8905 : 38082
|
|
61
|
+
// }
|
|
62
|
+
// },
|
|
63
|
+
// io: {
|
|
64
|
+
// proxy: {
|
|
65
|
+
// protocol: "http:",
|
|
66
|
+
// host: "green-90.inner.px.nfjbill.ren",
|
|
67
|
+
// port: 20022
|
|
68
|
+
// },
|
|
69
|
+
// registry: {
|
|
70
|
+
// protocol: "http:",
|
|
71
|
+
// host: "green-90.inner.px.nfjbill.ren",
|
|
72
|
+
// port: isPublish ? 20023 : 20021
|
|
73
|
+
// }
|
|
74
|
+
// },
|
|
75
|
+
// // yk3 内部端口
|
|
76
|
+
// lp: {
|
|
77
|
+
// addr: "http://127.0.0.1:38020"
|
|
78
|
+
// }
|
|
79
|
+
// });
|
|
80
|
+
|
|
81
|
+
// const outerAddr = JSON.parse(process.env.outerAddr);
|
|
82
|
+
|
|
83
|
+
// const getAddr = function(type) {
|
|
84
|
+
// return {
|
|
85
|
+
// proxy: `${outerAddr[type].proxy.protocol}//${outerAddr[type].proxy.host}:${outerAddr[type].proxy.port}`,
|
|
86
|
+
// registry: `${outerAddr[type].registry.protocol}//${outerAddr[type].registry.host}:${outerAddr[type].registry.port}`
|
|
87
|
+
// };
|
|
88
|
+
// };
|
|
89
|
+
|
|
90
|
+
// let addr = getAddr("io");
|
|
91
91
|
let pxnpmServer = `http://${outerAddr.io.registry.host}`;
|
|
92
|
-
const timeout = 3000;
|
|
93
|
-
const { success: is } = ping.test(outerAddr.inner.proxy.host, outerAddr.inner.proxy.port, timeout); // registry
|
|
94
|
-
const { success: os } = ping.test(outerAddr.outer.proxy.host, outerAddr.outer.proxy.port, timeout); // proxy
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
let registry = addr.registry;
|
|
92
|
+
// const timeout = 3000;
|
|
93
|
+
// const { success: is } = ping.test(outerAddr.inner.proxy.host, outerAddr.inner.proxy.port, timeout); // registry
|
|
94
|
+
// const { success: os } = ping.test(outerAddr.outer.proxy.host, outerAddr.outer.proxy.port, timeout); // proxy
|
|
95
|
+
|
|
96
|
+
// if (!is && !os) {
|
|
97
|
+
// // consola.fatal('没有发现安装源,请调通网络,或重新尝试安装');
|
|
98
|
+
// // process.exit(0);
|
|
99
|
+
// addr = getAddr("outer");
|
|
100
|
+
// }
|
|
101
|
+
//
|
|
102
|
+
// if (!is && os) {
|
|
103
|
+
// // consola.warn('您正在使用协同模式安装,如果安装失败,请多尝试几次,或联系管理员');
|
|
104
|
+
// addr = getAddr("outer");
|
|
105
|
+
// }
|
|
106
|
+
//
|
|
107
|
+
// if (is && !os) {
|
|
108
|
+
// addr = getAddr("inner");
|
|
109
|
+
// proxy = addr.proxy;
|
|
110
|
+
// }
|
|
111
|
+
|
|
112
|
+
let proxy = 'http://tpl.cln3.nfjbill.ren:20022';
|
|
113
|
+
let registry = `http://tpl.cln3.nfjbill.ren:${isPublish ? 20023 : 20021}`;
|
|
115
114
|
|
|
116
115
|
const userconfig = path.join(root, '.pxnpmrc');
|
|
117
116
|
if (fs.existsSync(userconfig)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxnpm",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7-0",
|
|
4
4
|
"description": "cnpm: npm client for cnpmjs.org",
|
|
5
5
|
"preferGlobal": true,
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"auto-correct": "^1.0.0",
|
|
23
23
|
"bagpipe": "^0.3.5",
|
|
24
24
|
"commander": "~2.10.0",
|
|
25
|
-
"connection-tester": "^0.2.1",
|
|
26
25
|
"cross-spawn": "~0.2.8",
|
|
27
26
|
"debug": "^4.3.4",
|
|
28
27
|
"giturl": "^1.0.0",
|