From 21cc95b8c44ab2674e1e8652eef4f1469ae7d4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Juli=C3=A1n=20Merelo=20Guerv=C3=B3s?= Date: Thu, 20 Jan 2022 17:22:28 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20url=20=E2=86=92=20Eliminate=20obsolete?= =?UTF-8?q?=20"url"=20library=20from=20the=20cli=20subpackage=20(#19695)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Emily Rohrbough --- cli/lib/tasks/download.js | 12 ++++++------ cli/package.json | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cli/lib/tasks/download.js b/cli/lib/tasks/download.js index ed98a1abed..59e586728d 100644 --- a/cli/lib/tasks/download.js +++ b/cli/lib/tasks/download.js @@ -2,7 +2,7 @@ const arch = require('arch') const la = require('lazy-ass') const is = require('check-more-types') const os = require('os') -const Url = require('url') +const url = require('url') const path = require('path') const debug = require('debug')('cypress:cli') const request = require('@cypress/request') @@ -62,7 +62,7 @@ const getCA = () => { } const prepend = (urlPath) => { - const endpoint = Url.resolve(getBaseUrl(), urlPath) + const endpoint = url.resolve(getBaseUrl(), urlPath) const platform = os.platform() const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE') @@ -318,7 +318,7 @@ const downloadFromUrl = ({ url, downloadDestination, progress, ca, version, redi } /** - * Download Cypress.zip from external url to local file. + * Download Cypress.zip from external versionUrl to local file. * @param [string] version Could be "3.3.0" or full URL * @param [string] downloadDestination Local filename to save as */ @@ -335,12 +335,12 @@ const start = (opts) => { } } } - const url = getUrl(version) + const versionUrl = getUrl(version) progress.throttle = 100 debug('needed Cypress version: %s', version) - debug('source url %s', url) + debug('source url %s', versionUrl) debug(`downloading cypress.zip to "${downloadDestination}"`) // ensure download dir exists @@ -349,7 +349,7 @@ const start = (opts) => { return getCA() }) .then((ca) => { - return downloadFromUrl({ url, downloadDestination, progress, ca, version, + return downloadFromUrl({ url: versionUrl, downloadDestination, progress, ca, version, ...(redirectTTL ? { redirectTTL } : {}) }) }) .catch((err) => { diff --git a/cli/package.json b/cli/package.json index 78c053a777..1cbf5623ef 100644 --- a/cli/package.json +++ b/cli/package.json @@ -61,7 +61,6 @@ "supports-color": "^8.1.1", "tmp": "~0.2.1", "untildify": "^4.0.0", - "url": "^0.11.0", "yauzl": "^2.10.0" }, "devDependencies": {