netlify-cli 10.7.0 → 10.7.1
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
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "10.7.
|
|
3
|
+
"version": "10.7.1",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "10.7.
|
|
9
|
+
"version": "10.7.1",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@netlify/build": "^27.3.2",
|
|
14
14
|
"@netlify/config": "^18.1.1",
|
|
15
|
-
"@netlify/edge-bundler": "^1.4.
|
|
15
|
+
"@netlify/edge-bundler": "^1.4.3",
|
|
16
16
|
"@netlify/framework-info": "^9.1.0",
|
|
17
17
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
18
18
|
"@netlify/plugins-list": "^6.30.0",
|
|
@@ -2301,9 +2301,9 @@
|
|
|
2301
2301
|
}
|
|
2302
2302
|
},
|
|
2303
2303
|
"node_modules/@netlify/edge-bundler": {
|
|
2304
|
-
"version": "1.4.
|
|
2305
|
-
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.4.
|
|
2306
|
-
"integrity": "sha512-
|
|
2304
|
+
"version": "1.4.3",
|
|
2305
|
+
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.4.3.tgz",
|
|
2306
|
+
"integrity": "sha512-6brBHMq8cM6110H8Dtp7csPMhHeF8dtH6eqz+M+PVzsPEua4PY2KlSf+7CFxnviiXivm/k7bC/Hq4+VQvp8o3A==",
|
|
2307
2307
|
"dependencies": {
|
|
2308
2308
|
"common-path-prefix": "^3.0.0",
|
|
2309
2309
|
"del": "^6.0.0",
|
|
@@ -24382,9 +24382,9 @@
|
|
|
24382
24382
|
}
|
|
24383
24383
|
},
|
|
24384
24384
|
"@netlify/edge-bundler": {
|
|
24385
|
-
"version": "1.4.
|
|
24386
|
-
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.4.
|
|
24387
|
-
"integrity": "sha512-
|
|
24385
|
+
"version": "1.4.3",
|
|
24386
|
+
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.4.3.tgz",
|
|
24387
|
+
"integrity": "sha512-6brBHMq8cM6110H8Dtp7csPMhHeF8dtH6eqz+M+PVzsPEua4PY2KlSf+7CFxnviiXivm/k7bC/Hq4+VQvp8o3A==",
|
|
24388
24388
|
"requires": {
|
|
24389
24389
|
"common-path-prefix": "^3.0.0",
|
|
24390
24390
|
"del": "^6.0.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "10.7.
|
|
4
|
+
"version": "10.7.1",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"dependencies": {
|
|
216
216
|
"@netlify/build": "^27.3.2",
|
|
217
217
|
"@netlify/config": "^18.1.1",
|
|
218
|
-
"@netlify/edge-bundler": "^1.4.
|
|
218
|
+
"@netlify/edge-bundler": "^1.4.3",
|
|
219
219
|
"@netlify/framework-info": "^9.1.0",
|
|
220
220
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
221
221
|
"@netlify/plugins-list": "^6.30.0",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const { stat } = require('fs').promises
|
|
3
|
-
const path = require('path')
|
|
4
3
|
|
|
5
4
|
const { getPathInProject } = require('../settings')
|
|
6
5
|
|
|
@@ -10,7 +9,7 @@ const distPath = getPathInProject([EDGE_FUNCTIONS_FOLDER])
|
|
|
10
9
|
|
|
11
10
|
const deployFileNormalizer = (file) => {
|
|
12
11
|
const isEdgeFunction = file.root === distPath
|
|
13
|
-
const normalizedPath = isEdgeFunction ?
|
|
12
|
+
const normalizedPath = isEdgeFunction ? `${PUBLIC_URL_PATH}/${file.normalizedPath}` : file.normalizedPath
|
|
14
13
|
|
|
15
14
|
return {
|
|
16
15
|
...file,
|
|
@@ -32,7 +31,7 @@ const getDistPathIfExists = async () => {
|
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
const isEdgeFunctionFile = (filePath) => filePath.startsWith(`${PUBLIC_URL_PATH}
|
|
34
|
+
const isEdgeFunctionFile = (filePath) => filePath.startsWith(`${PUBLIC_URL_PATH}/`)
|
|
36
35
|
|
|
37
36
|
module.exports = {
|
|
38
37
|
deployFileNormalizer,
|
|
@@ -5,7 +5,7 @@ const { cwd, env } = require('process')
|
|
|
5
5
|
const getAvailablePort = require('get-port')
|
|
6
6
|
const { v4: generateUUID } = require('uuid')
|
|
7
7
|
|
|
8
|
-
const { NETLIFYDEVERR, NETLIFYDEVWARN, chalk, error, log } = require('../../utils/command-helpers')
|
|
8
|
+
const { NETLIFYDEVERR, NETLIFYDEVWARN, chalk, error: printError, log } = require('../../utils/command-helpers')
|
|
9
9
|
const { getGeoLocation } = require('../geo-location')
|
|
10
10
|
const { getPathInProject } = require('../settings')
|
|
11
11
|
const { startSpinner, stopSpinner } = require('../spinner')
|
|
@@ -77,24 +77,18 @@ const initializeProxy = async ({
|
|
|
77
77
|
projectDir,
|
|
78
78
|
})
|
|
79
79
|
const hasEdgeFunctions = userFunctionsPath !== undefined || internalFunctions.length !== 0
|
|
80
|
-
let hasServerError = false
|
|
81
80
|
|
|
82
81
|
return async (req) => {
|
|
83
|
-
if (req.headers[headers.Passthrough] !== undefined || !hasEdgeFunctions
|
|
82
|
+
if (req.headers[headers.Passthrough] !== undefined || !hasEdgeFunctions) {
|
|
84
83
|
return
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
const [geoLocation, registry] = await Promise.all([
|
|
87
|
+
getGeoLocation({ mode: geolocationMode, offline, state }),
|
|
88
|
+
server,
|
|
89
|
+
])
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
promiseResult = await Promise.all([getGeoLocation({ mode: geolocationMode, offline, state }), server])
|
|
91
|
-
} catch (error_) {
|
|
92
|
-
error(error_.message, { exit: false })
|
|
93
|
-
hasServerError = true
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const [geoLocation, { registry }] = promiseResult
|
|
91
|
+
if (!registry) return
|
|
98
92
|
|
|
99
93
|
// Setting header with geolocation.
|
|
100
94
|
req.headers[headers.Geo] = JSON.stringify(geoLocation)
|
|
@@ -152,34 +146,39 @@ const prepareServer = async ({
|
|
|
152
146
|
port,
|
|
153
147
|
projectDir,
|
|
154
148
|
}) => {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
149
|
+
try {
|
|
150
|
+
const bundler = await import('@netlify/edge-bundler')
|
|
151
|
+
const distImportMapPath = getPathInProject([DIST_IMPORT_MAP_PATH])
|
|
152
|
+
const runIsolate = await bundler.serve({
|
|
153
|
+
...getDownloadUpdateFunctions(),
|
|
154
|
+
certificatePath,
|
|
155
|
+
debug: env.NETLIFY_DENO_DEBUG === 'true',
|
|
156
|
+
distImportMapPath,
|
|
157
|
+
formatExportTypeError: (name) =>
|
|
158
|
+
`${NETLIFYDEVERR} ${chalk.red('Failed')} to load Edge Function ${chalk.yellow(
|
|
159
|
+
name,
|
|
160
|
+
)}. The file does not seem to have a function as the default export.`,
|
|
161
|
+
formatImportError: (name) =>
|
|
162
|
+
`${NETLIFYDEVERR} ${chalk.red('Failed')} to run Edge Function ${chalk.yellow(name)}:`,
|
|
163
|
+
importMaps,
|
|
164
|
+
inspectSettings,
|
|
165
|
+
port,
|
|
166
|
+
})
|
|
167
|
+
const registry = new EdgeFunctionsRegistry({
|
|
168
|
+
bundler,
|
|
169
|
+
config,
|
|
170
|
+
configPath,
|
|
171
|
+
directories,
|
|
172
|
+
getUpdatedConfig,
|
|
173
|
+
internalFunctions,
|
|
174
|
+
projectDir,
|
|
175
|
+
runIsolate,
|
|
176
|
+
})
|
|
181
177
|
|
|
182
|
-
|
|
178
|
+
return registry
|
|
179
|
+
} catch (error) {
|
|
180
|
+
printError(error.message, { exit: false })
|
|
181
|
+
}
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
module.exports = { handleProxyRequest, initializeProxy, isEdgeFunctionsRequest }
|