@netlify/build 27.7.0 → 27.8.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.7.0",
3
+ "version": "27.8.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./src/core/main.js",
@@ -3,7 +3,15 @@
3
3
  // them consistent
4
4
  export const normalizeGroupingMessage = function (message, type) {
5
5
  const messageA = removeDependenciesLogs(message, type)
6
- return NORMALIZE_REGEXPS.reduce(normalizeMessage, messageA)
6
+ const messageB = NORMALIZE_REGEXPS.reduce(normalizeMessage, messageA)
7
+
8
+ // If this is a functions bundling error, we'll use additional normalization
9
+ // rules to group errors more aggressively.
10
+ if (type === 'functionsBundling') {
11
+ return FUNCTIONS_BUNDLING_REGEXPS.reduce(normalizeMessage, messageB)
12
+ }
13
+
14
+ return messageB
7
15
  }
8
16
 
9
17
  // Discard debug/info installation information
@@ -74,6 +82,15 @@ const NORMALIZE_REGEXPS = [
74
82
  [/(Parse Error):[^]*/, '$1'],
75
83
  // Multiple empty lines
76
84
  [/^\s*$/gm, ''],
77
- // Function bundling errors
78
- [/Bundling of function "([^"]+)" failed/gm, 'Bundling of function "functionName" failed'],
85
+ ]
86
+
87
+ const FUNCTIONS_BUNDLING_REGEXPS = [
88
+ // String literals and identifiers
89
+ [/"([^"]+)"/g, '""'],
90
+ [/'([^']+)'/g, "''"],
91
+ [/`([^`]+)`/g, '``'],
92
+
93
+ // Rust crates
94
+ [/(?:Downloaded \S+ v[\d.]+\s*)+/gm, 'Downloaded crates'],
95
+ [/(?:Compiling \S+ v[\d.]+\s*)+/gm, 'Compiled crates'],
79
96
  ]
package/src/error/type.js CHANGED
@@ -88,6 +88,7 @@ const TYPES = {
88
88
 
89
89
  return `Bundling of function "${functionName}" failed`
90
90
  },
91
+ group: ({ location: { functionType = 'serverless' } }) => `'Bundling of ${functionType} function failed`,
91
92
  stackType: 'none',
92
93
  locationType: 'functionsBundling',
93
94
  severity: 'info',