@bookshop/hugo-engine 3.15.0-alpha.3 → 3.15.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/lib/engine.js CHANGED
@@ -241,7 +241,13 @@ export class Engine {
241
241
  const component_regex = /execute of template failed: template: ([^:]+):\d/ig;
242
242
  let file_stack = [...error_string.matchAll(component_regex)].map(([, file]) => `layouts/${file}`);
243
243
  if (file_stack.length) {
244
- const deepest_errored_component = file_stack[file_stack.length - 1];
244
+ const raw_deepest_errored_component = file_stack[file_stack.length - 1];
245
+ // For some reason, in the Hugo bump to v0.147.6, the errors now log as:
246
+ // _partials/bookshop/components/bad/bad.hugo.html:1:7
247
+ // instead of the previous:
248
+ // partials/bookshop/components/bad/bad.hugo.html:1:7
249
+ // So, we now strip that off if it is present.
250
+ const deepest_errored_component = raw_deepest_errored_component.replace(/layouts\/_partials/, 'layouts/partials')
245
251
  const error_chunks = error_string.split("execute of template failed:");
246
252
  const error_msg = error_chunks[error_chunks.length - 1] ?? "template error";
247
253
  window.writeHugoFiles(JSON.stringify({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bookshop/hugo-engine",
3
- "version": "3.15.0-alpha.3",
3
+ "version": "3.15.0",
4
4
  "description": "Bookshop frontend Hugo renderer",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -30,7 +30,7 @@
30
30
  "esbuild": "^0.19.3",
31
31
  "fflate": "^0.7.3",
32
32
  "liquidjs": "10.17.0",
33
- "@bookshop/helpers": "3.15.0-alpha.3"
33
+ "@bookshop/helpers": "3.15.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=14.16"