theprogrammablemind_4wp 9.3.0-beta.54 → 9.3.0-beta.56
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 +7 -5
- package/package.json +1 -1
- package/src/config.js +31 -1
package/client.js
CHANGED
@@ -50,8 +50,8 @@ const getConfig_getContextCheck = (testConfig) => {
|
|
50
50
|
return (testConfig.checks && testConfig.checks.context) || []
|
51
51
|
}
|
52
52
|
|
53
|
-
const pickContext = (
|
54
|
-
return project2(context,
|
53
|
+
const pickContext = (contextChecks) => (context) => {
|
54
|
+
return project2(context, contextChecks)
|
55
55
|
}
|
56
56
|
|
57
57
|
const pickObjects = (config, testConfig, getObjects) => {
|
@@ -520,8 +520,9 @@ const runTest = async (config, expected, { args, verbose, testConfig, debug, tim
|
|
520
520
|
failed_generatedParenthesized = false
|
521
521
|
}
|
522
522
|
|
523
|
-
const
|
524
|
-
const
|
523
|
+
const contextChecks = config.getContextChecks()
|
524
|
+
const pickedResultContexts = result.contexts.map(pickContext(contextChecks))
|
525
|
+
const pickedExpectedContexts = expected.contexts.map(pickContext(contextChecks))
|
525
526
|
const failedCheckedContexts = !matching(pickedResultContexts, pickedExpectedContexts)
|
526
527
|
|
527
528
|
const expectedGetObjects = (name) => {
|
@@ -885,7 +886,8 @@ const defaultInnerProcess = (config, errorHandler, responses) => {
|
|
885
886
|
console.log(JSON.stringify(picked, null, 2))
|
886
887
|
}
|
887
888
|
|
888
|
-
const
|
889
|
+
const contextChecks = config.getContextChecks()
|
890
|
+
const pickedResultContexts = responses.contexts.map(pickContext(contextChecks))
|
889
891
|
if (pickedResultContexts.some((context) => Object.keys(context).length > 0)) {
|
890
892
|
console.log('--- Contexts showing only the checked values ---')
|
891
893
|
console.log(JSON.stringify(pickedResultContexts, null, 2))
|
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -335,6 +335,16 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
|
335
335
|
config.addPriority({ context: [[bridge.id, bridge.level], after], choose: [0] })
|
336
336
|
}
|
337
337
|
}
|
338
|
+
if (bridge.check) {
|
339
|
+
if (!config.testConfig?.checks?.context) {
|
340
|
+
config.testConfig.checks.context = []
|
341
|
+
}
|
342
|
+
config.testConfig.checks.context.push({
|
343
|
+
match: ({context}) => context.marker == bridge.id,
|
344
|
+
exported: true,
|
345
|
+
apply: ({context}) => bridge.check,
|
346
|
+
})
|
347
|
+
}
|
338
348
|
if (bridge.after) {
|
339
349
|
for (let before of bridge.after) {
|
340
350
|
if (typeof before === 'string') {
|
@@ -473,7 +483,7 @@ const handleCalculatedProps = (baseConfig, moreConfig, { addFirst, uuid } = {})
|
|
473
483
|
if (moreConfig.bridges) {
|
474
484
|
moreConfig.bridges = moreConfig.bridges.map((bridge) => {
|
475
485
|
bridge = { ...bridge }
|
476
|
-
const valid = ['after', 'conditional', 'associations', 'before', 'bridge', 'disabled', 'development', 'skipable', 'return_type_selector', 'evaluator', 'evaluators', 'generatorp', 'generatorr', 'generatorpr', 'generators', 'operator', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
|
486
|
+
const valid = ['after', 'conditional', 'associations', 'before', 'bridge', 'check', 'disabled', 'development', 'skipable', 'return_type_selector', 'evaluator', 'evaluators', 'generatorp', 'generatorr', 'generatorpr', 'generators', 'operator', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
|
477
487
|
'level', 'optional', 'selector', 'semantic', 'semantics', 'words', /Bridge$/, 'localHierarchy', 'levelSpecificHierarchy', 'where', 'uuid']
|
478
488
|
helpers.validProps(valid, bridge, 'bridge')
|
479
489
|
handleBridgeProps(baseConfig, bridge, { addFirst, uuid })
|
@@ -878,6 +888,7 @@ class Config {
|
|
878
888
|
getInfo () {
|
879
889
|
const name = this.name
|
880
890
|
const includes = this.configs.slice(1).map((km) => km.config.name)
|
891
|
+
includes.sort()
|
881
892
|
const visibleExamples = []
|
882
893
|
for (const test of this.tests) {
|
883
894
|
if (!test.developerTest) {
|
@@ -2596,6 +2607,24 @@ class Config {
|
|
2596
2607
|
})
|
2597
2608
|
}
|
2598
2609
|
|
2610
|
+
getContextChecks() {
|
2611
|
+
const allChecks = []
|
2612
|
+
for (const name of this.loadOrdering) {
|
2613
|
+
const checks = this.kms[name].testConfig?.checks?.context || []
|
2614
|
+
for (const check of checks) {
|
2615
|
+
if (check.exported) {
|
2616
|
+
allChecks.push(check)
|
2617
|
+
}
|
2618
|
+
}
|
2619
|
+
}
|
2620
|
+
for (const check of this.testConfig?.checks?.context || []) {
|
2621
|
+
if (!check.exported) {
|
2622
|
+
allChecks.push(check)
|
2623
|
+
}
|
2624
|
+
}
|
2625
|
+
return allChecks
|
2626
|
+
}
|
2627
|
+
|
2599
2628
|
// rebuild ({ isModule: mainIsModule = false } = {}) {
|
2600
2629
|
async rebuild ({ isModule: mainIsModule } = {}) {
|
2601
2630
|
if (this._stop_auto_rebuild) {
|
@@ -2623,6 +2652,7 @@ class Config {
|
|
2623
2652
|
// reorder configs base on load ordering
|
2624
2653
|
{
|
2625
2654
|
const ordering = this.loadOrder.order(this.configs.map((km) => km.name || km.uuid))
|
2655
|
+
this.loadOrdering = ordering
|
2626
2656
|
const oconfigs = []
|
2627
2657
|
for (const nameOrUUID of ordering) {
|
2628
2658
|
for (const km of this.configs) {
|