@adobe/helix-admin-support 2.3.22 → 2.4.1

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
+ ## [2.4.1](https://github.com/adobe/helix-admin-support/compare/v2.4.0...v2.4.1) (2024-03-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * don't fail if context has no env ([#231](https://github.com/adobe/helix-admin-support/issues/231)) ([f24d81f](https://github.com/adobe/helix-admin-support/commit/f24d81f79628a1d7a145eda092d10459b76b6d24))
7
+
8
+ # [2.4.0](https://github.com/adobe/helix-admin-support/compare/v2.3.22...v2.4.0) (2024-02-29)
9
+
10
+
11
+ ### Features
12
+
13
+ * make github raw url configurable ([#230](https://github.com/adobe/helix-admin-support/issues/230)) ([b2963bc](https://github.com/adobe/helix-admin-support/commit/b2963bca15d21db86a3d1867058f37480ba41e5e))
14
+
1
15
  ## [2.3.22](https://github.com/adobe/helix-admin-support/compare/v2.3.21...v2.3.22) (2024-02-24)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "2.3.22",
3
+ "version": "2.4.1",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -50,7 +50,7 @@ async function handleResponse(log, response, key, type) {
50
50
  * @returns {Promise<MountConfig>} the fstab
51
51
  */
52
52
  export async function fetchFstab(ctx, opts, optional) {
53
- const { log, attributes } = ctx;
53
+ const { log, attributes, env = {} } = ctx;
54
54
  const loadFstab = async () => {
55
55
  const { owner, repo } = opts;
56
56
  if (!owner || !repo) {
@@ -70,7 +70,10 @@ export async function fetchFstab(ctx, opts, optional) {
70
70
  if (ctx.githubToken) {
71
71
  headers.authorization = `token ${ctx.githubToken}`;
72
72
  }
73
- response = await fetch(`https://raw.githubusercontent.com/${key}`, {
73
+
74
+ const { GH_RAW_URL = 'https://raw.githubusercontent.com' } = env;
75
+
76
+ response = await fetch(`${GH_RAW_URL}/${key}`, {
74
77
  cache: 'no-store',
75
78
  headers,
76
79
  });
@@ -49,7 +49,7 @@ async function handleResponse(log, response, key) {
49
49
  * @returns {Promise<IgnoreConfig>} the IgnoreConfig
50
50
  */
51
51
  export async function fetchIgnore(ctx, opts) {
52
- const { attributes, log } = ctx;
52
+ const { attributes, log, env = {} } = ctx;
53
53
  const {
54
54
  owner, repo, ref, branch,
55
55
  } = opts;
@@ -63,7 +63,10 @@ export async function fetchIgnore(ctx, opts) {
63
63
  if (ctx.githubToken) {
64
64
  headers.authorization = `token ${ctx.githubToken}`;
65
65
  }
66
- const response = await fetch(`https://raw.githubusercontent.com/${key}`, {
66
+
67
+ const { GH_RAW_URL = 'https://raw.githubusercontent.com' } = env;
68
+
69
+ const response = await fetch(`${GH_RAW_URL}/${key}`, {
67
70
  cache: 'no-store',
68
71
  headers,
69
72
  });
@@ -55,7 +55,7 @@ async function handleResponse(log, response, key, type) {
55
55
  * @returns {Promise<IndexConfig>} the index config
56
56
  */
57
57
  export async function fetchIndex(ctx, opts, optional) {
58
- const { attributes, log } = ctx;
58
+ const { attributes, log, env = {} } = ctx;
59
59
  const {
60
60
  owner, repo, ref, branch,
61
61
  } = opts;
@@ -76,7 +76,9 @@ export async function fetchIndex(ctx, opts, optional) {
76
76
  if (ctx.githubToken) {
77
77
  headers.authorization = `token ${ctx.githubToken}`;
78
78
  }
79
- response = await fetch(`https://raw.githubusercontent.com/${key}`, {
79
+ const { GH_RAW_URL = 'https://raw.githubusercontent.com' } = env;
80
+
81
+ response = await fetch(`${GH_RAW_URL}/${key}`, {
80
82
  cache: 'no-store',
81
83
  headers,
82
84
  });