netlify-cli 8.6.8 → 8.6.12
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/npm-shrinkwrap.json +54 -41
- package/package.json +4 -4
- package/src/commands/functions/functions-create.js +1 -1
- package/src/commands/init/init.js +1 -1
- package/src/functions-templates/javascript/serverless-ssr/app/index.js +1 -1
- package/src/utils/gh-auth.js +9 -13
- package/src/utils/init/config-github.js +2 -2
- package/src/utils/read-repo-url.js +1 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.12",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "8.6.
|
|
9
|
+
"version": "8.6.12",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"ansi-styles": "^5.0.0",
|
|
25
25
|
"ascii-table": "0.0.9",
|
|
26
26
|
"backoff": "^2.5.0",
|
|
27
|
-
"better-opn": "^
|
|
27
|
+
"better-opn": "^3.0.0",
|
|
28
28
|
"boxen": "^5.0.0",
|
|
29
29
|
"chalk": "^4.0.0",
|
|
30
30
|
"chokidar": "^3.0.2",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"from2-array": "^0.0.4",
|
|
53
53
|
"fuzzy": "^0.1.3",
|
|
54
54
|
"get-port": "^5.1.0",
|
|
55
|
-
"gh-release-fetch": "^
|
|
55
|
+
"gh-release-fetch": "^3.0.0",
|
|
56
56
|
"git-repo-info": "^2.1.0",
|
|
57
57
|
"gitconfiglocal": "^2.1.0",
|
|
58
58
|
"hasbin": "^1.2.3",
|
|
59
59
|
"hasha": "^5.2.2",
|
|
60
60
|
"http-proxy": "^1.18.0",
|
|
61
|
-
"http-proxy-middleware": "^
|
|
61
|
+
"http-proxy-middleware": "^2.0.0",
|
|
62
62
|
"https-proxy-agent": "^5.0.0",
|
|
63
63
|
"inquirer": "^6.5.1",
|
|
64
64
|
"inquirer-autocomplete-prompt": "^1.0.1",
|
|
@@ -5383,14 +5383,14 @@
|
|
|
5383
5383
|
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
|
|
5384
5384
|
},
|
|
5385
5385
|
"node_modules/better-opn": {
|
|
5386
|
-
"version": "
|
|
5387
|
-
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-
|
|
5388
|
-
"integrity": "sha512-
|
|
5386
|
+
"version": "3.0.1",
|
|
5387
|
+
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.1.tgz",
|
|
5388
|
+
"integrity": "sha512-u7pU4QnwLQ+wCDLHdvtWbI/41pSRayJ+UHyAqpb5sr42FGnqzBlEyWdCklfaSzXqbmnXDBzCvWcaZmL3qp0xGA==",
|
|
5389
5389
|
"dependencies": {
|
|
5390
|
-
"open": "^
|
|
5390
|
+
"open": "^8.0.4"
|
|
5391
5391
|
},
|
|
5392
5392
|
"engines": {
|
|
5393
|
-
"node": "
|
|
5393
|
+
"node": ">=12.0.0"
|
|
5394
5394
|
}
|
|
5395
5395
|
},
|
|
5396
5396
|
"node_modules/binary-extensions": {
|
|
@@ -7583,6 +7583,14 @@
|
|
|
7583
7583
|
"node": ">=10"
|
|
7584
7584
|
}
|
|
7585
7585
|
},
|
|
7586
|
+
"node_modules/define-lazy-prop": {
|
|
7587
|
+
"version": "2.0.0",
|
|
7588
|
+
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
|
|
7589
|
+
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
|
|
7590
|
+
"engines": {
|
|
7591
|
+
"node": ">=8"
|
|
7592
|
+
}
|
|
7593
|
+
},
|
|
7586
7594
|
"node_modules/define-properties": {
|
|
7587
7595
|
"version": "1.1.3",
|
|
7588
7596
|
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
|
@@ -10765,20 +10773,19 @@
|
|
|
10765
10773
|
}
|
|
10766
10774
|
},
|
|
10767
10775
|
"node_modules/gh-release-fetch": {
|
|
10768
|
-
"version": "
|
|
10769
|
-
"resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-
|
|
10770
|
-
"integrity": "sha512-
|
|
10776
|
+
"version": "3.0.0",
|
|
10777
|
+
"resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-3.0.0.tgz",
|
|
10778
|
+
"integrity": "sha512-P7Anj35Y4kI3RBoQ+M8Z2U9ittORYyRNLb55+5yGGXmm3Mazgkq4MPqsHH9S7+pNWFpE2BtAWeF6twzz6JY3Bw==",
|
|
10771
10779
|
"dependencies": {
|
|
10772
10780
|
"@types/download": "^8.0.0",
|
|
10773
10781
|
"@types/node-fetch": "^2.1.6",
|
|
10774
10782
|
"@types/semver": "^7.0.0",
|
|
10775
10783
|
"download": "^8.0.0",
|
|
10776
|
-
"make-dir": "^3.1.0",
|
|
10777
10784
|
"node-fetch": "^2.3.0",
|
|
10778
10785
|
"semver": "^7.0.0"
|
|
10779
10786
|
},
|
|
10780
10787
|
"engines": {
|
|
10781
|
-
"node": ">=
|
|
10788
|
+
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
|
|
10782
10789
|
}
|
|
10783
10790
|
},
|
|
10784
10791
|
"node_modules/git-raw-commits": {
|
|
@@ -11281,9 +11288,9 @@
|
|
|
11281
11288
|
}
|
|
11282
11289
|
},
|
|
11283
11290
|
"node_modules/http-proxy-middleware": {
|
|
11284
|
-
"version": "
|
|
11285
|
-
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-
|
|
11286
|
-
"integrity": "sha512-
|
|
11291
|
+
"version": "2.0.1",
|
|
11292
|
+
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.1.tgz",
|
|
11293
|
+
"integrity": "sha512-cfaXRVoZxSed/BmkA7SwBVNI9Kj7HFltaE5rqYOub5kWzWZ+gofV2koVN1j2rMW7pEfSSlCHGJ31xmuyFyfLOg==",
|
|
11287
11294
|
"dependencies": {
|
|
11288
11295
|
"@types/http-proxy": "^1.17.5",
|
|
11289
11296
|
"http-proxy": "^1.18.1",
|
|
@@ -11292,7 +11299,7 @@
|
|
|
11292
11299
|
"micromatch": "^4.0.2"
|
|
11293
11300
|
},
|
|
11294
11301
|
"engines": {
|
|
11295
|
-
"node": ">=
|
|
11302
|
+
"node": ">=12.0.0"
|
|
11296
11303
|
}
|
|
11297
11304
|
},
|
|
11298
11305
|
"node_modules/http2-wrapper": {
|
|
@@ -16070,15 +16077,16 @@
|
|
|
16070
16077
|
}
|
|
16071
16078
|
},
|
|
16072
16079
|
"node_modules/open": {
|
|
16073
|
-
"version": "
|
|
16074
|
-
"resolved": "https://registry.npmjs.org/open/-/open-
|
|
16075
|
-
"integrity": "sha512-
|
|
16080
|
+
"version": "8.4.0",
|
|
16081
|
+
"resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
|
|
16082
|
+
"integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
|
|
16076
16083
|
"dependencies": {
|
|
16077
|
-
"
|
|
16078
|
-
"is-
|
|
16084
|
+
"define-lazy-prop": "^2.0.0",
|
|
16085
|
+
"is-docker": "^2.1.1",
|
|
16086
|
+
"is-wsl": "^2.2.0"
|
|
16079
16087
|
},
|
|
16080
16088
|
"engines": {
|
|
16081
|
-
"node": ">=
|
|
16089
|
+
"node": ">=12"
|
|
16082
16090
|
},
|
|
16083
16091
|
"funding": {
|
|
16084
16092
|
"url": "https://github.com/sponsors/sindresorhus"
|
|
@@ -24718,11 +24726,11 @@
|
|
|
24718
24726
|
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
|
|
24719
24727
|
},
|
|
24720
24728
|
"better-opn": {
|
|
24721
|
-
"version": "
|
|
24722
|
-
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-
|
|
24723
|
-
"integrity": "sha512-
|
|
24729
|
+
"version": "3.0.1",
|
|
24730
|
+
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.1.tgz",
|
|
24731
|
+
"integrity": "sha512-u7pU4QnwLQ+wCDLHdvtWbI/41pSRayJ+UHyAqpb5sr42FGnqzBlEyWdCklfaSzXqbmnXDBzCvWcaZmL3qp0xGA==",
|
|
24724
24732
|
"requires": {
|
|
24725
|
-
"open": "^
|
|
24733
|
+
"open": "^8.0.4"
|
|
24726
24734
|
}
|
|
24727
24735
|
},
|
|
24728
24736
|
"binary-extensions": {
|
|
@@ -26419,6 +26427,11 @@
|
|
|
26419
26427
|
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
|
|
26420
26428
|
"integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg=="
|
|
26421
26429
|
},
|
|
26430
|
+
"define-lazy-prop": {
|
|
26431
|
+
"version": "2.0.0",
|
|
26432
|
+
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
|
|
26433
|
+
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="
|
|
26434
|
+
},
|
|
26422
26435
|
"define-properties": {
|
|
26423
26436
|
"version": "1.1.3",
|
|
26424
26437
|
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
|
@@ -28789,15 +28802,14 @@
|
|
|
28789
28802
|
"integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg="
|
|
28790
28803
|
},
|
|
28791
28804
|
"gh-release-fetch": {
|
|
28792
|
-
"version": "
|
|
28793
|
-
"resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-
|
|
28794
|
-
"integrity": "sha512-
|
|
28805
|
+
"version": "3.0.0",
|
|
28806
|
+
"resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-3.0.0.tgz",
|
|
28807
|
+
"integrity": "sha512-P7Anj35Y4kI3RBoQ+M8Z2U9ittORYyRNLb55+5yGGXmm3Mazgkq4MPqsHH9S7+pNWFpE2BtAWeF6twzz6JY3Bw==",
|
|
28795
28808
|
"requires": {
|
|
28796
28809
|
"@types/download": "^8.0.0",
|
|
28797
28810
|
"@types/node-fetch": "^2.1.6",
|
|
28798
28811
|
"@types/semver": "^7.0.0",
|
|
28799
28812
|
"download": "^8.0.0",
|
|
28800
|
-
"make-dir": "^3.1.0",
|
|
28801
28813
|
"node-fetch": "^2.3.0",
|
|
28802
28814
|
"semver": "^7.0.0"
|
|
28803
28815
|
}
|
|
@@ -29181,9 +29193,9 @@
|
|
|
29181
29193
|
}
|
|
29182
29194
|
},
|
|
29183
29195
|
"http-proxy-middleware": {
|
|
29184
|
-
"version": "
|
|
29185
|
-
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-
|
|
29186
|
-
"integrity": "sha512-
|
|
29196
|
+
"version": "2.0.1",
|
|
29197
|
+
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.1.tgz",
|
|
29198
|
+
"integrity": "sha512-cfaXRVoZxSed/BmkA7SwBVNI9Kj7HFltaE5rqYOub5kWzWZ+gofV2koVN1j2rMW7pEfSSlCHGJ31xmuyFyfLOg==",
|
|
29187
29199
|
"requires": {
|
|
29188
29200
|
"@types/http-proxy": "^1.17.5",
|
|
29189
29201
|
"http-proxy": "^1.18.1",
|
|
@@ -32789,12 +32801,13 @@
|
|
|
32789
32801
|
}
|
|
32790
32802
|
},
|
|
32791
32803
|
"open": {
|
|
32792
|
-
"version": "
|
|
32793
|
-
"resolved": "https://registry.npmjs.org/open/-/open-
|
|
32794
|
-
"integrity": "sha512-
|
|
32804
|
+
"version": "8.4.0",
|
|
32805
|
+
"resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
|
|
32806
|
+
"integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
|
|
32795
32807
|
"requires": {
|
|
32796
|
-
"
|
|
32797
|
-
"is-
|
|
32808
|
+
"define-lazy-prop": "^2.0.0",
|
|
32809
|
+
"is-docker": "^2.1.1",
|
|
32810
|
+
"is-wsl": "^2.2.0"
|
|
32798
32811
|
}
|
|
32799
32812
|
},
|
|
32800
32813
|
"opencollective-postinstall": {
|
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.
|
|
4
|
+
"version": "8.6.12",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Mathias Biilmann <matt@netlify.com> (https://twitter.com/biilmann)",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"ansi-styles": "^5.0.0",
|
|
93
93
|
"ascii-table": "0.0.9",
|
|
94
94
|
"backoff": "^2.5.0",
|
|
95
|
-
"better-opn": "^
|
|
95
|
+
"better-opn": "^3.0.0",
|
|
96
96
|
"boxen": "^5.0.0",
|
|
97
97
|
"chalk": "^4.0.0",
|
|
98
98
|
"chokidar": "^3.0.2",
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
"from2-array": "^0.0.4",
|
|
121
121
|
"fuzzy": "^0.1.3",
|
|
122
122
|
"get-port": "^5.1.0",
|
|
123
|
-
"gh-release-fetch": "^
|
|
123
|
+
"gh-release-fetch": "^3.0.0",
|
|
124
124
|
"git-repo-info": "^2.1.0",
|
|
125
125
|
"gitconfiglocal": "^2.1.0",
|
|
126
126
|
"hasbin": "^1.2.3",
|
|
127
127
|
"hasha": "^5.2.2",
|
|
128
128
|
"http-proxy": "^1.18.0",
|
|
129
|
-
"http-proxy-middleware": "^
|
|
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",
|
|
@@ -253,7 +253,7 @@ const ensureFunctionDirExists = async function (command) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* Download files from a given
|
|
256
|
+
* Download files from a given GitHub URL
|
|
257
257
|
* @param {import('../base-command').BaseCommand} command
|
|
258
258
|
* @param {import('commander').OptionValues} options
|
|
259
259
|
* @param {string} argumentName
|
|
@@ -162,7 +162,7 @@ const logExistingRepoSetupAndExit = ({ repoUrl, siteName }) => {
|
|
|
162
162
|
log()
|
|
163
163
|
log(chalk.underline.bold(`Success`))
|
|
164
164
|
log(`This site "${siteName}" is configured to automatically deploy via ${repoUrl}`)
|
|
165
|
-
// TODO add support for changing
|
|
165
|
+
// TODO add support for changing GitHub repo in site:config command
|
|
166
166
|
exit()
|
|
167
167
|
}
|
|
168
168
|
|
package/src/utils/gh-auth.js
CHANGED
|
@@ -102,30 +102,26 @@ const getPersonalAccessToken = async () => {
|
|
|
102
102
|
*/
|
|
103
103
|
const authWithToken = async () => {
|
|
104
104
|
const { token } = await getPersonalAccessToken()
|
|
105
|
-
if (token) {
|
|
106
|
-
|
|
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
|
-
|
|
113
|
-
|
|
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
|
/**
|
|
117
|
-
* Get a
|
|
116
|
+
* Get a GitHub token
|
|
118
117
|
* @returns {Promise<Token>} Returns a Promise with a token object
|
|
119
118
|
*/
|
|
120
119
|
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 }
|
|
@@ -22,7 +22,7 @@ const formatRepoAndOwner = ({ repoName, repoOwner }) => ({
|
|
|
22
22
|
const PAGE_SIZE = 100
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Get a valid
|
|
25
|
+
* Get a valid GitHub token
|
|
26
26
|
* @returns {Promise<string>}
|
|
27
27
|
*/
|
|
28
28
|
const getGitHubToken = async ({ globalConfig }) => {
|
|
@@ -50,7 +50,7 @@ const getGitHubToken = async ({ globalConfig }) => {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Retrieves the
|
|
53
|
+
* Retrieves the GitHub octokit client
|
|
54
54
|
* @param {string} token
|
|
55
55
|
* @returns {Octokit}
|
|
56
56
|
*/
|
|
@@ -15,7 +15,7 @@ const readRepoURL = async function (_url) {
|
|
|
15
15
|
// eslint-disable-next-line node/no-deprecated-api
|
|
16
16
|
const URL = url.parse(_url)
|
|
17
17
|
const repoHost = validateRepoURL(_url)
|
|
18
|
-
if (repoHost !== GITHUB) throw new Error('only
|
|
18
|
+
if (repoHost !== GITHUB) throw new Error('only GitHub repos are supported for now')
|
|
19
19
|
const [ownerAndRepo, contentsPath] = parseRepoURL(repoHost, URL)
|
|
20
20
|
const folderContents = await getRepoURLContents(repoHost, ownerAndRepo, contentsPath)
|
|
21
21
|
return folderContents
|