File tree 6 files changed +34
-10
lines changed
6 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 42
42
]
43
43
},
44
44
"devDependencies" : {
45
- "axios" : " ^0.17.1" ,
46
45
"babel-core" : " ^7.0.0-0" ,
47
46
"debug" : " ^3.1.0" ,
48
47
"eslint" : " ^4.16.0" ,
54
53
"lint-staged" : " ^6.0.1" ,
55
54
"memfs" : " ^2.6.0" ,
56
55
"puppeteer" : " ^1.0.0" ,
56
+ "request" : " ^2.83.0" ,
57
+ "request-promise-native" : " ^1.0.5" ,
57
58
"yorkie" : " ^1.0.2"
58
59
}
59
60
}
Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ module.exports = async function getVersions () {
8
8
// test/debug, use local version
9
9
latest = process . env . VUE_CLI_LATEST_VERSION = current
10
10
} else {
11
- const axios = require ( 'axios ' )
11
+ const request = require ( './request ' )
12
12
const options = require ( '../options' ) . loadOptions ( )
13
13
const registry = options . useTaobaoRegistry
14
14
? `https://registry.npm.taobao.org`
15
15
: `https://registry.npmjs.org`
16
16
17
- const res = await axios . get ( `${ registry } /vue-cli-version-marker/latest` )
18
- if ( res . status === 200 ) {
19
- latest = process . env . VUE_CLI_LATEST_VERSION = res . data . version
17
+ const res = await request . get ( `${ registry } /vue-cli-version-marker/latest` )
18
+ if ( res . statusCode === 200 ) {
19
+ latest = process . env . VUE_CLI_LATEST_VERSION = res . body . version
20
20
} else {
21
21
// fallback to local version
22
22
latest = process . env . VUE_CLI_LATEST_VERSION = current
Original file line number Diff line number Diff line change 1
- const axios = require ( 'axios ' )
1
+ const request = require ( './request ' )
2
2
const chalk = require ( 'chalk' )
3
3
const execa = require ( 'execa' )
4
4
const readline = require ( 'readline' )
@@ -16,7 +16,7 @@ const registries = {
16
16
const taobaoDistURL = 'https://npm.taobao.org/dist'
17
17
18
18
async function ping ( registry ) {
19
- await axios . get ( `${ registry } /vue-cli-version-marker/latest` )
19
+ await request . get ( `${ registry } /vue-cli-version-marker/latest` )
20
20
return registry
21
21
}
22
22
Original file line number Diff line number Diff line change
1
+ const request = require ( 'request-promise-native' )
2
+
3
+ module . exports = {
4
+ async get ( uri ) {
5
+ const reqOpts = {
6
+ method : 'GET' ,
7
+ resolveWithFullResponse : true ,
8
+ json : true ,
9
+ uri
10
+ }
11
+
12
+ return request ( reqOpts )
13
+ }
14
+ }
Original file line number Diff line number Diff line change 28
28
},
29
29
"dependencies" : {
30
30
"@vue/cli-shared-utils" : " ^3.0.0-alpha.11" ,
31
- "axios" : " ^0.17.1" ,
32
31
"chalk" : " ^2.3.0" ,
33
32
"commander" : " ^2.12.2" ,
34
33
"ejs" : " ^2.5.7" ,
44
43
"minimist" : " ^1.2.0" ,
45
44
"mkdirp" : " ^0.5.1" ,
46
45
"recast" : " ^0.13.0" ,
46
+ "request" : " ^2.83.0" ,
47
+ "request-promise-native" : " ^1.0.5" ,
47
48
"resolve" : " ^1.5.0" ,
48
49
"rimraf" : " ^2.6.2" ,
49
50
"semver" : " ^5.4.1" ,
Original file line number Diff line number Diff line change 4
4
const fs = require ( 'fs' )
5
5
const path = require ( 'path' )
6
6
const chalk = require ( 'chalk' )
7
- const axios = require ( 'axios ' )
7
+ const request = require ( 'request-promise-native ' )
8
8
const semver = require ( 'semver' )
9
9
const globby = require ( 'globby' )
10
10
const { execSync } = require ( 'child_process' )
@@ -18,13 +18,21 @@ const localPackageRE = /'(@vue\/(?:cli|eslint|babel)[\w-]+)': '\^([\w-.]+)'/g
18
18
19
19
const versionCache = { }
20
20
21
+ const getRequest = uri => {
22
+ request ( {
23
+ method : 'GET' ,
24
+ resolveWithFullResponse : true ,
25
+ uri
26
+ } )
27
+ }
28
+
21
29
const getRemoteVersion = async ( pkg ) => {
22
30
if ( versionCache [ pkg ] ) {
23
31
return versionCache [ pkg ]
24
32
}
25
33
let res
26
34
try {
27
- res = await axios . get ( `http://registry.npmjs.org/${ pkg } /latest` )
35
+ res = await getRequest ( `http://registry.npmjs.org/${ pkg } /latest` )
28
36
} catch ( e ) {
29
37
return
30
38
}
You can’t perform that action at this time.
0 commit comments