@cucumber/react-components 21.1.1 → 22.1.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 (293) hide show
  1. package/README.md +2 -1
  2. package/dist/src/CucumberQueryContext.js +3 -8
  3. package/dist/src/CucumberQueryContext.js.map +1 -1
  4. package/dist/src/EnvelopesQueryContext.js +8 -20
  5. package/dist/src/EnvelopesQueryContext.js.map +1 -1
  6. package/dist/src/GherkinQueryContext.js +3 -8
  7. package/dist/src/GherkinQueryContext.js.map +1 -1
  8. package/dist/src/SearchQueryContext.js +24 -53
  9. package/dist/src/SearchQueryContext.js.map +1 -1
  10. package/dist/src/UriContext.js +2 -7
  11. package/dist/src/UriContext.js.map +1 -1
  12. package/dist/src/ciCommitLink.js +3 -9
  13. package/dist/src/ciCommitLink.js.map +1 -1
  14. package/dist/src/components/CucumberReact.d.ts +1 -1
  15. package/dist/src/components/CucumberReact.d.ts.map +1 -1
  16. package/dist/src/components/CucumberReact.js +7 -14
  17. package/dist/src/components/CucumberReact.js.map +1 -1
  18. package/dist/src/components/app/CICommitLink.js +14 -22
  19. package/dist/src/components/app/CICommitLink.js.map +1 -1
  20. package/dist/src/components/app/CIJobLink.js +8 -15
  21. package/dist/src/components/app/CIJobLink.js.map +1 -1
  22. package/dist/src/components/app/EnvelopesWrapper.js +11 -38
  23. package/dist/src/components/app/EnvelopesWrapper.js.map +1 -1
  24. package/dist/src/components/app/ExecutionSummary.js +54 -61
  25. package/dist/src/components/app/ExecutionSummary.js.map +1 -1
  26. package/dist/src/components/app/FilteredResults.d.ts.map +1 -1
  27. package/dist/src/components/app/FilteredResults.js +21 -39
  28. package/dist/src/components/app/FilteredResults.js.map +1 -1
  29. package/dist/src/components/app/GherkinDocumentList.js +27 -57
  30. package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
  31. package/dist/src/components/app/HighLight.js +14 -21
  32. package/dist/src/components/app/HighLight.js.map +1 -1
  33. package/dist/src/components/app/NavigationButton.js +4 -23
  34. package/dist/src/components/app/NavigationButton.js.map +1 -1
  35. package/dist/src/components/app/NoMatchResult.js +8 -15
  36. package/dist/src/components/app/NoMatchResult.js.map +1 -1
  37. package/dist/src/components/app/OSIcon.js +10 -17
  38. package/dist/src/components/app/OSIcon.js.map +1 -1
  39. package/dist/src/components/app/QueriesWrapper.d.ts +1 -1
  40. package/dist/src/components/app/QueriesWrapper.d.ts.map +1 -1
  41. package/dist/src/components/app/QueriesWrapper.js +7 -14
  42. package/dist/src/components/app/QueriesWrapper.js.map +1 -1
  43. package/dist/src/components/app/RuntimeIcon.js +10 -17
  44. package/dist/src/components/app/RuntimeIcon.js.map +1 -1
  45. package/dist/src/components/app/SearchBar.d.ts.map +1 -1
  46. package/dist/src/components/app/SearchBar.js +25 -30
  47. package/dist/src/components/app/SearchBar.js.map +1 -1
  48. package/dist/src/components/app/SearchWrapper.d.ts +1 -1
  49. package/dist/src/components/app/SearchWrapper.d.ts.map +1 -1
  50. package/dist/src/components/app/SearchWrapper.js +4 -46
  51. package/dist/src/components/app/SearchWrapper.js.map +1 -1
  52. package/dist/src/components/app/StatusesSummary.js +8 -15
  53. package/dist/src/components/app/StatusesSummary.js.map +1 -1
  54. package/dist/src/components/app/icons/CucumberLogo.d.ts +1 -1
  55. package/dist/src/components/app/icons/CucumberLogo.js +7 -14
  56. package/dist/src/components/app/icons/CucumberLogo.js.map +1 -1
  57. package/dist/src/components/app/icons/Jvm.d.ts +1 -1
  58. package/dist/src/components/app/icons/Jvm.js +8 -15
  59. package/dist/src/components/app/icons/Jvm.js.map +1 -1
  60. package/dist/src/components/app/icons/Linux.js +18 -25
  61. package/dist/src/components/app/icons/Linux.js.map +1 -1
  62. package/dist/src/components/app/icons/MacOS.d.ts +1 -1
  63. package/dist/src/components/app/icons/MacOS.js +4 -11
  64. package/dist/src/components/app/icons/MacOS.js.map +1 -1
  65. package/dist/src/components/app/icons/NodeJs.d.ts +1 -1
  66. package/dist/src/components/app/icons/NodeJs.js +34 -41
  67. package/dist/src/components/app/icons/NodeJs.js.map +1 -1
  68. package/dist/src/components/app/icons/Ruby.d.ts +1 -1
  69. package/dist/src/components/app/icons/Ruby.js +4 -11
  70. package/dist/src/components/app/icons/Ruby.js.map +1 -1
  71. package/dist/src/components/app/icons/Windows.js +4 -11
  72. package/dist/src/components/app/icons/Windows.js.map +1 -1
  73. package/dist/src/components/app/index.d.ts +11 -11
  74. package/dist/src/components/app/index.d.ts.map +1 -1
  75. package/dist/src/components/app/index.js +11 -27
  76. package/dist/src/components/app/index.js.map +1 -1
  77. package/dist/src/components/app/rehypePlugins.d.ts.map +1 -1
  78. package/dist/src/components/app/rehypePlugins.js +8 -13
  79. package/dist/src/components/app/rehypePlugins.js.map +1 -1
  80. package/dist/src/components/app/remarkPlugins.js +3 -8
  81. package/dist/src/components/app/remarkPlugins.js.map +1 -1
  82. package/dist/src/components/app/statuses.js +2 -27
  83. package/dist/src/components/app/statuses.js.map +1 -1
  84. package/dist/src/components/customise/customRendering.d.ts +2 -1
  85. package/dist/src/components/customise/customRendering.d.ts.map +1 -1
  86. package/dist/src/components/customise/customRendering.js +6 -33
  87. package/dist/src/components/customise/customRendering.js.map +1 -1
  88. package/dist/src/components/customise/index.d.ts +2 -2
  89. package/dist/src/components/customise/index.d.ts.map +1 -1
  90. package/dist/src/components/customise/index.js +2 -18
  91. package/dist/src/components/customise/index.js.map +1 -1
  92. package/dist/src/components/customise/theming.js +1 -2
  93. package/dist/src/components/gherkin/Anchor.d.ts +1 -1
  94. package/dist/src/components/gherkin/Anchor.d.ts.map +1 -1
  95. package/dist/src/components/gherkin/Anchor.js +11 -18
  96. package/dist/src/components/gherkin/Anchor.js.map +1 -1
  97. package/dist/src/components/gherkin/Attachment.d.ts +1 -1
  98. package/dist/src/components/gherkin/Attachment.d.ts.map +1 -1
  99. package/dist/src/components/gherkin/Attachment.js +43 -77
  100. package/dist/src/components/gherkin/Attachment.js.map +1 -1
  101. package/dist/src/components/gherkin/Background.d.ts +1 -1
  102. package/dist/src/components/gherkin/Background.d.ts.map +1 -1
  103. package/dist/src/components/gherkin/Background.js +17 -24
  104. package/dist/src/components/gherkin/Background.js.map +1 -1
  105. package/dist/src/components/gherkin/Children.d.ts +1 -1
  106. package/dist/src/components/gherkin/Children.d.ts.map +1 -1
  107. package/dist/src/components/gherkin/Children.js +7 -14
  108. package/dist/src/components/gherkin/Children.js.map +1 -1
  109. package/dist/src/components/gherkin/DataTable.d.ts +1 -1
  110. package/dist/src/components/gherkin/DataTable.d.ts.map +1 -1
  111. package/dist/src/components/gherkin/DataTable.js +12 -19
  112. package/dist/src/components/gherkin/DataTable.js.map +1 -1
  113. package/dist/src/components/gherkin/Description.d.ts +1 -1
  114. package/dist/src/components/gherkin/Description.d.ts.map +1 -1
  115. package/dist/src/components/gherkin/Description.js +9 -16
  116. package/dist/src/components/gherkin/Description.js.map +1 -1
  117. package/dist/src/components/gherkin/DocString.d.ts +1 -1
  118. package/dist/src/components/gherkin/DocString.d.ts.map +1 -1
  119. package/dist/src/components/gherkin/DocString.js +9 -16
  120. package/dist/src/components/gherkin/DocString.js.map +1 -1
  121. package/dist/src/components/gherkin/ErrorMessage.d.ts +3 -3
  122. package/dist/src/components/gherkin/ErrorMessage.d.ts.map +1 -1
  123. package/dist/src/components/gherkin/ErrorMessage.js +8 -15
  124. package/dist/src/components/gherkin/ErrorMessage.js.map +1 -1
  125. package/dist/src/components/gherkin/ExampleDetail.js +31 -61
  126. package/dist/src/components/gherkin/ExampleDetail.js.map +1 -1
  127. package/dist/src/components/gherkin/Examples.d.ts +1 -1
  128. package/dist/src/components/gherkin/Examples.d.ts.map +1 -1
  129. package/dist/src/components/gherkin/Examples.js +20 -27
  130. package/dist/src/components/gherkin/Examples.js.map +1 -1
  131. package/dist/src/components/gherkin/ExamplesContext.d.ts +1 -1
  132. package/dist/src/components/gherkin/ExamplesContext.js +2 -5
  133. package/dist/src/components/gherkin/ExamplesContext.js.map +1 -1
  134. package/dist/src/components/gherkin/ExamplesTable.d.ts +1 -1
  135. package/dist/src/components/gherkin/ExamplesTable.d.ts.map +1 -1
  136. package/dist/src/components/gherkin/ExamplesTable.js +29 -59
  137. package/dist/src/components/gherkin/ExamplesTable.js.map +1 -1
  138. package/dist/src/components/gherkin/Feature.d.ts +1 -1
  139. package/dist/src/components/gherkin/Feature.d.ts.map +1 -1
  140. package/dist/src/components/gherkin/Feature.js +24 -31
  141. package/dist/src/components/gherkin/Feature.js.map +1 -1
  142. package/dist/src/components/gherkin/GherkinDocument.d.ts +1 -1
  143. package/dist/src/components/gherkin/GherkinDocument.d.ts.map +1 -1
  144. package/dist/src/components/gherkin/GherkinDocument.js +7 -14
  145. package/dist/src/components/gherkin/GherkinDocument.js.map +1 -1
  146. package/dist/src/components/gherkin/GherkinStep.d.ts +1 -1
  147. package/dist/src/components/gherkin/GherkinStep.d.ts.map +1 -1
  148. package/dist/src/components/gherkin/GherkinStep.js +38 -46
  149. package/dist/src/components/gherkin/GherkinStep.js.map +1 -1
  150. package/dist/src/components/gherkin/GherkinSteps.d.ts +1 -1
  151. package/dist/src/components/gherkin/GherkinSteps.d.ts.map +1 -1
  152. package/dist/src/components/gherkin/GherkinSteps.js +10 -17
  153. package/dist/src/components/gherkin/GherkinSteps.js.map +1 -1
  154. package/dist/src/components/gherkin/HookStep.d.ts +1 -1
  155. package/dist/src/components/gherkin/HookStep.d.ts.map +1 -1
  156. package/dist/src/components/gherkin/HookStep.js +22 -52
  157. package/dist/src/components/gherkin/HookStep.js.map +1 -1
  158. package/dist/src/components/gherkin/HookSteps.js +5 -12
  159. package/dist/src/components/gherkin/HookSteps.js.map +1 -1
  160. package/dist/src/components/gherkin/Keyword.d.ts +1 -1
  161. package/dist/src/components/gherkin/Keyword.d.ts.map +1 -1
  162. package/dist/src/components/gherkin/Keyword.js +7 -14
  163. package/dist/src/components/gherkin/Keyword.js.map +1 -1
  164. package/dist/src/components/gherkin/MDG.js +25 -32
  165. package/dist/src/components/gherkin/MDG.js.map +1 -1
  166. package/dist/src/components/gherkin/Parameter.d.ts +1 -1
  167. package/dist/src/components/gherkin/Parameter.d.ts.map +1 -1
  168. package/dist/src/components/gherkin/Parameter.js +7 -14
  169. package/dist/src/components/gherkin/Parameter.js.map +1 -1
  170. package/dist/src/components/gherkin/Rule.d.ts +1 -1
  171. package/dist/src/components/gherkin/Rule.d.ts.map +1 -1
  172. package/dist/src/components/gherkin/Rule.js +22 -29
  173. package/dist/src/components/gherkin/Rule.js.map +1 -1
  174. package/dist/src/components/gherkin/Scenario.d.ts +1 -1
  175. package/dist/src/components/gherkin/Scenario.d.ts.map +1 -1
  176. package/dist/src/components/gherkin/Scenario.js +35 -65
  177. package/dist/src/components/gherkin/Scenario.js.map +1 -1
  178. package/dist/src/components/gherkin/StatusIcon.d.ts +1 -1
  179. package/dist/src/components/gherkin/StatusIcon.d.ts.map +1 -1
  180. package/dist/src/components/gherkin/StatusIcon.js +16 -23
  181. package/dist/src/components/gherkin/StatusIcon.js.map +1 -1
  182. package/dist/src/components/gherkin/StepItem.js +7 -14
  183. package/dist/src/components/gherkin/StepItem.js.map +1 -1
  184. package/dist/src/components/gherkin/StepsList.js +4 -11
  185. package/dist/src/components/gherkin/StepsList.js.map +1 -1
  186. package/dist/src/components/gherkin/Tags.d.ts +1 -1
  187. package/dist/src/components/gherkin/Tags.d.ts.map +1 -1
  188. package/dist/src/components/gherkin/Tags.js +9 -16
  189. package/dist/src/components/gherkin/Tags.js.map +1 -1
  190. package/dist/src/components/gherkin/Title.d.ts +1 -1
  191. package/dist/src/components/gherkin/Title.d.ts.map +1 -1
  192. package/dist/src/components/gherkin/Title.js +9 -16
  193. package/dist/src/components/gherkin/Title.js.map +1 -1
  194. package/dist/src/components/gherkin/attachmentFilename.js +3 -10
  195. package/dist/src/components/gherkin/attachmentFilename.js.map +1 -1
  196. package/dist/src/components/gherkin/index.d.ts +25 -25
  197. package/dist/src/components/gherkin/index.d.ts.map +1 -1
  198. package/dist/src/components/gherkin/index.js +25 -41
  199. package/dist/src/components/gherkin/index.js.map +1 -1
  200. package/dist/src/components/gherkin/isNumber.js +1 -4
  201. package/dist/src/components/gherkin/isNumber.js.map +1 -1
  202. package/dist/src/components/gherkin/statusName.js +1 -3
  203. package/dist/src/components/gherkin/statusName.js.map +1 -1
  204. package/dist/src/components/index.d.ts +4 -4
  205. package/dist/src/components/index.d.ts.map +1 -1
  206. package/dist/src/components/index.js +4 -33
  207. package/dist/src/components/index.js.map +1 -1
  208. package/dist/src/components/results/TestStepResultDetails.d.ts +4 -0
  209. package/dist/src/components/results/TestStepResultDetails.d.ts.map +1 -0
  210. package/dist/src/components/results/TestStepResultDetails.js +16 -0
  211. package/dist/src/components/results/TestStepResultDetails.js.map +1 -0
  212. package/dist/src/components/results/index.d.ts +2 -0
  213. package/dist/src/components/results/index.d.ts.map +1 -0
  214. package/dist/src/components/results/index.js +2 -0
  215. package/dist/src/components/results/index.js.map +1 -0
  216. package/dist/src/countScenariosByStatuses.d.ts +2 -1
  217. package/dist/src/countScenariosByStatuses.d.ts.map +1 -1
  218. package/dist/src/countScenariosByStatuses.js +26 -33
  219. package/dist/src/countScenariosByStatuses.js.map +1 -1
  220. package/dist/src/filter/filterByStatus.d.ts +2 -1
  221. package/dist/src/filter/filterByStatus.d.ts.map +1 -1
  222. package/dist/src/filter/filterByStatus.js +9 -9
  223. package/dist/src/filter/filterByStatus.js.map +1 -1
  224. package/dist/src/hooks/index.d.ts +2 -2
  225. package/dist/src/hooks/index.d.ts.map +1 -1
  226. package/dist/src/hooks/index.js +2 -18
  227. package/dist/src/hooks/index.js.map +1 -1
  228. package/dist/src/hooks/useFilteredDocuments.d.ts +3 -0
  229. package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -0
  230. package/dist/src/hooks/useFilteredDocuments.js +27 -0
  231. package/dist/src/hooks/useFilteredDocuments.js.map +1 -0
  232. package/dist/src/hooks/useQueries.d.ts +1 -1
  233. package/dist/src/hooks/useQueries.d.ts.map +1 -1
  234. package/dist/src/hooks/useQueries.js +8 -15
  235. package/dist/src/hooks/useQueries.js.map +1 -1
  236. package/dist/src/hooks/useResultStatistics.d.ts +6 -0
  237. package/dist/src/hooks/useResultStatistics.d.ts.map +1 -0
  238. package/dist/src/hooks/useResultStatistics.js +7 -0
  239. package/dist/src/hooks/useResultStatistics.js.map +1 -0
  240. package/dist/src/hooks/useSearch.d.ts +1 -1
  241. package/dist/src/hooks/useSearch.d.ts.map +1 -1
  242. package/dist/src/hooks/useSearch.js +4 -11
  243. package/dist/src/hooks/useSearch.js.map +1 -1
  244. package/dist/src/index.d.ts +7 -7
  245. package/dist/src/index.d.ts.map +1 -1
  246. package/dist/src/index.js +8 -43
  247. package/dist/src/index.js.map +1 -1
  248. package/dist/src/isTagExpression.js +1 -4
  249. package/dist/src/isTagExpression.js.map +1 -1
  250. package/dist/src/search/FeatureSearch.d.ts +3 -7
  251. package/dist/src/search/FeatureSearch.d.ts.map +1 -1
  252. package/dist/src/search/FeatureSearch.js +31 -31
  253. package/dist/src/search/FeatureSearch.js.map +1 -1
  254. package/dist/src/search/ScenarioLikeSearch.d.ts +25 -0
  255. package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -0
  256. package/dist/src/search/ScenarioLikeSearch.js +41 -0
  257. package/dist/src/search/ScenarioLikeSearch.js.map +1 -0
  258. package/dist/src/search/Search.d.ts +9 -9
  259. package/dist/src/search/Search.d.ts.map +1 -1
  260. package/dist/src/search/Search.js +34 -20
  261. package/dist/src/search/Search.js.map +1 -1
  262. package/dist/src/search/StepSearch.d.ts +16 -8
  263. package/dist/src/search/StepSearch.d.ts.map +1 -1
  264. package/dist/src/search/StepSearch.js +33 -44
  265. package/dist/src/search/StepSearch.js.map +1 -1
  266. package/dist/src/search/TagSearch.d.ts +2 -10
  267. package/dist/src/search/TagSearch.d.ts.map +1 -1
  268. package/dist/src/search/TagSearch.js +17 -18
  269. package/dist/src/search/TagSearch.js.map +1 -1
  270. package/dist/src/search/TextSearch.d.ts +2 -11
  271. package/dist/src/search/TextSearch.d.ts.map +1 -1
  272. package/dist/src/search/TextSearch.js +47 -36
  273. package/dist/src/search/TextSearch.js.map +1 -1
  274. package/dist/src/search/index.d.ts +3 -0
  275. package/dist/src/search/index.d.ts.map +1 -0
  276. package/dist/src/search/index.js +3 -0
  277. package/dist/src/search/index.js.map +1 -0
  278. package/dist/src/search/types.d.ts +14 -0
  279. package/dist/src/search/types.d.ts.map +1 -0
  280. package/dist/src/search/types.js +2 -0
  281. package/dist/src/search/types.js.map +1 -0
  282. package/dist/src/toRepositoryId.js +1 -4
  283. package/dist/src/toRepositoryId.js.map +1 -1
  284. package/dist/tsconfig.build.tsbuildinfo +1 -1
  285. package/package.json +35 -27
  286. package/dist/src/search/RuleSearch.d.ts +0 -9
  287. package/dist/src/search/RuleSearch.d.ts.map +0 -1
  288. package/dist/src/search/RuleSearch.js +0 -42
  289. package/dist/src/search/RuleSearch.js.map +0 -1
  290. package/dist/src/search/ScenarioSearch.d.ts +0 -9
  291. package/dist/src/search/ScenarioSearch.d.ts.map +0 -1
  292. package/dist/src/search/ScenarioSearch.js +0 -42
  293. package/dist/src/search/ScenarioSearch.js.map +0 -1
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const elasticlunr_1 = __importDefault(require("elasticlunr"));
7
- class RuleSearch {
8
- constructor() {
9
- this.index = (0, elasticlunr_1.default)((ctx) => {
10
- ctx.setRef('id');
11
- ctx.addField('name');
12
- ctx.addField('description');
13
- ctx.saveDocument(true);
14
- });
15
- this.ruleById = new Map();
16
- }
17
- add(rule) {
18
- this.index.addDoc({
19
- id: rule.id,
20
- name: rule.name,
21
- description: rule.description,
22
- });
23
- this.ruleById.set(rule.id, rule);
24
- }
25
- search(query) {
26
- const results = this.index.search(query, {
27
- fields: {
28
- name: { bool: 'OR', boost: 1 },
29
- description: { bool: 'OR', boost: 1 },
30
- },
31
- });
32
- return results.map((result) => this.get(result.ref));
33
- }
34
- get(ref) {
35
- const rule = this.ruleById.get(ref);
36
- if (!rule)
37
- throw new Error(`No rule for ref ${ref}`);
38
- return rule;
39
- }
40
- }
41
- exports.default = RuleSearch;
42
- //# sourceMappingURL=RuleSearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuleSearch.js","sourceRoot":"","sources":["../../../src/search/RuleSearch.ts"],"names":[],"mappings":";;;;;AACA,8DAAqC;AAQrC,MAAqB,UAAU;IAA/B;QACmB,UAAK,GAAG,IAAA,qBAAW,EAAiB,CAAC,GAAG,EAAE,EAAE;YAC3D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAChB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YACpB,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;YAC3B,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC,CAAC,CAAA;QACM,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAA;IA2BrD,CAAC;IAzBQ,GAAG,CAAC,IAAmB;QAC5B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAEM,MAAM,CAAC,KAAa;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;YACvC,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC9B,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;aACtC;SACF,CAAC,CAAA;QAEF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IACtD,CAAC;IAEO,GAAG,CAAC,GAAW;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAA;QACpD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAlCD,6BAkCC"}
@@ -1,9 +0,0 @@
1
- import * as messages from '@cucumber/messages';
2
- export default class ScenarioSearch {
3
- private readonly index;
4
- private scenarioById;
5
- add(scenario: messages.Scenario): void;
6
- search(query: string): messages.Scenario[];
7
- private get;
8
- }
9
- //# sourceMappingURL=ScenarioSearch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScenarioSearch.d.ts","sourceRoot":"","sources":["../../../src/search/ScenarioSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAS9C,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAKpB;IACF,OAAO,CAAC,YAAY,CAAuC;IAEpD,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAStC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE;IAWjD,OAAO,CAAC,GAAG;CAKZ"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const elasticlunr_1 = __importDefault(require("elasticlunr"));
7
- class ScenarioSearch {
8
- constructor() {
9
- this.index = (0, elasticlunr_1.default)((ctx) => {
10
- ctx.setRef('id');
11
- ctx.addField('name');
12
- ctx.addField('description');
13
- ctx.saveDocument(true);
14
- });
15
- this.scenarioById = new Map();
16
- }
17
- add(scenario) {
18
- this.index.addDoc({
19
- id: scenario.id,
20
- name: scenario.name,
21
- description: scenario.description,
22
- });
23
- this.scenarioById.set(scenario.id, scenario);
24
- }
25
- search(query) {
26
- const results = this.index.search(query, {
27
- fields: {
28
- name: { bool: 'OR', boost: 1 },
29
- description: { bool: 'OR', boost: 1 },
30
- },
31
- });
32
- return results.map((result) => this.get(result.ref));
33
- }
34
- get(ref) {
35
- const rule = this.scenarioById.get(ref);
36
- if (!rule)
37
- throw new Error(`No scenario for ref ${ref}`);
38
- return rule;
39
- }
40
- }
41
- exports.default = ScenarioSearch;
42
- //# sourceMappingURL=ScenarioSearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScenarioSearch.js","sourceRoot":"","sources":["../../../src/search/ScenarioSearch.ts"],"names":[],"mappings":";;;;;AACA,8DAAqC;AAQrC,MAAqB,cAAc;IAAnC;QACmB,UAAK,GAAG,IAAA,qBAAW,EAAqB,CAAC,GAAG,EAAE,EAAE;YAC/D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAChB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YACpB,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;YAC3B,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC,CAAC,CAAA;QACM,iBAAY,GAAG,IAAI,GAAG,EAA6B,CAAA;IA2B7D,CAAC;IAzBQ,GAAG,CAAC,QAA2B;QACpC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAChB,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;SAClC,CAAC,CAAA;QACF,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAC9C,CAAC;IAEM,MAAM,CAAC,KAAa;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;YACvC,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC9B,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;aACtC;SACF,CAAC,CAAA;QAEF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IACtD,CAAC;IAEO,GAAG,CAAC,GAAW;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACvC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;QACxD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAlCD,iCAkCC"}