@cucumber/react-components 24.1.2 → 24.3.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.
- package/LICENSE +1 -1
- package/dist/src/CucumberQueryContext.d.ts +1 -2
- package/dist/src/CucumberQueryContext.d.ts.map +1 -1
- package/dist/src/CucumberQueryContext.js +2 -2
- package/dist/src/CucumberQueryContext.js.map +1 -1
- package/dist/src/GherkinQueryContext.d.ts +1 -2
- package/dist/src/GherkinQueryContext.d.ts.map +1 -1
- package/dist/src/GherkinQueryContext.js +2 -2
- package/dist/src/GherkinQueryContext.js.map +1 -1
- package/dist/src/SearchContext.d.ts +11 -5
- package/dist/src/SearchContext.d.ts.map +1 -1
- package/dist/src/SearchContext.js +4 -2
- package/dist/src/SearchContext.js.map +1 -1
- package/dist/src/ciCommitLink.d.ts +1 -1
- package/dist/src/ciCommitLink.d.ts.map +1 -1
- package/dist/src/ciCommitLink.js +1 -1
- package/dist/src/ciCommitLink.js.map +1 -1
- package/dist/src/components/app/CICommitLink.d.ts +2 -2
- package/dist/src/components/app/CICommitLink.d.ts.map +1 -1
- package/dist/src/components/app/CICommitLink.js +3 -8
- package/dist/src/components/app/CICommitLink.js.map +1 -1
- package/dist/src/components/app/CIJobLink.d.ts +2 -2
- package/dist/src/components/app/CIJobLink.d.ts.map +1 -1
- package/dist/src/components/app/CIJobLink.js +3 -7
- package/dist/src/components/app/CIJobLink.js.map +1 -1
- package/dist/src/components/app/ControlledSearchProvider.d.ts +2 -2
- package/dist/src/components/app/ControlledSearchProvider.d.ts.map +1 -1
- package/dist/src/components/app/ControlledSearchProvider.js +24 -2
- package/dist/src/components/app/ControlledSearchProvider.js.map +1 -1
- package/dist/src/components/app/CopyButton.d.ts +2 -1
- package/dist/src/components/app/CopyButton.d.ts.map +1 -1
- package/dist/src/components/app/CopyButton.js +4 -4
- package/dist/src/components/app/CopyButton.js.map +1 -1
- package/dist/src/components/app/DocumentAccordion.d.ts +3 -3
- package/dist/src/components/app/DocumentAccordion.d.ts.map +1 -1
- package/dist/src/components/app/DocumentAccordion.js +12 -20
- package/dist/src/components/app/DocumentAccordion.js.map +1 -1
- package/dist/src/components/app/DocumentAccordion.module.scss +15 -7
- package/dist/src/components/app/EnvelopesProvider.d.ts +2 -2
- package/dist/src/components/app/EnvelopesProvider.d.ts.map +1 -1
- package/dist/src/components/app/EnvelopesProvider.js +3 -2
- package/dist/src/components/app/EnvelopesProvider.js.map +1 -1
- package/dist/src/components/app/ExecutionSummary.d.ts +1 -1
- package/dist/src/components/app/ExecutionSummary.d.ts.map +1 -1
- package/dist/src/components/app/ExecutionSummary.js +3 -49
- package/dist/src/components/app/ExecutionSummary.js.map +1 -1
- package/dist/src/components/app/FilteredDocuments.d.ts +1 -1
- package/dist/src/components/app/FilteredDocuments.d.ts.map +1 -1
- package/dist/src/components/app/FilteredDocuments.js +4 -4
- package/dist/src/components/app/FilteredDocuments.js.map +1 -1
- package/dist/src/components/app/GherkinDocumentList.d.ts +3 -3
- package/dist/src/components/app/GherkinDocumentList.d.ts.map +1 -1
- package/dist/src/components/app/GherkinDocumentList.js +8 -9
- package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
- package/dist/src/components/app/Header.d.ts +1 -1
- package/dist/src/components/app/Header.d.ts.map +1 -1
- package/dist/src/components/app/Header.js +4 -4
- package/dist/src/components/app/Header.js.map +1 -1
- package/dist/src/components/app/HealthChart.d.ts +1 -1
- package/dist/src/components/app/HealthChart.d.ts.map +1 -1
- package/dist/src/components/app/HealthChart.js +6 -7
- package/dist/src/components/app/HealthChart.js.map +1 -1
- package/dist/src/components/app/HighLight.d.ts +2 -2
- package/dist/src/components/app/HighLight.d.ts.map +1 -1
- package/dist/src/components/app/HighLight.js +15 -9
- package/dist/src/components/app/HighLight.js.map +1 -1
- package/dist/src/components/app/ImplementationIcon.d.ts +2 -2
- package/dist/src/components/app/ImplementationIcon.d.ts.map +1 -1
- package/dist/src/components/app/ImplementationIcon.js +2 -2
- package/dist/src/components/app/ImplementationIcon.js.map +1 -1
- package/dist/src/components/app/InMemorySearchProvider.d.ts +2 -2
- package/dist/src/components/app/InMemorySearchProvider.d.ts.map +1 -1
- package/dist/src/components/app/InMemorySearchProvider.js +3 -2
- package/dist/src/components/app/InMemorySearchProvider.js.map +1 -1
- package/dist/src/components/app/NavigationButton.d.ts +1 -1
- package/dist/src/components/app/NavigationButton.d.ts.map +1 -1
- package/dist/src/components/app/NavigationButton.js +2 -2
- package/dist/src/components/app/NavigationButton.js.map +1 -1
- package/dist/src/components/app/OSIcon.d.ts +2 -2
- package/dist/src/components/app/OSIcon.d.ts.map +1 -1
- package/dist/src/components/app/OSIcon.js +4 -4
- package/dist/src/components/app/OSIcon.js.map +1 -1
- package/dist/src/components/app/QueriesProvider.d.ts +3 -3
- package/dist/src/components/app/QueriesProvider.d.ts.map +1 -1
- package/dist/src/components/app/QueriesProvider.js +4 -3
- package/dist/src/components/app/QueriesProvider.js.map +1 -1
- package/dist/src/components/app/Report.d.ts +1 -1
- package/dist/src/components/app/Report.d.ts.map +1 -1
- package/dist/src/components/app/Report.js +2 -11
- package/dist/src/components/app/Report.js.map +1 -1
- package/dist/src/components/app/RuntimeIcon.d.ts +2 -2
- package/dist/src/components/app/RuntimeIcon.d.ts.map +1 -1
- package/dist/src/components/app/RuntimeIcon.js +4 -4
- package/dist/src/components/app/RuntimeIcon.js.map +1 -1
- package/dist/src/components/app/SearchBar.d.ts +1 -1
- package/dist/src/components/app/SearchBar.d.ts.map +1 -1
- package/dist/src/components/app/SearchBar.js +9 -24
- package/dist/src/components/app/SearchBar.js.map +1 -1
- package/dist/src/components/app/StatusesSummary.d.ts +1 -1
- package/dist/src/components/app/StatusesSummary.d.ts.map +1 -1
- package/dist/src/components/app/StatusesSummary.js +8 -11
- package/dist/src/components/app/StatusesSummary.js.map +1 -1
- package/dist/src/components/app/TestRunHooks.d.ts +1 -1
- package/dist/src/components/app/TestRunHooks.d.ts.map +1 -1
- package/dist/src/components/app/TestRunHooks.js +5 -5
- package/dist/src/components/app/TestRunHooks.js.map +1 -1
- package/dist/src/components/app/UrlSearchProvider.d.ts +1 -1
- package/dist/src/components/app/UrlSearchProvider.d.ts.map +1 -1
- package/dist/src/components/app/UrlSearchProvider.js +6 -3
- package/dist/src/components/app/UrlSearchProvider.js.map +1 -1
- package/dist/src/components/app/icons/CucumberLogo.d.ts +1 -1
- package/dist/src/components/app/icons/CucumberLogo.d.ts.map +1 -1
- package/dist/src/components/app/icons/CucumberLogo.js +2 -6
- package/dist/src/components/app/icons/CucumberLogo.js.map +1 -1
- package/dist/src/components/app/icons/Jvm.d.ts +1 -1
- package/dist/src/components/app/icons/Jvm.d.ts.map +1 -1
- package/dist/src/components/app/icons/Jvm.js +2 -7
- package/dist/src/components/app/icons/Jvm.js.map +1 -1
- package/dist/src/components/app/icons/Linux.d.ts +1 -1
- package/dist/src/components/app/icons/Linux.d.ts.map +1 -1
- package/dist/src/components/app/icons/Linux.js +2 -17
- package/dist/src/components/app/icons/Linux.js.map +1 -1
- package/dist/src/components/app/icons/MacOS.d.ts +1 -1
- package/dist/src/components/app/icons/MacOS.d.ts.map +1 -1
- package/dist/src/components/app/icons/MacOS.js +2 -3
- package/dist/src/components/app/icons/MacOS.js.map +1 -1
- package/dist/src/components/app/icons/NodeJs.d.ts +1 -1
- package/dist/src/components/app/icons/NodeJs.d.ts.map +1 -1
- package/dist/src/components/app/icons/NodeJs.js +2 -5
- package/dist/src/components/app/icons/NodeJs.js.map +1 -1
- package/dist/src/components/app/icons/Ruby.d.ts +1 -1
- package/dist/src/components/app/icons/Ruby.d.ts.map +1 -1
- package/dist/src/components/app/icons/Ruby.js +2 -3
- package/dist/src/components/app/icons/Ruby.js.map +1 -1
- package/dist/src/components/app/icons/Windows.d.ts +1 -1
- package/dist/src/components/app/icons/Windows.d.ts.map +1 -1
- package/dist/src/components/app/icons/Windows.js +2 -3
- package/dist/src/components/app/icons/Windows.js.map +1 -1
- package/dist/src/components/app/makeSetupString.d.ts +1 -1
- package/dist/src/components/app/makeSetupString.d.ts.map +1 -1
- package/dist/src/components/app/makeSetupString.js.map +1 -1
- package/dist/src/components/app/markdownComponents.d.ts +9 -0
- package/dist/src/components/app/markdownComponents.d.ts.map +1 -0
- package/dist/src/components/app/markdownComponents.js +6 -0
- package/dist/src/components/app/markdownComponents.js.map +1 -0
- package/dist/src/components/app/rehypePlugins.d.ts +2 -2
- package/dist/src/components/app/rehypePlugins.d.ts.map +1 -1
- package/dist/src/components/app/rehypePlugins.js.map +1 -1
- package/dist/src/components/app/remarkPlugins.d.ts +2 -2
- package/dist/src/components/app/remarkPlugins.d.ts.map +1 -1
- package/dist/src/components/app/remarkPlugins.js.map +1 -1
- package/dist/src/components/customise/CustomRendering.d.ts +18 -18
- package/dist/src/components/customise/CustomRendering.d.ts.map +1 -1
- package/dist/src/components/customise/CustomRendering.js +10 -9
- package/dist/src/components/customise/CustomRendering.js.map +1 -1
- package/dist/src/components/customise/CustomRendering.stories.scss +0 -17
- package/dist/src/components/gherkin/Anchor.d.ts +3 -3
- package/dist/src/components/gherkin/Anchor.d.ts.map +1 -1
- package/dist/src/components/gherkin/Anchor.js +3 -6
- package/dist/src/components/gherkin/Anchor.js.map +1 -1
- package/dist/src/components/gherkin/Background.d.ts +3 -3
- package/dist/src/components/gherkin/Background.d.ts.map +1 -1
- package/dist/src/components/gherkin/Background.js +4 -10
- package/dist/src/components/gherkin/Background.js.map +1 -1
- package/dist/src/components/gherkin/Children.d.ts +3 -3
- package/dist/src/components/gherkin/Children.d.ts.map +1 -1
- package/dist/src/components/gherkin/Children.js +3 -3
- package/dist/src/components/gherkin/Children.js.map +1 -1
- package/dist/src/components/gherkin/DataTable.d.ts +3 -3
- package/dist/src/components/gherkin/DataTable.d.ts.map +1 -1
- package/dist/src/components/gherkin/DataTable.js +4 -6
- package/dist/src/components/gherkin/DataTable.js.map +1 -1
- package/dist/src/components/gherkin/Description.d.ts +3 -3
- package/dist/src/components/gherkin/Description.d.ts.map +1 -1
- package/dist/src/components/gherkin/Description.js +3 -4
- package/dist/src/components/gherkin/Description.js.map +1 -1
- package/dist/src/components/gherkin/DocString.d.ts +3 -3
- package/dist/src/components/gherkin/DocString.d.ts.map +1 -1
- package/dist/src/components/gherkin/DocString.js +3 -4
- package/dist/src/components/gherkin/DocString.js.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.d.ts +2 -2
- package/dist/src/components/gherkin/ErrorMessage.d.ts.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.js +5 -3
- package/dist/src/components/gherkin/ErrorMessage.js.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.module.scss +17 -5
- package/dist/src/components/gherkin/Examples.d.ts +3 -3
- package/dist/src/components/gherkin/Examples.d.ts.map +1 -1
- package/dist/src/components/gherkin/Examples.js +7 -18
- package/dist/src/components/gherkin/Examples.js.map +1 -1
- package/dist/src/components/gherkin/Feature.d.ts +3 -3
- package/dist/src/components/gherkin/Feature.d.ts.map +1 -1
- package/dist/src/components/gherkin/Feature.js +14 -24
- package/dist/src/components/gherkin/Feature.js.map +1 -1
- package/dist/src/components/gherkin/GherkinDocument.d.ts +3 -3
- package/dist/src/components/gherkin/GherkinDocument.d.ts.map +1 -1
- package/dist/src/components/gherkin/GherkinDocument.js +3 -3
- package/dist/src/components/gherkin/GherkinDocument.js.map +1 -1
- package/dist/src/components/gherkin/Keyword.d.ts +2 -2
- package/dist/src/components/gherkin/Keyword.d.ts.map +1 -1
- package/dist/src/components/gherkin/Keyword.js +3 -3
- package/dist/src/components/gherkin/Keyword.js.map +1 -1
- package/dist/src/components/gherkin/Keyword.module.scss +0 -1
- package/dist/src/components/gherkin/Parameter.d.ts +3 -3
- package/dist/src/components/gherkin/Parameter.d.ts.map +1 -1
- package/dist/src/components/gherkin/Parameter.js +4 -4
- package/dist/src/components/gherkin/Parameter.js.map +1 -1
- package/dist/src/components/gherkin/Rule.d.ts +3 -3
- package/dist/src/components/gherkin/Rule.d.ts.map +1 -1
- package/dist/src/components/gherkin/Rule.js +11 -21
- package/dist/src/components/gherkin/Rule.js.map +1 -1
- package/dist/src/components/gherkin/Scenario.d.ts +3 -3
- package/dist/src/components/gherkin/Scenario.d.ts.map +1 -1
- package/dist/src/components/gherkin/Scenario.js +5 -14
- package/dist/src/components/gherkin/Scenario.js.map +1 -1
- package/dist/src/components/gherkin/StatusIcon.d.ts +2 -2
- package/dist/src/components/gherkin/StatusIcon.d.ts.map +1 -1
- package/dist/src/components/gherkin/StatusIcon.js +10 -10
- package/dist/src/components/gherkin/StatusIcon.js.map +1 -1
- package/dist/src/components/gherkin/StepsList.d.ts +1 -1
- package/dist/src/components/gherkin/StepsList.d.ts.map +1 -1
- package/dist/src/components/gherkin/StepsList.js +2 -2
- package/dist/src/components/gherkin/StepsList.js.map +1 -1
- package/dist/src/components/gherkin/Tags.d.ts +3 -3
- package/dist/src/components/gherkin/Tags.d.ts.map +1 -1
- package/dist/src/components/gherkin/Tags.js +4 -5
- package/dist/src/components/gherkin/Tags.js.map +1 -1
- package/dist/src/components/gherkin/Title.d.ts +3 -3
- package/dist/src/components/gherkin/Title.d.ts.map +1 -1
- package/dist/src/components/gherkin/Title.js +3 -4
- package/dist/src/components/gherkin/Title.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Attachment.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.js +14 -17
- package/dist/src/components/gherkin/attachment/Attachment.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.module.scss +15 -5
- package/dist/src/components/gherkin/attachment/Image.d.ts +4 -4
- package/dist/src/components/gherkin/attachment/Image.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Image.js +6 -8
- package/dist/src/components/gherkin/attachment/Image.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Links.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Links.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Links.js +7 -10
- package/dist/src/components/gherkin/attachment/Links.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Log.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Log.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Log.js +3 -3
- package/dist/src/components/gherkin/attachment/Log.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Text.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Text.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Text.js +4 -6
- package/dist/src/components/gherkin/attachment/Text.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Unknown.d.ts +2 -2
- package/dist/src/components/gherkin/attachment/Unknown.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Unknown.js +9 -17
- package/dist/src/components/gherkin/attachment/Unknown.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Video.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Video.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Video.js +6 -10
- package/dist/src/components/gherkin/attachment/Video.js.map +1 -1
- package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts +1 -1
- package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/attachmentFilename.js.map +1 -1
- package/dist/src/components/gherkin/attachment/base64Decode.d.ts +9 -1
- package/dist/src/components/gherkin/attachment/base64Decode.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/base64Decode.js +17 -3
- package/dist/src/components/gherkin/attachment/base64Decode.js.map +1 -1
- package/dist/src/components/gherkin/attachment/useText.d.ts +1 -1
- package/dist/src/components/gherkin/attachment/useText.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/useText.js +3 -3
- package/dist/src/components/gherkin/attachment/useText.js.map +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.d.ts +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.d.ts.map +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.js +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.js.map +1 -1
- package/dist/src/components/gherkin/composePickleStepTitle.d.ts +1 -1
- package/dist/src/components/gherkin/composePickleStepTitle.d.ts.map +1 -1
- package/dist/src/components/gherkin/composePickleStepTitle.js +2 -2
- package/dist/src/components/gherkin/composePickleStepTitle.js.map +1 -1
- package/dist/src/components/gherkin/statusName.d.ts +2 -2
- package/dist/src/components/gherkin/statusName.d.ts.map +1 -1
- package/dist/src/components/gherkin/statusName.js.map +1 -1
- package/dist/src/components/results/AmbiguousResult.d.ts +8 -0
- package/dist/src/components/results/AmbiguousResult.d.ts.map +1 -0
- package/dist/src/components/results/AmbiguousResult.js +11 -0
- package/dist/src/components/results/AmbiguousResult.js.map +1 -0
- package/dist/src/components/results/AmbiguousResult.module.scss +22 -0
- package/dist/src/components/results/FailedResult.d.ts +8 -0
- package/dist/src/components/results/FailedResult.d.ts.map +1 -0
- package/dist/src/components/results/FailedResult.js +15 -0
- package/dist/src/components/results/FailedResult.js.map +1 -0
- package/dist/src/components/results/PendingResult.d.ts +8 -0
- package/dist/src/components/results/PendingResult.d.ts.map +1 -0
- package/dist/src/components/results/PendingResult.js +12 -0
- package/dist/src/components/results/PendingResult.js.map +1 -0
- package/dist/src/components/results/ResultNote.d.ts +3 -0
- package/dist/src/components/results/ResultNote.d.ts.map +1 -0
- package/dist/src/components/results/ResultNote.js +6 -0
- package/dist/src/components/results/ResultNote.js.map +1 -0
- package/dist/src/components/results/ResultNote.module.scss +6 -0
- package/dist/src/components/results/SkippedResult.d.ts +8 -0
- package/dist/src/components/results/SkippedResult.d.ts.map +1 -0
- package/dist/src/components/results/SkippedResult.js +12 -0
- package/dist/src/components/results/SkippedResult.js.map +1 -0
- package/dist/src/components/results/SourceReference.d.ts +8 -0
- package/dist/src/components/results/SourceReference.d.ts.map +1 -0
- package/dist/src/components/results/SourceReference.js +13 -0
- package/dist/src/components/results/SourceReference.js.map +1 -0
- package/dist/src/components/results/SourceReference.module.scss +10 -0
- package/dist/src/components/results/TestCaseOutcome.d.ts +2 -2
- package/dist/src/components/results/TestCaseOutcome.d.ts.map +1 -1
- package/dist/src/components/results/TestCaseOutcome.js +5 -9
- package/dist/src/components/results/TestCaseOutcome.js.map +1 -1
- package/dist/src/components/results/TestRunHookOutcome.d.ts +2 -2
- package/dist/src/components/results/TestRunHookOutcome.d.ts.map +1 -1
- package/dist/src/components/results/TestRunHookOutcome.js +4 -13
- package/dist/src/components/results/TestRunHookOutcome.js.map +1 -1
- package/dist/src/components/results/TestStepAttachments.d.ts +2 -2
- package/dist/src/components/results/TestStepAttachments.d.ts.map +1 -1
- package/dist/src/components/results/TestStepAttachments.js +4 -5
- package/dist/src/components/results/TestStepAttachments.js.map +1 -1
- package/dist/src/components/results/TestStepDuration.d.ts +2 -2
- package/dist/src/components/results/TestStepDuration.d.ts.map +1 -1
- package/dist/src/components/results/TestStepDuration.js +4 -2
- package/dist/src/components/results/TestStepDuration.js.map +1 -1
- package/dist/src/components/results/TestStepOutcome.d.ts +2 -2
- package/dist/src/components/results/TestStepOutcome.d.ts.map +1 -1
- package/dist/src/components/results/TestStepOutcome.js +18 -27
- package/dist/src/components/results/TestStepOutcome.js.map +1 -1
- package/dist/src/components/results/TestStepOutcome.module.scss +1 -1
- package/dist/src/components/results/UndefinedResult.d.ts +8 -0
- package/dist/src/components/results/UndefinedResult.d.ts.map +1 -0
- package/dist/src/components/results/UndefinedResult.js +18 -0
- package/dist/src/components/results/UndefinedResult.js.map +1 -0
- package/dist/src/components/results/UndefinedResult.module.scss +14 -0
- package/dist/src/components/results/index.d.ts +1 -1
- package/dist/src/components/results/index.d.ts.map +1 -1
- package/dist/src/components/results/index.js +1 -1
- package/dist/src/components/results/index.js.map +1 -1
- package/dist/src/formatExecutionDuration.js.map +1 -1
- package/dist/src/hooks/helpers.js.map +1 -1
- package/dist/src/hooks/useFilteredDocuments.d.ts +2 -2
- package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -1
- package/dist/src/hooks/useFilteredDocuments.js +70 -18
- package/dist/src/hooks/useFilteredDocuments.js.map +1 -1
- package/dist/src/hooks/useMostSevereStatusByUri.js.map +1 -1
- package/dist/src/hooks/useQueries.d.ts +2 -2
- package/dist/src/hooks/useQueries.d.ts.map +1 -1
- package/dist/src/hooks/useQueries.js.map +1 -1
- package/dist/src/hooks/useResultStatistics.d.ts +3 -2
- package/dist/src/hooks/useResultStatistics.d.ts.map +1 -1
- package/dist/src/hooks/useResultStatistics.js +19 -2
- package/dist/src/hooks/useResultStatistics.js.map +1 -1
- package/dist/src/hooks/useSearch.d.ts +1 -1
- package/dist/src/hooks/useSearch.d.ts.map +1 -1
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/hooks/useTestCaseStarted.d.ts +6 -1
- package/dist/src/hooks/useTestCaseStarted.d.ts.map +1 -1
- package/dist/src/hooks/useTestCaseStarted.js +13 -10
- package/dist/src/hooks/useTestCaseStarted.js.map +1 -1
- package/dist/src/hooks/useTestRunHooks.d.ts +1 -1
- package/dist/src/hooks/useTestRunHooks.d.ts.map +1 -1
- package/dist/src/hooks/useTestRunHooks.js.map +1 -1
- package/dist/src/search/FeatureSearch.d.ts +12 -3
- package/dist/src/search/FeatureSearch.d.ts.map +1 -1
- package/dist/src/search/FeatureSearch.js +9 -17
- package/dist/src/search/FeatureSearch.js.map +1 -1
- package/dist/src/search/ScenarioLikeSearch.d.ts +8 -13
- package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -1
- package/dist/src/search/ScenarioLikeSearch.js +13 -17
- package/dist/src/search/ScenarioLikeSearch.js.map +1 -1
- package/dist/src/search/StepSearch.d.ts +9 -16
- package/dist/src/search/StepSearch.d.ts.map +1 -1
- package/dist/src/search/StepSearch.js +13 -17
- package/dist/src/search/StepSearch.js.map +1 -1
- package/dist/src/search/TextSearch.d.ts +11 -2
- package/dist/src/search/TextSearch.d.ts.map +1 -1
- package/dist/src/search/TextSearch.js +59 -52
- package/dist/src/search/TextSearch.js.map +1 -1
- package/dist/src/search/createSearchIndex.d.ts +7 -0
- package/dist/src/search/createSearchIndex.d.ts.map +1 -0
- package/dist/src/search/createSearchIndex.js +10 -0
- package/dist/src/search/createSearchIndex.js.map +1 -0
- package/dist/src/search/deriveLineageConstraints.d.ts +8 -0
- package/dist/src/search/deriveLineageConstraints.d.ts.map +1 -0
- package/dist/src/search/deriveLineageConstraints.js +38 -0
- package/dist/src/search/deriveLineageConstraints.js.map +1 -0
- package/dist/src/search/index.d.ts +3 -1
- package/dist/src/search/index.d.ts.map +1 -1
- package/dist/src/search/index.js +3 -1
- package/dist/src/search/index.js.map +1 -1
- package/dist/src/search/pruneGherkinDocuments.d.ts +24 -0
- package/dist/src/search/pruneGherkinDocuments.d.ts.map +1 -0
- package/dist/src/search/pruneGherkinDocuments.js +180 -0
- package/dist/src/search/pruneGherkinDocuments.js.map +1 -0
- package/dist/src/search/types.d.ts +39 -8
- package/dist/src/search/types.d.ts.map +1 -1
- package/dist/src/search/types.js +1 -1
- package/dist/src/search/types.js.map +1 -1
- package/dist/src/styles/statuses.scss +7 -13
- package/dist/src/toRepositoryId.d.ts +1 -1
- package/dist/src/toRepositoryId.d.ts.map +1 -1
- package/dist/src/toRepositoryId.js +7 -6
- package/dist/src/toRepositoryId.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +56 -71
- package/dist/src/components/results/TestStepResultDetails.d.ts +0 -4
- package/dist/src/components/results/TestStepResultDetails.d.ts.map +0 -1
- package/dist/src/components/results/TestStepResultDetails.js +0 -16
- package/dist/src/components/results/TestStepResultDetails.js.map +0 -1
- package/dist/src/countScenariosByStatuses.d.ts +0 -8
- package/dist/src/countScenariosByStatuses.d.ts.map +0 -1
- package/dist/src/countScenariosByStatuses.js +0 -22
- package/dist/src/countScenariosByStatuses.js.map +0 -1
- package/dist/src/filter/filterByStatus.d.ts +0 -5
- package/dist/src/filter/filterByStatus.d.ts.map +0 -1
- package/dist/src/filter/filterByStatus.js +0 -23
- package/dist/src/filter/filterByStatus.js.map +0 -1
- package/dist/src/search/Search.d.ts +0 -11
- package/dist/src/search/Search.d.ts.map +0 -1
- package/dist/src/search/Search.js +0 -46
- package/dist/src/search/Search.js.map +0 -1
- package/dist/src/search/TagSearch.d.ts +0 -4
- package/dist/src/search/TagSearch.d.ts.map +0 -1
- package/dist/src/search/TagSearch.js +0 -57
- package/dist/src/search/TagSearch.js.map +0 -1
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypedIndex } from './types.js';
|
|
3
|
-
|
|
1
|
+
import type { GherkinDocument } from '@cucumber/messages';
|
|
2
|
+
import type { IndexHit, TypedIndex } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A little different to the other indexes - a Feature doesn't have its own id,
|
|
5
|
+
* so we use the uri of the GherkinDocument as a pointer
|
|
6
|
+
*/
|
|
7
|
+
export declare class FeatureSearch implements TypedIndex<GherkinDocument> {
|
|
8
|
+
private readonly index;
|
|
9
|
+
constructor();
|
|
10
|
+
search(term: string): Promise<ReadonlyArray<IndexHit>>;
|
|
11
|
+
add(gherkinDocument: GherkinDocument, _uri: string): Promise<this>;
|
|
12
|
+
}
|
|
4
13
|
//# sourceMappingURL=FeatureSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSearch.d.ts","sourceRoot":"","sources":["../../../src/search/FeatureSearch.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FeatureSearch.d.ts","sourceRoot":"","sources":["../../../src/search/FeatureSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAOtD;;;GAGG;AACH,qBAAa,aAAc,YAAW,UAAU,CAAC,eAAe,CAAC;IAC/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;;IAStC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAOtD,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUzE"}
|
|
@@ -4,27 +4,28 @@ const schema = {
|
|
|
4
4
|
description: 'string',
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* A little different
|
|
7
|
+
* A little different to the other indexes - a Feature doesn't have its own id,
|
|
8
8
|
* so we use the uri of the GherkinDocument as a pointer
|
|
9
9
|
*/
|
|
10
|
-
class FeatureSearch {
|
|
11
|
-
featuresByUri = new Map();
|
|
10
|
+
export class FeatureSearch {
|
|
12
11
|
index;
|
|
13
|
-
constructor(
|
|
14
|
-
this.index =
|
|
12
|
+
constructor() {
|
|
13
|
+
this.index = create({
|
|
14
|
+
schema,
|
|
15
|
+
sort: { enabled: false },
|
|
16
|
+
});
|
|
15
17
|
}
|
|
16
18
|
async search(term) {
|
|
17
19
|
const { hits } = await search(this.index, {
|
|
18
20
|
term,
|
|
19
21
|
});
|
|
20
|
-
return hits.map((hit) =>
|
|
22
|
+
return hits.map((hit) => ({ uri: hit.id, id: hit.id }));
|
|
21
23
|
}
|
|
22
|
-
async add(gherkinDocument) {
|
|
24
|
+
async add(gherkinDocument, _uri) {
|
|
23
25
|
if (!gherkinDocument.feature)
|
|
24
26
|
return this;
|
|
25
27
|
if (!gherkinDocument.uri)
|
|
26
28
|
throw new Error('Missing uri on gherkinDocument');
|
|
27
|
-
this.featuresByUri.set(gherkinDocument.uri, gherkinDocument.feature);
|
|
28
29
|
await insert(this.index, {
|
|
29
30
|
id: gherkinDocument.uri,
|
|
30
31
|
name: gherkinDocument.feature.name,
|
|
@@ -33,13 +34,4 @@ class FeatureSearch {
|
|
|
33
34
|
return this;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
export async function createFeatureSearch() {
|
|
37
|
-
const index = await create({
|
|
38
|
-
schema,
|
|
39
|
-
sort: {
|
|
40
|
-
enabled: false,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
return new FeatureSearch(index);
|
|
44
|
-
}
|
|
45
37
|
//# sourceMappingURL=FeatureSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSearch.js","sourceRoot":"","sources":["../../../src/search/FeatureSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FeatureSearch.js","sourceRoot":"","sources":["../../../src/search/FeatureSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,cAAc,CAAA;AAIjE,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;CACb,CAAA;AAEV;;;GAGG;AACH,MAAM,OAAO,aAAa;IACP,KAAK,CAAsB;IAE5C;QACE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;YAClB,MAAM;YACN,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SACzB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACxC,IAAI;SACL,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IACzD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,eAAgC,EAAE,IAAY;QACtD,IAAI,CAAC,eAAe,CAAC,OAAO;YAAE,OAAO,IAAI,CAAA;QACzC,IAAI,CAAC,eAAe,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QAC3E,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACvB,EAAE,EAAE,eAAe,CAAC,GAAG;YACvB,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI;YAClC,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,WAAW;SACjD,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import type { GherkinDocument } from '@cucumber/messages'\nimport { create, insert, type Orama, search } from '@orama/orama'\n\nimport type { IndexHit, TypedIndex } from './types.js'\n\nconst schema = {\n name: 'string',\n description: 'string',\n} as const\n\n/**\n * A little different to the other indexes - a Feature doesn't have its own id,\n * so we use the uri of the GherkinDocument as a pointer\n */\nexport class FeatureSearch implements TypedIndex<GherkinDocument> {\n private readonly index: Orama<typeof schema>\n\n constructor() {\n this.index = create({\n schema,\n sort: { enabled: false },\n })\n }\n\n async search(term: string): Promise<ReadonlyArray<IndexHit>> {\n const { hits } = await search(this.index, {\n term,\n })\n return hits.map((hit) => ({ uri: hit.id, id: hit.id }))\n }\n\n async add(gherkinDocument: GherkinDocument, _uri: string): Promise<this> {\n if (!gherkinDocument.feature) return this\n if (!gherkinDocument.uri) throw new Error('Missing uri on gherkinDocument')\n await insert(this.index, {\n id: gherkinDocument.uri,\n name: gherkinDocument.feature.name,\n description: gherkinDocument.feature.description,\n })\n return this\n }\n}\n"]}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypedIndex } from './types.js';
|
|
3
|
-
declare const schema: {
|
|
4
|
-
readonly name: "string";
|
|
5
|
-
readonly description: "string";
|
|
6
|
-
};
|
|
1
|
+
import { type TypedIndex } from './types.js';
|
|
7
2
|
export interface ScenarioLike {
|
|
8
3
|
id: string;
|
|
9
4
|
name: string;
|
|
@@ -13,13 +8,13 @@ export interface ScenarioLike {
|
|
|
13
8
|
* Can be used for Backgrounds, Scenarios and Rules, searching against the
|
|
14
9
|
* name and description
|
|
15
10
|
*/
|
|
16
|
-
declare class ScenarioLikeSearch<T extends ScenarioLike> implements TypedIndex<T> {
|
|
17
|
-
private itemById;
|
|
11
|
+
export declare class ScenarioLikeSearch<T extends ScenarioLike> implements TypedIndex<T> {
|
|
18
12
|
private readonly index;
|
|
19
|
-
constructor(
|
|
20
|
-
search(term: string): Promise<
|
|
21
|
-
|
|
13
|
+
constructor();
|
|
14
|
+
search(term: string): Promise<{
|
|
15
|
+
uri: string;
|
|
16
|
+
id: string;
|
|
17
|
+
}[]>;
|
|
18
|
+
add(item: T, uri: string): Promise<this>;
|
|
22
19
|
}
|
|
23
|
-
export declare function createScenarioLikeSearch<T extends ScenarioLike>(): Promise<ScenarioLikeSearch<T>>;
|
|
24
|
-
export {};
|
|
25
20
|
//# sourceMappingURL=ScenarioLikeSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScenarioLikeSearch.d.ts","sourceRoot":"","sources":["../../../src/search/ScenarioLikeSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScenarioLikeSearch.d.ts","sourceRoot":"","sources":["../../../src/search/ScenarioLikeSearch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAO1D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,qBAAa,kBAAkB,CAAC,CAAC,SAAS,YAAY,CAAE,YAAW,UAAU,CAAC,CAAC,CAAC;IAC9E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;;IAStC,MAAM,CAAC,IAAI,EAAE,MAAM;;;;IAUnB,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ/C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { create, insert, search } from '@orama/orama';
|
|
2
|
+
import { ID_SEPARATOR } from './types.js';
|
|
2
3
|
const schema = {
|
|
3
4
|
name: 'string',
|
|
4
5
|
description: 'string',
|
|
@@ -7,35 +8,30 @@ const schema = {
|
|
|
7
8
|
* Can be used for Backgrounds, Scenarios and Rules, searching against the
|
|
8
9
|
* name and description
|
|
9
10
|
*/
|
|
10
|
-
class ScenarioLikeSearch {
|
|
11
|
-
itemById = new Map();
|
|
11
|
+
export class ScenarioLikeSearch {
|
|
12
12
|
index;
|
|
13
|
-
constructor(
|
|
14
|
-
this.index =
|
|
13
|
+
constructor() {
|
|
14
|
+
this.index = create({
|
|
15
|
+
schema,
|
|
16
|
+
sort: { enabled: false },
|
|
17
|
+
});
|
|
15
18
|
}
|
|
16
19
|
async search(term) {
|
|
17
20
|
const { hits } = await search(this.index, {
|
|
18
21
|
term,
|
|
19
22
|
});
|
|
20
|
-
return hits.map((hit) =>
|
|
23
|
+
return hits.map((hit) => {
|
|
24
|
+
const [uri, id] = hit.id.split(ID_SEPARATOR);
|
|
25
|
+
return { uri, id };
|
|
26
|
+
});
|
|
21
27
|
}
|
|
22
|
-
async add(item) {
|
|
23
|
-
this.itemById.set(item.id, item);
|
|
28
|
+
async add(item, uri) {
|
|
24
29
|
await insert(this.index, {
|
|
25
|
-
id: item.id,
|
|
30
|
+
id: uri + ID_SEPARATOR + item.id,
|
|
26
31
|
name: item.name,
|
|
27
32
|
description: item.description,
|
|
28
33
|
});
|
|
29
34
|
return this;
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
|
-
export async function createScenarioLikeSearch() {
|
|
33
|
-
const index = await create({
|
|
34
|
-
schema,
|
|
35
|
-
sort: {
|
|
36
|
-
enabled: false,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
return new ScenarioLikeSearch(index);
|
|
40
|
-
}
|
|
41
37
|
//# sourceMappingURL=ScenarioLikeSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScenarioLikeSearch.js","sourceRoot":"","sources":["../../../src/search/ScenarioLikeSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ScenarioLikeSearch.js","sourceRoot":"","sources":["../../../src/search/ScenarioLikeSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAmB,MAAM,YAAY,CAAA;AAE1D,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;CACb,CAAA;AAQV;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACZ,KAAK,CAAsB;IAE5C;QACE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;YAClB,MAAM;YACN,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SACzB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACxC,IAAI;SACL,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACtB,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;YAC5C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;QACpB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAO,EAAE,GAAW;QAC5B,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACvB,EAAE,EAAE,GAAG,GAAG,YAAY,GAAG,IAAI,CAAC,EAAE;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { create, insert, type Orama, search } from '@orama/orama'\n\nimport { ID_SEPARATOR, type TypedIndex } from './types.js'\n\nconst schema = {\n name: 'string',\n description: 'string',\n} as const\n\nexport interface ScenarioLike {\n id: string\n name: string\n description: string\n}\n\n/**\n * Can be used for Backgrounds, Scenarios and Rules, searching against the\n * name and description\n */\nexport class ScenarioLikeSearch<T extends ScenarioLike> implements TypedIndex<T> {\n private readonly index: Orama<typeof schema>\n\n constructor() {\n this.index = create({\n schema,\n sort: { enabled: false },\n })\n }\n\n async search(term: string) {\n const { hits } = await search(this.index, {\n term,\n })\n return hits.map((hit) => {\n const [uri, id] = hit.id.split(ID_SEPARATOR)\n return { uri, id }\n })\n }\n\n async add(item: T, uri: string): Promise<this> {\n await insert(this.index, {\n id: uri + ID_SEPARATOR + item.id,\n name: item.name,\n description: item.description,\n })\n return this\n }\n}\n"]}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { Step } from '@cucumber/messages';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare const schema: {
|
|
5
|
-
readonly keyword: "string";
|
|
6
|
-
readonly text: "string";
|
|
7
|
-
readonly docString: "string";
|
|
8
|
-
readonly dataTable: "string[]";
|
|
9
|
-
};
|
|
10
|
-
declare class StepSearch implements TypedIndex<Step> {
|
|
11
|
-
private readonly stepById;
|
|
1
|
+
import type { Step } from '@cucumber/messages';
|
|
2
|
+
import { type TypedIndex } from './types.js';
|
|
3
|
+
export declare class StepSearch implements TypedIndex<Step> {
|
|
12
4
|
private readonly index;
|
|
13
|
-
constructor(
|
|
14
|
-
search(term: string): Promise<
|
|
15
|
-
|
|
5
|
+
constructor();
|
|
6
|
+
search(term: string): Promise<{
|
|
7
|
+
uri: string;
|
|
8
|
+
id: string;
|
|
9
|
+
}[]>;
|
|
10
|
+
add(step: Step, uri: string): Promise<this>;
|
|
16
11
|
}
|
|
17
|
-
export declare function createStepSearch(): Promise<StepSearch>;
|
|
18
|
-
export {};
|
|
19
12
|
//# sourceMappingURL=StepSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepSearch.d.ts","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"StepSearch.d.ts","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAG9C,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAS1D,qBAAa,UAAW,YAAW,UAAU,CAAC,IAAI,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;;IAStC,MAAM,CAAC,IAAI,EAAE,MAAM;;;;IAanB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUlD"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { create, insert, search } from '@orama/orama';
|
|
2
|
+
import { ID_SEPARATOR } from './types.js';
|
|
2
3
|
const schema = {
|
|
3
4
|
keyword: 'string',
|
|
4
5
|
text: 'string',
|
|
5
6
|
docString: 'string',
|
|
6
7
|
dataTable: 'string[]',
|
|
7
8
|
};
|
|
8
|
-
class StepSearch {
|
|
9
|
-
stepById = new Map();
|
|
9
|
+
export class StepSearch {
|
|
10
10
|
index;
|
|
11
|
-
constructor(
|
|
12
|
-
this.index =
|
|
11
|
+
constructor() {
|
|
12
|
+
this.index = create({
|
|
13
|
+
schema,
|
|
14
|
+
sort: { enabled: false },
|
|
15
|
+
});
|
|
13
16
|
}
|
|
14
17
|
async search(term) {
|
|
15
18
|
const { hits } = await search(this.index, {
|
|
@@ -18,12 +21,14 @@ class StepSearch {
|
|
|
18
21
|
text: 2,
|
|
19
22
|
},
|
|
20
23
|
});
|
|
21
|
-
return hits.map((hit) =>
|
|
24
|
+
return hits.map((hit) => {
|
|
25
|
+
const [uri, id] = hit.id.split(ID_SEPARATOR);
|
|
26
|
+
return { uri, id };
|
|
27
|
+
});
|
|
22
28
|
}
|
|
23
|
-
async add(step) {
|
|
24
|
-
this.stepById.set(step.id, step);
|
|
29
|
+
async add(step, uri) {
|
|
25
30
|
await insert(this.index, {
|
|
26
|
-
id: step.id,
|
|
31
|
+
id: uri + ID_SEPARATOR + step.id,
|
|
27
32
|
keyword: step.keyword,
|
|
28
33
|
text: step.text,
|
|
29
34
|
docString: step.docString?.content,
|
|
@@ -32,13 +37,4 @@ class StepSearch {
|
|
|
32
37
|
return this;
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
|
-
export async function createStepSearch() {
|
|
36
|
-
const index = await create({
|
|
37
|
-
schema,
|
|
38
|
-
sort: {
|
|
39
|
-
enabled: false,
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
return new StepSearch(index);
|
|
43
|
-
}
|
|
44
40
|
//# sourceMappingURL=StepSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepSearch.js","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StepSearch.js","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAmB,MAAM,YAAY,CAAA;AAE1D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,UAAU;CACb,CAAA;AAEV,MAAM,OAAO,UAAU;IACJ,KAAK,CAAsB;IAE5C;QACE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;YAClB,MAAM;YACN,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SACzB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACxC,IAAI;YACJ,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC;aACR;SACF,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACtB,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;YAC5C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;QACpB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAU,EAAE,GAAW;QAC/B,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACvB,EAAE,EAAE,GAAG,GAAG,YAAY,GAAG,IAAI,CAAC,EAAE;YAChC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO;YAClC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;SACtF,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import type { Step } from '@cucumber/messages'\nimport { create, insert, type Orama, search } from '@orama/orama'\n\nimport { ID_SEPARATOR, type TypedIndex } from './types.js'\n\nconst schema = {\n keyword: 'string',\n text: 'string',\n docString: 'string',\n dataTable: 'string[]',\n} as const\n\nexport class StepSearch implements TypedIndex<Step> {\n private readonly index: Orama<typeof schema>\n\n constructor() {\n this.index = create({\n schema,\n sort: { enabled: false },\n })\n }\n\n async search(term: string) {\n const { hits } = await search(this.index, {\n term,\n boost: {\n text: 2,\n },\n })\n return hits.map((hit) => {\n const [uri, id] = hit.id.split(ID_SEPARATOR)\n return { uri, id }\n })\n }\n\n async add(step: Step, uri: string): Promise<this> {\n await insert(this.index, {\n id: uri + ID_SEPARATOR + step.id,\n keyword: step.keyword,\n text: step.text,\n docString: step.docString?.content,\n dataTable: step.dataTable?.rows.flatMap((row) => row.cells).map((cell) => cell.value),\n })\n return this\n }\n}\n"]}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { GherkinDocument } from '@cucumber/messages';
|
|
2
|
+
import type { SearchHits, SearchIndex } from './types.js';
|
|
3
|
+
export declare class TextSearch implements SearchIndex {
|
|
4
|
+
private readonly featureSearch;
|
|
5
|
+
private readonly backgroundSearch;
|
|
6
|
+
private readonly ruleSearch;
|
|
7
|
+
private readonly scenarioSearch;
|
|
8
|
+
private readonly stepSearch;
|
|
9
|
+
search(query: string): Promise<SearchHits | false>;
|
|
10
|
+
add(gherkinDocument: GherkinDocument): Promise<void>;
|
|
11
|
+
}
|
|
3
12
|
//# sourceMappingURL=TextSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSearch.d.ts","sourceRoot":"","sources":["../../../src/search/TextSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextSearch.d.ts","sourceRoot":"","sources":["../../../src/search/TextSearch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,eAAe,EAAkB,MAAM,oBAAoB,CAAA;AAIrF,OAAO,KAAK,EAAgC,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEvF,qBAAa,UAAW,YAAW,WAAW;IAC5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsB;IACpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuC;IACxE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqC;IACpE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmB;IAEjC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IA6ClD,GAAG,CAAC,eAAe,EAAE,eAAe;CAclD"}
|
|
@@ -1,63 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
class TextSearch {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
scenarioSearch;
|
|
10
|
-
|
|
11
|
-
featureSearch;
|
|
12
|
-
constructor(stepSearch, backgroundSearch, scenarioSearch, ruleSearch, featureSearch) {
|
|
13
|
-
this.stepSearch = stepSearch;
|
|
14
|
-
this.backgroundSearch = backgroundSearch;
|
|
15
|
-
this.scenarioSearch = scenarioSearch;
|
|
16
|
-
this.ruleSearch = ruleSearch;
|
|
17
|
-
this.featureSearch = featureSearch;
|
|
18
|
-
}
|
|
1
|
+
import { walkGherkinDocument } from '@cucumber/gherkin-utils';
|
|
2
|
+
import { FeatureSearch } from './FeatureSearch.js';
|
|
3
|
+
import { ScenarioLikeSearch } from './ScenarioLikeSearch.js';
|
|
4
|
+
import { StepSearch } from './StepSearch.js';
|
|
5
|
+
export class TextSearch {
|
|
6
|
+
featureSearch = new FeatureSearch();
|
|
7
|
+
backgroundSearch = new ScenarioLikeSearch();
|
|
8
|
+
ruleSearch = new ScenarioLikeSearch();
|
|
9
|
+
scenarioSearch = new ScenarioLikeSearch();
|
|
10
|
+
stepSearch = new StepSearch();
|
|
19
11
|
async search(query) {
|
|
20
|
-
const [
|
|
21
|
-
this.
|
|
12
|
+
const [featureHits, backgroundHits, ruleHits, scenarioHits, stepHits] = await Promise.all([
|
|
13
|
+
this.featureSearch.search(query),
|
|
22
14
|
this.backgroundSearch.search(query),
|
|
23
|
-
this.scenarioSearch.search(query),
|
|
24
15
|
this.ruleSearch.search(query),
|
|
25
|
-
this.
|
|
16
|
+
this.scenarioSearch.search(query),
|
|
17
|
+
this.stepSearch.search(query),
|
|
26
18
|
]);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
const allHits = [
|
|
20
|
+
...featureHits,
|
|
21
|
+
...backgroundHits,
|
|
22
|
+
...ruleHits,
|
|
23
|
+
...scenarioHits,
|
|
24
|
+
...stepHits,
|
|
25
|
+
];
|
|
26
|
+
if (allHits.length === 0) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const map = new Map();
|
|
30
|
+
const getOrDefault = (uri) => {
|
|
31
|
+
let entry = map.get(uri);
|
|
32
|
+
if (!entry) {
|
|
33
|
+
entry = { feature: false, background: [], rule: [], scenario: [], step: [] };
|
|
34
|
+
map.set(uri, entry);
|
|
35
|
+
}
|
|
36
|
+
return entry;
|
|
37
|
+
};
|
|
38
|
+
for (const hit of featureHits) {
|
|
39
|
+
getOrDefault(hit.uri).feature = true;
|
|
40
|
+
}
|
|
41
|
+
for (const hit of backgroundHits) {
|
|
42
|
+
getOrDefault(hit.uri).background.push(hit.id);
|
|
43
|
+
}
|
|
44
|
+
for (const hit of ruleHits) {
|
|
45
|
+
getOrDefault(hit.uri).rule.push(hit.id);
|
|
46
|
+
}
|
|
47
|
+
for (const hit of scenarioHits) {
|
|
48
|
+
getOrDefault(hit.uri).scenario.push(hit.id);
|
|
49
|
+
}
|
|
50
|
+
for (const hit of stepHits) {
|
|
51
|
+
getOrDefault(hit.uri).step.push(hit.id);
|
|
52
|
+
}
|
|
53
|
+
return map;
|
|
37
54
|
}
|
|
38
55
|
async add(gherkinDocument) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
const uri = gherkinDocument.uri;
|
|
57
|
+
if (!uri) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const promises = walkGherkinDocument(gherkinDocument, [], {
|
|
61
|
+
feature: (_feature, acc) => [...acc, this.featureSearch.add(gherkinDocument, uri)],
|
|
62
|
+
background: (background, acc) => [...acc, this.backgroundSearch.add(background, uri)],
|
|
63
|
+
rule: (rule, acc) => [...acc, this.ruleSearch.add(rule, uri)],
|
|
64
|
+
scenario: (scenario, acc) => [...acc, this.scenarioSearch.add(scenario, uri)],
|
|
65
|
+
step: (step, acc) => [...acc, this.stepSearch.add(step, uri)],
|
|
46
66
|
});
|
|
47
|
-
promises.push(this.featureSearch.add(gherkinDocument));
|
|
48
|
-
walker.walkGherkinDocument(gherkinDocument);
|
|
49
67
|
await Promise.all(promises);
|
|
50
|
-
return this;
|
|
51
68
|
}
|
|
52
69
|
}
|
|
53
|
-
export async function createTextSearch() {
|
|
54
|
-
const [stepSearch, backgroundSearch, scenarioSearch, ruleSearch, featureSearch] = await Promise.all([
|
|
55
|
-
createStepSearch(),
|
|
56
|
-
createScenarioLikeSearch(),
|
|
57
|
-
createScenarioLikeSearch(),
|
|
58
|
-
createScenarioLikeSearch(),
|
|
59
|
-
createFeatureSearch(),
|
|
60
|
-
]);
|
|
61
|
-
return new TextSearch(stepSearch, backgroundSearch, scenarioSearch, ruleSearch, featureSearch);
|
|
62
|
-
}
|
|
63
70
|
//# sourceMappingURL=TextSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSearch.js","sourceRoot":"","sources":["../../../src/search/TextSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TextSearch.js","sourceRoot":"","sources":["../../../src/search/TextSearch.ts"],"names":[],"mappings":"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","sourcesContent":["import { walkGherkinDocument } from '@cucumber/gherkin-utils'\nimport type { Background, GherkinDocument, Rule, Scenario } from '@cucumber/messages'\nimport { FeatureSearch } from './FeatureSearch.js'\nimport { ScenarioLikeSearch } from './ScenarioLikeSearch.js'\nimport { StepSearch } from './StepSearch.js'\nimport type { DocumentSearchHits, IndexHit, SearchHits, SearchIndex } from './types.js'\n\nexport class TextSearch implements SearchIndex {\n private readonly featureSearch = new FeatureSearch()\n private readonly backgroundSearch = new ScenarioLikeSearch<Background>()\n private readonly ruleSearch = new ScenarioLikeSearch<Rule>()\n private readonly scenarioSearch = new ScenarioLikeSearch<Scenario>()\n private readonly stepSearch = new StepSearch()\n\n public async search(query: string): Promise<SearchHits | false> {\n const [featureHits, backgroundHits, ruleHits, scenarioHits, stepHits] = await Promise.all([\n this.featureSearch.search(query),\n this.backgroundSearch.search(query),\n this.ruleSearch.search(query),\n this.scenarioSearch.search(query),\n this.stepSearch.search(query),\n ])\n const allHits: ReadonlyArray<IndexHit> = [\n ...featureHits,\n ...backgroundHits,\n ...ruleHits,\n ...scenarioHits,\n ...stepHits,\n ]\n if (allHits.length === 0) {\n return false\n }\n const map = new Map<string, DocumentSearchHits>()\n const getOrDefault = (uri: string) => {\n let entry = map.get(uri)\n if (!entry) {\n entry = { feature: false, background: [], rule: [], scenario: [], step: [] }\n map.set(uri, entry)\n }\n return entry\n }\n for (const hit of featureHits) {\n getOrDefault(hit.uri).feature = true\n }\n for (const hit of backgroundHits) {\n getOrDefault(hit.uri).background.push(hit.id)\n }\n for (const hit of ruleHits) {\n getOrDefault(hit.uri).rule.push(hit.id)\n }\n for (const hit of scenarioHits) {\n getOrDefault(hit.uri).scenario.push(hit.id)\n }\n for (const hit of stepHits) {\n getOrDefault(hit.uri).step.push(hit.id)\n }\n return map\n }\n\n public async add(gherkinDocument: GherkinDocument) {\n const uri = gherkinDocument.uri\n if (!uri) {\n return\n }\n const promises = walkGherkinDocument<Array<Promise<unknown>>>(gherkinDocument, [], {\n feature: (_feature, acc) => [...acc, this.featureSearch.add(gherkinDocument, uri)],\n background: (background, acc) => [...acc, this.backgroundSearch.add(background, uri)],\n rule: (rule, acc) => [...acc, this.ruleSearch.add(rule, uri)],\n scenario: (scenario, acc) => [...acc, this.scenarioSearch.add(scenario, uri)],\n step: (step, acc) => [...acc, this.stepSearch.add(step, uri)],\n })\n await Promise.all(promises)\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GherkinDocument } from '@cucumber/messages';
|
|
2
|
+
import type { SearchIndex } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a search index that supports querying by term
|
|
5
|
+
*/
|
|
6
|
+
export declare function createSearchIndex(gherkinDocuments: ReadonlyArray<GherkinDocument>): Promise<SearchIndex>;
|
|
7
|
+
//# sourceMappingURL=createSearchIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/search/createSearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,aAAa,CAAC,eAAe,CAAC,GAC/C,OAAO,CAAC,WAAW,CAAC,CAItB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextSearch } from './TextSearch.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a search index that supports querying by term
|
|
4
|
+
*/
|
|
5
|
+
export async function createSearchIndex(gherkinDocuments) {
|
|
6
|
+
const textSearch = new TextSearch();
|
|
7
|
+
await Promise.all(gherkinDocuments.map((gherkinDocument) => textSearch.add(gherkinDocument)));
|
|
8
|
+
return textSearch;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=createSearchIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSearchIndex.js","sourceRoot":"","sources":["../../../src/search/createSearchIndex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,gBAAgD;IAEhD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAA;IACnC,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IAC7F,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import type { GherkinDocument } from '@cucumber/messages'\n\nimport { TextSearch } from './TextSearch.js'\nimport type { SearchIndex } from './types.js'\n\n/**\n * Creates a search index that supports querying by term\n */\nexport async function createSearchIndex(\n gherkinDocuments: ReadonlyArray<GherkinDocument>\n): Promise<SearchIndex> {\n const textSearch = new TextSearch()\n await Promise.all(gherkinDocuments.map((gherkinDocument) => textSearch.add(gherkinDocument)))\n return textSearch\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Pickle } from '@cucumber/messages';
|
|
2
|
+
import type { Lineage } from '@cucumber/query';
|
|
3
|
+
import type { LineageConstraints } from './types.js';
|
|
4
|
+
export declare function deriveLineageConstraints(items: ReadonlyArray<{
|
|
5
|
+
pickle: Pickle;
|
|
6
|
+
lineage: Lineage;
|
|
7
|
+
}>): LineageConstraints;
|
|
8
|
+
//# sourceMappingURL=deriveLineageConstraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveLineageConstraints.d.ts","sourceRoot":"","sources":["../../../src/search/deriveLineageConstraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,aAAa,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,GACzD,kBAAkB,CAoCpB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function deriveLineageConstraints(items) {
|
|
2
|
+
const gherkinDocument = new Set();
|
|
3
|
+
const background = new Set();
|
|
4
|
+
const rule = new Set();
|
|
5
|
+
const scenario = new Set();
|
|
6
|
+
const examples = new Set();
|
|
7
|
+
const example = new Set();
|
|
8
|
+
for (const { pickle, lineage } of items) {
|
|
9
|
+
gherkinDocument.add(pickle.uri);
|
|
10
|
+
if (lineage.background) {
|
|
11
|
+
background.add(lineage.background.id);
|
|
12
|
+
}
|
|
13
|
+
if (lineage.ruleBackground) {
|
|
14
|
+
background.add(lineage.ruleBackground.id);
|
|
15
|
+
}
|
|
16
|
+
if (lineage.rule) {
|
|
17
|
+
rule.add(lineage.rule.id);
|
|
18
|
+
}
|
|
19
|
+
if (lineage.scenario) {
|
|
20
|
+
scenario.add(lineage.scenario.id);
|
|
21
|
+
}
|
|
22
|
+
if (lineage.examples) {
|
|
23
|
+
examples.add(lineage.examples.id);
|
|
24
|
+
}
|
|
25
|
+
if (lineage.example) {
|
|
26
|
+
example.add(lineage.example.id);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
gherkinDocument,
|
|
31
|
+
background,
|
|
32
|
+
rule,
|
|
33
|
+
scenario,
|
|
34
|
+
examples,
|
|
35
|
+
example,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=deriveLineageConstraints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveLineageConstraints.js","sourceRoot":"","sources":["../../../src/search/deriveLineageConstraints.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,wBAAwB,CACtC,KAA0D;IAE1D,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAA;IACzC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;IACpC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAClC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAClC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAA;IACjC,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK,EAAE,CAAC;QACxC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC/B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QACvC,CAAC;QACD,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;YAC3B,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;QAC3C,CAAC;QACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC3B,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACnC,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACnC,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;IACD,OAAO;QACL,eAAe;QACf,UAAU;QACV,IAAI;QACJ,QAAQ;QACR,QAAQ;QACR,OAAO;KACR,CAAA;AACH,CAAC","sourcesContent":["import type { Pickle } from '@cucumber/messages'\nimport type { Lineage } from '@cucumber/query'\nimport type { LineageConstraints } from './types.js'\n\nexport function deriveLineageConstraints(\n items: ReadonlyArray<{ pickle: Pickle; lineage: Lineage }>\n): LineageConstraints {\n const gherkinDocument = new Set<string>()\n const background = new Set<string>()\n const rule = new Set<string>()\n const scenario = new Set<string>()\n const examples = new Set<string>()\n const example = new Set<string>()\n for (const { pickle, lineage } of items) {\n gherkinDocument.add(pickle.uri)\n if (lineage.background) {\n background.add(lineage.background.id)\n }\n if (lineage.ruleBackground) {\n background.add(lineage.ruleBackground.id)\n }\n if (lineage.rule) {\n rule.add(lineage.rule.id)\n }\n if (lineage.scenario) {\n scenario.add(lineage.scenario.id)\n }\n if (lineage.examples) {\n examples.add(lineage.examples.id)\n }\n if (lineage.example) {\n example.add(lineage.example.id)\n }\n }\n return {\n gherkinDocument,\n background,\n rule,\n scenario,\n examples,\n example,\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,YAAY,CAAA"}
|
package/dist/src/search/index.js
CHANGED