@lowdefy/build 4.0.0-alpha.14 → 4.0.0-alpha.17
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.
|
@@ -14,13 +14,19 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import recursiveBuild from './recursiveBuild.js';
|
|
16
16
|
import makeRefDefinition from './makeRefDefinition.js';
|
|
17
|
-
|
|
17
|
+
import evaluateBuildOperators from './evaluateBuildOperators.js';
|
|
18
18
|
async function buildRefs({ context }) {
|
|
19
|
-
const
|
|
19
|
+
const refDef = makeRefDefinition('lowdefy.yaml');
|
|
20
|
+
let components = await recursiveBuild({
|
|
20
21
|
context,
|
|
21
|
-
refDef
|
|
22
|
+
refDef,
|
|
22
23
|
count: 0
|
|
23
24
|
});
|
|
24
|
-
|
|
25
|
+
components = await evaluateBuildOperators({
|
|
26
|
+
context,
|
|
27
|
+
input: components,
|
|
28
|
+
refDef
|
|
29
|
+
});
|
|
30
|
+
return components ?? {};
|
|
25
31
|
}
|
|
26
32
|
export default buildRefs;
|
|
@@ -33,7 +33,6 @@ async function recursiveParseFile({ context , refDef , count , referencedFrom }
|
|
|
33
33
|
// the deeper nodes, so we can use those parsed files in references higher in the tree.
|
|
34
34
|
// To do this, since foundRefs is an array of ref definitions that are in order of the
|
|
35
35
|
// deepest nodes first we for loop over over foundRefs one by one, awaiting each result.
|
|
36
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
37
36
|
for (const newRefDef of foundRefs.values()){
|
|
38
37
|
// Parse vars and path before passing down to parse new file
|
|
39
38
|
const parsedRefDef = populateRefs({
|
|
@@ -47,17 +46,18 @@ async function recursiveParseFile({ context , refDef , count , referencedFrom }
|
|
|
47
46
|
count: count + 1,
|
|
48
47
|
referencedFrom: refDef.path
|
|
49
48
|
});
|
|
50
|
-
const
|
|
49
|
+
const transformedFile = await runTransformer({
|
|
51
50
|
context,
|
|
52
51
|
input: parsedFile,
|
|
53
52
|
refDef: parsedRefDef
|
|
54
53
|
});
|
|
55
|
-
|
|
54
|
+
// Evaluated in recursive loop for better error messages
|
|
55
|
+
const evaluatedOperators = await evaluateBuildOperators({
|
|
56
56
|
context,
|
|
57
|
-
input:
|
|
57
|
+
input: transformedFile,
|
|
58
58
|
refDef: parsedRefDef
|
|
59
59
|
});
|
|
60
|
-
parsedFiles[newRefDef.id] =
|
|
60
|
+
parsedFiles[newRefDef.id] = evaluatedOperators;
|
|
61
61
|
}
|
|
62
62
|
return populateRefs({
|
|
63
63
|
toPopulate: fileContentBuiltRefs,
|