@adobe/helix-html-pipeline 6.31.0 → 6.31.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [6.31.2](https://github.com/adobe/helix-html-pipeline/compare/v6.31.1...v6.31.2) (2026-08-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **sitemap-index:** try generated first, then fallback to code ([#1129](https://github.com/adobe/helix-html-pipeline/issues/1129)) ([5158d71](https://github.com/adobe/helix-html-pipeline/commit/5158d7191cc9a2f90ad3d4252c186fdeb48514e3))
7
+
8
+ ## [6.31.1](https://github.com/adobe/helix-html-pipeline/compare/v6.31.0...v6.31.1) (2026-08-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **sitemap-index:** on a 404, we should also return code-related surrogate keys ([#1127](https://github.com/adobe/helix-html-pipeline/issues/1127)) ([132409c](https://github.com/adobe/helix-html-pipeline/commit/132409c77d334adb115d6bc26557186e7a2ba335))
14
+
1
15
  # [6.31.0](https://github.com/adobe/helix-html-pipeline/compare/v6.30.1...v6.31.0) (2026-08-17)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.31.0",
3
+ "version": "6.31.2",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -77,17 +77,17 @@
77
77
  "@semantic-release/git": "11.0.1",
78
78
  "@semantic-release/npm": "13.1.5",
79
79
  "c8": "12.0.0",
80
- "eslint": "9.4.0",
80
+ "eslint": "9.39.5",
81
81
  "eslint-import-resolver-exports": "1.0.0-beta.5",
82
82
  "eslint-plugin-header": "3.1.1",
83
83
  "eslint-plugin-import": "2.32.0",
84
84
  "esmock": "2.7.6",
85
85
  "husky": "9.1.7",
86
- "js-yaml": "5.2.2",
87
- "jsdom": "30.0.0",
86
+ "js-yaml": "5.2.3",
87
+ "jsdom": "30.0.1",
88
88
  "junit-report-builder": "5.1.2",
89
- "lint-staged": "17.2.0",
90
- "mocha": "11.7.6",
89
+ "lint-staged": "17.3.0",
90
+ "mocha": "11.8.0",
91
91
  "mocha-multi-reporters": "1.5.1",
92
92
  "mocha-suppress-logs": "0.6.0",
93
93
  "semantic-release": "25.0.8"
@@ -28,7 +28,12 @@ async function generateSitemapIndex(state) {
28
28
 
29
29
  const { sitemap } = config;
30
30
  if (!sitemap?.index) {
31
- throw new PipelineStatusError(404, 'No sitemap index defined in configuration');
31
+ return new PipelineResponse('', {
32
+ status: 404,
33
+ headers: {
34
+ 'x-error': 'No sitemap index defined in configuration',
35
+ },
36
+ });
32
37
  }
33
38
  const host = partition === 'preview'
34
39
  ? (previewHost || `${ref}--${repo}--${owner}.aem.page`)
@@ -77,19 +82,18 @@ export async function sitemapIndexPipe(state, req) {
77
82
  try {
78
83
  await initConfig(state, req, res);
79
84
 
80
- // fetch sitemap-index.xml
85
+ // generate sitemap-index.xml from config, fallback to sitemap-index.xml from code bus
81
86
  state.timer?.update('content-fetch');
82
- state.content.sourceBus = 'code';
83
- await fetchContent(state, req, res);
84
- if (res.status === 404) {
85
- state.content.sourceBus = 'content';
86
- const ret = await generateSitemapIndex(state);
87
- if (ret.status === 200) {
88
- res.status = 200;
89
- recordLastModified(state, res, 'content', extractLastModified(ret.headers));
90
- delete res.error;
91
- state.content.data = ret.body;
92
- }
87
+ state.content.sourceBus = 'content';
88
+
89
+ const ret = await generateSitemapIndex(state);
90
+ if (ret.status === 404) {
91
+ state.content.sourceBus = 'code';
92
+ await fetchContent(state, req, res);
93
+ } else {
94
+ res.status = 200;
95
+ recordLastModified(state, res, 'content', extractLastModified(ret.headers));
96
+ state.content.data = ret.body;
93
97
  }
94
98
  if (res.error) {
95
99
  // if content loading produced an error, we're done.
@@ -61,18 +61,22 @@ export default async function setXSurrogateKeyHeader(state, req, res) {
61
61
  } = state;
62
62
 
63
63
  const isCode = state.content.sourceBus === 'code';
64
- const purgeMetadataAndHead = !['/sitemap.xml', '/sitemap-index.xml'].includes(path);
64
+ const isSitemapRelated = ['/sitemap.xml', '/sitemap-index.xml'].includes(path);
65
65
 
66
66
  // provide either (prefixed) preview or (unprefixed) live content keys
67
67
  const contentKeyPrefix = partition === 'preview' ? 'p_' : '';
68
68
  const keys = [];
69
69
  const hash = await computeContentPathKey(state);
70
70
  if (isCode) {
71
+ if (path === '/sitemap-index.xml' && res.status === 404) {
72
+ keys.push(`${contentKeyPrefix}${hash}`);
73
+ keys.push(`${contentKeyPrefix}${contentBusId}`);
74
+ }
71
75
  keys.push(await computeCodePathKey(state));
72
76
  keys.push(`${ref}--${repo}--${owner}_code`);
73
77
  } else {
74
78
  keys.push(`${contentKeyPrefix}${hash}`);
75
- if (purgeMetadataAndHead) {
79
+ if (!isSitemapRelated) {
76
80
  keys.push(`${contentKeyPrefix}${contentBusId}_metadata`);
77
81
  keys.push(`${ref}--${repo}--${owner}_head`);
78
82
  }