@adobe/helix-html-pipeline 3.11.6 → 3.11.7
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 +7 -0
- package/package.json +5 -5
- package/src/html-pipe.js +11 -3
- package/src/json-pipe.js +13 -2
- package/src/steps/fetch-content.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.11.7](https://github.com/adobe/helix-html-pipeline/compare/v3.11.6...v3.11.7) (2023-05-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* folder mapping should only be applied if direct addressed resource is missing ([#307](https://github.com/adobe/helix-html-pipeline/issues/307)) ([cf9cfc0](https://github.com/adobe/helix-html-pipeline/commit/cf9cfc0f00aed7a8fd7a502d0b2c77e9aa6e710d))
|
|
7
|
+
|
|
1
8
|
## [3.11.6](https://github.com/adobe/helix-html-pipeline/compare/v3.11.5...v3.11.6) (2023-05-13)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.7",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"mime": "3.0.0",
|
|
67
67
|
"rehype-format": "4.0.1",
|
|
68
68
|
"rehype-parse": "8.0.4",
|
|
69
|
-
"remark-parse": "10.0.
|
|
70
|
-
"strip-markdown": "5.0.
|
|
69
|
+
"remark-parse": "10.0.2",
|
|
70
|
+
"strip-markdown": "5.0.1",
|
|
71
71
|
"unified": "10.1.2",
|
|
72
72
|
"unist-util-map": "3.1.3",
|
|
73
73
|
"unist-util-remove": "3.1.1",
|
|
@@ -83,11 +83,11 @@
|
|
|
83
83
|
"@semantic-release/git": "10.0.1",
|
|
84
84
|
"@semantic-release/npm": "10.0.3",
|
|
85
85
|
"c8": "7.13.0",
|
|
86
|
-
"eslint": "8.
|
|
86
|
+
"eslint": "8.41.0",
|
|
87
87
|
"eslint-import-resolver-exports": "1.0.0-beta.5",
|
|
88
88
|
"eslint-plugin-header": "3.1.1",
|
|
89
89
|
"eslint-plugin-import": "2.27.5",
|
|
90
|
-
"esmock": "2.2.
|
|
90
|
+
"esmock": "2.2.3",
|
|
91
91
|
"husky": "8.0.3",
|
|
92
92
|
"js-yaml": "4.1.0",
|
|
93
93
|
"jsdom": "22.0.0",
|
package/src/html-pipe.js
CHANGED
|
@@ -82,13 +82,21 @@ export async function htmlPipe(state, req) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
// ...and apply the folder mapping
|
|
85
|
-
|
|
85
|
+
state.timer?.update('content-fetch');
|
|
86
|
+
let contentPromise = await fetchContent(state, req, res);
|
|
87
|
+
// ...but only if the current resource doesn't exist
|
|
88
|
+
if (res.status === 404) {
|
|
89
|
+
await folderMapping(state);
|
|
90
|
+
if (state.info.unmappedPath) {
|
|
91
|
+
contentPromise = fetchContent(state, req, res);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
86
94
|
|
|
87
95
|
// load metadata and content in parallel
|
|
88
|
-
state.timer?.update('
|
|
96
|
+
state.timer?.update('metadata-fetch');
|
|
89
97
|
await Promise.all([
|
|
90
98
|
fetchConfigAll(state, req, res),
|
|
91
|
-
|
|
99
|
+
contentPromise,
|
|
92
100
|
fetchMappedMetadata(state),
|
|
93
101
|
]);
|
|
94
102
|
|
package/src/json-pipe.js
CHANGED
|
@@ -54,6 +54,8 @@ async function fetchJsonContent(state, req, res) {
|
|
|
54
54
|
ret = await s3Loader.getObject('helix-code-bus', `${owner}/${repo}/${ref}${path}`);
|
|
55
55
|
}
|
|
56
56
|
if (ret.status === 200) {
|
|
57
|
+
res.status = 200;
|
|
58
|
+
delete res.error;
|
|
57
59
|
state.content.data = ret.body;
|
|
58
60
|
|
|
59
61
|
// store extra source location if present
|
|
@@ -117,7 +119,6 @@ export async function jsonPipe(state, req) {
|
|
|
117
119
|
},
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
|
-
await folderMapping(state);
|
|
121
122
|
|
|
122
123
|
/** @type PipelineResponse */
|
|
123
124
|
const res = new PipelineResponse('', {
|
|
@@ -126,10 +127,20 @@ export async function jsonPipe(state, req) {
|
|
|
126
127
|
},
|
|
127
128
|
});
|
|
128
129
|
|
|
130
|
+
// apply the folder mapping if the current resource doesn't exist
|
|
129
131
|
state.timer?.update('json-fetch');
|
|
132
|
+
let contentPromise = await fetchJsonContent(state, req, res);
|
|
133
|
+
if (res.status === 404) {
|
|
134
|
+
await folderMapping(state);
|
|
135
|
+
if (state.info.unmappedPath) {
|
|
136
|
+
contentPromise = fetchJsonContent(state, req, res);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
state.timer?.update('json-metadata-fetch');
|
|
130
141
|
await Promise.all([
|
|
131
142
|
fetchConfigAll(state, req, res),
|
|
132
|
-
|
|
143
|
+
contentPromise,
|
|
133
144
|
]);
|
|
134
145
|
|
|
135
146
|
await authenticate(state, req, res);
|