@netlify/build 27.12.0-beta → 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.12.0-beta",
3
+ "version": "27.12.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./src/core/main.js",
@@ -56,14 +56,14 @@
56
56
  "license": "MIT",
57
57
  "dependencies": {
58
58
  "@bugsnag/js": "^7.0.0",
59
- "@netlify/edge-bundler": "^1.10.0",
59
+ "@netlify/edge-bundler": "^1.12.1",
60
60
  "@netlify/cache-utils": "^4.0.0",
61
- "@netlify/config": "^18.1.2",
62
- "@netlify/functions-utils": "^4.2.2",
61
+ "@netlify/config": "^18.1.4",
62
+ "@netlify/functions-utils": "^4.2.4",
63
63
  "@netlify/git-utils": "^4.0.0",
64
- "@netlify/plugins-list": "^6.35.0",
64
+ "@netlify/plugins-list": "^6.36.0",
65
65
  "@netlify/run-utils": "^4.0.0",
66
- "@netlify/zip-it-and-ship-it": "5.13.2",
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",
package/src/core/main.js CHANGED
@@ -1,4 +1,4 @@
1
- /* eslint-disable max-lines, import/max-dependencies */
1
+ /* eslint-disable import/max-dependencies */
2
2
  import { handleBuildError } from '../error/handle.js'
3
3
  import { getErrorInfo } from '../error/info.js'
4
4
  import { startErrorMonitor } from '../error/monitor/start.js'
@@ -700,4 +700,4 @@ const telemetryReport = async function ({
700
700
  await handleBuildError(error, errorParams)
701
701
  }
702
702
  }
703
- /* eslint-enable max-lines, import/max-dependencies */
703
+ /* eslint-enable import/max-dependencies */
@@ -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,
@@ -52,6 +52,7 @@ const INTERNAL_FLAGS = [
52
52
  'mode',
53
53
  'apiHost',
54
54
  'cacheDir',
55
+ 'systemLogFile',
55
56
  ]
56
57
  const HIDDEN_FLAGS = [...SECURE_FLAGS, ...TEST_FLAGS, ...INTERNAL_FLAGS]
57
58
  const HIDDEN_DEBUG_FLAGS = [...SECURE_FLAGS, ...TEST_FLAGS]
@@ -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)
@@ -5,7 +5,7 @@ import { getSeverity } from '../core/severity.js'
5
5
  import { handleBuildError } from '../error/handle.js'
6
6
  import { getErrorInfo } from '../error/info.js'
7
7
  import { startErrorMonitor } from '../error/monitor/start.js'
8
- import { getBufferLogs } from '../log/logger.js'
8
+ import { getBufferLogs, getSystemLogger } from '../log/logger.js'
9
9
  import { logBuildStart } from '../log/messages/core.js'
10
10
  import { reportStatuses } from '../status/report.js'
11
11
 
@@ -39,6 +39,7 @@ import { runSteps } from './run_steps.js'
39
39
  export const runCoreSteps = async (buildSteps, flags = {}) => {
40
40
  const { errorMonitor, mode, logs, debug, ...flagsA } = startBuild(flags)
41
41
  const errorParams = { errorMonitor, mode, logs, debug }
42
+ const systemLog = getSystemLogger(logs, debug)
42
43
 
43
44
  try {
44
45
  const { netlifyConfig: netlifyConfigA, configMutations } = await executeBuildStep({
@@ -49,6 +50,7 @@ export const runCoreSteps = async (buildSteps, flags = {}) => {
49
50
  debug,
50
51
  errorParams,
51
52
  buildSteps,
53
+ systemLog,
52
54
  })
53
55
  const { success, severityCode } = getSeverity('success')
54
56
 
@@ -93,6 +95,7 @@ const executeBuildStep = async function ({
93
95
  featureFlags,
94
96
  buildSteps,
95
97
  repositoryRoot,
98
+ systemLog,
96
99
  }) {
97
100
  const configOpts = getConfigOpts({
98
101
  config,
@@ -140,6 +143,7 @@ const executeBuildStep = async function ({
140
143
  childEnv,
141
144
  buildSteps,
142
145
  repositoryRoot: repositoryRootA,
146
+ systemLog,
143
147
  })
144
148
 
145
149
  return {
@@ -175,6 +179,7 @@ const runBuildStep = async function ({
175
179
  childEnv,
176
180
  buildSteps,
177
181
  repositoryRoot,
182
+ systemLog,
178
183
  }) {
179
184
  const { netlifyConfig: netlifyConfigA, configMutations } = await runSteps({
180
185
  steps: getBuildSteps(buildSteps),
@@ -188,6 +193,7 @@ const runBuildStep = async function ({
188
193
  featureFlags,
189
194
  childEnv,
190
195
  repositoryRoot,
196
+ systemLog,
191
197
  })
192
198
 
193
199
  return { netlifyConfig: netlifyConfigA, configMutations }
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-lines */
2
1
  import { addMutableConstants } from '../core/constants.js'
3
2
  import { logStepStart } from '../log/messages/steps.js'
4
3
  import { runsAlsoOnBuildFailure, runsOnlyOnBuildFailure } from '../plugins/events.js'
@@ -303,4 +302,3 @@ const tFireStep = function ({
303
302
  verbose,
304
303
  })
305
304
  }
306
- /* eslint-enable max-lines */
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-lines */
2
1
  import pReduce from 'p-reduce'
3
2
 
4
3
  import { addErrorInfo } from '../error/info.js'
@@ -178,4 +177,3 @@ export const runSteps = async function ({
178
177
  configMutations: configMutationsB,
179
178
  }
180
179
  }
181
- /* eslint-enable max-lines */