@ucm-kit/adapter-typescript 0.1.10 → 0.1.12
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 +13 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ depend on the TypeScript compiler, a 23 MB dependency no other consumer should
|
|
|
6
6
|
pay for.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npm install --save-dev @ucm-kit/adapter-typescript@0.1.
|
|
9
|
+
npm install --save-dev @ucm-kit/adapter-typescript@0.1.12 @ucm-kit/cli@0.1.19
|
|
10
10
|
npx ucm-typescript
|
|
11
11
|
npx --no-install ucm check
|
|
12
12
|
```
|
|
@@ -20,17 +20,17 @@ reported:
|
|
|
20
20
|
| Gap | What it means |
|
|
21
21
|
|---|---|
|
|
22
22
|
| Missing prop | The contract declares a prop the component's public API does not expose |
|
|
23
|
-
| Incompatible type |
|
|
23
|
+
| Incompatible type | A `boolean` prop of the contract is typed as something else |
|
|
24
24
|
| Value the code does not offer | The contract publishes an enum value the declared union leaves out |
|
|
25
|
-
| Unused boolean | A `
|
|
25
|
+
| Unused boolean | A `boolean` prop is declared but never read by the component |
|
|
26
26
|
| Unused enum | An enum prop is declared but never read by the component |
|
|
27
27
|
| Wrong composition cardinality | A declared dependency is rendered a different number of times than the contract says |
|
|
28
28
|
|
|
29
29
|
Parity requires a `tsconfig.json` at the root. Props are read with the
|
|
30
30
|
TypeScript type checker; compositions are counted by their occurrences in JSX.
|
|
31
31
|
|
|
32
|
-
Every one of these **warns without blocking**.
|
|
33
|
-
|
|
32
|
+
Every one of these **warns without blocking**. The gap is in the code, and a
|
|
33
|
+
developer closes it; a re-export changes nothing.
|
|
34
34
|
|
|
35
35
|
## The convention composition counting assumes
|
|
36
36
|
|
|
@@ -39,12 +39,16 @@ every occurrence explicit in the source, and neutralise in place the one a
|
|
|
39
39
|
given view does not show, rather than removing it. Without that, a list built
|
|
40
40
|
with `.map()` reports a cardinality gap the contract did not intend.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
Nothing enforces it: there is no exception list, no annotation, and no
|
|
43
|
+
per-component opt-out. The warning itself says what it does not see, and it
|
|
44
|
+
blocks nothing.
|
|
45
45
|
|
|
46
46
|
## What it does not measure
|
|
47
47
|
|
|
48
|
+
Type comparison covers `boolean` props only. An enum is judged on its declared
|
|
49
|
+
union, below; `string`, `icon`, `instance-swap` and `slot` props are checked for
|
|
50
|
+
presence and never for type.
|
|
51
|
+
|
|
48
52
|
Enum values are compared by the **declared union only**. A union smaller than
|
|
49
53
|
the contract is reported; a union that accepts more is not, because accepting
|
|
50
54
|
more contradicts nothing. On a widened type such as `string`, no value is
|
|
@@ -61,7 +65,7 @@ A prop relayed through `{...rest}` without being read is reported as unused.
|
|
|
61
65
|
Following a spread would mean knowing the child's contract, and the warning
|
|
62
66
|
blocks nothing.
|
|
63
67
|
|
|
64
|
-
Nothing here executes a render.
|
|
68
|
+
Nothing here executes a render.
|
|
65
69
|
|
|
66
70
|
None of this exists for a repository without this adapter, so the **absence of
|
|
67
71
|
these messages means nothing**: it is a capability of one adapter, never a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucm-kit/adapter-typescript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Adaptateur TypeScript UCM : parité statique des composants et génération des types dérivés des contrats.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test": "node scripts/run-tests.cjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ucm-kit/core": "0.1.
|
|
38
|
+
"@ucm-kit/core": "0.1.20",
|
|
39
39
|
"typescript": ">=5.5.0 <6"
|
|
40
40
|
}
|
|
41
41
|
}
|