Skip to content

Commit

Permalink
feat: replace request with @cypress/request (#4234)
Browse files Browse the repository at this point in the history
* deps: request@2.88.2 -> @cypress/request@3.0.1

* yarn dedupe dependencies

* Fix comment
  • Loading branch information
legobeat authored and juanpicado committed Dec 8, 2023
1 parent 359e4ae commit e11d95d
Show file tree
Hide file tree
Showing 144 changed files with 514 additions and 3,412 deletions.
2,363 changes: 344 additions & 2,019 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/fsevents-patch-2882183fbf-8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/resolve-patch-0c52e0e4f7-5656f4d0be.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/uuid-npm-3.4.0-4fd8ef88ad-58de2feed6.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"url": "https://opencollective.com/verdaccio"
},
"dependencies": {
"@cypress/request": "3.0.1",
"@verdaccio/config": "7.0.0-next.4",
"@verdaccio/core": "7.0.0-next.4",
"@verdaccio/local-storage": "10.3.3",
Expand Down Expand Up @@ -52,7 +53,6 @@
"mkdirp": "1.0.4",
"mv": "2.1.1",
"pkginfo": "0.4.1",
"request": "2.88.2",
"semver": "7.5.4",
"validator": "13.11.0",
"verdaccio-audit": "12.0.0-next.4",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/notify/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OptionsWithUrl } from '@cypress/request';
import Handlebars from 'handlebars';
import _ from 'lodash';
import { OptionsWithUrl } from 'request';

import { Config, Package, RemoteUser } from '@verdaccio/types';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/notify/notify-request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import request, { RequiredUriUrl } from '@cypress/request';
import buildDebug from 'debug';
import isNil from 'lodash/isNil';
import request, { RequiredUriUrl } from 'request';

import { HTTP_STATUS } from '../constants';
import { logger } from '../logger';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/up-storage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import request from '@cypress/request';
import JSONStream from 'JSONStream';
import buildDebug from 'debug';
import _ from 'lodash';
import request from 'request';
import Stream from 'stream';
import URL, { UrlWithStringQuery } from 'url';
import zlib from 'zlib';
Expand Down
2 changes: 1 addition & 1 deletion test/lib/request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import request from '@cypress/request';
import assert from 'assert';
import _ from 'lodash';
import request from 'request';

import { IRequestPromise } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/modules/basic_system.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import request from '@cypress/request';
import express from 'express';
import request from 'request';
import rimraf from 'rimraf';

import endPointAPI from '../../../src/api/index';
Expand Down
8 changes: 4 additions & 4 deletions test/unit/modules/notifications/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Notifications:: notifyRequest', () => {
});

test('when notification service throws error', async () => {
jest.doMock('request', () => (options, resolver) => {
jest.doMock('@cypress/request', () => (options, resolver) => {
const response = {
statusCode: HTTP_STATUS.BAD_REQUEST,
};
Expand All @@ -49,7 +49,7 @@ describe('Notifications:: notifyRequest', () => {
});

test('when notification service throws error with null error value', async () => {
jest.doMock('request', () => (options, resolver) => {
jest.doMock('@cypress/request', () => (options, resolver) => {
const response = {
statusCode: HTTP_STATUS.BAD_REQUEST,
body: API_ERROR.BAD_DATA,
Expand All @@ -69,7 +69,7 @@ describe('Notifications:: notifyRequest', () => {
});

test('when notification is successfully delivered', async () => {
jest.doMock('request', () => (options, resolver) => {
jest.doMock('@cypress/request', () => (options, resolver) => {
const response = {
statusCode: HTTP_STATUS.OK,
body: 'Successfully delivered',
Expand All @@ -90,7 +90,7 @@ describe('Notifications:: notifyRequest', () => {
});

test('when notification is successfully delivered but body is undefined/null', async () => {
jest.doMock('request', () => (options, resolver) => {
jest.doMock('@cypress/request', () => (options, resolver) => {
const response = {
statusCode: HTTP_STATUS.OK,
};
Expand Down

0 comments on commit e11d95d

Please sign in to comment.