mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
Merge pull request #21497 from storybookjs/tom/21432-replace-isomorphic-unfetch
Telemetry: Replace isomorphic-unfetch with node-fetch in telemetry
This commit is contained in:
commit
44284e4ccc
@ -45,12 +45,13 @@
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.64",
|
||||
"@storybook/core-common": "7.0.0-beta.64",
|
||||
"@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": {
|
||||
|
@ -1,12 +1,12 @@
|
||||
/// <reference types="@types/jest" />;
|
||||
|
||||
import fetch from 'isomorphic-unfetch';
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
import { sendTelemetry } from './telemetry';
|
||||
|
||||
jest.mock('isomorphic-unfetch');
|
||||
jest.mock('node-fetch');
|
||||
|
||||
const fetchMock = fetch as jest.Mock;
|
||||
const fetchMock = fetch as any as jest.Mock;
|
||||
|
||||
beforeEach(() => {
|
||||
fetchMock.mockResolvedValue({ status: 200 });
|
||||
|
@ -1,4 +1,4 @@
|
||||
import originalFetch from 'isomorphic-unfetch';
|
||||
import originalFetch from 'node-fetch';
|
||||
import retry from 'fetch-retry';
|
||||
import { nanoid } from 'nanoid';
|
||||
import type { Options, TelemetryData } from './types';
|
||||
@ -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);
|
||||
const fetch = retry(originalFetch as any);
|
||||
|
||||
let tasks: Promise<any>[] = [];
|
||||
|
||||
|
@ -7106,12 +7106,13 @@ __metadata:
|
||||
dependencies:
|
||||
"@storybook/client-logger": 7.0.0-beta.64
|
||||
"@storybook/core-common": 7.0.0-beta.64
|
||||
"@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
|
||||
|
Loading…
x
Reference in New Issue
Block a user