@netlify/edge-bundler 15.0.4 → 15.1.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Edge Bundler
5
5
 
6
- Intelligently prepare Netlify Edge Functions for deployment.
6
+ Prepare Netlify Edge Functions for deployment
7
7
 
8
8
  ## Usage
9
9
 
@@ -46,5 +46,5 @@ This will go away soon as we move away from the ESZIP format.
46
46
 
47
47
  ## Contributors
48
48
 
49
- Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks
50
- for contributing!
49
+ Please see [CONTRIBUTING.md](/CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks for
50
+ contributing!
@@ -255,11 +255,16 @@ const getBasePath = (sourceDirectories, inputBasePath) => {
255
255
  // declaration level. We want these properties to live at the function level
256
256
  // in their config object, so we translate that for backwards-compatibility.
257
257
  const mergeWithDeclarationConfig = ({ functionName, config, declarations }) => {
258
- const declaration = declarations?.find((decl) => decl.function === functionName);
258
+ // A function may have several declarations for example, one synthesized
259
+ // from its in-source config and one coming from `netlify.toml` or the
260
+ // Frameworks API. Only the latter can carry `name` and `generator`, so we
261
+ // look for each field across all of the function's declarations rather than
262
+ // just the first one, which may well be the in-source one.
263
+ const functionDeclarations = declarations?.filter((decl) => decl.function === functionName) ?? [];
259
264
  return {
260
265
  ...config,
261
- name: declaration?.name || config.name,
262
- generator: declaration?.generator || config.generator,
266
+ name: functionDeclarations.find((decl) => decl.name)?.name || config.name,
267
+ generator: functionDeclarations.find((decl) => decl.generator)?.generator || config.generator,
263
268
  };
264
269
  };
265
270
  const addGeneratorFallback = (config) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/edge-bundler",
3
- "version": "15.0.4",
3
+ "version": "15.1.1",
4
4
  "description": "Intelligently prepare Netlify Edge Functions for deployment",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.js",
@@ -80,5 +80,5 @@
80
80
  "tmp-promise": "^3.0.3",
81
81
  "urlpattern-polyfill": "8.0.2"
82
82
  },
83
- "gitHead": "46836e0332f78056d7faf221bfe55b7f4be1da76"
83
+ "gitHead": "bf7df1082def1573844b83b0282637836878705e"
84
84
  }