netlify-cli 8.6.21 → 8.6.22
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 +2 -2
- package/package.json +1 -1
- package/src/lib/functions/registry.js +11 -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.22",
|
|
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.22",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const { mkdir } = require('fs').promises
|
|
3
|
-
const { isAbsolute, join } = require('path')
|
|
3
|
+
const { extname, isAbsolute, join } = require('path')
|
|
4
4
|
const { env } = require('process')
|
|
5
5
|
|
|
6
6
|
const terminalLink = require('terminal-link')
|
|
7
7
|
|
|
8
|
-
const { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log, warn } = require('../../utils')
|
|
8
|
+
const { NETLIFYDEVERR, NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, log, warn } = require('../../utils')
|
|
9
9
|
const { getLogMessage } = require('../log')
|
|
10
10
|
|
|
11
11
|
const { NetlifyFunction } = require('./netlify-function')
|
|
12
12
|
const runtimes = require('./runtimes')
|
|
13
13
|
const { watchDebounced } = require('./watcher')
|
|
14
14
|
|
|
15
|
+
const ZIP_EXTENSION = '.zip'
|
|
16
|
+
|
|
15
17
|
class FunctionsRegistry {
|
|
16
18
|
constructor({ capabilities, config, isConnected = false, projectRoot, settings, timeouts }) {
|
|
17
19
|
this.capabilities = capabilities
|
|
@@ -141,6 +143,13 @@ class FunctionsRegistry {
|
|
|
141
143
|
)
|
|
142
144
|
}
|
|
143
145
|
|
|
146
|
+
// This fixes the bug described here https://github.com/netlify/zip-it-and-ship-it/issues/637
|
|
147
|
+
// If the current function's file is a zip bundle, we ignore it and log a helpful message.
|
|
148
|
+
if (extname(func.mainFile) === ZIP_EXTENSION) {
|
|
149
|
+
log(`${NETLIFYDEVWARN} Skipped bundled function ${chalk.yellow(name)}. Unzip the archive to load it from source.`)
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
|
|
144
153
|
this.functions.set(name, func)
|
|
145
154
|
this.buildFunctionAndWatchFiles(func)
|
|
146
155
|
|