@step-forge/step-forge 0.0.12 → 0.0.14
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/dist/analyzer-QH03uejK.js +478 -0
- package/dist/analyzer-QH03uejK.js.map +1 -0
- package/dist/analyzer-cli.d.ts +1 -0
- package/dist/analyzer-cli.js +69 -0
- package/dist/analyzer-cli.js.map +1 -0
- package/dist/analyzer.d.ts +73 -0
- package/dist/analyzer.js +2 -0
- package/dist/step-forge.cjs +727 -0
- package/dist/step-forge.cjs.map +1 -0
- package/dist/step-forge.d.cts +326 -0
- package/dist/step-forge.d.ts +326 -0
- package/dist/step-forge.js +695 -0
- package/dist/step-forge.js.map +1 -0
- package/package.json +1 -3
- package/.claude/settings.local.json +0 -18
- package/.eslintignore +0 -6
- package/.eslintrc +0 -18
- package/.prettierignore +0 -6
- package/.prettierrc +0 -15
- package/CLAUDE.md +0 -115
- package/cucumber.mjs +0 -39
- package/docs/assets/state_deps.gif +0 -0
- package/features/TESTING.md +0 -100
- package/features/analyzer/analyzer.feature +0 -110
- package/features/analyzer/fixtures/ambiguous-step.feature +0 -5
- package/features/analyzer/fixtures/missing-given-dep.feature +0 -5
- package/features/analyzer/fixtures/missing-multiple-deps.feature +0 -6
- package/features/analyzer/fixtures/missing-when-dep.feature +0 -5
- package/features/analyzer/fixtures/steps.ts +0 -113
- package/features/analyzer/fixtures/undefined-step.feature +0 -5
- package/features/analyzer/fixtures/undefined-with-missing-dep.feature +0 -5
- package/features/analyzer/fixtures/valid-and-but-keywords.feature +0 -8
- package/features/analyzer/fixtures/valid-deps.feature +0 -6
- package/features/analyzer/fixtures/valid-no-deps.feature +0 -6
- package/features/analyzer/fixtures/valid-optional-deps.feature +0 -6
- package/features/analyzer/fixtures/valid-variables.feature +0 -6
- package/features/basic.feature +0 -21
- package/features/exported.feature +0 -6
- package/features/steps/analyzerSteps.ts +0 -67
- package/features/steps/commonSteps.ts +0 -93
- package/features/steps/exportedSteps.ts +0 -42
- package/features/steps/world.ts +0 -29
- package/src/analyzer/cli.ts +0 -96
- package/src/analyzer/gherkinParser.ts +0 -179
- package/src/analyzer/index.ts +0 -89
- package/src/analyzer/rules/ambiguousStepRule.ts +0 -36
- package/src/analyzer/rules/dependencyRule.ts +0 -71
- package/src/analyzer/rules/index.ts +0 -23
- package/src/analyzer/rules/undefinedStepRule.ts +0 -31
- package/src/analyzer/stepExtractor.ts +0 -432
- package/src/analyzer/stepMatcher.ts +0 -85
- package/src/analyzer/types.ts +0 -55
- package/src/builderTypeUtils.ts +0 -27
- package/src/common.ts +0 -138
- package/src/given.ts +0 -102
- package/src/index.ts +0 -46
- package/src/then.ts +0 -128
- package/src/utils.ts +0 -74
- package/src/when.ts +0 -118
- package/src/world.ts +0 -90
- package/test/givenCompilationTests.ts +0 -130
- package/test/testUtils.ts +0 -30
- package/test/thenCompilationTests.ts +0 -207
- package/test/whenCompilationTests.ts +0 -157
- package/ts-node-esm-register.js +0 -8
- package/tsconfig.cucumber.json +0 -14
- package/tsconfig.json +0 -29
- package/tsdown.config.ts +0 -35
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/analyzer/types.d.ts
|
|
2
|
+
interface StepDefinitionMeta {
|
|
3
|
+
stepType: "given" | "when" | "then";
|
|
4
|
+
expression: string;
|
|
5
|
+
dependencies: {
|
|
6
|
+
given: Record<string, "required" | "optional">;
|
|
7
|
+
when: Record<string, "required" | "optional">;
|
|
8
|
+
then: Record<string, "required" | "optional">;
|
|
9
|
+
};
|
|
10
|
+
produces: string[];
|
|
11
|
+
sourceFile: string;
|
|
12
|
+
line: number;
|
|
13
|
+
}
|
|
14
|
+
interface ParsedScenario {
|
|
15
|
+
name: string;
|
|
16
|
+
file: string;
|
|
17
|
+
steps: ParsedStep[];
|
|
18
|
+
}
|
|
19
|
+
interface ParsedStep {
|
|
20
|
+
keyword: "Given" | "When" | "Then" | "And" | "But";
|
|
21
|
+
effectiveKeyword: "Given" | "When" | "Then";
|
|
22
|
+
text: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
}
|
|
26
|
+
interface MatchedStep extends ParsedStep {
|
|
27
|
+
definitions: StepDefinitionMeta[];
|
|
28
|
+
}
|
|
29
|
+
interface Diagnostic {
|
|
30
|
+
file: string;
|
|
31
|
+
range: {
|
|
32
|
+
startLine: number;
|
|
33
|
+
startColumn: number;
|
|
34
|
+
endLine: number;
|
|
35
|
+
endColumn: number;
|
|
36
|
+
};
|
|
37
|
+
severity: "error" | "warning" | "info";
|
|
38
|
+
message: string;
|
|
39
|
+
rule: string;
|
|
40
|
+
source: "step-forge";
|
|
41
|
+
}
|
|
42
|
+
interface AnalysisRule {
|
|
43
|
+
name: string;
|
|
44
|
+
check(scenario: ParsedScenario, matchedSteps: MatchedStep[]): Diagnostic[];
|
|
45
|
+
}
|
|
46
|
+
interface AnalyzerConfig {
|
|
47
|
+
stepFiles: string[];
|
|
48
|
+
featureFiles: string[];
|
|
49
|
+
tsConfigPath?: string;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/analyzer/stepExtractor.d.ts
|
|
53
|
+
declare function extractStepDefinitions(filePaths: string[], tsConfigPath?: string): StepDefinitionMeta[];
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/analyzer/gherkinParser.d.ts
|
|
56
|
+
declare function parseFeatureFiles(filePaths: string[]): ParsedScenario[];
|
|
57
|
+
declare function parseFeatureContent(content: string, filePath: string): ParsedScenario[];
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/analyzer/stepMatcher.d.ts
|
|
60
|
+
declare function matchScenarioSteps(scenario: ParsedScenario, definitions: StepDefinitionMeta[]): MatchedStep[];
|
|
61
|
+
declare function findMatchingDefinitions(text: string, effectiveKeyword: "Given" | "When" | "Then", definitions: StepDefinitionMeta[]): StepDefinitionMeta[];
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/analyzer/rules/index.d.ts
|
|
64
|
+
declare const defaultRules: AnalysisRule[];
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/analyzer/index.d.ts
|
|
67
|
+
interface AnalyzeOptions {
|
|
68
|
+
rules?: AnalysisRule[];
|
|
69
|
+
}
|
|
70
|
+
declare function analyze(config: AnalyzerConfig, options?: AnalyzeOptions): Promise<Diagnostic[]>;
|
|
71
|
+
//#endregion
|
|
72
|
+
export { type AnalysisRule, AnalyzeOptions, type AnalyzerConfig, type Diagnostic, type MatchedStep, type ParsedScenario, type ParsedStep, type StepDefinitionMeta, analyze, defaultRules, extractStepDefinitions, findMatchingDefinitions, matchScenarioSteps, parseFeatureContent, parseFeatureFiles };
|
|
73
|
+
//# sourceMappingURL=analyzer.d.ts.map
|
package/dist/analyzer.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as parseFeatureContent, i as matchScenarioSteps, n as defaultRules, o as parseFeatureFiles, r as findMatchingDefinitions, s as extractStepDefinitions, t as analyze } from "./analyzer-QH03uejK.js";
|
|
2
|
+
export { analyze, defaultRules, extractStepDefinitions, findMatchingDefinitions, matchScenarioSteps, parseFeatureContent, parseFeatureFiles };
|