@adobe/helix-config 5.4.1 → 5.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 +7 -0
- package/package.json +1 -1
- package/src/config-legacy.js +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [5.4.2](https://github.com/adobe/helix-config/compare/v5.4.1...v5.4.2) (2025-05-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* include last modified from helix-config.json in legacy ([#278](https://github.com/adobe/helix-config/issues/278)) ([a36f6ef](https://github.com/adobe/helix-config/commit/a36f6ef7bc2e8632f92939a0ed39a238503e1567))
|
|
7
|
+
|
|
1
8
|
## [5.4.1](https://github.com/adobe/helix-config/compare/v5.4.0...v5.4.1) (2025-05-20)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/config-legacy.js
CHANGED
|
@@ -30,7 +30,7 @@ export function toArray(v) {
|
|
|
30
30
|
*
|
|
31
31
|
* @param {ConfigContext} ctx the context
|
|
32
32
|
* @param {RSO} rso
|
|
33
|
-
* @returns {Promise<
|
|
33
|
+
* @returns {Promise<ConfigObject|null>} the helix-config or {@code null} if optional and not found.
|
|
34
34
|
*/
|
|
35
35
|
async function fetchHelixConfig(ctx, rso) {
|
|
36
36
|
const key = `${rso.org}/${rso.site}/${rso.ref}/helix-config.json`;
|
|
@@ -56,7 +56,10 @@ async function fetchHelixConfig(ctx, rso) {
|
|
|
56
56
|
content[path].contentBusId = id;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
const cfg = new ConfigObject();
|
|
60
|
+
cfg.updateLastModified(res.headers);
|
|
61
|
+
cfg.data = config;
|
|
62
|
+
return cfg;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
/**
|
|
@@ -120,10 +123,11 @@ async function resolveAdminAccess(ctx, admin) {
|
|
|
120
123
|
*/
|
|
121
124
|
export async function resolveLegacyConfig(ctx, rso, scope) {
|
|
122
125
|
// set owner==org and repo==site and fetch from helix-config for now
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
126
|
+
const cfg = await fetchHelixConfig(ctx, rso);
|
|
127
|
+
if (!cfg) {
|
|
125
128
|
return null;
|
|
126
129
|
}
|
|
130
|
+
const helixConfig = cfg.data;
|
|
127
131
|
const { contentBusId } = helixConfig.content.data['/'];
|
|
128
132
|
const fstab = helixConfig.fstab?.data || helixConfig.fstab;
|
|
129
133
|
if (!fstab) {
|
|
@@ -160,8 +164,9 @@ export async function resolveLegacyConfig(ctx, rso, scope) {
|
|
|
160
164
|
},
|
|
161
165
|
folders: fstab.folders ?? {},
|
|
162
166
|
/* c8 ignore next */
|
|
163
|
-
head: helixConfig
|
|
167
|
+
head: helixConfig.head?.data ?? helixConfig.head ?? {},
|
|
164
168
|
};
|
|
169
|
+
cfg.data = config;
|
|
165
170
|
const configAllPreview = await fetchConfigAll(ctx, config.content.contentBusId, 'preview');
|
|
166
171
|
const configAllLive = await fetchConfigAll(ctx, config.content.contentBusId, 'live');
|
|
167
172
|
const { access, admin } = configAllPreview?.config?.data || {};
|
|
@@ -213,7 +218,5 @@ export async function resolveLegacyConfig(ctx, rso, scope) {
|
|
|
213
218
|
config.metadata.source = configAllPreview?.config?.data?.metadata;
|
|
214
219
|
}
|
|
215
220
|
|
|
216
|
-
|
|
217
|
-
obj.data = config;
|
|
218
|
-
return obj;
|
|
221
|
+
return cfg;
|
|
219
222
|
}
|