boxwood 2.8.2 → 2.9.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.
@@ -32,15 +32,23 @@ function engine(options = {}) {
32
32
  try {
33
33
  const template = await compileFile(path)
34
34
  // Automatically inject nonce from res.locals if available
35
- const templateOptions = options && options._locals && options._locals.nonce
36
- ? { ...options, nonce: options._locals.nonce }
37
- : options
35
+ const templateOptions =
36
+ options && options._locals && options._locals.nonce
37
+ ? { ...options, nonce: options._locals.nonce }
38
+ : options
38
39
  const html = template(templateOptions)
39
40
  if (callback) return callback(null, html)
40
41
  return html
41
42
  } catch (error) {
42
- if (callback) return callback(error)
43
- return error.message
43
+ // Enhance error message with file path for better debugging
44
+ const exception = new Error(
45
+ `Error rendering view "${path}": ${error.message}`,
46
+ )
47
+ exception.stack = error.stack
48
+ exception.originalError = error
49
+ exception.viewPath = path
50
+ if (callback) return callback(exception)
51
+ return exception.message
44
52
  }
45
53
  }
46
54
  return render
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boxwood",
3
- "version": "2.8.2",
3
+ "version": "2.9.0",
4
4
  "description": "Compile HTML templates into JS",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -49,8 +49,8 @@
49
49
  "benchmark": "2.1.4",
50
50
  "c8": "^11.0.0",
51
51
  "express": "^5.2.1",
52
- "handlebars": "^4.7.8",
53
- "jsdom": "^28.1.0",
52
+ "handlebars": "^4.7.9",
53
+ "jsdom": "^29.1.1",
54
54
  "mustache": "^4.2.0",
55
55
  "underscore": "^1.13.8"
56
56
  },