diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml index 066ea422308..f54dcf59b7a 100644 --- a/.github/workflows/vale.yml +++ b/.github/workflows/vale.yml @@ -11,7 +11,7 @@ permissions: jobs: lint-docs: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Git checkout uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index d080ce2a521..13af2fea197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +## [17.37.1](https://github.com/netlify/cli/compare/v17.37.0...v17.37.1) (2024-10-17) + + +### Bug Fixes + +* **deploy:** fix edge function logs url scope key ([#6881](https://github.com/netlify/cli/issues/6881)) ([f833f2d](https://github.com/netlify/cli/commit/f833f2dc4d238769217e30411cb98ee326dcb582)) +* **deps:** update dependency @netlify/blobs to v8.1.0 ([#6870](https://github.com/netlify/cli/issues/6870)) ([b82c536](https://github.com/netlify/cli/commit/b82c5369a5abbd763f53c2d107cab38826974979)) +* **deps:** update dependency @types/node to v20.16.11 ([#6874](https://github.com/netlify/cli/issues/6874)) ([e41ac33](https://github.com/netlify/cli/commit/e41ac33ca489aaeba6dc034222e89e015120cf28)) +* **deps:** update dependency cookie to v0.7.2 ([#6875](https://github.com/netlify/cli/issues/6875)) ([69a7a3b](https://github.com/netlify/cli/commit/69a7a3b09c96512471f451c90a6d4253dee5648d)) +* **deps:** update dependency express to v4.21.1 ([#6858](https://github.com/netlify/cli/issues/6858)) ([9d37ec0](https://github.com/netlify/cli/commit/9d37ec02a2b8a2112c56a24000148979429a0f9e)) + ## [17.37.0](https://github.com/netlify/cli/compare/v17.36.4...v17.37.0) (2024-10-11) diff --git a/package-lock.json b/package-lock.json index a0560d8328f..aad7e8c94ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "netlify-cli", - "version": "17.37.0", + "version": "17.37.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "netlify-cli", - "version": "17.37.0", + "version": "17.37.1", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -48,7 +48,7 @@ "envinfo": "7.14.0", "etag": "1.8.1", "execa": "5.1.1", - "express": "4.21.0", + "express": "4.21.1", "express-logging": "1.1.1", "extract-zip": "2.0.1", "fastest-levenshtein": "1.0.16", @@ -6540,6 +6540,91 @@ "balanced-match": "^1.0.0" } }, + "node_modules/@verdaccio/middleware/node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@verdaccio/middleware/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@verdaccio/middleware/node_modules/express": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.10", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/@verdaccio/middleware/node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/@verdaccio/middleware/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/@verdaccio/middleware/node_modules/lru-cache": { "version": "7.18.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", @@ -6576,6 +6661,32 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@verdaccio/middleware/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/@verdaccio/middleware/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/@verdaccio/search-indexer": { "version": "8.0.0-next-8.1", "resolved": "https://registry.npmjs.org/@verdaccio/search-indexer/-/search-indexer-8.0.0-next-8.1.tgz", @@ -12284,16 +12395,16 @@ } }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -12342,9 +12453,9 @@ "dev": true }, "node_modules/express/node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "engines": { "node": ">= 0.6" } @@ -12357,11 +12468,6 @@ "ms": "2.0.0" } }, - "node_modules/express/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/express/node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -12385,6 +12491,11 @@ "node": ">= 0.8" } }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, "node_modules/express/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -22158,99 +22269,16 @@ "url": "https://opencollective.com/verdaccio" } }, - "node_modules/verdaccio-audit/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/verdaccio-htpasswd": { - "version": "13.0.0-next-8.3", - "resolved": "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-13.0.0-next-8.3.tgz", - "integrity": "sha512-Nl2rEEyGHJQ/1/93BE9TxBMRN4tKF/51VYTb+hWDQFhDEDAR20rcvJ4ND0jOIIZljI7Lg/WrCPBh90u5IyPJ5Q==", - "dev": true, - "dependencies": { - "@verdaccio/core": "8.0.0-next-8.3", - "@verdaccio/file-locking": "13.0.0-next-8.1", - "apache-md5": "1.1.8", - "bcryptjs": "2.4.3", - "core-js": "3.37.1", - "debug": "4.3.7", - "http-errors": "2.0.0", - "unix-crypt-td-js": "1.1.4" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/verdaccio" - } - }, - "node_modules/verdaccio-htpasswd/node_modules/@verdaccio/file-locking": { - "version": "13.0.0-next-8.1", - "resolved": "https://registry.npmjs.org/@verdaccio/file-locking/-/file-locking-13.0.0-next-8.1.tgz", - "integrity": "sha512-9PhfRKXsWaWJkON/2/jdG5/N+9Kk4UINvbMGuJz0A/PbzIYfVrBhry7fcnjn6hFKxVPTbSOSSztRzLF30nmBFg==", - "dev": true, - "dependencies": { - "lockfile": "1.0.4" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/verdaccio" - } - }, - "node_modules/verdaccio-htpasswd/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verdaccio-htpasswd/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verdaccio/node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true - }, - "node_modules/verdaccio/node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "node_modules/verdaccio-audit/node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true, "engines": { "node": ">= 0.6" } }, - "node_modules/verdaccio/node_modules/depd": { + "node_modules/verdaccio-audit/node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", @@ -22259,10 +22287,10 @@ "node": ">= 0.8" } }, - "node_modules/verdaccio/node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "node_modules/verdaccio-audit/node_modules/express": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dev": true, "dependencies": { "accepts": "~1.3.8", @@ -22270,7 +22298,7 @@ "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.7.1", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -22301,7 +22329,7 @@ "node": ">= 0.10.0" } }, - "node_modules/verdaccio/node_modules/express/node_modules/debug": { + "node_modules/verdaccio-audit/node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", @@ -22310,7 +22338,7 @@ "ms": "2.0.0" } }, - "node_modules/verdaccio/node_modules/http-errors": { + "node_modules/verdaccio-audit/node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", @@ -22326,46 +22354,26 @@ "node": ">= 0.8" } }, - "node_modules/verdaccio/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/verdaccio/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/verdaccio/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "node_modules/verdaccio-audit/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" + "dependencies": { + "agent-base": "6", + "debug": "4" }, "engines": { - "node": ">=10" + "node": ">= 6" } }, - "node_modules/verdaccio/node_modules/ms": { + "node_modules/verdaccio-audit/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/verdaccio/node_modules/safe-buffer": { + "node_modules/verdaccio-audit/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", @@ -22385,6 +22393,109 @@ } ] }, + "node_modules/verdaccio-htpasswd": { + "version": "13.0.0-next-8.3", + "resolved": "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-13.0.0-next-8.3.tgz", + "integrity": "sha512-Nl2rEEyGHJQ/1/93BE9TxBMRN4tKF/51VYTb+hWDQFhDEDAR20rcvJ4ND0jOIIZljI7Lg/WrCPBh90u5IyPJ5Q==", + "dev": true, + "dependencies": { + "@verdaccio/core": "8.0.0-next-8.3", + "@verdaccio/file-locking": "13.0.0-next-8.1", + "apache-md5": "1.1.8", + "bcryptjs": "2.4.3", + "core-js": "3.37.1", + "debug": "4.3.7", + "http-errors": "2.0.0", + "unix-crypt-td-js": "1.1.4" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/verdaccio" + } + }, + "node_modules/verdaccio-htpasswd/node_modules/@verdaccio/file-locking": { + "version": "13.0.0-next-8.1", + "resolved": "https://registry.npmjs.org/@verdaccio/file-locking/-/file-locking-13.0.0-next-8.1.tgz", + "integrity": "sha512-9PhfRKXsWaWJkON/2/jdG5/N+9Kk4UINvbMGuJz0A/PbzIYfVrBhry7fcnjn6hFKxVPTbSOSSztRzLF30nmBFg==", + "dev": true, + "dependencies": { + "lockfile": "1.0.4" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/verdaccio" + } + }, + "node_modules/verdaccio-htpasswd/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verdaccio-htpasswd/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verdaccio/node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, + "node_modules/verdaccio/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/verdaccio/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/verdaccio/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -28001,6 +28112,81 @@ "balanced-match": "^1.0.0" } }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, + "express": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "dev": true, + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.10", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, "lru-cache": { "version": "7.18.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", @@ -28021,6 +28207,18 @@ "requires": { "brace-expansion": "^2.0.1" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true } } }, @@ -32069,16 +32267,16 @@ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" }, "express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -32107,9 +32305,9 @@ }, "dependencies": { "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "debug": { "version": "2.6.9", @@ -32117,13 +32315,6 @@ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - } } }, "depd": { @@ -32143,6 +32334,11 @@ "toidentifier": "1.0.1" } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -39235,10 +39431,43 @@ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "dev": true }, + "lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true + }, + "mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, + "verdaccio-audit": { + "version": "13.0.0-next-8.3", + "resolved": "https://registry.npmjs.org/verdaccio-audit/-/verdaccio-audit-13.0.0-next-8.3.tgz", + "integrity": "sha512-/mgRfsg+RENtUggcf0xnfPKNJJqidyKING3nyHgS3vABE6CBe4/fWQKs67X4mfCFiIVLf0PiOTFGT8tmwSZubA==", + "dev": true, + "requires": { + "@verdaccio/config": "8.0.0-next-8.3", + "@verdaccio/core": "8.0.0-next-8.3", + "express": "4.21.0", + "https-proxy-agent": "5.0.1", + "node-fetch": "cjs" + }, + "dependencies": { "cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true }, "depd": { @@ -39248,9 +39477,9 @@ "dev": true }, "express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dev": true, "requires": { "accepts": "~1.3.8", @@ -39258,7 +39487,7 @@ "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.7.1", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -39310,23 +39539,15 @@ "toidentifier": "1.0.1" } }, - "lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true - }, - "mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "dev": true - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } }, "ms": { "version": "2.0.0", @@ -39342,31 +39563,6 @@ } } }, - "verdaccio-audit": { - "version": "13.0.0-next-8.3", - "resolved": "https://registry.npmjs.org/verdaccio-audit/-/verdaccio-audit-13.0.0-next-8.3.tgz", - "integrity": "sha512-/mgRfsg+RENtUggcf0xnfPKNJJqidyKING3nyHgS3vABE6CBe4/fWQKs67X4mfCFiIVLf0PiOTFGT8tmwSZubA==", - "dev": true, - "requires": { - "@verdaccio/config": "8.0.0-next-8.3", - "@verdaccio/core": "8.0.0-next-8.3", - "express": "4.21.0", - "https-proxy-agent": "5.0.1", - "node-fetch": "cjs" - }, - "dependencies": { - "https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - } - } - }, "verdaccio-htpasswd": { "version": "13.0.0-next-8.3", "resolved": "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-13.0.0-next-8.3.tgz", diff --git a/package.json b/package.json index cdee5344793..e20f66578d0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "netlify-cli", "description": "Netlify command line tool", - "version": "17.37.0", + "version": "17.37.1", "author": "Netlify Inc.", "type": "module", "engines": { @@ -109,7 +109,7 @@ "envinfo": "7.14.0", "etag": "1.8.1", "execa": "5.1.1", - "express": "4.21.0", + "express": "4.21.1", "express-logging": "1.1.1", "extract-zip": "2.0.1", "fastest-levenshtein": "1.0.16", diff --git a/src/commands/addons/addons-config.ts b/src/commands/addons/addons-config.ts index 9d23fe36380..2d2698b0224 100644 --- a/src/commands/addons/addons-config.ts +++ b/src/commands/addons/addons-config.ts @@ -8,7 +8,7 @@ import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepar import generatePrompts from '../../utils/addons/prompts.js' import { renderConfigValues } from '../../utils/addons/render.js' import { missingConfigValues, requiredConfigValues, updateConfigValues } from '../../utils/addons/validation.js' -import { chalk, error, log } from '../../utils/command-helpers.js' +import { chalk, error, log, APIError } from '../../utils/command-helpers.js' import { parseRawFlags } from '../../utils/parse-raw-flags.js' import BaseCommand from '../base-command.js' @@ -35,8 +35,7 @@ const update = async function ({ addonName, api, currentConfig, instanceId, newC }) log(`Add-on "${addonName}" successfully updated`) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(error_.message) + error((error_ as APIError).message) } } diff --git a/src/commands/addons/addons-create.ts b/src/commands/addons/addons-create.ts index 1fa244725d3..4453f87edba 100644 --- a/src/commands/addons/addons-create.ts +++ b/src/commands/addons/addons-create.ts @@ -6,7 +6,7 @@ import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepar import generatePrompts from '../../utils/addons/prompts.js' import { renderConfigValues, renderMissingValues } from '../../utils/addons/render.js' import { missingConfigValues, requiredConfigValues, updateConfigValues } from '../../utils/addons/validation.js' -import { chalk, error, log } from '../../utils/command-helpers.js' +import { chalk, error, log, APIError } from '../../utils/command-helpers.js' import { parseRawFlags } from '../../utils/parse-raw-flags.js' import BaseCommand from '../base-command.js' // @ts-expect-error TS(7031) FIXME: Binding element 'addonName' implicitly has an 'any... Remove this comment to see the full error message @@ -23,8 +23,7 @@ const createAddon = async ({ addonName, api, config, siteData, siteId }) => { log(`${response.config.message}`) } } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(error_.message) + error((error_ as APIError).message) } } diff --git a/src/commands/addons/addons-delete.ts b/src/commands/addons/addons-delete.ts index 32f9e46eb61..dee08cf0d7a 100644 --- a/src/commands/addons/addons-delete.ts +++ b/src/commands/addons/addons-delete.ts @@ -2,7 +2,7 @@ import { OptionValues } from 'commander' import inquirer from 'inquirer' import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.js' -import { error, exit, log } from '../../utils/command-helpers.js' +import { error, exit, log, APIError } from '../../utils/command-helpers.js' import BaseCommand from '../base-command.js' export const addonsDelete = async (addonName: string, options: OptionValues, command: BaseCommand) => { @@ -31,7 +31,6 @@ export const addonsDelete = async (addonName: string, options: OptionValues, com }) log(`Addon "${addonName}" deleted`) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(error_.message) + error((error_ as APIError).message) } } diff --git a/src/commands/api/api.ts b/src/commands/api/api.ts index 10caa2d127c..b594b1646dd 100644 --- a/src/commands/api/api.ts +++ b/src/commands/api/api.ts @@ -40,7 +40,6 @@ export const apiCommand = async (apiMethod: string, options: OptionValues, comma const apiResponse = await api[apiMethod](payload) logJson(apiResponse) } catch (error_) { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } diff --git a/src/commands/base-command.ts b/src/commands/base-command.ts index 592f464b755..f8a7c469124 100644 --- a/src/commands/base-command.ts +++ b/src/commands/base-command.ts @@ -725,7 +725,6 @@ export default class BaseCommand extends Command { // the option to say that we don't need API data.) if (isUserError && !config.offline && config.token) { if (flags.debug) { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_, { exit: false }) warn('Failed to resolve config, falling back to offline resolution') } diff --git a/src/commands/deploy/deploy.ts b/src/commands/deploy/deploy.ts index c0604531826..a2ad454b014 100644 --- a/src/commands/deploy/deploy.ts +++ b/src/commands/deploy/deploy.ts @@ -30,6 +30,7 @@ import { log, logJson, warn, + APIError, } from '../../utils/command-helpers.js' import { DEFAULT_DEPLOY_TIMEOUT } from '../../utils/deploy/constants.js' import { deploySite } from '../../utils/deploy/deploy-site.js' @@ -58,12 +59,10 @@ const triggerDeploy = async ({ api, options, siteData, siteId }) => { ) } } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { error('Site not found. Please rerun "netlify link" and make sure that your site has CI configured.') } else { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(error_.message) + error((error_ as APIError).message) } } } diff --git a/src/commands/functions/functions-create.ts b/src/commands/functions/functions-create.ts index 1fcf7fe4781..40bacd10617 100644 --- a/src/commands/functions/functions-create.ts +++ b/src/commands/functions/functions-create.ts @@ -15,7 +15,15 @@ import ora from 'ora' import { fileExistsAsync } from '../../lib/fs.js' import { getAddons, getCurrentAddon, getSiteData } from '../../utils/addons/prepare.js' -import { NETLIFYDEVERR, NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, error, log } from '../../utils/command-helpers.js' +import { + APIError, + NETLIFYDEVERR, + NETLIFYDEVLOG, + NETLIFYDEVWARN, + chalk, + error, + log, +} from '../../utils/command-helpers.js' import { copyTemplateDir } from '../../utils/copy-template-dir/copy-template-dir.js' import { getDotEnvVariables, injectEnvVariables } from '../../utils/dev.js' import execa from '../../utils/execa.js' @@ -492,7 +500,6 @@ const scaffoldFromTemplate = async function (command, options, argumentName, fun await downloadFromURL(command, options, argumentName, functionsDir) } catch (error_) { error(`$${NETLIFYDEVERR} Error downloading from URL: ${options.url}`) - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) process.exit(1) } @@ -583,8 +590,7 @@ const createFunctionAddon = async function ({ addonName, addons, api, siteData, log(`Add-on "${addonName}" created for ${siteData.name}`) return true } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(error_.message) + error((error_ as APIError).message) } } @@ -682,8 +688,7 @@ const installAddons = async function (command, functionAddons, fnPath) { await handleAddonDidInstall({ addonCreated, addonDidInstall, command, fnPath }) } catch (error_) { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message - error(`${NETLIFYDEVERR} Error installing addon: `, error_) + error(`${NETLIFYDEVERR} Error installing addon: ${error_}`) } }) return Promise.all(arr) diff --git a/src/commands/functions/functions-invoke.ts b/src/commands/functions/functions-invoke.ts index 0ca0da575f0..f8af526ba4d 100644 --- a/src/commands/functions/functions-invoke.ts +++ b/src/commands/functions/functions-invoke.ts @@ -6,7 +6,7 @@ import { OptionValues } from 'commander' import inquirer from 'inquirer' import fetch from 'node-fetch' -import { NETLIFYDEVWARN, chalk, error, exit } from '../../utils/command-helpers.js' +import { APIError, NETLIFYDEVWARN, chalk, error, exit } from '../../utils/command-helpers.js' import { BACKGROUND, CLOCKWORK_USERAGENT, getFunctions } from '../../utils/functions/index.js' import BaseCommand from '../base-command.js' @@ -234,7 +234,6 @@ export const functionsInvoke = async (nameArgument: string, options: OptionValue const data = await response.text() console.log(data) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`Ran into an error invoking your function: ${error_.message}`) + error(`Ran into an error invoking your function: ${(error_ as APIError).message}`) } } diff --git a/src/commands/link/link.ts b/src/commands/link/link.ts index 30889cb2525..31be9b20fc3 100644 --- a/src/commands/link/link.ts +++ b/src/commands/link/link.ts @@ -3,7 +3,7 @@ import inquirer from 'inquirer' import isEmpty from 'lodash/isEmpty.js' import { listSites } from '../../lib/api.js' -import { chalk, error, exit, log } from '../../utils/command-helpers.js' +import { chalk, error, exit, log, APIError } from '../../utils/command-helpers.js' import getRepoData from '../../utils/get-repo-data.js' import { ensureNetlifyIgnore } from '../../utils/gitignore.js' import { track } from '../../utils/telemetry/index.js' @@ -125,11 +125,9 @@ Run ${chalk.cyanBright('git remote -v')} to see a list of your git remotes.`) options: { name: searchTerm, filter: 'all' }, }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { error(`'${searchTerm}' not found`) } else { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } @@ -172,7 +170,6 @@ or run ${chalk.cyanBright('netlify sites:create')} to create a site.`) try { sites = await listSites({ api, options: { maxPages: 1, filter: 'all' } }) } catch (error_) { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } @@ -209,11 +206,9 @@ or run ${chalk.cyanBright('netlify sites:create')} to create a site.`) try { site = await api.getSite({ siteId }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { - error(new Error(`Site ID '${siteId}' not found`)) + if ((error_ as APIError).status === 404) { + error(`Site ID '${siteId}' not found`) } else { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } @@ -281,11 +276,9 @@ export const link = async (options: OptionValues, command: BaseCommand) => { try { siteData = await api.getSite({ site_id: options.id }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { error(new Error(`Site id ${options.id} not found`)) } else { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } @@ -310,11 +303,9 @@ export const link = async (options: OptionValues, command: BaseCommand) => { }, }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { error(new Error(`${options.name} not found`)) } else { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } diff --git a/src/commands/lm/lm-setup.ts b/src/commands/lm/lm-setup.ts index 409b0fad854..f32940ab4c5 100644 --- a/src/commands/lm/lm-setup.ts +++ b/src/commands/lm/lm-setup.ts @@ -65,7 +65,6 @@ export const lmSetup = async (options: OptionValues, command: BaseCommand) => { try { helperInstalled = await installHelperIfMissing({ force: options.forceInstall }) } catch (error_) { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } diff --git a/src/commands/logs/build.ts b/src/commands/logs/build.ts index 502d1b97d92..d16fdf43bd4 100644 --- a/src/commands/logs/build.ts +++ b/src/commands/logs/build.ts @@ -39,6 +39,11 @@ export const logsBuild = async (options: OptionValues, command: BaseCommand) => const { id: siteId } = site const userId = command.netlify.globalConfig.get('userId') + if (!siteId) { + log('You must link a site before attempting to view deploy logs') + return + } + const deploys = await client.listSiteDeploys({ siteId, state: 'building' }) if (deploys.length === 0) { diff --git a/src/commands/sites/sites-create-template.ts b/src/commands/sites/sites-create-template.ts index ff2747f1086..5a88d6b8c2c 100644 --- a/src/commands/sites/sites-create-template.ts +++ b/src/commands/sites/sites-create-template.ts @@ -5,7 +5,7 @@ import pick from 'lodash/pick.js' import parseGitHubUrl from 'parse-github-url' import { render } from 'prettyjson' -import { chalk, error, getTerminalLink, log, logJson, warn } from '../../utils/command-helpers.js' +import { chalk, error, getTerminalLink, log, logJson, warn, APIError } from '../../utils/command-helpers.js' import execa from '../../utils/execa.js' import getRepoData from '../../utils/get-repo-data.js' import { getGitHubToken } from '../../utils/init/config-github.js' @@ -163,16 +163,14 @@ export const sitesCreateTemplate = async (repository: string, options: OptionVal }) } } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 422 || error_.message === 'Duplicate repo') { + if ((error_ as APIError).status === 422 || (error_ as APIError).message === 'Duplicate repo') { warn( `${name}.netlify.app already exists or a repository named ${name} already exists on this account. Please try a different slug.`, ) // @ts-expect-error TS(2554) FIXME: Expected 1 arguments, but got 0. await inputSiteName() } else { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`createSiteInTeam error: ${error_.status}: ${error_.message}`) + error(`createSiteInTeam error: ${(error_ as APIError).status}: ${(error_ as APIError).message}`) } } } diff --git a/src/commands/sites/sites-create.ts b/src/commands/sites/sites-create.ts index c7a21f3d81a..5fcbf5f2d16 100644 --- a/src/commands/sites/sites-create.ts +++ b/src/commands/sites/sites-create.ts @@ -3,7 +3,7 @@ import inquirer from 'inquirer' import pick from 'lodash/pick.js' import prettyjson from 'prettyjson' -import { chalk, error, log, logJson, warn } from '../../utils/command-helpers.js' +import { chalk, error, log, logJson, warn, APIError } from '../../utils/command-helpers.js' import getRepoData from '../../utils/get-repo-data.js' import { configureRepo } from '../../utils/init/config.js' import { track } from '../../utils/telemetry/index.js' @@ -70,14 +70,12 @@ export const sitesCreate = async (options: OptionValues, command: BaseCommand) = body, }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 422) { + if ((error_ as APIError).status === 422) { warn(`${siteName}.netlify.app already exists. Please try a different slug.`) // @ts-expect-error TS(2554) FIXME: Expected 1 arguments, but got 0. await inputSiteName() } else { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`createSiteInTeam error: ${error_.status}: ${error_.message}`) + error(`createSiteInTeam error: ${(error_ as APIError).status}: ${(error_ as APIError).message}`) } } } diff --git a/src/commands/sites/sites-delete.ts b/src/commands/sites/sites-delete.ts index 70956c893c3..512fab816ff 100644 --- a/src/commands/sites/sites-delete.ts +++ b/src/commands/sites/sites-delete.ts @@ -1,7 +1,7 @@ import { OptionValues } from 'commander' import inquirer from 'inquirer' -import { chalk, error, exit, log } from '../../utils/command-helpers.js' +import { chalk, error, exit, log, APIError } from '../../utils/command-helpers.js' import BaseCommand from '../base-command.js' export const sitesDelete = async (siteId: string, options: OptionValues, command: BaseCommand) => { @@ -17,9 +17,10 @@ export const sitesDelete = async (siteId: string, options: OptionValues, command try { siteData = await api.getSite({ siteId }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { error(`No site with id ${siteId} found. Please verify the siteId & try again.`) + } else { + error(error_) } } @@ -74,12 +75,10 @@ export const sitesDelete = async (siteId: string, options: OptionValues, command try { await api.deleteSite({ site_id: siteId }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { error(`No site with id ${siteId} found. Please verify the siteId & try again.`) } else { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`Delete Site error: ${error_.status}: ${error_.message}`) + error(`Delete Site error: ${(error_ as APIError).status}: ${(error_ as APIError).message}`) } } log(`Site "${siteId}" successfully deleted!`) diff --git a/src/commands/status/status.ts b/src/commands/status/status.ts index f5a8475faf0..1912c6be418 100644 --- a/src/commands/status/status.ts +++ b/src/commands/status/status.ts @@ -2,7 +2,7 @@ import clean from 'clean-deep' import { OptionValues } from 'commander' import prettyjson from 'prettyjson' -import { chalk, error, exit, getToken, log, logJson, warn } from '../../utils/command-helpers.js' +import { chalk, error, exit, getToken, log, logJson, warn, APIError } from '../../utils/command-helpers.js' import BaseCommand from '../base-command.js' export const status = async (options: OptionValues, command: BaseCommand) => { @@ -30,9 +30,10 @@ export const status = async (options: OptionValues, command: BaseCommand) => { // eslint-disable-next-line @typescript-eslint/no-extra-semi ;[accounts, user] = await Promise.all([api.listAccountsForUser(), api.getCurrentUser()]) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 401) { + if ((error_ as APIError).status === 401) { error('Your session has expired. Please try to re-authenticate by running `netlify logout` and `netlify login`.') + } else { + error(error_) } } diff --git a/src/commands/watch/watch.ts b/src/commands/watch/watch.ts index 071ccce8b02..2bf7a016878 100644 --- a/src/commands/watch/watch.ts +++ b/src/commands/watch/watch.ts @@ -114,7 +114,6 @@ export const watch = async (options: OptionValues, command: BaseCommand) => { ) console.timeEnd('Deploy time') } catch (error_) { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } diff --git a/src/lib/exec-fetcher.ts b/src/lib/exec-fetcher.ts index 3a1910f0877..ea703eaa157 100644 --- a/src/lib/exec-fetcher.ts +++ b/src/lib/exec-fetcher.ts @@ -148,8 +148,6 @@ export const fetchLatestVersion = async ({ destination, execName, extension, lat Please open up an issue on our CLI repository so that we can support it: ${issueLink}`) } - - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } diff --git a/src/utils/addons/prepare.ts b/src/utils/addons/prepare.ts index 3a31e07b077..2b0342429df 100644 --- a/src/utils/addons/prepare.ts +++ b/src/utils/addons/prepare.ts @@ -1,4 +1,4 @@ -import { chalk, error, exit, log, warn } from '../command-helpers.js' +import { APIError, chalk, error, exit, log, warn } from '../command-helpers.js' export const ADDON_VALIDATION = { EXISTS: 'EXISTS', @@ -55,12 +55,10 @@ export const getAddonManifest = async ({ addonName, api }) => { try { manifest = await api.showServiceManifest({ addonName }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (typeof error_.message === 'string' && error_.message.includes('Not Found')) { + if ((error_ as APIError).message.includes('Not Found')) { error(`No add-on "${addonName}" found. Please double check your add-on name and try again`) } else { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(error_.message) + error((error_ as APIError).message) } } return manifest @@ -72,8 +70,7 @@ export const getSiteData = async ({ api, siteId }) => { try { siteData = await api.getSite({ siteId }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`Failed getting list of site data: ${error_.message}`) + error(`Failed getting list of site data: ${(error_ as APIError).message}`) } return siteData } @@ -84,8 +81,7 @@ export const getAddons = async ({ api, siteId }) => { try { addons = await api.listServiceInstancesForSite({ siteId }) } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`Failed getting list of addons: ${error_.message}`) + error(`Failed getting list of addons: ${(error_ as APIError).message}`) } return addons } diff --git a/src/utils/command-helpers.ts b/src/utils/command-helpers.ts index 1af31ecd30a..ec033cf6703 100644 --- a/src/utils/command-helpers.ts +++ b/src/utils/command-helpers.ts @@ -120,7 +120,6 @@ export const pollForToken = async ({ )}, then run ${chalk.cyanBright('netlify login')} again.`, ) } else { - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) } } finally { @@ -195,7 +194,7 @@ export const warn = (message = '') => { } /** Throws an error or logs it */ -export const error = (message: Error | string = '', options: { exit?: boolean } = {}) => { +export const error = (message: unknown | Error | string = '', options: { exit?: boolean } = {}) => { const err = message instanceof Error ? message @@ -309,3 +308,8 @@ export const nonNullable = (value: T): value is NonNullable => value !== n export const noOp = () => { // no-op } + +export interface APIError extends Error { + status: number + message: string +} diff --git a/src/utils/dev.ts b/src/utils/dev.ts index 3d2fd51d335..5e08de4aafd 100644 --- a/src/utils/dev.ts +++ b/src/utils/dev.ts @@ -5,7 +5,7 @@ import isEmpty from 'lodash/isEmpty.js' import { supportsBackgroundFunctions } from '../lib/account.js' -import { NETLIFYDEVLOG, chalk, error, log, warn } from './command-helpers.js' +import { NETLIFYDEVLOG, chalk, error, log, warn, APIError } from './command-helpers.js' import { loadDotEnvFiles } from './dot-env.js' // Possible sources of environment variables. For the purpose of printing log messages only. Order does not matter. @@ -52,8 +52,7 @@ const getAccounts = async ({ api }) => { const accounts = await api.listAccountsForUser() return accounts } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`Failed retrieving user account: ${error_.message}. ${ERROR_CALL_TO_ACTION}`) + error(`Failed retrieving user account: ${(error_ as APIError).message}. ${ERROR_CALL_TO_ACTION}`) } } @@ -63,8 +62,11 @@ const getAddons = async ({ api, site }) => { const addons = await api.listServiceInstancesForSite({ siteId: site.id }) return addons } catch (error_) { - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - error(`Failed retrieving addons for site ${chalk.yellow(site.id)}: ${error_.message}. ${ERROR_CALL_TO_ACTION}`) + error( + `Failed retrieving addons for site ${chalk.yellow(site.id)}: ${ + (error_ as APIError).message + }. ${ERROR_CALL_TO_ACTION}`, + ) } } diff --git a/src/utils/framework-server.ts b/src/utils/framework-server.ts index 1b7e97b77bd..b7652a806e2 100644 --- a/src/utils/framework-server.ts +++ b/src/utils/framework-server.ts @@ -70,7 +70,6 @@ export const startFrameworkServer = async function ({ stopSpinner({ error: true, spinner }) log(NETLIFYDEVERR, `Netlify Dev could not start or connect to localhost:${settings.frameworkPort}.`) log(NETLIFYDEVERR, `Please make sure your framework server is running on port ${settings.frameworkPort}`) - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message error(error_) exit(1) } diff --git a/src/utils/hooks/requires-site-info.ts b/src/utils/hooks/requires-site-info.ts index 69b38e1a5f1..6065dd3c831 100644 --- a/src/utils/hooks/requires-site-info.ts +++ b/src/utils/hooks/requires-site-info.ts @@ -1,4 +1,5 @@ -import { error, warn } from '../command-helpers.js' +import { error, warn, APIError } from '../command-helpers.js' + /** * A preAction hook that errors out if siteInfo is an empty object * @param {*} command @@ -15,17 +16,15 @@ const requiresSiteInfo = async (command) => { await api.getSite({ siteId }) } catch (error_) { // unauthorized - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 401) { + if ((error_ as APIError).status === 401) { warn(`Log in with a different account or re-link to a site you have permission for`) return error(`Not authorized to view the currently linked site (${siteId})`) } // missing - // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. - if (error_.status === 404) { + if ((error_ as APIError).status === 404) { return error(`The site this folder is linked to can't be found`) } - // @ts-expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message + return error(error_) } } diff --git a/tests/integration/commands/logs/build.test.ts b/tests/integration/commands/logs/build.test.ts index dc1e654f039..956bab228a4 100644 --- a/tests/integration/commands/logs/build.test.ts +++ b/tests/integration/commands/logs/build.test.ts @@ -5,6 +5,10 @@ import { createLogsBuildCommand } from '../../../../src/commands/logs/index.js' import { getWebSocket } from '../../../../src/utils/websockets/index.js' import { startMockApi } from '../../utils/mock-api-vitest.js' import { getEnvironmentVariables } from '../../utils/mock-api.js' +import { callCli } from '../../utils/call-cli.js' +import { getCLIOptions, withMockApi } from '../../utils/mock-api.js' +import { withSiteBuilder } from '../../utils/site-builder.ts' +import { join } from 'path' vi.mock('../../../../src/utils/websockets/index.js', () => ({ getWebSocket: vi.fn(), @@ -47,12 +51,14 @@ const routes = [ describe('logs:deploy command', () => { let program: BaseCommand + const originalEnv = { ...process.env } afterEach(() => { vi.clearAllMocks() }) beforeEach(() => { + process.env = { ...originalEnv } program = new BaseCommand('netlify') createLogsBuildCommand(program) @@ -107,4 +113,21 @@ describe('logs:deploy command', () => { expect(body.site_id).toEqual('site_id') expect(body.access_token).toEqual(env.NETLIFY_AUTH_TOKEN) }) + + test('should instruct user to link a site if one is not linked', async (t) => { + await withSiteBuilder(t, async (builder) => { + const projectPath = join('projects', 'project1') + await builder.withNetlifyToml({ config: {}, pathPrefix: projectPath }).build() + + await withMockApi( + routes, + async ({ apiUrl }) => { + const options = getCLIOptions({ builder, apiUrl, env: { NETLIFY_SITE_ID: '' } }) + const stdout = await callCli(['logs:deploy'], { ...options, cwd: join(builder.directory, projectPath) }) + expect(stdout).toContain('You must link a site before attempting to view deploy logs') + }, + true, + ) + }) + }) })