@netlify/build 28.4.0 → 28.4.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.
|
@@ -2,7 +2,12 @@ import { env, execPath } from 'process';
|
|
|
2
2
|
import { logFlags } from '../log/messages/config.js';
|
|
3
3
|
import { removeFalsy } from '../utils/remove_falsy.js';
|
|
4
4
|
import { DEFAULT_FEATURE_FLAGS } from './feature_flags.js';
|
|
5
|
-
|
|
5
|
+
const REQUIRE_MODE = 'require';
|
|
6
|
+
const DEFAULT_EDGE_FUNCTIONS_DIST = '.netlify/edge-functions-dist/';
|
|
7
|
+
const DEFAULT_FUNCTIONS_DIST = '.netlify/functions/';
|
|
8
|
+
const DEFAULT_CACHE_DIR = '.netlify/cache/';
|
|
9
|
+
const DEFAULT_STATSD_PORT = 8125;
|
|
10
|
+
/** Normalize CLI flags */
|
|
6
11
|
export const normalizeFlags = function (flags, logs) {
|
|
7
12
|
const rawFlags = removeFalsy(flags);
|
|
8
13
|
// Combine the flags object env with the process.env
|
|
@@ -52,8 +57,3 @@ const getDefaultFlags = function ({ env: envOpt = {} }, combinedEnv) {
|
|
|
52
57
|
const computeTelemetry = function (flags, envOpts) {
|
|
53
58
|
return envOpts.BUILD_TELEMETRY_DISABLED ? { telemetry: false } : { telemetry: flags.telemetry };
|
|
54
59
|
};
|
|
55
|
-
const REQUIRE_MODE = 'require';
|
|
56
|
-
const DEFAULT_EDGE_FUNCTIONS_DIST = '.netlify/edge-functions-dist/';
|
|
57
|
-
const DEFAULT_FUNCTIONS_DIST = '.netlify/functions/';
|
|
58
|
-
const DEFAULT_CACHE_DIR = '.netlify/cache/';
|
|
59
|
-
const DEFAULT_STATSD_PORT = 8125;
|
package/lib/log/logger.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createWriteStream } from 'fs';
|
|
|
2
2
|
import figures from 'figures';
|
|
3
3
|
import indentString from 'indent-string';
|
|
4
4
|
import { getHeader } from './header.js';
|
|
5
|
-
import {
|
|
5
|
+
import { serializeArray, serializeObject } from './serialize.js';
|
|
6
6
|
import { THEME } from './theme.js';
|
|
7
7
|
const INDENT_SIZE = 2;
|
|
8
8
|
/**
|
|
@@ -132,7 +132,7 @@ systemLogFile) {
|
|
|
132
132
|
}
|
|
133
133
|
// Return a function that writes to the file descriptor configured for system
|
|
134
134
|
// logs.
|
|
135
|
-
const fileDescriptor = createWriteStream(
|
|
135
|
+
const fileDescriptor = createWriteStream('', { fd: systemLogFile });
|
|
136
136
|
fileDescriptor.on('error', () => {
|
|
137
137
|
logError(logs, 'Could not write to system log file');
|
|
138
138
|
});
|
package/lib/plugins/options.js
CHANGED
|
@@ -54,10 +54,15 @@ const isNotRedundantCorePlugin = function (pluginOptionsA, index, pluginsOptions
|
|
|
54
54
|
* Retrieve information about @netlify/build when an error happens there and not
|
|
55
55
|
* in a plugin
|
|
56
56
|
*/
|
|
57
|
-
export const getSpawnInfo = () =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
export const getSpawnInfo = () => {
|
|
58
|
+
// we know that this package.json has a name as it's ours
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
60
|
+
const packageName = ROOT_PACKAGE_JSON.name;
|
|
61
|
+
return {
|
|
62
|
+
plugin: { packageName, pluginPackageJson: ROOT_PACKAGE_JSON },
|
|
63
|
+
location: { event: 'load', packageName, loadedFrom: 'core', origin: 'core' },
|
|
64
|
+
};
|
|
65
|
+
};
|
|
61
66
|
const throwUserError = function (message) {
|
|
62
67
|
const error = new Error(message);
|
|
63
68
|
addErrorInfo(error, { type: 'resolveConfig' });
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import { startBuild } from '../core/build.js';
|
|
1
2
|
import { getConfigOpts, loadConfig } from '../core/config.js';
|
|
2
3
|
import { getConstants } from '../core/constants.js';
|
|
3
|
-
import { normalizeFlags } from '../core/normalize_flags.js';
|
|
4
4
|
import { getSeverity } from '../core/severity.js';
|
|
5
5
|
import { handleBuildError } from '../error/handle.js';
|
|
6
6
|
import { getErrorInfo } from '../error/info.js';
|
|
7
|
-
import {
|
|
8
|
-
import { getBufferLogs, getSystemLogger } from '../log/logger.js';
|
|
9
|
-
import { logBuildStart } from '../log/messages/core.js';
|
|
7
|
+
import { getSystemLogger } from '../log/logger.js';
|
|
10
8
|
import { reportStatuses } from '../status/report.js';
|
|
11
9
|
import { getSteps } from './get.js';
|
|
12
10
|
import { runSteps } from './run_steps.js';
|
|
@@ -37,13 +35,6 @@ export const runCoreSteps = async (buildSteps, flags = {}) => {
|
|
|
37
35
|
return { success, severityCode, logs };
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
|
-
const startBuild = function (flags) {
|
|
41
|
-
const logs = getBufferLogs(flags);
|
|
42
|
-
logBuildStart(logs);
|
|
43
|
-
const { bugsnagKey, ...flagsA } = normalizeFlags(flags, logs);
|
|
44
|
-
const errorMonitor = startErrorMonitor({ flags: flagsA, logs, bugsnagKey });
|
|
45
|
-
return { ...flagsA, errorMonitor, logs };
|
|
46
|
-
};
|
|
47
38
|
const getBuildSteps = function (buildSteps) {
|
|
48
39
|
const allSteps = getSteps([]).steps.filter(({ coreStepId }) => buildSteps.includes(coreStepId));
|
|
49
40
|
return allSteps;
|
package/lib/utils/package.js
CHANGED
|
@@ -8,12 +8,14 @@ export const getPackageJson = async function (cwd, options = {}) {
|
|
|
8
8
|
packageJson: {},
|
|
9
9
|
};
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
11
|
+
const readResult = await readPackageUp({
|
|
12
12
|
cwd,
|
|
13
13
|
...Object.assign({ normalize: true }, options),
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
if (readResult) {
|
|
16
|
+
result.packageJson = readResult.packageJson;
|
|
17
|
+
result.packageDir = dirname(readResult.path);
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
catch {
|
|
19
21
|
// continue regardless error
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "28.4.
|
|
3
|
+
"version": "28.4.2",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/core/main.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
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.
|
|
69
|
+
"@netlify/edge-bundler": "4.4.2",
|
|
70
70
|
"@netlify/functions-utils": "^5.0.4",
|
|
71
71
|
"@netlify/git-utils": "^5.0.2",
|
|
72
72
|
"@netlify/plugins-list": "^6.54.0",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"module": "commonjs"
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "ee3a0dc207e5508cc61a8da525cbaa65810cb859"
|
|
153
153
|
}
|