Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #21497 from storybookjs/tom/21432-replace-… #21526

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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