@overkill-dev/bench 0.0.1 → 0.0.2

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.
Files changed (32) hide show
  1. package/LICENSE +21 -0
  2. package/authoring/test-node-authoring.d.ts +58 -0
  3. package/authoring/test-node-authoring.d.ts.map +1 -0
  4. package/authoring/test-node-authoring.js +165 -0
  5. package/authoring/test-node-authoring.js.map +1 -0
  6. package/package.json +39 -6
  7. package/packages/bench/bench.entry-point.d.ts +5 -0
  8. package/packages/bench/bench.entry-point.d.ts.map +1 -0
  9. package/packages/bench/bench.entry-point.js +2 -0
  10. package/packages/bench/bench.entry-point.js.map +1 -0
  11. package/packages/test/authoring-input.js +27 -0
  12. package/packages/test/authoring-input.js.map +1 -0
  13. package/packages/test/authoring-source-locations.js +99 -0
  14. package/packages/test/authoring-source-locations.js.map +1 -0
  15. package/packages/test/authoring-test-data.d.ts +12 -0
  16. package/packages/test/authoring-test-data.d.ts.map +1 -0
  17. package/packages/test/authoring-test-data.js +132 -0
  18. package/packages/test/authoring-test-data.js.map +1 -0
  19. package/packages/test/resource-wrapper-composition.js +334 -0
  20. package/packages/test/resource-wrapper-composition.js.map +1 -0
  21. package/packages/test/resource-wrapper-data.js +71 -0
  22. package/packages/test/resource-wrapper-data.js.map +1 -0
  23. package/packages/test/resource-wrapper-runtime-scope.js +44 -0
  24. package/packages/test/resource-wrapper-runtime-scope.js.map +1 -0
  25. package/packages/test/resource-wrapper-session.js +3 -0
  26. package/packages/test/resource-wrapper-session.js.map +1 -0
  27. package/packages/test/table-authoring.d.ts +17 -0
  28. package/packages/test/table-authoring.d.ts.map +1 -0
  29. package/packages/test/table-authoring.js +77 -0
  30. package/packages/test/table-authoring.js.map +1 -0
  31. package/readme.md +32 -4
  32. package/sbom.cdx.json +84 -0
@@ -0,0 +1,334 @@
1
+ import { attachTestBodyResourceAttachments, hasTestBodyResourceAttachments } from "@overkill-dev/engine";
2
+ import { resolvedRuntimeScenarioOwners } from "@overkill-dev/resources";
3
+ import { resourceContextForStep, resourceWrapperLifecycleError, runtimeContextForStep } from "@overkill-dev/run/resource-lifecycle";
4
+ import { directResourceEntries, ensureResourceDescriptor, lifecycleMessages, resourceWrapperSteps, stepRuntimeGraphs } from "./resource-wrapper-data.js";
5
+ import { composeRuntimeScope } from "./resource-wrapper-runtime-scope.js";
6
+ const composedResourceBodyBrand = Symbol.for('@overkill-dev/test/ComposedResourceBody');
7
+ function isComposedResourceBody(value) {
8
+ return typeof value === 'function' && Object.hasOwn(value, composedResourceBodyBrand);
9
+ }
10
+ function ensureBody(body, wrapperName) {
11
+ if (typeof body !== 'function') {
12
+ throw new TypeError(`${wrapperName}() requires a body function.`);
13
+ }
14
+ if (hasTestBodyResourceAttachments(body) && !isComposedResourceBody(body)) {
15
+ throw new TypeError(`${wrapperName}() requires first-party resource wrapper metadata for wrapped bodies.`);
16
+ }
17
+ }
18
+ function ensureResource(resource, wrapperName) {
19
+ return ensureResourceDescriptor(resource, `${wrapperName}() requires resource descriptors.`);
20
+ }
21
+ function entries(record) {
22
+ return Object.entries(record);
23
+ }
24
+ function requirementSummary(requirement) {
25
+ return { ...requirement };
26
+ }
27
+ function resourceHandleTransport(resource) {
28
+ if (typeof resource.serializeHandle === 'function' && typeof resource.deserializeHandle === 'function') {
29
+ return 'projected';
30
+ }
31
+ return 'local';
32
+ }
33
+ function resourceSummary(resource) {
34
+ return {
35
+ dependencies: Object.values(resource.dependencies).map(function dependencyName(dependency) {
36
+ return dependency.name;
37
+ }),
38
+ handleTransport: resourceHandleTransport(resource),
39
+ name: resource.name,
40
+ requirements: resource.requirements.map(requirementSummary),
41
+ scenarios: Object.entries(resource.scenarios).map(function scenarioSummary([name, scenario]) {
42
+ return {
43
+ default: scenario.default,
44
+ name,
45
+ timing: scenario.timing,
46
+ values: scenario.values
47
+ };
48
+ }),
49
+ scope: resource.scope
50
+ };
51
+ }
52
+ function assertUniqueResourceName(descriptorsByName, descriptor) {
53
+ const descriptorForName = descriptorsByName.get(descriptor.name);
54
+ if (descriptorForName !== undefined && descriptorForName !== descriptor) {
55
+ throw new TypeError(`Resource name "${descriptor.name}" is used by multiple descriptors.`);
56
+ }
57
+ }
58
+ function assertResourceAcyclic(traversal, descriptor, path) {
59
+ if (traversal.has(descriptor)) {
60
+ throw new TypeError(`Resource dependency cycle detected: ${path.join(' -> ')}.`);
61
+ }
62
+ }
63
+ function assertResourceCanBeRecorded(descriptorsByName, traversal, descriptor, path) {
64
+ assertUniqueResourceName(descriptorsByName, descriptor);
65
+ assertResourceAcyclic(traversal, descriptor, path);
66
+ }
67
+ function visitDependencies(collector, descriptor, path) {
68
+ for (const [, dependency] of entries(descriptor.dependencies)) {
69
+ collector.visit(dependency, [...path, dependency.name]);
70
+ }
71
+ }
72
+ function createResourceGraphCollector() {
73
+ const descriptorsByName = new Map();
74
+ const resourceGraph = [];
75
+ const recorded = new Set();
76
+ const traversal = new Set();
77
+ const collector = {
78
+ resourceGraph() {
79
+ return resourceGraph;
80
+ },
81
+ visit(resource, path) {
82
+ const descriptor = ensureResource(resource, 'resource attachment');
83
+ assertResourceCanBeRecorded(descriptorsByName, traversal, descriptor, path);
84
+ descriptorsByName.set(descriptor.name, descriptor);
85
+ if (recorded.has(descriptor)) {
86
+ return;
87
+ }
88
+ traversal.add(descriptor);
89
+ visitDependencies(collector, descriptor, path);
90
+ traversal.delete(descriptor);
91
+ recorded.add(descriptor);
92
+ resourceGraph.push(resourceSummary(descriptor));
93
+ }
94
+ };
95
+ return collector;
96
+ }
97
+ function resourceAttachmentSummary(entry) {
98
+ return {
99
+ key: entry.key,
100
+ resourceName: entry.resource.name
101
+ };
102
+ }
103
+ function runtimeVariantEntries(runtimeGraph) {
104
+ return runtimeGraph.kind === 'runtime-matrix'
105
+ ? Object.values(runtimeGraph.variants)
106
+ : [{ id: runtimeGraph.name, runtime: runtimeGraph }];
107
+ }
108
+ function leafRuntimeSummary(runtimeGraph) {
109
+ return {
110
+ dimensions: runtimeGraph.dimensions,
111
+ kind: 'runtime',
112
+ name: runtimeGraph.name,
113
+ requirements: runtimeGraph.requirements.map(requirementSummary),
114
+ resources: entries(runtimeGraph.resources).map(function runtimeResourceSummary([key, resource]) {
115
+ return {
116
+ key,
117
+ resourceName: resource.name
118
+ };
119
+ }),
120
+ scenarioBindings: Array.from(resolvedRuntimeScenarioOwners(runtimeGraph), function scenarioBinding([name, owner]) {
121
+ return {
122
+ default: owner.slot.default,
123
+ name,
124
+ owner: {
125
+ path: owner.path,
126
+ resourceName: owner.resource.name
127
+ },
128
+ timing: owner.slot.timing,
129
+ value: owner.value,
130
+ values: owner.slot.values
131
+ };
132
+ })
133
+ };
134
+ }
135
+ function runtimeSummary(runtimeGraph) {
136
+ if (runtimeGraph.kind === 'composed-runtimes') {
137
+ throw new TypeError('Composed runtime graphs must be flattened before summary creation.');
138
+ }
139
+ if (runtimeGraph.kind === 'runtime-matrix') {
140
+ const [firstVariant] = Object.values(runtimeGraph.variants);
141
+ if (firstVariant === undefined) {
142
+ throw new TypeError(`Runtime matrix "${runtimeGraph.name}" requires at least one variant.`);
143
+ }
144
+ return {
145
+ kind: 'runtime-matrix',
146
+ name: runtimeGraph.name,
147
+ resources: leafRuntimeSummary(firstVariant.runtime).resources,
148
+ variants: Object.values(runtimeGraph.variants).map(function variantSummary(variant) {
149
+ return {
150
+ id: variant.id,
151
+ runtime: leafRuntimeSummary(variant.runtime)
152
+ };
153
+ })
154
+ };
155
+ }
156
+ return leafRuntimeSummary(runtimeGraph);
157
+ }
158
+ function buildAttachments(directResources, runtimeGraphEntries) {
159
+ const graphCollector = createResourceGraphCollector();
160
+ for (const entry of directResources) {
161
+ graphCollector.visit(entry.resource, [entry.resource.name]);
162
+ }
163
+ for (const runtimeGraph of runtimeGraphEntries) {
164
+ if (runtimeGraph.kind === 'composed-runtimes') {
165
+ throw new TypeError('Composed runtime graphs must be flattened before resource graph collection.');
166
+ }
167
+ for (const variant of runtimeVariantEntries(runtimeGraph)) {
168
+ for (const [, resource] of entries(variant.runtime.resources)) {
169
+ graphCollector.visit(resource, [resource.name]);
170
+ }
171
+ }
172
+ }
173
+ return {
174
+ directResources: directResources.map(resourceAttachmentSummary),
175
+ resourceGraph: graphCollector.resourceGraph(),
176
+ runtimeGraphs: runtimeGraphEntries.map(runtimeSummary)
177
+ };
178
+ }
179
+ function bodyComposition(body) {
180
+ if (isComposedResourceBody(body)) {
181
+ return body[composedResourceBodyBrand];
182
+ }
183
+ return {
184
+ actions: [],
185
+ body
186
+ };
187
+ }
188
+ function isPromise(value) {
189
+ return value instanceof Promise;
190
+ }
191
+ function isAssertionNode(value) {
192
+ return typeof value === 'object' &&
193
+ value !== null &&
194
+ typeof Reflect.get(value, 'check') === 'string';
195
+ }
196
+ function isAssertionResult(value) {
197
+ return isAssertionNode(value) ||
198
+ Array.isArray(value) && value.length > 0 && value.every(isAssertionNode);
199
+ }
200
+ function isTestBodyResult(value) {
201
+ return isPromise(value) || isAssertionResult(value);
202
+ }
203
+ function invokeTestBody(body, scope) {
204
+ const result = Reflect.apply(body, undefined, [scope]);
205
+ if (isTestBodyResult(result)) {
206
+ return result;
207
+ }
208
+ throw new TypeError('Resource wrapper body returned an invalid assertion result.');
209
+ }
210
+ function buildStepAttachments(actions) {
211
+ return buildAttachments(directResourceEntries(actions), stepRuntimeGraphs(actions));
212
+ }
213
+ function isResourceScopeInput(value) {
214
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
215
+ }
216
+ function isScopeMapResult(value) {
217
+ return isResourceScopeInput(value) && typeof Reflect.get(value, 'then') !== 'function';
218
+ }
219
+ function isResourceTestScope(value, handles) {
220
+ if (!isResourceScopeInput(value)) {
221
+ return false;
222
+ }
223
+ const resources = Object.hasOwn(value, 'resources') ? Reflect.get(value, 'resources') : {};
224
+ return isResourceScopeInput(resources) &&
225
+ Object.keys(handles).every(function hasResourceHandle(key) {
226
+ return Reflect.get(resources, key) !== undefined;
227
+ });
228
+ }
229
+ function composeResourceContext(scope, handles) {
230
+ const resources = Object.hasOwn(scope, 'resources') ? Reflect.get(scope, 'resources') : {};
231
+ if (!isResourceScopeInput(resources)) {
232
+ throw resourceWrapperLifecycleError('Resource scope composition failed.', resources);
233
+ }
234
+ for (const key of Object.keys(handles)) {
235
+ if (Object.hasOwn(resources, key)) {
236
+ throw resourceWrapperLifecycleError(`Resource scope "${key}" already exists.`, handles);
237
+ }
238
+ }
239
+ const composed = Object.freeze({
240
+ ...scope,
241
+ resources: Object.freeze({
242
+ ...resources,
243
+ ...handles
244
+ })
245
+ });
246
+ if (isResourceTestScope(composed, handles)) {
247
+ return composed;
248
+ }
249
+ throw resourceWrapperLifecycleError('Resource scope composition failed.', handles);
250
+ }
251
+ function composeMappedScope(scope, step) {
252
+ const mappedScope = step.mapScope(scope);
253
+ if (!isScopeMapResult(mappedScope)) {
254
+ throw new TypeError(`${step.name} must return an object.`);
255
+ }
256
+ return step.collision === 'replace-existing'
257
+ ? Object.freeze({
258
+ ...scope,
259
+ ...mappedScope
260
+ })
261
+ : Object.freeze({
262
+ ...mappedScope,
263
+ ...scope
264
+ });
265
+ }
266
+ function composeActionScope(scope, action, session) {
267
+ if (action.kind === 'resources') {
268
+ return composeResourceContext(scope, resourceContextForStep(action.resources, session.directResources));
269
+ }
270
+ if (action.kind === 'runtime') {
271
+ return composeRuntimeScope(scope, action.runtime, runtimeContextForStep(action.runtime, session));
272
+ }
273
+ return composeMappedScope(scope, action);
274
+ }
275
+ function composeActionScopes(scope, actions, session) {
276
+ return actions.reduce(function composeScope(composedScope, action) {
277
+ return composeActionScope(composedScope, action, session);
278
+ }, scope);
279
+ }
280
+ function composeMappedOnlyScopes(scope, actions) {
281
+ return actions.reduce(function composeScope(composedScope, action) {
282
+ if (action.kind !== 'scope') {
283
+ throw resourceWrapperLifecycleError('Resource scope composition failed.', action);
284
+ }
285
+ return composeMappedScope(composedScope, action);
286
+ }, scope);
287
+ }
288
+ async function importResourceWrapperSession() {
289
+ return await import("./resource-wrapper-session.js");
290
+ }
291
+ async function acquireCompositionSession(steps, signal, messages) {
292
+ const sessionModule = await importResourceWrapperSession();
293
+ return await sessionModule.acquireComposedResources(steps, signal, messages);
294
+ }
295
+ async function disposeCompositionSession(session, messages) {
296
+ const sessionModule = await importResourceWrapperSession();
297
+ await sessionModule.disposeComposedResources(session, messages);
298
+ }
299
+ function defineComposedBodyBrand(body, composition) {
300
+ Object.defineProperty(body, composedResourceBodyBrand, {
301
+ value: Object.freeze(composition)
302
+ });
303
+ }
304
+ function attachResourceMetadata(body, actions) {
305
+ return attachTestBodyResourceAttachments(body, buildStepAttachments(actions));
306
+ }
307
+
308
+ export function attachComposedResourceActions(actions, body, wrapperName) {
309
+ ensureBody(body, wrapperName);
310
+ const composition = bodyComposition(body);
311
+ const composedActions = Object.freeze([...actions, ...composition.actions]);
312
+ const steps = resourceWrapperSteps(composedActions);
313
+ const messages = lifecycleMessages(composedActions);
314
+ const wrappedBody = async function runWithComposedResources(scope) {
315
+ if (steps.length === 0) {
316
+ return await invokeTestBody(composition.body, composeMappedOnlyScopes(scope, composedActions));
317
+ }
318
+ const session = await acquireCompositionSession(steps, scope.signal, messages);
319
+ scope.cleanup(async function cleanupComposedResources() {
320
+ await disposeCompositionSession(session, messages);
321
+ });
322
+ return await invokeTestBody(composition.body, composeActionScopes(scope, composedActions, session));
323
+ };
324
+ const composedBody = steps.length > 0
325
+ ? attachResourceMetadata(wrappedBody, composedActions)
326
+ : wrappedBody;
327
+ defineComposedBodyBrand(composedBody, {
328
+ actions: composedActions,
329
+ body: composition.body
330
+ });
331
+ return composedBody;
332
+ }
333
+
334
+ //# sourceMappingURL=resource-wrapper-composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-wrapper-composition.js","sourceRoot":"","sources":["../../../../../source/packages/test/resource-wrapper-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iCAAiC,EACjC,8BAA8B,EAWjC,MAAM,sBAAiC,CAAC;AACzC,OAAO,EACH,6BAA6B,EAQhC,MAAM,yBAA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AO,MAAM,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;IACxG,CAAC,CAAC;IACF,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC;QACjC,CAAC,CAAC,sBAAsB,CAAC,WAAW,EAAE,eAAe,CAAC;QACtD,CAAC,CAAC,WAAW,CAAC;IAElB,uBAAuB,CAAC,YAAY,EAAE;QAClC,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,WAAW,CAAC,IAAI;KACzB,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACxB,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { runtimeGraphLeaves } from "@overkill-dev/resources";
2
+ function isRecord(value) {
3
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
4
+ }
5
+ function hasResourceIdentity(value) {
6
+ return typeof value.name === 'string' && value.name.trim().length > 0;
7
+ }
8
+ function hasResourceGraphData(value) {
9
+ return isRecord(value.dependencies) &&
10
+ Array.isArray(value.requirements) &&
11
+ typeof value.scope === 'string';
12
+ }
13
+ function hasResourceLifecycle(value) {
14
+ return typeof value.acquire === 'function' &&
15
+ (typeof value.dispose === 'function' || value.dispose === null);
16
+ }
17
+ function isResourceDescriptor(value) {
18
+ return isRecord(value) &&
19
+ hasResourceIdentity(value) &&
20
+ hasResourceGraphData(value) &&
21
+ hasResourceLifecycle(value);
22
+ }
23
+
24
+ function entries(record) {
25
+ return Object.entries(record);
26
+ }
27
+ export function ensureResourceDescriptor(resource, message) {
28
+ if (isResourceDescriptor(resource)) {
29
+ return resource;
30
+ }
31
+ throw new TypeError(message);
32
+ }
33
+
34
+ export function directResourceEntries(actions) {
35
+ return actions.flatMap(function actionResourceEntries(action) {
36
+ return action.kind === 'resources'
37
+ ? entries(action.resources).map(function resourceEntry([key, resource]) {
38
+ return { key, resource };
39
+ })
40
+ : [];
41
+ });
42
+ }
43
+ export function resourceWrapperSteps(actions) {
44
+ return actions.flatMap(function actionResourceStep(action) {
45
+ return action.kind === 'resources' || action.kind === 'runtime' ? [action] : [];
46
+ });
47
+ }
48
+ export function stepRuntimeGraphs(actions) {
49
+ return actions.flatMap(function actionRuntimeGraph(action) {
50
+ return action.kind === 'runtime' ? runtimeGraphLeaves(action.runtime) : [];
51
+ });
52
+ }
53
+ export function lifecycleMessages(actions) {
54
+ const hasDirectResources = actions.some(function actionHasDirectResources(action) {
55
+ return action.kind === 'resources';
56
+ });
57
+ return hasDirectResources
58
+ ? {
59
+ acquisitionFailure: 'Resource acquisition failed.',
60
+ disposalFailure: 'Resource disposal failed.'
61
+ }
62
+ : {
63
+ acquisitionFailure: 'Runtime resource acquisition failed.',
64
+ disposalFailure: 'Runtime resource disposal failed.'
65
+ };
66
+ }
67
+
68
+ export function scopeWrapperStep(name, mapScope, collision = 'preserve-existing') {
69
+ return { collision, kind: 'scope', mapScope, name };
70
+ }
71
+ //# sourceMappingURL=resource-wrapper-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-wrapper-data.js","sourceRoot":"","sources":["../../../../../source/packages/test/resource-wrapper-data.ts"],"names":[],"mappings":"AAAA,OAAO,oBAEe,EAIrB,MAAM,yBAAuC,CAAC;AAqC/C,SAAS,QAAQ,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAwC;IACjE,OAAO,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAwC;IAClE,OAAO,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAC/B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY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BAAkB,CAAC,MAAM;QACrD,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAE,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAyC;IACvE,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,kBAAkB,CAAC,MAAM;QACrD,OAAO,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAyC;IACvE,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,wBAAwB,CAAC,MAAM;QAC5E,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,OAAO,kBAAkB;QACrB,CAAC,CAAC;YACE,kBAAkB,EAAE,8BAA8B;YAClD,eAAe,EAAE,2BAA2B;SAC/C;QACD,CAAC,CAAC;YACE,kBAAkB,EAAE,sCAAsC;YAC1D,eAAe,EAAE,mCAAmC;SACvD,CAAC;AACV,CAAC;;MASK,0BAI4B,KAKlB,EACZ,QAAiE,EACjE,YAAmD,mBAAmB;IAEtE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACxD,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { resourceWrapperLifecycleError } from "@overkill-dev/run/resource-lifecycle";
2
+ function isResourceScopeInput(value) {
3
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
4
+ }
5
+ function isRuntimeTestScope(value, runtimeGraph) {
6
+ if (!isResourceScopeInput(value)) {
7
+ return false;
8
+ }
9
+ const runtimes = Object.hasOwn(value, 'runtimes') ? Reflect.get(value, 'runtimes') : {};
10
+ return isResourceScopeInput(runtimes) && (runtimeGraph.kind === 'composed-runtimes'
11
+ ? runtimeGraph.runtimes.every(function hasComposedRuntimeScope(runtime) {
12
+ return Reflect.get(runtimes, runtime.name) !== undefined;
13
+ })
14
+ : Reflect.get(runtimes, runtimeGraph.name) !== undefined);
15
+ }
16
+ function failRuntimeScopeComposition(handles) {
17
+ throw resourceWrapperLifecycleError('Runtime scope composition failed.', handles);
18
+ }
19
+ export function composeRuntimeScope(scope, runtimeGraph, handles) {
20
+ const runtimes = Object.hasOwn(scope, 'runtimes') ? Reflect.get(scope, 'runtimes') : {};
21
+ if (!isResourceScopeInput(runtimes)) {
22
+ throw resourceWrapperLifecycleError('Runtime scope composition failed.', runtimes);
23
+ }
24
+ const newRuntimeScopes = runtimeGraph.kind === 'composed-runtimes'
25
+ ? handles
26
+ : { [runtimeGraph.name]: handles };
27
+ const duplicateRuntimeName = Object.keys(newRuntimeScopes).find(function runtimeNameExists(runtimeName) {
28
+ return Object.hasOwn(runtimes, runtimeName);
29
+ });
30
+ if (duplicateRuntimeName !== undefined) {
31
+ throw resourceWrapperLifecycleError(`Runtime scope "${duplicateRuntimeName}" already exists.`, handles);
32
+ }
33
+ const composed = Object.freeze({
34
+ ...scope,
35
+ runtimes: Object.freeze({
36
+ ...runtimes,
37
+ ...newRuntimeScopes
38
+ })
39
+ });
40
+ return isRuntimeTestScope(composed, runtimeGraph)
41
+ ? composed
42
+ : failRuntimeScopeComposition(handles);
43
+ }
44
+ //# sourceMappingURL=resource-wrapper-runtime-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-wrapper-runtime-scope.js","sourceRoot":"","sources":["../../../../../source/packages/test/resource-wrapper-runtime-scope.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAA0C,CAAC;AASzF,SAAS,oBAAoB,CAAC,KAAc;IACxC,OAAO,OAAO,KAAK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AAmC,EAAE,QAAQ,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,KAAK,mBAAmB;QAC9D,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACvC,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,iBAAiB,CAAC,WAAW;QAClG,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,IAAI,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,6BAA6B,CAAC,kBAAkB,oBAAoB,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC5G,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;QAC3B,GAAG,KAAK;QACR,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;YACpB,GAAG,QAAQ;YACX,GAAG,gBAAgB;SACtB,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,kBAAkB,CAAe,QAAQ,EAAE,YAAY,CAAC;QAC3D,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import "@overkill-dev/resources";
2
+ import "@overkill-dev/run/resource-lifecycle";
3
+ //# sourceMappingURL=resource-wrapper-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-wrapper-session.js","sourceRoot":"","sources":["../../../../../source/packages/test/resource-wrapper-session.ts"],"names":[],"mappings":"AAAA,OAMO,yBAAuC,CAAC;AAC/C,OAYO,sCAA0C,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type TestBody, type TestControlsInput, type TestScope } from '@overkill-dev/engine';
2
+ import { type AuthoringAnnotations, type AuthoringControls } from './authoring-test-data.ts';
3
+ export type ParameterizedTestScope<Row, Scope extends TestScope = TestScope> = Scope & {
4
+ readonly parameters: Row;
5
+ };
6
+ export type TableTestBody<Row, Scope extends TestScope = TestScope> = (scope: ParameterizedTestScope<Row, Scope>) => ReturnType<TestBody>;
7
+ type AnyTableTestBody = (scope: never) => ReturnType<TestBody>;
8
+ export type TableDefinition<Row, ControlsType extends TestControlsInput = AuthoringControls, Body extends AnyTableTestBody = TableTestBody<Row>> = {
9
+ readonly annotations?: AuthoringAnnotations;
10
+ readonly caseTitle?: (parameters: Row, index: number) => string;
11
+ readonly cases: readonly Row[];
12
+ readonly controls?: ControlsType;
13
+ readonly test: Body;
14
+ readonly title: string;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=table-authoring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-authoring.d.ts","sourceRoot":"","sources":["../../../../../source/packages/test/table-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,QAGQ,EACb,KAAK,iBAAiB,EAItB,KAAK,SAAS,EACjB,MAAM,sBAAiC,CAAC;AACzC,OAAO,EAKH,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACzB,MAAM,0BAA0B,CAAC;MAa5B,MAAM,sBAAsB,CAC9B,GAAG,EACH,KAAK,SAAS,SAAS,GAAG,SAAS,IACnC,KAAK,GAAG;IACR,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,aAAa,CACrB,GAAG,EACH,KAAK,SAAS,SAAS,GAAG,SAAS,IACnC,CACA,KAAK,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,CAAC,KACxC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE1B,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE/D,MAAM,MAAM,eAAe,CACvB,GAAG,EACH,YAAY,SAAS,iBAAiB,GAAG,iBAAiB,EAC1D,IAAI,SAAS,gBAAgB,GAAG,aAAa,CAAC,GAAG,CAAC,IAClD;IACA,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAChE,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B,CAAC;AA6GF"}
@@ -0,0 +1,77 @@
1
+ import { createTable, attachTestBodyResourceAttachments, hasTestBodyResourceAttachments, readTestBodyResourceAttachments } from "@overkill-dev/engine";
2
+ import { createAuthoringAnnotations, createAuthoringControls, readAuthoringAnnotations, readAuthoringControls } from "./authoring-test-data.js";
3
+ import { activeMacroSourceLocations, definitionLocationsForAuthoringCall, runWithForwardedSourceLocations } from "./authoring-source-locations.js";
4
+ import { readAuthoringRecord, readAuthoringString, readAuthoringTestBody } from "./authoring-input.js";
5
+ import { attachComposedResourceActions } from "./resource-wrapper-composition.js";
6
+ import { scopeWrapperStep } from "./resource-wrapper-data.js";
7
+ const tableArgumentsError = 'table() requires ({ title, cases, annotations?, controls?, caseTitle?, test }).';
8
+ function defaultCaseTitle(index) {
9
+ return `case ${index + 1}`;
10
+ }
11
+ function tableCaseTitle(caseTitle, parameters, index) {
12
+ const title = caseTitle === null ? defaultCaseTitle(index) : caseTitle(parameters, index);
13
+ if (typeof title !== 'string') {
14
+ throw new TypeError('table() caseTitle must return a string.');
15
+ }
16
+ return title;
17
+ }
18
+ function tableCaseBody(definition, parameters, sourceLocations, facadeActions) {
19
+ const caseBody = attachComposedResourceActions([
20
+ ...facadeActions,
21
+ scopeWrapperStep('table() parameters', function addTableParameters() {
22
+ return { parameters };
23
+ }, 'replace-existing')
24
+ ], definition.test, 'table');
25
+ const body = async function runTableCase(scope) {
26
+ return await runWithForwardedSourceLocations(sourceLocations, async function runMacroGeneratedTableCase() {
27
+ return await caseBody(scope);
28
+ });
29
+ };
30
+ return hasTestBodyResourceAttachments(caseBody)
31
+ ? attachTestBodyResourceAttachments(body, readTestBodyResourceAttachments(caseBody))
32
+ : body;
33
+ }
34
+ function ensureTableDefinitionShape(definition) {
35
+ if (definition.caseTitle !== undefined && typeof definition.caseTitle !== 'function') {
36
+ throw new TypeError(tableArgumentsError);
37
+ }
38
+ if (!Array.isArray(definition.cases)) {
39
+ throw new TypeError(tableArgumentsError);
40
+ }
41
+ readAuthoringTestBody(definition.test);
42
+ }
43
+ function readTableDefinition(definition) {
44
+ const runtimeDefinition = readAuthoringRecord(definition, tableArgumentsError);
45
+ ensureTableDefinitionShape(runtimeDefinition);
46
+ return {
47
+ annotations: readAuthoringAnnotations(runtimeDefinition.annotations ?? {}),
48
+ caseTitle: definition.caseTitle ?? null,
49
+ cases: definition.cases,
50
+ controls: readAuthoringControls(runtimeDefinition.controls ?? {}),
51
+ test: definition.test,
52
+ title: readAuthoringString(runtimeDefinition.title, tableArgumentsError)
53
+ };
54
+ }
55
+ function tableCases(definition, facadeActions) {
56
+ const sourceLocations = activeMacroSourceLocations();
57
+ return definition.cases.map(function createTableCase(parameters, index) {
58
+ return {
59
+ annotations: {},
60
+ body: tableCaseBody(definition, parameters, sourceLocations, facadeActions),
61
+ controls: {},
62
+ parameters,
63
+ title: tableCaseTitle(definition.caseTitle, parameters, index)
64
+ };
65
+ });
66
+ }
67
+ export function createAuthoredTable(facadeAnnotations, facadeControls, definition, facadeActions = []) {
68
+ const tableDefinition = readTableDefinition(definition);
69
+ return createTable({
70
+ annotations: createAuthoringAnnotations(facadeAnnotations, tableDefinition.annotations),
71
+ cases: tableCases(tableDefinition, facadeActions),
72
+ controls: createAuthoringControls(facadeControls, tableDefinition.controls),
73
+ definitionLocations: definitionLocationsForAuthoringCall(),
74
+ title: tableDefinition.title
75
+ });
76
+ }
77
+ //# sourceMappingURL=table-authoring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-authoring.js","sourceRoot":"","sources":["../../../../../source/packages/test/table-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EAOX,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAElC,MAAM,sBAAiC,CAAC;AACzC,OAAO,EACH,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,0BAA0B,EAC1B,mCAAmC,EACnC,+BAA+B,EAClC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EACH,gBAAgB,EAEnB,MAAM,4BAA4B,CAAC;AA0CpC,MAAM,mBAAmB,GAAG,iFAAiF,CAAC;AAE9G,SAAS,gBAAgB,CAAC,KAAa;IACnC,OAAO,QAAQ,KAAK,GAAG,CAAC,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,cAAc,CACnB,SAA8D,EAC9D,UAAe,EACf,KAAa;IAEb,MAAM,KAAK,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAE1F,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAClB,UAAuC,EACvC,UAAe,EACf,eAAoD,EACpD,aAA+C;IAE/C,MAAM,QAAQ,GAAG,6BAA6B,C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3
- This version is a placeholder published only to claim the npm name `@overkill-dev/bench` so a Trusted Publisher
4
- can subsequently be configured for it. It contains no real package content and is published already
5
- deprecated.
3
+ Ordinary test-node authoring for the Overkill benchmark package.
6
4
 
7
- Workaround context: https://github.com/npm/cli/issues/8544
5
+ The current facade exports `test`, `skippedTest`, `suite`, `table`,
6
+ `defineMacro`, and `defineParameterizedTestBody`. These are the same
7
+ family-neutral constructors used by `@overkill-dev/test`, with the same
8
+ assertion, validation, and source-location behavior.
9
+
10
+ ```ts
11
+ import { suite, test } from '@overkill-dev/bench';
12
+
13
+ const fixture = { entries: [ 1, 2, 3, 4, 5 ] };
14
+
15
+ export const testNode = suite('fixture validation', [
16
+ test('contains the expected entries', (scope) => {
17
+ scope.assert.equal(fixture.entries.length, 5);
18
+ return scope.assert.collect();
19
+ })
20
+ ]);
21
+ ```
22
+
23
+ Nodes compose with ordinary `@overkill-dev/test` suites, tables, and macros.
24
+ Creating a node does not execute its body or select a test family.
25
+
26
+ Public types include `AuthoringAnnotations`, `AuthoringControls`,
27
+ `ParameterizedTestScope`, `TableDefinition`, `TableTestBody`, `Suite`,
28
+ `Table`, `TestBody`, `TestCase`, `TestNode`, `TestScope`, and
29
+ `TestScopeAssertContext`.
30
+
31
+ This facade does not yet measure performance. `benchmark(...)`, workloads,
32
+ measurement strategies, budgets, and `overkill bench` commands are separate
33
+ implementation milestones. `@overkill-dev/test/bench` remains reserved until
34
+ standard distribution integration. Advanced authoring and runtime binding
35
+ remain available from `@overkill-dev/test` and its resources subpath.