@netlify/build 28.4.4 → 28.4.5

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.
@@ -14,7 +14,6 @@ export const DEFAULT_FEATURE_FLAGS = {
14
14
  buildbot_zisi_trace_nft: false,
15
15
  buildbot_zisi_esbuild_parser: false,
16
16
  edge_functions_cache_cli: false,
17
- edge_functions_produce_eszip: false,
18
17
  edge_functions_system_logger: false,
19
18
  // TODO: remove this flag once rolled out to everyone
20
19
  // FF link: https://app.launchdarkly.com/default/production/features/plugins_break_builds_with_unsupported_plugin_versions/targeting
@@ -4,21 +4,18 @@ import { bundle, find } from '@netlify/edge-bundler';
4
4
  import { pathExists } from 'path-exists';
5
5
  import { logFunctionsToBundle } from '../../log/messages/core_steps.js';
6
6
  import { tagBundlingError } from './lib/error.js';
7
- import { parseManifest } from './lib/internal_manifest.js';
8
7
  import { validateEdgeFunctionsManifest } from './validate_manifest/validate_edge_functions_manifest.js';
9
8
  // TODO: Replace this with a custom cache directory.
10
9
  const DENO_CLI_CACHE_DIRECTORY = '.netlify/plugins/deno-cli';
11
10
  const IMPORT_MAP_FILENAME = 'edge-functions-import-map.json';
12
11
  const coreStep = async function ({ buildDir, constants: { EDGE_FUNCTIONS_DIST: distDirectory, EDGE_FUNCTIONS_SRC: srcDirectory, INTERNAL_EDGE_FUNCTIONS_SRC: internalSrcDirectory, IS_LOCAL: isRunningLocally, }, debug, systemLog, featureFlags, logs, netlifyConfig, }) {
13
- const { edge_functions: configDeclarations = [] } = netlifyConfig;
12
+ const { edge_functions: declarations = [] } = netlifyConfig;
14
13
  const distPath = resolve(buildDir, distDirectory);
15
14
  const internalSrcPath = resolve(buildDir, internalSrcDirectory);
16
15
  const distImportMapPath = join(dirname(internalSrcPath), IMPORT_MAP_FILENAME);
17
16
  const srcPath = srcDirectory ? resolve(buildDir, srcDirectory) : undefined;
18
17
  const sourcePaths = [internalSrcPath, srcPath].filter(Boolean);
19
18
  logFunctions({ internalSrcDirectory, internalSrcPath, logs, srcDirectory, srcPath });
20
- const { declarations: internalDeclarations, importMap, layers } = await parseManifest(internalSrcPath, systemLog);
21
- const declarations = [...configDeclarations, ...internalDeclarations];
22
19
  // If we're running in buildbot and the feature flag is enabled, we set the
23
20
  // Deno cache dir to a directory that is persisted between builds.
24
21
  const cacheDirectory = !isRunningLocally && featureFlags.edge_functions_cache_cli ? resolve(buildDir, DENO_CLI_CACHE_DIRECTORY) : undefined;
@@ -28,11 +25,10 @@ const coreStep = async function ({ buildDir, constants: { EDGE_FUNCTIONS_DIST: d
28
25
  const { manifest } = await bundle(sourcePaths, distPath, declarations, {
29
26
  basePath: buildDir,
30
27
  cacheDirectory,
28
+ configPath: join(internalSrcPath, 'manifest.json'),
31
29
  debug,
32
30
  distImportMapPath,
33
31
  featureFlags,
34
- importMaps: [importMap].filter(Boolean),
35
- layers,
36
32
  systemLogger: featureFlags.edge_functions_system_logger ? systemLog : undefined,
37
33
  });
38
34
  systemLog('Edge Functions manifest:', manifest);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "28.4.4",
3
+ "version": "28.4.5",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/core/main.js",
@@ -66,12 +66,12 @@
66
66
  "@bugsnag/js": "^7.0.0",
67
67
  "@netlify/cache-utils": "^5.0.2",
68
68
  "@netlify/config": "^20.0.2",
69
- "@netlify/edge-bundler": "4.4.3",
70
- "@netlify/functions-utils": "^5.0.4",
69
+ "@netlify/edge-bundler": "5.0.0",
70
+ "@netlify/functions-utils": "^5.0.5",
71
71
  "@netlify/git-utils": "^5.0.2",
72
72
  "@netlify/plugins-list": "^6.54.0",
73
73
  "@netlify/run-utils": "^5.0.2",
74
- "@netlify/zip-it-and-ship-it": "^7.1.2",
74
+ "@netlify/zip-it-and-ship-it": "^7.1.3",
75
75
  "@sindresorhus/slugify": "^2.0.0",
76
76
  "ansi-escapes": "^5.0.0",
77
77
  "chalk": "^5.0.0",
@@ -149,5 +149,5 @@
149
149
  "module": "commonjs"
150
150
  }
151
151
  },
152
- "gitHead": "53a1a1a513008e58b3b720a0bf6f8166ef9a1b00"
152
+ "gitHead": "c7e107e79b77f3037ca6d10aceadfa208af5ace8"
153
153
  }
@@ -1,52 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import { dirname, join, resolve } from 'path';
3
- import { pathToFileURL } from 'url';
4
- const parseManifest = async (internalSourceDirectory, systemLog) => {
5
- const manifestPath = join(internalSourceDirectory, 'manifest.json');
6
- try {
7
- const data = await fs.readFile(manifestPath);
8
- const manifest = JSON.parse(data);
9
- if (manifest.version !== 1) {
10
- throw new Error('Unsupported manifest version');
11
- }
12
- const result = {
13
- declarations: manifest.functions,
14
- layers: manifest.layers,
15
- };
16
- if (manifest.import_map) {
17
- const importMapPath = resolve(dirname(manifestPath), manifest.import_map);
18
- const importMap = await readImportMap(importMapPath);
19
- return {
20
- ...result,
21
- importMap: {
22
- baseURL: pathToFileURL(importMapPath),
23
- ...importMap,
24
- },
25
- };
26
- }
27
- return result;
28
- }
29
- catch (error) {
30
- if (error.code !== 'ENOENT') {
31
- systemLog('Error while parsing internal edge functions manifest:', error);
32
- }
33
- }
34
- return {
35
- declarations: [],
36
- layers: [],
37
- };
38
- };
39
- const readImportMap = async (path) => {
40
- try {
41
- const data = await fs.readFile(path);
42
- const importMap = JSON.parse(data);
43
- return importMap;
44
- }
45
- catch {
46
- // no-op
47
- }
48
- return {
49
- imports: {},
50
- };
51
- };
52
- export { parseManifest };