@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 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
- [![codecov](https://img.shields.io/codecov/c/github/adobe/helix-config.svg)](https://codecov.io/gh/adobe/helix-config)
6
+ [![codecov](https://img.shields.io/codecov/c/github/adobe/helix-config-storage.svg)](https://codecov.io/gh/adobe/helix-config)
7
7
  [![GitHub Actions](https://img.shields.io/github/actions/workflow/status/adobe/helix-config/main.yaml)](https://github.com/adobe/helix-config/actions/workflows/main.yaml)
8
- [![GitHub license](https://img.shields.io/github/license/adobe/helix-config.svg)](https://github.com/adobe/helix-config/blob/master/LICENSE.txt)
9
- [![GitHub issues](https://img.shields.io/github/issues/adobe/helix-config.svg)](https://github.com/adobe/helix-config/issues)
8
+ [![GitHub license](https://img.shields.io/github/license/adobe/helix-config-storage.svg)](https://github.com/adobe/helix-config/blob/master/LICENSE.txt)
9
+ [![GitHub issues](https://img.shields.io/github/issues/adobe/helix-config-storage.svg)](https://github.com/adobe/helix-config/issues)
10
10
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config-storage",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Helix Config Storage",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -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
- return validateSchema(data, this.type);
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 = '') {