@netlify/build 35.0.2 → 35.0.3
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/core/config.js +1 -2
- package/lib/core/constants.d.ts +1 -16
- package/lib/core/constants.js +2 -3
- package/lib/env/changes.d.ts +1 -3
- package/lib/env/changes.js +2 -3
- package/lib/error/api.d.ts +1 -1
- package/lib/error/api.js +2 -3
- package/lib/plugins/child/run.d.ts +1 -3
- package/lib/plugins/child/status.js +2 -3
- package/lib/plugins_core/frameworks_api/util.js +8 -4
- package/lib/plugins_core/functions/zisi.js +2 -3
- package/package.json +5 -6
package/lib/core/config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { resolveConfig, restoreConfig, updateConfig } from '@netlify/config';
|
|
2
|
-
import mapObj from 'map-obj';
|
|
3
2
|
import { getChildEnv } from '../env/main.js';
|
|
4
3
|
import { addApiErrorHandlers } from '../error/api.js';
|
|
5
4
|
import { changeErrorType } from '../error/info.js';
|
|
@@ -45,7 +44,7 @@ const tLoadConfig = async function ({ configOpts, cachedConfig, defaultConfig, c
|
|
|
45
44
|
logConfigInfo({ logs, configPath, buildDir, netlifyConfig, context: contextA, debug });
|
|
46
45
|
}
|
|
47
46
|
const apiA = addApiErrorHandlers(api);
|
|
48
|
-
const envValues =
|
|
47
|
+
const envValues = Object.fromEntries(Object.entries(env).map(([key, { value }]) => [key, value]));
|
|
49
48
|
const childEnv = getChildEnv({ envOpt, env: envValues });
|
|
50
49
|
const [{ packageJson }, userNodeVersion] = await Promise.all([getPackageJson(buildDir), getUserNodeVersion(nodePath)]);
|
|
51
50
|
return {
|
package/lib/core/constants.d.ts
CHANGED
|
@@ -102,20 +102,5 @@ export declare const addMutableConstants: ({ constants, buildDir, netlifyConfig:
|
|
|
102
102
|
functionsDirectory: any;
|
|
103
103
|
};
|
|
104
104
|
}) => Promise<{
|
|
105
|
-
|
|
106
|
-
EDGE_FUNCTIONS_SRC: string | undefined;
|
|
107
|
-
CONFIG_PATH: string | undefined;
|
|
108
|
-
PUBLISH_DIR: string | undefined;
|
|
109
|
-
FUNCTIONS_DIST: string | undefined;
|
|
110
|
-
INTERNAL_EDGE_FUNCTIONS_SRC: string | undefined;
|
|
111
|
-
INTERNAL_FUNCTIONS_SRC: string | undefined;
|
|
112
|
-
EDGE_FUNCTIONS_DIST: string | undefined;
|
|
113
|
-
CACHE_DIR: string | undefined;
|
|
114
|
-
PACKAGE_PATH: string | undefined;
|
|
115
|
-
IS_LOCAL: string | undefined;
|
|
116
|
-
NETLIFY_BUILD_VERSION: string | undefined;
|
|
117
|
-
SITE_ID: string | undefined;
|
|
118
|
-
ACCOUNT_ID: string | undefined;
|
|
119
|
-
NETLIFY_API_TOKEN: string | undefined;
|
|
120
|
-
NETLIFY_API_HOST: string | undefined;
|
|
105
|
+
[k: string]: string | boolean | undefined;
|
|
121
106
|
}>;
|
package/lib/core/constants.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { relative, normalize, join } from 'path';
|
|
2
2
|
import { getCacheDir } from '@netlify/cache-utils';
|
|
3
|
-
import mapObj from 'map-obj';
|
|
4
3
|
import { pathExists } from 'path-exists';
|
|
5
4
|
import { ROOT_PACKAGE_JSON } from '../utils/json.js';
|
|
6
5
|
/**
|
|
@@ -91,13 +90,13 @@ const addDefaultConstant = async function ({ constants, constantName, defaultPat
|
|
|
91
90
|
return { [constantName]: defaultPath };
|
|
92
91
|
};
|
|
93
92
|
const normalizeConstantsPaths = function (constants, buildDir) {
|
|
94
|
-
return
|
|
93
|
+
return Object.fromEntries(Object.entries(constants).map(([key, path]) => [key, normalizePath(path, buildDir, key)]));
|
|
95
94
|
};
|
|
96
95
|
// The current directory is `buildDir`. Most constants are inside this `buildDir`.
|
|
97
96
|
// Instead of passing absolute paths, we pass paths relative to `buildDir`, so
|
|
98
97
|
// that logs are less verbose.
|
|
99
98
|
const normalizePath = function (path, buildDir, key) {
|
|
100
|
-
if (path
|
|
99
|
+
if (typeof path !== 'string' || path === '' || !CONSTANT_PATHS.has(key)) {
|
|
101
100
|
return path;
|
|
102
101
|
}
|
|
103
102
|
const pathA = normalize(path);
|
package/lib/env/changes.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export function getNewEnvChanges(envBefore: any, netlifyConfig: any, netlifyConfigCopy: any):
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
};
|
|
1
|
+
export function getNewEnvChanges(envBefore: any, netlifyConfig: any, netlifyConfigCopy: any): any;
|
|
4
2
|
export function setEnvChanges(envChanges: any, currentEnv?: NodeJS.ProcessEnv): {
|
|
5
3
|
[key: string]: string | undefined;
|
|
6
4
|
TZ?: string;
|
package/lib/env/changes.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { env } from 'process';
|
|
2
2
|
import { includeKeys } from 'filter-obj';
|
|
3
|
-
import mapObj from 'map-obj';
|
|
4
3
|
// If plugins modify `process.env`, this is propagated in other plugins and in
|
|
5
4
|
// `build.command`. Since those are different processes, we figure out when they
|
|
6
5
|
// do this and communicate the new `process.env` to other processes.
|
|
@@ -12,14 +11,14 @@ export const getNewEnvChanges = function (envBefore, netlifyConfig, netlifyConfi
|
|
|
12
11
|
const diffEnv = function (envBefore, envAfter) {
|
|
13
12
|
const envChanges = includeKeys(envAfter, (name, value) => value !== envBefore[name]);
|
|
14
13
|
const deletedEnv = includeKeys(envBefore, (name) => envAfter[name] === undefined);
|
|
15
|
-
const deletedEnvA =
|
|
14
|
+
const deletedEnvA = Object.fromEntries(Object.entries(deletedEnv).map(setToNull));
|
|
16
15
|
return { ...envChanges, ...deletedEnvA };
|
|
17
16
|
};
|
|
18
17
|
// `undefined` is not JSON-serializable (which is used in process IPC), so we
|
|
19
18
|
// convert it to `null`
|
|
20
19
|
// Note: `process.env[name] = undefined` actually does
|
|
21
20
|
// `process.env[name] = 'undefined'` in Node.js.
|
|
22
|
-
const setToNull = function (name) {
|
|
21
|
+
const setToNull = function ([name]) {
|
|
23
22
|
return [name, null];
|
|
24
23
|
};
|
|
25
24
|
// Set `process.env` changes from a previous different plugin.
|
package/lib/error/api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function addApiErrorHandlers(api: any):
|
|
1
|
+
export function addApiErrorHandlers(api: any): any;
|
package/lib/error/api.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import isPlainObj from 'is-plain-obj';
|
|
2
|
-
import mapObj from 'map-obj';
|
|
3
2
|
import { addErrorInfo } from './info.js';
|
|
4
3
|
// Wrap `api.*` methods so that they add more error information
|
|
5
4
|
export const addApiErrorHandlers = function (api) {
|
|
6
5
|
if (api === undefined) {
|
|
7
6
|
return;
|
|
8
7
|
}
|
|
9
|
-
return
|
|
8
|
+
return Object.fromEntries(Object.entries(api).map(addErrorHandler));
|
|
10
9
|
};
|
|
11
|
-
const addErrorHandler = function (key, value) {
|
|
10
|
+
const addErrorHandler = function ([key, value]) {
|
|
12
11
|
if (typeof value !== 'function') {
|
|
13
12
|
return [key, value];
|
|
14
13
|
}
|
|
@@ -13,9 +13,7 @@ export function run({ event, error, constants, envChanges, featureFlags, netlify
|
|
|
13
13
|
packageJson: any;
|
|
14
14
|
verbose: any;
|
|
15
15
|
}): Promise<{
|
|
16
|
-
newEnvChanges:
|
|
17
|
-
[x: string]: any;
|
|
18
|
-
};
|
|
16
|
+
newEnvChanges: any;
|
|
19
17
|
configMutations: any;
|
|
20
18
|
returnValue: {
|
|
21
19
|
generatedFunctions: any[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import isPlainObj from 'is-plain-obj';
|
|
2
|
-
import mapObj from 'map-obj';
|
|
3
2
|
import { addErrorInfo } from '../../error/info.js';
|
|
4
3
|
// Report status information to the UI
|
|
5
4
|
export const show = function (runState, showArgs) {
|
|
@@ -53,9 +52,9 @@ const validateShowArgsExtraData = function (extraData) {
|
|
|
53
52
|
}
|
|
54
53
|
};
|
|
55
54
|
const removeEmptyStrings = function (showArgs) {
|
|
56
|
-
return
|
|
55
|
+
return Object.fromEntries(Object.entries(showArgs).map(removeEmptyString));
|
|
57
56
|
};
|
|
58
|
-
const removeEmptyString = function (key, value) {
|
|
57
|
+
const removeEmptyString = function ([key, value]) {
|
|
59
58
|
if (typeof value === 'string' && value.trim() === '') {
|
|
60
59
|
return [key];
|
|
61
60
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
3
|
import isPlainObject from 'is-plain-obj';
|
|
4
|
-
import mapObject, { mapObjectSkip } from 'map-obj';
|
|
5
4
|
import { FRAMEWORKS_API_CONFIG_ENDPOINT } from '../../utils/frameworks_api.js';
|
|
6
5
|
export const loadConfigFile = async (buildDir, packagePath) => {
|
|
7
6
|
const configPath = resolve(buildDir, packagePath ?? '', FRAMEWORKS_API_CONFIG_ENDPOINT);
|
|
@@ -48,15 +47,20 @@ export const isAllowedProperty = (property, allowedProperties) => allowedPropert
|
|
|
48
47
|
* recursively, so `allowedProperties` can contain the full list of properties
|
|
49
48
|
* that the Deploy Configuration API can interact with.
|
|
50
49
|
*/
|
|
51
|
-
export const filterConfig = (obj, path, allowedProperties, systemLog) =>
|
|
50
|
+
export const filterConfig = (obj, path, allowedProperties, systemLog) => Object.fromEntries(Object.entries(obj)
|
|
51
|
+
.filter(([key]) => {
|
|
52
52
|
const keyPath = [...path, key];
|
|
53
53
|
if (!isAllowedProperty(keyPath, allowedProperties)) {
|
|
54
54
|
systemLog(`Discarding property that is not supported by the Deploy Configuration API: ${keyPath.join('.')}`);
|
|
55
|
-
return
|
|
55
|
+
return false;
|
|
56
56
|
}
|
|
57
|
+
return true;
|
|
58
|
+
})
|
|
59
|
+
.map(([key, value]) => {
|
|
60
|
+
const keyPath = [...path, key];
|
|
57
61
|
if (!isPlainObject(value)) {
|
|
58
62
|
systemLog(`Loading property from Deploy Configuration API: ${keyPath.join('.')}`);
|
|
59
63
|
return [key, value];
|
|
60
64
|
}
|
|
61
65
|
return [key, filterConfig(value, keyPath, allowedProperties, systemLog)];
|
|
62
|
-
});
|
|
66
|
+
}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { join, resolve } from 'path';
|
|
2
|
-
import mapObject from 'map-obj';
|
|
3
2
|
import semver from 'semver';
|
|
4
3
|
import { getZisiFeatureFlags } from './feature_flags.js';
|
|
5
4
|
const getLambdaNodeVersion = (childEnv, userNodeVersion) => {
|
|
@@ -20,10 +19,10 @@ const getLambdaNodeVersion = (childEnv, userNodeVersion) => {
|
|
|
20
19
|
export const getZisiParameters = ({ branch, buildDir, childEnv, featureFlags, functionsConfig, functionsDist, internalFunctionsSrc, isRunningLocally, repositoryRoot, userNodeVersion, systemLog, }) => {
|
|
21
20
|
const nodeVersion = getLambdaNodeVersion(childEnv, userNodeVersion);
|
|
22
21
|
const manifest = join(functionsDist, 'manifest.json');
|
|
23
|
-
const config =
|
|
22
|
+
const config = Object.fromEntries(Object.entries(functionsConfig).map(([expression, object]) => [
|
|
24
23
|
expression,
|
|
25
24
|
normalizeFunctionConfig({ buildDir, functionConfig: object, isRunningLocally, nodeVersion }),
|
|
26
|
-
]);
|
|
25
|
+
]));
|
|
27
26
|
const zisiFeatureFlags = getZisiFeatureFlags(featureFlags);
|
|
28
27
|
// Only the legacy internal functions directory is allowed to have a JSON
|
|
29
28
|
// config file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "35.0.
|
|
3
|
+
"version": "35.0.3",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"@netlify/blobs": "^10.0.7",
|
|
71
71
|
"@netlify/cache-utils": "^6.0.3",
|
|
72
72
|
"@netlify/config": "^24.0.1",
|
|
73
|
-
"@netlify/edge-bundler": "14.4.
|
|
74
|
-
"@netlify/functions-utils": "^6.2.
|
|
73
|
+
"@netlify/edge-bundler": "14.4.1",
|
|
74
|
+
"@netlify/functions-utils": "^6.2.1",
|
|
75
75
|
"@netlify/git-utils": "^6.0.2",
|
|
76
76
|
"@netlify/opentelemetry-utils": "^2.0.1",
|
|
77
77
|
"@netlify/plugins-list": "^6.80.0",
|
|
78
78
|
"@netlify/run-utils": "^6.0.2",
|
|
79
|
-
"@netlify/zip-it-and-ship-it": "14.1.
|
|
79
|
+
"@netlify/zip-it-and-ship-it": "14.1.1",
|
|
80
80
|
"@sindresorhus/slugify": "^2.0.0",
|
|
81
81
|
"ansi-escapes": "^7.0.0",
|
|
82
82
|
"ansis": "^4.1.0",
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"is-plain-obj": "^4.0.0",
|
|
91
91
|
"keep-func-props": "^6.0.0",
|
|
92
92
|
"log-process-errors": "^11.0.0",
|
|
93
|
-
"map-obj": "^5.0.0",
|
|
94
93
|
"memoize-one": "^6.0.0",
|
|
95
94
|
"minimatch": "^9.0.4",
|
|
96
95
|
"os-name": "^6.0.0",
|
|
@@ -152,5 +151,5 @@
|
|
|
152
151
|
"engines": {
|
|
153
152
|
"node": ">=18.14.0"
|
|
154
153
|
},
|
|
155
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "2b427686f1d4cfc2d28b79d4ce18ad691f270d2e"
|
|
156
155
|
}
|