@sdboyer/thema-ui 0.0.0-stage → 0.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/LICENSE +201 -0
- package/README.md +25 -2
- package/dist/Diagnostics.d.ts +8 -0
- package/dist/Diagnostics.js +14 -0
- package/dist/Editor.d.ts +12 -0
- package/dist/Editor.js +95 -0
- package/dist/OpBar.d.ts +14 -0
- package/dist/OpBar.js +15 -0
- package/dist/Output.d.ts +20 -0
- package/dist/Output.js +56 -0
- package/dist/Tabs.d.ts +15 -0
- package/dist/Tabs.js +23 -0
- package/dist/cue-lang.d.ts +8 -0
- package/dist/cue-lang.js +82 -0
- package/dist/docs.d.ts +64 -0
- package/dist/docs.js +42 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +18 -0
- package/dist/markers.d.ts +11 -0
- package/dist/markers.js +45 -0
- package/dist/ops.d.ts +13 -0
- package/dist/ops.js +22 -0
- package/dist/positions.d.ts +7 -0
- package/dist/positions.js +40 -0
- package/dist/theme.d.ts +16 -0
- package/dist/theme.js +55 -0
- package/dist/types.d.ts +580 -0
- package/dist/types.js +85 -0
- package/errors/E0101.md +43 -0
- package/errors/E0102.md +34 -0
- package/errors/E0103.md +41 -0
- package/errors/E0104.md +5 -0
- package/errors/E0105.md +62 -0
- package/errors/E0106.md +46 -0
- package/errors/E0107.md +48 -0
- package/errors/E0108.md +45 -0
- package/errors/E0109.md +37 -0
- package/errors/E0110.md +17 -0
- package/errors/E0111.md +55 -0
- package/errors/E0112.md +40 -0
- package/errors/E0120.md +34 -0
- package/errors/E0121.md +34 -0
- package/errors/E0122.md +26 -0
- package/errors/E0123.md +37 -0
- package/errors/E0124.md +36 -0
- package/errors/E0125.md +43 -0
- package/errors/E0126.md +38 -0
- package/errors/E0128.md +34 -0
- package/errors/E0129.md +42 -0
- package/errors/E0130.md +43 -0
- package/errors/E0131.md +42 -0
- package/errors/E0132.md +40 -0
- package/errors/E0133.md +46 -0
- package/errors/E0134.md +36 -0
- package/errors/E0135.md +109 -0
- package/errors/E0137.md +37 -0
- package/errors/E0140.md +46 -0
- package/errors/E0141.md +35 -0
- package/errors/E0142.md +38 -0
- package/errors/E0143.md +62 -0
- package/errors/E0144.md +49 -0
- package/errors/E0145.md +48 -0
- package/errors/E0146.md +38 -0
- package/errors/E0147.md +57 -0
- package/errors/E0148.md +42 -0
- package/errors/E0149.md +27 -0
- package/errors/E0150.md +77 -0
- package/errors/E0151.md +47 -0
- package/errors/E0152.md +35 -0
- package/errors/E0201.md +35 -0
- package/errors/E0202.md +42 -0
- package/errors/E0203.md +37 -0
- package/errors/E0204.md +46 -0
- package/errors/E0205.md +47 -0
- package/errors/E0206.md +47 -0
- package/errors/E0208.md +59 -0
- package/errors/E0210.md +44 -0
- package/errors/E0211.md +43 -0
- package/errors/E0212.md +41 -0
- package/errors/E0213.md +42 -0
- package/errors/E0214.md +42 -0
- package/errors/E0215.md +44 -0
- package/errors/E0216.md +41 -0
- package/errors/E0217.md +43 -0
- package/errors/E0218.md +44 -0
- package/errors/E0230.md +46 -0
- package/errors/E0232.md +42 -0
- package/errors/E0233.md +42 -0
- package/errors/E0234.md +43 -0
- package/errors/E0240.md +31 -0
- package/errors/E0242.md +5 -0
- package/errors/E0243.md +5 -0
- package/errors/E0250.md +39 -0
- package/errors/E0251.md +83 -0
- package/errors/E0252.md +42 -0
- package/errors/E0253.md +142 -0
- package/errors/E0254.md +38 -0
- package/errors/E0301.md +43 -0
- package/errors/E0302.md +58 -0
- package/errors/E0303.md +57 -0
- package/errors/E0304.md +9 -0
- package/errors/E0305.md +55 -0
- package/errors/E0307.md +9 -0
- package/errors/E0308.md +9 -0
- package/errors/E0310.md +46 -0
- package/errors/E0311.md +46 -0
- package/errors/E0330.md +67 -0
- package/errors/E0331.md +64 -0
- package/errors/E0332.md +52 -0
- package/errors/E0333.md +61 -0
- package/errors/E0334.md +61 -0
- package/errors/E0335.md +57 -0
- package/errors/E0336.md +50 -0
- package/errors/E0337.md +54 -0
- package/errors/E0338.md +62 -0
- package/errors/E0340.md +57 -0
- package/errors/E0341.md +51 -0
- package/errors/E0342.md +53 -0
- package/errors/E0343.md +56 -0
- package/errors/E0344.md +58 -0
- package/errors/E0345.md +51 -0
- package/errors/E0346.md +45 -0
- package/errors/E0347.md +53 -0
- package/errors/E0348.md +50 -0
- package/errors/E0349.md +52 -0
- package/errors/E0350.md +54 -0
- package/errors/E0351.md +54 -0
- package/errors/E0352.md +60 -0
- package/errors/E0353.md +53 -0
- package/errors/E0354.md +43 -0
- package/errors/E0355.md +55 -0
- package/errors/E0356.md +65 -0
- package/errors/E0357.md +68 -0
- package/errors/E0358.md +50 -0
- package/errors/E0359.md +53 -0
- package/errors/E0360.md +59 -0
- package/errors/E0361.md +59 -0
- package/errors/E0362.md +56 -0
- package/errors/E0364.md +58 -0
- package/errors/E0365.md +58 -0
- package/errors/E0366.md +56 -0
- package/errors/E0367.md +57 -0
- package/errors/E0368.md +58 -0
- package/errors/E0369.md +60 -0
- package/errors/E0370.md +59 -0
- package/errors/E0371.md +59 -0
- package/errors/E0372.md +57 -0
- package/errors/E0380.md +71 -0
- package/errors/E0381.md +61 -0
- package/errors/E0382.md +64 -0
- package/errors/E0383.md +61 -0
- package/errors/E0384.md +63 -0
- package/errors/E0385.md +61 -0
- package/errors/E0386.md +59 -0
- package/errors/E0387.md +59 -0
- package/errors/E0388.md +60 -0
- package/errors/E0389.md +59 -0
- package/errors/E0390.md +59 -0
- package/errors/E0401.md +56 -0
- package/errors/E0402.md +51 -0
- package/errors/E0403.md +51 -0
- package/errors/E0404.md +57 -0
- package/errors/E0405.md +56 -0
- package/errors/E0406.md +53 -0
- package/errors/E0407.md +54 -0
- package/errors/E0410.md +56 -0
- package/errors/E0411.md +59 -0
- package/errors/E0412.md +59 -0
- package/errors/E0413.md +74 -0
- package/errors/E0414.md +53 -0
- package/errors/E0415.md +72 -0
- package/errors/E0416.md +67 -0
- package/errors/E0418.md +59 -0
- package/errors/E0420.md +71 -0
- package/errors/E0421.md +82 -0
- package/errors/E0422.md +82 -0
- package/errors/E0423.md +83 -0
- package/errors/E0501.md +51 -0
- package/errors/E0502.md +50 -0
- package/errors/E0503.md +52 -0
- package/errors/E0504.md +64 -0
- package/errors/E0505.md +51 -0
- package/errors/E0506.md +48 -0
- package/errors/E0507.md +41 -0
- package/errors/E0508.md +39 -0
- package/errors/E0601.md +22 -0
- package/errors/E0602.md +28 -0
- package/errors/E0603.md +65 -0
- package/errors/E0604.md +37 -0
- package/errors/E0605.md +36 -0
- package/errors/E0606.md +44 -0
- package/errors/E0607.md +57 -0
- package/errors/E0608.md +37 -0
- package/errors/E0609.md +33 -0
- package/errors/E0611.md +37 -0
- package/errors/E0612.md +34 -0
- package/errors/E0613.md +30 -0
- package/errors/E0614.md +36 -0
- package/errors/E0616.md +33 -0
- package/errors/E0617.md +15 -0
- package/errors/E0618.md +16 -0
- package/errors/E0620.md +37 -0
- package/errors/E0621.md +45 -0
- package/errors/E0622.md +34 -0
- package/errors/E0623.md +33 -0
- package/errors/E0624.md +34 -0
- package/errors/E0625.md +28 -0
- package/errors/E0626.md +54 -0
- package/errors/E0627.md +27 -0
- package/errors/E0628.md +63 -0
- package/errors/E0701.md +25 -0
- package/errors/E0801.md +23 -0
- package/errors/E0802.md +22 -0
- package/errors/E0803.md +22 -0
- package/errors/E0804.md +25 -0
- package/errors/E0805.md +26 -0
- package/errors/E0901.md +27 -0
- package/errors/E0902.md +40 -0
- package/errors/E0903.md +23 -0
- package/errors/E1001.md +53 -0
- package/errors/E1002.md +43 -0
- package/errors/E1003.md +40 -0
- package/errors/E1004.md +44 -0
- package/errors/README.md +215 -0
- package/package.json +34 -4
package/errors/E0210.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0210: a minor version requires a field its predecessor does not declare
|
|
4
|
+
|
|
5
|
+
A minor version is backward compatible with its predecessor: every instance of
|
|
6
|
+
the predecessor is an instance of it. A new field that data must supply breaks
|
|
7
|
+
that, since no prior instance supplies it. Give the field a default, make it
|
|
8
|
+
optional, or make this a major version.
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
`lineage.cue`:
|
|
13
|
+
|
|
14
|
+
```cue
|
|
15
|
+
name: "ship"
|
|
16
|
+
schemas: {
|
|
17
|
+
"0": {
|
|
18
|
+
"0": {
|
|
19
|
+
schema: {
|
|
20
|
+
a: string
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
"1": {
|
|
24
|
+
schema: {
|
|
25
|
+
a: string
|
|
26
|
+
b: int
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
thema reports:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
error[E0210]: b in schema 0.1 is required in the new schema but not declared in the prior one
|
|
37
|
+
--> lineage.cue:12:5
|
|
38
|
+
|
|
|
39
|
+
12 | b: int
|
|
40
|
+
| ^
|
|
41
|
+
|
|
|
42
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule field-added-required)
|
|
43
|
+
= help: make the change compatible, or make this version 1.0
|
|
44
|
+
```
|
package/errors/E0211.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0211: a minor version rejects a field its predecessor declares
|
|
4
|
+
|
|
5
|
+
A minor version accepts every instance of its predecessor. Removing a field the
|
|
6
|
+
predecessor declares rejects every instance that has it. The position is the
|
|
7
|
+
predecessor's declaration, since the new schema has nothing to point at.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
a: string
|
|
20
|
+
b: int
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
"1": {
|
|
24
|
+
schema: {
|
|
25
|
+
a: string
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
thema reports:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
error[E0211]: b in schema 0.1 is declared in the prior schema and not accepted by the new one
|
|
36
|
+
--> lineage.cue:7:5
|
|
37
|
+
|
|
|
38
|
+
7 | b: int
|
|
39
|
+
| ^
|
|
40
|
+
|
|
|
41
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule field-removed)
|
|
42
|
+
= help: make the change compatible, or make this version 1.0
|
|
43
|
+
```
|
package/errors/E0212.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0212: a minor version requires a field its predecessor left optional
|
|
4
|
+
|
|
5
|
+
A field the predecessor left optional may be absent from its instances; a minor
|
|
6
|
+
version that requires it rejects those instances.
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
`lineage.cue`:
|
|
11
|
+
|
|
12
|
+
```cue
|
|
13
|
+
name: "ship"
|
|
14
|
+
schemas: {
|
|
15
|
+
"0": {
|
|
16
|
+
"0": {
|
|
17
|
+
schema: {
|
|
18
|
+
a?: int
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
"1": {
|
|
22
|
+
schema: {
|
|
23
|
+
a!: int
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
thema reports:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
error[E0212]: a in schema 0.1 was optional and is now required
|
|
34
|
+
--> lineage.cue:11:5
|
|
35
|
+
|
|
|
36
|
+
11 | a!: int
|
|
37
|
+
| ^
|
|
38
|
+
|
|
|
39
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule field-now-required)
|
|
40
|
+
= help: make the change compatible, or make this version 1.0
|
|
41
|
+
```
|
package/errors/E0213.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0213: a minor version drops a default its predecessor filled
|
|
4
|
+
|
|
5
|
+
A defaulted field is filled when absent, and a consumer of the predecessor sees
|
|
6
|
+
that value. A minor version that makes the field optional leaves it absent
|
|
7
|
+
instead, so the same data means something different.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
a: *1 | int
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
"1": {
|
|
23
|
+
schema: {
|
|
24
|
+
a?: int
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
thema reports:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
error[E0213]: a in schema 0.1 was filled when absent and is now left absent
|
|
35
|
+
--> lineage.cue:11:5
|
|
36
|
+
|
|
|
37
|
+
11 | a?: int
|
|
38
|
+
| ^
|
|
39
|
+
|
|
|
40
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule default-removed)
|
|
41
|
+
= help: make the change compatible, or make this version 1.0
|
|
42
|
+
```
|
package/errors/E0214.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0214: a minor version changes a default
|
|
4
|
+
|
|
5
|
+
A defaulted field fills with its default when absent. A minor version that
|
|
6
|
+
changes the default makes the same absent field mean a different value, which
|
|
7
|
+
is a breaking change for every instance that relied on the old one.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
u: *"foo" | "bar" | "baz"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
"1": {
|
|
23
|
+
schema: {
|
|
24
|
+
u: "foo" | "bar" | *"baz"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
thema reports:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
error[E0214]: u in schema 0.1 fills with "baz" when absent, where the prior schema filled it with "foo"
|
|
35
|
+
--> lineage.cue:11:5
|
|
36
|
+
|
|
|
37
|
+
11 | u: "foo" | "bar" | *"baz"
|
|
38
|
+
| ^
|
|
39
|
+
|
|
|
40
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule default-changed)
|
|
41
|
+
= help: make the change compatible, or make this version 1.0
|
|
42
|
+
```
|
package/errors/E0215.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0215: a minor version narrows the values a field accepts
|
|
4
|
+
|
|
5
|
+
A minor version accepts every value its predecessor accepts at every path. A
|
|
6
|
+
bound, a narrower kind or a smaller disjunction rejects values the predecessor
|
|
7
|
+
accepted. A field the predecessor admitted only through `...` is the same case
|
|
8
|
+
(see also issue #47): it may already hold any value, so declaring it with a type
|
|
9
|
+
narrows it.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
`lineage.cue`:
|
|
14
|
+
|
|
15
|
+
```cue
|
|
16
|
+
name: "ship"
|
|
17
|
+
schemas: {
|
|
18
|
+
"0": {
|
|
19
|
+
"0": {
|
|
20
|
+
schema: {
|
|
21
|
+
n: int
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
"1": {
|
|
25
|
+
schema: {
|
|
26
|
+
n: int & >=0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
thema reports:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
error[E0215]: n in schema 0.1 is now uint, which does not accept every value of the prior int
|
|
37
|
+
--> lineage.cue:11:5
|
|
38
|
+
|
|
|
39
|
+
11 | n: int & >=0
|
|
40
|
+
| ^
|
|
41
|
+
|
|
|
42
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule value-narrowed)
|
|
43
|
+
= help: make the change compatible, or make this version 1.0
|
|
44
|
+
```
|
package/errors/E0216.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0216: a minor version narrows a list's length
|
|
4
|
+
|
|
5
|
+
A list's length is part of what a schema accepts. A minor version that fixes or
|
|
6
|
+
shortens a list's length rejects the predecessor's longer and shorter lists.
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
`lineage.cue`:
|
|
11
|
+
|
|
12
|
+
```cue
|
|
13
|
+
name: "ship"
|
|
14
|
+
schemas: {
|
|
15
|
+
"0": {
|
|
16
|
+
"0": {
|
|
17
|
+
schema: {
|
|
18
|
+
l: [...int]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
"1": {
|
|
22
|
+
schema: {
|
|
23
|
+
l: [int, int]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
thema reports:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
error[E0216]: l in schema 0.1 had length uint and now has length 2
|
|
34
|
+
--> lineage.cue:11:5
|
|
35
|
+
|
|
|
36
|
+
11 | l: [int, int]
|
|
37
|
+
| ^
|
|
38
|
+
|
|
|
39
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule length-narrowed)
|
|
40
|
+
= help: make the change compatible, or make this version 1.0
|
|
41
|
+
```
|
package/errors/E0217.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0217: a minor version narrows the field names a struct accepts
|
|
4
|
+
|
|
5
|
+
A struct written with `...` accepts any field name; its instances may hold
|
|
6
|
+
fields the schema never names. A minor version that closes the struct, or
|
|
7
|
+
narrows it to a pattern, rejects those instances.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
a: int
|
|
20
|
+
...
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
"1": {
|
|
24
|
+
schema: {
|
|
25
|
+
a: int
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
thema reports:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
error[E0217]: schema 0.1 accepts any field name in the prior schema and is closed in the new one
|
|
36
|
+
--> lineage.cue:11:4
|
|
37
|
+
|
|
|
38
|
+
11 | schema: {
|
|
39
|
+
| ^^^^^^
|
|
40
|
+
|
|
|
41
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule labels-narrowed)
|
|
42
|
+
= help: make the change compatible, or make this version 1.0
|
|
43
|
+
```
|
package/errors/E0218.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0218: a minor version adds or tightens a validator
|
|
4
|
+
|
|
5
|
+
A validator such as strings.MinRunes rejects values that fail it. A minor
|
|
6
|
+
version that adds one, or tightens one, rejects values the predecessor
|
|
7
|
+
accepted.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
import "strings"
|
|
15
|
+
|
|
16
|
+
name: "ship"
|
|
17
|
+
schemas: {
|
|
18
|
+
"0": {
|
|
19
|
+
"0": {
|
|
20
|
+
schema: {
|
|
21
|
+
s: string
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
"1": {
|
|
25
|
+
schema: {
|
|
26
|
+
s: strings.MinRunes(1)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
thema reports:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
error[E0218]: s in schema 0.1 must now satisfy strings.MinRunes(1), which the prior schema did not require
|
|
37
|
+
--> lineage.cue:13:5
|
|
38
|
+
|
|
|
39
|
+
13 | s: strings.MinRunes(1)
|
|
40
|
+
| ^
|
|
41
|
+
|
|
|
42
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule validator-added)
|
|
43
|
+
= help: make the change compatible, or make this version 1.0
|
|
44
|
+
```
|
package/errors/E0230.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0230: a minor version constrains a field by another field's value, which the checker cannot compare
|
|
4
|
+
|
|
5
|
+
The compatibility checker compares each field's constraint between the two
|
|
6
|
+
schemas. A field constrained by another field's value has no constraint of its
|
|
7
|
+
own to compare, so the checker cannot decide, and a minor version it cannot
|
|
8
|
+
decide about does not bind: change the schema so the checker can decide, or
|
|
9
|
+
make it a major version.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
`lineage.cue`:
|
|
14
|
+
|
|
15
|
+
```cue
|
|
16
|
+
name: "ship"
|
|
17
|
+
schemas: {
|
|
18
|
+
"0": {
|
|
19
|
+
"0": {
|
|
20
|
+
schema: {
|
|
21
|
+
a: int
|
|
22
|
+
b?: a
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
"1": {
|
|
26
|
+
schema: {
|
|
27
|
+
a: int
|
|
28
|
+
b?: >a
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
thema reports:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
error[E0230]: b in schema 0.1 is constrained by a in both schemas, differently; the checker cannot compare constraints between fields
|
|
39
|
+
--> lineage.cue:13:5
|
|
40
|
+
|
|
|
41
|
+
13 | b?: >a
|
|
42
|
+
| ^
|
|
43
|
+
|
|
|
44
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule unknown-crossfield)
|
|
45
|
+
= help: change the schema so the checker can decide, or make this version 1.0
|
|
46
|
+
```
|
package/errors/E0232.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0232: a minor version changes a validator the checker has no rule for
|
|
4
|
+
|
|
5
|
+
The compatibility checker knows a fixed set of validators and how each narrows a
|
|
6
|
+
value. A minor version that adds or changes one it has no rule for cannot be
|
|
7
|
+
shown compatible.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
n: int
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
"1": {
|
|
23
|
+
schema: {
|
|
24
|
+
n: int & matchN(1, [>0, <0])
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
thema reports:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
error[E0232]: n in schema 0.1 must now satisfy matchN(1, [>0, <0]), for which the checker has no rule
|
|
35
|
+
--> lineage.cue:11:5
|
|
36
|
+
|
|
|
37
|
+
11 | n: int & matchN(1, [>0, <0])
|
|
38
|
+
| ^
|
|
39
|
+
|
|
|
40
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule unknown-validator)
|
|
41
|
+
= help: change the schema so the checker can decide, or make this version 1.0
|
|
42
|
+
```
|
package/errors/E0233.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0233: a minor version's disjunction cannot be shown to cover its predecessor's
|
|
4
|
+
|
|
5
|
+
The checker shows a disjunction compatible by finding, for each alternative of
|
|
6
|
+
the predecessor, one alternative of the new schema that covers it. Alternatives
|
|
7
|
+
that cover it only together are not combined, so the checker cannot decide.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
n: int
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
"1": {
|
|
23
|
+
schema: {
|
|
24
|
+
n: >=0 | <0
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
thema reports:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
error[E0233]: n in schema 0.1 is now >=0 | <0, no single alternative of which covers the prior alternative int; the checker does not combine alternatives
|
|
35
|
+
--> lineage.cue:11:5
|
|
36
|
+
|
|
|
37
|
+
11 | n: >=0 | <0
|
|
38
|
+
| ^
|
|
39
|
+
|
|
|
40
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule unknown-disjunction)
|
|
41
|
+
= help: change the schema so the checker can decide, or make this version 1.0
|
|
42
|
+
```
|
package/errors/E0234.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0234: a minor version's pattern constraints cannot be shown to cover its predecessor's
|
|
4
|
+
|
|
5
|
+
Pattern constraints decide what a struct accepts for field names it does not
|
|
6
|
+
declare. The checker compares one pattern per side; several on each side are
|
|
7
|
+
compared only for identity, so a change among them cannot be decided.
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
`lineage.cue`:
|
|
12
|
+
|
|
13
|
+
```cue
|
|
14
|
+
name: "ship"
|
|
15
|
+
schemas: {
|
|
16
|
+
"0": {
|
|
17
|
+
"0": {
|
|
18
|
+
schema: {
|
|
19
|
+
m: {[=~"^a"]: int, [=~"^b"]: string}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
"1": {
|
|
23
|
+
schema: {
|
|
24
|
+
m: {[=~"^a"]: int, [=~"^b"]: number}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
thema reports:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
error[E0234]: m in schema 0.1 is not backward compatible with 0.0
|
|
35
|
+
--> lineage.cue:11:5
|
|
36
|
+
|
|
|
37
|
+
11 | m: {[=~"^a"]: int, [=~"^b"]: number}
|
|
38
|
+
| ^
|
|
39
|
+
|
|
|
40
|
+
= note: m in schema 0.1 has several pattern constraints, [=~"^a"], [=~"^b"] in the prior schema and [=~"^a"], [=~"^b"] in the new one, which the checker compares only for identity
|
|
41
|
+
= note: schema 0.1 is declared as a minor version of 0.0, so every instance of schema 0.0 must be an instance of it (compatibility rule unknown-patterns)
|
|
42
|
+
= help: change the schema so the checker can decide, or make this version 1.0
|
|
43
|
+
```
|
package/errors/E0240.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0240: the lineage has no schema with that version
|
|
4
|
+
|
|
5
|
+
A schema was asked for by a version the lineage does not have. The help lists
|
|
6
|
+
the versions it does.
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
`lineage.cue`:
|
|
11
|
+
|
|
12
|
+
```cue
|
|
13
|
+
name: "ship"
|
|
14
|
+
schemas: {
|
|
15
|
+
"0": {
|
|
16
|
+
"0": {
|
|
17
|
+
schema: {
|
|
18
|
+
a: string
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
thema reports:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
error[E0240]: lineage ship has no schema 9.9
|
|
29
|
+
|
|
|
30
|
+
= help: its versions are 0.0
|
|
31
|
+
```
|
package/errors/E0242.md
ADDED
package/errors/E0243.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0243: a published schema was changed
|
|
4
|
+
|
|
5
|
+
**Retired.** thema.IsAppendOnly, which reported it, was replaced by thema.CheckAppendOnly (#56), which compares versions by their identity, and reports a changed schema as E0250 and a changed lens as E0251.
|
package/errors/E0250.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- Generated by go test ./diag; do not edit. -->
|
|
2
|
+
|
|
3
|
+
# E0250: a published version's schema was changed
|
|
4
|
+
|
|
5
|
+
Once a version is published, instances are validated against it as it was
|
|
6
|
+
published, so its schema never changes. Here the candidate's 0.0 narrows
|
|
7
|
+
name, which the published 0.0 left as any string. A change, compatible or not,
|
|
8
|
+
is a new version: here, the tip, cut as 0.1 or 1.0.
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
`candidate/ship/history/0.0.thema`:
|
|
13
|
+
|
|
14
|
+
```cue
|
|
15
|
+
Schema: {
|
|
16
|
+
name: string & !=""
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`published/ship/history/0.0.thema`:
|
|
21
|
+
|
|
22
|
+
```cue
|
|
23
|
+
Schema: {
|
|
24
|
+
name: string
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
thema reports:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
error[E0250]: the schema in history/0.0.thema is not as published
|
|
32
|
+
--> candidate/ship/history/0.0.thema:1:1
|
|
33
|
+
|
|
|
34
|
+
1 | Schema: {
|
|
35
|
+
| ^^^^^^
|
|
36
|
+
|
|
|
37
|
+
= note: a published version never changes: instances were validated against it as it was published
|
|
38
|
+
= help: restore the schema in history/0.0.thema as it was published, and make the change in a new version
|
|
39
|
+
```
|