@netlify/build 29.12.1 → 29.12.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/bin.js +2 -2
- package/lib/env/changes.js +3 -3
- package/lib/env/main.js +2 -2
- package/lib/env/metadata.js +2 -2
- package/lib/plugins/child/load.js +3 -3
- package/lib/utils/omit.js +2 -2
- package/lib/utils/remove_falsy.js +3 -3
- package/package.json +12 -12
package/lib/core/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from 'process';
|
|
3
|
-
import
|
|
3
|
+
import { includeKeys } from 'filter-obj';
|
|
4
4
|
import yargs from 'yargs';
|
|
5
5
|
import { hideBin } from 'yargs/helpers';
|
|
6
6
|
import { normalizeCliFeatureFlags } from './feature_flags.js';
|
|
@@ -14,7 +14,7 @@ import { FALLBACK_SEVERITY_ENTRY } from './severity.js';
|
|
|
14
14
|
// sense only in CLI, such as CLI flags parsing and exit code.
|
|
15
15
|
const runCli = async function () {
|
|
16
16
|
const flags = parseFlags();
|
|
17
|
-
const flagsA =
|
|
17
|
+
const flagsA = includeKeys(flags, isUserFlag);
|
|
18
18
|
const state = { done: false };
|
|
19
19
|
process.on('exit', onExit.bind(undefined, state));
|
|
20
20
|
const { severityCode, logs } = await build(flagsA);
|
package/lib/env/changes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { env } from 'process';
|
|
2
|
-
import
|
|
2
|
+
import { includeKeys } from 'filter-obj';
|
|
3
3
|
import mapObj from 'map-obj';
|
|
4
4
|
// If plugins modify `process.env`, this is propagated in other plugins and in
|
|
5
5
|
// `build.command`. Since those are different processes, we figure out when they
|
|
@@ -10,8 +10,8 @@ export const getNewEnvChanges = function (envBefore, netlifyConfig, netlifyConfi
|
|
|
10
10
|
return { ...processEnvChanges, ...netlifyConfigEnvChanges };
|
|
11
11
|
};
|
|
12
12
|
const diffEnv = function (envBefore, envAfter) {
|
|
13
|
-
const envChanges =
|
|
14
|
-
const deletedEnv =
|
|
13
|
+
const envChanges = includeKeys(envAfter, (name, value) => value !== envBefore[name]);
|
|
14
|
+
const deletedEnv = includeKeys(envBefore, (name) => envAfter[name] === undefined);
|
|
15
15
|
const deletedEnvA = mapObj(deletedEnv, setToNull);
|
|
16
16
|
return { ...envChanges, ...deletedEnvA };
|
|
17
17
|
};
|
package/lib/env/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { env } from 'process';
|
|
2
|
-
import
|
|
2
|
+
import { includeKeys } from 'filter-obj';
|
|
3
3
|
import { getParentColorEnv } from '../log/colors.js';
|
|
4
4
|
// Retrieve the environment variables passed to plugins and `build.command`
|
|
5
5
|
// When run locally, this tries to emulate the production environment.
|
|
6
6
|
export const getChildEnv = function ({ envOpt, env: allConfigEnv }) {
|
|
7
7
|
const parentColorEnv = getParentColorEnv();
|
|
8
8
|
const parentEnv = { ...env, ...allConfigEnv, ...envOpt, ...parentColorEnv };
|
|
9
|
-
return
|
|
9
|
+
return includeKeys(parentEnv, shouldKeepEnv);
|
|
10
10
|
};
|
|
11
11
|
const shouldKeepEnv = function (key) {
|
|
12
12
|
return !REMOVED_PARENT_ENV.has(key.toLowerCase());
|
package/lib/env/metadata.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { env } from 'process';
|
|
2
|
-
import
|
|
2
|
+
import { includeKeys } from 'filter-obj';
|
|
3
3
|
// Retrieve environment variables used in error monitoring
|
|
4
4
|
export const getEnvMetadata = function (childEnv = env) {
|
|
5
|
-
return
|
|
5
|
+
return includeKeys(childEnv, isEnvMetadata);
|
|
6
6
|
};
|
|
7
7
|
const isEnvMetadata = function (name) {
|
|
8
8
|
return ENVIRONMENT_VARIABLES.has(name);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { includeKeys } from 'filter-obj';
|
|
2
2
|
import { getLogic } from './logic.js';
|
|
3
3
|
import { registerTypeScript } from './typescript.js';
|
|
4
4
|
import { validatePlugin } from './validate.js';
|
|
@@ -11,12 +11,12 @@ export const load = async function ({ pluginPath, inputs, packageJson, verbose }
|
|
|
11
11
|
const tsNodeService = registerTypeScript(pluginPath);
|
|
12
12
|
const logic = await getLogic({ pluginPath, inputs, tsNodeService });
|
|
13
13
|
validatePlugin(logic);
|
|
14
|
-
const methods =
|
|
14
|
+
const methods = includeKeys(logic, isEventHandler);
|
|
15
15
|
const events = Object.keys(methods);
|
|
16
16
|
// Context passed to every event handler
|
|
17
17
|
const context = { methods, inputs, packageJson, verbose };
|
|
18
18
|
return { events, context };
|
|
19
19
|
};
|
|
20
|
-
const isEventHandler = function (
|
|
20
|
+
const isEventHandler = function (_event, value) {
|
|
21
21
|
return typeof value === 'function';
|
|
22
22
|
};
|
package/lib/utils/omit.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { excludeKeys } from 'filter-obj';
|
|
2
2
|
// lodash.omit is 1400 lines of codes. filter-obj is much smaller and simpler.
|
|
3
|
-
export const omit = (obj, keys) =>
|
|
3
|
+
export const omit = (obj, keys) => excludeKeys(obj, (key) => keys.includes(key));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { includeKeys } from 'filter-obj';
|
|
2
2
|
// Remove falsy values from object
|
|
3
3
|
export const removeFalsy = function (obj) {
|
|
4
|
-
return
|
|
4
|
+
return includeKeys(obj, isDefined);
|
|
5
5
|
};
|
|
6
|
-
const isDefined = function (
|
|
6
|
+
const isDefined = function (_key, value) {
|
|
7
7
|
return value !== undefined && value !== '';
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "29.12.
|
|
3
|
+
"version": "29.12.3",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/core/main.js",
|
|
@@ -65,23 +65,23 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@bugsnag/js": "^7.0.0",
|
|
67
67
|
"@netlify/cache-utils": "^5.1.5",
|
|
68
|
-
"@netlify/config": "^20.4.
|
|
69
|
-
"@netlify/edge-bundler": "8.16.
|
|
70
|
-
"@netlify/framework-info": "^9.8.
|
|
71
|
-
"@netlify/functions-utils": "^5.2.
|
|
68
|
+
"@netlify/config": "^20.4.6",
|
|
69
|
+
"@netlify/edge-bundler": "8.16.2",
|
|
70
|
+
"@netlify/framework-info": "^9.8.10",
|
|
71
|
+
"@netlify/functions-utils": "^5.2.11",
|
|
72
72
|
"@netlify/git-utils": "^5.1.1",
|
|
73
73
|
"@netlify/plugins-list": "^6.68.0",
|
|
74
74
|
"@netlify/run-utils": "^5.1.1",
|
|
75
|
-
"@netlify/zip-it-and-ship-it": "9.8.
|
|
75
|
+
"@netlify/zip-it-and-ship-it": "9.8.1",
|
|
76
76
|
"@sindresorhus/slugify": "^2.0.0",
|
|
77
77
|
"ansi-escapes": "^6.0.0",
|
|
78
78
|
"chalk": "^5.0.0",
|
|
79
79
|
"clean-stack": "^4.0.0",
|
|
80
80
|
"execa": "^6.0.0",
|
|
81
|
-
"figures": "^
|
|
82
|
-
"filter-obj": "^
|
|
81
|
+
"figures": "^5.0.0",
|
|
82
|
+
"filter-obj": "^5.0.0",
|
|
83
83
|
"got": "^12.0.0",
|
|
84
|
-
"hot-shots": "
|
|
84
|
+
"hot-shots": "10.0.0",
|
|
85
85
|
"indent-string": "^5.0.0",
|
|
86
86
|
"is-plain-obj": "^4.0.0",
|
|
87
87
|
"js-yaml": "^4.0.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"p-reduce": "^3.0.0",
|
|
99
99
|
"path-exists": "^5.0.0",
|
|
100
100
|
"path-type": "^5.0.0",
|
|
101
|
-
"pkg-dir": "^
|
|
101
|
+
"pkg-dir": "^7.0.0",
|
|
102
102
|
"pretty-ms": "^8.0.0",
|
|
103
103
|
"ps-list": "^8.0.0",
|
|
104
104
|
"read-pkg-up": "^9.0.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"tmp-promise": "^3.0.2",
|
|
115
115
|
"ts-node": "^10.9.1",
|
|
116
116
|
"typescript": "^5.0.0",
|
|
117
|
-
"uuid": "^
|
|
117
|
+
"uuid": "^9.0.0",
|
|
118
118
|
"yargs": "^17.6.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
@@ -146,5 +146,5 @@
|
|
|
146
146
|
"module": "commonjs"
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
|
-
"gitHead": "
|
|
149
|
+
"gitHead": "2f5a0d4c921ca8f8ae7e559410908f538ffb3d72"
|
|
150
150
|
}
|