@adobe/helix-shared-config 9.0.0 → 9.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
+ # [@adobe/helix-shared-config-v9.1.0](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config-v9.0.0...@adobe/helix-shared-config-v9.1.0) (2022-09-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * replace index definition ([#714](https://github.com/adobe/helix-shared/issues/714)) ([88b6389](https://github.com/adobe/helix-shared/commit/88b6389793f0c23181f05cd663c8129c6a95de25))
7
+
1
8
  # [@adobe/helix-shared-config-v9.0.0](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-config-v8.3.0...@adobe/helix-shared-config-v9.0.0) (2022-09-13)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-shared-config",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "description": "Shared modules of the Helix Project - config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -63,6 +63,31 @@ class IndexConfig extends SchemaDerivedConfig {
63
63
  this._document = null;
64
64
  }
65
65
 
66
+ /**
67
+ * Replaces an index definition.
68
+ *
69
+ * @param {Object} index index configuration
70
+ * @param {string} index.name index name
71
+ * @param {Array} index.include paths to include
72
+ * @param {Array} index.exclude paths to exclude
73
+ * @param {string} index.target target
74
+ * @param {object} index.properties properties to add to the index
75
+ */
76
+ replaceIndex({
77
+ name, include, exclude, target, properties,
78
+ }) {
79
+ const { indices } = this._cfg;
80
+ indices[name] = {
81
+ include,
82
+ exclude,
83
+ target,
84
+ properties,
85
+ };
86
+
87
+ // let BaseConfig.toYAML() use the JSON output
88
+ this._document = null;
89
+ }
90
+
66
91
  /**
67
92
  * Evaluates a variable expression
68
93
  * @param {string} expression the expression to encode