netlify-cli 8.6.7 → 8.6.11
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 +46 -34
- package/package.json +3 -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/lib/functions/runtimes/js/builders/zisi.js +2 -3
- 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/src/utils/state-config.js +1 -2
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.11",
|
|
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.11",
|
|
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,7 +52,7 @@
|
|
|
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",
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
"lodash": "^4.17.20",
|
|
74
74
|
"log-symbols": "^4.0.0",
|
|
75
75
|
"log-update": "^5.0.0",
|
|
76
|
-
"make-dir": "^3.0.0",
|
|
77
76
|
"memoize-one": "^6.0.0",
|
|
78
77
|
"minimist": "^1.2.5",
|
|
79
78
|
"multiparty": "^4.2.1",
|
|
@@ -5384,14 +5383,14 @@
|
|
|
5384
5383
|
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
|
|
5385
5384
|
},
|
|
5386
5385
|
"node_modules/better-opn": {
|
|
5387
|
-
"version": "
|
|
5388
|
-
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-
|
|
5389
|
-
"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==",
|
|
5390
5389
|
"dependencies": {
|
|
5391
|
-
"open": "^
|
|
5390
|
+
"open": "^8.0.4"
|
|
5392
5391
|
},
|
|
5393
5392
|
"engines": {
|
|
5394
|
-
"node": "
|
|
5393
|
+
"node": ">=12.0.0"
|
|
5395
5394
|
}
|
|
5396
5395
|
},
|
|
5397
5396
|
"node_modules/binary-extensions": {
|
|
@@ -7584,6 +7583,14 @@
|
|
|
7584
7583
|
"node": ">=10"
|
|
7585
7584
|
}
|
|
7586
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
|
+
},
|
|
7587
7594
|
"node_modules/define-properties": {
|
|
7588
7595
|
"version": "1.1.3",
|
|
7589
7596
|
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
|
@@ -10766,20 +10773,19 @@
|
|
|
10766
10773
|
}
|
|
10767
10774
|
},
|
|
10768
10775
|
"node_modules/gh-release-fetch": {
|
|
10769
|
-
"version": "
|
|
10770
|
-
"resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-
|
|
10771
|
-
"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==",
|
|
10772
10779
|
"dependencies": {
|
|
10773
10780
|
"@types/download": "^8.0.0",
|
|
10774
10781
|
"@types/node-fetch": "^2.1.6",
|
|
10775
10782
|
"@types/semver": "^7.0.0",
|
|
10776
10783
|
"download": "^8.0.0",
|
|
10777
|
-
"make-dir": "^3.1.0",
|
|
10778
10784
|
"node-fetch": "^2.3.0",
|
|
10779
10785
|
"semver": "^7.0.0"
|
|
10780
10786
|
},
|
|
10781
10787
|
"engines": {
|
|
10782
|
-
"node": ">=
|
|
10788
|
+
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
|
|
10783
10789
|
}
|
|
10784
10790
|
},
|
|
10785
10791
|
"node_modules/git-raw-commits": {
|
|
@@ -16071,15 +16077,16 @@
|
|
|
16071
16077
|
}
|
|
16072
16078
|
},
|
|
16073
16079
|
"node_modules/open": {
|
|
16074
|
-
"version": "
|
|
16075
|
-
"resolved": "https://registry.npmjs.org/open/-/open-
|
|
16076
|
-
"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==",
|
|
16077
16083
|
"dependencies": {
|
|
16078
|
-
"
|
|
16079
|
-
"is-
|
|
16084
|
+
"define-lazy-prop": "^2.0.0",
|
|
16085
|
+
"is-docker": "^2.1.1",
|
|
16086
|
+
"is-wsl": "^2.2.0"
|
|
16080
16087
|
},
|
|
16081
16088
|
"engines": {
|
|
16082
|
-
"node": ">=
|
|
16089
|
+
"node": ">=12"
|
|
16083
16090
|
},
|
|
16084
16091
|
"funding": {
|
|
16085
16092
|
"url": "https://github.com/sponsors/sindresorhus"
|
|
@@ -24719,11 +24726,11 @@
|
|
|
24719
24726
|
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
|
|
24720
24727
|
},
|
|
24721
24728
|
"better-opn": {
|
|
24722
|
-
"version": "
|
|
24723
|
-
"resolved": "https://registry.npmjs.org/better-opn/-/better-opn-
|
|
24724
|
-
"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==",
|
|
24725
24732
|
"requires": {
|
|
24726
|
-
"open": "^
|
|
24733
|
+
"open": "^8.0.4"
|
|
24727
24734
|
}
|
|
24728
24735
|
},
|
|
24729
24736
|
"binary-extensions": {
|
|
@@ -26420,6 +26427,11 @@
|
|
|
26420
26427
|
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
|
|
26421
26428
|
"integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg=="
|
|
26422
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
|
+
},
|
|
26423
26435
|
"define-properties": {
|
|
26424
26436
|
"version": "1.1.3",
|
|
26425
26437
|
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
|
@@ -28790,15 +28802,14 @@
|
|
|
28790
28802
|
"integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg="
|
|
28791
28803
|
},
|
|
28792
28804
|
"gh-release-fetch": {
|
|
28793
|
-
"version": "
|
|
28794
|
-
"resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-
|
|
28795
|
-
"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==",
|
|
28796
28808
|
"requires": {
|
|
28797
28809
|
"@types/download": "^8.0.0",
|
|
28798
28810
|
"@types/node-fetch": "^2.1.6",
|
|
28799
28811
|
"@types/semver": "^7.0.0",
|
|
28800
28812
|
"download": "^8.0.0",
|
|
28801
|
-
"make-dir": "^3.1.0",
|
|
28802
28813
|
"node-fetch": "^2.3.0",
|
|
28803
28814
|
"semver": "^7.0.0"
|
|
28804
28815
|
}
|
|
@@ -32790,12 +32801,13 @@
|
|
|
32790
32801
|
}
|
|
32791
32802
|
},
|
|
32792
32803
|
"open": {
|
|
32793
|
-
"version": "
|
|
32794
|
-
"resolved": "https://registry.npmjs.org/open/-/open-
|
|
32795
|
-
"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==",
|
|
32796
32807
|
"requires": {
|
|
32797
|
-
"
|
|
32798
|
-
"is-
|
|
32808
|
+
"define-lazy-prop": "^2.0.0",
|
|
32809
|
+
"is-docker": "^2.1.1",
|
|
32810
|
+
"is-wsl": "^2.2.0"
|
|
32799
32811
|
}
|
|
32800
32812
|
},
|
|
32801
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.11",
|
|
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,7 +120,7 @@
|
|
|
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",
|
|
@@ -141,7 +141,6 @@
|
|
|
141
141
|
"lodash": "^4.17.20",
|
|
142
142
|
"log-symbols": "^4.0.0",
|
|
143
143
|
"log-update": "^5.0.0",
|
|
144
|
-
"make-dir": "^3.0.0",
|
|
145
144
|
"memoize-one": "^6.0.0",
|
|
146
145
|
"minimist": "^1.2.5",
|
|
147
146
|
"multiparty": "^4.2.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
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
const { writeFile } = require('fs').promises
|
|
1
|
+
const { mkdir, writeFile } = require('fs').promises
|
|
2
2
|
const path = require('path')
|
|
3
3
|
|
|
4
4
|
const { zipFunction } = require('@netlify/zip-it-and-ship-it')
|
|
5
5
|
const decache = require('decache')
|
|
6
|
-
const makeDir = require('make-dir')
|
|
7
6
|
const readPkgUp = require('read-pkg-up')
|
|
8
7
|
const sourceMapSupport = require('source-map-support')
|
|
9
8
|
|
|
@@ -72,7 +71,7 @@ const getTargetDirectory = async ({ errorExit }) => {
|
|
|
72
71
|
const targetDirectory = path.resolve(getPathInProject(['functions-serve']))
|
|
73
72
|
|
|
74
73
|
try {
|
|
75
|
-
await
|
|
74
|
+
await mkdir(targetDirectory, { recursive: true })
|
|
76
75
|
} catch (error) {
|
|
77
76
|
errorExit(`${NETLIFYDEVERR} Could not create directory: ${targetDirectory}`)
|
|
78
77
|
}
|
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
|
|
@@ -4,7 +4,6 @@ const process = require('process')
|
|
|
4
4
|
|
|
5
5
|
const dotProp = require('dot-prop')
|
|
6
6
|
const findUp = require('find-up')
|
|
7
|
-
const makeDir = require('make-dir')
|
|
8
7
|
const writeFileAtomic = require('write-file-atomic')
|
|
9
8
|
|
|
10
9
|
const { getPathInProject } = require('../lib/settings')
|
|
@@ -55,7 +54,7 @@ class StateConfig {
|
|
|
55
54
|
set all(val) {
|
|
56
55
|
try {
|
|
57
56
|
// Make sure the folder exists as it could have been deleted in the meantime
|
|
58
|
-
|
|
57
|
+
fs.mkdirSync(path.dirname(this.path), { recursive: true })
|
|
59
58
|
writeFileAtomic.sync(this.path, JSON.stringify(val, null, '\t'))
|
|
60
59
|
} catch (error) {
|
|
61
60
|
// Improve the message of permission errors
|