@adobe/helix-html-pipeline 6.31.1 → 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,10 @@
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
+
1
8
  ## [6.31.1](https://github.com/adobe/helix-html-pipeline/compare/v6.31.0...v6.31.1) (2026-08-17)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.31.1",
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.
@@ -68,6 +68,10 @@ export default async function setXSurrogateKeyHeader(state, req, res) {
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 {
@@ -75,9 +79,6 @@ export default async function setXSurrogateKeyHeader(state, req, res) {
75
79
  if (!isSitemapRelated) {
76
80
  keys.push(`${contentKeyPrefix}${contentBusId}_metadata`);
77
81
  keys.push(`${ref}--${repo}--${owner}_head`);
78
- } else if (path === '/sitemap-index.xml' && res.status === 404) {
79
- keys.push(await computeCodePathKey(state));
80
- keys.push(`${ref}--${repo}--${owner}_code`);
81
82
  }
82
83
  keys.push(`${contentKeyPrefix}${contentBusId}`);
83
84
  }