netlify-cli 12.10.0 → 12.11.0
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 +1567 -3165
- package/package.json +11 -11
- package/src/functions-templates/javascript/auth-fetch/package-lock.json +6 -6
- package/src/functions-templates/javascript/google-analytics/package-lock.json +6 -6
- package/src/functions-templates/javascript/token-hider/package-lock.json +6 -6
- package/src/functions-templates/typescript/hello-world/package-lock.json +6 -6
- package/src/lib/edge-functions/internal.mjs +1 -1
- package/src/lib/functions/netlify-function.mjs +2 -0
- package/src/lib/functions/registry.mjs +10 -3
- package/src/lib/functions/runtimes/go/index.mjs +2 -2
- package/src/utils/deploy/deploy-site.mjs +2 -2
- package/src/utils/deploy/hash-fns.mjs +3 -2
- package/src/utils/deploy/util.mjs +2 -2
- package/src/functions-templates/rust/hello-world/.gitignore +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.11.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@fastify/static": "^6.6.0",
|
|
79
|
-
"@netlify/build": "^29.5.
|
|
80
|
-
"@netlify/config": "^20.3.
|
|
79
|
+
"@netlify/build": "^29.5.5",
|
|
80
|
+
"@netlify/config": "^20.3.3",
|
|
81
81
|
"@netlify/edge-bundler": "^8.4.0",
|
|
82
|
-
"@netlify/framework-info": "^9.
|
|
82
|
+
"@netlify/framework-info": "^9.8.1",
|
|
83
83
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
84
|
-
"@netlify/zip-it-and-ship-it": "^8.
|
|
84
|
+
"@netlify/zip-it-and-ship-it": "^8.5.0",
|
|
85
85
|
"@octokit/rest": "^19.0.0",
|
|
86
86
|
"ansi-escapes": "^5.0.0",
|
|
87
87
|
"ansi-styles": "^5.0.0",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"netlify-redirect-parser": "^14.1.1",
|
|
150
150
|
"netlify-redirector": "^0.4.0",
|
|
151
151
|
"node-fetch": "^2.6.0",
|
|
152
|
-
"node-version-alias": "^
|
|
152
|
+
"node-version-alias": "^2.0.0",
|
|
153
153
|
"ora": "^5.0.0",
|
|
154
154
|
"p-filter": "^2.1.0",
|
|
155
155
|
"p-map": "^4.0.0",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"string-similarity": "^4.0.4",
|
|
168
168
|
"strip-ansi-control-characters": "^2.0.0",
|
|
169
169
|
"tabtab": "^3.0.2",
|
|
170
|
-
"tempy": "^
|
|
170
|
+
"tempy": "^3.0.0",
|
|
171
171
|
"terminal-link": "^2.1.1",
|
|
172
172
|
"through2-filter": "^3.0.0",
|
|
173
173
|
"through2-map": "^3.0.0",
|
|
@@ -183,13 +183,13 @@
|
|
|
183
183
|
"devDependencies": {
|
|
184
184
|
"@babel/preset-react": "^7.12.13",
|
|
185
185
|
"@netlify/eslint-config-node": "^7.0.0",
|
|
186
|
-
"@vitest/coverage-c8": "^0.
|
|
186
|
+
"@vitest/coverage-c8": "^0.28.0",
|
|
187
187
|
"ava": "^4.0.0",
|
|
188
188
|
"c8": "^7.11.0",
|
|
189
189
|
"eslint-plugin-sort-destructure-keys": "^1.3.5",
|
|
190
190
|
"fast-glob": "^3.2.7",
|
|
191
191
|
"form-data": "^4.0.0",
|
|
192
|
-
"got": "^11.8.
|
|
192
|
+
"got": "^11.8.6",
|
|
193
193
|
"graphviz": "^0.0.9",
|
|
194
194
|
"husky": "^8.0.0",
|
|
195
195
|
"ini": "^2.0.0",
|
|
@@ -199,14 +199,14 @@
|
|
|
199
199
|
"rewiremock": "^3.14.3",
|
|
200
200
|
"serialize-javascript": "^6.0.0",
|
|
201
201
|
"sinon": "^14.0.0",
|
|
202
|
-
"strip-ansi": "^
|
|
202
|
+
"strip-ansi": "^7.0.0",
|
|
203
203
|
"temp-dir": "^2.0.0",
|
|
204
204
|
"tomlify-j0.4": "^3.0.0",
|
|
205
205
|
"tree-kill": "^1.2.2",
|
|
206
206
|
"typescript": "^4.4.4",
|
|
207
207
|
"verdaccio": "^5.10.2",
|
|
208
208
|
"vite": "^4.0.0",
|
|
209
|
-
"vitest": "^0.
|
|
209
|
+
"vitest": "^0.28.0"
|
|
210
210
|
},
|
|
211
211
|
"ava": {
|
|
212
212
|
"files": [
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"node_modules/node-fetch": {
|
|
16
|
-
"version": "2.6.
|
|
17
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
18
|
-
"integrity": "sha512-
|
|
16
|
+
"version": "2.6.9",
|
|
17
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz",
|
|
18
|
+
"integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"whatwg-url": "^5.0.0"
|
|
21
21
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"node-fetch": {
|
|
56
|
-
"version": "2.6.
|
|
57
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
58
|
-
"integrity": "sha512-
|
|
56
|
+
"version": "2.6.9",
|
|
57
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz",
|
|
58
|
+
"integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==",
|
|
59
59
|
"requires": {
|
|
60
60
|
"whatwg-url": "^5.0.0"
|
|
61
61
|
}
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"node_modules/node-fetch": {
|
|
20
|
-
"version": "2.6.
|
|
21
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
22
|
-
"integrity": "sha512-
|
|
20
|
+
"version": "2.6.9",
|
|
21
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz",
|
|
22
|
+
"integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"whatwg-url": "^5.0.0"
|
|
25
25
|
},
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"node-fetch": {
|
|
68
|
-
"version": "2.6.
|
|
69
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
70
|
-
"integrity": "sha512-
|
|
68
|
+
"version": "2.6.9",
|
|
69
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz",
|
|
70
|
+
"integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==",
|
|
71
71
|
"requires": {
|
|
72
72
|
"whatwg-url": "^5.0.0"
|
|
73
73
|
}
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
20
20
|
},
|
|
21
21
|
"node_modules/axios": {
|
|
22
|
-
"version": "1.2.
|
|
23
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.2.
|
|
24
|
-
"integrity": "sha512-
|
|
22
|
+
"version": "1.2.6",
|
|
23
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz",
|
|
24
|
+
"integrity": "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"follow-redirects": "^1.15.0",
|
|
27
27
|
"form-data": "^4.0.0",
|
|
@@ -198,9 +198,9 @@
|
|
|
198
198
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
199
199
|
},
|
|
200
200
|
"axios": {
|
|
201
|
-
"version": "1.2.
|
|
202
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.2.
|
|
203
|
-
"integrity": "sha512-
|
|
201
|
+
"version": "1.2.6",
|
|
202
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz",
|
|
203
|
+
"integrity": "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==",
|
|
204
204
|
"requires": {
|
|
205
205
|
"follow-redirects": "^1.15.0",
|
|
206
206
|
"form-data": "^4.0.0",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
|
|
37
37
|
},
|
|
38
38
|
"node_modules/typescript": {
|
|
39
|
-
"version": "4.9.
|
|
40
|
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.
|
|
41
|
-
"integrity": "sha512-
|
|
39
|
+
"version": "4.9.5",
|
|
40
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
|
41
|
+
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
|
42
42
|
"bin": {
|
|
43
43
|
"tsc": "bin/tsc",
|
|
44
44
|
"tsserver": "bin/tsserver"
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
|
|
69
69
|
},
|
|
70
70
|
"typescript": {
|
|
71
|
-
"version": "4.9.
|
|
72
|
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.
|
|
73
|
-
"integrity": "sha512-
|
|
71
|
+
"version": "4.9.5",
|
|
72
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
|
73
|
+
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -18,6 +18,7 @@ export default class NetlifyFunction {
|
|
|
18
18
|
constructor({
|
|
19
19
|
config,
|
|
20
20
|
directory,
|
|
21
|
+
displayName,
|
|
21
22
|
mainFile,
|
|
22
23
|
name,
|
|
23
24
|
projectRoot,
|
|
@@ -31,6 +32,7 @@ export default class NetlifyFunction {
|
|
|
31
32
|
this.errorExit = errorExit
|
|
32
33
|
this.mainFile = mainFile
|
|
33
34
|
this.name = name
|
|
35
|
+
this.displayName = displayName
|
|
34
36
|
this.projectRoot = projectRoot
|
|
35
37
|
this.runtime = runtime
|
|
36
38
|
this.timeoutBackground = timeoutBackground
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
warn,
|
|
15
15
|
watchDebounced,
|
|
16
16
|
} from '../../utils/command-helpers.mjs'
|
|
17
|
-
import { SERVE_FUNCTIONS_FOLDER } from '../../utils/functions/functions.mjs'
|
|
17
|
+
import { INTERNAL_FUNCTIONS_FOLDER, SERVE_FUNCTIONS_FOLDER } from '../../utils/functions/functions.mjs'
|
|
18
18
|
import { getLogMessage } from '../log.mjs'
|
|
19
19
|
import { getPathInProject } from '../settings.mjs'
|
|
20
20
|
|
|
@@ -164,7 +164,12 @@ export class FunctionsRegistry {
|
|
|
164
164
|
this.functions.set(name, func)
|
|
165
165
|
this.buildFunctionAndWatchFiles(func)
|
|
166
166
|
|
|
167
|
-
log(
|
|
167
|
+
log(
|
|
168
|
+
`${NETLIFYDEVLOG} ${chalk.green('Loaded')} function ${getTerminalLink(
|
|
169
|
+
chalk.yellow(func.displayName || name),
|
|
170
|
+
func.url,
|
|
171
|
+
)}.`,
|
|
172
|
+
)
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
// This function is here so we can mock it in tests
|
|
@@ -191,6 +196,7 @@ export class FunctionsRegistry {
|
|
|
191
196
|
buildRustSource: env.NETLIFY_EXPERIMENTAL_BUILD_RUST_SOURCE === 'true',
|
|
192
197
|
project_deploy_configuration_api_use_per_function_configuration_files: true,
|
|
193
198
|
},
|
|
199
|
+
configFileDirectories: [getPathInProject([INTERNAL_FUNCTIONS_FOLDER])],
|
|
194
200
|
config: this.config.functions,
|
|
195
201
|
})
|
|
196
202
|
|
|
@@ -207,7 +213,7 @@ export class FunctionsRegistry {
|
|
|
207
213
|
await Promise.all(deletedFunctions.map((func) => this.unregisterFunction(func.name)))
|
|
208
214
|
|
|
209
215
|
await Promise.all(
|
|
210
|
-
functions.map(async ({ mainFile, name, runtime: runtimeName }) => {
|
|
216
|
+
functions.map(async ({ displayName, mainFile, name, runtime: runtimeName }) => {
|
|
211
217
|
const runtime = runtimes[runtimeName]
|
|
212
218
|
|
|
213
219
|
// If there is no matching runtime, it means this function is not yet
|
|
@@ -226,6 +232,7 @@ export class FunctionsRegistry {
|
|
|
226
232
|
directory: directories.find((directory) => mainFile.startsWith(directory)),
|
|
227
233
|
mainFile,
|
|
228
234
|
name,
|
|
235
|
+
displayName,
|
|
229
236
|
projectRoot: this.projectRoot,
|
|
230
237
|
runtime,
|
|
231
238
|
timeoutBackground: this.timeouts.backgroundFunctions,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { dirname, extname } from 'path'
|
|
3
3
|
import { platform } from 'process'
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { temporaryFile } from 'tempy'
|
|
6
6
|
|
|
7
7
|
import execa from '../../../../utils/execa.mjs'
|
|
8
8
|
import { runFunctionsProxy } from '../../local-proxy.mjs'
|
|
@@ -41,7 +41,7 @@ const checkGoInstallation = async ({ cwd }) => {
|
|
|
41
41
|
|
|
42
42
|
export const getBuildFunction = ({ func }) => {
|
|
43
43
|
const functionDirectory = dirname(func.mainFile)
|
|
44
|
-
const binaryPath =
|
|
44
|
+
const binaryPath = temporaryFile(isWindows ? { extension: 'exe' } : undefined)
|
|
45
45
|
|
|
46
46
|
return () => build({ binaryPath, functionDirectory })
|
|
47
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { rm } from 'fs/promises'
|
|
2
2
|
|
|
3
3
|
import cleanDeep from 'clean-deep'
|
|
4
|
-
import
|
|
4
|
+
import { temporaryDirectory } from 'tempy'
|
|
5
5
|
|
|
6
6
|
import { deployFileNormalizer, getDistPathIfExists, isEdgeFunctionFile } from '../../lib/edge-functions/deploy.mjs'
|
|
7
7
|
import { warn } from '../command-helpers.mjs'
|
|
@@ -45,7 +45,7 @@ export const deploySite = async (
|
|
|
45
45
|
/* default to noop */
|
|
46
46
|
},
|
|
47
47
|
syncFileLimit = DEFAULT_SYNC_LIMIT,
|
|
48
|
-
tmpDir =
|
|
48
|
+
tmpDir = temporaryDirectory(),
|
|
49
49
|
rootDir,
|
|
50
50
|
} = {},
|
|
51
51
|
) => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { readFile } from 'fs/promises'
|
|
2
|
-
import path
|
|
2
|
+
import path from 'path'
|
|
3
3
|
import { promisify } from 'util'
|
|
4
4
|
|
|
5
5
|
import fromArray from 'from2-array'
|
|
6
6
|
import pumpModule from 'pump'
|
|
7
7
|
|
|
8
|
+
import { getPathInProject } from '../../lib/settings.mjs'
|
|
8
9
|
import { INTERNAL_FUNCTIONS_FOLDER } from '../functions/functions.mjs'
|
|
9
10
|
|
|
10
11
|
import { hasherCtor, manifestCollectorCtor } from './hasher-segments.mjs'
|
|
@@ -70,7 +71,7 @@ const getFunctionZips = async ({
|
|
|
70
71
|
return await zipFunctions(directories, tmpDir, {
|
|
71
72
|
featureFlags: { project_deploy_configuration_api_use_per_function_configuration_files: true },
|
|
72
73
|
basePath: rootDir,
|
|
73
|
-
configFileDirectories: [
|
|
74
|
+
configFileDirectories: [getPathInProject([INTERNAL_FUNCTIONS_FOLDER])],
|
|
74
75
|
config: functionsConfig,
|
|
75
76
|
})
|
|
76
77
|
}
|
|
@@ -23,7 +23,7 @@ export const waitForDiff = async (api, deployId, siteId, timeout) => {
|
|
|
23
23
|
switch (siteDeploy.state) {
|
|
24
24
|
// https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33
|
|
25
25
|
case 'error': {
|
|
26
|
-
const deployError = new Error(`Deploy ${deployId} had an error`)
|
|
26
|
+
const deployError = new Error(siteDeploy.error_message || `Deploy ${deployId} had an error`)
|
|
27
27
|
deployError.deploy = siteDeploy
|
|
28
28
|
throw deployError
|
|
29
29
|
}
|
|
@@ -60,7 +60,7 @@ export const waitForDeploy = async (api, deployId, siteId, timeout) => {
|
|
|
60
60
|
switch (siteDeploy.state) {
|
|
61
61
|
// https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33
|
|
62
62
|
case 'error': {
|
|
63
|
-
const deployError = new Error(`Deploy ${deployId} had an error`)
|
|
63
|
+
const deployError = new Error(siteDeploy.error_message || `Deploy ${deployId} had an error`)
|
|
64
64
|
deployError.deploy = siteDeploy
|
|
65
65
|
throw deployError
|
|
66
66
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/target
|