@haibun/core 1.13.5 → 1.15.0

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 (172) hide show
  1. package/build/index.d.ts +1 -2
  2. package/build/index.js +1 -27
  3. package/build/index.js.map +1 -1
  4. package/build/lib/ConnectedLogger.d.ts +3 -4
  5. package/build/lib/ConnectedLogger.js +3 -9
  6. package/build/lib/ConnectedLogger.js.map +1 -1
  7. package/build/lib/Logger.d.ts +10 -11
  8. package/build/lib/Logger.js +17 -19
  9. package/build/lib/Logger.js.map +1 -1
  10. package/build/lib/Logger.test.d.ts +0 -1
  11. package/build/lib/Logger.test.js +11 -36
  12. package/build/lib/Logger.test.js.map +1 -1
  13. package/build/lib/TestLogger.d.ts +1 -2
  14. package/build/lib/TestLogger.js +1 -4
  15. package/build/lib/TestLogger.js.map +1 -1
  16. package/build/lib/Timer.d.ts +0 -1
  17. package/build/lib/Timer.js +4 -8
  18. package/build/lib/Timer.js.map +1 -1
  19. package/build/lib/contexts.d.ts +1 -2
  20. package/build/lib/contexts.js +9 -14
  21. package/build/lib/contexts.js.map +1 -1
  22. package/build/lib/{defs/index.d.ts → defs.d.ts} +57 -57
  23. package/build/lib/defs.js +28 -0
  24. package/build/lib/defs.js.map +1 -0
  25. package/build/lib/domain.d.ts +3 -4
  26. package/build/lib/domain.js +14 -23
  27. package/build/lib/domain.js.map +1 -1
  28. package/build/lib/features.d.ts +1 -2
  29. package/build/lib/features.js +15 -27
  30. package/build/lib/features.js.map +1 -1
  31. package/build/lib/features.test.d.ts +0 -1
  32. package/build/lib/features.test.js +31 -59
  33. package/build/lib/features.test.js.map +1 -1
  34. package/build/lib/interfaces/logger.d.ts +9 -10
  35. package/build/lib/interfaces/logger.js +1 -4
  36. package/build/lib/interfaces/logger.js.map +1 -1
  37. package/build/lib/namedVars.d.ts +7 -8
  38. package/build/lib/namedVars.js +12 -20
  39. package/build/lib/namedVars.js.map +1 -1
  40. package/build/lib/namedVars.test.d.ts +0 -1
  41. package/build/lib/namedVars.test.js +33 -38
  42. package/build/lib/namedVars.test.js.map +1 -1
  43. package/build/lib/run-with-options.d.ts +2 -3
  44. package/build/lib/run-with-options.js +13 -19
  45. package/build/lib/run-with-options.js.map +1 -1
  46. package/build/lib/run.d.ts +3 -4
  47. package/build/lib/run.domains.test.d.ts +0 -1
  48. package/build/lib/run.domains.test.js +43 -51
  49. package/build/lib/run.domains.test.js.map +1 -1
  50. package/build/lib/run.js +28 -36
  51. package/build/lib/run.js.map +1 -1
  52. package/build/lib/run.test.d.ts +0 -1
  53. package/build/lib/run.test.js +24 -32
  54. package/build/lib/run.test.js.map +1 -1
  55. package/build/lib/test/TestSteps.d.ts +12 -13
  56. package/build/lib/test/TestSteps.js +39 -44
  57. package/build/lib/test/TestSteps.js.map +1 -1
  58. package/build/lib/test/TestStepsWithDomain.d.ts +7 -8
  59. package/build/lib/test/TestStepsWithDomain.js +12 -17
  60. package/build/lib/test/TestStepsWithDomain.js.map +1 -1
  61. package/build/lib/test/TestStepsWithOptions.d.ts +6 -7
  62. package/build/lib/test/TestStepsWithOptions.js +18 -23
  63. package/build/lib/test/TestStepsWithOptions.js.map +1 -1
  64. package/build/lib/test/lib.d.ts +5 -6
  65. package/build/lib/test/lib.js +38 -72
  66. package/build/lib/test/lib.js.map +1 -1
  67. package/build/lib/util/index.d.ts +5 -6
  68. package/build/lib/util/index.js +54 -119
  69. package/build/lib/util/index.js.map +1 -1
  70. package/build/lib/util/util.test.d.ts +0 -1
  71. package/build/lib/util/util.test.js +35 -67
  72. package/build/lib/util/util.test.js.map +1 -1
  73. package/build/link-packages.d.ts +0 -1
  74. package/build/link-packages.js +5 -7
  75. package/build/link-packages.js.map +1 -1
  76. package/build/phases/Builder.d.ts +3 -4
  77. package/build/phases/Builder.js +12 -12
  78. package/build/phases/Builder.js.map +1 -1
  79. package/build/phases/Builder.test.d.ts +0 -1
  80. package/build/phases/Builder.test.js +13 -18
  81. package/build/phases/Builder.test.js.map +1 -1
  82. package/build/phases/Executor.d.ts +1 -2
  83. package/build/phases/Executor.js +16 -17
  84. package/build/phases/Executor.js.map +1 -1
  85. package/build/phases/Resolver.d.ts +1 -2
  86. package/build/phases/Resolver.domains.test.d.ts +0 -1
  87. package/build/phases/Resolver.domains.test.js +1 -2
  88. package/build/phases/Resolver.domains.test.js.map +1 -1
  89. package/build/phases/Resolver.js +19 -20
  90. package/build/phases/Resolver.js.map +1 -1
  91. package/build/phases/Resolver.test.d.ts +0 -1
  92. package/build/phases/Resolver.test.js +31 -36
  93. package/build/phases/Resolver.test.js.map +1 -1
  94. package/build/scaffold/index.d.ts +0 -1
  95. package/build/scaffold/index.js +2 -4
  96. package/build/scaffold/index.js.map +1 -1
  97. package/build/scaffold/scaffold.d.ts +1 -2
  98. package/build/scaffold/scaffold.js +25 -33
  99. package/build/scaffold/scaffold.js.map +1 -1
  100. package/build/scaffold/scaffold.test.d.ts +0 -1
  101. package/build/scaffold/scaffold.test.js +15 -20
  102. package/build/scaffold/scaffold.test.js.map +1 -1
  103. package/build/steps/conformance.d.ts +6 -7
  104. package/build/steps/conformance.js +10 -15
  105. package/build/steps/conformance.js.map +1 -1
  106. package/build/steps/credentials.d.ts +7 -8
  107. package/build/steps/credentials.js +25 -32
  108. package/build/steps/credentials.js.map +1 -1
  109. package/build/steps/haibun.d.ts +13 -14
  110. package/build/steps/haibun.js +66 -71
  111. package/build/steps/haibun.js.map +1 -1
  112. package/build/steps/haibun.test.d.ts +0 -1
  113. package/build/steps/haibun.test.js +4 -6
  114. package/build/steps/haibun.test.js.map +1 -1
  115. package/build/steps/vars.d.ts +17 -18
  116. package/build/steps/vars.js +74 -83
  117. package/build/steps/vars.js.map +1 -1
  118. package/build/steps/vars.test.d.ts +0 -1
  119. package/build/steps/vars.test.js +9 -11
  120. package/build/steps/vars.test.js.map +1 -1
  121. package/package.json +19 -5
  122. package/scaffold/.eslintrc.in +20 -0
  123. package/scaffold/.prettierrc.in +6 -0
  124. package/scaffold/src/stepper.test.ts.in +1 -1
  125. package/scaffold/src/stepper.ts.in +2 -2
  126. package/scaffold/tsconfig.json.in +2 -2
  127. package/build/index.d.ts.map +0 -1
  128. package/build/lib/ConnectedLogger.d.ts.map +0 -1
  129. package/build/lib/Logger.d.ts.map +0 -1
  130. package/build/lib/Logger.test.d.ts.map +0 -1
  131. package/build/lib/TestLogger.d.ts.map +0 -1
  132. package/build/lib/Timer.d.ts.map +0 -1
  133. package/build/lib/contexts.d.ts.map +0 -1
  134. package/build/lib/defs/index.d.ts.map +0 -1
  135. package/build/lib/defs/index.js +0 -31
  136. package/build/lib/defs/index.js.map +0 -1
  137. package/build/lib/domain.d.ts.map +0 -1
  138. package/build/lib/features.d.ts.map +0 -1
  139. package/build/lib/features.test.d.ts.map +0 -1
  140. package/build/lib/interfaces/logger.d.ts.map +0 -1
  141. package/build/lib/namedVars.d.ts.map +0 -1
  142. package/build/lib/namedVars.test.d.ts.map +0 -1
  143. package/build/lib/run-with-options.d.ts.map +0 -1
  144. package/build/lib/run.d.ts.map +0 -1
  145. package/build/lib/run.domains.test.d.ts.map +0 -1
  146. package/build/lib/run.test.d.ts.map +0 -1
  147. package/build/lib/test/TestSteps.d.ts.map +0 -1
  148. package/build/lib/test/TestStepsWithDomain.d.ts.map +0 -1
  149. package/build/lib/test/TestStepsWithOptions.d.ts.map +0 -1
  150. package/build/lib/test/lib.d.ts.map +0 -1
  151. package/build/lib/util/index.d.ts.map +0 -1
  152. package/build/lib/util/util.test.d.ts.map +0 -1
  153. package/build/link-packages.d.ts.map +0 -1
  154. package/build/phases/Builder.d.ts.map +0 -1
  155. package/build/phases/Builder.test.d.ts.map +0 -1
  156. package/build/phases/Executor.d.ts.map +0 -1
  157. package/build/phases/Resolver.d.ts.map +0 -1
  158. package/build/phases/Resolver.domains.test.d.ts.map +0 -1
  159. package/build/phases/Resolver.test.d.ts.map +0 -1
  160. package/build/scaffold/index.d.ts.map +0 -1
  161. package/build/scaffold/scaffold.d.ts.map +0 -1
  162. package/build/scaffold/scaffold.test.d.ts.map +0 -1
  163. package/build/scaffold.d.ts +0 -3
  164. package/build/scaffold.d.ts.map +0 -1
  165. package/build/scaffold.js +0 -78
  166. package/build/scaffold.js.map +0 -1
  167. package/build/steps/conformance.d.ts.map +0 -1
  168. package/build/steps/credentials.d.ts.map +0 -1
  169. package/build/steps/haibun.d.ts.map +0 -1
  170. package/build/steps/haibun.test.d.ts.map +0 -1
  171. package/build/steps/vars.d.ts.map +0 -1
  172. package/build/steps/vars.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
- import { DomainContext, WorkspaceContext, WorldContext } from '../contexts';
2
- import { ILogger } from '../interfaces/logger';
3
- import { Timer } from '../Timer';
4
- export declare type TSpecl = {
1
+ import { DomainContext, WorkspaceContext, WorldContext } from './contexts.js';
2
+ import { ILogger } from './interfaces/logger.js';
3
+ import { Timer } from './Timer.js';
4
+ export type TSpecl = {
5
5
  steppers: string[];
6
6
  mode: 'all' | 'some';
7
7
  refs?: {
@@ -13,13 +13,13 @@ export declare type TSpecl = {
13
13
  };
14
14
  options: TOptions;
15
15
  };
16
- declare type TBaseOptions = {
16
+ type TBaseOptions = {
17
17
  DEST: string;
18
18
  };
19
- export declare type TOptions = TBaseOptions & {
19
+ export type TOptions = TBaseOptions & {
20
20
  [name: string]: TOptionValue;
21
21
  };
22
- export declare type TOptionValue = any;
22
+ export type TOptionValue = any;
23
23
  export interface IHasOptions {
24
24
  options?: {
25
25
  [name: string]: {
@@ -44,30 +44,30 @@ export interface IHasDomains {
44
44
  export interface IRequireDomains {
45
45
  requireDomains?: string[];
46
46
  }
47
- export declare type TExtraOptions = {
47
+ export type TExtraOptions = {
48
48
  [name: string]: string;
49
49
  };
50
- export declare type TProtoOptions = {
50
+ export type TProtoOptions = {
51
51
  options: TOptions;
52
52
  extraOptions: TExtraOptions;
53
53
  };
54
- export declare type TFromDomain = {
54
+ export type TFromDomain = {
55
55
  name: string;
56
56
  from: string;
57
57
  is: string;
58
58
  };
59
- export declare type TFileTypeDomain = {
59
+ export type TFileTypeDomain = {
60
60
  name: string;
61
61
  validate: (content: string) => undefined | string;
62
62
  fileType: string;
63
63
  is: string;
64
64
  };
65
- export declare type TDomain = TFromDomain | TFileTypeDomain;
66
- export declare type TModuleDomain = TDomain & {
65
+ export type TDomain = TFromDomain | TFileTypeDomain;
66
+ export type TModuleDomain = TDomain & {
67
67
  module: IHasDomains;
68
68
  shared: DomainContext;
69
69
  };
70
- export declare type TWorld = {
70
+ export type TWorld = {
71
71
  tag: TTag;
72
72
  shared: WorldContext;
73
73
  runtime: TRuntime;
@@ -78,29 +78,29 @@ export declare type TWorld = {
78
78
  timer: Timer;
79
79
  base: string;
80
80
  };
81
- export declare type TFeatureMeta = {
81
+ export type TFeatureMeta = {
82
82
  type: string;
83
83
  name: string;
84
84
  path: string;
85
85
  };
86
- export declare type TFeature = TFeatureMeta & {
86
+ export type TFeature = TFeatureMeta & {
87
87
  name: string;
88
88
  content: string;
89
89
  };
90
- export declare type TExpandedFeature = TFeatureMeta & {
90
+ export type TExpandedFeature = TFeatureMeta & {
91
91
  name: string;
92
92
  expanded: TExpandedLine[];
93
93
  };
94
- export declare type TExpandedLine = {
94
+ export type TExpandedLine = {
95
95
  line: string;
96
96
  feature: TFeature;
97
97
  };
98
- export declare type TFeatures = TFeature[];
99
- export declare type TResolvedFeature = TExpandedFeature & {
98
+ export type TFeatures = TFeature[];
99
+ export type TResolvedFeature = TExpandedFeature & {
100
100
  vsteps: TVStep[];
101
101
  };
102
- export declare type TTagValue = number;
103
- export declare type TTag = {
102
+ export type TTagValue = number;
103
+ export type TTag = {
104
104
  sequence: number;
105
105
  featureNum: number;
106
106
  loop: number;
@@ -108,28 +108,28 @@ export declare type TTag = {
108
108
  params: any;
109
109
  trace: boolean;
110
110
  };
111
- export declare type TVStep = {
111
+ export type TVStep = {
112
112
  source: TFeature;
113
113
  in: string;
114
114
  seq: number;
115
115
  actions: TFound[];
116
116
  };
117
- export declare type TAction = (named: TNamed, vstep: TVStep) => Promise<TActionResult>;
118
- export declare type TBuildResult = (TOKActionResult & {
117
+ export type TAction = (named: TNamed, vstep: TVStep) => Promise<TActionResult>;
118
+ export type TBuildResult = (TOKActionResult & {
119
119
  finalize?: TFinalize;
120
120
  }) | TNotOKActionResult;
121
- export declare type TBuild = (named: TNamed, vstep: TVStep, workspace: WorkspaceContext) => Promise<TBuildResult>;
122
- export declare type TRequiresResult = {
121
+ export type TBuild = (named: TNamed, vstep: TVStep, workspace: WorkspaceContext) => Promise<TBuildResult>;
122
+ export type TRequiresResult = {
123
123
  includes?: string[];
124
124
  };
125
- export declare type TFinalize = (workspace: WorkspaceContext) => void;
125
+ export type TFinalize = (workspace: WorkspaceContext) => void;
126
126
  export declare abstract class WorkspaceBuilder {
127
127
  name: string;
128
128
  constructor(name: string);
129
129
  addControl(...args: any): void;
130
130
  finalize(): any;
131
131
  }
132
- export declare type TStep = {
132
+ export type TStep = {
133
133
  match?: RegExp;
134
134
  gwta?: string;
135
135
  exact?: string;
@@ -157,28 +157,29 @@ export declare abstract class AStepper {
157
157
  };
158
158
  getWorld(): TWorld;
159
159
  }
160
- export declare type TFound = {
160
+ export type TFound = {
161
161
  actionName: string;
162
162
  stepperName: string;
163
163
  step: TStep;
164
164
  named?: TNamed | undefined;
165
165
  vars?: TNamedVar[];
166
166
  };
167
- export declare type TNamed = {
167
+ export type TNamed = {
168
168
  [name: string]: string;
169
169
  };
170
- export declare type TNamedVar = {
170
+ export type TNamedVar = {
171
171
  name: string;
172
172
  type: string;
173
173
  };
174
174
  export declare const OK: TOKActionResult;
175
- export declare type TResultError = {
175
+ export type TResultError = {
176
176
  details: {
177
177
  [name: string]: any;
178
+ stack: string[];
178
179
  };
179
180
  message: string;
180
181
  };
181
- export declare type TResult = {
182
+ export type TResult = {
182
183
  ok: boolean;
183
184
  tag: TTag;
184
185
  shared: WorldContext;
@@ -188,66 +189,66 @@ export declare type TResult = {
188
189
  error: TResultError;
189
190
  };
190
191
  };
191
- export declare type TOKActionResult = {
192
+ export type TOKActionResult = {
192
193
  ok: true;
193
194
  topics?: TActionResultTopics;
194
195
  };
195
- export declare type TActionResultTopics = {
196
+ export type TActionResultTopics = {
196
197
  [topic: string]: {
197
198
  summary: string;
198
199
  details?: any;
199
200
  };
200
201
  };
201
- export declare type TNotOKActionResult = {
202
+ export type TNotOKActionResult = {
202
203
  ok: false;
203
204
  score?: number;
204
205
  message: string;
205
206
  topics?: TActionResultTopics;
206
207
  };
207
- export declare type TTrace = {
208
+ export type TTrace = {
208
209
  [name: string]: {
209
210
  url: string;
210
211
  since: number;
211
212
  trace: any;
212
213
  };
213
214
  };
214
- export declare type TTraces = {
215
+ export type TTraces = {
215
216
  start?: number;
216
217
  end?: number;
217
218
  traces?: TTrace[];
218
219
  };
219
- export declare type TTraceOptions = {
220
+ export type TTraceOptions = {
220
221
  [event: string]: {
221
222
  listener: any;
222
223
  };
223
224
  };
224
- export declare type TActionResult = (TOKActionResult | TNotOKActionResult);
225
- export declare type TStepActionResult = (TNotOkStepActionResult | TOKStepActionResult) & TTraces;
226
- declare type TNamedStepActionResult = {
225
+ export type TActionResult = (TOKActionResult | TNotOKActionResult);
226
+ export type TStepActionResult = (TNotOkStepActionResult | TOKStepActionResult) & TTraces;
227
+ type TNamedStepActionResult = {
227
228
  name: string;
228
229
  };
229
- export declare type TNotOkStepActionResult = TNotOKActionResult & TNamedStepActionResult;
230
- export declare type TOKStepActionResult = TOKActionResult & TNamedStepActionResult;
231
- export declare type TFeatureResult = {
230
+ export type TNotOkStepActionResult = TNotOKActionResult & TNamedStepActionResult;
231
+ export type TOKStepActionResult = TOKActionResult & TNamedStepActionResult;
232
+ export type TFeatureResult = {
232
233
  skip?: boolean;
233
234
  path: string;
234
235
  ok: boolean;
235
236
  stepResults: TStepResult[];
236
237
  failure?: TFeatureResultFailure;
237
238
  };
238
- export declare type TFeatureResultFailure = {
239
+ export type TFeatureResultFailure = {
239
240
  message: string;
240
241
  error: any;
241
242
  expected?: any;
242
243
  };
243
- export declare type TStepResult = {
244
+ export type TStepResult = {
244
245
  ok: boolean;
245
246
  actionResults: TStepActionResult[];
246
247
  in: string;
247
248
  sourcePath: string;
248
249
  seq: number;
249
250
  };
250
- export declare type TRuntime = {
251
+ export type TRuntime = {
251
252
  [name: string]: any;
252
253
  };
253
254
  export interface IResultOutput {
@@ -262,22 +263,22 @@ export declare const BASE_DOMAINS: {
262
263
  resolve: (inp: string) => string;
263
264
  }[];
264
265
  export declare const BASE_TYPES: string[];
265
- export declare type TScored = {
266
+ export type TScored = {
266
267
  name: string;
267
268
  score: number;
268
269
  };
269
- export declare type TStartRunCallback = (world: TWorld) => void;
270
- export declare type TEndFeatureCallbackParams = {
270
+ export type TStartRunCallback = (world: TWorld) => void;
271
+ export type TEndFeatureCallbackParams = {
271
272
  world: TWorld;
272
273
  result: TFeatureResult;
273
274
  steppers: AStepper[];
274
275
  startOffset: number;
275
276
  };
276
- export declare type TEndFeatureCallback = (params: TEndFeatureCallbackParams) => Promise<void>;
277
- export declare type TRunEnv = {
277
+ export type TEndFeatureCallback = (params: TEndFeatureCallbackParams) => Promise<void>;
278
+ export type TRunEnv = {
278
279
  [name: string]: string;
279
280
  };
280
- export declare type TRunOptions = {
281
+ export type TRunOptions = {
281
282
  loops: number;
282
283
  members: number;
283
284
  trace: boolean;
@@ -289,7 +290,7 @@ export declare type TRunOptions = {
289
290
  splits: TRunEnv[];
290
291
  protoOptions: TProtoOptions;
291
292
  };
292
- export declare type TRunResult = {
293
+ export type TRunResult = {
293
294
  output: any;
294
295
  result: TResult;
295
296
  shared: WorldContext;
@@ -299,4 +300,3 @@ export declare type TRunResult = {
299
300
  fromStart: number;
300
301
  };
301
302
  export {};
302
- //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,28 @@
1
+ export class WorkspaceBuilder {
2
+ name;
3
+ constructor(name) {
4
+ this.name = name;
5
+ }
6
+ addControl(...args) { }
7
+ finalize() { }
8
+ }
9
+ export class AStepper {
10
+ world;
11
+ setWorld(world, steppers) {
12
+ this.world = world;
13
+ }
14
+ getWorld() {
15
+ if (!this.world) {
16
+ throw Error(`stepper without world ${this.constructor.name}`);
17
+ }
18
+ return this.world;
19
+ }
20
+ }
21
+ export const OK = { ok: true };
22
+ export const HAIBUN = 'HAIBUN';
23
+ export const BASE_PREFIX = `${HAIBUN}_`;
24
+ export const CAPTURE = 'capture';
25
+ export const DEFAULT_DEST = 'default';
26
+ export const BASE_DOMAINS = [{ name: 'string', resolve: (inp) => inp }];
27
+ export const BASE_TYPES = BASE_DOMAINS.map((b) => b.name);
28
+ //# sourceMappingURL=defs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defs.js","sourceRoot":"","sources":["../../src/lib/defs.ts"],"names":[],"mappings":"AAoIA,MAAM,OAAgB,gBAAgB;IACpC,IAAI,CAAS;IACb,YAAY,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,UAAU,CAAC,GAAG,IAAS,IAAI,CAAC;IAC5B,QAAQ,KAAU,CAAC;CACpB;AAqBD,MAAM,OAAgB,QAAQ;IAC5B,KAAK,CAAU;IAIf,QAAQ,CAAC,KAAa,EAAE,QAAoB;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,MAAM,KAAK,CAAC,yBAAyB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;SAC/D;QAED,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAMD,MAAM,CAAC,MAAM,EAAE,GAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAiGhD,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,MAAM,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC"}
@@ -1,11 +1,10 @@
1
- import { Context } from './contexts';
2
- import { AStepper, TFound, TWorld, TModuleDomain } from './defs';
1
+ import { Context } from './contexts.js';
2
+ import { AStepper, TFound, TWorld, TModuleDomain } from './defs.js';
3
3
  export declare const isBaseType: (type: string) => boolean;
4
4
  export declare const getStepShared: (type: string, world: TWorld) => Context;
5
- export declare const getDomain: (domain: string, world: Partial<TWorld>) => TModuleDomain | undefined;
5
+ export declare const getDomain: (domain: string, world: Partial<TWorld>) => TModuleDomain;
6
6
  export declare const getDomains: (steppers: AStepper[], world: TWorld) => Promise<TModuleDomain[]>;
7
7
  export declare const verifyDomainsOrError: (steppers: AStepper[], world: TWorld) => Promise<void>;
8
8
  export declare function checkRequiredType({ path }: {
9
9
  path: string;
10
10
  }, featureLine: string, actions: TFound[], world: TWorld): void;
11
- //# sourceMappingURL=domain.d.ts.map
@@ -1,16 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkRequiredType = exports.verifyDomainsOrError = exports.getDomains = exports.getDomain = exports.getStepShared = exports.isBaseType = void 0;
4
- const contexts_1 = require("./contexts");
5
- const defs_1 = require("./defs");
6
- const isBaseType = (type) => defs_1.BASE_TYPES.includes(type);
7
- exports.isBaseType = isBaseType;
8
- const getStepShared = (type, world) => {
1
+ import { DomainContext } from './contexts.js';
2
+ import { BASE_TYPES } from './defs.js';
3
+ export const isBaseType = (type) => BASE_TYPES.includes(type);
4
+ export const getStepShared = (type, world) => {
9
5
  // FIXME shouldn't need to check 'feature'
10
- if (type === 'feature' || (0, exports.isBaseType)(type)) {
6
+ if (type === 'feature' || isBaseType(type)) {
11
7
  return world.shared;
12
8
  }
13
- let source = (0, exports.getDomain)(type, world);
9
+ let source = getDomain(type, world);
14
10
  if (!source || !source.shared) {
15
11
  throw Error(`no shared for ${type}, ${source}}`);
16
12
  }
@@ -18,7 +14,7 @@ const getStepShared = (type, world) => {
18
14
  if (!isFrom) {
19
15
  return source.shared;
20
16
  }
21
- const fromSource = (0, exports.getDomain)(isFrom, world);
17
+ const fromSource = getDomain(isFrom, world);
22
18
  if (!fromSource || !fromSource.shared) {
23
19
  throw Error(`no isFrom shared for ${isFrom}, ${fromSource}}`);
24
20
  }
@@ -33,33 +29,30 @@ const getStepShared = (type, world) => {
33
29
  }
34
30
  return currentSource;
35
31
  };
36
- exports.getStepShared = getStepShared;
37
- const getDomain = (domain, world) => world.domains.find((d) => d.name === domain);
38
- exports.getDomain = getDomain;
39
- const getDomains = async (steppers, world) => {
32
+ export const getDomain = (domain, world) => world.domains.find((d) => d.name === domain);
33
+ export const getDomains = async (steppers, world) => {
40
34
  const domainWorld = { domains: [] };
41
35
  for (const module of steppers.filter((s) => !!s.domains).map((s) => s)) {
42
36
  const { domains } = module;
43
37
  if (domains) {
44
38
  for (const d of domains) {
45
- if ((0, exports.getDomain)(d.name, domainWorld)) {
39
+ if (getDomain(d.name, domainWorld)) {
46
40
  throw Error(`duplicate domain "${d.name}" in "${module.constructor.name}"`);
47
41
  }
48
- domainWorld.domains.push({ ...d, module, shared: new contexts_1.DomainContext(d.name) });
42
+ domainWorld.domains.push({ ...d, module, shared: new DomainContext(d.name) });
49
43
  }
50
44
  }
51
45
  }
52
46
  return domainWorld.domains;
53
47
  };
54
- exports.getDomains = getDomains;
55
- const verifyDomainsOrError = async (steppers, world) => {
48
+ export const verifyDomainsOrError = async (steppers, world) => {
56
49
  // verify all required are present
57
50
  for (const s of steppers.filter((s) => !!s.requireDomains).map((s) => s)) {
58
51
  const { requireDomains } = s;
59
52
  const { name: module } = s.constructor;
60
53
  if (requireDomains) {
61
54
  for (const name of requireDomains) {
62
- if (!(0, exports.getDomain)(name, world)) {
55
+ if (!getDomain(name, world)) {
63
56
  throw Error(`missing required domain "${name}" for ${module} from ${Object.keys(world.domains)}`);
64
57
  // return { result: { ok: false, failure: { stage: 'Options', error: { details: `missing required domain ${name} in ${name}`, context: world.domains } } } };
65
58
  }
@@ -67,9 +60,8 @@ const verifyDomainsOrError = async (steppers, world) => {
67
60
  }
68
61
  }
69
62
  };
70
- exports.verifyDomainsOrError = verifyDomainsOrError;
71
63
  // if there is a fileType for the domain type, get it from the match and make sure it is ok
72
- function checkRequiredType({ path }, featureLine, actions, world) {
64
+ export function checkRequiredType({ path }, featureLine, actions, world) {
73
65
  /*
74
66
  for (const action of actions) {
75
67
  if (action.step.gwta && action.vars) {
@@ -112,5 +104,4 @@ function checkRequiredType({ path }, featureLine, actions, world) {
112
104
  }
113
105
  */
114
106
  }
115
- exports.checkRequiredType = checkRequiredType;
116
107
  //# sourceMappingURL=domain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"domain.js","sourceRoot":"","sources":["../../src/lib/domain.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AACpD,iCAAwH;AAEjH,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,iBAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAAzD,QAAA,UAAU,cAA+C;AAC/D,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,KAAa,EAAW,EAAE;IACpE,0CAA0C;IAE1C,IAAI,IAAI,KAAK,SAAS,IAAI,IAAA,kBAAU,EAAC,IAAI,CAAC,EAAE;QAC1C,OAAO,KAAK,CAAC,MAAM,CAAC;KACrB;IACD,IAAI,MAAM,GAAG,IAAA,iBAAS,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,E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} from './defs';
1
+ import { TExpandedFeature, TFeature, TFeatures } from './defs.js';
2
2
  export declare function expand(backgrounds: TFeatures, features: TFeatures): Promise<TExpandedFeature[]>;
3
3
  export declare function expandBackgrounds(features: TFeatures): Promise<TFeatures>;
4
4
  export declare function findUpper(path: string, features: TFeatures): {
@@ -19,4 +19,3 @@ export declare const asFeatureLine: (line: string, feature: TFeature) => {
19
19
  export declare function findFeatures(name: string, backgrounds: TFeatures, type?: string): TFeatures;
20
20
  export declare function findFeaturesOfType(backgrounds: TFeatures, type?: string): TFeatures;
21
21
  export declare const featureSplit: (content: string) => string[];
22
- //# sourceMappingURL=features.d.ts.map
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.featureSplit = exports.findFeaturesOfType = exports.findFeatures = exports.asFeatureLine = exports.withNameType = exports.expandFeatures = exports.findUpper = exports.expandBackgrounds = exports.expand = void 0;
4
- const util_1 = require("./util");
5
- async function expand(backgrounds, features) {
1
+ import { getActionable } from './util/index.js';
2
+ export async function expand(backgrounds, features) {
6
3
  const expandedBackgrounds = await expandBackgrounds(backgrounds);
7
4
  const expandedFeatures = await expandFeatures(features, expandedBackgrounds);
8
5
  return expandedFeatures;
9
6
  }
10
- exports.expand = expand;
11
7
  // Expand backgrounds by prepending 'upper' features to 'lower' features
12
- async function expandBackgrounds(features) {
8
+ export async function expandBackgrounds(features) {
13
9
  const expanded = [];
14
10
  for (const { path, content: feature } of features) {
15
11
  let res = feature;
@@ -24,12 +20,11 @@ async function expandBackgrounds(features) {
24
20
  }
25
21
  return expanded;
26
22
  }
27
- exports.expandBackgrounds = expandBackgrounds;
28
23
  const upperPath = (path) => {
29
24
  const r = path.split('/');
30
25
  return '/' + r.slice(1, r.length - 1).join('/');
31
26
  };
32
- function findUpper(path, features) {
27
+ export function findUpper(path, features) {
33
28
  const rem = upperPath(path);
34
29
  const upper = features.filter((f) => {
35
30
  const p = upperPath(f.path);
@@ -37,8 +32,7 @@ function findUpper(path, features) {
37
32
  });
38
33
  return { rem, upper };
39
34
  }
40
- exports.findUpper = findUpper;
41
- async function expandFeatures(features, backgrounds) {
35
+ export async function expandFeatures(features, backgrounds) {
42
36
  const expandeds = [];
43
37
  for (const feature of features) {
44
38
  const expanded = await expandIncluded(feature, backgrounds);
@@ -47,12 +41,11 @@ async function expandFeatures(features, backgrounds) {
47
41
  }
48
42
  return expandeds;
49
43
  }
50
- exports.expandFeatures = expandFeatures;
51
44
  async function expandIncluded(feature, backgrounds) {
52
45
  let lines = [];
53
- const split = (0, exports.featureSplit)(feature.content);
46
+ const split = featureSplit(feature.content);
54
47
  for (const l of split) {
55
- const actionable = (0, util_1.getActionable)(l);
48
+ const actionable = getActionable(l);
56
49
  if (!!actionable.match(/^Backgrounds: .*$/)) {
57
50
  lines = lines.concat(doIncludes(l, backgrounds));
58
51
  }
@@ -60,21 +53,19 @@ async function expandIncluded(feature, backgrounds) {
60
53
  lines = lines.concat(doIncludes(l, backgrounds));
61
54
  }
62
55
  else {
63
- const nl = (0, exports.asFeatureLine)(l, feature);
56
+ const nl = asFeatureLine(l, feature);
64
57
  lines.push(nl);
65
58
  }
66
59
  }
67
60
  return lines;
68
61
  }
69
- function withNameType(path, content) {
62
+ export function withNameType(path, content) {
70
63
  const s = path.split('.');
71
64
  const name = s[0];
72
65
  const type = s.length === 3 ? s[1] : 'feature';
73
66
  return { path, name, type, content };
74
67
  }
75
- exports.withNameType = withNameType;
76
- const asFeatureLine = (line, feature) => ({ line, feature });
77
- exports.asFeatureLine = asFeatureLine;
68
+ export const asFeatureLine = (line, feature) => ({ line, feature });
78
69
  function doIncludes(input, backgrounds) {
79
70
  const includes = input.replace(/^.*?: /, '').split(',').map((a) => a.trim());
80
71
  let ret = [];
@@ -84,26 +75,23 @@ function doIncludes(input, backgrounds) {
84
75
  throw Error(`can't find single "${l}.feature" from ${backgrounds.map((b) => b.path).join(', ')}`);
85
76
  }
86
77
  const origin = bg[0];
87
- for (const l of (0, exports.featureSplit)(origin.content)) {
88
- ret.push((0, exports.asFeatureLine)(l, origin));
78
+ for (const l of featureSplit(origin.content)) {
79
+ ret.push(asFeatureLine(l, origin));
89
80
  }
90
81
  }
91
82
  return ret;
92
83
  }
93
- function findFeatures(name, backgrounds, type = 'feature') {
84
+ export function findFeatures(name, backgrounds, type = 'feature') {
94
85
  const ftype = findFeaturesOfType(backgrounds, type);
95
86
  return ftype.filter((f) => f.path.endsWith(`/${name}.${fileTypeToExt(type)}`));
96
87
  }
97
- exports.findFeatures = findFeatures;
98
- function findFeaturesOfType(backgrounds, type = 'feature') {
88
+ export function findFeaturesOfType(backgrounds, type = 'feature') {
99
89
  return backgrounds.filter((f) => f.path.endsWith(`.${fileTypeToExt(type)}`));
100
90
  }
101
- exports.findFeaturesOfType = findFeaturesOfType;
102
91
  const fileTypeToExt = (type) => (type === 'feature' ? 'feature' : `${type}.feature`);
103
- const featureSplit = (content) => content
92
+ export const featureSplit = (content) => content
104
93
  .trim()
105
94
  .split('\n')
106
95
  .map((a) => a.trim())
107
96
  .filter((a) => a.length > 0);
108
- exports.featureSplit = featureSplit;
109
97
  //# sourceMappingURL=features.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/lib/features.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEhC,KAAK,UAAU,MAAM,CAAC,WAAsB,EAAE,QAAmB;IACtE,MAAM,mBAAmB,GAAG,MAAM,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACjE,MAAM,gBAAgB,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IAC7E,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAJD,wBAIC;AAED,wEAAwE;AACjE,KAAK,UAAU,iBAAiB,CAAC,QAAmB;IACzD,MAAM,QAAQ,GAAc,EAAE,CAAC;IAC/B,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,QAAQ,EAAE;QACj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