@adobe/helix-config-storage 1.0.0 → 1.1.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 +7 -0
- package/README.md +6 -10
- package/package.json +1 -1
- package/src/config-store.js +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.1.0](https://github.com/adobe/helix-config-storage/compare/v1.0.0...v1.1.0) (2024-08-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* validate profile-aggregated site config ([#3](https://github.com/adobe/helix-config-storage/issues/3)) ([b14d137](https://github.com/adobe/helix-config-storage/commit/b14d137e5c82e830197831986b75601720e319c0)), closes [#2](https://github.com/adobe/helix-config-storage/issues/2)
|
|
7
|
+
|
|
1
8
|
# 1.0.0 (2024-08-15)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
# Helix Config
|
|
1
|
+
# Helix Config Storage
|
|
2
2
|
|
|
3
|
-
> Helix Configuration Library
|
|
3
|
+
> Helix Configuration Storage Library
|
|
4
4
|
|
|
5
5
|
## Status
|
|
6
|
-
[](https://codecov.io/gh/adobe/helix-config)
|
|
6
|
+
[](https://codecov.io/gh/adobe/helix-config)
|
|
7
7
|
[](https://github.com/adobe/helix-config/actions/workflows/main.yaml)
|
|
8
|
-
[](https://github.com/adobe/helix-config/blob/master/LICENSE.txt)
|
|
9
|
-
[](https://github.com/adobe/helix-config/issues)
|
|
8
|
+
[](https://github.com/adobe/helix-config/blob/master/LICENSE.txt)
|
|
9
|
+
[](https://github.com/adobe/helix-config/issues)
|
|
10
10
|
[](https://github.com/semantic-release/semantic-release)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
$ npm install @adobe/helix-config
|
|
15
|
+
$ npm install @adobe/helix-config-storage
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
## Usage
|
|
19
|
-
|
|
20
|
-
See the [API documentation](docs/API.md).
|
|
21
|
-
|
|
22
18
|
## Development
|
|
23
19
|
|
|
24
20
|
### Build
|
package/package.json
CHANGED
package/src/config-store.js
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
deepGetOrCreate, deepPut,
|
|
22
22
|
} from './utils.js';
|
|
23
23
|
import { validate as validateSchema } from './config-validator.js';
|
|
24
|
+
import { getMergedConfig } from './config-merge.js';
|
|
24
25
|
|
|
25
26
|
const FRAGMENTS_COMMON = {
|
|
26
27
|
content: 'object',
|
|
@@ -184,7 +185,16 @@ export class ConfigStore {
|
|
|
184
185
|
* @returns {Promise<boolean|undefined>}
|
|
185
186
|
*/
|
|
186
187
|
async validate(ctx, data) {
|
|
187
|
-
|
|
188
|
+
let config = data;
|
|
189
|
+
if (this.type === 'sites') {
|
|
190
|
+
// validate the config after merging with the profile
|
|
191
|
+
const storage = HelixStorage.fromContext(ctx).configBus();
|
|
192
|
+
const profileName = data.extends?.profile || 'default';
|
|
193
|
+
const profileJson = await storage.get(`/orgs/${this.org}/profiles/${profileName}.json`);
|
|
194
|
+
const profile = profileJson ? JSON.parse(profileJson) : null;
|
|
195
|
+
config = getMergedConfig(config, profile);
|
|
196
|
+
}
|
|
197
|
+
return validateSchema(config, this.type);
|
|
188
198
|
}
|
|
189
199
|
|
|
190
200
|
async create(ctx, data, relPath = '') {
|