@autometa/runner 0.6.4 → 1.0.0-rc.1

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/index.js CHANGED
@@ -1,495 +1,2103 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
1
+ import { createStepRuntime, tryGetWorld } from '@autometa/executor';
2
+ export { Pending, ScenarioPendingError, ToDo, clearStepDocstring, clearStepTable, configureStepDocstrings, configureStepTables, consumeDocstring, consumeTable, getDocstring, getDocstringInfo, getDocstringMediaType, getRawTable, getTable, isScenarioPendingError, markScenarioPending, resetStepDocstringConfig, resetStepTableConfig, setStepDocstring, setStepDocstringInfo, setStepTable } from '@autometa/executor';
3
+ import { createParameterTypes, createDefaultParameterTypes } from '@autometa/cucumber-expressions';
4
+ import { createScopes, DecoratorScopeRegistry } from '@autometa/scopes';
5
+ import { ParameterTypeRegistry } from '@cucumber/cucumber-expressions';
6
+ import { ensure, createEnsureFactory, createDefaultEnsureFactory } from '@autometa/assertions';
7
+ import { createToken, createContainer, Scope, createDecorators } from '@autometa/injection';
8
+ import { coordinateFeature } from '@autometa/coordinator';
9
+
10
+ var __accessCheck = (obj, member, msg) => {
11
+ if (!member.has(obj))
12
+ throw TypeError("Cannot " + msg);
13
+ };
14
+ var __privateGet = (obj, member, getter) => {
15
+ __accessCheck(obj, member, "read from private field");
16
+ return getter ? getter.call(obj) : member.get(obj);
17
+ };
18
+ var __privateAdd = (obj, member, value) => {
19
+ if (member.has(obj))
20
+ throw TypeError("Cannot add the same private member more than once");
21
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
11
22
  };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ var __privateSet = (obj, member, value, setter) => {
24
+ __accessCheck(obj, member, "write to private field");
25
+ setter ? setter.call(obj, value) : member.set(obj, value);
26
+ return value;
27
+ };
28
+ var _registry;
29
+ var ParameterRegistryAdapter = class {
30
+ constructor(options = {}) {
31
+ __privateAdd(this, _registry, void 0);
32
+ __privateSet(this, _registry, options.registry ?? new ParameterTypeRegistry());
33
+ }
34
+ get registry() {
35
+ return __privateGet(this, _registry);
36
+ }
37
+ get parameterTypes() {
38
+ return __privateGet(this, _registry).parameterTypes;
39
+ }
40
+ lookupByTypeName(name) {
41
+ return __privateGet(this, _registry).lookupByTypeName(name);
42
+ }
43
+ lookupByRegexp(parameterTypeRegexp, expressionRegexp, text) {
44
+ return __privateGet(this, _registry).lookupByRegexp(parameterTypeRegexp, expressionRegexp, text);
45
+ }
46
+ defineParameterType(definition) {
47
+ const parameter = definition;
48
+ __privateGet(this, _registry).defineParameterType(parameter);
49
+ return parameter;
17
50
  }
18
- return to;
19
51
  };
20
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/index.ts
32
- var src_exports = {};
33
- __export(src_exports, {
34
- After: () => After2,
35
- AfterExamples: () => AfterExamples2,
36
- AfterFeature: () => AfterFeature2,
37
- AfterRule: () => AfterRule2,
38
- AfterScenarioOutline: () => AfterScenarioOutline2,
39
- App: () => import_app2.App,
40
- AppType: () => AppType,
41
- AutomationError: () => import_errors.AutomationError,
42
- AutometaApp: () => import_app2.AutometaApp,
43
- AutometaWorld: () => import_app2.AutometaWorld,
44
- Before: () => Before2,
45
- BeforeExamples: () => BeforeExamples2,
46
- BeforeFeature: () => BeforeFeature2,
47
- BeforeRule: () => BeforeRule2,
48
- BeforeScenarioOutline: () => BeforeScenarioOutline2,
49
- Bind: () => import_bind_decorator.Bind,
50
- Constructor: () => import_injection.Constructor,
51
- Container: () => import_injection.Container,
52
- DataTable: () => import_gherkin.DataTable,
53
- Dates: () => import_datetime.Dates,
54
- DisposeMethod: () => import_injection2.DisposeMethod,
55
- DisposeTagFilter: () => import_injection2.DisposeTagFilter,
56
- Feature: () => Feature2,
57
- FileObject: () => import_file_proxies.FileObject,
58
- Fixture: () => import_injection.Fixture,
59
- GetAccessedCount: () => import_fixture_proxies.GetAccessedCount,
60
- GetAssignedValues: () => import_fixture_proxies.GetAssignedValues,
61
- Given: () => Given2,
62
- HTable: () => import_gherkin.HTable,
63
- INJECTION_SCOPE: () => import_injection.INJECTION_SCOPE,
64
- Inject: () => import_injection.Inject,
65
- InjectionScope: () => import_injection.InjectionScope,
66
- MTable: () => import_gherkin.MTable,
67
- Pass: () => import_scopes.Pass,
68
- Rule: () => Rule2,
69
- Scenario: () => Scenario2,
70
- ScenarioOutline: () => ScenarioOutline2,
71
- Setup: () => Setup2,
72
- TableDocument: () => import_gherkin.TableDocument,
73
- Teardown: () => Teardown2,
74
- Then: () => Then2,
75
- Time: () => import_datetime.Time,
76
- TrackAccess: () => import_fixture_proxies.TrackAccess,
77
- Types: () => import_scopes4.Types,
78
- VTable: () => import_gherkin.VTable,
79
- When: () => When2,
80
- World: () => import_app2.World,
81
- defineConfig: () => defineConfig,
82
- defineParameterType: () => defineParameterType,
83
- getApp: () => import_app3.getApp,
84
- makeTestEmitter: () => makeTestEmitter,
85
- raise: () => import_errors.raise
86
- });
87
- module.exports = __toCommonJS(src_exports);
88
-
89
- // src/config.ts
90
- var import_config = require("@autometa/config");
91
- var CONFIG = new import_config.Config(/* @__PURE__ */ new Map());
92
- var defineConfig = import_config.defineConfig.bind(null, CONFIG);
52
+ _registry = new WeakMap();
53
+ function createParameterRegistryAdapter(options) {
54
+ return new ParameterRegistryAdapter(options);
55
+ }
93
56
 
94
- // src/parameters.ts
95
- var import_cucumber_expressions = require("@cucumber/cucumber-expressions");
96
- var import_cucumber_expressions2 = require("@autometa/cucumber-expressions");
97
- var PARAM_REGISTRY = new import_cucumber_expressions.ParameterTypeRegistry();
98
- var defineParameterType = import_cucumber_expressions2.defineParameterType.bind(null, PARAM_REGISTRY);
99
- defineParameterType(
100
- import_cucumber_expressions2.NumberParam,
101
- import_cucumber_expressions2.BooleanParam,
102
- import_cucumber_expressions2.PrimitiveParam,
103
- import_cucumber_expressions2.TextParam,
104
- import_cucumber_expressions2.DateParam,
105
- import_cucumber_expressions2.OrdinalParam
106
- );
57
+ // src/core/runner-context.ts
58
+ var RunnerContext = class _RunnerContext {
59
+ constructor(options = {}) {
60
+ this.registryAdapter = options.parameterRegistry ? createParameterRegistryAdapter({ registry: options.parameterRegistry }) : createParameterRegistryAdapter();
61
+ this.defineParameterTypeFn = createParameterTypes(
62
+ options.parameterTypesOptions
63
+ );
64
+ this.registerDefaultParameterTypesFn = createDefaultParameterTypes(
65
+ options.parameterTypesOptions
66
+ );
67
+ const scopeOptions = _RunnerContext.extractScopeOptions(options);
68
+ this.scopesInternal = createScopes({
69
+ ...scopeOptions,
70
+ parameterRegistry: this.registryAdapter
71
+ });
72
+ if (options.registerDefaultParameterTypes !== false) {
73
+ this.registerDefaultParameterTypes();
74
+ }
75
+ if (options.parameterTypes && options.parameterTypes.length > 0) {
76
+ this.defineParameterTypes(...options.parameterTypes);
77
+ }
78
+ }
79
+ get scopes() {
80
+ return this.scopesInternal;
81
+ }
82
+ get parameterRegistry() {
83
+ return this.registryAdapter.registry;
84
+ }
85
+ get parameterRegistryAdapter() {
86
+ return this.registryAdapter;
87
+ }
88
+ get plan() {
89
+ return this.scopesInternal.plan();
90
+ }
91
+ defineParameterType(definition) {
92
+ return this.defineParameterTypeFn(this.parameterRegistry, definition);
93
+ }
94
+ defineParameterTypes(...definitions) {
95
+ this.defineParameterTypeFn.many(this.parameterRegistry, ...definitions);
96
+ return this.parameterRegistry;
97
+ }
98
+ registerDefaultParameterTypes() {
99
+ return this.registerDefaultParameterTypesFn(this.parameterRegistry);
100
+ }
101
+ lookupParameterType(name) {
102
+ return this.parameterRegistry.lookupByTypeName(name);
103
+ }
104
+ static extractScopeOptions(options) {
105
+ const {
106
+ parameterRegistry: _parameterRegistry,
107
+ parameterTypes: _parameterTypes,
108
+ parameterTypesOptions: _parameterTypesOptions,
109
+ registerDefaultParameterTypes: _registerDefaultParameterTypes,
110
+ ...scopeOptions
111
+ } = options;
112
+ return scopeOptions;
113
+ }
114
+ };
107
115
 
108
- // src/scopes.ts
109
- var import_scopes = require("@autometa/scopes");
110
- var import_coordinator = require("@autometa/coordinator");
116
+ // src/dsl/create-runner.ts
117
+ var hookWrapperCache = /* @__PURE__ */ new WeakMap();
118
+ function wrapHook(hook) {
119
+ if (typeof hook !== "function") {
120
+ throw new TypeError("Hook DSL must be a function");
121
+ }
122
+ const cached = hookWrapperCache.get(hook);
123
+ if (cached) {
124
+ return cached;
125
+ }
126
+ const callable = (first, second, third) => {
127
+ if (typeof first === "string") {
128
+ return hook(first, second, third);
129
+ }
130
+ return hook(first, second);
131
+ };
132
+ hookWrapperCache.set(hook, callable);
133
+ const assignVariant = (variant, source) => {
134
+ if (typeof source === "function") {
135
+ callable[variant] = wrapHook(
136
+ source
137
+ );
138
+ }
139
+ };
140
+ assignVariant("skip", hook.skip);
141
+ assignVariant("only", hook.only);
142
+ assignVariant("failing", hook.failing);
143
+ assignVariant("concurrent", hook.concurrent);
144
+ return callable;
145
+ }
146
+ function wrapStepHandler(handler) {
147
+ return (world, ...args) => {
148
+ const runtime = createStepRuntime(world);
149
+ const withRuntime = handler;
150
+ const withoutRuntime = handler;
151
+ const paramLength = typeof handler === "function" ? handler.length : 0;
152
+ const expectsRuntime = paramLength > args.length + 1;
153
+ const invocationArgs = expectsRuntime ? [...args, runtime, world] : [...args, world];
154
+ const callable = expectsRuntime ? withRuntime : withoutRuntime;
155
+ return Reflect.apply(callable, world, invocationArgs);
156
+ };
157
+ }
158
+ function enhanceStepDsl(dsl) {
159
+ const cache = /* @__PURE__ */ new Map();
160
+ const convert = (source) => {
161
+ const existing = cache.get(source);
162
+ if (existing) {
163
+ return existing;
164
+ }
165
+ const invoke = (expression, handler, options) => source(
166
+ expression,
167
+ wrapStepHandler(handler),
168
+ options
169
+ );
170
+ cache.set(source, invoke);
171
+ invoke.skip = convert(source.skip);
172
+ invoke.only = convert(source.only);
173
+ invoke.failing = convert(source.failing);
174
+ invoke.concurrent = convert(source.concurrent);
175
+ invoke.tags = (...inputs) => convert(source.tags(...inputs));
176
+ return invoke;
177
+ };
178
+ return convert(dsl);
179
+ }
180
+ function createRunner(options = {}) {
181
+ const context = new RunnerContext(options);
182
+ const scopes = context.scopes;
183
+ const given = enhanceStepDsl(scopes.given);
184
+ const when = enhanceStepDsl(scopes.when);
185
+ const then = enhanceStepDsl(scopes.then);
186
+ const and = enhanceStepDsl(scopes.and);
187
+ const but = enhanceStepDsl(scopes.but);
188
+ const defineParameterTypesFromList = (definitions) => context.defineParameterTypes(...definitions);
189
+ const beforeFeatureHook = wrapHook(scopes.beforeFeature);
190
+ const afterFeatureHook = wrapHook(scopes.afterFeature);
191
+ const beforeRuleHook = wrapHook(scopes.beforeRule);
192
+ const afterRuleHook = wrapHook(scopes.afterRule);
193
+ const beforeScenarioHook = wrapHook(scopes.beforeScenario);
194
+ const afterScenarioHook = wrapHook(scopes.afterScenario);
195
+ const beforeScenarioOutlineHook = wrapHook(scopes.beforeScenarioOutline);
196
+ const afterScenarioOutlineHook = wrapHook(scopes.afterScenarioOutline);
197
+ const beforeStepHook = wrapHook(scopes.beforeStep);
198
+ const afterStepHook = wrapHook(scopes.afterStep);
199
+ const environment = {
200
+ context,
201
+ parameterRegistry: context.parameterRegistry,
202
+ getPlan: () => context.plan,
203
+ defineParameterType: (definition) => context.defineParameterType(definition),
204
+ defineParameterTypes: (...definitions) => context.defineParameterTypes(...definitions),
205
+ defineParameterTypesFromList,
206
+ registerDefaultParameterTypes: () => context.registerDefaultParameterTypes(),
207
+ lookupParameterType: (name) => context.lookupParameterType(name),
208
+ feature: scopes.feature,
209
+ rule: scopes.rule,
210
+ scenario: scopes.scenario,
211
+ scenarioOutline: scopes.scenarioOutline,
212
+ given,
213
+ when,
214
+ then,
215
+ and,
216
+ but,
217
+ beforeFeature: beforeFeatureHook,
218
+ afterFeature: afterFeatureHook,
219
+ beforeRule: beforeRuleHook,
220
+ afterRule: afterRuleHook,
221
+ beforeScenario: beforeScenarioHook,
222
+ afterScenario: afterScenarioHook,
223
+ beforeScenarioOutline: beforeScenarioOutlineHook,
224
+ afterScenarioOutline: afterScenarioOutlineHook,
225
+ beforeStep: beforeStepHook,
226
+ afterStep: afterStepHook,
227
+ Given: given,
228
+ When: when,
229
+ Then: then,
230
+ And: and,
231
+ But: but,
232
+ plan: scopes.plan,
233
+ BeforeFeature: beforeFeatureHook,
234
+ AfterFeature: afterFeatureHook,
235
+ BeforeRule: beforeRuleHook,
236
+ AfterRule: afterRuleHook,
237
+ BeforeScenario: beforeScenarioHook,
238
+ AfterScenario: afterScenarioHook,
239
+ BeforeScenarioOutline: beforeScenarioOutlineHook,
240
+ AfterScenarioOutline: afterScenarioOutlineHook,
241
+ BeforeStep: beforeStepHook,
242
+ AfterStep: afterStepHook
243
+ };
244
+ return environment;
245
+ }
111
246
 
112
- // src/events.ts
113
- var events_exports = {};
114
- __export(events_exports, {
115
- makeTestEmitter: () => makeTestEmitter
116
- });
117
- var import_events = require("@autometa/events");
118
- __reExport(events_exports, require("@autometa/events"));
247
+ // src/dsl/create-global-runner.ts
248
+ function createGlobalRunner(initialOptions) {
249
+ let lastOptions = initialOptions;
250
+ function instantiate(options) {
251
+ if (options) {
252
+ lastOptions = options;
253
+ return createRunner(options);
254
+ }
255
+ if (lastOptions) {
256
+ return createRunner(lastOptions);
257
+ }
258
+ return createRunner();
259
+ }
260
+ let current = instantiate(initialOptions);
261
+ const target = {
262
+ reset(options) {
263
+ current = instantiate(options);
264
+ return current;
265
+ },
266
+ useEnvironment(environment) {
267
+ current = environment;
268
+ return current;
269
+ },
270
+ getEnvironment() {
271
+ return current;
272
+ }
273
+ };
274
+ const forwardedKeys = /* @__PURE__ */ new Set([
275
+ "reset",
276
+ "useEnvironment",
277
+ "getEnvironment"
278
+ ]);
279
+ return new Proxy(target, {
280
+ get(obj, prop, receiver) {
281
+ if (forwardedKeys.has(prop)) {
282
+ return Reflect.get(obj, prop, receiver);
283
+ }
284
+ const value = current[prop];
285
+ if (typeof value === "function") {
286
+ return value.bind(current);
287
+ }
288
+ return value;
289
+ },
290
+ has(_, prop) {
291
+ if (forwardedKeys.has(prop)) {
292
+ return true;
293
+ }
294
+ return prop in current;
295
+ },
296
+ ownKeys() {
297
+ const forwardable = Array.from(forwardedKeys).filter(
298
+ (key) => typeof key === "string" || typeof key === "symbol"
299
+ );
300
+ const keys = /* @__PURE__ */ new Set([
301
+ ...Reflect.ownKeys(current),
302
+ ...forwardable
303
+ ]);
304
+ return Array.from(keys);
305
+ },
306
+ getOwnPropertyDescriptor(obj, prop) {
307
+ if (forwardedKeys.has(prop)) {
308
+ return {
309
+ configurable: true,
310
+ enumerable: false,
311
+ value: Reflect.get(obj, prop)
312
+ };
313
+ }
314
+ return Object.getOwnPropertyDescriptor(current, prop);
315
+ }
316
+ });
317
+ }
318
+ function createDecoratorRunner(options = {}) {
319
+ const context = new RunnerContext(options);
320
+ const registry = new DecoratorScopeRegistry();
321
+ const scopeOptions = RunnerContext.extractScopeOptions(options);
322
+ return {
323
+ feature(token, descriptor) {
324
+ registry.registerFeature(token, descriptor);
325
+ },
326
+ rule(featureToken, token, descriptor) {
327
+ registry.registerRule(featureToken, token, descriptor);
328
+ },
329
+ scenario(token, descriptor, scenarioContext) {
330
+ registry.registerScenario(token, descriptor, scenarioContext);
331
+ },
332
+ step(scenarioToken, keyword, expression, handler, options2) {
333
+ registry.registerStep(scenarioToken, {
334
+ keyword,
335
+ expression,
336
+ handler,
337
+ ...options2 ? { options: options2 } : {}
338
+ });
339
+ },
340
+ hook(scopeToken, type, handler, description, options2) {
341
+ registry.registerHook(scopeToken, {
342
+ type,
343
+ handler,
344
+ ...description ? { description } : {},
345
+ ...options2 ? { options: options2 } : {}
346
+ });
347
+ },
348
+ context,
349
+ buildPlan() {
350
+ return registry.build(
351
+ createScopeOptions(scopeOptions, context.parameterRegistryAdapter)
352
+ );
353
+ }
354
+ };
355
+ }
356
+ function createScopeOptions(opts, parameterRegistry) {
357
+ return {
358
+ ...opts,
359
+ parameterRegistry
360
+ };
361
+ }
119
362
 
120
- // src/event-logger.ts
121
- var import_colors_cli = __toESM(require("colors-cli"), 1);
122
- var GroupLogEvents = class {
123
- onFeatureStart({ title }) {
124
- console.group(title);
125
- console.group();
126
- }
127
- onFeatureEnd({ title, status }) {
128
- console.groupEnd();
129
- console.groupEnd();
130
- console.log(colorStatus(status, `Ending ${title}`));
131
- }
132
- onScenarioStart({ title }) {
133
- console.group(title);
134
- console.group();
135
- }
136
- onScenarioEnd({ title, status }) {
137
- console.groupEnd();
138
- console.groupEnd();
139
- console.log(colorStatus(status, `Ending ${title}`));
140
- }
141
- onScenarioOutlineStart(opts) {
142
- console.group(opts.title);
143
- console.group();
144
- }
145
- onScenarioOutlineEnd({ title, status }) {
146
- console.groupEnd();
147
- console.groupEnd();
148
- console.log(colorStatus(status, `Ending ${title}`));
149
- }
150
- onRuleStart({ title }) {
151
- console.group(title);
152
- console.group();
153
- }
154
- onRuleEnd({ title, status }) {
155
- console.groupEnd();
156
- console.groupEnd();
157
- console.log(colorStatus(status, `Ending ${title}`));
158
- }
159
- onStepStart({ title }) {
160
- console.group(title);
161
- console.group();
162
- }
163
- onStepEnd({ title, status }) {
164
- console.groupEnd();
165
- console.groupEnd();
166
- console.log(colorStatus(status, `Ending ${title}`));
167
- }
168
- onBeforeStart({ title, status }) {
169
- if (status === "SKIPPED") {
170
- return;
363
+ // src/decorators/create-runner-decorators.ts
364
+ function createRunnerDecorators(environment) {
365
+ const stepMetadata = /* @__PURE__ */ new WeakMap();
366
+ const hookMetadata = /* @__PURE__ */ new WeakMap();
367
+ const scenarioRecords = /* @__PURE__ */ new WeakMap();
368
+ const pendingScenarioData = /* @__PURE__ */ new WeakMap();
369
+ const ruleRecords = /* @__PURE__ */ new WeakMap();
370
+ const pendingRuleData = /* @__PURE__ */ new WeakMap();
371
+ const featureHooks = /* @__PURE__ */ new WeakMap();
372
+ function getOrCreateRecordMap(constructor) {
373
+ let records = scenarioRecords.get(constructor);
374
+ if (!records) {
375
+ records = /* @__PURE__ */ new Map();
376
+ scenarioRecords.set(constructor, records);
171
377
  }
172
- console.group(title);
173
- console.group();
378
+ return records;
174
379
  }
175
- onBeforeEnd({ title, status }) {
176
- if (status === "SKIPPED") {
177
- return;
380
+ function getOrCreatePending(constructor) {
381
+ let pending = pendingScenarioData.get(constructor);
382
+ if (!pending) {
383
+ pending = /* @__PURE__ */ new Map();
384
+ pendingScenarioData.set(constructor, pending);
178
385
  }
179
- console.groupEnd();
180
- console.groupEnd();
181
- console.log(colorStatus(status, `Ending ${title}`));
386
+ return pending;
182
387
  }
183
- onAfterStart({ title, status }) {
184
- if (status === "SKIPPED") {
185
- return;
388
+ function getOrCreateRuleRecordMap(constructor) {
389
+ let records = ruleRecords.get(constructor);
390
+ if (!records) {
391
+ records = /* @__PURE__ */ new Map();
392
+ ruleRecords.set(constructor, records);
186
393
  }
187
- console.group(title);
188
- console.group();
394
+ return records;
189
395
  }
190
- onAfterEnd({ title, status }) {
191
- if (status === "SKIPPED") {
396
+ function getOrCreateRulePending(constructor) {
397
+ let pending = pendingRuleData.get(constructor);
398
+ if (!pending) {
399
+ pending = /* @__PURE__ */ new Map();
400
+ pendingRuleData.set(constructor, pending);
401
+ }
402
+ return pending;
403
+ }
404
+ function addStepAssociation(constructor, scenarioKey, stepKey) {
405
+ const records = scenarioRecords.get(constructor);
406
+ const record = records?.get(scenarioKey);
407
+ if (record) {
408
+ record.steps.add(stepKey);
192
409
  return;
193
410
  }
194
- console.groupEnd();
195
- console.groupEnd();
196
- console.log(colorStatus(status, `Ending ${title}`));
411
+ const pending = getOrCreatePending(constructor);
412
+ let entry = pending.get(scenarioKey);
413
+ if (!entry) {
414
+ entry = { steps: /* @__PURE__ */ new Set(), hooks: [] };
415
+ pending.set(scenarioKey, entry);
416
+ }
417
+ entry.steps.add(stepKey);
197
418
  }
198
- onTeardownStart({ title, status }) {
199
- if (status === "SKIPPED") {
419
+ function addHookAssociation(constructor, scenarioKey, hook) {
420
+ const records = scenarioRecords.get(constructor);
421
+ const record = records?.get(scenarioKey);
422
+ if (record) {
423
+ record.hooks.push(hook);
200
424
  return;
201
425
  }
202
- console.group(title);
203
- console.group();
426
+ const pending = getOrCreatePending(constructor);
427
+ let entry = pending.get(scenarioKey);
428
+ if (!entry) {
429
+ entry = { steps: /* @__PURE__ */ new Set(), hooks: [] };
430
+ pending.set(scenarioKey, entry);
431
+ }
432
+ entry.hooks.push(hook);
204
433
  }
205
- onTeardownEnd({ title, status }) {
206
- if (status === "SKIPPED") {
434
+ function addRuleScenarioAssociation(constructor, ruleKey, scenarioKey) {
435
+ const records = ruleRecords.get(constructor);
436
+ const record = records?.get(ruleKey);
437
+ if (record) {
438
+ record.scenarios.add(scenarioKey);
439
+ return record.token;
440
+ }
441
+ const pending = getOrCreateRulePending(constructor);
442
+ let entry = pending.get(ruleKey);
443
+ if (!entry) {
444
+ entry = { scenarios: /* @__PURE__ */ new Set(), hooks: [] };
445
+ pending.set(ruleKey, entry);
446
+ }
447
+ entry.scenarios.add(scenarioKey);
448
+ return void 0;
449
+ }
450
+ function addRuleHookAssociation(constructor, ruleKey, hook) {
451
+ const records = ruleRecords.get(constructor);
452
+ const record = records?.get(ruleKey);
453
+ if (record) {
454
+ record.hooks.push(hook);
207
455
  return;
208
456
  }
209
- console.groupEnd();
210
- console.groupEnd();
211
- console.log(colorStatus(status, `Ending ${title}`));
457
+ const pending = getOrCreateRulePending(constructor);
458
+ let entry = pending.get(ruleKey);
459
+ if (!entry) {
460
+ entry = { scenarios: /* @__PURE__ */ new Set(), hooks: [] };
461
+ pending.set(ruleKey, entry);
462
+ }
463
+ entry.hooks.push(hook);
212
464
  }
213
- onSetupStart({ title, status }) {
214
- if (status === "SKIPPED") {
465
+ function recordFeatureHook(constructor, hook) {
466
+ const hooks = featureHooks.get(constructor);
467
+ if (hooks) {
468
+ hooks.push(hook);
215
469
  return;
216
470
  }
217
- console.group(title);
218
- console.group();
471
+ featureHooks.set(constructor, [hook]);
472
+ }
473
+ function recordStepMetadata(target, propertyKey, metadata) {
474
+ let map = stepMetadata.get(target);
475
+ if (!map) {
476
+ map = /* @__PURE__ */ new Map();
477
+ stepMetadata.set(target, map);
478
+ }
479
+ map.set(propertyKey, metadata);
480
+ }
481
+ function recordHookMetadata(target, propertyKey, metadata) {
482
+ let map = hookMetadata.get(target);
483
+ if (!map) {
484
+ map = /* @__PURE__ */ new Map();
485
+ hookMetadata.set(target, map);
486
+ }
487
+ map.set(propertyKey, metadata);
488
+ }
489
+ function getStepMetadata(target, propertyKey) {
490
+ return stepMetadata.get(target)?.get(propertyKey);
491
+ }
492
+ function getHookMetadata(target, propertyKey) {
493
+ return hookMetadata.get(target)?.get(propertyKey);
494
+ }
495
+ function normalizeSteps(value) {
496
+ return value ? new Set(value) : /* @__PURE__ */ new Set();
497
+ }
498
+ function isReadonlyArray(value) {
499
+ return Array.isArray(value);
500
+ }
501
+ function toArray(input) {
502
+ return isReadonlyArray(input) ? input : [input];
503
+ }
504
+ function buildStepOptions(options) {
505
+ const candidate = {};
506
+ if (options.tags) {
507
+ candidate.tags = [...options.tags];
508
+ }
509
+ if (options.timeout !== void 0) {
510
+ candidate.timeout = options.timeout;
511
+ }
512
+ if (options.mode) {
513
+ candidate.mode = options.mode;
514
+ }
515
+ if (options.data) {
516
+ candidate.data = { ...options.data };
517
+ }
518
+ return Object.keys(candidate).length > 0 ? candidate : void 0;
219
519
  }
220
- onSetupEnd({ title, status }) {
221
- if (status === "SKIPPED") {
520
+ function buildHookOptions(options) {
521
+ const candidate = {};
522
+ if (options.tags) {
523
+ candidate.tags = [...options.tags];
524
+ }
525
+ if (options.timeout !== void 0) {
526
+ candidate.timeout = options.timeout;
527
+ }
528
+ if (options.order !== void 0) {
529
+ candidate.order = options.order;
530
+ }
531
+ if (options.mode) {
532
+ candidate.mode = options.mode;
533
+ }
534
+ if (options.data) {
535
+ candidate.data = { ...options.data };
536
+ }
537
+ return Object.keys(candidate).length > 0 ? candidate : void 0;
538
+ }
539
+ function normalizeTagInputs(inputs) {
540
+ if (inputs.length === 0) {
541
+ return [];
542
+ }
543
+ const tags = [];
544
+ for (const input of inputs) {
545
+ if (typeof input === "string") {
546
+ if (input.length > 0) {
547
+ tags.push(input);
548
+ }
549
+ continue;
550
+ }
551
+ if (Array.isArray(input)) {
552
+ for (const tag of input) {
553
+ if (typeof tag === "string" && tag.length > 0) {
554
+ tags.push(tag);
555
+ }
556
+ }
557
+ }
558
+ }
559
+ return tags.length > 0 ? Array.from(new Set(tags)) : [];
560
+ }
561
+ function mergeStepOptions(base, extras) {
562
+ if (!base && !extras) {
563
+ return void 0;
564
+ }
565
+ const mergedTags = [
566
+ ...base?.tags ?? [],
567
+ ...extras?.tags ?? []
568
+ ];
569
+ const timeout = extras?.timeout ?? base?.timeout;
570
+ const mode = extras?.mode ?? base?.mode;
571
+ const data = {
572
+ ...base?.data ?? {},
573
+ ...extras?.data ?? {}
574
+ };
575
+ const tagsResult = mergedTags.length > 0 ? Array.from(new Set(mergedTags)) : void 0;
576
+ const hasData = Object.keys(data).length > 0;
577
+ if (!tagsResult && timeout === void 0 && mode === void 0 && !hasData) {
578
+ return void 0;
579
+ }
580
+ return {
581
+ ...tagsResult ? { tags: tagsResult } : {},
582
+ ...timeout !== void 0 ? { timeout } : {},
583
+ ...mode !== void 0 ? { mode } : {},
584
+ ...hasData ? { data } : {}
585
+ };
586
+ }
587
+ function applyExecutionModeToStepOptions(mode, options) {
588
+ if (!options) {
589
+ return mode === "default" ? void 0 : { mode };
590
+ }
591
+ return mode !== "default" ? { ...options, mode } : { ...options };
592
+ }
593
+ function clonePendingOption(pending) {
594
+ if (typeof pending === "boolean" || typeof pending === "string") {
595
+ return pending;
596
+ }
597
+ const reason = pending.reason;
598
+ return reason !== void 0 ? { reason } : {};
599
+ }
600
+ function cloneScopeOptions(options) {
601
+ const {
602
+ tags,
603
+ description,
604
+ timeout,
605
+ mode,
606
+ source,
607
+ data,
608
+ examples,
609
+ pending
610
+ } = options;
611
+ const cloned = {
612
+ ...tags ? { tags: [...tags] } : {},
613
+ ...description !== void 0 ? { description } : {},
614
+ ...timeout !== void 0 ? {
615
+ timeout: typeof timeout === "number" ? timeout : { ...timeout }
616
+ } : {},
617
+ ...mode !== void 0 ? { mode } : {},
618
+ ...source ? { source: { ...source } } : {},
619
+ ...data ? { data: { ...data } } : {},
620
+ ...examples ? {
621
+ examples: examples.map((example) => ({
622
+ ...example,
623
+ ...example.tags ? { tags: [...example.tags] } : {},
624
+ table: example.table.map((row) => [...row])
625
+ }))
626
+ } : {}
627
+ };
628
+ if (pending !== void 0) {
629
+ cloned.pending = clonePendingOption(pending);
630
+ }
631
+ return cloned;
632
+ }
633
+ function Feature(options = {}) {
634
+ return (target) => {
635
+ const constructor = target;
636
+ const descriptor = {
637
+ name: options.name ?? constructor.name ?? "Feature",
638
+ ...cloneScopeOptions(options)
639
+ };
640
+ environment.feature(constructor, descriptor);
641
+ const featureHookRefs = featureHooks.get(constructor);
642
+ if (featureHookRefs) {
643
+ for (const hook of featureHookRefs) {
644
+ const metadata = getHookMetadata(constructor.prototype, hook.propertyKey) ?? getHookMetadata(constructor, hook.propertyKey);
645
+ if (!metadata) {
646
+ throw new Error(
647
+ `Hook metadata missing for ${String(hook.propertyKey)} on feature ${descriptor.name}`
648
+ );
649
+ }
650
+ environment.hook(
651
+ constructor,
652
+ hook.type,
653
+ metadata.handler,
654
+ hook.description,
655
+ hook.options ?? metadata.options
656
+ );
657
+ }
658
+ featureHooks.delete(constructor);
659
+ }
660
+ const rules = ruleRecords.get(constructor);
661
+ if (rules) {
662
+ for (const [ruleKey, ruleRecord] of rules.entries()) {
663
+ environment.rule(constructor, ruleRecord.token, ruleRecord.descriptor);
664
+ const hooks = ruleRecord.hooks;
665
+ for (const hook of hooks) {
666
+ const metadata = getHookMetadata(constructor.prototype, hook.propertyKey) ?? getHookMetadata(constructor, hook.propertyKey);
667
+ if (!metadata) {
668
+ throw new Error(
669
+ `Hook metadata missing for ${String(hook.propertyKey)} on rule ${String(ruleKey)} of feature ${descriptor.name}`
670
+ );
671
+ }
672
+ environment.hook(
673
+ ruleRecord.token,
674
+ hook.type,
675
+ metadata.handler,
676
+ hook.description,
677
+ hook.options ?? metadata.options
678
+ );
679
+ }
680
+ }
681
+ }
682
+ const records = scenarioRecords.get(constructor);
683
+ if (records) {
684
+ for (const [scenarioKey, record] of records.entries()) {
685
+ if (record.ruleKey) {
686
+ const ruleRecord = rules?.get(record.ruleKey);
687
+ if (!ruleRecord) {
688
+ throw new Error(
689
+ `Scenario ${record.descriptor.name} references unknown rule ${String(record.ruleKey)}`
690
+ );
691
+ }
692
+ record.ruleToken = record.ruleToken ?? ruleRecord.token;
693
+ ruleRecord.scenarios.add(scenarioKey);
694
+ }
695
+ environment.scenario(record.token, record.descriptor, {
696
+ feature: constructor,
697
+ ...record.ruleToken ? { rule: record.ruleToken } : {}
698
+ });
699
+ for (const stepKey of record.steps) {
700
+ const metadata = getStepMetadata(constructor.prototype, stepKey) ?? getStepMetadata(constructor, stepKey);
701
+ if (!metadata) {
702
+ throw new Error(
703
+ `Step metadata missing for ${String(stepKey)} on feature ${descriptor.name}`
704
+ );
705
+ }
706
+ environment.step(
707
+ record.token,
708
+ metadata.keyword,
709
+ metadata.expression,
710
+ metadata.handler,
711
+ metadata.options
712
+ );
713
+ }
714
+ for (const hook of record.hooks) {
715
+ const metadata = getHookMetadata(constructor.prototype, hook.propertyKey) ?? getHookMetadata(constructor, hook.propertyKey);
716
+ if (!metadata) {
717
+ throw new Error(
718
+ `Hook metadata missing for ${String(hook.propertyKey)} on feature ${descriptor.name}`
719
+ );
720
+ }
721
+ environment.hook(
722
+ record.token,
723
+ hook.type,
724
+ metadata.handler,
725
+ hook.description,
726
+ hook.options ?? metadata.options
727
+ );
728
+ }
729
+ }
730
+ scenarioRecords.delete(constructor);
731
+ }
732
+ ruleRecords.delete(constructor);
733
+ pendingRuleData.delete(constructor);
734
+ pendingScenarioData.delete(constructor);
735
+ };
736
+ }
737
+ function Rule(options) {
738
+ return (target, propertyKey) => {
739
+ const constructor = resolveConstructor(target);
740
+ const descriptor = {
741
+ name: options.name,
742
+ ...cloneScopeOptions(options)
743
+ };
744
+ const records = getOrCreateRuleRecordMap(constructor);
745
+ if (records.has(propertyKey)) {
746
+ throw new Error(`Rule ${String(propertyKey)} already registered on feature ${constructor.name}`);
747
+ }
748
+ const token = Symbol(`rule:${String(propertyKey)}`);
749
+ const record = {
750
+ token,
751
+ descriptor,
752
+ hooks: [],
753
+ scenarios: /* @__PURE__ */ new Set()
754
+ };
755
+ const pending = pendingRuleData.get(constructor)?.get(propertyKey);
756
+ if (pending) {
757
+ for (const scenarioKey of pending.scenarios) {
758
+ record.scenarios.add(scenarioKey);
759
+ }
760
+ record.hooks.push(...pending.hooks);
761
+ pendingRuleData.get(constructor)?.delete(propertyKey);
762
+ }
763
+ records.set(propertyKey, record);
764
+ const scenarios = scenarioRecords.get(constructor);
765
+ if (scenarios) {
766
+ for (const scenarioKey of record.scenarios) {
767
+ const scenarioRecord = scenarios.get(scenarioKey);
768
+ if (scenarioRecord) {
769
+ scenarioRecord.ruleToken = token;
770
+ }
771
+ }
772
+ }
773
+ };
774
+ }
775
+ function Scenario(options) {
776
+ return (target, propertyKey) => {
777
+ const constructor = resolveConstructor(target);
778
+ const records = getOrCreateRecordMap(constructor);
779
+ const descriptor = {
780
+ name: options.name,
781
+ kind: options.kind ?? "scenario",
782
+ ...cloneScopeOptions(options)
783
+ };
784
+ const token = Symbol(`scenario:${String(propertyKey)}`);
785
+ const steps = normalizeSteps(options.steps);
786
+ const hooks = [];
787
+ const ruleKey = options.rule;
788
+ let ruleToken;
789
+ if (ruleKey !== void 0) {
790
+ ruleToken = addRuleScenarioAssociation(constructor, ruleKey, propertyKey);
791
+ }
792
+ const pending = pendingScenarioData.get(constructor)?.get(propertyKey);
793
+ if (pending) {
794
+ for (const stepKey of pending.steps) {
795
+ steps.add(stepKey);
796
+ }
797
+ hooks.push(...pending.hooks);
798
+ pendingScenarioData.get(constructor)?.delete(propertyKey);
799
+ }
800
+ const record = {
801
+ token,
802
+ descriptor,
803
+ steps,
804
+ hooks,
805
+ ...ruleKey !== void 0 ? { ruleKey } : {},
806
+ ...ruleToken ? { ruleToken } : {}
807
+ };
808
+ records.set(propertyKey, record);
809
+ };
810
+ }
811
+ function createStepDecorator(keyword) {
812
+ const factoryCache = /* @__PURE__ */ new Map();
813
+ const getCachedFactory = (mode, inheritedOptions) => {
814
+ const cacheForOptions = factoryCache.get(inheritedOptions);
815
+ return cacheForOptions?.get(mode);
816
+ };
817
+ const storeFactory = (mode, inheritedOptions, factory) => {
818
+ let cacheForOptions = factoryCache.get(inheritedOptions);
819
+ if (!cacheForOptions) {
820
+ cacheForOptions = /* @__PURE__ */ new Map();
821
+ factoryCache.set(inheritedOptions, cacheForOptions);
822
+ }
823
+ cacheForOptions.set(mode, factory);
824
+ };
825
+ const buildFactory = (mode, inheritedOptions) => {
826
+ const cached = getCachedFactory(mode, inheritedOptions);
827
+ if (cached) {
828
+ return cached;
829
+ }
830
+ const decorator = (expression, options) => {
831
+ if (!options || !options.scenario) {
832
+ throw new Error("Step decorator requires a scenario property key");
833
+ }
834
+ const scenarioRefs = toArray(options.scenario);
835
+ const explicitOptions = buildStepOptions(options);
836
+ const baseWithMode = mergeStepOptions(
837
+ inheritedOptions,
838
+ applyExecutionModeToStepOptions(mode)
839
+ );
840
+ const mergedOptions = mergeStepOptions(baseWithMode, explicitOptions);
841
+ const finalOptions = applyExecutionModeToStepOptions(mode, mergedOptions);
842
+ return (target, propertyKey, descriptor) => {
843
+ const handler = descriptor?.value;
844
+ if (typeof handler !== "function") {
845
+ throw new Error(
846
+ `Step decorator can only be applied to methods. ${String(propertyKey)} is not a function.`
847
+ );
848
+ }
849
+ recordStepMetadata(target, propertyKey, {
850
+ keyword,
851
+ expression,
852
+ handler,
853
+ ...finalOptions ? { options: finalOptions } : {}
854
+ });
855
+ const constructor = resolveConstructor(target);
856
+ for (const scenarioKey of scenarioRefs) {
857
+ addStepAssociation(constructor, scenarioKey, propertyKey);
858
+ }
859
+ };
860
+ };
861
+ storeFactory(mode, inheritedOptions, decorator);
862
+ decorator.tags = (...inputs) => {
863
+ const normalizedTags = normalizeTagInputs(inputs);
864
+ if (normalizedTags.length === 0) {
865
+ return decorator;
866
+ }
867
+ const tagOptions = {
868
+ tags: normalizedTags
869
+ };
870
+ const merged = mergeStepOptions(inheritedOptions, tagOptions);
871
+ return buildFactory(mode, merged);
872
+ };
873
+ decorator.skip = mode === "skip" ? decorator : buildFactory("skip", inheritedOptions);
874
+ decorator.only = mode === "only" ? decorator : buildFactory("only", inheritedOptions);
875
+ decorator.failing = mode === "failing" ? decorator : buildFactory("failing", inheritedOptions);
876
+ decorator.concurrent = mode === "concurrent" ? decorator : buildFactory("concurrent", inheritedOptions);
877
+ return decorator;
878
+ };
879
+ return buildFactory("default");
880
+ }
881
+ function createScenarioHookDecorator(type) {
882
+ return (options) => {
883
+ if (!options || !options.scenario) {
884
+ throw new Error("Hook decorator requires a scenario property key");
885
+ }
886
+ const scenarioRefs = toArray(options.scenario);
887
+ const hookOptions = buildHookOptions(options);
888
+ const description = options.description;
889
+ return (target, propertyKey, descriptor) => {
890
+ const handler = descriptor?.value;
891
+ if (typeof handler !== "function") {
892
+ throw new Error(
893
+ `Hook decorator can only be applied to methods. ${String(propertyKey)} is not a function.`
894
+ );
895
+ }
896
+ recordHookMetadata(target, propertyKey, {
897
+ handler,
898
+ ...hookOptions ? { options: hookOptions } : {}
899
+ });
900
+ const constructor = resolveConstructor(target);
901
+ const hookRef = {
902
+ propertyKey,
903
+ type,
904
+ ...description ? { description } : {},
905
+ ...hookOptions ? { options: hookOptions } : {}
906
+ };
907
+ for (const scenarioKey of scenarioRefs) {
908
+ addHookAssociation(constructor, scenarioKey, hookRef);
909
+ }
910
+ };
911
+ };
912
+ }
913
+ function createRuleHookDecorator(type) {
914
+ return (options) => {
915
+ if (!options || !options.rule) {
916
+ throw new Error("Rule hook decorator requires a rule property key");
917
+ }
918
+ const ruleRefs = toArray(options.rule);
919
+ const hookOptions = buildHookOptions(options);
920
+ const description = options.description;
921
+ return (target, propertyKey, descriptor) => {
922
+ const handler = descriptor?.value;
923
+ if (typeof handler !== "function") {
924
+ throw new Error(
925
+ `Hook decorator can only be applied to methods. ${String(propertyKey)} is not a function.`
926
+ );
927
+ }
928
+ recordHookMetadata(target, propertyKey, {
929
+ handler,
930
+ ...hookOptions ? { options: hookOptions } : {}
931
+ });
932
+ const constructor = resolveConstructor(target);
933
+ const hookRef = {
934
+ propertyKey,
935
+ type,
936
+ ...description ? { description } : {},
937
+ ...hookOptions ? { options: hookOptions } : {}
938
+ };
939
+ for (const ruleKey of ruleRefs) {
940
+ addRuleHookAssociation(constructor, ruleKey, hookRef);
941
+ }
942
+ };
943
+ };
944
+ }
945
+ function createFeatureHookDecorator(type) {
946
+ return (options = {}) => {
947
+ const hookOptions = buildHookOptions(options);
948
+ const description = options.description;
949
+ return (target, propertyKey, descriptor) => {
950
+ const handler = descriptor?.value;
951
+ if (typeof handler !== "function") {
952
+ throw new Error(
953
+ `Hook decorator can only be applied to methods. ${String(propertyKey)} is not a function.`
954
+ );
955
+ }
956
+ recordHookMetadata(target, propertyKey, {
957
+ handler,
958
+ ...hookOptions ? { options: hookOptions } : {}
959
+ });
960
+ const constructor = resolveConstructor(target);
961
+ const hookRef = {
962
+ propertyKey,
963
+ type,
964
+ ...description ? { description } : {},
965
+ ...hookOptions ? { options: hookOptions } : {}
966
+ };
967
+ recordFeatureHook(constructor, hookRef);
968
+ };
969
+ };
970
+ }
971
+ function resolveConstructor(target) {
972
+ const ctor = target.constructor;
973
+ if (typeof ctor !== "function") {
974
+ throw new Error("Decorated target does not expose a constructor");
975
+ }
976
+ return ctor;
977
+ }
978
+ return {
979
+ Feature,
980
+ Rule,
981
+ Scenario,
982
+ Given: createStepDecorator("Given"),
983
+ When: createStepDecorator("When"),
984
+ Then: createStepDecorator("Then"),
985
+ And: createStepDecorator("And"),
986
+ But: createStepDecorator("But"),
987
+ BeforeFeature: createFeatureHookDecorator("beforeFeature"),
988
+ AfterFeature: createFeatureHookDecorator("afterFeature"),
989
+ BeforeRule: createRuleHookDecorator("beforeRule"),
990
+ AfterRule: createRuleHookDecorator("afterRule"),
991
+ BeforeScenario: createScenarioHookDecorator("beforeScenario"),
992
+ AfterScenario: createScenarioHookDecorator("afterScenario"),
993
+ BeforeScenarioOutline: createScenarioHookDecorator("beforeScenarioOutline"),
994
+ AfterScenarioOutline: createScenarioHookDecorator("afterScenarioOutline")
995
+ };
996
+ }
997
+ var WORLD_TOKEN = createToken(
998
+ "@autometa/runner/world"
999
+ );
1000
+
1001
+ // src/bindings/create-bindings-ts.ts
1002
+ var BINDING_METADATA_KEY = Symbol("autometa:binding");
1003
+ var INJECT_PARAM_KEY = "autometa:inject_param";
1004
+ function createBindingsTS(stepsEnvironment) {
1005
+ if (typeof Reflect === "undefined" || typeof Reflect.getMetadata !== "function") {
1006
+ throw new Error(
1007
+ "bindingsTS() requires reflect-metadata. Add `import 'reflect-metadata'` at the top of your step-definitions file."
1008
+ );
1009
+ }
1010
+ const globalContainer = createContainer();
1011
+ const { Inject, LazyInject } = createDecorators(globalContainer);
1012
+ const { Given: GivenFn, When: WhenFn, Then: ThenFn, And: AndFn, But: BothFn } = stepsEnvironment;
1013
+ const instanceCache = /* @__PURE__ */ new WeakMap();
1014
+ const containerCache = /* @__PURE__ */ new WeakMap();
1015
+ function getScenarioContainer(world) {
1016
+ const worldObj = world;
1017
+ let container = containerCache.get(worldObj);
1018
+ if (!container) {
1019
+ container = globalContainer.createChild();
1020
+ container.registerValue(WORLD_TOKEN, world);
1021
+ containerCache.set(worldObj, container);
1022
+ }
1023
+ return container;
1024
+ }
1025
+ function getStepInstance(BindingClass, world) {
1026
+ const worldObj = world;
1027
+ let cache = instanceCache.get(worldObj);
1028
+ if (!cache) {
1029
+ cache = /* @__PURE__ */ new Map();
1030
+ instanceCache.set(worldObj, cache);
1031
+ }
1032
+ let instance = cache.get(BindingClass);
1033
+ if (instance) {
1034
+ return instance;
1035
+ }
1036
+ const container = getScenarioContainer(world);
1037
+ instance = container.resolve(BindingClass);
1038
+ cache.set(BindingClass, instance);
1039
+ return instance;
1040
+ }
1041
+ function getBindingMetadata(target) {
1042
+ let metadata = Reflect.getMetadata(BINDING_METADATA_KEY, target);
1043
+ if (!metadata) {
1044
+ metadata = { steps: [] };
1045
+ Reflect.defineMetadata(BINDING_METADATA_KEY, metadata, target);
1046
+ }
1047
+ return metadata;
1048
+ }
1049
+ function getBindingSteps(target) {
1050
+ const proto = target.prototype;
1051
+ return Reflect.getMetadata(BINDING_METADATA_KEY, target) ?? (proto ? Reflect.getMetadata(BINDING_METADATA_KEY, proto) : void 0);
1052
+ }
1053
+ function registerBindingClass(BindingClass) {
1054
+ const metadata = getBindingSteps(BindingClass);
1055
+ if (!metadata) {
222
1056
  return;
223
1057
  }
224
- console.groupEnd();
225
- console.groupEnd();
226
- console.log(colorStatus(status, `Ending ${title}`));
227
- }
228
- onBeforeFeatureStart(opts) {
229
- console.group(opts.title);
230
- console.group();
231
- }
232
- onBeforeFeatureEnd(opts) {
233
- console.groupEnd();
234
- console.groupEnd();
235
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
236
- }
237
- onAfterFeatureStart(opts) {
238
- console.group(opts.title);
239
- console.group();
240
- }
241
- onAfterFeatureEnd(opts) {
242
- console.groupEnd();
243
- console.groupEnd();
244
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
245
- }
246
- onBeforeRuleStart(opts) {
247
- console.group(opts.title);
248
- console.group();
249
- }
250
- onBeforeRuleEnd(opts) {
251
- console.groupEnd();
252
- console.groupEnd();
253
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
254
- }
255
- onAfterRuleStart(opts) {
256
- console.group(opts.title);
257
- console.group();
258
- }
259
- onAfterRuleEnd(opts) {
260
- console.groupEnd();
261
- console.groupEnd();
262
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
263
- }
264
- onBeforeScenarioOutlineStart(opts) {
265
- console.group(opts.title);
266
- console.group();
267
- }
268
- onBeforeScenarioOutlineEnd(opts) {
269
- console.groupEnd();
270
- console.groupEnd();
271
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
272
- }
273
- onBeforeExamplesStart(opts) {
274
- console.group(opts.title);
275
- console.group();
276
- }
277
- onBeforeExamplesEnd(opts) {
278
- console.groupEnd();
279
- console.groupEnd();
280
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
281
- }
282
- onAfterExamplesStart(opts) {
283
- console.group(opts.title);
284
- console.group();
285
- }
286
- onAfterExamplesEnd(opts) {
287
- console.groupEnd();
288
- console.groupEnd();
289
- console.log(colorStatus(opts.status, `Ending ${opts.title}`));
1058
+ for (const step of metadata.steps) {
1059
+ const handler = (...args) => {
1060
+ const world = args[args.length - 1];
1061
+ const stepArgs = args.slice(0, -1);
1062
+ const instance = getStepInstance(BindingClass, world);
1063
+ const method = instance[step.propertyKey];
1064
+ if (typeof method !== "function") {
1065
+ throw new Error(`Step method ${String(step.propertyKey)} is not a function`);
1066
+ }
1067
+ return method.apply(instance, stepArgs);
1068
+ };
1069
+ switch (step.keyword) {
1070
+ case "Given":
1071
+ GivenFn(step.expression, handler);
1072
+ break;
1073
+ case "When":
1074
+ WhenFn(step.expression, handler);
1075
+ break;
1076
+ case "Then":
1077
+ ThenFn(step.expression, handler);
1078
+ break;
1079
+ case "And":
1080
+ AndFn(step.expression, handler);
1081
+ break;
1082
+ case "But":
1083
+ BothFn(step.expression, handler);
1084
+ break;
1085
+ }
1086
+ }
1087
+ }
1088
+ function Binding() {
1089
+ return (target) => {
1090
+ const existing = Reflect.getMetadata(BINDING_METADATA_KEY, target.prototype);
1091
+ if (existing) {
1092
+ Reflect.defineMetadata(BINDING_METADATA_KEY, existing, target);
1093
+ }
1094
+ const paramTokens = Reflect.getMetadata(INJECT_PARAM_KEY, target);
1095
+ const deps = [];
1096
+ if (paramTokens) {
1097
+ const maxIndex = Math.max(...paramTokens.keys());
1098
+ for (let i = 0; i <= maxIndex; i++) {
1099
+ const token = paramTokens.get(i);
1100
+ if (token) {
1101
+ deps[i] = token;
1102
+ }
1103
+ }
1104
+ }
1105
+ globalContainer.registerClass(target, {
1106
+ scope: Scope.TRANSIENT,
1107
+ deps
1108
+ });
1109
+ registerBindingClass(target);
1110
+ };
1111
+ }
1112
+ function createStepDecorator(keyword) {
1113
+ return (expression) => {
1114
+ return (target, propertyKey, _descriptor) => {
1115
+ const metadata = getBindingMetadata(target);
1116
+ metadata.steps.push({
1117
+ propertyKey,
1118
+ keyword,
1119
+ expression
1120
+ });
1121
+ };
1122
+ };
1123
+ }
1124
+ function Injectable(options) {
1125
+ return (target) => {
1126
+ globalContainer.registerClass(target, {
1127
+ scope: options?.scope ?? Scope.TRANSIENT
1128
+ });
1129
+ };
1130
+ }
1131
+ return {
1132
+ Binding,
1133
+ Given: createStepDecorator("Given"),
1134
+ When: createStepDecorator("When"),
1135
+ Then: createStepDecorator("Then"),
1136
+ And: createStepDecorator("And"),
1137
+ But: createStepDecorator("But"),
1138
+ Injectable,
1139
+ Inject,
1140
+ LazyInject,
1141
+ container: globalContainer
1142
+ };
1143
+ }
1144
+ function coordinateRunnerFeature(options) {
1145
+ const {
1146
+ environment,
1147
+ feature,
1148
+ config,
1149
+ runtime,
1150
+ plan,
1151
+ adapterFactory,
1152
+ planBuilder,
1153
+ registerPlan,
1154
+ featureScope,
1155
+ hookLogger
1156
+ } = options;
1157
+ const scopePlan = plan ?? environment.getPlan();
1158
+ return coordinateFeature({
1159
+ feature,
1160
+ scopePlan,
1161
+ config,
1162
+ ...runtime ? { runtime } : {},
1163
+ ...adapterFactory ? { adapterFactory } : {},
1164
+ ...planBuilder ? { planBuilder } : {},
1165
+ ...registerPlan ? { registerPlan } : {},
1166
+ ...featureScope ? { featureScope } : {},
1167
+ ...hookLogger ? { hookLogger } : {}
1168
+ });
1169
+ }
1170
+
1171
+ // src/builder/create-runner-builder.ts
1172
+ function normalizeWorldFactory(factory) {
1173
+ const callable = factory;
1174
+ if (callable.length >= 1) {
1175
+ return factory;
1176
+ }
1177
+ return async (_context) => await callable();
1178
+ }
1179
+ var WORLD_INHERIT_KEYS = Symbol("autometa.runner.world.inherit");
1180
+ var STEPS_ENVIRONMENT_META = Symbol.for(
1181
+ "autometa.runner.steps.environment.meta"
1182
+ );
1183
+ var App = {
1184
+ compositionRoot(ctor, options) {
1185
+ return async (context) => {
1186
+ const { setup, ...registration } = options ?? {};
1187
+ if (setup) {
1188
+ await setup(context);
1189
+ }
1190
+ const registered = context.getRegisteredApp?.();
1191
+ if (registered !== void 0) {
1192
+ return registered;
1193
+ }
1194
+ const container = context.container;
1195
+ if (typeof container.isRegistered === "function" && container.isRegistered(ctor)) {
1196
+ return context.resolve(ctor);
1197
+ }
1198
+ return context.registerApp(
1199
+ ctor,
1200
+ registration
1201
+ );
1202
+ };
1203
+ }
1204
+ };
1205
+ function createRunnerBuilder(initial) {
1206
+ const state = initializeState(initial);
1207
+ return new RunnerBuilderImpl(state);
1208
+ }
1209
+ var RunnerBuilderImpl = class _RunnerBuilderImpl {
1210
+ constructor(state) {
1211
+ this.state = state;
1212
+ }
1213
+ fork() {
1214
+ const next = cloneBuilderState(this.state);
1215
+ return new _RunnerBuilderImpl(next);
1216
+ }
1217
+ derivable() {
1218
+ if (!this.state.derivedBuilders) {
1219
+ this.state.derivedBuilders = /* @__PURE__ */ new Map();
1220
+ }
1221
+ return this;
1222
+ }
1223
+ group(key) {
1224
+ const trimmed = key.trim();
1225
+ if (!trimmed) {
1226
+ throw new Error("group key must be a non-empty string");
1227
+ }
1228
+ if (!this.state.derivedBuilders) {
1229
+ this.state.derivedBuilders = /* @__PURE__ */ new Map();
1230
+ }
1231
+ const existing = this.state.derivedBuilders.get(trimmed);
1232
+ if (existing) {
1233
+ return new _RunnerBuilderImpl(existing);
1234
+ }
1235
+ const derived = cloneBuilderState(this.state);
1236
+ derived.stepsEnvironmentMeta = { kind: "group", group: trimmed };
1237
+ this.state.derivedBuilders.set(trimmed, derived);
1238
+ return new _RunnerBuilderImpl(derived);
1239
+ }
1240
+ extendWorld(value) {
1241
+ const baseFactory = this.state.worldFactory;
1242
+ const extensionFactory = typeof value === "function" ? normalizeWorldFactory(
1243
+ value
1244
+ ) : value ? createDefaultsWorldFactory(ensureWorldDefaults(value)) : async () => ({});
1245
+ const baseInheritance = getWorldInheritance(baseFactory);
1246
+ const extensionInheritance = getWorldInheritance(extensionFactory);
1247
+ const inheritance = baseInheritance || extensionInheritance ? /* @__PURE__ */ new Set([
1248
+ ...baseInheritance ? Array.from(baseInheritance) : [],
1249
+ ...extensionInheritance ? Array.from(extensionInheritance) : []
1250
+ ]) : void 0;
1251
+ const merged = async (context) => {
1252
+ const base = baseFactory ? await baseFactory(context) : {};
1253
+ const extension = await extensionFactory(
1254
+ context
1255
+ );
1256
+ const baseObj = ensureWorldObject(base);
1257
+ const extObj = ensureWorldObject(extension);
1258
+ return { ...baseObj, ...extObj };
1259
+ };
1260
+ if (inheritance && inheritance.size > 0) {
1261
+ Object.defineProperty(merged, WORLD_INHERIT_KEYS, {
1262
+ value: inheritance,
1263
+ writable: false,
1264
+ enumerable: false,
1265
+ configurable: false
1266
+ });
1267
+ }
1268
+ this.state.worldFactory = merged;
1269
+ delete this.state.ensureFactory;
1270
+ invalidateCaches(this.state);
1271
+ return new _RunnerBuilderImpl(this.state);
1272
+ }
1273
+ extendApp(app) {
1274
+ const next = normalizeAppFactory(app);
1275
+ const previous = this.state.appFactory;
1276
+ const chained = async (context) => {
1277
+ let currentApp;
1278
+ const readRegisteredApp = () => {
1279
+ const anyContext = context;
1280
+ return typeof anyContext.getRegisteredApp === "function" ? anyContext.getRegisteredApp() : void 0;
1281
+ };
1282
+ const updateWorldApp = (value) => {
1283
+ if (!value) {
1284
+ return;
1285
+ }
1286
+ const world = context.world;
1287
+ if (world && typeof world === "object") {
1288
+ world.app = value;
1289
+ }
1290
+ };
1291
+ if (previous) {
1292
+ const result = await previous(context);
1293
+ currentApp = result ?? readRegisteredApp();
1294
+ updateWorldApp(currentApp);
1295
+ }
1296
+ const nextResult = await next(context);
1297
+ const nextApp = nextResult ?? readRegisteredApp();
1298
+ if (nextApp !== void 0) {
1299
+ currentApp = nextApp;
1300
+ updateWorldApp(currentApp);
1301
+ }
1302
+ return currentApp;
1303
+ };
1304
+ this.state.appFactory = chained;
1305
+ delete this.state.ensureFactory;
1306
+ invalidateCaches(this.state);
1307
+ return new _RunnerBuilderImpl(this.state);
1308
+ }
1309
+ configure(update) {
1310
+ if (typeof update === "function") {
1311
+ const current = collectCurrentOptions(this.state);
1312
+ const merged = update(current);
1313
+ applyOptions(this.state, merged);
1314
+ return new _RunnerBuilderImpl(
1315
+ this.state
1316
+ );
1317
+ }
1318
+ applyOptions(this.state, update);
1319
+ return new _RunnerBuilderImpl(
1320
+ this.state
1321
+ );
1322
+ }
1323
+ expressionMap() {
1324
+ return new _RunnerBuilderImpl(
1325
+ this.state
1326
+ );
1327
+ }
1328
+ withWorld(value) {
1329
+ if (typeof value === "function") {
1330
+ this.state.worldFactory = normalizeWorldFactory(
1331
+ value
1332
+ );
1333
+ } else if (value) {
1334
+ const validated = ensureWorldDefaults(value);
1335
+ this.state.worldFactory = createDefaultsWorldFactory(validated);
1336
+ } else {
1337
+ this.state.worldFactory = async (_context) => ({});
1338
+ }
1339
+ delete this.state.ensureFactory;
1340
+ invalidateCaches(this.state);
1341
+ return new _RunnerBuilderImpl(this.state);
1342
+ }
1343
+ app(app) {
1344
+ this.state.appFactory = normalizeAppFactory(app);
1345
+ delete this.state.ensureFactory;
1346
+ invalidateCaches(this.state);
1347
+ return new _RunnerBuilderImpl(this.state);
1348
+ }
1349
+ assertions(setup) {
1350
+ this.state.ensureFactory = setup(ensure);
1351
+ invalidateCaches(this.state);
1352
+ return new _RunnerBuilderImpl(
1353
+ this.state
1354
+ );
1355
+ }
1356
+ assertionPlugins(plugins) {
1357
+ return this.assertions(
1358
+ (ensureInvoke) => {
1359
+ const factory = createEnsureFactory(
1360
+ ensureInvoke,
1361
+ plugins
1362
+ );
1363
+ return createImplicitEnsureProxy(factory);
1364
+ }
1365
+ );
1366
+ }
1367
+ parameterTypes(definitions) {
1368
+ const current = this.state.options.parameterTypes ?? [];
1369
+ this.state.options.parameterTypes = [
1370
+ ...current,
1371
+ ...definitions
1372
+ ];
1373
+ invalidateCaches(this.state);
1374
+ return new _RunnerBuilderImpl(this.state);
1375
+ }
1376
+ steps() {
1377
+ return ensureSteps(this.state);
1378
+ }
1379
+ decorators() {
1380
+ return ensureDecorators(this.state);
1381
+ }
1382
+ bindingsTS() {
1383
+ return ensureBindingsTS(this.state);
290
1384
  }
291
1385
  };
292
- function colorStatus(status, text) {
293
- switch (status) {
294
- case "FAILED":
295
- return `${import_colors_cli.default.red("x")} ${text}`;
296
- case "PASSED":
297
- return `${import_colors_cli.default.green("\u2714\uFE0F")} ${text}`;
298
- case "SKIPPED":
299
- return `${import_colors_cli.default.yellow("\u2298")} ${text}`;
1386
+ function initializeState(initial) {
1387
+ if (!initial) {
1388
+ return {
1389
+ options: {},
1390
+ stepsEnvironmentMeta: { kind: "root" }
1391
+ };
1392
+ }
1393
+ const { worldFactory, ...rest } = initial;
1394
+ const state = {
1395
+ options: { ...rest },
1396
+ stepsEnvironmentMeta: { kind: "root" }
1397
+ };
1398
+ if (worldFactory) {
1399
+ state.worldFactory = normalizeWorldFactory(
1400
+ worldFactory
1401
+ );
1402
+ }
1403
+ return state;
1404
+ }
1405
+ function cloneBuilderState(source) {
1406
+ const next = {
1407
+ options: cloneWithFallback(source.options)
1408
+ };
1409
+ if (source.stepsEnvironmentMeta) {
1410
+ next.stepsEnvironmentMeta = source.stepsEnvironmentMeta;
1411
+ }
1412
+ if (source.worldFactory) {
1413
+ next.worldFactory = source.worldFactory;
1414
+ }
1415
+ if (source.appFactory) {
1416
+ next.appFactory = source.appFactory;
1417
+ }
1418
+ if (source.ensureFactory) {
1419
+ next.ensureFactory = source.ensureFactory;
1420
+ }
1421
+ return next;
1422
+ }
1423
+ function collectCurrentOptions(state) {
1424
+ const options = {
1425
+ ...state.options
1426
+ };
1427
+ if (state.worldFactory) {
1428
+ options.worldFactory = state.worldFactory;
1429
+ }
1430
+ return options;
1431
+ }
1432
+ function applyOptions(state, options) {
1433
+ const { worldFactory, ...rest } = options;
1434
+ state.options = {
1435
+ ...state.options,
1436
+ ...rest
1437
+ };
1438
+ if ("worldFactory" in options) {
1439
+ if (worldFactory) {
1440
+ state.worldFactory = normalizeWorldFactory(
1441
+ worldFactory
1442
+ );
1443
+ } else {
1444
+ delete state.worldFactory;
1445
+ }
1446
+ delete state.ensureFactory;
1447
+ }
1448
+ invalidateCaches(state);
1449
+ }
1450
+ function normalizeAppFactory(app) {
1451
+ if (typeof app === "function") {
1452
+ if (app.length > 0) {
1453
+ return async (context) => await app(
1454
+ context
1455
+ );
1456
+ }
1457
+ return async () => await app();
1458
+ }
1459
+ return async () => app;
1460
+ }
1461
+ function createDefaultsWorldFactory(defaults) {
1462
+ const inheritance = extractWorldInheritance(defaults);
1463
+ const snapshot = cloneDefaults(defaults);
1464
+ const factory = async () => cloneDefaults(snapshot);
1465
+ if (inheritance.size > 0) {
1466
+ Object.defineProperty(factory, WORLD_INHERIT_KEYS, {
1467
+ value: inheritance,
1468
+ writable: false,
1469
+ enumerable: false,
1470
+ configurable: false
1471
+ });
1472
+ }
1473
+ return factory;
1474
+ }
1475
+ function ensureWorldDefaults(value) {
1476
+ if (!value || typeof value !== "object") {
1477
+ throw new TypeError(
1478
+ "withWorld defaults must be a non-null object"
1479
+ );
1480
+ }
1481
+ return value;
1482
+ }
1483
+ function cloneDefaults(defaults) {
1484
+ const structuredCloneFn = globalThis.structuredClone;
1485
+ if (structuredCloneFn) {
1486
+ try {
1487
+ return structuredCloneFn(defaults);
1488
+ } catch {
1489
+ }
1490
+ }
1491
+ return cloneWithFallback(defaults);
1492
+ }
1493
+ function extractWorldInheritance(defaults) {
1494
+ const inherit = defaults[WORLD_INHERIT_KEYS];
1495
+ if (!inherit || inherit.length === 0) {
1496
+ return /* @__PURE__ */ new Set();
1497
+ }
1498
+ const inheritance = new Set(inherit);
1499
+ return inheritance;
1500
+ }
1501
+ function getWorldInheritance(factory) {
1502
+ if (!factory) {
1503
+ return void 0;
1504
+ }
1505
+ const withMetadata = factory;
1506
+ return withMetadata[WORLD_INHERIT_KEYS];
1507
+ }
1508
+ function cloneWithFallback(value) {
1509
+ if (Array.isArray(value)) {
1510
+ return value.map((item) => cloneWithFallback(item));
1511
+ }
1512
+ if (value instanceof Map) {
1513
+ return new Map(
1514
+ Array.from(value.entries(), ([key, entry]) => [key, cloneWithFallback(entry)])
1515
+ );
1516
+ }
1517
+ if (value instanceof Set) {
1518
+ return new Set(Array.from(value.values(), (entry) => cloneWithFallback(entry)));
1519
+ }
1520
+ if (value && typeof value === "object") {
1521
+ const prototype = Object.getPrototypeOf(value);
1522
+ if (prototype === Object.prototype || prototype === null) {
1523
+ const result = {};
1524
+ for (const [key, entry] of Object.entries(value)) {
1525
+ result[key] = cloneWithFallback(entry);
1526
+ }
1527
+ return result;
1528
+ }
1529
+ }
1530
+ return value;
1531
+ }
1532
+ function invalidateCaches(state) {
1533
+ delete state.stepsCache;
1534
+ delete state.decoratorsCache;
1535
+ delete state.bindingsTSCache;
1536
+ }
1537
+ function ensureSteps(state) {
1538
+ let cache = state.stepsCache;
1539
+ if (!cache) {
1540
+ const options = buildRunnerOptions(state, { includeParameterTypes: true });
1541
+ const environment = createRunner(options);
1542
+ const globals = createGlobalRunner();
1543
+ globals.useEnvironment(environment);
1544
+ const ensureFactory = resolveEnsureFactory(state);
1545
+ const surface = attachStepsHelpers(
1546
+ state,
1547
+ environment,
1548
+ globals,
1549
+ ensureFactory
1550
+ );
1551
+ try {
1552
+ Object.defineProperty(surface, STEPS_ENVIRONMENT_META, {
1553
+ value: state.stepsEnvironmentMeta ?? { kind: "root" },
1554
+ writable: false,
1555
+ enumerable: false,
1556
+ configurable: false
1557
+ });
1558
+ } catch {
1559
+ }
1560
+ cache = {
1561
+ environment,
1562
+ globals,
1563
+ surface,
1564
+ ensureFactory
1565
+ };
1566
+ state.stepsCache = cache;
1567
+ }
1568
+ return cache.surface;
1569
+ }
1570
+ function ensureDecorators(state) {
1571
+ let cache = state.decoratorsCache;
1572
+ if (!cache) {
1573
+ const steps = ensureSteps(state);
1574
+ const options = buildRunnerOptions(state, {
1575
+ includeParameterTypes: false
1576
+ });
1577
+ const decoratorOptions = {
1578
+ ...options,
1579
+ parameterRegistry: steps.parameterRegistry,
1580
+ registerDefaultParameterTypes: false
1581
+ };
1582
+ const environment = createDecoratorRunner(decoratorOptions);
1583
+ const decorators = createRunnerDecorators(environment);
1584
+ const surface = attachDecoratorEnvironment(decorators, environment);
1585
+ cache = {
1586
+ environment,
1587
+ surface
1588
+ };
1589
+ state.decoratorsCache = cache;
1590
+ }
1591
+ return cache.surface;
1592
+ }
1593
+ function ensureBindingsTS(state) {
1594
+ let cache = state.bindingsTSCache;
1595
+ if (!cache) {
1596
+ const stepsEnv = ensureSteps(state);
1597
+ const surface = createBindingsTS(stepsEnv);
1598
+ cache = {
1599
+ surface
1600
+ };
1601
+ state.bindingsTSCache = cache;
1602
+ }
1603
+ return cache.surface;
1604
+ }
1605
+ function buildRunnerOptions(state, options) {
1606
+ const includeParameterTypes = options?.includeParameterTypes ?? true;
1607
+ const base = {
1608
+ ...state.options
1609
+ };
1610
+ if (!includeParameterTypes && "parameterTypes" in base) {
1611
+ delete base.parameterTypes;
1612
+ }
1613
+ const featureRegistry = ensureFeatureRegistry(state);
1614
+ const worldFactory = composeWorldFactory(
1615
+ state.worldFactory,
1616
+ state.appFactory,
1617
+ featureRegistry
1618
+ );
1619
+ if (worldFactory) {
1620
+ base.worldFactory = worldFactory;
1621
+ } else if ("worldFactory" in base) {
1622
+ delete base.worldFactory;
1623
+ }
1624
+ return base;
1625
+ }
1626
+ function composeWorldFactory(baseFactory, appFactory, featureRegistry) {
1627
+ if (!baseFactory && !appFactory && !featureRegistry) {
1628
+ return void 0;
1629
+ }
1630
+ const factory = baseFactory ?? (async (_context) => ({}));
1631
+ const inheritance = getWorldInheritance(baseFactory);
1632
+ return async (context) => {
1633
+ const container = createContainer();
1634
+ const world = await factory(context);
1635
+ const asObject = ensureWorldObject(world);
1636
+ const parentObject = context.parent !== void 0 ? ensureWorldObject(context.parent) : void 0;
1637
+ const mergedWorld = parentObject !== void 0 ? mergeWorldWithParent(asObject, parentObject, inheritance) : asObject;
1638
+ attachWorldAncestors(mergedWorld, parentObject);
1639
+ attachFeatureRegistry(mergedWorld, featureRegistry);
1640
+ attachContainer(mergedWorld, container);
1641
+ attachRuntime(mergedWorld);
1642
+ attachWorldToJson(mergedWorld);
1643
+ container.registerValue(WORLD_TOKEN, mergedWorld, {
1644
+ scope: Scope.SCENARIO
1645
+ });
1646
+ if (appFactory) {
1647
+ const resolvedAppFactory = appFactory;
1648
+ const composer = createAppFactoryContext(container, mergedWorld);
1649
+ const appResult = await resolvedAppFactory(composer);
1650
+ const app = appResult ?? composer.getRegisteredApp();
1651
+ if (app === void 0) {
1652
+ throw new Error(
1653
+ "App factory did not return an application instance. Use return or registerApp to provide one."
1654
+ );
1655
+ }
1656
+ mergedWorld.app = app;
1657
+ }
1658
+ return mergedWorld;
1659
+ };
1660
+ }
1661
+ function attachStepsHelpers(state, environment, globals, ensureFactory) {
1662
+ if (!("globals" in environment)) {
1663
+ Object.defineProperty(environment, "globals", {
1664
+ value: globals,
1665
+ enumerable: true,
1666
+ configurable: true
1667
+ });
1668
+ }
1669
+ if (!("coordinateFeature" in environment)) {
1670
+ Object.defineProperty(environment, "coordinateFeature", {
1671
+ value: (options) => {
1672
+ const registry = ensureFeatureRegistry(state);
1673
+ if (options.feature) {
1674
+ registry.remember(options.feature);
1675
+ }
1676
+ return coordinateRunnerFeature({
1677
+ environment,
1678
+ ...options
1679
+ });
1680
+ },
1681
+ enumerable: true,
1682
+ configurable: true
1683
+ });
1684
+ }
1685
+ if (!("ensure" in environment)) {
1686
+ Object.defineProperty(environment, "ensure", {
1687
+ value: ensureFactory,
1688
+ enumerable: true,
1689
+ configurable: true
1690
+ });
1691
+ }
1692
+ return environment;
1693
+ }
1694
+ function resolveEnsureFactory(state) {
1695
+ if (state.ensureFactory) {
1696
+ return state.ensureFactory;
1697
+ }
1698
+ const factory = createDefaultEnsureFactory();
1699
+ const proxy = createImplicitEnsureProxy(factory);
1700
+ state.ensureFactory = proxy;
1701
+ return proxy;
1702
+ }
1703
+ function attachDecoratorEnvironment(decorators, environment) {
1704
+ if (!("environment" in decorators)) {
1705
+ Object.defineProperty(decorators, "environment", {
1706
+ value: environment,
1707
+ enumerable: true,
1708
+ configurable: true
1709
+ });
1710
+ }
1711
+ return decorators;
1712
+ }
1713
+ function ensureWorldObject(world) {
1714
+ if (world && typeof world === "object") {
1715
+ return world;
1716
+ }
1717
+ return {};
1718
+ }
1719
+ function attachContainer(world, container) {
1720
+ const descriptor = {
1721
+ value: container,
1722
+ configurable: true,
1723
+ enumerable: false,
1724
+ writable: false
1725
+ };
1726
+ if (!Reflect.has(world, "di")) {
1727
+ Object.defineProperty(world, "di", descriptor);
1728
+ }
1729
+ if (!Reflect.has(world, "container")) {
1730
+ Object.defineProperty(world, "container", descriptor);
1731
+ }
1732
+ }
1733
+ function createAppFactoryContext(container, world) {
1734
+ let registeredApp;
1735
+ function withScenarioScope(options) {
1736
+ return {
1737
+ scope: options?.scope ?? Scope.SCENARIO,
1738
+ ...options?.tags ? { tags: [...options.tags] } : {},
1739
+ ...options?.deps ? { deps: [...options.deps] } : {},
1740
+ ...options?.props ? { props: options.props } : {}
1741
+ };
1742
+ }
1743
+ const context = {
1744
+ container,
1745
+ world,
1746
+ getRegisteredApp() {
1747
+ return registeredApp;
1748
+ },
1749
+ registerClass(target, options) {
1750
+ const { scope, tags, deps, inject } = options ?? {};
1751
+ let propsMap;
1752
+ if (inject) {
1753
+ const keys = Reflect.ownKeys(inject);
1754
+ if (keys.length > 0) {
1755
+ const entries = [];
1756
+ for (const key of keys) {
1757
+ const descriptor = inject[key];
1758
+ if (!descriptor) {
1759
+ continue;
1760
+ }
1761
+ entries.push([key, descriptor]);
1762
+ }
1763
+ if (entries.length > 0) {
1764
+ propsMap = Object.fromEntries(entries.map(([key, descriptor]) => {
1765
+ if (typeof descriptor === "object" && "token" in descriptor) {
1766
+ return [key, {
1767
+ token: descriptor.token,
1768
+ ...descriptor.lazy ? { lazy: descriptor.lazy } : {}
1769
+ }];
1770
+ }
1771
+ return [key, descriptor];
1772
+ }));
1773
+ }
1774
+ }
1775
+ }
1776
+ const registration = {
1777
+ scope: scope ?? Scope.SCENARIO,
1778
+ ...tags ? { tags: [...tags] } : {},
1779
+ ...deps ? { deps: [...deps] } : {},
1780
+ ...propsMap ? { props: propsMap } : {}
1781
+ };
1782
+ container.registerClass(target, registration);
1783
+ return context;
1784
+ },
1785
+ registerValue(identifier, value, options) {
1786
+ container.registerValue(identifier, value, withScenarioScope(options));
1787
+ return context;
1788
+ },
1789
+ registerFactory(identifier, factory, options) {
1790
+ container.registerFactory(identifier, factory, withScenarioScope(options));
1791
+ return context;
1792
+ },
1793
+ registerToken(token, target, options) {
1794
+ container.registerToken(token, target, withScenarioScope(options));
1795
+ return context;
1796
+ },
1797
+ async registerApp(target, options) {
1798
+ context.registerClass(target, options);
1799
+ const instance = container.resolve(target);
1800
+ registeredApp = instance;
1801
+ if (options?.configure) {
1802
+ await options.configure(instance, context);
1803
+ }
1804
+ return instance;
1805
+ },
1806
+ resolve(identifier) {
1807
+ return container.resolve(identifier);
1808
+ }
1809
+ };
1810
+ return context;
1811
+ }
1812
+ function attachRuntime(world) {
1813
+ if (Reflect.has(world, "runtime")) {
1814
+ return;
1815
+ }
1816
+ Object.defineProperty(world, "runtime", {
1817
+ get() {
1818
+ return createStepRuntime(this);
1819
+ },
1820
+ enumerable: false,
1821
+ configurable: true
1822
+ });
1823
+ }
1824
+ var WORLD_JSON_EXCLUDE_KEYS = /* @__PURE__ */ new Set([
1825
+ "app",
1826
+ "di",
1827
+ "container",
1828
+ "runtime",
1829
+ "ancestors"
1830
+ ]);
1831
+ function attachWorldToJson(world) {
1832
+ if (Reflect.has(world, "toJSON")) {
1833
+ return;
1834
+ }
1835
+ Object.defineProperty(world, "toJSON", {
1836
+ value: () => {
1837
+ const stack = /* @__PURE__ */ new WeakSet();
1838
+ return toJsonSafeValue(world, 8, stack);
1839
+ },
1840
+ enumerable: false,
1841
+ configurable: true,
1842
+ writable: true
1843
+ });
1844
+ }
1845
+ function toJsonSafeValue(value, depth, stack) {
1846
+ if (value === null) {
1847
+ return null;
1848
+ }
1849
+ switch (typeof value) {
1850
+ case "boolean":
1851
+ case "number":
1852
+ case "string":
1853
+ return value;
1854
+ case "bigint":
1855
+ return value.toString();
1856
+ case "undefined":
1857
+ return "[undefined]";
1858
+ case "symbol":
1859
+ return value.toString();
1860
+ case "function":
1861
+ return "[Function]";
1862
+ case "object":
1863
+ break;
300
1864
  default:
301
- return text;
1865
+ return String(value);
1866
+ }
1867
+ if (depth <= 0) {
1868
+ return "[MaxDepth]";
1869
+ }
1870
+ const obj = value;
1871
+ if (stack.has(obj)) {
1872
+ return "[Circular]";
1873
+ }
1874
+ if (Array.isArray(obj)) {
1875
+ stack.add(obj);
1876
+ try {
1877
+ return obj.map((entry) => toJsonSafeValue(entry, depth - 1, stack));
1878
+ } finally {
1879
+ stack.delete(obj);
1880
+ }
1881
+ }
1882
+ if (obj instanceof Date) {
1883
+ return obj.toISOString();
1884
+ }
1885
+ if (obj instanceof Error) {
1886
+ return {
1887
+ name: obj.name,
1888
+ message: obj.message,
1889
+ stack: obj.stack ?? ""
1890
+ };
1891
+ }
1892
+ if (obj instanceof Map) {
1893
+ stack.add(obj);
1894
+ try {
1895
+ return {
1896
+ "[Map]": Array.from(obj.entries()).map(([key, entry]) => ({
1897
+ key: toJsonSafeValue(key, depth - 1, stack),
1898
+ value: toJsonSafeValue(entry, depth - 1, stack)
1899
+ }))
1900
+ };
1901
+ } finally {
1902
+ stack.delete(obj);
1903
+ }
1904
+ }
1905
+ if (obj instanceof Set) {
1906
+ stack.add(obj);
1907
+ try {
1908
+ return { "[Set]": Array.from(obj.values()).map((entry) => toJsonSafeValue(entry, depth - 1, stack)) };
1909
+ } finally {
1910
+ stack.delete(obj);
1911
+ }
1912
+ }
1913
+ stack.add(obj);
1914
+ try {
1915
+ const record = obj;
1916
+ const result = {};
1917
+ for (const [key, entry] of Object.entries(record)) {
1918
+ if (WORLD_JSON_EXCLUDE_KEYS.has(key)) {
1919
+ continue;
1920
+ }
1921
+ result[key] = toJsonSafeValue(entry, depth - 1, stack);
1922
+ }
1923
+ return result;
1924
+ } finally {
1925
+ stack.delete(obj);
302
1926
  }
303
1927
  }
304
-
305
- // src/events.ts
306
- var import_path = __toESM(require("path"), 1);
307
- function makeTestEmitter(opts) {
308
- const events = CONFIG.current.events;
309
- const emitter = new import_events.TestEventEmitter();
310
- if (opts.groupLogger) {
311
- emitter.load(new GroupLogEvents());
312
- }
313
- if (!events) {
314
- return emitter;
315
- }
316
- for (const event of events) {
317
- const isLocal = isRelativePath(event) || isAbsolutePath(event);
318
- if (isLocal) {
319
- const uriRoot = process.cwd();
320
- const uri = import_path.default.join(uriRoot, event);
321
- const listener2 = require(uri);
322
- if ("default" in listener2 && typeof listener2.default === "function") {
323
- emitter.load(new listener2.default());
324
- return emitter;
325
- }
326
- if ("default" in listener2 && typeof listener2.default === "object") {
327
- emitter.load(listener2.default);
328
- return emitter;
329
- }
330
- if (typeof listener2 === "function") {
331
- emitter.load(new listener2());
332
- return emitter;
333
- }
334
- emitter.load(listener2);
335
- return emitter;
336
- }
337
- const listener = require(event);
338
- if ("default" in listener) {
339
- emitter.load(listener.default);
340
- return emitter;
341
- }
342
- emitter.load(listener);
343
- return emitter;
344
- }
345
- return emitter;
346
- }
347
- function isRelativePath(path) {
348
- return path.startsWith(".");
349
- }
350
- function isAbsolutePath(path) {
351
- return import_path.default.isAbsolute(path);
1928
+ function attachFeatureRegistry(world, featureRegistry) {
1929
+ if (!featureRegistry) {
1930
+ return;
1931
+ }
1932
+ world.features = featureRegistry.snapshot();
1933
+ }
1934
+ var PARENT_WORLD_EXCLUDE_KEYS = /* @__PURE__ */ new Set([
1935
+ "di",
1936
+ "container",
1937
+ "runtime",
1938
+ "app",
1939
+ "ancestors"
1940
+ ]);
1941
+ function mergeWorldWithParent(child, parent, inheritance) {
1942
+ if (!parent || !inheritance || inheritance.size === 0) {
1943
+ return child;
1944
+ }
1945
+ for (const key of inheritance) {
1946
+ if (PARENT_WORLD_EXCLUDE_KEYS.has(key)) {
1947
+ continue;
1948
+ }
1949
+ if (!Reflect.has(parent, key)) {
1950
+ continue;
1951
+ }
1952
+ const descriptor = Object.getOwnPropertyDescriptor(parent, key);
1953
+ if (descriptor) {
1954
+ Object.defineProperty(child, key, descriptor);
1955
+ }
1956
+ }
1957
+ return child;
1958
+ }
1959
+ function attachWorldAncestors(world, parent) {
1960
+ const parentAncestors = parent && Reflect.has(parent, "ancestors") ? parent.ancestors : void 0;
1961
+ const lineage = parent ? [
1962
+ parent,
1963
+ ...Array.isArray(parentAncestors) ? parentAncestors : []
1964
+ ] : [];
1965
+ Object.defineProperty(world, "ancestors", {
1966
+ value: lineage,
1967
+ writable: false,
1968
+ enumerable: false,
1969
+ configurable: true
1970
+ });
1971
+ }
1972
+ function ensureFeatureRegistry(state) {
1973
+ if (!state.featureRegistry) {
1974
+ state.featureRegistry = createFeatureRegistry();
1975
+ }
1976
+ return state.featureRegistry;
1977
+ }
1978
+ function createFeatureRegistry() {
1979
+ const byId = /* @__PURE__ */ new Map();
1980
+ return {
1981
+ remember(feature) {
1982
+ const id = feature.uri ?? feature.name;
1983
+ if (!id || byId.has(id)) {
1984
+ return;
1985
+ }
1986
+ byId.set(id, feature);
1987
+ },
1988
+ snapshot() {
1989
+ return Array.from(byId.values());
1990
+ }
1991
+ };
1992
+ }
1993
+ function createImplicitEnsureProxy(factory) {
1994
+ return new Proxy(factory, {
1995
+ get(target, prop, receiver) {
1996
+ if (prop === "world") {
1997
+ return tryGetWorld();
1998
+ }
1999
+ const world = tryGetWorld();
2000
+ if (world) {
2001
+ const facade = factory(world);
2002
+ return Reflect.get(facade, prop, receiver);
2003
+ }
2004
+ return Reflect.get(target, prop, receiver);
2005
+ },
2006
+ apply(target, _thisArg, args) {
2007
+ const [arg, options] = args;
2008
+ const world = tryGetWorld();
2009
+ if (world) {
2010
+ if (arg === world) {
2011
+ return factory(world);
2012
+ }
2013
+ const facade = factory(world);
2014
+ return facade(arg, options);
2015
+ }
2016
+ return factory(arg);
2017
+ }
2018
+ });
352
2019
  }
353
2020
 
354
- // src/executor.ts
355
- var import_jest_executor = require("@autometa/jest-executor");
356
- var executor = import_jest_executor.execute;
2021
+ // src/current.ts
2022
+ var stepsErrorMessage = "Runner steps surface has not been configured. Call setCurrentRunnerSteps() before accessing the shared runner surface.";
2023
+ var currentSteps;
2024
+ function setCurrentRunnerSteps(steps) {
2025
+ currentSteps = steps;
2026
+ }
2027
+ function getCurrentRunnerSteps() {
2028
+ if (!currentSteps) {
2029
+ throw new Error(stepsErrorMessage);
2030
+ }
2031
+ return currentSteps;
2032
+ }
2033
+ function clearCurrentRunnerSteps() {
2034
+ currentSteps = void 0;
2035
+ }
357
2036
 
358
- // src/app.ts
359
- var import_types = require("@autometa/types");
360
- var import_app = require("@autometa/app");
361
- var import_app2 = require("@autometa/app");
362
- var import_injection = require("@autometa/injection");
363
- var import_app3 = require("@autometa/app");
364
- var import_injection2 = require("@autometa/injection");
365
- var OPTS = {};
366
- var AppType = import_app.AppType.bind(null, OPTS);
2037
+ // src/global.ts
2038
+ var runnerInstance;
2039
+ function instantiateRunner(options) {
2040
+ return createGlobalRunner(options);
2041
+ }
2042
+ function requireConfigured(action) {
2043
+ if (!runnerInstance) {
2044
+ throw new Error(
2045
+ `Global runner has not been configured. ${action}`
2046
+ );
2047
+ }
2048
+ return runnerInstance;
2049
+ }
2050
+ function getGlobalRunner(options) {
2051
+ if (!runnerInstance) {
2052
+ runnerInstance = instantiateRunner(options);
2053
+ }
2054
+ return runnerInstance;
2055
+ }
2056
+ function configureGlobalRunner(options) {
2057
+ runnerInstance = instantiateRunner(options);
2058
+ return runnerInstance;
2059
+ }
2060
+ function resetGlobalRunner(options) {
2061
+ runnerInstance = instantiateRunner(options);
2062
+ return runnerInstance;
2063
+ }
2064
+ function disposeGlobalRunner() {
2065
+ runnerInstance = void 0;
2066
+ }
2067
+ function useGlobalRunnerEnvironment(environment) {
2068
+ const runner = requireConfigured(
2069
+ "Call configureGlobalRunner() before injecting environments."
2070
+ );
2071
+ return runner.useEnvironment(environment);
2072
+ }
2073
+ function getGlobalRunnerEnvironment() {
2074
+ const runner = requireConfigured(
2075
+ "Call configureGlobalRunner() before reading environments."
2076
+ );
2077
+ return runner.getEnvironment();
2078
+ }
2079
+ function getConfiguredGlobalRunner() {
2080
+ return requireConfigured(
2081
+ "Call configureGlobalRunner() before accessing runner APIs."
2082
+ );
2083
+ }
367
2084
 
368
- // src/scopes.ts
369
- var {
370
- BeforeFeature,
371
- AfterFeature,
372
- BeforeScenarioOutline,
373
- AfterScenarioOutline,
374
- BeforeExamples,
375
- AfterExamples,
376
- BeforeRule,
377
- AfterRule,
378
- Feature,
379
- Scenario,
380
- ScenarioOutline,
381
- Rule,
382
- Given,
383
- When,
384
- Then,
385
- Before,
386
- After,
387
- Teardown,
388
- Setup,
389
- Global
390
- } = (0, import_scopes.GetCucumberFunctions)(PARAM_REGISTRY);
391
- var coordinator = new import_coordinator.Coordinator(Global, CONFIG, OPTS);
392
- Global.onFeatureExecuted = (feature, caller) => {
393
- const groupLogger = CONFIG.current.test?.groupLogging ?? false;
394
- const events = makeTestEmitter({ groupLogger });
395
- coordinator.run(feature, caller, events, executor);
2085
+ // src/cucumber-runner.ts
2086
+ var CucumberRunner = class {
2087
+ static builder(initial) {
2088
+ return createRunnerBuilder(initial);
2089
+ }
2090
+ static setSteps(steps) {
2091
+ setCurrentRunnerSteps(steps);
2092
+ }
2093
+ static steps() {
2094
+ return getCurrentRunnerSteps();
2095
+ }
2096
+ static clearSteps() {
2097
+ clearCurrentRunnerSteps();
2098
+ }
396
2099
  };
397
2100
 
398
- // src/index.ts
399
- __reExport(src_exports, require("@autometa/phrases"), module.exports);
400
- var import_datetime = require("@autometa/datetime");
401
- var import_errors = require("@autometa/errors");
402
- var import_gherkin = require("@autometa/gherkin");
403
- var import_bind_decorator = require("@autometa/bind-decorator");
404
- var import_scopes4 = require("@autometa/scopes");
405
- __reExport(src_exports, events_exports, module.exports);
406
- __reExport(src_exports, require("@autometa/http"), module.exports);
407
- __reExport(src_exports, require("@autometa/asserters"), module.exports);
408
- var import_fixture_proxies = require("@autometa/fixture-proxies");
409
- var import_file_proxies = require("@autometa/file-proxies");
410
- function Feature2(...args) {
411
- return Feature(...args);
412
- }
413
- function Scenario2(...args) {
414
- return Scenario(...args);
415
- }
416
- function ScenarioOutline2(...args) {
417
- return ScenarioOutline(...args);
418
- }
419
- function Rule2(...args) {
420
- return Rule(...args);
421
- }
422
- var Given2 = Given;
423
- var When2 = When;
424
- var Then2 = Then;
425
- var Before2 = Before;
426
- var After2 = After;
427
- var Teardown2 = Teardown;
428
- var Setup2 = Setup;
429
- var BeforeFeature2 = BeforeFeature;
430
- var AfterFeature2 = AfterFeature;
431
- var BeforeScenarioOutline2 = BeforeScenarioOutline;
432
- var AfterScenarioOutline2 = AfterScenarioOutline;
433
- var BeforeExamples2 = BeforeExamples;
434
- var AfterExamples2 = AfterExamples;
435
- var BeforeRule2 = BeforeRule;
436
- var AfterRule2 = AfterRule;
437
- // Annotate the CommonJS export names for ESM import in node:
438
- 0 && (module.exports = {
439
- After,
440
- AfterExamples,
441
- AfterFeature,
442
- AfterRule,
443
- AfterScenarioOutline,
444
- App,
445
- AppType,
446
- AutomationError,
447
- AutometaApp,
448
- AutometaWorld,
449
- Before,
450
- BeforeExamples,
451
- BeforeFeature,
452
- BeforeRule,
453
- BeforeScenarioOutline,
454
- Bind,
455
- Constructor,
456
- Container,
457
- DataTable,
458
- Dates,
459
- DisposeMethod,
460
- DisposeTagFilter,
461
- Feature,
462
- FileObject,
463
- Fixture,
464
- GetAccessedCount,
465
- GetAssignedValues,
466
- Given,
467
- HTable,
468
- INJECTION_SCOPE,
469
- Inject,
470
- InjectionScope,
471
- MTable,
472
- Pass,
473
- Rule,
474
- Scenario,
475
- ScenarioOutline,
476
- Setup,
477
- TableDocument,
478
- Teardown,
479
- Then,
480
- Time,
481
- TrackAccess,
482
- Types,
483
- VTable,
484
- When,
485
- World,
486
- defineConfig,
487
- defineParameterType,
488
- getApp,
489
- makeTestEmitter,
490
- raise,
491
- ...require("@autometa/phrases"),
492
- ...require("@autometa/http"),
493
- ...require("@autometa/asserters")
494
- });
2101
+ export { App, CucumberRunner, ParameterRegistryAdapter, RunnerContext, STEPS_ENVIRONMENT_META, WORLD_INHERIT_KEYS, WORLD_TOKEN, clearCurrentRunnerSteps, configureGlobalRunner, coordinateRunnerFeature, createDecoratorRunner, createGlobalRunner, createParameterRegistryAdapter, createRunner, createRunner as default, disposeGlobalRunner, getConfiguredGlobalRunner, getCurrentRunnerSteps, getGlobalRunner, getGlobalRunnerEnvironment, resetGlobalRunner, setCurrentRunnerSteps, useGlobalRunnerEnvironment };
2102
+ //# sourceMappingURL=out.js.map
495
2103
  //# sourceMappingURL=index.js.map