Skip to content

Commit

Permalink
Merge pull request #608 from thefrontside/mk/fetch
Browse files Browse the repository at this point in the history
Upgrade `cross-fetch` and remove `node-fetch`
  • Loading branch information
minkimcello committed Jan 25, 2022
2 parents 0591337 + cd7698e commit a81ece7
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changes/fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effection/fetch": "patch"
---

Remove redundant node-fetch from dependencies
3 changes: 1 addition & 2 deletions packages/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
},
"dependencies": {
"@effection/core": "2.1.0",
"cross-fetch": "^3.0.4",
"node-fetch": "^2.6.1"
"cross-fetch": "3.1.5"
},
"volta": {
"extends": "../../package.json"
Expand Down
5 changes: 2 additions & 3 deletions packages/process/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,19 @@
"mocha": "mocha -r ts-node/register"
},
"devDependencies": {
"@effection/fetch": "^2.0.2",
"@frontside/tsconfig": "^1.2.0",
"@types/cross-spawn": "^6.0.2",
"@types/node": "^16.3.2",
"@types/node-fetch": "^2.5.7",
"expect": "^25.4.0",
"mocha": "^8.3.1",
"node-fetch": "^2.6.1",
"ts-node": "^10.4.0",
"typescript": "^4.3.5"
},
"dependencies": {
"effection": "2.0.2",
"cross-spawn": "^7.0.3",
"ctrlc-windows": "^2.0.0",
"effection": "2.0.2",
"shellwords": "^0.1.1"
},
"volta": {
Expand Down
8 changes: 3 additions & 5 deletions packages/process/test/daemon.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { describe, it, beforeEach, afterEach } from '@effection/mocha';
import { describe, it, beforeEach, afterEach, captureError } from '@effection/mocha';
import expect from 'expect';
import fetch from 'node-fetch';

import { run, Task, createFuture } from 'effection';
import { run, Task, createFuture, fetch, spawn } from 'effection';

import { daemon, Process } from '../src';

Expand Down Expand Up @@ -42,9 +41,8 @@ describe('daemon', () => {
beforeEach(function*() {
task.halt();
});

it('kills the process', function*() {
yield expect(fetch(`http://localhost:29000`, { method: "POST", body: "hello" })).rejects.toHaveProperty('name', 'FetchError');
expect(yield captureError(fetch(`http://localhost:29000`, { method: "POST", body: "hello" }))).toHaveProperty('name', 'FetchError');
});
});

Expand Down
3 changes: 1 addition & 2 deletions packages/process/test/exec.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Task, spawn } from 'effection';
import { Task, spawn, fetch } from 'effection';
import { describe, it, beforeEach, captureError } from '@effection/mocha';
import expect from 'expect';

import { exec, Process, ProcessResult } from '../src';
import fetch from 'node-fetch';

describe('exec', () => {
describe('.join', () => {
Expand Down
51 changes: 33 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2317,14 +2317,6 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.1.tgz#f3f3ae4590c5386fc7c543aae9b78d4cf30ffee9"
integrity sha512-NysN+bNqj6E0Hv4CTGWSlPzMW6vTKjDpOteycDkV4IWBsO+PU48JonrPzV9ODjiI2XrjmA05KInLgF5ivZ/YGQ==

"@types/node-fetch@^2.5.7":
version "2.5.8"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb"
integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw==
dependencies:
"@types/node" "*"
form-data "^3.0.0"

"@types/node-static@^0.7.6":
version "0.7.6"
resolved "https://registry.yarnpkg.com/@types/node-static/-/node-static-0.7.6.tgz#18d1464c5e8d1e525a467f304433b2f84cb41d55"
Expand Down Expand Up @@ -3559,7 +3551,7 @@ colors@>=0.6.0:
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==

combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
combined-stream@^1.0.6, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
Expand Down Expand Up @@ -3796,6 +3788,13 @@ create-require@^1.1.0:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

cross-fetch@3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
dependencies:
node-fetch "2.6.7"

cross-fetch@^3.0.4:
version "3.0.6"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c"
Expand Down Expand Up @@ -5099,15 +5098,6 @@ forever-agent@~0.6.1:
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=

form-data@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
Expand Down Expand Up @@ -7121,6 +7111,13 @@ node-fetch@2.6.1, node-fetch@^2.6.1:
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==

node-fetch@2.6.7:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"

node-forge@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3"
Expand Down Expand Up @@ -9556,6 +9553,11 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=

trim-newlines@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
Expand Down Expand Up @@ -10039,6 +10041,11 @@ wcwidth@^1.0.1:
dependencies:
defaults "^1.0.3"

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=

webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
Expand Down Expand Up @@ -10068,6 +10075,14 @@ whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0:
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

whatwg-url@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06"
Expand Down

0 comments on commit a81ece7

Please sign in to comment.