@adobe/helix-html-pipeline 1.3.4 → 1.4.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 +21 -0
- package/README.md +1 -1
- package/package.json +7 -7
- package/src/steps/fetch-config.js +22 -2
- package/src/steps/folder-mapping.js +1 -1
- package/src/steps/render.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.4.2](https://github.com/adobe/helix-html-pipeline/compare/v1.4.1...v1.4.2) (2022-05-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency @adobe/helix-shared-utils to v2.0.9 ([2aee8a3](https://github.com/adobe/helix-html-pipeline/commit/2aee8a3c70388a220bacdef1671e6c899b02736f))
|
|
7
|
+
|
|
8
|
+
## [1.4.1](https://github.com/adobe/helix-html-pipeline/compare/v1.4.0...v1.4.1) (2022-04-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/helix-shared-utils to v2.0.8 ([9c7e30d](https://github.com/adobe/helix-html-pipeline/commit/9c7e30daccfab99e0dc5861f7105c0eee6c88ca5))
|
|
14
|
+
|
|
15
|
+
# [1.4.0](https://github.com/adobe/helix-html-pipeline/compare/v1.3.4...v1.4.0) (2022-04-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* adjust for upcoming helix-config changes ([#37](https://github.com/adobe/helix-html-pipeline/issues/37)) ([e6d4f90](https://github.com/adobe/helix-html-pipeline/commit/e6d4f90d4bf8c9a0642e921395e5ac48aa3e53c7)), closes [#36](https://github.com/adobe/helix-html-pipeline/issues/36)
|
|
21
|
+
|
|
1
22
|
## [1.3.4](https://github.com/adobe/helix-html-pipeline/compare/v1.3.3...v1.3.4) (2022-04-11)
|
|
2
23
|
|
|
3
24
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Helix HTML Pipeline
|
|
2
2
|
|
|
3
|
-
This package contains the common code for `helix-pipeline-service` and `helix-cloudflare-
|
|
3
|
+
This package contains the common code for `helix-pipeline-service` and `helix-cloudflare-page` for rendering the html response for helix3. it has the following design goals:
|
|
4
4
|
|
|
5
5
|
- be platform neutral, i.e. not using node or browser specific modules or dependencies.
|
|
6
6
|
- +/-0 runtime dependencies (eg. node [crypto](https://nodejs.org/api/crypto.html))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@adobe/helix-markdown-support": "3.1.2",
|
|
36
|
-
"@adobe/helix-shared-utils": "2.0.
|
|
36
|
+
"@adobe/helix-shared-utils": "2.0.9",
|
|
37
37
|
"github-slugger": "1.4.0",
|
|
38
38
|
"hast-util-raw": "7.2.1",
|
|
39
39
|
"hast-util-select": "5.0.1",
|
|
@@ -67,16 +67,16 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@adobe/eslint-config-helix": "1.3.2",
|
|
70
|
-
"@markedjs/html-differ": "4.0.
|
|
70
|
+
"@markedjs/html-differ": "4.0.2",
|
|
71
71
|
"@semantic-release/changelog": "6.0.1",
|
|
72
72
|
"@semantic-release/git": "10.0.1",
|
|
73
73
|
"@semantic-release/npm": "9.0.1",
|
|
74
|
-
"c8": "7.11.
|
|
74
|
+
"c8": "7.11.2",
|
|
75
75
|
"chalk-template": "0.4.0",
|
|
76
76
|
"codecov": "3.8.3",
|
|
77
77
|
"commitizen": "4.2.4",
|
|
78
78
|
"cz-conventional-changelog": "3.3.0",
|
|
79
|
-
"eslint": "8.
|
|
79
|
+
"eslint": "8.14.0",
|
|
80
80
|
"eslint-plugin-header": "3.1.1",
|
|
81
81
|
"eslint-plugin-import": "2.26.0",
|
|
82
82
|
"esmock": "1.7.5",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"jsdoc-to-markdown": "7.1.1",
|
|
86
86
|
"jsdom": "19.0.0",
|
|
87
87
|
"junit-report-builder": "3.0.0",
|
|
88
|
-
"lint-staged": "12.
|
|
89
|
-
"mocha": "
|
|
88
|
+
"lint-staged": "12.4.1",
|
|
89
|
+
"mocha": "10.0.0",
|
|
90
90
|
"mocha-multi-reporters": "1.5.1",
|
|
91
91
|
"remark-gfm": "3.0.1",
|
|
92
92
|
"semantic-release": "19.0.2"
|
|
@@ -30,13 +30,33 @@ export default async function fetchConfig(state, req, res) {
|
|
|
30
30
|
if (ret.status !== 200) {
|
|
31
31
|
throw new PipelineStatusError(ret.status === 404 ? 404 : 502, `unable to load /helix-config.json: ${ret.status}`);
|
|
32
32
|
}
|
|
33
|
+
let config;
|
|
33
34
|
try {
|
|
34
|
-
|
|
35
|
+
config = JSON.parse(ret.body);
|
|
35
36
|
} catch (e) {
|
|
36
37
|
log.info('failed to parse helix-config.json', e);
|
|
37
38
|
throw new PipelineStatusError(400, `Failed parsing of /helix-config.json: ${e.message}`);
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
// upgrade to version 2 if needed
|
|
42
|
+
if (config.version !== 2) {
|
|
43
|
+
Object.keys(config).forEach((name) => {
|
|
44
|
+
config[name] = {
|
|
45
|
+
data: config[name],
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
// also update last-modified
|
|
41
|
-
|
|
51
|
+
const configLastModified = extractLastModified(ret.headers);
|
|
52
|
+
|
|
53
|
+
// update last modified of fstab
|
|
54
|
+
updateLastModified(state, res, config.fstab?.lastModified || configLastModified);
|
|
55
|
+
|
|
56
|
+
// for html requests, also consider the HEAD config
|
|
57
|
+
if (state.type === 'html' && state.info.selector !== 'plain' && config.head?.lastModified) {
|
|
58
|
+
updateLastModified(state, res, config.head.lastModified);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
state.helixConfig = config;
|
|
42
62
|
}
|
|
@@ -40,7 +40,7 @@ export function mapPath(folders, path) {
|
|
|
40
40
|
* @param {PipelineState} state
|
|
41
41
|
*/
|
|
42
42
|
export default function folderMapping(state) {
|
|
43
|
-
const folders = state.helixConfig?.fstab?.folders;
|
|
43
|
+
const folders = state.helixConfig?.fstab?.data.folders;
|
|
44
44
|
if (!folders) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
package/src/steps/render.js
CHANGED
|
@@ -81,7 +81,7 @@ export default async function render(state, req, res) {
|
|
|
81
81
|
appendElement($head, createElement('link', 'rel', 'alternate', 'type', 'application/xml+atom', 'href', meta.feed, 'title', `${meta.title} feed`));
|
|
82
82
|
|
|
83
83
|
// inject head.html
|
|
84
|
-
const headHtml = state.helixConfig?.head?.html;
|
|
84
|
+
const headHtml = state.helixConfig?.head?.data.html;
|
|
85
85
|
if (headHtml) {
|
|
86
86
|
const $headHtml = await unified()
|
|
87
87
|
.use(rehypeParse, { fragment: true })
|