@netlify/build 27.11.4 → 27.12.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": "27.11.4",
3
+ "version": "27.12.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./src/core/main.js",
@@ -59,11 +59,11 @@
59
59
  "@netlify/edge-bundler": "^1.12.1",
60
60
  "@netlify/cache-utils": "^4.0.0",
61
61
  "@netlify/config": "^18.1.4",
62
- "@netlify/functions-utils": "^4.2.3",
62
+ "@netlify/functions-utils": "^4.2.4",
63
63
  "@netlify/git-utils": "^4.0.0",
64
64
  "@netlify/plugins-list": "^6.36.0",
65
65
  "@netlify/run-utils": "^4.0.0",
66
- "@netlify/zip-it-and-ship-it": "5.13.4",
66
+ "@netlify/zip-it-and-ship-it": "^5.13.5",
67
67
  "@sindresorhus/slugify": "^2.0.0",
68
68
  "@types/node": "^16.0.0",
69
69
  "ajv": "^8.11.0",
@@ -5,9 +5,20 @@ import { getPluginOrigin } from '../description.js'
5
5
  import { logArray, logSubHeader, logWarningArray, logWarningSubHeader } from '../logger.js'
6
6
  import { THEME } from '../theme.js'
7
7
 
8
+ export const logRuntime = (logs, pluginOptions) => {
9
+ const runtimes = pluginOptions.filter(isRuntime)
10
+
11
+ // Once we have more runtimes, this hardcoded check should be removed
12
+ if (runtimes.length > 1) {
13
+ logSubHeader(logs, 'Using Next.js Runtime')
14
+ }
15
+ }
16
+
8
17
  export const logLoadingPlugins = function (logs, pluginsOptions, debug) {
9
18
  const loadingPlugins = pluginsOptions
10
19
  .filter(isNotCorePlugin)
20
+ // We don't want to show runtimes as plugins
21
+ .filter((plugin) => !isRuntime(plugin))
11
22
  .map((pluginOptions) => getPluginDescription(pluginOptions, debug))
12
23
 
13
24
  if (loadingPlugins.length === 0) {
@@ -23,6 +34,11 @@ const isNotCorePlugin = function ({ origin }) {
23
34
  return origin !== 'core'
24
35
  }
25
36
 
37
+ const isRuntime = function ({ packageName }) {
38
+ // Make this a bit more robust in the future
39
+ return ['@netlify/next-runtime'].includes(packageName)
40
+ }
41
+
26
42
  const getPluginDescription = function (
27
43
  {
28
44
  packageName,
@@ -3,7 +3,12 @@ import { fileURLToPath } from 'url'
3
3
  import { execaNode } from 'execa'
4
4
 
5
5
  import { addErrorInfo } from '../error/info.js'
6
- import { logLoadingPlugins, logOutdatedPlugins, logIncompatiblePlugins } from '../log/messages/compatibility.js'
6
+ import {
7
+ logRuntime,
8
+ logLoadingPlugins,
9
+ logOutdatedPlugins,
10
+ logIncompatiblePlugins,
11
+ } from '../log/messages/compatibility.js'
7
12
  import { measureDuration } from '../time/main.js'
8
13
 
9
14
  import { getEventFromChild } from './ipc.js'
@@ -18,6 +23,7 @@ const CHILD_MAIN_FILE = fileURLToPath(new URL('child/main.js', import.meta.url))
18
23
  // - logs can be buffered which allows manipulating them for log shipping,
19
24
  // transforming and parallel plugins
20
25
  const tStartPlugins = async function ({ pluginsOptions, buildDir, childEnv, logs, debug }) {
26
+ logRuntime(logs, pluginsOptions)
21
27
  logLoadingPlugins(logs, pluginsOptions, debug)
22
28
  logOutdatedPlugins(logs, pluginsOptions)
23
29
  logIncompatiblePlugins(logs, pluginsOptions)
@@ -84,7 +84,18 @@ const getDeployDir = function ({ buildDir, repositoryRoot, constants: { PUBLISH_
84
84
 
85
85
  // We distinguish between user errors and system errors during deploys
86
86
  const handleDeployError = function (error, errorType) {
87
- const errorA = new Error(`Deploy did not succeed: ${error}`)
87
+ const errorIs422 = error !== undefined && error.code === '422'
88
+
89
+ const errMsg = errorIs422
90
+ ? `
91
+ File upload failed because of mismatched SHAs.
92
+ This can happen when files are changed after the deployment process has started but before they are uploaded.
93
+
94
+ Error: ${error}
95
+ `
96
+ : `Deploy did not succeed: ${error}`
97
+
98
+ const errorA = new Error(errMsg)
88
99
  const errorInfo =
89
100
  errorType === 'user' ? { type: 'resolveConfig' } : { type: 'coreStep', location: { coreStepName: 'Deploy site' } }
90
101
  addErrorInfo(errorA, errorInfo)