@bleedingdev/modern-js-code-tools 3.9.0-ultramodern.19 → 3.9.0-ultramodern.20
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.
|
@@ -168,14 +168,21 @@ const singleAddedArgument = (expression, factory, names)=>{
|
|
|
168
168
|
if (1 !== chain.base.arguments.length || !names.includes(stringLiteral(chain.base.arguments[0]) ?? '') || 1 !== chain.methods.length || method?.name !== 'add' || 1 !== method.arguments.length) return;
|
|
169
169
|
return method.arguments[0];
|
|
170
170
|
};
|
|
171
|
-
const
|
|
172
|
-
|
|
171
|
+
const rootGroupExpression = (graph, expression)=>{
|
|
172
|
+
if (void 0 === expression) return;
|
|
173
|
+
const node = (0, external_source_analysis_cjs_namespaceObject.unwrapExpression)(expression);
|
|
174
|
+
if (!types_namespaceObject.isIdentifier(node)) return node;
|
|
175
|
+
const resolved = graph.resolve(graph.root, node.name, 'local');
|
|
176
|
+
return resolved?.kind === 'declaration' && resolved.module === graph.root ? (0, external_source_analysis_cjs_namespaceObject.unwrapExpression)(resolved.expression) : void 0;
|
|
177
|
+
};
|
|
178
|
+
const foundationGroup = (graph, declaration, stem, readinessSchemaName)=>{
|
|
179
|
+
const group = rootGroupExpression(graph, singleAddedArgument(declaration?.init, [
|
|
173
180
|
'HttpApi',
|
|
174
181
|
'make'
|
|
175
182
|
], [
|
|
176
183
|
`${pascalCaseStem(stem)}FoundationApi`,
|
|
177
184
|
`${pascalCaseStem(stem)}ApiFoundation`
|
|
178
|
-
]);
|
|
185
|
+
]));
|
|
179
186
|
const endpointExpression = singleAddedArgument(group, [
|
|
180
187
|
'HttpApiGroup',
|
|
181
188
|
'make'
|
|
@@ -188,21 +195,24 @@ const foundationIsExact = (declaration, stem, readinessSchemaName)=>{
|
|
|
188
195
|
], 3);
|
|
189
196
|
const endpointOptions = objectLiteral(endpoint?.arguments[2]);
|
|
190
197
|
const endpointProperties = void 0 === endpointOptions ? void 0 : propertyAssignments(endpointOptions.properties);
|
|
191
|
-
return void 0 !== endpoint && 'readiness' === stringLiteral(endpoint.arguments[0]) && stringLiteral(endpoint.arguments[1]) === `/${stem}/readiness` && endpointProperties?.size === 1 && identifierName(endpointProperties.get('success')?.value) === readinessSchemaName;
|
|
198
|
+
return void 0 !== endpoint && 'readiness' === stringLiteral(endpoint.arguments[0]) && stringLiteral(endpoint.arguments[1]) === `/${stem}/readiness` && endpointProperties?.size === 1 && identifierName(endpointProperties.get('success')?.value) === readinessSchemaName ? group : void 0;
|
|
192
199
|
};
|
|
193
|
-
const rootComposesFoundation = (
|
|
200
|
+
const rootComposesFoundation = (graph, declaration, stem, foundationName, foundation)=>{
|
|
201
|
+
const sourceFile = graph.root.file;
|
|
194
202
|
const chain = directCallChain(declaration?.init);
|
|
195
203
|
const first = chain?.methods[0];
|
|
204
|
+
const firstArgument = first?.arguments[0];
|
|
196
205
|
return void 0 !== chain && isAccessPath(chain.base.callee, [
|
|
197
206
|
'HttpApi',
|
|
198
207
|
'make'
|
|
199
208
|
]) && 1 === chain.base.arguments.length && stringLiteral(chain.base.arguments[0]) === `${pascalCaseStem(stem)}Api` && chain.methods.length > 0 && chain.methods.every((method, index)=>{
|
|
200
209
|
const combinatorArity = nonEndpointCombinators.api[method.name];
|
|
201
210
|
if (void 0 !== combinatorArity) return method.arguments.length === combinatorArity;
|
|
202
|
-
|
|
211
|
+
if ('add' === method.name) return method.arguments.length > 0;
|
|
212
|
+
return 1 === method.arguments.length && ('addHttpApi' === method.name || index === chain.methods.length - 1 && 'pipe' === method.name && 'identity' === identifierName(method.arguments[0]) && importsExactBindings(sourceFile, 'effect', [
|
|
203
213
|
'identity'
|
|
204
214
|
]));
|
|
205
|
-
}) && first?.name === 'addHttpApi' && identifierName(first.
|
|
215
|
+
}) && void 0 !== firstArgument && (first?.name === 'addHttpApi' && identifierName(firstArgument) === foundationName || first?.name === 'add' && types_namespaceObject.isIdentifier(firstArgument) && rootGroupExpression(graph, firstArgument) === foundation);
|
|
206
216
|
};
|
|
207
217
|
const nonEndpointCombinators = {
|
|
208
218
|
api: {
|
|
@@ -285,17 +295,35 @@ const reachableEndpoints = (graph, declaration)=>{
|
|
|
285
295
|
}
|
|
286
296
|
const combinatorArity = combinators[method.name];
|
|
287
297
|
if (void 0 !== combinatorArity) return method.arguments.length === combinatorArity;
|
|
298
|
+
if ('add' === method.name) return method.arguments.length > 0 && method.arguments.every((argument)=>visitAdded(argument, module, 'api' === kind ? 'group' : 'endpoint', 'group' === kind ? name : ''));
|
|
288
299
|
if (1 !== method.arguments.length) return false;
|
|
289
300
|
if ('pipe' === method.name) return 'identity' === identifierName(method.arguments[0]) && importsExactBindings(module.file, 'effect', [
|
|
290
301
|
'identity'
|
|
291
302
|
]);
|
|
292
|
-
if ('add' === method.name) return visit(method.arguments[0], module, 'api' === kind ? 'group' : 'endpoint', 'group' === kind ? name : '');
|
|
293
303
|
return 'api' === kind && 'addHttpApi' === method.name && visit(method.arguments[0], module, 'api');
|
|
294
304
|
});
|
|
295
305
|
} finally{
|
|
296
306
|
active.delete(node);
|
|
297
307
|
}
|
|
298
308
|
};
|
|
309
|
+
const visitAdded = (argument, module, kind, group)=>{
|
|
310
|
+
if (!types_namespaceObject.isSpreadElement(argument)) return visit(argument, module, kind, group);
|
|
311
|
+
let node = (0, external_source_analysis_cjs_namespaceObject.unwrapExpression)(argument.argument);
|
|
312
|
+
let owner = module;
|
|
313
|
+
if (types_namespaceObject.isIdentifier(node)) {
|
|
314
|
+
const resolved = graph.resolve(module, node.name, 'local');
|
|
315
|
+
if (resolved?.kind !== 'declaration') return false;
|
|
316
|
+
node = (0, external_source_analysis_cjs_namespaceObject.unwrapExpression)(resolved.expression);
|
|
317
|
+
owner = resolved.module;
|
|
318
|
+
}
|
|
319
|
+
if (!types_namespaceObject.isArrayExpression(node) || active.has(node) || ++visits > 2048) return false;
|
|
320
|
+
active.add(node);
|
|
321
|
+
try {
|
|
322
|
+
return node.elements.every((element)=>null !== element && visitAdded(element, owner, kind, group));
|
|
323
|
+
} finally{
|
|
324
|
+
active.delete(node);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
299
327
|
return visit(declaration?.init, graph.root, 'api') ? endpoints : void 0;
|
|
300
328
|
};
|
|
301
329
|
const operationContextFields = (property)=>{
|
|
@@ -443,8 +471,9 @@ const validateParsedContract = (graph, stem, expectation)=>{
|
|
|
443
471
|
if (!importsSharedBaselinePrimitives(sourceFile, expectation.baselinePackage)) return 'MicroVertical root contract must import exact baseline primitives from the framework baseline package';
|
|
444
472
|
if (!markerSchemaIsShared(sourceFile, markerDeclaration)) return 'MicroVertical root contract must consume the shared build marker schema without overriding shared fields';
|
|
445
473
|
if (!readinessSchemaIsShared((0, external_module_graph_cjs_namespaceObject.exportedConst)(sourceFile, readinessSchemaName), markerSchemaName, declarationIsIdentifier(markerDeclaration, 'MicroVerticalBuildMarkerSchema'))) return 'MicroVertical readiness schema must consume the shared readiness schema without overriding shared fields';
|
|
446
|
-
|
|
447
|
-
if (
|
|
474
|
+
const foundation = foundationGroup(graph, (0, external_module_graph_cjs_namespaceObject.exportedConst)(sourceFile, foundationName), stem, readinessSchemaName);
|
|
475
|
+
if (void 0 === foundation) return 'MicroVertical readiness foundation API must directly compose its exact readiness endpoint and foundation identity';
|
|
476
|
+
if (!rootComposesFoundation(graph, (0, external_module_graph_cjs_namespaceObject.exportedConst)(sourceFile, `${exportStem}Api`), stem, foundationName, foundation)) return 'MicroVertical root API must explicitly compose its readiness foundation API';
|
|
448
477
|
const endpoints = reachableEndpoints(graph, (0, external_module_graph_cjs_namespaceObject.exportedConst)(sourceFile, `${exportStem}Api`));
|
|
449
478
|
if (!endpoints) return 'MicroVertical root API must compose bounded native endpoint declarations without ambiguous identities';
|
|
450
479
|
if (!operationMapIsConnected((0, external_module_graph_cjs_namespaceObject.exportedConst)(sourceFile, `${exportStem}OperationContexts`), stem, expectation.operationPaths ?? {}, endpoints)) return 'MicroVertical operation map must construct every operation with the shared context constructor';
|
|
@@ -135,14 +135,21 @@ const singleAddedArgument = (expression, factory, names)=>{
|
|
|
135
135
|
if (1 !== chain.base.arguments.length || !names.includes(stringLiteral(chain.base.arguments[0]) ?? '') || 1 !== chain.methods.length || method?.name !== 'add' || 1 !== method.arguments.length) return;
|
|
136
136
|
return method.arguments[0];
|
|
137
137
|
};
|
|
138
|
-
const
|
|
139
|
-
|
|
138
|
+
const rootGroupExpression = (graph, expression)=>{
|
|
139
|
+
if (void 0 === expression) return;
|
|
140
|
+
const node = unwrapExpression(expression);
|
|
141
|
+
if (!__rspack_external__babel_types_6e8337dd.isIdentifier(node)) return node;
|
|
142
|
+
const resolved = graph.resolve(graph.root, node.name, 'local');
|
|
143
|
+
return resolved?.kind === 'declaration' && resolved.module === graph.root ? unwrapExpression(resolved.expression) : void 0;
|
|
144
|
+
};
|
|
145
|
+
const foundationGroup = (graph, declaration, stem, readinessSchemaName)=>{
|
|
146
|
+
const group = rootGroupExpression(graph, singleAddedArgument(declaration?.init, [
|
|
140
147
|
'HttpApi',
|
|
141
148
|
'make'
|
|
142
149
|
], [
|
|
143
150
|
`${pascalCaseStem(stem)}FoundationApi`,
|
|
144
151
|
`${pascalCaseStem(stem)}ApiFoundation`
|
|
145
|
-
]);
|
|
152
|
+
]));
|
|
146
153
|
const endpointExpression = singleAddedArgument(group, [
|
|
147
154
|
'HttpApiGroup',
|
|
148
155
|
'make'
|
|
@@ -155,21 +162,24 @@ const foundationIsExact = (declaration, stem, readinessSchemaName)=>{
|
|
|
155
162
|
], 3);
|
|
156
163
|
const endpointOptions = objectLiteral(endpoint?.arguments[2]);
|
|
157
164
|
const endpointProperties = void 0 === endpointOptions ? void 0 : propertyAssignments(endpointOptions.properties);
|
|
158
|
-
return void 0 !== endpoint && 'readiness' === stringLiteral(endpoint.arguments[0]) && stringLiteral(endpoint.arguments[1]) === `/${stem}/readiness` && endpointProperties?.size === 1 && identifierName(endpointProperties.get('success')?.value) === readinessSchemaName;
|
|
165
|
+
return void 0 !== endpoint && 'readiness' === stringLiteral(endpoint.arguments[0]) && stringLiteral(endpoint.arguments[1]) === `/${stem}/readiness` && endpointProperties?.size === 1 && identifierName(endpointProperties.get('success')?.value) === readinessSchemaName ? group : void 0;
|
|
159
166
|
};
|
|
160
|
-
const rootComposesFoundation = (
|
|
167
|
+
const rootComposesFoundation = (graph, declaration, stem, foundationName, foundation)=>{
|
|
168
|
+
const sourceFile = graph.root.file;
|
|
161
169
|
const chain = directCallChain(declaration?.init);
|
|
162
170
|
const first = chain?.methods[0];
|
|
171
|
+
const firstArgument = first?.arguments[0];
|
|
163
172
|
return void 0 !== chain && isAccessPath(chain.base.callee, [
|
|
164
173
|
'HttpApi',
|
|
165
174
|
'make'
|
|
166
175
|
]) && 1 === chain.base.arguments.length && stringLiteral(chain.base.arguments[0]) === `${pascalCaseStem(stem)}Api` && chain.methods.length > 0 && chain.methods.every((method, index)=>{
|
|
167
176
|
const combinatorArity = nonEndpointCombinators.api[method.name];
|
|
168
177
|
if (void 0 !== combinatorArity) return method.arguments.length === combinatorArity;
|
|
169
|
-
|
|
178
|
+
if ('add' === method.name) return method.arguments.length > 0;
|
|
179
|
+
return 1 === method.arguments.length && ('addHttpApi' === method.name || index === chain.methods.length - 1 && 'pipe' === method.name && 'identity' === identifierName(method.arguments[0]) && importsExactBindings(sourceFile, 'effect', [
|
|
170
180
|
'identity'
|
|
171
181
|
]));
|
|
172
|
-
}) && first?.name === 'addHttpApi' && identifierName(first.
|
|
182
|
+
}) && void 0 !== firstArgument && (first?.name === 'addHttpApi' && identifierName(firstArgument) === foundationName || first?.name === 'add' && __rspack_external__babel_types_6e8337dd.isIdentifier(firstArgument) && rootGroupExpression(graph, firstArgument) === foundation);
|
|
173
183
|
};
|
|
174
184
|
const nonEndpointCombinators = {
|
|
175
185
|
api: {
|
|
@@ -252,17 +262,35 @@ const reachableEndpoints = (graph, declaration)=>{
|
|
|
252
262
|
}
|
|
253
263
|
const combinatorArity = combinators[method.name];
|
|
254
264
|
if (void 0 !== combinatorArity) return method.arguments.length === combinatorArity;
|
|
265
|
+
if ('add' === method.name) return method.arguments.length > 0 && method.arguments.every((argument)=>visitAdded(argument, module, 'api' === kind ? 'group' : 'endpoint', 'group' === kind ? name : ''));
|
|
255
266
|
if (1 !== method.arguments.length) return false;
|
|
256
267
|
if ('pipe' === method.name) return 'identity' === identifierName(method.arguments[0]) && importsExactBindings(module.file, 'effect', [
|
|
257
268
|
'identity'
|
|
258
269
|
]);
|
|
259
|
-
if ('add' === method.name) return visit(method.arguments[0], module, 'api' === kind ? 'group' : 'endpoint', 'group' === kind ? name : '');
|
|
260
270
|
return 'api' === kind && 'addHttpApi' === method.name && visit(method.arguments[0], module, 'api');
|
|
261
271
|
});
|
|
262
272
|
} finally{
|
|
263
273
|
active.delete(node);
|
|
264
274
|
}
|
|
265
275
|
};
|
|
276
|
+
const visitAdded = (argument, module, kind, group)=>{
|
|
277
|
+
if (!__rspack_external__babel_types_6e8337dd.isSpreadElement(argument)) return visit(argument, module, kind, group);
|
|
278
|
+
let node = unwrapExpression(argument.argument);
|
|
279
|
+
let owner = module;
|
|
280
|
+
if (__rspack_external__babel_types_6e8337dd.isIdentifier(node)) {
|
|
281
|
+
const resolved = graph.resolve(module, node.name, 'local');
|
|
282
|
+
if (resolved?.kind !== 'declaration') return false;
|
|
283
|
+
node = unwrapExpression(resolved.expression);
|
|
284
|
+
owner = resolved.module;
|
|
285
|
+
}
|
|
286
|
+
if (!__rspack_external__babel_types_6e8337dd.isArrayExpression(node) || active.has(node) || ++visits > 2048) return false;
|
|
287
|
+
active.add(node);
|
|
288
|
+
try {
|
|
289
|
+
return node.elements.every((element)=>null !== element && visitAdded(element, owner, kind, group));
|
|
290
|
+
} finally{
|
|
291
|
+
active.delete(node);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
266
294
|
return visit(declaration?.init, graph.root, 'api') ? endpoints : void 0;
|
|
267
295
|
};
|
|
268
296
|
const operationContextFields = (property)=>{
|
|
@@ -410,8 +438,9 @@ const validateParsedContract = (graph, stem, expectation)=>{
|
|
|
410
438
|
if (!importsSharedBaselinePrimitives(sourceFile, expectation.baselinePackage)) return 'MicroVertical root contract must import exact baseline primitives from the framework baseline package';
|
|
411
439
|
if (!markerSchemaIsShared(sourceFile, markerDeclaration)) return 'MicroVertical root contract must consume the shared build marker schema without overriding shared fields';
|
|
412
440
|
if (!readinessSchemaIsShared(exportedConst(sourceFile, readinessSchemaName), markerSchemaName, declarationIsIdentifier(markerDeclaration, 'MicroVerticalBuildMarkerSchema'))) return 'MicroVertical readiness schema must consume the shared readiness schema without overriding shared fields';
|
|
413
|
-
|
|
414
|
-
if (
|
|
441
|
+
const foundation = foundationGroup(graph, exportedConst(sourceFile, foundationName), stem, readinessSchemaName);
|
|
442
|
+
if (void 0 === foundation) return 'MicroVertical readiness foundation API must directly compose its exact readiness endpoint and foundation identity';
|
|
443
|
+
if (!rootComposesFoundation(graph, exportedConst(sourceFile, `${exportStem}Api`), stem, foundationName, foundation)) return 'MicroVertical root API must explicitly compose its readiness foundation API';
|
|
415
444
|
const endpoints = reachableEndpoints(graph, exportedConst(sourceFile, `${exportStem}Api`));
|
|
416
445
|
if (!endpoints) return 'MicroVertical root API must compose bounded native endpoint declarations without ambiguous identities';
|
|
417
446
|
if (!operationMapIsConnected(exportedConst(sourceFile, `${exportStem}OperationContexts`), stem, expectation.operationPaths ?? {}, endpoints)) return 'MicroVertical operation map must construct every operation with the shared context constructor';
|
|
@@ -136,14 +136,21 @@ const singleAddedArgument = (expression, factory, names)=>{
|
|
|
136
136
|
if (1 !== chain.base.arguments.length || !names.includes(stringLiteral(chain.base.arguments[0]) ?? '') || 1 !== chain.methods.length || method?.name !== 'add' || 1 !== method.arguments.length) return;
|
|
137
137
|
return method.arguments[0];
|
|
138
138
|
};
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const rootGroupExpression = (graph, expression)=>{
|
|
140
|
+
if (void 0 === expression) return;
|
|
141
|
+
const node = unwrapExpression(expression);
|
|
142
|
+
if (!__rspack_external__babel_types_6e8337dd.isIdentifier(node)) return node;
|
|
143
|
+
const resolved = graph.resolve(graph.root, node.name, 'local');
|
|
144
|
+
return resolved?.kind === 'declaration' && resolved.module === graph.root ? unwrapExpression(resolved.expression) : void 0;
|
|
145
|
+
};
|
|
146
|
+
const foundationGroup = (graph, declaration, stem, readinessSchemaName)=>{
|
|
147
|
+
const group = rootGroupExpression(graph, singleAddedArgument(declaration?.init, [
|
|
141
148
|
'HttpApi',
|
|
142
149
|
'make'
|
|
143
150
|
], [
|
|
144
151
|
`${pascalCaseStem(stem)}FoundationApi`,
|
|
145
152
|
`${pascalCaseStem(stem)}ApiFoundation`
|
|
146
|
-
]);
|
|
153
|
+
]));
|
|
147
154
|
const endpointExpression = singleAddedArgument(group, [
|
|
148
155
|
'HttpApiGroup',
|
|
149
156
|
'make'
|
|
@@ -156,21 +163,24 @@ const foundationIsExact = (declaration, stem, readinessSchemaName)=>{
|
|
|
156
163
|
], 3);
|
|
157
164
|
const endpointOptions = objectLiteral(endpoint?.arguments[2]);
|
|
158
165
|
const endpointProperties = void 0 === endpointOptions ? void 0 : propertyAssignments(endpointOptions.properties);
|
|
159
|
-
return void 0 !== endpoint && 'readiness' === stringLiteral(endpoint.arguments[0]) && stringLiteral(endpoint.arguments[1]) === `/${stem}/readiness` && endpointProperties?.size === 1 && identifierName(endpointProperties.get('success')?.value) === readinessSchemaName;
|
|
166
|
+
return void 0 !== endpoint && 'readiness' === stringLiteral(endpoint.arguments[0]) && stringLiteral(endpoint.arguments[1]) === `/${stem}/readiness` && endpointProperties?.size === 1 && identifierName(endpointProperties.get('success')?.value) === readinessSchemaName ? group : void 0;
|
|
160
167
|
};
|
|
161
|
-
const rootComposesFoundation = (
|
|
168
|
+
const rootComposesFoundation = (graph, declaration, stem, foundationName, foundation)=>{
|
|
169
|
+
const sourceFile = graph.root.file;
|
|
162
170
|
const chain = directCallChain(declaration?.init);
|
|
163
171
|
const first = chain?.methods[0];
|
|
172
|
+
const firstArgument = first?.arguments[0];
|
|
164
173
|
return void 0 !== chain && isAccessPath(chain.base.callee, [
|
|
165
174
|
'HttpApi',
|
|
166
175
|
'make'
|
|
167
176
|
]) && 1 === chain.base.arguments.length && stringLiteral(chain.base.arguments[0]) === `${pascalCaseStem(stem)}Api` && chain.methods.length > 0 && chain.methods.every((method, index)=>{
|
|
168
177
|
const combinatorArity = nonEndpointCombinators.api[method.name];
|
|
169
178
|
if (void 0 !== combinatorArity) return method.arguments.length === combinatorArity;
|
|
170
|
-
|
|
179
|
+
if ('add' === method.name) return method.arguments.length > 0;
|
|
180
|
+
return 1 === method.arguments.length && ('addHttpApi' === method.name || index === chain.methods.length - 1 && 'pipe' === method.name && 'identity' === identifierName(method.arguments[0]) && importsExactBindings(sourceFile, 'effect', [
|
|
171
181
|
'identity'
|
|
172
182
|
]));
|
|
173
|
-
}) && first?.name === 'addHttpApi' && identifierName(first.
|
|
183
|
+
}) && void 0 !== firstArgument && (first?.name === 'addHttpApi' && identifierName(firstArgument) === foundationName || first?.name === 'add' && __rspack_external__babel_types_6e8337dd.isIdentifier(firstArgument) && rootGroupExpression(graph, firstArgument) === foundation);
|
|
174
184
|
};
|
|
175
185
|
const nonEndpointCombinators = {
|
|
176
186
|
api: {
|
|
@@ -253,17 +263,35 @@ const reachableEndpoints = (graph, declaration)=>{
|
|
|
253
263
|
}
|
|
254
264
|
const combinatorArity = combinators[method.name];
|
|
255
265
|
if (void 0 !== combinatorArity) return method.arguments.length === combinatorArity;
|
|
266
|
+
if ('add' === method.name) return method.arguments.length > 0 && method.arguments.every((argument)=>visitAdded(argument, module, 'api' === kind ? 'group' : 'endpoint', 'group' === kind ? name : ''));
|
|
256
267
|
if (1 !== method.arguments.length) return false;
|
|
257
268
|
if ('pipe' === method.name) return 'identity' === identifierName(method.arguments[0]) && importsExactBindings(module.file, 'effect', [
|
|
258
269
|
'identity'
|
|
259
270
|
]);
|
|
260
|
-
if ('add' === method.name) return visit(method.arguments[0], module, 'api' === kind ? 'group' : 'endpoint', 'group' === kind ? name : '');
|
|
261
271
|
return 'api' === kind && 'addHttpApi' === method.name && visit(method.arguments[0], module, 'api');
|
|
262
272
|
});
|
|
263
273
|
} finally{
|
|
264
274
|
active.delete(node);
|
|
265
275
|
}
|
|
266
276
|
};
|
|
277
|
+
const visitAdded = (argument, module, kind, group)=>{
|
|
278
|
+
if (!__rspack_external__babel_types_6e8337dd.isSpreadElement(argument)) return visit(argument, module, kind, group);
|
|
279
|
+
let node = unwrapExpression(argument.argument);
|
|
280
|
+
let owner = module;
|
|
281
|
+
if (__rspack_external__babel_types_6e8337dd.isIdentifier(node)) {
|
|
282
|
+
const resolved = graph.resolve(module, node.name, 'local');
|
|
283
|
+
if (resolved?.kind !== 'declaration') return false;
|
|
284
|
+
node = unwrapExpression(resolved.expression);
|
|
285
|
+
owner = resolved.module;
|
|
286
|
+
}
|
|
287
|
+
if (!__rspack_external__babel_types_6e8337dd.isArrayExpression(node) || active.has(node) || ++visits > 2048) return false;
|
|
288
|
+
active.add(node);
|
|
289
|
+
try {
|
|
290
|
+
return node.elements.every((element)=>null !== element && visitAdded(element, owner, kind, group));
|
|
291
|
+
} finally{
|
|
292
|
+
active.delete(node);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
267
295
|
return visit(declaration?.init, graph.root, 'api') ? endpoints : void 0;
|
|
268
296
|
};
|
|
269
297
|
const operationContextFields = (property)=>{
|
|
@@ -411,8 +439,9 @@ const validateParsedContract = (graph, stem, expectation)=>{
|
|
|
411
439
|
if (!importsSharedBaselinePrimitives(sourceFile, expectation.baselinePackage)) return 'MicroVertical root contract must import exact baseline primitives from the framework baseline package';
|
|
412
440
|
if (!markerSchemaIsShared(sourceFile, markerDeclaration)) return 'MicroVertical root contract must consume the shared build marker schema without overriding shared fields';
|
|
413
441
|
if (!readinessSchemaIsShared(exportedConst(sourceFile, readinessSchemaName), markerSchemaName, declarationIsIdentifier(markerDeclaration, 'MicroVerticalBuildMarkerSchema'))) return 'MicroVertical readiness schema must consume the shared readiness schema without overriding shared fields';
|
|
414
|
-
|
|
415
|
-
if (
|
|
442
|
+
const foundation = foundationGroup(graph, exportedConst(sourceFile, foundationName), stem, readinessSchemaName);
|
|
443
|
+
if (void 0 === foundation) return 'MicroVertical readiness foundation API must directly compose its exact readiness endpoint and foundation identity';
|
|
444
|
+
if (!rootComposesFoundation(graph, exportedConst(sourceFile, `${exportStem}Api`), stem, foundationName, foundation)) return 'MicroVertical root API must explicitly compose its readiness foundation API';
|
|
416
445
|
const endpoints = reachableEndpoints(graph, exportedConst(sourceFile, `${exportStem}Api`));
|
|
417
446
|
if (!endpoints) return 'MicroVertical root API must compose bounded native endpoint declarations without ambiguous identities';
|
|
418
447
|
if (!operationMapIsConnected(exportedConst(sourceFile, `${exportStem}OperationContexts`), stem, expectation.operationPaths ?? {}, endpoints)) return 'MicroVertical operation map must construct every operation with the shared context constructor';
|