entodicton 8.0.0-beta.45 → 8.0.0-beta.48
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/client.js +6 -4
- package/package.json +1 -1
- package/src/config.js +15 -1
- package/src/configHelpers.js +1 -1
package/client.js
CHANGED
@@ -895,14 +895,15 @@ const rebuildTemplate = async ({ config, target, previousResultss, startOfChange
|
|
895
895
|
}
|
896
896
|
const { property, hierarchy, query: queryOrExtraConfig, previousResults, initializer, skipSemantics } = configs.shift()
|
897
897
|
// queries are strings or { query: "blah", development: true/false }
|
898
|
-
if (typeof queryOrExtraConfig === 'string' || queryOrExtraConfig.query) {
|
898
|
+
if (typeof queryOrExtraConfig === 'string' || queryOrExtraConfig.query || queryOrExtraConfig.isFragment) {
|
899
899
|
let query = queryOrExtraConfig
|
900
|
+
let isFragment = queryOrExtraConfig.isFragment
|
900
901
|
if (typeof queryOrExtraConfig === 'string') {
|
901
902
|
query = { query }
|
902
903
|
}
|
903
|
-
config.config.skipSemantics = skipSemantics
|
904
|
+
config.config.skipSemantics = skipSemantics && !isFragment
|
904
905
|
const transitoryMode = global.transitoryMode
|
905
|
-
if (property == 'fragments') {
|
906
|
+
if (isFragment || property == 'fragments') {
|
906
907
|
global.transitoryMode = true
|
907
908
|
}
|
908
909
|
if (hierarchy) {
|
@@ -939,6 +940,7 @@ const rebuildTemplate = async ({ config, target, previousResultss, startOfChange
|
|
939
940
|
global.transitoryMode = transitoryMode
|
940
941
|
config.config.skipSemantics = null
|
941
942
|
results.query = query.query
|
943
|
+
results.isFragment = isFragment
|
942
944
|
results.skipSemantics = skipSemantics
|
943
945
|
results.development = query.development
|
944
946
|
results.key = { query: query.query, hierarchy }
|
@@ -1103,7 +1105,7 @@ const knowledgeModuleImpl = async ({
|
|
1103
1105
|
}
|
1104
1106
|
|
1105
1107
|
const createConfig = async () => {
|
1106
|
-
const config = new Config(configStruct, moduleFromJSFile)
|
1108
|
+
const config = new Config(configStruct, moduleFromJSFile, _process)
|
1107
1109
|
config.stop_auto_rebuild()
|
1108
1110
|
await config.add(...(includes || []))
|
1109
1111
|
if (api) {
|
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -255,6 +255,9 @@ const priority_valid = (cp) => {
|
|
255
255
|
const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
256
256
|
ecatch(`While processing the bridge for ${bridge.id}#${bridge.level}`,
|
257
257
|
() => {
|
258
|
+
if (bridge.development && config.isModule) {
|
259
|
+
return
|
260
|
+
}
|
258
261
|
if (!bridge.bridge) {
|
259
262
|
bridge.bridge = '{ ...next(operator) }'
|
260
263
|
}
|
@@ -857,6 +860,7 @@ class Config {
|
|
857
860
|
addArgs: (...args) => this.addArgs(...args),
|
858
861
|
getBridge: (...args) => this.getBridge(...args),
|
859
862
|
fragment: (...args) => this.fragment(...args),
|
863
|
+
server: (...args) => this.server(...args),
|
860
864
|
exists: (...args) => this.exists(...args),
|
861
865
|
addAPI: (...args) => this.addAPI(...args)
|
862
866
|
}
|
@@ -1046,6 +1050,11 @@ class Config {
|
|
1046
1050
|
return this.fragmentInstantiator(fragment.contexts)
|
1047
1051
|
}
|
1048
1052
|
}
|
1053
|
+
for (const fragment of (instance.resultss || [])) {
|
1054
|
+
if (fragment.isFragment && fragment.query === query) {
|
1055
|
+
return this.fragmentInstantiator(fragment.contexts)
|
1056
|
+
}
|
1057
|
+
}
|
1049
1058
|
}
|
1050
1059
|
}
|
1051
1060
|
|
@@ -1634,6 +1643,10 @@ class Config {
|
|
1634
1643
|
return await configHelpers.processContext(context, this.getParams())
|
1635
1644
|
}
|
1636
1645
|
|
1646
|
+
process (query, options) {
|
1647
|
+
return this.clientProcess(this, query, options)
|
1648
|
+
}
|
1649
|
+
|
1637
1650
|
query (query, options) {
|
1638
1651
|
return this.process(query, options)
|
1639
1652
|
}
|
@@ -1772,7 +1785,7 @@ class Config {
|
|
1772
1785
|
}
|
1773
1786
|
|
1774
1787
|
// configs = [ { config, namespace } ... ]
|
1775
|
-
constructor (config, module) {
|
1788
|
+
constructor (config, module, clientProcess) {
|
1776
1789
|
if (config instanceof Config) {
|
1777
1790
|
throw new Error('Excepted the config argument to be a hash not a Config object')
|
1778
1791
|
}
|
@@ -1790,6 +1803,7 @@ class Config {
|
|
1790
1803
|
config.priorities = config.priorities || []
|
1791
1804
|
}
|
1792
1805
|
|
1806
|
+
this.clientProcess = clientProcess
|
1793
1807
|
this.maxDepth = 20 // for generators and semantics
|
1794
1808
|
this.debugLoops = false // for generators and semantics
|
1795
1809
|
|
package/src/configHelpers.js
CHANGED
@@ -381,7 +381,6 @@ const loadInstance = async (config, instance) => {
|
|
381
381
|
}
|
382
382
|
|
383
383
|
const { /* data, generators, semantics, */ hierarchy } = setupProcessB({ config })
|
384
|
-
// for (const results of (instance.resultss || [])) {
|
385
384
|
for (const i in (instance.resultss || [])) {
|
386
385
|
const results = instance.resultss[i]
|
387
386
|
if (results.extraConfig) {
|
@@ -400,6 +399,7 @@ const loadInstance = async (config, instance) => {
|
|
400
399
|
const uuid = config.nameToUUID(instance.name)
|
401
400
|
setupArgs(args, config, config.logs, hierarchy, uuid)
|
402
401
|
await results.apply(args)
|
402
|
+
} else if (results.isFragment) {
|
403
403
|
} else {
|
404
404
|
if (results.skipSemantics) {
|
405
405
|
config.config.skipSemantics = results.skipSemantics
|