Skip to content

Commit 899d2a7

Browse files
committed
Remove cross-fetch dependency
1 parent 3506ce2 commit 899d2a7

File tree

7 files changed

+6
-16
lines changed

7 files changed

+6
-16
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ updates:
1111

1212
- package-ecosystem: npm
1313
directory: '/'
14-
allow:
15-
- dependency-name: cross-fetch
1614

1715
schedule:
1816
interval: 'monthly'

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@
7272
"git add"
7373
]
7474
},
75-
"dependencies": {
76-
"cross-fetch": "^3.1.6"
77-
},
7875
"devDependencies": {
7976
"@babel/core": "^7.23.6",
8077
"@babel/preset-env": "^7.22.5",

rollup.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = [
2929
// browser-friendly UMD build
3030
{
3131
input: 'src/browser.ts', // directory to transpilation of typescript
32-
external: ['cross-fetch', 'cross-fetch/polyfill'],
3332
output: {
3433
name: 'window',
3534
extend: true,
@@ -75,7 +74,6 @@ module.exports = [
7574
// ES module (for bundlers) build.
7675
{
7776
input: 'src/index.ts',
78-
external: ['cross-fetch', 'cross-fetch/polyfill'],
7977
output: [
8078
{
8179
file: getOutputFileName(
@@ -96,7 +94,6 @@ module.exports = [
9694
// Compatible only in a nodeJS environment.
9795
{
9896
input: 'src/index.ts',
99-
external: ['cross-fetch', 'cross-fetch/polyfill'],
10097
output: {
10198
file: getOutputFileName(
10299
// will add .min. in filename if in production env

src/http-requests.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ class HttpRequests {
123123
body?: any;
124124
config?: Record<string, any>;
125125
}) {
126-
if (typeof fetch === 'undefined') {
127-
require('cross-fetch/polyfill');
128-
}
129-
130126
const constructURL = new URL(url, this.url);
131127
if (params) {
132128
const queryParams = new URLSearchParams();

tests/settings.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
171171
},
172172
};
173173
const task = await client.index(index.uid).updateSettings(newSettings);
174-
await client.index(index.uid).waitForTask(task.taskUid);
174+
await client
175+
.index(index.uid)
176+
.waitForTask(task.taskUid, { timeOutMs: 60_000 });
175177
const response = await client.index(index.uid).getSettings();
176178

177179
expect(response).toMatchSnapshot();

tests/utils/meilisearch-test-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ const clearAllIndexes = async (config: Config): Promise<void> => {
8080
const { results } = await client.getRawIndexes();
8181
const indexes = results.map((elem) => elem.uid);
8282

83-
const taskIds = [];
83+
const taskIds: number[] = [];
8484
for (const indexUid of indexes) {
8585
const { taskUid } = await client.index(indexUid).delete();
8686
taskIds.push(taskUid);
8787
}
88-
await client.waitForTasks(taskIds);
88+
await client.waitForTasks(taskIds, { timeOutMs: 60_000 });
8989
};
9090

9191
function decode64(buff: string) {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,7 @@ create-jest@^29.7.0:
27762776
jest-util "^29.7.0"
27772777
prompts "^2.0.1"
27782778

2779-
cross-fetch@^3.0.4, cross-fetch@^3.1.6:
2779+
cross-fetch@^3.0.4:
27802780
version "3.1.6"
27812781
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.6.tgz#bae05aa31a4da760969756318feeee6e70f15d6c"
27822782
integrity sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==

0 commit comments

Comments
 (0)