@unotest/web 0.49.2 → 0.51.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.
@@ -1,7 +1,8 @@
1
- import { IDslLanguageService } from '@unotest/protocol';
2
- import { a as LintSeverity, E as ExternalVariableLookup } from '../linter-RrjB1n9R.js';
1
+ import { ScenarioSyntaxError, ParsedScenario } from '@unotest/dsl';
2
+ export { ProgramComment, ScenarioSyntaxError, scenarioFromProgram } from '@unotest/dsl';
3
+ import { DslDiagnostic, IDslLanguageService, DslValidateContext } from '@unotest/protocol';
4
+ import { a as LintSeverity, E as ExternalVariableLookup } from '../linter-CYRlmOLy.js';
3
5
  import { L as LegacyLayout } from '../legacy-layout-By62PkbP.js';
4
- import '@unotest/dsl';
5
6
 
6
7
  interface LinterSeverity {
7
8
  ruleSeverity: Partial<Record<string, LintSeverity>>;
@@ -60,13 +61,24 @@ interface LintProjectContextOptions {
60
61
  * the schema defaults — same as `unotest-web lint`. */
61
62
  declare function loadLintProjectContext(cwd?: string, opts?: LintProjectContextOptions): Promise<LintProjectContext>;
62
63
 
64
+ /** A file that does not parse, as one diagnostic. The CLI prints parse
65
+ * errors to stderr; here they come back structurally so the editor can
66
+ * render a squiggle. The CLI detects `source === "parse"` and restores
67
+ * its stderr formatting. */
68
+ declare function parseDiagnostic(e: ScenarioSyntaxError): DslDiagnostic;
69
+
70
+ /** The port, plus a door for a frontend that already holds the parsed
71
+ * file (the ESLint plugin): the same diagnostics without a second parse. */
72
+ interface WebDslLanguageService extends IDslLanguageService {
73
+ validateParsed(parsed: ParsedScenario, ctx?: DslValidateContext): DslDiagnostic[];
74
+ }
63
75
  /** Build the service. `severity` carries the project's `linter.rules`
64
76
  * overrides (computed from config by the launcher) so the editor's
65
77
  * diagnostics match `unotest-web lint`. Omit for default severities. */
66
- declare function createWebDslLanguageService(severity?: LinterSeverity): IDslLanguageService;
78
+ declare function createWebDslLanguageService(severity?: LinterSeverity): WebDslLanguageService;
67
79
 
68
80
  /** Default service (no project config) — used by the standalone-launch
69
81
  * fallback where no config has been loaded. */
70
- declare const webDslLanguageService: IDslLanguageService;
82
+ declare const webDslLanguageService: WebDslLanguageService;
71
83
 
72
- export { type LintProjectContext, type LinterSeverity, createWebDslLanguageService, webDslLanguageService as default, linterRulesToSeverity, loadLintProjectContext, webDslLanguageService };
84
+ export { type LintProjectContext, type LinterSeverity, type WebDslLanguageService, createWebDslLanguageService, webDslLanguageService as default, linterRulesToSeverity, loadLintProjectContext, parseDiagnostic, webDslLanguageService };