@adobe/helix-html-pipeline 3.2.0 → 3.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [3.3.0](https://github.com/adobe/helix-html-pipeline/compare/v3.2.0...v3.3.0) (2022-09-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * improve cross platform compatibilty with conditional crypto import ([22f465c](https://github.com/adobe/helix-html-pipeline/commit/22f465c34d82ae0710740e7243e83578ea2a881b))
7
+
1
8
  # [3.2.0](https://github.com/adobe/helix-html-pipeline/compare/v3.1.8...v3.2.0) (2022-09-10)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
7
7
  "type": "module",
8
+ "imports": {
9
+ "#crypto": {
10
+ "node": "./src/utils/crypto.node.js",
11
+ "browser": "./src/utils/crypto.worker.js",
12
+ "worker": "./src/utils/crypto.worker.js"
13
+ }
14
+ },
8
15
  "scripts": {
9
16
  "test": "c8 mocha",
10
17
  "lint": "eslint .",
@@ -34,7 +41,7 @@
34
41
  },
35
42
  "dependencies": {
36
43
  "@adobe/helix-markdown-support": "5.0.7",
37
- "@adobe/helix-shared-utils": "2.0.11",
44
+ "@adobe/helix-shared-utils": "2.1.0",
38
45
  "cookie": "0.5.0",
39
46
  "github-slugger": "1.4.0",
40
47
  "hast-util-raw": "7.2.2",
@@ -45,9 +52,9 @@
45
52
  "jose": "4.9.2",
46
53
  "mdast-util-gfm-footnote": "1.0.1",
47
54
  "mdast-util-gfm-strikethrough": "1.0.1",
48
- "mdast-util-gfm-table": "1.0.4",
55
+ "mdast-util-gfm-table": "1.0.6",
49
56
  "mdast-util-gfm-task-list-item": "1.0.1",
50
- "mdast-util-to-hast": "12.2.1",
57
+ "mdast-util-to-hast": "12.2.2",
51
58
  "mdast-util-to-string": "3.1.0",
52
59
  "micromark-extension-gfm-footnote": "1.0.4",
53
60
  "micromark-extension-gfm-strikethrough": "1.0.4",
@@ -75,11 +82,11 @@
75
82
  "@semantic-release/git": "10.0.1",
76
83
  "@semantic-release/npm": "9.0.1",
77
84
  "c8": "7.12.0",
78
- "eslint": "8.23.0",
79
- "eslint-import-resolver-exports": "1.0.0-beta.2",
85
+ "eslint": "8.23.1",
86
+ "eslint-import-resolver-exports": "1.0.0-beta.3",
80
87
  "eslint-plugin-header": "3.1.1",
81
88
  "eslint-plugin-import": "2.26.0",
82
- "esmock": "1.9.8",
89
+ "esmock": "2.0.0",
83
90
  "husky": "8.0.1",
84
91
  "js-yaml": "4.1.0",
85
92
  "jsdoc-to-markdown": "7.1.1",
package/src/utils/auth.js CHANGED
@@ -17,16 +17,8 @@ import { clearAuthCookie, getAuthCookie, setAuthCookie } from './auth-cookie.js'
17
17
 
18
18
  import idpMicrosoft from './idp-configs/microsoft.js';
19
19
 
20
- let cryptoImpl;
21
- import('crypto')
22
- .then((crypto) => {
23
- cryptoImpl = crypto;
24
- })
25
- /* c8 ignore next 3 */
26
- .catch(() => {
27
- // eslint-disable-next-line no-undef
28
- cryptoImpl = crypto;
29
- });
20
+ // eslint-disable-next-line import/no-unresolved
21
+ import cryptoImpl from '#crypto';
30
22
 
31
23
  export const IDPS = [
32
24
  idpMicrosoft,
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright 2018 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ // node runtime
14
+ import cryptoImpl from 'node:crypto';
15
+
16
+ export default cryptoImpl;
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright 2018 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ // browser/worker runtime
14
+ // eslint-disable-next-line no-undef
15
+ export default crypto;