netlify-cli 12.2.9 → 12.2.10

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "12.2.9",
3
+ "version": "12.2.10",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "12.2.9",
9
+ "version": "12.2.10",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
@@ -5956,13 +5956,13 @@
5956
5956
  "dev": true
5957
5957
  },
5958
5958
  "node_modules/@vitest/coverage-c8": {
5959
- "version": "0.25.3",
5960
- "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.25.3.tgz",
5961
- "integrity": "sha512-+tmrB3E7pZTSM+aWKzLk0FpyyaQOoRQf0594hHp+E3Kk0tiFONiEFYf7+9a1Z+C2ffU/0w6KvyBjpNPdashMrg==",
5959
+ "version": "0.25.6",
5960
+ "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.25.6.tgz",
5961
+ "integrity": "sha512-+Bcs1XZ8CuEe52QSOgzqmqiV82CXZRRj3yclPQqtLkUV4S6+kdOdfRTtMHOilwhZH70giDjBQx3jgiZoYgFVMA==",
5962
5962
  "dev": true,
5963
5963
  "dependencies": {
5964
5964
  "c8": "^7.12.0",
5965
- "vitest": "0.25.3"
5965
+ "vitest": "0.25.6"
5966
5966
  },
5967
5967
  "funding": {
5968
5968
  "url": "https://github.com/sponsors/antfu"
@@ -5986,9 +5986,9 @@
5986
5986
  }
5987
5987
  },
5988
5988
  "node_modules/acorn": {
5989
- "version": "8.8.0",
5990
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
5991
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
5989
+ "version": "8.8.1",
5990
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
5991
+ "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==",
5992
5992
  "bin": {
5993
5993
  "acorn": "bin/acorn"
5994
5994
  },
@@ -22053,12 +22053,12 @@
22053
22053
  }
22054
22054
  },
22055
22055
  "node_modules/strip-literal": {
22056
- "version": "0.4.2",
22057
- "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-0.4.2.tgz",
22058
- "integrity": "sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==",
22056
+ "version": "1.0.0",
22057
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.0.tgz",
22058
+ "integrity": "sha512-5o4LsH1lzBzO9UFH63AJ2ad2/S2AVx6NtjOcaz+VTT2h1RiRvbipW72z8M/lxEhcPHDBQwpDrnTF7sXy/7OwCQ==",
22059
22059
  "dev": true,
22060
22060
  "dependencies": {
22061
- "acorn": "^8.8.0"
22061
+ "acorn": "^8.8.1"
22062
22062
  },
22063
22063
  "funding": {
22064
22064
  "url": "https://github.com/sponsors/antfu"
@@ -24126,9 +24126,9 @@
24126
24126
  }
24127
24127
  },
24128
24128
  "node_modules/vite": {
24129
- "version": "3.2.4",
24130
- "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.4.tgz",
24131
- "integrity": "sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==",
24129
+ "version": "3.2.5",
24130
+ "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.5.tgz",
24131
+ "integrity": "sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==",
24132
24132
  "dev": true,
24133
24133
  "dependencies": {
24134
24134
  "esbuild": "^0.15.9",
@@ -24192,9 +24192,9 @@
24192
24192
  }
24193
24193
  },
24194
24194
  "node_modules/vitest": {
24195
- "version": "0.25.3",
24196
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.3.tgz",
24197
- "integrity": "sha512-/UzHfXIKsELZhL7OaM2xFlRF8HRZgAHtPctacvNK8H4vOcbJJAMEgbWNGSAK7Y9b1NBe5SeM7VTuz2RsTHFJJA==",
24195
+ "version": "0.25.6",
24196
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.6.tgz",
24197
+ "integrity": "sha512-jdPgmZ7BcDnm1+hmMPIl9BZjSy+b8Y8V0tQMsv7ECO90Qic7EZ5/+traILXLpsXgqK5KgVrUJmchevAUuKL/1w==",
24198
24198
  "dev": true,
24199
24199
  "dependencies": {
24200
24200
  "@types/chai": "^4.3.3",
@@ -24206,7 +24206,7 @@
24206
24206
  "debug": "^4.3.4",
24207
24207
  "local-pkg": "^0.4.2",
24208
24208
  "source-map": "^0.6.1",
24209
- "strip-literal": "^0.4.2",
24209
+ "strip-literal": "^1.0.0",
24210
24210
  "tinybench": "^2.3.1",
24211
24211
  "tinypool": "^0.3.0",
24212
24212
  "tinyspy": "^1.0.2",
@@ -28531,13 +28531,13 @@
28531
28531
  "dev": true
28532
28532
  },
28533
28533
  "@vitest/coverage-c8": {
28534
- "version": "0.25.3",
28535
- "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.25.3.tgz",
28536
- "integrity": "sha512-+tmrB3E7pZTSM+aWKzLk0FpyyaQOoRQf0594hHp+E3Kk0tiFONiEFYf7+9a1Z+C2ffU/0w6KvyBjpNPdashMrg==",
28534
+ "version": "0.25.6",
28535
+ "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.25.6.tgz",
28536
+ "integrity": "sha512-+Bcs1XZ8CuEe52QSOgzqmqiV82CXZRRj3yclPQqtLkUV4S6+kdOdfRTtMHOilwhZH70giDjBQx3jgiZoYgFVMA==",
28537
28537
  "dev": true,
28538
28538
  "requires": {
28539
28539
  "c8": "^7.12.0",
28540
- "vitest": "0.25.3"
28540
+ "vitest": "0.25.6"
28541
28541
  }
28542
28542
  },
28543
28543
  "abbrev": {
@@ -28555,9 +28555,9 @@
28555
28555
  }
28556
28556
  },
28557
28557
  "acorn": {
28558
- "version": "8.8.0",
28559
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
28560
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w=="
28558
+ "version": "8.8.1",
28559
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
28560
+ "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA=="
28561
28561
  },
28562
28562
  "acorn-jsx": {
28563
28563
  "version": "5.3.2",
@@ -40633,12 +40633,12 @@
40633
40633
  "dev": true
40634
40634
  },
40635
40635
  "strip-literal": {
40636
- "version": "0.4.2",
40637
- "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-0.4.2.tgz",
40638
- "integrity": "sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==",
40636
+ "version": "1.0.0",
40637
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.0.tgz",
40638
+ "integrity": "sha512-5o4LsH1lzBzO9UFH63AJ2ad2/S2AVx6NtjOcaz+VTT2h1RiRvbipW72z8M/lxEhcPHDBQwpDrnTF7sXy/7OwCQ==",
40639
40639
  "dev": true,
40640
40640
  "requires": {
40641
- "acorn": "^8.8.0"
40641
+ "acorn": "^8.8.1"
40642
40642
  }
40643
40643
  },
40644
40644
  "strip-outer": {
@@ -42160,9 +42160,9 @@
42160
42160
  }
42161
42161
  },
42162
42162
  "vite": {
42163
- "version": "3.2.4",
42164
- "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.4.tgz",
42165
- "integrity": "sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==",
42163
+ "version": "3.2.5",
42164
+ "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.5.tgz",
42165
+ "integrity": "sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==",
42166
42166
  "dev": true,
42167
42167
  "requires": {
42168
42168
  "esbuild": "^0.15.9",
@@ -42186,9 +42186,9 @@
42186
42186
  }
42187
42187
  },
42188
42188
  "vitest": {
42189
- "version": "0.25.3",
42190
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.3.tgz",
42191
- "integrity": "sha512-/UzHfXIKsELZhL7OaM2xFlRF8HRZgAHtPctacvNK8H4vOcbJJAMEgbWNGSAK7Y9b1NBe5SeM7VTuz2RsTHFJJA==",
42189
+ "version": "0.25.6",
42190
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.6.tgz",
42191
+ "integrity": "sha512-jdPgmZ7BcDnm1+hmMPIl9BZjSy+b8Y8V0tQMsv7ECO90Qic7EZ5/+traILXLpsXgqK5KgVrUJmchevAUuKL/1w==",
42192
42192
  "dev": true,
42193
42193
  "requires": {
42194
42194
  "@types/chai": "^4.3.3",
@@ -42200,7 +42200,7 @@
42200
42200
  "debug": "^4.3.4",
42201
42201
  "local-pkg": "^0.4.2",
42202
42202
  "source-map": "^0.6.1",
42203
- "strip-literal": "^0.4.2",
42203
+ "strip-literal": "^1.0.0",
42204
42204
  "tinybench": "^2.3.1",
42205
42205
  "tinypool": "^0.3.0",
42206
42206
  "tinyspy": "^1.0.2",
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.2.9",
4
+ "version": "12.2.10",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
2
  const { promises: fs } = require('fs')
3
- const path = require('path')
3
+ const { dirname, join, resolve } = require('path')
4
4
  const { cwd } = require('process')
5
5
  const { pathToFileURL } = require('url')
6
6
 
@@ -30,16 +30,16 @@ const getImportMap = async (importMapPath) => {
30
30
  }
31
31
 
32
32
  const getInternalFunctions = async () => {
33
- const internalPath = path.join(cwd(), getPathInProject([INTERNAL_EDGE_FUNCTIONS_FOLDER]))
33
+ const path = join(cwd(), getPathInProject([INTERNAL_EDGE_FUNCTIONS_FOLDER]))
34
34
 
35
35
  try {
36
- const stats = await fs.stat(internalPath)
36
+ const stats = await fs.stat(path)
37
37
 
38
38
  if (!stats.isDirectory()) {
39
39
  throw new Error('Path is not a directory')
40
40
  }
41
41
 
42
- const manifestPath = path.join(internalPath, 'manifest.json')
42
+ const manifestPath = join(path, 'manifest.json')
43
43
  // eslint-disable-next-line import/no-dynamic-require, n/global-require
44
44
  const manifest = require(manifestPath)
45
45
 
@@ -49,11 +49,11 @@ const getInternalFunctions = async () => {
49
49
 
50
50
  const data = {
51
51
  functions: manifest.functions,
52
- path: internalPath,
52
+ path,
53
53
  }
54
54
 
55
55
  if (manifest.import_map) {
56
- const importMapPath = path.resolve(path.dirname(manifestPath), manifest.import_map)
56
+ const importMapPath = resolve(dirname(manifestPath), manifest.import_map)
57
57
  const importMap = await getImportMap(importMapPath)
58
58
 
59
59
  if (importMap !== null) {
@@ -71,7 +71,7 @@ const getInternalFunctions = async () => {
71
71
  } catch {
72
72
  return {
73
73
  functions: [],
74
- path: null,
74
+ path,
75
75
  }
76
76
  }
77
77
  }
@@ -11,12 +11,21 @@ const { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log, warn, watchDebounced } = requi
11
11
  */
12
12
 
13
13
  /**
14
- * @typedef EdgeFunctionDeclaration
14
+ * @typedef EdgeFunctionDeclarationWithPath
15
15
  * @type {object}
16
16
  * @property {string} function
17
17
  * @property {string} path
18
18
  */
19
19
 
20
+ /**
21
+ * @typedef EdgeFunctionDeclarationWithPattern
22
+ * @type {object}
23
+ * @property {string} function
24
+ * @property {RegExp} pattern
25
+ */
26
+
27
+ /** @typedef {(EdgeFunctionDeclarationWithPath | EdgeFunctionDeclarationWithPattern) } EdgeFunctionDeclaration */
28
+
20
29
  class EdgeFunctionsRegistry {
21
30
  /**
22
31
  * @param {Object} opts
@@ -341,7 +350,9 @@ class EdgeFunctionsRegistry {
341
350
  }
342
351
  })
343
352
 
344
- return declarations
353
+ const filteredDeclarations = declarations.filter((declaration) => 'path' in declaration || 'pattern' in declaration)
354
+
355
+ return filteredDeclarations
345
356
  }
346
357
 
347
358
  processGraph(graph) {