@netlify/build 26.0.0 → 26.1.1
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 +4 -5
- package/src/core/feature_flags.js +0 -1
- package/src/error/handle.js +1 -1
- package/src/error/monitor/report.js +1 -1
- package/src/error/parse/clean_stack.js +1 -1
- package/src/install/missing.js +4 -9
- package/src/log/logger.js +1 -1
- package/src/log/messages/core_steps.js +1 -1
- package/src/log/messages/mutations.js +5 -7
- package/src/log/serialize.js +1 -1
- package/src/log/stream.js +1 -1
- package/src/plugins/compatibility.js +1 -1
- package/src/plugins/manifest/load.js +2 -5
- package/src/plugins_core/functions/index.js +2 -2
- package/src/utils/json.js +1 -1
- package/src/utils/package.js +1 -1
- package/src/utils/resolve.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.1.1",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/core/main.js",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"@netlify/config": "^17.0.0",
|
|
61
61
|
"@netlify/functions-utils": "^4.0.0",
|
|
62
62
|
"@netlify/git-utils": "^4.0.0",
|
|
63
|
-
"@netlify/plugin-edge-handlers": "^3.0.
|
|
64
|
-
"@netlify/plugins-list": "^6.2.
|
|
63
|
+
"@netlify/plugin-edge-handlers": "^3.0.2",
|
|
64
|
+
"@netlify/plugins-list": "^6.2.1",
|
|
65
65
|
"@netlify/run-utils": "^4.0.0",
|
|
66
|
-
"@netlify/zip-it-and-ship-it": "^5.
|
|
66
|
+
"@netlify/zip-it-and-ship-it": "^5.4.0",
|
|
67
67
|
"@sindresorhus/slugify": "^1.1.0",
|
|
68
68
|
"ansi-escapes": "^4.3.2",
|
|
69
69
|
"chalk": "^4.1.2",
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"keep-func-props": "^3.0.0",
|
|
79
79
|
"locate-path": "^6.0.0",
|
|
80
80
|
"log-process-errors": "^6.0.0",
|
|
81
|
-
"make-dir": "^3.0.2",
|
|
82
81
|
"map-obj": "^4.0.0",
|
|
83
82
|
"memoize-one": "^6.0.0",
|
|
84
83
|
"os-name": "^4.0.1",
|
package/src/error/handle.js
CHANGED
|
@@ -102,7 +102,7 @@ const reportError = async function ({ errorMonitor, error, logs, testOpts, event
|
|
|
102
102
|
try {
|
|
103
103
|
await promisify(errorMonitor.notify)(error, (event) => onError(event, eventProps))
|
|
104
104
|
// Failsafe
|
|
105
|
-
} catch
|
|
105
|
+
} catch {
|
|
106
106
|
log(logs, `Error monitor could not notify\n${error.stack}`)
|
|
107
107
|
}
|
|
108
108
|
}
|
package/src/install/missing.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { promises as fs } from 'fs'
|
|
2
2
|
import { normalize } from 'path'
|
|
3
|
-
import { promisify } from 'util'
|
|
4
3
|
|
|
5
|
-
import makeDir from 'make-dir'
|
|
6
4
|
import pathExists from 'path-exists'
|
|
7
5
|
import { isFile } from 'path-type'
|
|
8
6
|
|
|
@@ -10,9 +8,6 @@ import { logInstallMissingPlugins } from '../log/messages/install.js'
|
|
|
10
8
|
|
|
11
9
|
import { addExactDependencies } from './main.js'
|
|
12
10
|
|
|
13
|
-
const pWriteFile = promisify(writeFile)
|
|
14
|
-
const pUnlink = promisify(unlink)
|
|
15
|
-
|
|
16
11
|
// Automatically install plugins if not already installed.
|
|
17
12
|
// Since this is done under the hood, we always use `npm` with specific `npm`
|
|
18
13
|
// options. We do not allow configure the package manager nor its options.
|
|
@@ -45,10 +40,10 @@ const ensureDir = async function (logs, autoPluginsDir) {
|
|
|
45
40
|
// If `.netlify` exists but is not a directory, we remove it first
|
|
46
41
|
const autoPluginsParent = normalize(`${autoPluginsDir}/..`)
|
|
47
42
|
if (await isFile(autoPluginsParent)) {
|
|
48
|
-
await
|
|
43
|
+
await fs.unlink(autoPluginsParent)
|
|
49
44
|
}
|
|
50
45
|
|
|
51
|
-
await
|
|
46
|
+
await fs.mkdir(autoPluginsDir, { recursive: true })
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
// Create a dummy `package.json` so we can run `npm install` and get a lock file
|
|
@@ -59,7 +54,7 @@ const createPackageJson = async function (autoPluginsDir) {
|
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
const packageJsonContent = JSON.stringify(AUTO_PLUGINS_PACKAGE_JSON, null, 2)
|
|
62
|
-
await
|
|
57
|
+
await fs.writeFile(packageJsonPath, packageJsonContent)
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
const AUTO_PLUGINS_PACKAGE_JSON = {
|
package/src/log/logger.js
CHANGED
|
@@ -45,7 +45,7 @@ const serializeIndentedArray = function (array) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const serializeIndentedItem = function (item) {
|
|
48
|
-
return indentString(item, INDENT_SIZE + 1).
|
|
48
|
+
return indentString(item, INDENT_SIZE + 1).trimStart()
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export const logError = function (logs, string, opts) {
|
|
@@ -21,7 +21,7 @@ export const logBundleResults = ({ logs, results = [] }) => {
|
|
|
21
21
|
({ bundler, bundlerWarnings }) => bundler === 'esbuild' && bundlerWarnings && bundlerWarnings.length !== 0,
|
|
22
22
|
)
|
|
23
23
|
const modulesWithDynamicImports = [
|
|
24
|
-
...new Set(results.
|
|
24
|
+
...new Set(results.flatMap((result) => result.nodeModulesWithDynamicImports || [])),
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
if (resultsWithErrors.length !== 0) {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { inspect
|
|
1
|
+
import { promises as fs } from 'fs'
|
|
2
|
+
import { inspect } from 'util'
|
|
3
3
|
|
|
4
4
|
import pathExists from 'path-exists'
|
|
5
5
|
|
|
6
6
|
import { log, logMessage, logSubHeader } from '../logger.js'
|
|
7
7
|
|
|
8
|
-
const pReadFile = promisify(readFile)
|
|
9
|
-
|
|
10
8
|
export const logConfigMutations = function (logs, newConfigMutations, debug) {
|
|
11
9
|
const configMutationsToLog = debug ? newConfigMutations : newConfigMutations.filter(shouldLogConfigMutation)
|
|
12
10
|
configMutationsToLog.forEach(({ keysString, value }) => {
|
|
@@ -47,7 +45,7 @@ export const logConfigOnUpload = async function ({ logs, configPath, debug }) {
|
|
|
47
45
|
return
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
const configContents = await
|
|
48
|
+
const configContents = await fs.readFile(configPath, 'utf8')
|
|
51
49
|
logMessage(logs, configContents.trim())
|
|
52
50
|
}
|
|
53
51
|
|
|
@@ -63,7 +61,7 @@ export const logHeadersOnUpload = async function ({ logs, headersPath, debug })
|
|
|
63
61
|
return
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
const headersContents = await
|
|
64
|
+
const headersContents = await fs.readFile(headersPath, 'utf8')
|
|
67
65
|
logMessage(logs, headersContents.trim())
|
|
68
66
|
}
|
|
69
67
|
|
|
@@ -79,6 +77,6 @@ export const logRedirectsOnUpload = async function ({ logs, redirectsPath, debug
|
|
|
79
77
|
return
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
const redirectsContents = await
|
|
80
|
+
const redirectsContents = await fs.readFile(redirectsPath, 'utf8')
|
|
83
81
|
logMessage(logs, `${redirectsContents.trim()}\n`)
|
|
84
82
|
}
|
package/src/log/serialize.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dump } from 'js-yaml'
|
|
2
2
|
|
|
3
3
|
export const serializeObject = function (object) {
|
|
4
|
-
return dump(object, { noRefs: true, sortKeys: true, lineWidth: Number.POSITIVE_INFINITY }).
|
|
4
|
+
return dump(object, { noRefs: true, sortKeys: true, lineWidth: Number.POSITIVE_INFINITY }).trimEnd()
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const serializeArray = function (array) {
|
package/src/log/stream.js
CHANGED
|
@@ -76,7 +76,7 @@ const pushOutputToLogs = function (childProcess, logs) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
const logsListener = function (logs, chunk) {
|
|
79
|
-
logs.push(chunk.toString().
|
|
79
|
+
logs.push(chunk.toString().trimEnd())
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const unpushOutputToLogs = function (childProcess, logs, { stdoutListener, stderrListener }) {
|
|
@@ -109,7 +109,7 @@ const siteDependencyTest = async function ({ dependencyName, allowedVersion, sit
|
|
|
109
109
|
const packageJsonPath = await resolvePath(`${dependencyName}/package.json`, buildDir)
|
|
110
110
|
const { version } = await importJsonFile(packageJsonPath)
|
|
111
111
|
return semver.satisfies(version, allowedVersion)
|
|
112
|
-
} catch
|
|
112
|
+
} catch {
|
|
113
113
|
return false
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'util'
|
|
1
|
+
import { promises as fs } from 'fs'
|
|
3
2
|
|
|
4
3
|
import { load as loadYaml, JSON_SCHEMA } from 'js-yaml'
|
|
5
4
|
|
|
@@ -7,8 +6,6 @@ import { addErrorInfo } from '../../error/info.js'
|
|
|
7
6
|
|
|
8
7
|
import { validateManifest } from './validate.js'
|
|
9
8
|
|
|
10
|
-
const pReadFile = promisify(readFile)
|
|
11
|
-
|
|
12
9
|
// Load "manifest.yml" using its file path
|
|
13
10
|
export const loadManifest = async function ({ manifestPath, packageName, pluginPackageJson, loadedFrom, origin }) {
|
|
14
11
|
try {
|
|
@@ -28,7 +25,7 @@ export const loadManifest = async function ({ manifestPath, packageName, pluginP
|
|
|
28
25
|
|
|
29
26
|
const loadRawManifest = async function (manifestPath) {
|
|
30
27
|
try {
|
|
31
|
-
return await
|
|
28
|
+
return await fs.readFile(manifestPath, 'utf8')
|
|
32
29
|
} catch (error) {
|
|
33
30
|
error.message = `Could not load plugin's "manifest.yml"\n${error.message}`
|
|
34
31
|
throw error
|
|
@@ -19,7 +19,7 @@ const isUsingEsbuild = (functionsConfig = {}) =>
|
|
|
19
19
|
// The function configuration keys returned by @netlify/config are not an exact
|
|
20
20
|
// match to the properties that @netlify/zip-it-and-ship-it expects. We do that
|
|
21
21
|
// translation here.
|
|
22
|
-
const normalizeFunctionConfig = ({ buildDir,
|
|
22
|
+
const normalizeFunctionConfig = ({ buildDir, functionConfig = {}, isRunningLocally }) => ({
|
|
23
23
|
externalNodeModules: functionConfig.external_node_modules,
|
|
24
24
|
includedFiles: functionConfig.included_files,
|
|
25
25
|
includedFilesBasePath: buildDir,
|
|
@@ -37,7 +37,7 @@ const normalizeFunctionConfig = ({ buildDir, featureFlags, functionConfig = {},
|
|
|
37
37
|
// build process.
|
|
38
38
|
rustTargetDirectory: isRunningLocally ? undefined : resolve(buildDir, '.netlify', 'rust-functions-cache', '[name]'),
|
|
39
39
|
|
|
40
|
-
schedule:
|
|
40
|
+
schedule: functionConfig.schedule,
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
const getZisiParameters = ({
|
package/src/utils/json.js
CHANGED
|
@@ -6,7 +6,7 @@ const ROOT_PACKAGE_JSON_PATH = fileURLToPath(new URL('../../package.json', impor
|
|
|
6
6
|
// TODO: Replace with dynamic `import()` once it is supported without
|
|
7
7
|
// experimental flags
|
|
8
8
|
export const importJsonFile = async function (filePath) {
|
|
9
|
-
const fileContents = await fs.readFile(filePath
|
|
9
|
+
const fileContents = await fs.readFile(filePath)
|
|
10
10
|
return JSON.parse(fileContents)
|
|
11
11
|
}
|
|
12
12
|
|
package/src/utils/package.js
CHANGED
|
@@ -19,5 +19,5 @@ const getPackageObj = async function ({ cwd, normalize = true }) {
|
|
|
19
19
|
return await readPkgUp({ cwd, normalize })
|
|
20
20
|
// If the `package.json` is invalid and `normalize` is `true`, an error is
|
|
21
21
|
// thrown. We return `undefined` then.
|
|
22
|
-
} catch
|
|
22
|
+
} catch {}
|
|
23
23
|
}
|
package/src/utils/resolve.js
CHANGED
|
@@ -23,7 +23,7 @@ export const resolvePath = async function (path, basedir) {
|
|
|
23
23
|
// Fallback.
|
|
24
24
|
// `resolve` sometimes gives unhelpful error messages.
|
|
25
25
|
// https://github.com/browserify/resolve/issues/223
|
|
26
|
-
} catch
|
|
26
|
+
} catch {
|
|
27
27
|
return require.resolve(path, { paths: [basedir] })
|
|
28
28
|
}
|
|
29
29
|
}
|