@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.
- package/README.md +2 -1
- package/dist/src/CucumberQueryContext.js +3 -8
- package/dist/src/CucumberQueryContext.js.map +1 -1
- package/dist/src/EnvelopesQueryContext.js +8 -20
- package/dist/src/EnvelopesQueryContext.js.map +1 -1
- package/dist/src/GherkinQueryContext.js +3 -8
- package/dist/src/GherkinQueryContext.js.map +1 -1
- package/dist/src/SearchQueryContext.js +24 -53
- package/dist/src/SearchQueryContext.js.map +1 -1
- package/dist/src/UriContext.js +2 -7
- package/dist/src/UriContext.js.map +1 -1
- package/dist/src/ciCommitLink.js +3 -9
- package/dist/src/ciCommitLink.js.map +1 -1
- package/dist/src/components/CucumberReact.d.ts +1 -1
- package/dist/src/components/CucumberReact.d.ts.map +1 -1
- package/dist/src/components/CucumberReact.js +7 -14
- package/dist/src/components/CucumberReact.js.map +1 -1
- package/dist/src/components/app/CICommitLink.js +14 -22
- package/dist/src/components/app/CICommitLink.js.map +1 -1
- package/dist/src/components/app/CIJobLink.js +8 -15
- package/dist/src/components/app/CIJobLink.js.map +1 -1
- package/dist/src/components/app/EnvelopesWrapper.js +11 -38
- package/dist/src/components/app/EnvelopesWrapper.js.map +1 -1
- package/dist/src/components/app/ExecutionSummary.js +54 -61
- package/dist/src/components/app/ExecutionSummary.js.map +1 -1
- package/dist/src/components/app/FilteredResults.d.ts.map +1 -1
- package/dist/src/components/app/FilteredResults.js +21 -39
- package/dist/src/components/app/FilteredResults.js.map +1 -1
- package/dist/src/components/app/GherkinDocumentList.js +27 -57
- package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
- package/dist/src/components/app/HighLight.js +14 -21
- package/dist/src/components/app/HighLight.js.map +1 -1
- package/dist/src/components/app/NavigationButton.js +4 -23
- package/dist/src/components/app/NavigationButton.js.map +1 -1
- package/dist/src/components/app/NoMatchResult.js +8 -15
- package/dist/src/components/app/NoMatchResult.js.map +1 -1
- package/dist/src/components/app/OSIcon.js +10 -17
- package/dist/src/components/app/OSIcon.js.map +1 -1
- package/dist/src/components/app/QueriesWrapper.d.ts +1 -1
- package/dist/src/components/app/QueriesWrapper.d.ts.map +1 -1
- package/dist/src/components/app/QueriesWrapper.js +7 -14
- package/dist/src/components/app/QueriesWrapper.js.map +1 -1
- package/dist/src/components/app/RuntimeIcon.js +10 -17
- package/dist/src/components/app/RuntimeIcon.js.map +1 -1
- package/dist/src/components/app/SearchBar.d.ts.map +1 -1
- package/dist/src/components/app/SearchBar.js +25 -30
- package/dist/src/components/app/SearchBar.js.map +1 -1
- package/dist/src/components/app/SearchWrapper.d.ts +1 -1
- package/dist/src/components/app/SearchWrapper.d.ts.map +1 -1
- package/dist/src/components/app/SearchWrapper.js +4 -46
- package/dist/src/components/app/SearchWrapper.js.map +1 -1
- package/dist/src/components/app/StatusesSummary.js +8 -15
- package/dist/src/components/app/StatusesSummary.js.map +1 -1
- package/dist/src/components/app/icons/CucumberLogo.d.ts +1 -1
- package/dist/src/components/app/icons/CucumberLogo.js +7 -14
- 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.js +8 -15
- package/dist/src/components/app/icons/Jvm.js.map +1 -1
- package/dist/src/components/app/icons/Linux.js +18 -25
- 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.js +4 -11
- 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.js +34 -41
- 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.js +4 -11
- package/dist/src/components/app/icons/Ruby.js.map +1 -1
- package/dist/src/components/app/icons/Windows.js +4 -11
- package/dist/src/components/app/icons/Windows.js.map +1 -1
- package/dist/src/components/app/index.d.ts +11 -11
- package/dist/src/components/app/index.d.ts.map +1 -1
- package/dist/src/components/app/index.js +11 -27
- package/dist/src/components/app/index.js.map +1 -1
- package/dist/src/components/app/rehypePlugins.d.ts.map +1 -1
- package/dist/src/components/app/rehypePlugins.js +8 -13
- package/dist/src/components/app/rehypePlugins.js.map +1 -1
- package/dist/src/components/app/remarkPlugins.js +3 -8
- package/dist/src/components/app/remarkPlugins.js.map +1 -1
- package/dist/src/components/app/statuses.js +2 -27
- package/dist/src/components/app/statuses.js.map +1 -1
- package/dist/src/components/customise/customRendering.d.ts +2 -1
- package/dist/src/components/customise/customRendering.d.ts.map +1 -1
- package/dist/src/components/customise/customRendering.js +6 -33
- package/dist/src/components/customise/customRendering.js.map +1 -1
- package/dist/src/components/customise/index.d.ts +2 -2
- package/dist/src/components/customise/index.d.ts.map +1 -1
- package/dist/src/components/customise/index.js +2 -18
- package/dist/src/components/customise/index.js.map +1 -1
- package/dist/src/components/customise/theming.js +1 -2
- package/dist/src/components/gherkin/Anchor.d.ts +1 -1
- package/dist/src/components/gherkin/Anchor.d.ts.map +1 -1
- package/dist/src/components/gherkin/Anchor.js +11 -18
- package/dist/src/components/gherkin/Anchor.js.map +1 -1
- package/dist/src/components/gherkin/Attachment.d.ts +1 -1
- package/dist/src/components/gherkin/Attachment.d.ts.map +1 -1
- package/dist/src/components/gherkin/Attachment.js +43 -77
- package/dist/src/components/gherkin/Attachment.js.map +1 -1
- package/dist/src/components/gherkin/Background.d.ts +1 -1
- package/dist/src/components/gherkin/Background.d.ts.map +1 -1
- package/dist/src/components/gherkin/Background.js +17 -24
- package/dist/src/components/gherkin/Background.js.map +1 -1
- package/dist/src/components/gherkin/Children.d.ts +1 -1
- package/dist/src/components/gherkin/Children.d.ts.map +1 -1
- package/dist/src/components/gherkin/Children.js +7 -14
- package/dist/src/components/gherkin/Children.js.map +1 -1
- package/dist/src/components/gherkin/DataTable.d.ts +1 -1
- package/dist/src/components/gherkin/DataTable.d.ts.map +1 -1
- package/dist/src/components/gherkin/DataTable.js +12 -19
- package/dist/src/components/gherkin/DataTable.js.map +1 -1
- package/dist/src/components/gherkin/Description.d.ts +1 -1
- package/dist/src/components/gherkin/Description.d.ts.map +1 -1
- package/dist/src/components/gherkin/Description.js +9 -16
- package/dist/src/components/gherkin/Description.js.map +1 -1
- package/dist/src/components/gherkin/DocString.d.ts +1 -1
- package/dist/src/components/gherkin/DocString.d.ts.map +1 -1
- package/dist/src/components/gherkin/DocString.js +9 -16
- package/dist/src/components/gherkin/DocString.js.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.d.ts +3 -3
- package/dist/src/components/gherkin/ErrorMessage.d.ts.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.js +8 -15
- package/dist/src/components/gherkin/ErrorMessage.js.map +1 -1
- package/dist/src/components/gherkin/ExampleDetail.js +31 -61
- package/dist/src/components/gherkin/ExampleDetail.js.map +1 -1
- package/dist/src/components/gherkin/Examples.d.ts +1 -1
- package/dist/src/components/gherkin/Examples.d.ts.map +1 -1
- package/dist/src/components/gherkin/Examples.js +20 -27
- package/dist/src/components/gherkin/Examples.js.map +1 -1
- package/dist/src/components/gherkin/ExamplesContext.d.ts +1 -1
- package/dist/src/components/gherkin/ExamplesContext.js +2 -5
- package/dist/src/components/gherkin/ExamplesContext.js.map +1 -1
- package/dist/src/components/gherkin/ExamplesTable.d.ts +1 -1
- package/dist/src/components/gherkin/ExamplesTable.d.ts.map +1 -1
- package/dist/src/components/gherkin/ExamplesTable.js +29 -59
- package/dist/src/components/gherkin/ExamplesTable.js.map +1 -1
- package/dist/src/components/gherkin/Feature.d.ts +1 -1
- package/dist/src/components/gherkin/Feature.d.ts.map +1 -1
- package/dist/src/components/gherkin/Feature.js +24 -31
- package/dist/src/components/gherkin/Feature.js.map +1 -1
- package/dist/src/components/gherkin/GherkinDocument.d.ts +1 -1
- package/dist/src/components/gherkin/GherkinDocument.d.ts.map +1 -1
- package/dist/src/components/gherkin/GherkinDocument.js +7 -14
- package/dist/src/components/gherkin/GherkinDocument.js.map +1 -1
- package/dist/src/components/gherkin/GherkinStep.d.ts +1 -1
- package/dist/src/components/gherkin/GherkinStep.d.ts.map +1 -1
- package/dist/src/components/gherkin/GherkinStep.js +38 -46
- package/dist/src/components/gherkin/GherkinStep.js.map +1 -1
- package/dist/src/components/gherkin/GherkinSteps.d.ts +1 -1
- package/dist/src/components/gherkin/GherkinSteps.d.ts.map +1 -1
- package/dist/src/components/gherkin/GherkinSteps.js +10 -17
- package/dist/src/components/gherkin/GherkinSteps.js.map +1 -1
- package/dist/src/components/gherkin/HookStep.d.ts +1 -1
- package/dist/src/components/gherkin/HookStep.d.ts.map +1 -1
- package/dist/src/components/gherkin/HookStep.js +22 -52
- package/dist/src/components/gherkin/HookStep.js.map +1 -1
- package/dist/src/components/gherkin/HookSteps.js +5 -12
- package/dist/src/components/gherkin/HookSteps.js.map +1 -1
- package/dist/src/components/gherkin/Keyword.d.ts +1 -1
- package/dist/src/components/gherkin/Keyword.d.ts.map +1 -1
- package/dist/src/components/gherkin/Keyword.js +7 -14
- package/dist/src/components/gherkin/Keyword.js.map +1 -1
- package/dist/src/components/gherkin/MDG.js +25 -32
- package/dist/src/components/gherkin/MDG.js.map +1 -1
- package/dist/src/components/gherkin/Parameter.d.ts +1 -1
- package/dist/src/components/gherkin/Parameter.d.ts.map +1 -1
- package/dist/src/components/gherkin/Parameter.js +7 -14
- package/dist/src/components/gherkin/Parameter.js.map +1 -1
- package/dist/src/components/gherkin/Rule.d.ts +1 -1
- package/dist/src/components/gherkin/Rule.d.ts.map +1 -1
- package/dist/src/components/gherkin/Rule.js +22 -29
- package/dist/src/components/gherkin/Rule.js.map +1 -1
- package/dist/src/components/gherkin/Scenario.d.ts +1 -1
- package/dist/src/components/gherkin/Scenario.d.ts.map +1 -1
- package/dist/src/components/gherkin/Scenario.js +35 -65
- package/dist/src/components/gherkin/Scenario.js.map +1 -1
- package/dist/src/components/gherkin/StatusIcon.d.ts +1 -1
- package/dist/src/components/gherkin/StatusIcon.d.ts.map +1 -1
- package/dist/src/components/gherkin/StatusIcon.js +16 -23
- package/dist/src/components/gherkin/StatusIcon.js.map +1 -1
- package/dist/src/components/gherkin/StepItem.js +7 -14
- package/dist/src/components/gherkin/StepItem.js.map +1 -1
- package/dist/src/components/gherkin/StepsList.js +4 -11
- package/dist/src/components/gherkin/StepsList.js.map +1 -1
- package/dist/src/components/gherkin/Tags.d.ts +1 -1
- package/dist/src/components/gherkin/Tags.d.ts.map +1 -1
- package/dist/src/components/gherkin/Tags.js +9 -16
- package/dist/src/components/gherkin/Tags.js.map +1 -1
- package/dist/src/components/gherkin/Title.d.ts +1 -1
- package/dist/src/components/gherkin/Title.d.ts.map +1 -1
- package/dist/src/components/gherkin/Title.js +9 -16
- package/dist/src/components/gherkin/Title.js.map +1 -1
- package/dist/src/components/gherkin/attachmentFilename.js +3 -10
- package/dist/src/components/gherkin/attachmentFilename.js.map +1 -1
- package/dist/src/components/gherkin/index.d.ts +25 -25
- package/dist/src/components/gherkin/index.d.ts.map +1 -1
- package/dist/src/components/gherkin/index.js +25 -41
- package/dist/src/components/gherkin/index.js.map +1 -1
- package/dist/src/components/gherkin/isNumber.js +1 -4
- package/dist/src/components/gherkin/isNumber.js.map +1 -1
- package/dist/src/components/gherkin/statusName.js +1 -3
- package/dist/src/components/gherkin/statusName.js.map +1 -1
- package/dist/src/components/index.d.ts +4 -4
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +4 -33
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/results/TestStepResultDetails.d.ts +4 -0
- package/dist/src/components/results/TestStepResultDetails.d.ts.map +1 -0
- package/dist/src/components/results/TestStepResultDetails.js +16 -0
- package/dist/src/components/results/TestStepResultDetails.js.map +1 -0
- package/dist/src/components/results/index.d.ts +2 -0
- package/dist/src/components/results/index.d.ts.map +1 -0
- package/dist/src/components/results/index.js +2 -0
- package/dist/src/components/results/index.js.map +1 -0
- package/dist/src/countScenariosByStatuses.d.ts +2 -1
- package/dist/src/countScenariosByStatuses.d.ts.map +1 -1
- package/dist/src/countScenariosByStatuses.js +26 -33
- package/dist/src/countScenariosByStatuses.js.map +1 -1
- package/dist/src/filter/filterByStatus.d.ts +2 -1
- package/dist/src/filter/filterByStatus.d.ts.map +1 -1
- package/dist/src/filter/filterByStatus.js +9 -9
- package/dist/src/filter/filterByStatus.js.map +1 -1
- package/dist/src/hooks/index.d.ts +2 -2
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -18
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useFilteredDocuments.d.ts +3 -0
- package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -0
- package/dist/src/hooks/useFilteredDocuments.js +27 -0
- package/dist/src/hooks/useFilteredDocuments.js.map +1 -0
- package/dist/src/hooks/useQueries.d.ts +1 -1
- package/dist/src/hooks/useQueries.d.ts.map +1 -1
- package/dist/src/hooks/useQueries.js +8 -15
- package/dist/src/hooks/useQueries.js.map +1 -1
- package/dist/src/hooks/useResultStatistics.d.ts +6 -0
- package/dist/src/hooks/useResultStatistics.d.ts.map +1 -0
- package/dist/src/hooks/useResultStatistics.js +7 -0
- package/dist/src/hooks/useResultStatistics.js.map +1 -0
- 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 +4 -11
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -43
- package/dist/src/index.js.map +1 -1
- package/dist/src/isTagExpression.js +1 -4
- package/dist/src/isTagExpression.js.map +1 -1
- package/dist/src/search/FeatureSearch.d.ts +3 -7
- package/dist/src/search/FeatureSearch.d.ts.map +1 -1
- package/dist/src/search/FeatureSearch.js +31 -31
- package/dist/src/search/FeatureSearch.js.map +1 -1
- package/dist/src/search/ScenarioLikeSearch.d.ts +25 -0
- package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -0
- package/dist/src/search/ScenarioLikeSearch.js +41 -0
- package/dist/src/search/ScenarioLikeSearch.js.map +1 -0
- package/dist/src/search/Search.d.ts +9 -9
- package/dist/src/search/Search.d.ts.map +1 -1
- package/dist/src/search/Search.js +34 -20
- package/dist/src/search/Search.js.map +1 -1
- package/dist/src/search/StepSearch.d.ts +16 -8
- package/dist/src/search/StepSearch.d.ts.map +1 -1
- package/dist/src/search/StepSearch.js +33 -44
- package/dist/src/search/StepSearch.js.map +1 -1
- package/dist/src/search/TagSearch.d.ts +2 -10
- package/dist/src/search/TagSearch.d.ts.map +1 -1
- package/dist/src/search/TagSearch.js +17 -18
- package/dist/src/search/TagSearch.js.map +1 -1
- package/dist/src/search/TextSearch.d.ts +2 -11
- package/dist/src/search/TextSearch.d.ts.map +1 -1
- package/dist/src/search/TextSearch.js +47 -36
- package/dist/src/search/TextSearch.js.map +1 -1
- package/dist/src/search/index.d.ts +3 -0
- package/dist/src/search/index.d.ts.map +1 -0
- package/dist/src/search/index.js +3 -0
- package/dist/src/search/index.js.map +1 -0
- package/dist/src/search/types.d.ts +14 -0
- package/dist/src/search/types.d.ts.map +1 -0
- package/dist/src/search/types.js +2 -0
- package/dist/src/search/types.js.map +1 -0
- package/dist/src/toRepositoryId.js +1 -4
- package/dist/src/toRepositoryId.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +35 -27
- package/dist/src/search/RuleSearch.d.ts +0 -9
- package/dist/src/search/RuleSearch.d.ts.map +0 -1
- package/dist/src/search/RuleSearch.js +0 -42
- package/dist/src/search/RuleSearch.js.map +0 -1
- package/dist/src/search/ScenarioSearch.d.ts +0 -9
- package/dist/src/search/ScenarioSearch.d.ts.map +0 -1
- package/dist/src/search/ScenarioSearch.js +0 -42
- package/dist/src/search/ScenarioSearch.js.map +0 -1
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
private readonly featureSearch;
|
|
4
|
-
private readonly backgroundSearch;
|
|
5
|
-
private readonly scenarioSearch;
|
|
6
|
-
private readonly stepSearch;
|
|
7
|
-
private readonly ruleSearch;
|
|
8
|
-
private readonly gherkinDocuments;
|
|
9
|
-
search(query: string): messages.GherkinDocument[];
|
|
10
|
-
add(gherkinDocument: messages.GherkinDocument): void;
|
|
11
|
-
}
|
|
1
|
+
import { Searchable } from './types.js';
|
|
2
|
+
export declare function createTextSearch(): Promise<Searchable>;
|
|
12
3
|
//# 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":"AAMA,OAAO,EAAE,UAAU,EAAc,MAAM,YAAY,CAAA;AAmEnD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC,CAU5D"}
|
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const gherkin_utils_1 = require("@cucumber/gherkin-utils");
|
|
7
|
-
const FeatureSearch_1 = __importDefault(require("./FeatureSearch"));
|
|
8
|
-
const RuleSearch_1 = __importDefault(require("./RuleSearch"));
|
|
9
|
-
const ScenarioSearch_1 = __importDefault(require("./ScenarioSearch"));
|
|
10
|
-
const StepSearch_1 = __importDefault(require("./StepSearch"));
|
|
1
|
+
import { GherkinDocumentWalker } from '@cucumber/gherkin-utils';
|
|
2
|
+
import { createFeatureSearch } from './FeatureSearch.js';
|
|
3
|
+
import { createScenarioLikeSearch } from './ScenarioLikeSearch.js';
|
|
4
|
+
import { createStepSearch } from './StepSearch.js';
|
|
11
5
|
class TextSearch {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
gherkinDocuments = [];
|
|
7
|
+
stepSearch;
|
|
8
|
+
backgroundSearch;
|
|
9
|
+
scenarioSearch;
|
|
10
|
+
ruleSearch;
|
|
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;
|
|
19
18
|
}
|
|
20
|
-
search(query) {
|
|
21
|
-
const matchingSteps =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
async search(query) {
|
|
20
|
+
const [matchingSteps, matchingBackgrounds, matchingScenarios, matchingRules, matchingFeatures] = await Promise.all([
|
|
21
|
+
this.stepSearch.search(query),
|
|
22
|
+
this.backgroundSearch.search(query),
|
|
23
|
+
this.scenarioSearch.search(query),
|
|
24
|
+
this.ruleSearch.search(query),
|
|
25
|
+
this.featureSearch.search(query),
|
|
26
|
+
]);
|
|
27
|
+
const walker = new GherkinDocumentWalker({
|
|
27
28
|
acceptStep: (step) => matchingSteps.includes(step),
|
|
28
|
-
acceptScenario: (scenario) => matchingScenarios.includes(scenario),
|
|
29
|
-
// TODO: This is an ugly hack to work around the fact that Scenario and Background are no longer interchangeable,
|
|
30
|
-
// because tags is now mandatory.
|
|
31
29
|
acceptBackground: (background) => matchingBackgrounds.includes(background),
|
|
30
|
+
acceptScenario: (scenario) => matchingScenarios.includes(scenario),
|
|
32
31
|
acceptRule: (rule) => matchingRules.includes(rule),
|
|
33
32
|
acceptFeature: (feature) => matchingFeatures.includes(feature),
|
|
34
33
|
});
|
|
35
34
|
return this.gherkinDocuments
|
|
36
35
|
.map((gherkinDocument) => walker.walkGherkinDocument(gherkinDocument))
|
|
37
|
-
.filter((gherkinDocument) => gherkinDocument
|
|
36
|
+
.filter((gherkinDocument) => !!gherkinDocument);
|
|
38
37
|
}
|
|
39
|
-
add(gherkinDocument) {
|
|
38
|
+
async add(gherkinDocument) {
|
|
40
39
|
this.gherkinDocuments.push(gherkinDocument);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
handleBackground: (background) => this.backgroundSearch.add(background),
|
|
45
|
-
|
|
40
|
+
const promises = [];
|
|
41
|
+
const walker = new GherkinDocumentWalker({}, {
|
|
42
|
+
handleStep: (step) => promises.push(this.stepSearch.add(step)),
|
|
43
|
+
handleBackground: (background) => promises.push(this.backgroundSearch.add(background)),
|
|
44
|
+
handleScenario: (scenario) => promises.push(this.scenarioSearch.add(scenario)),
|
|
45
|
+
handleRule: (rule) => promises.push(this.ruleSearch.add(rule)),
|
|
46
46
|
});
|
|
47
|
-
this.featureSearch.add(gherkinDocument);
|
|
47
|
+
promises.push(this.featureSearch.add(gherkinDocument));
|
|
48
48
|
walker.walkGherkinDocument(gherkinDocument);
|
|
49
|
+
await Promise.all(promises);
|
|
50
|
+
return this;
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
|
-
|
|
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
|
+
}
|
|
52
63
|
//# sourceMappingURL=TextSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSearch.js","sourceRoot":"","sources":["../../../src/search/TextSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextSearch.js","sourceRoot":"","sources":["../../../src/search/TextSearch.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GherkinDocument } from '@cucumber/messages';
|
|
2
|
+
/**
|
|
3
|
+
* Facade for an index that supports searching for and adding items of a given
|
|
4
|
+
* type. Also supports a different type being added if needed.
|
|
5
|
+
*/
|
|
6
|
+
export interface TypedIndex<ReturnedType, SourceType = ReturnedType> {
|
|
7
|
+
search: (query: string) => Promise<readonly ReturnedType[]>;
|
|
8
|
+
add: (item: SourceType) => Promise<this>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Shorthand type for an index of Gherkin documents.
|
|
12
|
+
*/
|
|
13
|
+
export type Searchable = TypedIndex<GherkinDocument>;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY;IACjE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAAA;IAC3D,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACzC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function toRepositoryId(s) {
|
|
1
|
+
export default function toRepositoryId(s) {
|
|
4
2
|
if (!s.includes('://') && s.includes(':')) {
|
|
5
3
|
// scp style URL (not really a URL)
|
|
6
4
|
const [host, path] = s.split(':', 2);
|
|
@@ -10,5 +8,4 @@ function toRepositoryId(s) {
|
|
|
10
8
|
const url = new URL(s);
|
|
11
9
|
return `${url.hostname}${url.pathname}`;
|
|
12
10
|
}
|
|
13
|
-
exports.default = toRepositoryId;
|
|
14
11
|
//# sourceMappingURL=toRepositoryId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toRepositoryId.js","sourceRoot":"","sources":["../../src/toRepositoryId.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toRepositoryId.js","sourceRoot":"","sources":["../../src/toRepositoryId.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAS;IAC9C,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACzC,mCAAmC;QACnC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC,GAAG,SAAS,IAAI,IAAI,IAAI,EAAE,CAAA;KAC5B;IACD,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAC3B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;AACzC,CAAC"}
|