@cloudcannon/configuration-loader 0.0.8 → 0.0.9

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.
Files changed (2) hide show
  1. package/dist/loader.js +15 -0
  2. package/package.json +2 -2
package/dist/loader.js CHANGED
@@ -49,6 +49,7 @@ class ConfigurationLoader {
49
49
  await this.importFromGlobKey(config, '_snippets_definitions_from_glob', '_snippets_definitions', false);
50
50
  await this.importFromGlobKey(config, 'collections_config_from_glob', 'collections_config', false);
51
51
  await this.importFromGlobKey(config, '_inputs_from_glob', '_inputs', false);
52
+ await this.importFromGlobKey(config, '_editables_from_glob', '_editables', false);
52
53
  await this.importFromGlobKey(config, '_structures_from_glob', '_structures', false);
53
54
  await this.processInputsKey(config._inputs);
54
55
  await this.processStructuresKey(config._structures);
@@ -63,17 +64,31 @@ class ConfigurationLoader {
63
64
  }
64
65
  const collection = config.collections_config[collectionKey];
65
66
  await this.importFromGlobKey(collection, '_inputs_from_glob', '_inputs', false);
67
+ await this.importFromGlobKey(collection, '_editables_from_glob', '_editables', false);
66
68
  await this.importFromGlobKey(collection, '_structures_from_glob', '_structures', false);
67
69
  await this.processInputsKey(collection._inputs);
68
70
  await this.processStructuresKey(collection._structures);
71
+ if (isObject(collection.create)) {
72
+ await this.importFromGlobKey(collection.create, '_inputs_from_glob', '_inputs', false);
73
+ await this.importFromGlobKey(collection.create, '_structures_from_glob', '_structures', false);
74
+ await this.processInputsKey(collection.create._inputs);
75
+ await this.processStructuresKey(collection.create._structures);
76
+ }
69
77
  // Process recursive globs in schemas
70
78
  if (isObject(collection.schemas)) {
71
79
  for (const schemaValue of Object.values(collection.schemas)) {
72
80
  if (isObject(schemaValue)) {
73
81
  await this.importFromGlobKey(schemaValue, '_inputs_from_glob', '_inputs', false);
82
+ await this.importFromGlobKey(schemaValue, '_editables_from_glob', '_editables', false);
74
83
  await this.importFromGlobKey(schemaValue, '_structures_from_glob', '_structures', false);
75
84
  await this.processInputsKey(schemaValue._inputs);
76
85
  await this.processStructuresKey(schemaValue._structures);
86
+ if (isObject(schemaValue.create)) {
87
+ await this.importFromGlobKey(schemaValue.create, '_inputs_from_glob', '_inputs', false);
88
+ await this.importFromGlobKey(schemaValue.create, '_structures_from_glob', '_structures', false);
89
+ await this.processInputsKey(schemaValue.create._inputs);
90
+ await this.processStructuresKey(schemaValue.create._structures);
91
+ }
77
92
  }
78
93
  }
79
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-loader",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Load and merge CloudCannon configuration files",
5
5
  "type": "module",
6
6
  "engines": {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "homepage": "https://cloudcannon.com/documentation/articles/why-split-your-configuration-file/",
54
54
  "dependencies": {
55
- "@cloudcannon/configuration-types": "0.0.56"
55
+ "@cloudcannon/configuration-types": "0.0.58"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "js-yaml": "^4.0.0"