mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
make jest and typescript accept the node-fetch ESM edition
This commit is contained in:
parent
ebf5cb642e
commit
0e7dfa2637
@ -28,21 +28,25 @@ const modulesToTransform = [
|
||||
'decode-named-character-reference',
|
||||
'estree',
|
||||
'is-absolute-url',
|
||||
'lit',
|
||||
'lit-html',
|
||||
'lit',
|
||||
'mdast',
|
||||
'micromark',
|
||||
'nanoid',
|
||||
'node-fetch',
|
||||
'remark',
|
||||
'rxjs',
|
||||
'data-uri-to-buffer',
|
||||
'fetch-blob',
|
||||
'formdata-polyfill',
|
||||
'slash',
|
||||
'space-separated-tokens',
|
||||
'stringify-entities',
|
||||
'unified',
|
||||
'unist',
|
||||
'uuid',
|
||||
'vfile',
|
||||
'vfile-message',
|
||||
'vfile',
|
||||
'zwitch',
|
||||
];
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import originalFetch from 'node-fetch';
|
||||
import retry from 'fetch-retry';
|
||||
import { nanoid } from 'nanoid';
|
||||
@ -8,7 +10,7 @@ import { getSessionId } from './session-id';
|
||||
|
||||
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>[] = [];
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
"strict": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user