@lowdefy/build 0.0.0-experimental-20260112140412 → 0.0.0-experimental-20260113081624
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/dist/build/buildConnections.js +7 -7
- package/dist/build/buildRefs/recursiveBuild.js +10 -6
- package/dist/createContext.js +1 -0
- package/dist/defaultTypesMap.js +484 -484
- package/dist/index.js +22 -14
- package/dist/utils/collectConfigError.js +40 -0
- package/dist/utils/tryBuildStep.js +38 -0
- package/package.json +39 -39
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
import collectConfigError from '../utils/collectConfigError.js';
|
|
16
17
|
import countOperators from '../utils/countOperators.js';
|
|
17
18
|
import createCheckDuplicateId from '../utils/createCheckDuplicateId.js';
|
|
18
|
-
import formatConfigError from '../utils/formatConfigError.js';
|
|
19
19
|
function buildConnections({ components, context }) {
|
|
20
20
|
// Store connection IDs for validation in buildRequests
|
|
21
21
|
context.connectionIds = new Set();
|
|
@@ -27,29 +27,29 @@ function buildConnections({ components, context }) {
|
|
|
27
27
|
components.connections.forEach((connection)=>{
|
|
28
28
|
const configKey = connection['~k'];
|
|
29
29
|
if (type.isUndefined(connection.id)) {
|
|
30
|
-
|
|
30
|
+
collectConfigError({
|
|
31
31
|
message: 'Connection id missing.',
|
|
32
32
|
configKey,
|
|
33
33
|
context
|
|
34
|
-
})
|
|
34
|
+
});
|
|
35
35
|
}
|
|
36
36
|
if (!type.isString(connection.id)) {
|
|
37
|
-
|
|
37
|
+
collectConfigError({
|
|
38
38
|
message: `Connection id is not a string. Received ${JSON.stringify(connection.id)}.`,
|
|
39
39
|
configKey,
|
|
40
40
|
context
|
|
41
|
-
})
|
|
41
|
+
});
|
|
42
42
|
}
|
|
43
43
|
checkDuplicateConnectionId({
|
|
44
44
|
id: connection.id,
|
|
45
45
|
configKey
|
|
46
46
|
});
|
|
47
47
|
if (!type.isString(connection.type)) {
|
|
48
|
-
|
|
48
|
+
collectConfigError({
|
|
49
49
|
message: `Connection type is not a string at connection "${connection.id}". Received ${JSON.stringify(connection.type)}.`,
|
|
50
50
|
configKey,
|
|
51
51
|
context
|
|
52
|
-
})
|
|
52
|
+
});
|
|
53
53
|
}
|
|
54
54
|
context.typeCounters.connections.increment(connection.type, connection['~k']);
|
|
55
55
|
connection.connectionId = connection.id;
|
|
@@ -79,12 +79,16 @@ async function recursiveBuild({ context, refDef, count, referencedFrom, refChain
|
|
|
79
79
|
});
|
|
80
80
|
const reviver = (_, value)=>{
|
|
81
81
|
if (!type.isObject(value)) return value;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
// Only set ~r if not already present to preserve original file references from nested imports.
|
|
83
|
+
// Use child file's ref ID (parsedRefDef.id) not parent's (refDef.id) for correct error tracing.
|
|
84
|
+
if (value['~r'] === undefined) {
|
|
85
|
+
Object.defineProperty(value, '~r', {
|
|
86
|
+
value: parsedRefDef.id,
|
|
87
|
+
enumerable: false,
|
|
88
|
+
writable: true,
|
|
89
|
+
configurable: true
|
|
90
|
+
});
|
|
91
|
+
}
|
|
88
92
|
return value;
|
|
89
93
|
};
|
|
90
94
|
// Use serializer.copy to preserve non-enumerable properties like ~l
|