netlify-cli 8.6.9 → 8.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "8.6.9",
4
+ "version": "8.6.13",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "Mathias Biilmann <matt@netlify.com> (https://twitter.com/biilmann)",
@@ -62,10 +62,10 @@
62
62
  "test:init:eleventy-deps": "npm ci --prefix tests/eleventy-site --no-audit",
63
63
  "test:init:hugo-deps": "npm ci --prefix tests/hugo-site --no-audit",
64
64
  "test:dev:ava": "ava --verbose",
65
- "test:ci:ava": "nyc -r json ava",
65
+ "test:ci:ava": "c8 -r json ava",
66
66
  "test:affected": "node ./tools/affected-test.js",
67
67
  "docs": "node ./site/scripts/docs.js",
68
- "watch": "nyc --reporter=lcov ava --watch",
68
+ "watch": "c8 --reporter=lcov ava --watch",
69
69
  "prepack": "npm prune --prod",
70
70
  "postpack": "npm i",
71
71
  "site:build": "run-s site:build:*",
@@ -85,14 +85,14 @@
85
85
  "@netlify/plugin-edge-handlers": "^3.0.0",
86
86
  "@netlify/plugins-list": "^6.2.0",
87
87
  "@netlify/routing-local-proxy": "^0.34.1",
88
- "@netlify/zip-it-and-ship-it": "5.3.1",
88
+ "@netlify/zip-it-and-ship-it": "5.4.0",
89
89
  "@octokit/rest": "^18.0.0",
90
90
  "@sindresorhus/slugify": "^1.1.0",
91
91
  "ansi-escapes": "^5.0.0",
92
92
  "ansi-styles": "^5.0.0",
93
93
  "ascii-table": "0.0.9",
94
94
  "backoff": "^2.5.0",
95
- "better-opn": "^2.1.1",
95
+ "better-opn": "^3.0.0",
96
96
  "boxen": "^5.0.0",
97
97
  "chalk": "^4.0.0",
98
98
  "chokidar": "^3.0.2",
@@ -126,7 +126,7 @@
126
126
  "hasbin": "^1.2.3",
127
127
  "hasha": "^5.2.2",
128
128
  "http-proxy": "^1.18.0",
129
- "http-proxy-middleware": "^1.0.0",
129
+ "http-proxy-middleware": "^2.0.0",
130
130
  "https-proxy-agent": "^5.0.0",
131
131
  "inquirer": "^6.5.1",
132
132
  "inquirer-autocomplete-prompt": "^1.0.1",
@@ -188,6 +188,7 @@
188
188
  "@commitlint/config-conventional": "^16.0.0",
189
189
  "@netlify/eslint-config-node": "^4.0.6",
190
190
  "ava": "^3.15.0",
191
+ "c8": "^7.11.0",
191
192
  "eslint-plugin-sort-destructure-keys": "^1.3.5",
192
193
  "fast-glob": "^3.2.7",
193
194
  "form-data": "^4.0.0",
@@ -197,7 +198,6 @@
197
198
  "jsonwebtoken": "^8.5.1",
198
199
  "mock-fs": "^5.1.2",
199
200
  "mock-require": "^3.0.3",
200
- "nyc": "^15.0.0",
201
201
  "p-timeout": "^4.0.0",
202
202
  "seedrandom": "^3.0.5",
203
203
  "serialize-javascript": "^6.0.0",
@@ -102,15 +102,14 @@ const getPersonalAccessToken = async () => {
102
102
  */
103
103
  const authWithToken = async () => {
104
104
  const { token } = await getPersonalAccessToken()
105
- if (token) {
106
- const octokit = new Octokit({
107
- auth: `token ${token}`,
108
- })
109
- const { login: user } = await octokit.users.getAuthenticated()
110
- return { token, user, provider: 'github' }
105
+ if (!token) {
106
+ throw new Error('GitHub authentication failed')
111
107
  }
112
- const error = new Error('GitHub authentication failed')
113
- throw error
108
+
109
+ const octokit = new Octokit({ auth: `token ${token}` })
110
+ const { login: user } = await octokit.users.getAuthenticated()
111
+
112
+ return { token, user, provider: 'github' }
114
113
  }
115
114
 
116
115
  /**
@@ -121,11 +120,8 @@ const getGitHubToken = async () => {
121
120
  log('')
122
121
 
123
122
  const withNetlify = await promptForAuthMethod()
124
- if (withNetlify) {
125
- return await authWithNetlify()
126
- }
127
123
 
128
- return await authWithToken()
124
+ return withNetlify ? await authWithNetlify() : await authWithToken()
129
125
  }
130
126
 
131
127
  module.exports = { getGitHubToken, authWithNetlify }