@netlify/edge-bundler 5.3.0 → 5.3.2

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.
@@ -8,6 +8,7 @@ import { useFixture } from '../test/util.js';
8
8
  import { BundleError } from './bundle_error.js';
9
9
  import { bundle } from './bundler.js';
10
10
  import { isNodeError } from './utils/error.js';
11
+ import { validateManifest } from './validation/manifest/index.js';
11
12
  test('Produces an ESZIP bundle', async () => {
12
13
  const { basePath, cleanup, distPath } = await useFixture('with_import_maps');
13
14
  const declarations = [
@@ -27,6 +28,7 @@ test('Produces an ESZIP bundle', async () => {
27
28
  expect(generatedFiles.length).toBe(3);
28
29
  const manifestFile = await fs.readFile(resolve(distPath, 'manifest.json'), 'utf8');
29
30
  const manifest = JSON.parse(manifestFile);
31
+ expect(() => validateManifest(manifest)).not.toThrowError();
30
32
  const { bundles, import_map: importMapURL } = manifest;
31
33
  expect(bundles.length).toBe(1);
32
34
  expect(bundles[0].format).toBe('eszip2');
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-nested-callbacks */
2
1
  import { test, expect, describe } from 'vitest';
3
2
  import { validateManifest, ManifestValidationError } from './index.js';
4
3
  // Factory so we have a new object per test
@@ -113,4 +112,15 @@ describe('layers', () => {
113
112
  expect(() => validateManifest(manifest)).toThrowErrorMatchingSnapshot();
114
113
  });
115
114
  });
116
- /* eslint-enable max-nested-callbacks */
115
+ describe('import map URL', () => {
116
+ test('should accept string value', () => {
117
+ const manifest = getBaseManifest();
118
+ manifest.import_map = 'file:///root/.netlify/edge-functions-dist/import_map.json';
119
+ expect(() => validateManifest(manifest)).not.toThrowError();
120
+ });
121
+ test('should throw on wrong type', () => {
122
+ const manifest = getBaseManifest();
123
+ manifest.import_map = ['file:///root/.netlify/edge-functions-dist/import_map.json'];
124
+ expect(() => validateManifest(manifest)).toThrowErrorMatchingSnapshot();
125
+ });
126
+ });
@@ -80,6 +80,9 @@ declare const edgeManifestSchema: {
80
80
  additionalProperties: boolean;
81
81
  };
82
82
  };
83
+ import_map: {
84
+ type: string;
85
+ };
83
86
  bundler_version: {
84
87
  type: string;
85
88
  };
@@ -51,6 +51,7 @@ const edgeManifestSchema = {
51
51
  type: 'array',
52
52
  items: layersSchema,
53
53
  },
54
+ import_map: { type: 'string' },
54
55
  bundler_version: { type: 'string' },
55
56
  },
56
57
  additionalProperties: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/edge-bundler",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "Intelligently prepare Netlify Edge Functions for deployment",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.js",