@netlify/build 29.49.1 → 29.50.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/lib/plugins_core/edge_functions/index.js +1 -1
- package/lib/plugins_core/functions/index.js +1 -1
- package/lib/plugins_core/pre_cleanup/index.js +5 -5
- package/lib/steps/get.js +1 -1
- package/lib/utils/blobs.js +3 -5
- package/lib/utils/frameworks_api.d.ts +1 -0
- package/lib/utils/frameworks_api.js +5 -4
- package/package.json +4 -4
- /package/lib/plugins_core/{deploy_config → frameworks_api}/index.d.ts +0 -0
- /package/lib/plugins_core/{deploy_config → frameworks_api}/index.js +0 -0
- /package/lib/plugins_core/{deploy_config → frameworks_api}/util.d.ts +0 -0
- /package/lib/plugins_core/{deploy_config → frameworks_api}/util.js +0 -0
|
@@ -22,7 +22,7 @@ const coreStep = async function ({ buildDir, packagePath, constants: { EDGE_FUNC
|
|
|
22
22
|
const generatedFunctionPaths = [internalSrcPath];
|
|
23
23
|
if (featureFlags.netlify_build_frameworks_api) {
|
|
24
24
|
if (await pathExists(frameworksAPISrcPath)) {
|
|
25
|
-
generatedFunctionPaths.
|
|
25
|
+
generatedFunctionPaths.push(frameworksAPISrcPath);
|
|
26
26
|
}
|
|
27
27
|
const frameworkImportMap = resolve(buildDir, packagePath || '', FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT, FRAMEWORKS_API_EDGE_FUNCTIONS_IMPORT_MAP);
|
|
28
28
|
if (await pathExists(frameworkImportMap)) {
|
|
@@ -62,7 +62,7 @@ const zipFunctionsAndLogResults = async ({ buildDir, childEnv, featureFlags, fun
|
|
|
62
62
|
try {
|
|
63
63
|
// Printing an empty line before bundling output.
|
|
64
64
|
log(logs, '');
|
|
65
|
-
const sourceDirectories = [
|
|
65
|
+
const sourceDirectories = [internalFunctionsSrc, frameworkFunctionsSrc, functionsSrc].filter(Boolean);
|
|
66
66
|
const results = await zipItAndShipIt.zipFunctions(sourceDirectories, functionsDist, zisiParameters);
|
|
67
67
|
validateCustomRoutes(results);
|
|
68
68
|
const bundlers = Array.from(getBundlers(results));
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { rm } from 'node:fs/promises';
|
|
2
|
-
import {
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { getBlobsDirs } from '../../utils/blobs.js';
|
|
4
|
+
import { FRAMEWORKS_API_ENDPOINT } from '../../utils/frameworks_api.js';
|
|
3
5
|
const coreStep = async ({ buildDir, packagePath }) => {
|
|
4
|
-
const
|
|
6
|
+
const dirs = [...getBlobsDirs(buildDir, packagePath), resolve(buildDir, packagePath || '', FRAMEWORKS_API_ENDPOINT)];
|
|
5
7
|
try {
|
|
6
|
-
await Promise.all(
|
|
8
|
+
await Promise.all(dirs.map((dir) => rm(dir, { recursive: true, force: true })));
|
|
7
9
|
}
|
|
8
10
|
catch {
|
|
9
11
|
// Ignore errors if it fails, we can continue anyway.
|
|
10
12
|
}
|
|
11
13
|
return {};
|
|
12
14
|
};
|
|
13
|
-
const blobsPresent = async ({ buildDir, packagePath }) => Boolean(await scanForBlobs(buildDir, packagePath));
|
|
14
15
|
export const preCleanup = {
|
|
15
16
|
event: 'onPreBuild',
|
|
16
17
|
coreStep,
|
|
17
18
|
coreStepId: 'pre_cleanup',
|
|
18
19
|
coreStepName: 'Pre cleanup',
|
|
19
20
|
coreStepDescription: () => 'Cleaning up leftover files from previous builds',
|
|
20
|
-
condition: blobsPresent,
|
|
21
21
|
quiet: true,
|
|
22
22
|
};
|
package/lib/steps/get.js
CHANGED
|
@@ -3,9 +3,9 @@ import { DEV_EVENTS, EVENTS } from '../plugins/events.js';
|
|
|
3
3
|
import { uploadBlobs } from '../plugins_core/blobs_upload/index.js';
|
|
4
4
|
import { buildCommandCore } from '../plugins_core/build_command.js';
|
|
5
5
|
import { deploySite } from '../plugins_core/deploy/index.js';
|
|
6
|
-
import { applyDeployConfig } from '../plugins_core/deploy_config/index.js';
|
|
7
6
|
import { devUploadBlobs } from '../plugins_core/dev_blobs_upload/index.js';
|
|
8
7
|
import { bundleEdgeFunctions } from '../plugins_core/edge_functions/index.js';
|
|
8
|
+
import { applyDeployConfig } from '../plugins_core/frameworks_api/index.js';
|
|
9
9
|
import { bundleFunctions } from '../plugins_core/functions/index.js';
|
|
10
10
|
import { preCleanup } from '../plugins_core/pre_cleanup/index.js';
|
|
11
11
|
import { preDevCleanup } from '../plugins_core/pre_dev_cleanup/index.js';
|
package/lib/utils/blobs.js
CHANGED
|
@@ -75,24 +75,22 @@ const METADATA_SUFFIX = '.json';
|
|
|
75
75
|
* path to its metadata file.
|
|
76
76
|
*/
|
|
77
77
|
export const getKeysToUpload = async (blobsDir) => {
|
|
78
|
-
const blobsToUpload = [];
|
|
79
78
|
const files = await new fdir()
|
|
80
79
|
.withRelativePaths() // we want the relative path from the blobsDir
|
|
81
80
|
.filter((fpath) => !path.basename(fpath).startsWith(METADATA_PREFIX))
|
|
82
81
|
.crawl(blobsDir)
|
|
83
82
|
.withPromise();
|
|
84
|
-
files.
|
|
83
|
+
return files.map((filePath) => {
|
|
85
84
|
const key = filePath.split(path.sep).join('/');
|
|
86
85
|
const contentPath = path.resolve(blobsDir, filePath);
|
|
87
86
|
const basename = path.basename(filePath);
|
|
88
87
|
const metadataPath = path.resolve(blobsDir, path.dirname(filePath), `${METADATA_PREFIX}${basename}${METADATA_SUFFIX}`);
|
|
89
|
-
|
|
88
|
+
return {
|
|
90
89
|
key,
|
|
91
90
|
contentPath,
|
|
92
91
|
metadataPath,
|
|
93
|
-
}
|
|
92
|
+
};
|
|
94
93
|
});
|
|
95
|
-
return blobsToUpload;
|
|
96
94
|
};
|
|
97
95
|
/** Read a file and its metadata file from the blobs directory */
|
|
98
96
|
export const getFileWithMetadata = async (key, contentPath, metadataPath) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const FRAMEWORKS_API_ENDPOINT = ".netlify/v1";
|
|
1
2
|
export declare const FRAMEWORKS_API_BLOBS_ENDPOINT = ".netlify/v1/blobs";
|
|
2
3
|
export declare const FRAMEWORKS_API_CONFIG_ENDPOINT = ".netlify/v1/config.json";
|
|
3
4
|
export declare const FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT = ".netlify/v1/edge-functions";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { basename, dirname, resolve, sep } from 'node:path';
|
|
2
2
|
import { fdir } from 'fdir';
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
3
|
+
export const FRAMEWORKS_API_ENDPOINT = '.netlify/v1';
|
|
4
|
+
export const FRAMEWORKS_API_BLOBS_ENDPOINT = `${FRAMEWORKS_API_ENDPOINT}/blobs`;
|
|
5
|
+
export const FRAMEWORKS_API_CONFIG_ENDPOINT = `${FRAMEWORKS_API_ENDPOINT}/config.json`;
|
|
6
|
+
export const FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT = `${FRAMEWORKS_API_ENDPOINT}/edge-functions`;
|
|
6
7
|
export const FRAMEWORKS_API_EDGE_FUNCTIONS_IMPORT_MAP = 'import_map.json';
|
|
7
|
-
export const FRAMEWORKS_API_FUNCTIONS_ENDPOINT =
|
|
8
|
+
export const FRAMEWORKS_API_FUNCTIONS_ENDPOINT = `${FRAMEWORKS_API_ENDPOINT}/functions`;
|
|
8
9
|
/**
|
|
9
10
|
* Traverses a directory tree in search of leaf files. The key of each leaf
|
|
10
11
|
* file is determined by its path relative to the base directory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.50.0",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"@netlify/config": "^20.15.4",
|
|
74
74
|
"@netlify/edge-bundler": "12.1.1",
|
|
75
75
|
"@netlify/framework-info": "^9.8.13",
|
|
76
|
-
"@netlify/functions-utils": "^5.2.
|
|
76
|
+
"@netlify/functions-utils": "^5.2.70",
|
|
77
77
|
"@netlify/git-utils": "^5.1.1",
|
|
78
78
|
"@netlify/opentelemetry-utils": "^1.2.1",
|
|
79
79
|
"@netlify/plugins-list": "^6.80.0",
|
|
80
80
|
"@netlify/run-utils": "^5.1.1",
|
|
81
|
-
"@netlify/zip-it-and-ship-it": "9.37.
|
|
81
|
+
"@netlify/zip-it-and-ship-it": "9.37.2",
|
|
82
82
|
"@sindresorhus/slugify": "^2.0.0",
|
|
83
83
|
"ansi-escapes": "^6.0.0",
|
|
84
84
|
"chalk": "^5.0.0",
|
|
@@ -165,5 +165,5 @@
|
|
|
165
165
|
"engines": {
|
|
166
166
|
"node": "^14.16.0 || >=16.0.0"
|
|
167
167
|
},
|
|
168
|
-
"gitHead": "
|
|
168
|
+
"gitHead": "73b6616a85923ed3c436747b5d69353400236a71"
|
|
169
169
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|