@netlify/edge-bundler 14.8.7 → 14.9.0
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/dist/node/bundler.js
CHANGED
|
@@ -65,18 +65,27 @@ export const bundle = async (sourceDirectories, distDirectory, tomlDeclarations
|
|
|
65
65
|
importMap.add(vendor.importMap);
|
|
66
66
|
}
|
|
67
67
|
const bundles = [];
|
|
68
|
+
let tarballBundleDurationMs;
|
|
68
69
|
if (featureFlags.edge_bundler_generate_tarball || featureFlags.edge_bundler_dry_run_generate_tarball) {
|
|
69
|
-
const tarballPromise =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
const tarballPromise = (async () => {
|
|
71
|
+
const start = Date.now();
|
|
72
|
+
try {
|
|
73
|
+
return await bundleTarball({
|
|
74
|
+
basePath,
|
|
75
|
+
buildID,
|
|
76
|
+
debug,
|
|
77
|
+
deno,
|
|
78
|
+
distDirectory,
|
|
79
|
+
functions,
|
|
80
|
+
featureFlags,
|
|
81
|
+
importMap: importMap.clone(),
|
|
82
|
+
vendorDirectory: vendor?.directory,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
tarballBundleDurationMs = Date.now() - start;
|
|
87
|
+
}
|
|
88
|
+
})();
|
|
80
89
|
if (featureFlags.edge_bundler_dry_run_generate_tarball) {
|
|
81
90
|
try {
|
|
82
91
|
await tarballPromise;
|
|
@@ -135,6 +144,7 @@ export const bundle = async (sourceDirectories, distDirectory, tomlDeclarations
|
|
|
135
144
|
internalFunctionConfig,
|
|
136
145
|
importMap: importMapSpecifier,
|
|
137
146
|
layers: deployConfig.layers,
|
|
147
|
+
bundlingTiming: tarballBundleDurationMs === undefined ? undefined : { tarball_ms: tarballBundleDurationMs },
|
|
138
148
|
});
|
|
139
149
|
await vendor?.cleanup();
|
|
140
150
|
if (distImportMapPath) {
|
package/dist/node/manifest.d.ts
CHANGED
|
@@ -37,12 +37,16 @@ export interface EdgeFunctionConfig {
|
|
|
37
37
|
name?: string;
|
|
38
38
|
traffic_rules?: TrafficRules;
|
|
39
39
|
}
|
|
40
|
+
interface BundlingTiming {
|
|
41
|
+
tarball_ms?: number;
|
|
42
|
+
}
|
|
40
43
|
interface Manifest {
|
|
41
44
|
bundler_version: string;
|
|
42
45
|
bundles: {
|
|
43
46
|
asset: string;
|
|
44
47
|
format: string;
|
|
45
48
|
}[];
|
|
49
|
+
bundling_timing?: BundlingTiming;
|
|
46
50
|
import_map?: string;
|
|
47
51
|
layers: {
|
|
48
52
|
name: string;
|
|
@@ -61,8 +65,9 @@ interface GenerateManifestOptions {
|
|
|
61
65
|
internalFunctionConfig?: Record<string, FunctionConfig>;
|
|
62
66
|
layers?: Layer[];
|
|
63
67
|
userFunctionConfig?: Record<string, FunctionConfig>;
|
|
68
|
+
bundlingTiming?: BundlingTiming;
|
|
64
69
|
}
|
|
65
|
-
declare const generateManifest: ({ bundles, declarations, functions, userFunctionConfig, internalFunctionConfig, importMap, layers, }: GenerateManifestOptions) => {
|
|
70
|
+
declare const generateManifest: ({ bundles, declarations, functions, userFunctionConfig, internalFunctionConfig, importMap, layers, bundlingTiming, }: GenerateManifestOptions) => {
|
|
66
71
|
declarationsWithoutFunction: string[];
|
|
67
72
|
manifest: Manifest;
|
|
68
73
|
unroutedFunctions: string[];
|
package/dist/node/manifest.js
CHANGED
|
@@ -54,7 +54,7 @@ const normalizeMethods = (method, name) => {
|
|
|
54
54
|
return method.toUpperCase();
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
-
const generateManifest = ({ bundles = [], declarations = [], functions, userFunctionConfig = {}, internalFunctionConfig = {}, importMap, layers = [], }) => {
|
|
57
|
+
const generateManifest = ({ bundles = [], declarations = [], functions, userFunctionConfig = {}, internalFunctionConfig = {}, importMap, layers = [], bundlingTiming, }) => {
|
|
58
58
|
const preCacheRoutes = [];
|
|
59
59
|
const postCacheRoutes = [];
|
|
60
60
|
const manifestFunctionConfig = Object.fromEntries(functions.map(({ name }) => [name, { excluded_patterns: [] }]));
|
|
@@ -144,6 +144,9 @@ const generateManifest = ({ bundles = [], declarations = [], functions, userFunc
|
|
|
144
144
|
layers,
|
|
145
145
|
import_map: importMap,
|
|
146
146
|
function_config: sanitizeEdgeFunctionConfig(manifestFunctionConfig),
|
|
147
|
+
...(bundlingTiming && Object.values(bundlingTiming).some((value) => value !== undefined)
|
|
148
|
+
? { bundling_timing: bundlingTiming }
|
|
149
|
+
: {}),
|
|
147
150
|
};
|
|
148
151
|
const unroutedFunctions = functions.filter(({ name }) => !routedFunctions.has(name)).map(({ name }) => name);
|
|
149
152
|
return { declarationsWithoutFunction: [...declarationsWithoutFunction], manifest, unroutedFunctions };
|
|
@@ -188,6 +188,16 @@ declare const edgeManifestSchema: {
|
|
|
188
188
|
bundler_version: {
|
|
189
189
|
type: string;
|
|
190
190
|
};
|
|
191
|
+
bundling_timing: {
|
|
192
|
+
type: string;
|
|
193
|
+
properties: {
|
|
194
|
+
tarball_ms: {
|
|
195
|
+
type: string;
|
|
196
|
+
minimum: number;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
additionalProperties: boolean;
|
|
200
|
+
};
|
|
191
201
|
function_config: {
|
|
192
202
|
type: string;
|
|
193
203
|
additionalProperties: {
|
|
@@ -15,6 +15,13 @@ const excludedPatternsSchema = {
|
|
|
15
15
|
errorMessage: 'excluded_patterns must be an array of regex that starts with ^ and ends with $ (e.g. ^/blog/[d]{4}$)',
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
+
const bundlingTimingSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
tarball_ms: { type: 'number', minimum: 0 },
|
|
22
|
+
},
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
};
|
|
18
25
|
const headersSchema = {
|
|
19
26
|
type: 'object',
|
|
20
27
|
patternProperties: {
|
|
@@ -105,6 +112,7 @@ const edgeManifestSchema = {
|
|
|
105
112
|
},
|
|
106
113
|
import_map: { type: 'string' },
|
|
107
114
|
bundler_version: { type: 'string' },
|
|
115
|
+
bundling_timing: bundlingTimingSchema,
|
|
108
116
|
function_config: { type: 'object', additionalProperties: functionConfigSchema },
|
|
109
117
|
},
|
|
110
118
|
additionalProperties: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/edge-bundler",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.9.0",
|
|
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
|
"urlpattern-polyfill": "8.0.2",
|
|
81
81
|
"uuid": "^11.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "62138231cf941ffa7e3a5227be4d686a982f6e4b"
|
|
84
84
|
}
|