@netlify/build 26.2.5 → 26.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.0",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/core/main.js",
|
|
@@ -61,37 +61,37 @@
|
|
|
61
61
|
"@netlify/functions-utils": "^4.0.0",
|
|
62
62
|
"@netlify/git-utils": "^4.0.0",
|
|
63
63
|
"@netlify/plugin-edge-handlers": "^3.0.6",
|
|
64
|
-
"@netlify/plugins-list": "^6.
|
|
64
|
+
"@netlify/plugins-list": "^6.10.1",
|
|
65
65
|
"@netlify/run-utils": "^4.0.0",
|
|
66
|
-
"@netlify/zip-it-and-ship-it": "5.7.
|
|
67
|
-
"@sindresorhus/slugify": "^
|
|
66
|
+
"@netlify/zip-it-and-ship-it": "5.7.4",
|
|
67
|
+
"@sindresorhus/slugify": "^2.0.0",
|
|
68
68
|
"@types/node": "^16.0.0",
|
|
69
|
-
"ansi-escapes": "^
|
|
69
|
+
"ansi-escapes": "^5.0.0",
|
|
70
70
|
"chalk": "^5.0.0",
|
|
71
|
-
"clean-stack": "^
|
|
71
|
+
"clean-stack": "^4.0.0",
|
|
72
72
|
"execa": "^6.0.0",
|
|
73
|
-
"figures": "^
|
|
73
|
+
"figures": "^4.0.0",
|
|
74
74
|
"filter-obj": "^3.0.0",
|
|
75
75
|
"got": "^10.0.0",
|
|
76
|
-
"indent-string": "^
|
|
76
|
+
"indent-string": "^5.0.0",
|
|
77
77
|
"is-plain-obj": "^4.0.0",
|
|
78
78
|
"js-yaml": "^4.0.0",
|
|
79
|
-
"keep-func-props": "^
|
|
79
|
+
"keep-func-props": "^4.0.0",
|
|
80
80
|
"locate-path": "^7.0.0",
|
|
81
|
-
"log-process-errors": "^
|
|
81
|
+
"log-process-errors": "^7.0.0",
|
|
82
82
|
"map-obj": "^5.0.0",
|
|
83
83
|
"memoize-one": "^6.0.0",
|
|
84
|
-
"os-name": "^
|
|
85
|
-
"p-event": "^
|
|
84
|
+
"os-name": "^5.0.0",
|
|
85
|
+
"p-event": "^5.0.0",
|
|
86
86
|
"p-every": "^2.0.0",
|
|
87
87
|
"p-filter": "^3.0.0",
|
|
88
88
|
"p-locate": "^6.0.0",
|
|
89
|
-
"p-reduce": "^
|
|
89
|
+
"p-reduce": "^3.0.0",
|
|
90
90
|
"path-exists": "^5.0.0",
|
|
91
|
-
"path-type": "^
|
|
92
|
-
"pkg-dir": "^
|
|
91
|
+
"path-type": "^5.0.0",
|
|
92
|
+
"pkg-dir": "^6.0.0",
|
|
93
93
|
"pretty-ms": "^7.0.0",
|
|
94
|
-
"ps-list": "^
|
|
94
|
+
"ps-list": "^8.0.0",
|
|
95
95
|
"read-pkg-up": "^9.0.0",
|
|
96
96
|
"readdirp": "^3.4.0",
|
|
97
97
|
"resolve": "^2.0.0-next.1",
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
"safe-json-stringify": "^1.2.0",
|
|
100
100
|
"semver": "^7.0.0",
|
|
101
101
|
"statsd-client": "0.4.7",
|
|
102
|
-
"string-width": "^
|
|
102
|
+
"string-width": "^5.0.0",
|
|
103
103
|
"strip-ansi": "^7.0.0",
|
|
104
|
-
"supports-color": "^
|
|
104
|
+
"supports-color": "^9.0.0",
|
|
105
105
|
"tmp-promise": "^3.0.2",
|
|
106
106
|
"ts-node": "10.4.0",
|
|
107
107
|
"typescript": "^4.5.4",
|
|
@@ -117,14 +117,14 @@
|
|
|
117
117
|
"del": "^6.0.0",
|
|
118
118
|
"fast-safe-stringify": "^2.0.7",
|
|
119
119
|
"get-bin-path": "^6.0.0",
|
|
120
|
-
"get-node": "^
|
|
121
|
-
"get-port": "^
|
|
120
|
+
"get-node": "^12.0.0",
|
|
121
|
+
"get-port": "^6.0.0",
|
|
122
122
|
"get-stream": "^6.0.0",
|
|
123
|
-
"has-ansi": "^
|
|
123
|
+
"has-ansi": "^5.0.0",
|
|
124
124
|
"is-ci": "^3.0.0",
|
|
125
125
|
"moize": "^6.0.0",
|
|
126
|
-
"path-key": "^
|
|
127
|
-
"process-exists": "^
|
|
126
|
+
"path-key": "^4.0.0",
|
|
127
|
+
"process-exists": "^5.0.0",
|
|
128
128
|
"sinon": "^13.0.0",
|
|
129
129
|
"yarn": "^1.22.4"
|
|
130
130
|
},
|
package/src/install/local.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { packageDirectory } from 'pkg-dir'
|
|
2
2
|
|
|
3
3
|
import { logInstallLocalPluginsDeps } from '../log/messages/install.js'
|
|
4
4
|
|
|
@@ -57,6 +57,6 @@ const hasPackageDir = function ({ packageDir }) {
|
|
|
57
57
|
|
|
58
58
|
// We only install dependencies of local plugins that have their own `package.json`
|
|
59
59
|
const removeMainRoot = async function (localPluginsOptions, buildDir) {
|
|
60
|
-
const mainPackageDir = await
|
|
60
|
+
const mainPackageDir = await packageDirectory({ cwd: buildDir })
|
|
61
61
|
return localPluginsOptions.filter(({ packageDir }) => packageDir !== mainPackageDir)
|
|
62
62
|
}
|
package/src/plugins/ipc.js
CHANGED
|
@@ -2,7 +2,7 @@ import net from 'net'
|
|
|
2
2
|
import { normalize, resolve, relative } from 'path'
|
|
3
3
|
import { promisify } from 'util'
|
|
4
4
|
|
|
5
|
-
import pEvent from 'p-event'
|
|
5
|
+
import { pEvent } from 'p-event'
|
|
6
6
|
|
|
7
7
|
import { addErrorInfo } from '../../error/info.js'
|
|
8
8
|
import { runsAfterDeploy } from '../../plugins/events.js'
|
|
@@ -1,69 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolve } from 'path'
|
|
2
2
|
|
|
3
3
|
import { zipFunctions } from '@netlify/zip-it-and-ship-it'
|
|
4
|
-
import mapObject from 'map-obj'
|
|
5
4
|
import { pathExists } from 'path-exists'
|
|
6
5
|
|
|
7
6
|
import { log } from '../../log/logger.js'
|
|
8
7
|
import { logBundleResults, logFunctionsNonExistingDir, logFunctionsToBundle } from '../../log/messages/core_steps.js'
|
|
9
8
|
|
|
10
9
|
import { getZipError } from './error.js'
|
|
11
|
-
import { getZisiFeatureFlags } from './feature_flags.js'
|
|
12
10
|
import { getUserAndInternalFunctions, validateFunctionsSrc } from './utils.js'
|
|
11
|
+
import { getZisiParameters } from './zisi.js'
|
|
13
12
|
|
|
14
13
|
// Returns `true` if at least one of the functions has been configured to use
|
|
15
14
|
// esbuild.
|
|
16
15
|
const isUsingEsbuild = (functionsConfig = {}) =>
|
|
17
16
|
Object.values(functionsConfig).some((configObject) => configObject.node_bundler === 'esbuild')
|
|
18
17
|
|
|
19
|
-
// The function configuration keys returned by @netlify/config are not an exact
|
|
20
|
-
// match to the properties that @netlify/zip-it-and-ship-it expects. We do that
|
|
21
|
-
// translation here.
|
|
22
|
-
const normalizeFunctionConfig = ({ buildDir, functionConfig = {}, isRunningLocally }) => ({
|
|
23
|
-
externalNodeModules: functionConfig.external_node_modules,
|
|
24
|
-
includedFiles: functionConfig.included_files,
|
|
25
|
-
includedFilesBasePath: buildDir,
|
|
26
|
-
ignoredNodeModules: functionConfig.ignored_node_modules,
|
|
27
|
-
schedule: functionConfig.schedule,
|
|
28
|
-
|
|
29
|
-
// When the user selects esbuild as the Node bundler, we still want to use
|
|
30
|
-
// the legacy ZISI bundler as a fallback. Rather than asking the user to
|
|
31
|
-
// make this decision, we abstract that complexity away by injecting the
|
|
32
|
-
// fallback behavior ourselves. We do this by transforming the value
|
|
33
|
-
// `esbuild` into `esbuild_zisi`, which zip-it-and-ship-it understands.
|
|
34
|
-
nodeBundler: functionConfig.node_bundler === 'esbuild' ? 'esbuild_zisi' : functionConfig.node_bundler,
|
|
35
|
-
|
|
36
|
-
// If the build is running in buildbot, we set the Rust target directory to a
|
|
37
|
-
// path that will get cached in between builds, allowing us to speed up the
|
|
38
|
-
// build process.
|
|
39
|
-
rustTargetDirectory: isRunningLocally ? undefined : resolve(buildDir, '.netlify', 'rust-functions-cache', '[name]'),
|
|
40
|
-
|
|
41
|
-
// Go functions should be zipped only when building locally. When running in
|
|
42
|
-
// buildbot, the Go API client will handle the zipping.
|
|
43
|
-
zipGo: isRunningLocally ? true : undefined,
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const getZisiParameters = ({
|
|
47
|
-
buildDir,
|
|
48
|
-
featureFlags,
|
|
49
|
-
functionsConfig,
|
|
50
|
-
functionsDist,
|
|
51
|
-
isRunningLocally,
|
|
52
|
-
repositoryRoot,
|
|
53
|
-
}) => {
|
|
54
|
-
const isManifestEnabled = isRunningLocally || featureFlags.buildbot_create_functions_manifest === true
|
|
55
|
-
const manifest = isManifestEnabled ? join(functionsDist, 'manifest.json') : undefined
|
|
56
|
-
const config = mapObject(functionsConfig, (expression, object) => [
|
|
57
|
-
expression,
|
|
58
|
-
normalizeFunctionConfig({ buildDir, featureFlags, functionConfig: object, isRunningLocally }),
|
|
59
|
-
])
|
|
60
|
-
const zisiFeatureFlags = getZisiFeatureFlags(featureFlags)
|
|
61
|
-
|
|
62
|
-
return { basePath: buildDir, config, manifest, featureFlags: zisiFeatureFlags, repositoryRoot }
|
|
63
|
-
}
|
|
64
|
-
|
|
65
18
|
const zipFunctionsAndLogResults = async ({
|
|
66
19
|
buildDir,
|
|
20
|
+
childEnv,
|
|
67
21
|
featureFlags,
|
|
68
22
|
functionsConfig,
|
|
69
23
|
functionsDist,
|
|
@@ -75,6 +29,7 @@ const zipFunctionsAndLogResults = async ({
|
|
|
75
29
|
}) => {
|
|
76
30
|
const zisiParameters = getZisiParameters({
|
|
77
31
|
buildDir,
|
|
32
|
+
childEnv,
|
|
78
33
|
featureFlags,
|
|
79
34
|
functionsConfig,
|
|
80
35
|
functionsDist,
|
|
@@ -101,6 +56,7 @@ const zipFunctionsAndLogResults = async ({
|
|
|
101
56
|
// Plugin to package Netlify functions with @netlify/zip-it-and-ship-it
|
|
102
57
|
// eslint-disable-next-line complexity
|
|
103
58
|
const coreStep = async function ({
|
|
59
|
+
childEnv,
|
|
104
60
|
constants: {
|
|
105
61
|
INTERNAL_FUNCTIONS_SRC: relativeInternalFunctionsSrc,
|
|
106
62
|
IS_LOCAL: isRunningLocally,
|
|
@@ -149,6 +105,7 @@ const coreStep = async function ({
|
|
|
149
105
|
|
|
150
106
|
const { bundler } = await zipFunctionsAndLogResults({
|
|
151
107
|
buildDir,
|
|
108
|
+
childEnv,
|
|
152
109
|
featureFlags,
|
|
153
110
|
functionsConfig: netlifyConfig.functions,
|
|
154
111
|
functionsDist,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { join, resolve } from 'path'
|
|
2
|
+
|
|
3
|
+
import mapObject from 'map-obj'
|
|
4
|
+
|
|
5
|
+
import { getZisiFeatureFlags } from './feature_flags.js'
|
|
6
|
+
|
|
7
|
+
export const getZisiParameters = ({
|
|
8
|
+
buildDir,
|
|
9
|
+
childEnv,
|
|
10
|
+
featureFlags,
|
|
11
|
+
functionsConfig,
|
|
12
|
+
functionsDist,
|
|
13
|
+
isRunningLocally,
|
|
14
|
+
repositoryRoot,
|
|
15
|
+
}) => {
|
|
16
|
+
const nodeVersion = childEnv.AWS_LAMBDA_JS_RUNTIME
|
|
17
|
+
const isManifestEnabled = isRunningLocally || featureFlags.buildbot_create_functions_manifest === true
|
|
18
|
+
const manifest = isManifestEnabled ? join(functionsDist, 'manifest.json') : undefined
|
|
19
|
+
const config = mapObject(functionsConfig, (expression, object) => [
|
|
20
|
+
expression,
|
|
21
|
+
normalizeFunctionConfig({ buildDir, featureFlags, functionConfig: object, isRunningLocally, nodeVersion }),
|
|
22
|
+
])
|
|
23
|
+
const zisiFeatureFlags = getZisiFeatureFlags(featureFlags)
|
|
24
|
+
|
|
25
|
+
return { basePath: buildDir, config, manifest, featureFlags: zisiFeatureFlags, repositoryRoot }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// The function configuration keys returned by @netlify/config are not an exact
|
|
29
|
+
// match to the properties that @netlify/zip-it-and-ship-it expects. We do that
|
|
30
|
+
// translation here.
|
|
31
|
+
export const normalizeFunctionConfig = ({ buildDir, functionConfig = {}, isRunningLocally, nodeVersion }) => ({
|
|
32
|
+
externalNodeModules: functionConfig.external_node_modules,
|
|
33
|
+
includedFiles: functionConfig.included_files,
|
|
34
|
+
includedFilesBasePath: buildDir,
|
|
35
|
+
ignoredNodeModules: functionConfig.ignored_node_modules,
|
|
36
|
+
nodeVersion,
|
|
37
|
+
schedule: functionConfig.schedule,
|
|
38
|
+
|
|
39
|
+
// When the user selects esbuild as the Node bundler, we still want to use
|
|
40
|
+
// the legacy ZISI bundler as a fallback. Rather than asking the user to
|
|
41
|
+
// make this decision, we abstract that complexity away by injecting the
|
|
42
|
+
// fallback behavior ourselves. We do this by transforming the value
|
|
43
|
+
// `esbuild` into `esbuild_zisi`, which zip-it-and-ship-it understands.
|
|
44
|
+
nodeBundler: functionConfig.node_bundler === 'esbuild' ? 'esbuild_zisi' : functionConfig.node_bundler,
|
|
45
|
+
|
|
46
|
+
// If the build is running in buildbot, we set the Rust target directory to a
|
|
47
|
+
// path that will get cached in between builds, allowing us to speed up the
|
|
48
|
+
// build process.
|
|
49
|
+
rustTargetDirectory: isRunningLocally ? undefined : resolve(buildDir, '.netlify', 'rust-functions-cache', '[name]'),
|
|
50
|
+
|
|
51
|
+
// Go functions should be zipped only when building locally. When running in
|
|
52
|
+
// buildbot, the Go API client will handle the zipping.
|
|
53
|
+
zipGo: isRunningLocally ? true : undefined,
|
|
54
|
+
})
|