Skip to content

Commit

Permalink
Merge pull request #21526 from storybookjs/revert/tom/21432-replace-i…
Browse files Browse the repository at this point in the history
…somorphic-unfetch

Revert "Merge pull request #21497 from storybookjs/tom/21432-replace-…
  • Loading branch information
shilman authored Mar 10, 2023
2 parents 520d0b2 + a1c6880 commit 559baf5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions code/lib/telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@
"dependencies": {
"@storybook/client-logger": "7.0.0-rc.0",
"@storybook/core-common": "7.0.0-rc.0",
"@types/node-fetch": "^2.5.7",
"chalk": "^4.1.0",
"detect-package-manager": "^2.0.1",
"fetch-retry": "^5.0.2",
"fs-extra": "^11.1.0",
"isomorphic-unfetch": "^3.1.0",
"nanoid": "^3.3.1",
"node-fetch": "^2.6.7",
"read-pkg-up": "^7.0.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions code/lib/telemetry/src/telemetry.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// <reference types="@types/jest" />;

import fetch from 'node-fetch';
import fetch from 'isomorphic-unfetch';

import { sendTelemetry } from './telemetry';

jest.mock('node-fetch');
jest.mock('isomorphic-unfetch');

const fetchMock = fetch as any as jest.Mock;
const fetchMock = fetch as jest.Mock;

beforeEach(() => {
fetchMock.mockResolvedValue({ status: 200 });
Expand Down
4 changes: 2 additions & 2 deletions code/lib/telemetry/src/telemetry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import originalFetch from 'node-fetch';
import originalFetch from 'isomorphic-unfetch';
import retry from 'fetch-retry';
import { nanoid } from 'nanoid';
import type { Options, TelemetryData } from './types';
Expand All @@ -7,7 +7,7 @@ import { set as saveToCache } from './event-cache';

const URL = process.env.STORYBOOK_TELEMETRY_URL || 'https://storybook.js.org/event-log';

const fetch = retry(originalFetch as any);
const fetch = retry(originalFetch);

let tasks: Promise<any>[] = [];

Expand Down
3 changes: 1 addition & 2 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7106,13 +7106,12 @@ __metadata:
dependencies:
"@storybook/client-logger": 7.0.0-rc.0
"@storybook/core-common": 7.0.0-rc.0
"@types/node-fetch": ^2.5.7
chalk: ^4.1.0
detect-package-manager: ^2.0.1
fetch-retry: ^5.0.2
fs-extra: ^11.1.0
isomorphic-unfetch: ^3.1.0
nanoid: ^3.3.1
node-fetch: ^2.6.7
read-pkg-up: ^7.0.1
typescript: ~4.9.3
languageName: unknown
Expand Down

0 comments on commit 559baf5

Please sign in to comment.