mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Replace request-promise
with node-fetch
(#7899)
`node-fetch` is a smaller and simpler project than `request-promise`, and we already have it as a transitive dependency. `request-promise` was also incorrectly listed as a production dependency. `node-fetch` has been added as a `devDependency` to replace it, as it was only used in one CI script.
This commit is contained in:
parent
f32ea5f676
commit
7908232719
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
const { promises: fs } = require('fs')
|
const { promises: fs } = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const request = require('request-promise')
|
const fetch = require('node-fetch')
|
||||||
const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved
|
const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved
|
||||||
|
|
||||||
start().catch(console.error)
|
start().catch(console.error)
|
||||||
@ -152,14 +152,15 @@ async function start () {
|
|||||||
console.log(`Announcement:\n${commentBody}`)
|
console.log(`Announcement:\n${commentBody}`)
|
||||||
console.log(`Posting to: ${POST_COMMENT_URI}`)
|
console.log(`Posting to: ${POST_COMMENT_URI}`)
|
||||||
|
|
||||||
await request({
|
const response = await fetch(POST_COMMENT_URI, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
uri: POST_COMMENT_URI,
|
|
||||||
body: JSON_PAYLOAD,
|
body: JSON_PAYLOAD,
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'metamaskbot',
|
'User-Agent': 'metamaskbot',
|
||||||
'Authorization': `token ${GITHUB_COMMENT_TOKEN}`,
|
'Authorization': `token ${GITHUB_COMMENT_TOKEN}`,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`Post comment failed with status '${response.statusText}'`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,6 @@
|
|||||||
"redux": "^3.0.5",
|
"redux": "^3.0.5",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-thunk": "^2.2.0",
|
"redux-thunk": "^2.2.0",
|
||||||
"request-promise": "^4.2.1",
|
|
||||||
"reselect": "^3.0.1",
|
"reselect": "^3.0.1",
|
||||||
"rpc-cap": "^1.0.1",
|
"rpc-cap": "^1.0.1",
|
||||||
"safe-event-emitter": "^1.0.1",
|
"safe-event-emitter": "^1.0.1",
|
||||||
@ -272,6 +271,7 @@
|
|||||||
"mocha-jsdom": "^1.1.0",
|
"mocha-jsdom": "^1.1.0",
|
||||||
"mocha-sinon": "^2.0.0",
|
"mocha-sinon": "^2.0.0",
|
||||||
"nock": "^9.0.14",
|
"nock": "^9.0.14",
|
||||||
|
"node-fetch": "^2.6.0",
|
||||||
"node-sass": "^4.12.0",
|
"node-sass": "^4.12.0",
|
||||||
"nyc": "^13.0.0",
|
"nyc": "^13.0.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
|
10
yarn.lock
10
yarn.lock
@ -23773,16 +23773,6 @@ request-promise-native@^1.0.3:
|
|||||||
stealthy-require "^1.1.0"
|
stealthy-require "^1.1.0"
|
||||||
tough-cookie ">=2.3.3"
|
tough-cookie ">=2.3.3"
|
||||||
|
|
||||||
request-promise@^4.2.1:
|
|
||||||
version "4.2.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4"
|
|
||||||
integrity sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=
|
|
||||||
dependencies:
|
|
||||||
bluebird "^3.5.0"
|
|
||||||
request-promise-core "1.1.1"
|
|
||||||
stealthy-require "^1.1.0"
|
|
||||||
tough-cookie ">=2.3.3"
|
|
||||||
|
|
||||||
request@^2.45.0, request@^2.81.0, request@^2.83.0:
|
request@^2.45.0, request@^2.81.0, request@^2.83.0:
|
||||||
version "2.87.0"
|
version "2.87.0"
|
||||||
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
|
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
|
||||||
|
Loading…
Reference in New Issue
Block a user