Skip to content

Commit 856c8e5

Browse files
authored
Turn on new WIT metadata format by default (#2201)
* Turn on new WIT metadata format by default This commit is a follow-up to #1508 where a new JSON format was added for storing docs/stability and accounting for world imports/exports allowing overlap. This support should have permeated far enough that it's reasonable to turn this on-by-default now. This additionally fixes fuzz bugs cropping up after adding support for stability annotations in the generated WIT, the other motivation for this. * Update test expectations
1 parent c969911 commit 856c8e5

39 files changed

+39
-39
lines changed

crates/wit-component/tests/interfaces/console.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212
)
1313
(export (;1;) "console" (type 0))
14-
(@custom "package-docs" "\00{}")
14+
(@custom "package-docs" "\01{}")
1515
(@producers
1616
(processed-by "wit-component" "$CARGO_PKG_VERSION")
1717
)

crates/wit-component/tests/interfaces/diamond-disambiguate.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
)
6464
)
6565
(export (;5;) "w1" (type 4))
66-
(@custom "package-docs" "\00{}")
66+
(@custom "package-docs" "\01{}")
6767
(@producers
6868
(processed-by "wit-component" "$CARGO_PKG_VERSION")
6969
)

crates/wit-component/tests/interfaces/diamond.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
)
101101
)
102102
(export (;7;) "w3" (type 6))
103-
(@custom "package-docs" "\00{}")
103+
(@custom "package-docs" "\01{}")
104104
(@producers
105105
(processed-by "wit-component" "$CARGO_PKG_VERSION")
106106
)

crates/wit-component/tests/interfaces/doc-comments.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
)
6767
)
6868
(export (;5;) "coverage-world" (type 4))
69-
(@custom "package-docs" "\00{\22docs\22:\22package docs;\22,\22worlds\22:{\22coverage-world\22:{\22docs\22:\22world docs\22,\22interfaces\22:{\22i\22:{\22docs\22:\22world inline interface docs\22,\22funcs\22:{\22f\22:\22inline interface func docs\22},\22types\22:{\22t\22:{\22docs\22:\22inline interface typedef docs\22}}}},\22types\22:{\22t\22:{\22docs\22:\22world typedef docs\22}},\22funcs\22:{\22imp\22:\22world func import docs\22,\22exp\22:\22world func export docs\22}}},\22interfaces\22:{\22coverage-iface\22:{\22docs\22:\22interface docs\22,\22funcs\22:{\22[constructor]res\22:\22constructor docs\22,\22[method]res.m\22:\22method docs\22,\22[static]res.s\22:\22static func docs\22,\22f\22:\22interface func docs\22},\22types\22:{\22t\22:{\22docs\22:\22basic typedef docs\22},\22r\22:{\22docs\22:\22record typedef docs\22,\22items\22:{\22f1\22:\22record field docs\22}},\22fl\22:{\22items\22:{\22f1\22:\22flag docs\22}},\22v\22:{\22items\22:{\22c1\22:\22variant case docs\22}},\22e\22:{\22items\22:{\22c1\22:\22enum case docs\22}}}},\22other-comment-forms\22:{\22docs\22:\22other comment forms\5cn multi-line block\22,\22funcs\22:{\22multiple-lines-split\22:\22one doc line\5cnnon-doc in the middle\5cnanother doc line\22,\22mixed-forms\22:\22mixed forms; line doc\5cnplus block doc\5cn multi-line\22}}}}")
69+
(@custom "package-docs" "\01{\22docs\22:\22package docs;\22,\22worlds\22:{\22coverage-world\22:{\22docs\22:\22world docs\22,\22types\22:{\22t\22:{\22docs\22:\22world typedef docs\22}},\22funcs\22:{\22imp\22:{\22docs\22:\22world func import docs\22}},\22interface_exports\22:{\22i\22:{\22docs\22:\22world inline interface docs\22,\22funcs\22:{\22f\22:{\22docs\22:\22inline interface func docs\22}},\22types\22:{\22t\22:{\22docs\22:\22inline interface typedef docs\22}}}},\22func_exports\22:{\22exp\22:{\22docs\22:\22world func export docs\22}}}},\22interfaces\22:{\22coverage-iface\22:{\22docs\22:\22interface docs\22,\22funcs\22:{\22[constructor]res\22:{\22docs\22:\22constructor docs\22},\22[method]res.m\22:{\22docs\22:\22method docs\22},\22[static]res.s\22:{\22docs\22:\22static func docs\22},\22f\22:{\22docs\22:\22interface func docs\22}},\22types\22:{\22t\22:{\22docs\22:\22basic typedef docs\22},\22r\22:{\22docs\22:\22record typedef docs\22,\22items\22:{\22f1\22:\22record field docs\22}},\22fl\22:{\22items\22:{\22f1\22:\22flag docs\22}},\22v\22:{\22items\22:{\22c1\22:\22variant case docs\22}},\22e\22:{\22items\22:{\22c1\22:\22enum case docs\22}}}},\22other-comment-forms\22:{\22docs\22:\22other comment forms\5cn multi-line block\22,\22funcs\22:{\22multiple-lines-split\22:{\22docs\22:\22one doc line\5cnnon-doc in the middle\5cnanother doc line\22},\22mixed-forms\22:{\22docs\22:\22mixed forms; line doc\5cnplus block doc\5cn multi-line\22}}}}}")
7070
(@producers
7171
(processed-by "wit-component" "$CARGO_PKG_VERSION")
7272
)

crates/wit-component/tests/interfaces/empty.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
)
4444
)
4545
(export (;5;) "actually-empty-world" (type 4))
46-
(@custom "package-docs" "\00{}")
46+
(@custom "package-docs" "\01{}")
4747
(@producers
4848
(processed-by "wit-component" "$CARGO_PKG_VERSION")
4949
)

crates/wit-component/tests/interfaces/export-other-packages-interface.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717
)
1818
(export (;1;) "foo" (type 0))
19-
(@custom "package-docs" "\00{}")
19+
(@custom "package-docs" "\01{}")
2020
(@producers
2121
(processed-by "wit-component" "$CARGO_PKG_VERSION")
2222
)

crates/wit-component/tests/interfaces/exports.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
)
3333
)
3434
(export (;3;) "export-foo" (type 2))
35-
(@custom "package-docs" "\00{}")
35+
(@custom "package-docs" "\01{}")
3636
(@producers
3737
(processed-by "wit-component" "$CARGO_PKG_VERSION")
3838
)

crates/wit-component/tests/interfaces/flags.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
)
7373
)
7474
(export (;3;) "flags-world" (type 2))
75-
(@custom "package-docs" "\00{}")
75+
(@custom "package-docs" "\01{}")
7676
(@producers
7777
(processed-by "wit-component" "$CARGO_PKG_VERSION")
7878
)

crates/wit-component/tests/interfaces/floats.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
)
4141
)
4242
(export (;3;) "floats-world" (type 2))
43-
(@custom "package-docs" "\00{}")
43+
(@custom "package-docs" "\01{}")
4444
(@producers
4545
(processed-by "wit-component" "$CARGO_PKG_VERSION")
4646
)

crates/wit-component/tests/interfaces/foreign-use-chain.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
)
2525
)
2626
(export (;1;) "foo" (type 0))
27-
(@custom "package-docs" "\00{}")
27+
(@custom "package-docs" "\01{}")
2828
(@producers
2929
(processed-by "wit-component" "$CARGO_PKG_VERSION")
3030
)

crates/wit-component/tests/interfaces/import-and-export.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
)
4848
)
4949
(export (;5;) "import-and-export" (type 4))
50-
(@custom "package-docs" "\00{}")
50+
(@custom "package-docs" "\01{}")
5151
(@producers
5252
(processed-by "wit-component" "$CARGO_PKG_VERSION")
5353
)

crates/wit-component/tests/interfaces/integers.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
)
101101
)
102102
(export (;3;) "integers-world" (type 2))
103-
(@custom "package-docs" "\00{}")
103+
(@custom "package-docs" "\01{}")
104104
(@producers
105105
(processed-by "wit-component" "$CARGO_PKG_VERSION")
106106
)

crates/wit-component/tests/interfaces/lists.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
)
205205
)
206206
(export (;3;) "lists-world" (type 2))
207-
(@custom "package-docs" "\00{}")
207+
(@custom "package-docs" "\01{}")
208208
(@producers
209209
(processed-by "wit-component" "$CARGO_PKG_VERSION")
210210
)

crates/wit-component/tests/interfaces/multi-doc.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
)
7272
)
7373
(export (;7;) "a2" (type 6))
74-
(@custom "package-docs" "\00{}")
74+
(@custom "package-docs" "\01{}")
7575
(@producers
7676
(processed-by "wit-component" "$CARGO_PKG_VERSION")
7777
)

crates/wit-component/tests/interfaces/multiple-use.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
)
6161
)
6262
(export (;5;) "baz" (type 4))
63-
(@custom "package-docs" "\00{}")
63+
(@custom "package-docs" "\01{}")
6464
(@producers
6565
(processed-by "wit-component" "$CARGO_PKG_VERSION")
6666
)

crates/wit-component/tests/interfaces/pkg-use-chain.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
)
6464
)
6565
(export (;5;) "foo" (type 4))
66-
(@custom "package-docs" "\00{}")
66+
(@custom "package-docs" "\01{}")
6767
(@producers
6868
(processed-by "wit-component" "$CARGO_PKG_VERSION")
6969
)

crates/wit-component/tests/interfaces/pkg-use-chain2.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
)
6464
)
6565
(export (;5;) "foo" (type 4))
66-
(@custom "package-docs" "\00{}")
66+
(@custom "package-docs" "\01{}")
6767
(@producers
6868
(processed-by "wit-component" "$CARGO_PKG_VERSION")
6969
)

crates/wit-component/tests/interfaces/preserve-dep-type-order.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
)
4141
)
4242
(export (;3;) "bar" (type 2))
43-
(@custom "package-docs" "\00{}")
43+
(@custom "package-docs" "\01{}")
4444
(@producers
4545
(processed-by "wit-component" "$CARGO_PKG_VERSION")
4646
)

crates/wit-component/tests/interfaces/preserve-foreign-reexport.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818
)
1919
(export (;1;) "foo" (type 0))
20-
(@custom "package-docs" "\00{}")
20+
(@custom "package-docs" "\01{}")
2121
(@producers
2222
(processed-by "wit-component" "$CARGO_PKG_VERSION")
2323
)

crates/wit-component/tests/interfaces/print-keyword.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515
)
1616
(export (;1;) "interface" (type 0))
17-
(@custom "package-docs" "\00{}")
17+
(@custom "package-docs" "\01{}")
1818
(@producers
1919
(processed-by "wit-component" "$CARGO_PKG_VERSION")
2020
)

crates/wit-component/tests/interfaces/records.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
)
135135
)
136136
(export (;3;) "records-world" (type 2))
137-
(@custom "package-docs" "\00{}")
137+
(@custom "package-docs" "\01{}")
138138
(@producers
139139
(processed-by "wit-component" "$CARGO_PKG_VERSION")
140140
)

crates/wit-component/tests/interfaces/reference-out-of-order.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
)
5757
)
5858
(export (;3;) "foo-world" (type 2))
59-
(@custom "package-docs" "\00{}")
59+
(@custom "package-docs" "\01{}")
6060
(@producers
6161
(processed-by "wit-component" "$CARGO_PKG_VERSION")
6262
)

crates/wit-component/tests/interfaces/resources.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
)
181181
)
182182
(export (;11;) "implicit-own-handles3" (type 10))
183-
(@custom "package-docs" "\00{\22worlds\22:{\22implicit-own-handles3\22:{\22types\22:{\22a\22:{\22docs\22:\22there should only be one `list` type despite there looking like two\5cnlist types here\22}}}},\22interfaces\22:{\22implicit-own-handles2\22:{\22types\22:{\22a\22:{\22docs\22:\22the `own` return and list param should be the same `own`\22},\22b\22:{\22docs\22:\22same as above, even when the `list<b>` implicitly-defined `own` comes\5cnbefore an explicitly defined `own`\22},\22c\22:{\22docs\22:\22same as the above, the `own` argument should have the same type as the\5cnreturn value\22}}}}}")
183+
(@custom "package-docs" "\01{\22worlds\22:{\22implicit-own-handles3\22:{\22types\22:{\22a\22:{\22docs\22:\22there should only be one `list` type despite there looking like two\5cnlist types here\22}}}},\22interfaces\22:{\22implicit-own-handles2\22:{\22types\22:{\22a\22:{\22docs\22:\22the `own` return and list param should be the same `own`\22},\22b\22:{\22docs\22:\22same as above, even when the `list<b>` implicitly-defined `own` comes\5cnbefore an explicitly defined `own`\22},\22c\22:{\22docs\22:\22same as the above, the `own` argument should have the same type as the\5cnreturn value\22}}}}}")
184184
(@producers
185185
(processed-by "wit-component" "$CARGO_PKG_VERSION")
186186
)

crates/wit-component/tests/interfaces/simple-deps.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
)
2020
)
2121
(export (;1;) "foo" (type 0))
22-
(@custom "package-docs" "\00{}")
22+
(@custom "package-docs" "\01{}")
2323
(@producers
2424
(processed-by "wit-component" "$CARGO_PKG_VERSION")
2525
)

crates/wit-component/tests/interfaces/simple-multi.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818
)
1919
(export (;3;) "foo" (type 2))
20-
(@custom "package-docs" "\00{}")
20+
(@custom "package-docs" "\01{}")
2121
(@producers
2222
(processed-by "wit-component" "$CARGO_PKG_VERSION")
2323
)

crates/wit-component/tests/interfaces/simple-use.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
)
3434
)
3535
(export (;3;) "console" (type 2))
36-
(@custom "package-docs" "\00{}")
36+
(@custom "package-docs" "\01{}")
3737
(@producers
3838
(processed-by "wit-component" "$CARGO_PKG_VERSION")
3939
)

crates/wit-component/tests/interfaces/simple-world.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
)
2929
)
3030
(export (;3;) "the-world" (type 2))
31-
(@custom "package-docs" "\00{}")
31+
(@custom "package-docs" "\01{}")
3232
(@producers
3333
(processed-by "wit-component" "$CARGO_PKG_VERSION")
3434
)

crates/wit-component/tests/interfaces/type-alias.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
)
4545
)
4646
(export (;3;) "my-world" (type 2))
47-
(@custom "package-docs" "\00{}")
47+
(@custom "package-docs" "\01{}")
4848
(@producers
4949
(processed-by "wit-component" "$CARGO_PKG_VERSION")
5050
)

crates/wit-component/tests/interfaces/type-alias2.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
)
3535
)
3636
(export (;3;) "my-world" (type 2))
37-
(@custom "package-docs" "\00{}")
37+
(@custom "package-docs" "\01{}")
3838
(@producers
3939
(processed-by "wit-component" "$CARGO_PKG_VERSION")
4040
)

crates/wit-component/tests/interfaces/upstream-deps-same-name.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
)
3030
)
3131
(export (;1;) "a" (type 0))
32-
(@custom "package-docs" "\00{}")
32+
(@custom "package-docs" "\01{}")
3333
(@producers
3434
(processed-by "wit-component" "$CARGO_PKG_VERSION")
3535
)

crates/wit-component/tests/interfaces/use-chain.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
)
6666
)
6767
(export (;5;) "baz" (type 4))
68-
(@custom "package-docs" "\00{}")
68+
(@custom "package-docs" "\01{}")
6969
(@producers
7070
(processed-by "wit-component" "$CARGO_PKG_VERSION")
7171
)

crates/wit-component/tests/interfaces/use-for-type.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
)
4343
)
4444
(export (;5;) "baz" (type 4))
45-
(@custom "package-docs" "\00{}")
45+
(@custom "package-docs" "\01{}")
4646
(@producers
4747
(processed-by "wit-component" "$CARGO_PKG_VERSION")
4848
)

crates/wit-component/tests/interfaces/variants.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
)
191191
)
192192
(export (;3;) "variants-world" (type 2))
193-
(@custom "package-docs" "\00{}")
193+
(@custom "package-docs" "\01{}")
194194
(@producers
195195
(processed-by "wit-component" "$CARGO_PKG_VERSION")
196196
)

crates/wit-component/tests/interfaces/wasi-http.wat

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

crates/wit-component/tests/interfaces/world-inline-interface.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818
)
1919
(export (;1;) "has-inline" (type 0))
20-
(@custom "package-docs" "\00{}")
20+
(@custom "package-docs" "\01{}")
2121
(@producers
2222
(processed-by "wit-component" "$CARGO_PKG_VERSION")
2323
)

crates/wit-component/tests/interfaces/world-pkg-conflict.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
)
4141
)
4242
(export (;5;) "c" (type 4))
43-
(@custom "package-docs" "\00{}")
43+
(@custom "package-docs" "\01{}")
4444
(@producers
4545
(processed-by "wit-component" "$CARGO_PKG_VERSION")
4646
)

crates/wit-component/tests/interfaces/world-top-level.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
)
4949
)
5050
(export (;5;) "just-export" (type 4))
51-
(@custom "package-docs" "\00{}")
51+
(@custom "package-docs" "\01{}")
5252
(@producers
5353
(processed-by "wit-component" "$CARGO_PKG_VERSION")
5454
)

crates/wit-component/tests/interfaces/worlds-with-types.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
)
5050
)
5151
(export (;5;) "with-imports" (type 4))
52-
(@custom "package-docs" "\00{}")
52+
(@custom "package-docs" "\01{}")
5353
(@producers
5454
(processed-by "wit-component" "$CARGO_PKG_VERSION")
5555
)

crates/wit-parser/src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const PACKAGE_DOCS_SECTION_VERSION: u8 = 1;
4343
/// tools we'll still try to emit the v0 format by default, if the input is
4444
/// compatible. This will be turned off in the future once enough published
4545
/// versions support the v1 format.
46-
const TRY_TO_EMIT_V0_BY_DEFAULT: bool = true;
46+
const TRY_TO_EMIT_V0_BY_DEFAULT: bool = false;
4747

4848
/// Represents serializable doc comments parsed from a WIT package.
4949
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

0 commit comments

Comments
 (0)