@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
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,2BAA2B,CAAA;AAC5D,OAAO,qBAAqB,EAAE,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAClF,OAAO,cAAc,MAAM,4BAA4B,CAAA;AACvD,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,kBAAkB,EAAE,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACb,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,GACb,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,44 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.SearchQueryContext = exports.searchFromURLParams = exports.GherkinQueryContext = exports.filterByStatus = exports.EnvelopesQueryContext = exports.EnvelopesQuery = exports.CucumberQueryContext = exports.hooks = exports.components = void 0;
|
|
30
|
-
const CucumberQueryContext_1 = __importDefault(require("./CucumberQueryContext"));
|
|
31
|
-
exports.CucumberQueryContext = CucumberQueryContext_1.default;
|
|
32
|
-
const EnvelopesQueryContext_1 = __importStar(require("./EnvelopesQueryContext"));
|
|
33
|
-
exports.EnvelopesQueryContext = EnvelopesQueryContext_1.default;
|
|
34
|
-
Object.defineProperty(exports, "EnvelopesQuery", { enumerable: true, get: function () { return EnvelopesQueryContext_1.EnvelopesQuery; } });
|
|
35
|
-
const filterByStatus_1 = __importDefault(require("./filter/filterByStatus"));
|
|
36
|
-
exports.filterByStatus = filterByStatus_1.default;
|
|
37
|
-
const GherkinQueryContext_1 = __importDefault(require("./GherkinQueryContext"));
|
|
38
|
-
exports.GherkinQueryContext = GherkinQueryContext_1.default;
|
|
39
|
-
const SearchQueryContext_1 = __importStar(require("./SearchQueryContext"));
|
|
40
|
-
exports.SearchQueryContext = SearchQueryContext_1.default;
|
|
41
|
-
Object.defineProperty(exports, "searchFromURLParams", { enumerable: true, get: function () { return SearchQueryContext_1.searchFromURLParams; } });
|
|
42
|
-
exports.components = __importStar(require("./components/index"));
|
|
43
|
-
exports.hooks = __importStar(require("./hooks/index"));
|
|
1
|
+
import CucumberQueryContext from './CucumberQueryContext.js';
|
|
2
|
+
import EnvelopesQueryContext, { EnvelopesQuery } from './EnvelopesQueryContext.js';
|
|
3
|
+
import filterByStatus from './filter/filterByStatus.js';
|
|
4
|
+
import GherkinQueryContext from './GherkinQueryContext.js';
|
|
5
|
+
import SearchQueryContext, { searchFromURLParams, } from './SearchQueryContext.js';
|
|
6
|
+
export * as components from './components/index.js';
|
|
7
|
+
export * as hooks from './hooks/index.js';
|
|
8
|
+
export { CucumberQueryContext, EnvelopesQuery, EnvelopesQueryContext, filterByStatus, GherkinQueryContext, searchFromURLParams, SearchQueryContext, };
|
|
44
9
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,2BAA2B,CAAA;AAC5D,OAAO,qBAAqB,EAAE,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAClF,OAAO,cAAc,MAAM,4BAA4B,CAAA;AACvD,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,kBAAkB,EAAE,EACzB,mBAAmB,GAIpB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,GAInB,CAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function isTagExpression(expression) {
|
|
1
|
+
export default function isTagExpression(expression) {
|
|
4
2
|
const tagExpression = /^\s*((@[^\s]+\s*)|(and\s+)|(or\s+)|(not\s+)|\(|\))+\s*$/;
|
|
5
3
|
return !!tagExpression.exec(expression);
|
|
6
4
|
}
|
|
7
|
-
exports.default = isTagExpression;
|
|
8
5
|
//# sourceMappingURL=isTagExpression.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTagExpression.js","sourceRoot":"","sources":["../../src/isTagExpression.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isTagExpression.js","sourceRoot":"","sources":["../../src/isTagExpression.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,UAAkB;IACxD,MAAM,aAAa,GAAG,yDAAyD,CAAA;IAC/E,OAAO,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
private readonly index;
|
|
5
|
-
add(gherkinDocument: messages.GherkinDocument): void;
|
|
6
|
-
search(query: string): messages.Feature[];
|
|
7
|
-
}
|
|
1
|
+
import { Feature, GherkinDocument } from '@cucumber/messages';
|
|
2
|
+
import { TypedIndex } from './types.js';
|
|
3
|
+
export declare function createFeatureSearch(): Promise<TypedIndex<Feature, GherkinDocument>>;
|
|
8
4
|
//# 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,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAuCvC,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAQzF"}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { create, insert, search } from '@orama/orama';
|
|
2
|
+
const schema = {
|
|
3
|
+
name: 'string',
|
|
4
|
+
description: 'string',
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A little different than the other indexes - a Feature doesn't have its own id,
|
|
8
|
+
* so we use the uri of the GherkinDocument as a pointer
|
|
9
|
+
*/
|
|
7
10
|
class FeatureSearch {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
featuresByUri = new Map();
|
|
12
|
+
index;
|
|
13
|
+
constructor(index) {
|
|
14
|
+
this.index = index;
|
|
15
|
+
}
|
|
16
|
+
async search(term) {
|
|
17
|
+
const { hits } = await search(this.index, {
|
|
18
|
+
term,
|
|
15
19
|
});
|
|
20
|
+
return hits.map((hit) => this.featuresByUri.get(hit.id));
|
|
16
21
|
}
|
|
17
|
-
add(gherkinDocument) {
|
|
22
|
+
async add(gherkinDocument) {
|
|
18
23
|
if (!gherkinDocument.feature)
|
|
19
|
-
return;
|
|
24
|
+
return this;
|
|
20
25
|
if (!gherkinDocument.uri)
|
|
21
26
|
throw new Error('Missing uri on gherkinDocument');
|
|
22
27
|
this.featuresByUri.set(gherkinDocument.uri, gherkinDocument.feature);
|
|
23
|
-
this.index
|
|
24
|
-
|
|
28
|
+
await insert(this.index, {
|
|
29
|
+
id: gherkinDocument.uri,
|
|
25
30
|
name: gherkinDocument.feature.name,
|
|
26
31
|
description: gherkinDocument.feature.description,
|
|
27
32
|
});
|
|
33
|
+
return this;
|
|
28
34
|
}
|
|
29
|
-
search(query) {
|
|
30
|
-
const searchResultsList = this.index.search(query, {
|
|
31
|
-
fields: {
|
|
32
|
-
name: { bool: 'OR', boost: 1 },
|
|
33
|
-
description: { bool: 'OR', boost: 1 },
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
return searchResultsList.map((searchResults) => {
|
|
37
|
-
const feature = this.featuresByUri.get(searchResults.ref);
|
|
38
|
-
if (!feature)
|
|
39
|
-
throw new Error(`No feature for ref ${searchResults.ref}`);
|
|
40
|
-
return feature;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
35
|
}
|
|
44
|
-
|
|
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
45
|
//# sourceMappingURL=FeatureSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSearch.js","sourceRoot":"","sources":["../../../src/search/FeatureSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeatureSearch.js","sourceRoot":"","sources":["../../../src/search/FeatureSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,cAAc,CAAA;AAI5D,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;CACb,CAAA;AAEV;;;GAGG;AACH,MAAM,aAAa;IACA,aAAa,GAAG,IAAI,GAAG,EAAmB,CAAA;IAC1C,KAAK,CAAsB;IAE5C,YAAY,KAA2B;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,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,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAc,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,eAAgC;QACxC,IAAI,CAAC,eAAe,CAAC,OAAO;YAAE,OAAO,IAAI,CAAA;QACzC,IAAI,CAAC,eAAe,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QAC3E,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;QACpE,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;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,KAAK,GAAyB,MAAM,MAAM,CAAC;QAC/C,MAAM;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK;SACf;KACF,CAAC,CAAA;IACF,OAAO,IAAI,aAAa,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Orama } from '@orama/orama';
|
|
2
|
+
import { TypedIndex } from './types.js';
|
|
3
|
+
declare const schema: {
|
|
4
|
+
readonly name: "string";
|
|
5
|
+
readonly description: "string";
|
|
6
|
+
};
|
|
7
|
+
export interface ScenarioLike {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Can be used for Backgrounds, Scenarios and Rules, searching against the
|
|
14
|
+
* name and description
|
|
15
|
+
*/
|
|
16
|
+
declare class ScenarioLikeSearch<T extends ScenarioLike> implements TypedIndex<T> {
|
|
17
|
+
private itemById;
|
|
18
|
+
private readonly index;
|
|
19
|
+
constructor(index: Orama<typeof schema>);
|
|
20
|
+
search(term: string): Promise<Array<T>>;
|
|
21
|
+
add(item: T): Promise<this>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createScenarioLikeSearch<T extends ScenarioLike>(): Promise<ScenarioLikeSearch<T>>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=ScenarioLikeSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScenarioLikeSearch.d.ts","sourceRoot":"","sources":["../../../src/search/ScenarioLikeSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAU,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,QAAA,MAAM,MAAM;;;CAGF,CAAA;AAEV,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,cAAM,kBAAkB,CAAC,CAAC,SAAS,YAAY,CAAE,YAAW,UAAU,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;gBAEhC,KAAK,EAAE,KAAK,CAAC,OAAO,MAAM,CAAC;IAIjC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAOvC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CASlC;AAED,wBAAsB,wBAAwB,CAAC,CAAC,SAAS,YAAY,KAAK,OAAO,CAC/E,kBAAkB,CAAC,CAAC,CAAC,CACtB,CAQA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { create, insert, search } from '@orama/orama';
|
|
2
|
+
const schema = {
|
|
3
|
+
name: 'string',
|
|
4
|
+
description: 'string',
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Can be used for Backgrounds, Scenarios and Rules, searching against the
|
|
8
|
+
* name and description
|
|
9
|
+
*/
|
|
10
|
+
class ScenarioLikeSearch {
|
|
11
|
+
itemById = new Map();
|
|
12
|
+
index;
|
|
13
|
+
constructor(index) {
|
|
14
|
+
this.index = index;
|
|
15
|
+
}
|
|
16
|
+
async search(term) {
|
|
17
|
+
const { hits } = await search(this.index, {
|
|
18
|
+
term,
|
|
19
|
+
});
|
|
20
|
+
return hits.map((hit) => this.itemById.get(hit.id));
|
|
21
|
+
}
|
|
22
|
+
async add(item) {
|
|
23
|
+
this.itemById.set(item.id, item);
|
|
24
|
+
await insert(this.index, {
|
|
25
|
+
id: item.id,
|
|
26
|
+
name: item.name,
|
|
27
|
+
description: item.description,
|
|
28
|
+
});
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
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
|
+
//# sourceMappingURL=ScenarioLikeSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScenarioLikeSearch.js","sourceRoot":"","sources":["../../../src/search/ScenarioLikeSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,cAAc,CAAA;AAI5D,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;CACb,CAAA;AAQV;;;GAGG;AACH,MAAM,kBAAkB;IACd,QAAQ,GAAG,IAAI,GAAG,EAAa,CAAA;IACtB,KAAK,CAAsB;IAE5C,YAAY,KAA2B;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,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,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAQ,CAAA;IAC5D,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAO;QACf,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QAChC,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;YACvB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAG5C,MAAM,KAAK,GAAyB,MAAM,MAAM,CAAC;QAC/C,MAAM;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK;SACf;KACF,CAAC,CAAA;IACF,OAAO,IAAI,kBAAkB,CAAI,KAAK,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Query as GherkinQuery } from '@cucumber/gherkin-utils';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { Searchable } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a search index that supports querying by term or tag expression, and
|
|
5
|
+
* returns an array of abridged Gherkin documents matching the query.
|
|
6
|
+
*
|
|
7
|
+
* @param gherkinQuery - query instance used internally for searching, with any
|
|
8
|
+
* documents already present being pre-populated in the search index
|
|
9
|
+
*/
|
|
10
|
+
export declare function createSearch(gherkinQuery: GherkinQuery): Promise<Searchable>;
|
|
11
11
|
//# sourceMappingURL=Search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/search/Search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/search/Search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAM/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAwBvC;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAUlF"}
|
|
@@ -1,32 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const isTagExpression_1 = __importDefault(require("../../src/isTagExpression"));
|
|
7
|
-
const TagSearch_1 = __importDefault(require("../../src/search/TagSearch"));
|
|
8
|
-
const TextSearch_1 = __importDefault(require("../../src/search/TextSearch"));
|
|
1
|
+
import isTagExpression from '../isTagExpression.js';
|
|
2
|
+
import { createTagSearch } from './TagSearch.js';
|
|
3
|
+
import { createTextSearch } from './TextSearch.js';
|
|
9
4
|
class Search {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.tagSearch =
|
|
5
|
+
tagSearch;
|
|
6
|
+
textSearch;
|
|
7
|
+
constructor(tagSearch, textSearch) {
|
|
8
|
+
this.tagSearch = tagSearch;
|
|
9
|
+
this.textSearch = textSearch;
|
|
14
10
|
}
|
|
15
|
-
search(query) {
|
|
16
|
-
if ((
|
|
11
|
+
async search(query) {
|
|
12
|
+
if (isTagExpression(query)) {
|
|
17
13
|
try {
|
|
18
|
-
return this.tagSearch.search(query);
|
|
14
|
+
return await this.tagSearch.search(query);
|
|
19
15
|
}
|
|
20
|
-
catch
|
|
16
|
+
catch {
|
|
21
17
|
// No-op, we fall back to text search.
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
return this.textSearch.search(query);
|
|
25
21
|
}
|
|
26
|
-
add(gherkinDocument) {
|
|
27
|
-
this.tagSearch.add(gherkinDocument);
|
|
28
|
-
this.textSearch.add(gherkinDocument);
|
|
22
|
+
async add(gherkinDocument) {
|
|
23
|
+
await this.tagSearch.add(gherkinDocument);
|
|
24
|
+
await this.textSearch.add(gherkinDocument);
|
|
25
|
+
return this;
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Creates a search index that supports querying by term or tag expression, and
|
|
30
|
+
* returns an array of abridged Gherkin documents matching the query.
|
|
31
|
+
*
|
|
32
|
+
* @param gherkinQuery - query instance used internally for searching, with any
|
|
33
|
+
* documents already present being pre-populated in the search index
|
|
34
|
+
*/
|
|
35
|
+
export async function createSearch(gherkinQuery) {
|
|
36
|
+
const [tagSearch, textSearch] = await Promise.all([
|
|
37
|
+
createTagSearch(gherkinQuery),
|
|
38
|
+
createTextSearch(),
|
|
39
|
+
]);
|
|
40
|
+
const searchImpl = new Search(tagSearch, textSearch);
|
|
41
|
+
for (const doc of gherkinQuery.getGherkinDocuments()) {
|
|
42
|
+
await searchImpl.add(doc);
|
|
43
|
+
}
|
|
44
|
+
return searchImpl;
|
|
45
|
+
}
|
|
32
46
|
//# sourceMappingURL=Search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/search/Search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src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CAAA;AACnB,CAAC"}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Step } from '@cucumber/messages';
|
|
2
|
+
import { Orama } from '@orama/orama';
|
|
3
|
+
import { TypedIndex } from './types.js';
|
|
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;
|
|
3
12
|
private readonly index;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
private get;
|
|
8
|
-
private static docStringToString;
|
|
9
|
-
private static dataTableToString;
|
|
13
|
+
constructor(index: Orama<typeof schema>);
|
|
14
|
+
search(term: string): Promise<Array<Step>>;
|
|
15
|
+
add(step: Step): Promise<this>;
|
|
10
16
|
}
|
|
17
|
+
export declare function createStepSearch(): Promise<StepSearch>;
|
|
18
|
+
export {};
|
|
11
19
|
//# sourceMappingURL=StepSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepSearch.d.ts","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"StepSearch.d.ts","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAkB,KAAK,EAAU,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,QAAA,MAAM,MAAM;;;;;CAKF,CAAA;AAEV,cAAM,UAAW,YAAW,UAAU,CAAC,IAAI,CAAC;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;gBAEhC,KAAK,EAAE,KAAK,CAAC,OAAO,MAAM,CAAC;IAIjC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAU1C,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAWrC;AAED,wBAAsB,gBAAgB,wBAQrC"}
|
|
@@ -1,55 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { create, insert, search } from '@orama/orama';
|
|
2
|
+
const schema = {
|
|
3
|
+
keyword: 'string',
|
|
4
|
+
text: 'string',
|
|
5
|
+
docString: 'string',
|
|
6
|
+
dataTable: 'string[]',
|
|
4
7
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const elasticlunr_1 = __importDefault(require("elasticlunr"));
|
|
7
8
|
class StepSearch {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
stepById = new Map();
|
|
10
|
+
index;
|
|
11
|
+
constructor(index) {
|
|
12
|
+
this.index = index;
|
|
13
|
+
}
|
|
14
|
+
async search(term) {
|
|
15
|
+
const { hits } = await search(this.index, {
|
|
16
|
+
term,
|
|
17
|
+
boost: {
|
|
18
|
+
text: 2,
|
|
19
|
+
},
|
|
16
20
|
});
|
|
17
|
-
this.stepById
|
|
21
|
+
return hits.map((hit) => this.stepById.get(hit.id));
|
|
18
22
|
}
|
|
19
|
-
add(step) {
|
|
20
|
-
|
|
23
|
+
async add(step) {
|
|
24
|
+
this.stepById.set(step.id, step);
|
|
25
|
+
await insert(this.index, {
|
|
21
26
|
id: step.id,
|
|
22
27
|
keyword: step.keyword,
|
|
23
28
|
text: step.text,
|
|
24
|
-
docString: step.docString
|
|
25
|
-
dataTable: step.dataTable
|
|
26
|
-
};
|
|
27
|
-
this.index.addDoc(doc);
|
|
28
|
-
this.stepById.set(step.id, step);
|
|
29
|
-
}
|
|
30
|
-
search(query) {
|
|
31
|
-
const results = this.index.search(query, {
|
|
32
|
-
fields: {
|
|
33
|
-
keyword: { bool: 'OR', boost: 1 },
|
|
34
|
-
text: { bool: 'OR', boost: 2 },
|
|
35
|
-
docString: { bool: 'OR', boost: 1 },
|
|
36
|
-
dataTable: { bool: 'OR', boost: 1 },
|
|
37
|
-
},
|
|
29
|
+
docString: step.docString?.content,
|
|
30
|
+
dataTable: step.dataTable?.rows.flatMap((row) => row.cells).map((cell) => cell.value),
|
|
38
31
|
});
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
get(ref) {
|
|
42
|
-
const rule = this.stepById.get(ref);
|
|
43
|
-
if (!rule)
|
|
44
|
-
throw new Error(`No step for ref ${ref}`);
|
|
45
|
-
return rule;
|
|
46
|
-
}
|
|
47
|
-
static docStringToString(docString) {
|
|
48
|
-
return docString.content;
|
|
49
|
-
}
|
|
50
|
-
static dataTableToString(dataTable) {
|
|
51
|
-
return dataTable.rows.map((row) => row.cells.map((cell) => cell.value).join(' ')).join(' ');
|
|
32
|
+
return this;
|
|
52
33
|
}
|
|
53
34
|
}
|
|
54
|
-
|
|
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
|
+
}
|
|
55
44
|
//# sourceMappingURL=StepSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepSearch.js","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StepSearch.js","sourceRoot":"","sources":["../../../src/search/StepSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,cAAc,CAAA;A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AgB;IACpC,MAAM,KAAK,GAAyB,MAAM,MAAM,CAAC;QAC/C,MAAM;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK;SACf;KACF,CAAC,CAAA;IACF,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { Query as GherkinQuery } from '@cucumber/gherkin-utils';
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
private readonly gherkinQuery;
|
|
5
|
-
private readonly pickleById;
|
|
6
|
-
private readonly picklesByScenarioId;
|
|
7
|
-
private gherkinDocuments;
|
|
8
|
-
constructor(gherkinQuery: GherkinQuery);
|
|
9
|
-
search(query: string): messages.GherkinDocument[];
|
|
10
|
-
add(gherkinDocument: messages.GherkinDocument): void;
|
|
11
|
-
}
|
|
2
|
+
import { Searchable } from './types.js';
|
|
3
|
+
export declare function createTagSearch(gherkinQuery: GherkinQuery): Promise<Searchable>;
|
|
12
4
|
//# sourceMappingURL=TagSearch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagSearch.d.ts","sourceRoot":"","sources":["../../../src/search/TagSearch.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TagSearch.d.ts","sourceRoot":"","sources":["../../../src/search/TagSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,YAAY,EAEtB,MAAM,yBAAyB,CAAA;AAMhC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA6DvC,wBAAsB,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAErF"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const gherkin_utils_1 = require("@cucumber/gherkin-utils");
|
|
7
|
-
const tag_expressions_1 = __importDefault(require("@cucumber/tag-expressions"));
|
|
8
|
-
const multimaps_1 = require("@teppeis/multimaps");
|
|
1
|
+
import { GherkinDocumentWalker, rejectAllFilters, } from '@cucumber/gherkin-utils';
|
|
2
|
+
import parse from '@cucumber/tag-expressions';
|
|
3
|
+
import { ArrayMultimap } from '@teppeis/multimaps';
|
|
9
4
|
class TagSearch {
|
|
5
|
+
gherkinQuery;
|
|
6
|
+
pickleById = new Map();
|
|
7
|
+
picklesByScenarioId = new ArrayMultimap();
|
|
8
|
+
gherkinDocuments = [];
|
|
10
9
|
constructor(gherkinQuery) {
|
|
11
10
|
this.gherkinQuery = gherkinQuery;
|
|
12
|
-
this.pickleById = new Map();
|
|
13
|
-
this.picklesByScenarioId = new multimaps_1.ArrayMultimap();
|
|
14
|
-
this.gherkinDocuments = [];
|
|
15
11
|
this.gherkinQuery = gherkinQuery;
|
|
16
12
|
}
|
|
17
|
-
search(query) {
|
|
18
|
-
const expressionNode = (
|
|
13
|
+
async search(query) {
|
|
14
|
+
const expressionNode = parse(query);
|
|
19
15
|
const tagFilters = {
|
|
20
16
|
acceptScenario: (scenario) => {
|
|
21
17
|
const pickles = this.picklesByScenarioId.get(scenario.id);
|
|
@@ -28,17 +24,17 @@ class TagSearch {
|
|
|
28
24
|
return false;
|
|
29
25
|
},
|
|
30
26
|
};
|
|
31
|
-
const filters =
|
|
32
|
-
const astWalker = new
|
|
27
|
+
const filters = { ...rejectAllFilters, ...tagFilters };
|
|
28
|
+
const astWalker = new GherkinDocumentWalker(filters);
|
|
33
29
|
return this.gherkinDocuments
|
|
34
30
|
.map((gherkinDocument) => astWalker.walkGherkinDocument(gherkinDocument))
|
|
35
31
|
.filter((gherkinDocument) => gherkinDocument !== null);
|
|
36
32
|
}
|
|
37
|
-
add(gherkinDocument) {
|
|
33
|
+
async add(gherkinDocument) {
|
|
38
34
|
this.gherkinDocuments.push(gherkinDocument);
|
|
39
35
|
const pickles = this.gherkinQuery.getPickles();
|
|
40
36
|
pickles.forEach((pickle) => this.pickleById.set(pickle.id, pickle));
|
|
41
|
-
const astWalker = new
|
|
37
|
+
const astWalker = new GherkinDocumentWalker({}, {
|
|
42
38
|
handleScenario: (scenario) => {
|
|
43
39
|
if (!gherkinDocument.uri)
|
|
44
40
|
throw new Error('No uri for gherkinDocument');
|
|
@@ -52,7 +48,10 @@ class TagSearch {
|
|
|
52
48
|
},
|
|
53
49
|
});
|
|
54
50
|
astWalker.walkGherkinDocument(gherkinDocument);
|
|
51
|
+
return this;
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
export async function createTagSearch(gherkinQuery) {
|
|
55
|
+
return new TagSearch(gherkinQuery);
|
|
56
|
+
}
|
|
58
57
|
//# sourceMappingURL=TagSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagSearch.js","sourceRoot":"","sources":["../../../src/search/TagSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TagSearch.js","sourceRoot":"","sources":["../../../src/search/TagSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,gBAAgB,GACjB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,KAAK,MAAM,2BAA2B,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIlD,MAAM,SAAS;IAKgB;IAJZ,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAA;IAC/C,mBAAmB,GAAG,IAAI,aAAa,EAA2B,CAAA;IAC3E,gBAAgB,GAA+B,EAAE,CAAA;IAEzD,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QACrD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,KAAa;QAC/B,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,UAAU,GAAG;YACjB,cAAc,EAAE,C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