ivue 2.5.0 → 2.6.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.
@@ -21,12 +21,12 @@
21
21
  import { existsSync, readFileSync } from 'node:fs';
22
22
  import { basename, dirname, resolve } from 'node:path';
23
23
  import { Static } from '../../lib/Static';
24
- import { CheckStandard, type CheckProof, type Finding, type StandardCheck } from './ivue-standards-check';
24
+ import { CheckStandard } from './ivue-standards-check';
25
25
 
26
26
  class $GeneratorStandard extends CheckStandard.$Class {
27
- static get invariants_a_test_file_opens_with_its_generator_header(): StandardCheck {
27
+ static get invariants_a_test_file_opens_with_its_generator_header(): CheckStandard.StandardCheck {
28
28
  return this.defineCheck('invariants_a_test_file_opens_with_its_generator_header', (context) => {
29
- const findings: Finding[] = [];
29
+ const findings: CheckStandard.Finding[] = [];
30
30
  for (const unit of context.tests) {
31
31
  const header = this.parseHeader(unit);
32
32
  if (!header.present) findings.push(this.finding(this.invariants_a_test_file_opens_with_its_generator_header, unit, 1, `no \`${this.$grammar.GENERATOR}\` header — the test file opens with its generator header, before any import`));
@@ -36,9 +36,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
36
36
  });
37
37
  }
38
38
 
39
- static get invariants_a_generator_header_carries_both_registers_in_order(): StandardCheck {
39
+ static get invariants_a_generator_header_carries_both_registers_in_order(): CheckStandard.StandardCheck {
40
40
  return this.defineCheck('invariants_a_generator_header_carries_both_registers_in_order', (context) => {
41
- const findings: Finding[] = [];
41
+ const findings: CheckStandard.Finding[] = [];
42
42
  const grammar = this.$grammar;
43
43
  for (const unit of context.tests) {
44
44
  const header = this.parseHeader(unit);
@@ -54,9 +54,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
54
54
  });
55
55
  }
56
56
 
57
- static get invariants_a_header_symbol_is_declared_in_the_sibling_source(): StandardCheck {
57
+ static get invariants_a_header_symbol_is_declared_in_the_sibling_source(): CheckStandard.StandardCheck {
58
58
  return this.defineCheck('invariants_a_header_symbol_is_declared_in_the_sibling_source', (context) => {
59
- const findings: Finding[] = [];
59
+ const findings: CheckStandard.Finding[] = [];
60
60
  for (const unit of context.tests) {
61
61
  const header = this.parseHeader(unit);
62
62
  if (!header.present) continue;
@@ -92,9 +92,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
92
92
  });
93
93
  }
94
94
 
95
- static get invariants_a_claim_annotation_sits_directly_above_its_test(): StandardCheck {
95
+ static get invariants_a_claim_annotation_sits_directly_above_its_test(): CheckStandard.StandardCheck {
96
96
  return this.defineCheck('invariants_a_claim_annotation_sits_directly_above_its_test', (context) => {
97
- const findings: Finding[] = [];
97
+ const findings: CheckStandard.Finding[] = [];
98
98
  for (const unit of context.tests) {
99
99
  const header = this.parseHeader(unit);
100
100
  if (!header.present) continue;
@@ -106,9 +106,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
106
106
  });
107
107
  }
108
108
 
109
- static get invariants_header_claims_and_annotated_tests_match_one_to_one(): StandardCheck {
109
+ static get invariants_header_claims_and_annotated_tests_match_one_to_one(): CheckStandard.StandardCheck {
110
110
  return this.defineCheck('invariants_header_claims_and_annotated_tests_match_one_to_one', (context) => {
111
- const findings: Finding[] = [];
111
+ const findings: CheckStandard.Finding[] = [];
112
112
  for (const unit of context.tests) {
113
113
  const header = this.parseHeader(unit);
114
114
  if (!header.present) continue;
@@ -127,9 +127,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
127
127
  });
128
128
  }
129
129
 
130
- static get invariants_an_impossibility_is_proved_by_an_exact_negative_test(): StandardCheck {
130
+ static get invariants_an_impossibility_is_proved_by_an_exact_negative_test(): CheckStandard.StandardCheck {
131
131
  return this.defineCheck('invariants_an_impossibility_is_proved_by_an_exact_negative_test', (context) => {
132
- const findings: Finding[] = [];
132
+ const findings: CheckStandard.Finding[] = [];
133
133
  for (const unit of context.tests) {
134
134
  const header = this.parseHeader(unit);
135
135
  if (!header.present) continue;
@@ -154,9 +154,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
154
154
  });
155
155
  }
156
156
 
157
- static get invariants_a_contract_pointer_resolves_and_is_proved(): StandardCheck {
157
+ static get invariants_a_contract_pointer_resolves_and_is_proved(): CheckStandard.StandardCheck {
158
158
  return this.defineCheck('invariants_a_contract_pointer_resolves_and_is_proved', (context) => {
159
- const findings: Finding[] = [];
159
+ const findings: CheckStandard.Finding[] = [];
160
160
  for (const unit of context.tests) {
161
161
  const header = this.parseHeader(unit);
162
162
  if (!header.present) continue;
@@ -187,9 +187,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
187
187
  });
188
188
  }
189
189
 
190
- static get invariants_a_source_tripwire_resolves_to_its_sibling_header(): StandardCheck {
190
+ static get invariants_a_source_tripwire_resolves_to_its_sibling_header(): CheckStandard.StandardCheck {
191
191
  return this.defineCheck('invariants_a_source_tripwire_resolves_to_its_sibling_header', (context) => {
192
- const findings: Finding[] = [];
192
+ const findings: CheckStandard.Finding[] = [];
193
193
  const grammar = this.$grammar;
194
194
  const SYMBOL_ONLY = new RegExp(`^\\s*//\\s*${grammar.DOMAIN}:\\s*([^—\\n]+?)\\s*$`);
195
195
  for (const unit of context.sources) {
@@ -214,9 +214,9 @@ class $GeneratorStandard extends CheckStandard.$Class {
214
214
  });
215
215
  }
216
216
 
217
- static get invariants_a_test_caveat_derives_from_a_tested_claim(): StandardCheck {
217
+ static get invariants_a_test_caveat_derives_from_a_tested_claim(): CheckStandard.StandardCheck {
218
218
  return this.defineCheck('invariants_a_test_caveat_derives_from_a_tested_claim', (context) => {
219
- const findings: Finding[] = [];
219
+ const findings: CheckStandard.Finding[] = [];
220
220
  for (const unit of context.tests) {
221
221
  const header = this.parseHeader(unit);
222
222
  if (!header.present || !header.described) continue;
@@ -234,10 +234,10 @@ class $GeneratorStandard extends CheckStandard.$Class {
234
234
  });
235
235
  }
236
236
 
237
- static get invariants_two_test_files_do_not_share_one_generator_header(): StandardCheck {
237
+ static get invariants_two_test_files_do_not_share_one_generator_header(): CheckStandard.StandardCheck {
238
238
  return this.defineCheck('invariants_two_test_files_do_not_share_one_generator_header', (context) => {
239
- const findings: Finding[] = [];
240
- const normalized = new Map<string, SourceUnit>();
239
+ const findings: CheckStandard.Finding[] = [];
240
+ const normalized = new Map<string, CheckStandard.SourceUnit>();
241
241
  for (const unit of context.tests) {
242
242
  const header = this.parseHeader(unit);
243
243
  if (!header.present) continue;
@@ -253,7 +253,7 @@ class $GeneratorStandard extends CheckStandard.$Class {
253
253
  });
254
254
  }
255
255
 
256
- static get checks(): readonly StandardCheck[] {
256
+ static get checks(): readonly CheckStandard.StandardCheck[] {
257
257
  return [
258
258
  ...super.checks,
259
259
  this.invariants_a_test_file_opens_with_its_generator_header,
@@ -269,7 +269,7 @@ class $GeneratorStandard extends CheckStandard.$Class {
269
269
  ];
270
270
  }
271
271
 
272
- static get proofs(): Readonly<Record<string, CheckProof>> {
272
+ static get proofs(): Readonly<Record<string, CheckStandard.CheckProof>> {
273
273
  const fixture = this.$fixtures;
274
274
  const grammar = this.$grammar;
275
275
  const contractName = `demo${grammar.CONTRACT_SUFFIX}`;
@@ -19,7 +19,7 @@
19
19
  * npm run gate:house -- --source-root src --test-glob 'src/**\/*.test.ts'
20
20
  */
21
21
  import { Static } from '../../lib/Static';
22
- import { CheckStandard, type CheckProof, type StandardCheck } from './ivue-standards-check';
22
+ import { CheckStandard } from './ivue-standards-check';
23
23
 
24
24
  // This gate extends the ivue-only Standard. Teams using the invariant
25
25
  // methodology (generator headers on test files, claims bound to tests)
@@ -58,6 +58,7 @@ class $HouseGate extends CheckStandard.$Class {
58
58
  a_lifecycle_hook_delegates_to_one_method: 'warn',
59
59
  the_state_destructure_is_total: 'error',
60
60
  template_expressions_carry_no_logic: 'error',
61
+ one_handler_per_event: 'error',
61
62
  watch_lifetime_matches_the_instance_owner: 'error',
62
63
  a_reactive_closure_delegates_to_one_method: 'error',
63
64
  a_store_is_used_lazily_and_swapped_at_the_class_slot: 'error',
@@ -95,7 +96,7 @@ class $HouseGate extends CheckStandard.$Class {
95
96
  return 900;
96
97
  }
97
98
 
98
- static get a_source_file_stays_under_the_line_budget(): StandardCheck {
99
+ static get a_source_file_stays_under_the_line_budget(): CheckStandard.StandardCheck {
99
100
  return this.defineCheck('a_source_file_stays_under_the_line_budget', (context) =>
100
101
  context.sources
101
102
  .filter((unit) => unit.lines.length > this.MAX_SOURCE_LINES)
@@ -103,11 +104,11 @@ class $HouseGate extends CheckStandard.$Class {
103
104
  );
104
105
  }
105
106
 
106
- static get checks(): readonly StandardCheck[] {
107
+ static get checks(): readonly CheckStandard.StandardCheck[] {
107
108
  return [...super.checks, this.a_source_file_stays_under_the_line_budget];
108
109
  }
109
110
 
110
- static get proofs(): Readonly<Record<string, CheckProof>> {
111
+ static get proofs(): Readonly<Record<string, CheckStandard.CheckProof>> {
111
112
  return {
112
113
  ...super.proofs,
113
114
  [this.a_source_file_stays_under_the_line_budget.name]: {