ferrovue 0.3.0 → 0.5.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.
Files changed (106) hide show
  1. package/README.md +225 -42
  2. package/dist/attrs.d.ts +3 -53
  3. package/dist/attrs.js +41 -469
  4. package/dist/calls.d.ts +4 -0
  5. package/dist/calls.js +221 -0
  6. package/dist/children.d.ts +16 -0
  7. package/dist/children.js +286 -0
  8. package/dist/classes.d.ts +13 -0
  9. package/dist/classes.js +176 -0
  10. package/dist/cli.js +31 -22
  11. package/dist/client.d.ts +35 -2
  12. package/dist/client.js +77 -14
  13. package/dist/compiler.d.ts +1 -1
  14. package/dist/compiler.js +31 -92
  15. package/dist/component.d.ts +3 -1
  16. package/dist/component.js +123 -104
  17. package/dist/constants.d.ts +42 -0
  18. package/dist/constants.js +292 -0
  19. package/dist/context.d.ts +29 -67
  20. package/dist/context.js +13 -38
  21. package/dist/diagnostics.d.ts +23 -0
  22. package/dist/diagnostics.js +30 -0
  23. package/dist/diff.d.ts +0 -3
  24. package/dist/diff.js +0 -9
  25. package/dist/emitter.d.ts +0 -8
  26. package/dist/emitter.js +0 -12
  27. package/dist/errors.d.ts +867 -0
  28. package/dist/errors.js +330 -0
  29. package/dist/expr.d.ts +1 -70
  30. package/dist/expr.js +142 -934
  31. package/dist/fallthrough.d.ts +9 -0
  32. package/dist/fallthrough.js +78 -0
  33. package/dist/fixture.d.ts +4 -10
  34. package/dist/fixture.js +38 -27
  35. package/dist/hydration.d.ts +15 -0
  36. package/dist/hydration.js +80 -0
  37. package/dist/index.d.ts +3 -0
  38. package/dist/index.js +2 -0
  39. package/dist/islands.d.ts +1 -0
  40. package/dist/islands.js +1 -0
  41. package/dist/link-router.d.ts +24 -0
  42. package/dist/link-router.js +36 -0
  43. package/dist/lists.d.ts +0 -11
  44. package/dist/lists.js +34 -60
  45. package/dist/loops.d.ts +3 -0
  46. package/dist/loops.js +168 -0
  47. package/dist/model.d.ts +46 -144
  48. package/dist/model.js +150 -18
  49. package/dist/narrowing.d.ts +27 -0
  50. package/dist/narrowing.js +157 -0
  51. package/dist/numbers.d.ts +8 -0
  52. package/dist/numbers.js +73 -0
  53. package/dist/parens.d.ts +0 -27
  54. package/dist/parens.js +0 -44
  55. package/dist/plugin.d.ts +84 -0
  56. package/dist/plugin.js +26 -0
  57. package/dist/plugins/client-only.d.ts +8 -0
  58. package/dist/plugins/client-only.js +107 -0
  59. package/dist/plugins/i18n.d.ts +23 -0
  60. package/dist/{i18n.js → plugins/i18n.js} +88 -31
  61. package/dist/plugins/index.d.ts +2 -0
  62. package/dist/plugins/index.js +10 -0
  63. package/dist/plugins/router-link.d.ts +8 -0
  64. package/dist/{router.js → plugins/router-link.js} +52 -91
  65. package/dist/plugins/router.d.ts +42 -0
  66. package/dist/plugins/router.js +256 -0
  67. package/dist/plugins/scoped.d.ts +12 -0
  68. package/dist/plugins/scoped.js +125 -0
  69. package/dist/plugins/shared-types.d.ts +2 -0
  70. package/dist/plugins/shared-types.js +7 -0
  71. package/dist/plugins/stores.d.ts +37 -0
  72. package/dist/plugins/stores.js +379 -0
  73. package/dist/plugins/teleport.d.ts +5 -0
  74. package/dist/plugins/teleport.js +55 -0
  75. package/dist/plugins/twins.d.ts +10 -0
  76. package/dist/plugins/twins.js +164 -0
  77. package/dist/routes.d.ts +10 -0
  78. package/dist/routes.js +6 -0
  79. package/dist/rust.d.ts +1 -7
  80. package/dist/rust.js +56 -174
  81. package/dist/script.d.ts +3 -6
  82. package/dist/script.js +127 -140
  83. package/dist/settle.d.ts +6 -0
  84. package/dist/settle.js +34 -0
  85. package/dist/slots.d.ts +13 -0
  86. package/dist/slots.js +160 -0
  87. package/dist/strings.d.ts +13 -0
  88. package/dist/strings.js +208 -0
  89. package/dist/styles.d.ts +14 -0
  90. package/dist/styles.js +181 -0
  91. package/dist/template.d.ts +1 -42
  92. package/dist/template.js +25 -749
  93. package/dist/testing.d.ts +2 -0
  94. package/dist/testing.js +4 -10
  95. package/dist/types.d.ts +2 -0
  96. package/dist/typescript.d.ts +2 -14
  97. package/dist/typescript.js +53 -59
  98. package/dist/vite.d.ts +2 -1
  99. package/dist/vite.js +11 -32
  100. package/package.json +15 -6
  101. package/dist/i18n.d.ts +0 -27
  102. package/dist/router.d.ts +0 -17
  103. package/dist/scoped.d.ts +0 -24
  104. package/dist/scoped.js +0 -177
  105. package/dist/stores.d.ts +0 -6
  106. package/dist/stores.js +0 -229
package/dist/errors.js ADDED
@@ -0,0 +1,330 @@
1
+ /** The areas codes are grouped in, by their first two digits, with the guide page that explains each. */
2
+ export const AREAS = {
3
+ "00": { name: "Components and parsing" },
4
+ "01": { name: "Script setup" },
5
+ "02": { name: "Constants and enums" },
6
+ "03": { name: "Props and types", guide: "props" },
7
+ "04": { name: "Templates and attributes", guide: "generated_code" },
8
+ "05": { name: "Child components", guide: "generated_code" },
9
+ "06": { name: "Expressions" },
10
+ "07": { name: "Strings and numbers", guide: "strings" },
11
+ "08": { name: "Lists and loops", guide: "props" },
12
+ "09": { name: "Slots", guide: "slots" },
13
+ "10": { name: "Classes, styles and scoped styles", guide: "scoped_styles" },
14
+ "11": { name: "Configuration and helpers", guide: "quick_start" },
15
+ "12": { name: "Router", guide: "routing" },
16
+ "13": { name: "Pinia stores", guide: "pinia" },
17
+ "14": { name: "vue-i18n", guide: "i18n" },
18
+ "15": { name: "Raw HTML, client-only content, teleports and Rust twins", guide: "errors_and_limits" },
19
+ };
20
+ /** Every code the compiler raises. A code is never reused: one the compiler stops raising is marked
21
+ * `retired` and stays listed. `pnpm errors:generate` writes the guide's index from this list. */
22
+ export const ERRORS = {
23
+ FV0001: {
24
+ title: "Source file that does not parse",
25
+ detail: "A `<script setup>` block, or a file it reads, is not valid TypeScript. The message is the parser's own, with the line and column where it stopped.",
26
+ },
27
+ FV0002: { title: "Component file Vue cannot parse" },
28
+ FV0003: { title: "`<script>` without `setup`" },
29
+ FV0004: { title: "Component without a `<template>`" },
30
+ FV0005: { title: "Template Vue cannot compile" },
31
+ FV0006: {
32
+ title: "Unexpected construct in Vue's compiled template",
33
+ detail: "The compiler met output of Vue's server compiler that it has no translation for. Please report it with the component that caused it.",
34
+ },
35
+ FV0101: { title: "`inheritAttrs` that is not `true` or `false`" },
36
+ FV0102: { title: "`watch` with `immediate`" },
37
+ FV0103: { title: "Effect that runs once on the server" },
38
+ FV0104: { title: "`onServerPrefetch`" },
39
+ FV0105: { title: "Statement in setup that could change what renders" },
40
+ FV0106: { title: "`defineAsyncComponent` of anything but a component of this project" },
41
+ FV0107: { title: "Unsupported statement in setup" },
42
+ FV0108: { title: "`...rest` in destructured props" },
43
+ FV0109: { title: "Destructured prop that is not a plain name" },
44
+ FV0201: { title: "Constant that refers to itself" },
45
+ FV0202: { title: "Enum member without a value after a string member" },
46
+ FV0203: { title: "Enum member value that is not a string or number literal" },
47
+ FV0204: { title: "Field a constant object does not have" },
48
+ FV0205: { title: "Spread or hole in a constant list" },
49
+ FV0206: { title: "Computed or spread key in a constant object" },
50
+ FV0207: { title: "Constant that is not a literal" },
51
+ FV0208: { title: "Constant object read whole" },
52
+ FV0209: { title: "`null` in a constant list of plain values" },
53
+ FV0210: { title: "Constant list of plain values of different types" },
54
+ FV0211: { title: "Constant list mixing plain values and objects" },
55
+ FV0212: { title: "Two constant lists with one Rust name" },
56
+ FV0213: { title: "Object in a constant list without a required field" },
57
+ FV0214: { title: "`null` for a field that is not nullable" },
58
+ FV0215: { title: "Field of the wrong type in a constant list's object" },
59
+ FV0216: { title: "Field of an unsupported type in a constant list's objects" },
60
+ FV0217: { title: "Field that is only ever `null`" },
61
+ FV0218: { title: "Field `null` in some objects and absent in others" },
62
+ FV0219: { title: "Field of different types across a constant list's objects" },
63
+ FV0220: { title: "Constant list's object type declared twice" },
64
+ FV0221: { title: "Constant list's object type named as a Rust type" },
65
+ FV0222: { title: "Constant object read by a key chosen at run time" },
66
+ FV0301: { title: "`generic` that is not a list of type parameters" },
67
+ FV0302: {
68
+ title: "Type parameter without a constraint",
69
+ detail: "A generic component renders each type parameter as its constraint, so `generic=\"T\"` alone gives the server no type. Write `generic=\"T extends string\"`.",
70
+ },
71
+ FV0303: { title: "Props declared at run time" },
72
+ FV0304: { title: "Props type not declared in the component" },
73
+ FV0305: { title: "`defineModel` without a type" },
74
+ FV0306: { title: "`defineModel` of a nullable type that is not required" },
75
+ FV0307: { title: "Default for a nullable prop" },
76
+ FV0308: { title: "Unknown type" },
77
+ FV0309: { title: "Type that is only `undefined`" },
78
+ FV0310: { title: "Object type written in place" },
79
+ FV0311: {
80
+ title: "Type that may be both `null` and `undefined`",
81
+ detail: "A Rust `Option` holds one kind of nothing, where JavaScript has two. Declare `T | null` or `x?: T`, never both. See [`props`](crate::guide::props#nullable-props).",
82
+ },
83
+ FV0312: { title: "Union of different types" },
84
+ FV0313: { title: "`Record` not keyed by `string`" },
85
+ FV0314: { title: "Type alias that refers to itself" },
86
+ FV0315: { title: "Unsupported named type" },
87
+ FV0316: { title: "Unsupported type" },
88
+ FV0317: { title: "`Record` of unsupported values" },
89
+ FV0318: { title: "Interface named as a Rust type" },
90
+ FV0319: { title: "Type declared in two files" },
91
+ FV0320: { title: "Interface with members other than plain named fields" },
92
+ FV0321: { title: "Optional field of a nullable type" },
93
+ FV0322: { title: "Prop default that is not a literal" },
94
+ FV0401: { title: "Interpolation of a value that is not a string, a number or a boolean" },
95
+ FV0402: { title: "Attribute value of an unsupported type" },
96
+ FV0403: {
97
+ title: "Attribute bound to a value Vue's server leaves out",
98
+ detail: "Vue's server renderer leaves out an attribute bound to a list, an object or a `route.query` value, and hydration then sets it to the value's `String()` without reporting a mismatch. Join a list (`.join(\",\")`) or narrow a query value to one string.",
99
+ },
100
+ FV0404: { title: "Unsafe attribute name" },
101
+ FV0405: {
102
+ title: "Custom directive not listed in `clientDirectives`",
103
+ detail: "A custom directive's `getSSRProps` may add attributes on the server, which ferrovue does not run. List a directive that adds none in `clientDirectives`.",
104
+ },
105
+ FV0406: { title: "`$attrs` on a root that takes scope ids" },
106
+ FV0407: { title: "Attributes that are not an object literal" },
107
+ FV0408: { title: "Computed or spread key in an attribute object" },
108
+ FV0409: { title: "`className` bound in place of `class`" },
109
+ FV0410: { title: "Merged attributes that are not object literals" },
110
+ FV0411: { title: "Class merged with a string that may repeat the class before it" },
111
+ FV0412: { title: "Fallthrough attribute of an unsupported type" },
112
+ FV0413: { title: "`v-model` comparing values of types it cannot compare" },
113
+ FV0414: { title: "`v-model` over an array" },
114
+ FV0415: { title: "Value read from `$attrs`" },
115
+ FV0416: { title: "Root `<Transition>` or `<KeepAlive>` around `v-if` that is given attributes" },
116
+ FV0417: { title: "Attribute name chosen at run time" },
117
+ FV0418: { title: "`<component :is>`" },
118
+ FV0501: { title: "Child component that is not among the compiled components" },
119
+ FV0502: { title: "Fallthrough attribute that would reach a child's prop" },
120
+ FV0503: { title: "Child props that are not an object literal" },
121
+ FV0504: { title: "Computed or spread key in child props" },
122
+ FV0505: { title: "Attribute named by an integer" },
123
+ FV0506: { title: "Required prop not passed" },
124
+ FV0507: { title: "Required nullable prop not passed" },
125
+ FV0508: { title: "Attributes passed to a child that takes none" },
126
+ FV0509: { title: "String prop given a value that is not a string" },
127
+ FV0510: { title: "One type declared separately by parent and child" },
128
+ FV0511: { title: "Prop given a value of another type" },
129
+ FV0512: { title: "`Props` imported from a component that is not compiled" },
130
+ FV0513: { title: "Component resolved by name that is not imported" },
131
+ FV0601: { title: "Name or function not available on the server" },
132
+ FV0602: { title: "Unsupported method" },
133
+ FV0603: { title: "Unsupported call" },
134
+ FV0604: { title: "Field read on a value that is not an object" },
135
+ FV0605: { title: "Field the type does not have" },
136
+ FV0606: { title: "Value that may be absent where its target cannot take it as it is" },
137
+ FV0607: { title: "Value of an unexpected type" },
138
+ FV0608: { title: "`+` between unsupported types" },
139
+ FV0609: { title: "Comparison between unsupported or absent values" },
140
+ FV0610: { title: "Spread or hole in an array literal" },
141
+ FV0611: { title: "Array literal of different types" },
142
+ FV0612: { title: "Computed member access" },
143
+ FV0613: { title: "Value set up in a way the server cannot evaluate" },
144
+ FV0614: { title: "Logical operator between values that are not booleans" },
145
+ FV0615: { title: "`??` falling back to a computed list" },
146
+ FV0616: { title: "`??` between different types" },
147
+ FV0617: { title: "`||` between unsupported types" },
148
+ FV0618: { title: "Unsupported unary operator" },
149
+ FV0619: { title: "`==` or `!=` with anything but `null` or `undefined`" },
150
+ FV0620: { title: "Loose test against `undefined` of a value of a plugin's type" },
151
+ FV0621: { title: "Comparison of a plugin's value with `null` or `undefined`" },
152
+ FV0622: { title: "`===` between different types" },
153
+ FV0623: { title: "Branches of `?:` of different types" },
154
+ FV0624: { title: "`new` in an expression" },
155
+ FV0625: { title: "Unsupported expression" },
156
+ FV0626: { title: "Strict test of a value that may be `null` or `undefined`" },
157
+ FV0627: { title: "Strict test against the absence a value cannot have" },
158
+ FV0701: { title: "`Number()` of an unsupported value" },
159
+ FV0702: { title: "`parseInt()` or `parseFloat()` of a value that is not a string" },
160
+ FV0703: { title: "`parseInt()` with a radix other than a literal 10 or 16" },
161
+ FV0704: { title: "Unsupported `Math` method" },
162
+ FV0705: { title: "`.toFixed()` without a literal number of digits from 0 to 100" },
163
+ FV0706: {
164
+ title: "String that may hold half of a surrogate pair compared, searched or joined",
165
+ detail: "`slice`, `substring`, `at`, `charAt` and `split(\"\")` can cut a surrogate pair in half. JavaScript keeps the half where ferrovue holds U+FFFD, so two such strings may compare, search or join differently. See [`strings`](crate::guide::strings#halves-of-surrogate-pairs).",
166
+ },
167
+ FV0707: { title: "`JSON.stringify()` of an unsupported value" },
168
+ FV0708: { title: "Template literal of values that are not present strings, numbers or booleans" },
169
+ FV0709: { title: "String method with the wrong number of arguments" },
170
+ FV0710: { title: "Regular expression given to a string method" },
171
+ FV0711: { title: "String method given a value that is not a present string" },
172
+ FV0712: { title: "String method given a value that is not a present number" },
173
+ FV0713: { title: "Function given to a string method" },
174
+ FV0714: { title: "`.repeat()` by a negative or infinite count" },
175
+ FV0715: { title: "Case mapping by the server's locale" },
176
+ FV0801: { title: "`.includes()` of a value of another type than the list's" },
177
+ FV0802: { title: "`.join()` with a separator that is not a string" },
178
+ FV0803: { title: "List method on a value that is not a list" },
179
+ FV0804: { title: "List method over a list of unsupported items" },
180
+ FV0805: { title: "List method given anything but an arrow function" },
181
+ FV0806: { title: "Arrow function with a block body" },
182
+ FV0807: { title: "Arrow function index that is not a plain name" },
183
+ FV0808: { title: "Defaults or nested patterns in an arrow function's item" },
184
+ FV0809: { title: "Arrow function item bound by an unsupported pattern" },
185
+ FV0810: { title: "`.map()` to optional or unsupported values" },
186
+ FV0811: { title: "`.slice()` with more than two arguments" },
187
+ FV0812: { title: "`.slice()` of values that are not numbers" },
188
+ FV0813: { title: "List method given more than one function" },
189
+ FV0814: { title: "`Object` method of a value that is not a `Record`" },
190
+ FV0815: { title: "`Object.values()` of a record of lists" },
191
+ FV0816: { title: "`Object.entries()` outside a `v-for`" },
192
+ FV0817: { title: "Unsupported `Object` method" },
193
+ FV0818: { title: "`v-for` over `Object.entries()` without `[key, value]`" },
194
+ FV0819: { title: "`v-for` over an empty array literal" },
195
+ FV0820: { title: "`v-for` over a value that is not a list or a number" },
196
+ FV0821: { title: "Defaults or nested patterns in a `v-for` item" },
197
+ FV0822: { title: "`v-for` item bound by an unsupported pattern" },
198
+ FV0823: { title: "`v-for` key or index that is not a plain name" },
199
+ FV0901: { title: "Slots that are not an object literal" },
200
+ FV0902: { title: "Computed or spread slot name" },
201
+ FV0903: { title: "Content for a slot the child does not have" },
202
+ FV0904: { title: "Defaults or nested patterns in destructured slot props" },
203
+ FV0905: { title: "Slot props bound by an unsupported pattern" },
204
+ FV0906: { title: "Slot props taken from a slot that passes none" },
205
+ FV0907: { title: "Slot read that the template does not render" },
206
+ FV0908: { title: "Slot prop of a type with no Rust type" },
207
+ FV0909: { title: "Array literal as a slot prop" },
208
+ FV0910: { title: "Computed list as a slot prop" },
209
+ FV0911: { title: "Slot prop of an unsupported type" },
210
+ FV0912: { title: "Slot name that is not literal" },
211
+ FV0913: { title: "Slot props that are not attributes or an object literal" },
212
+ FV0914: { title: "Computed or spread key in slot props" },
213
+ FV0915: { title: "Slot prop name that is not a plain name" },
214
+ FV0916: { title: "Outlets of one slot that pass different props" },
215
+ FV0917: { title: "Interface named as a slot's props type" },
216
+ FV0918: { title: "Slot scope id given to content that takes none" },
217
+ FV1001: { title: "Computed or spread key in a class object" },
218
+ FV1002: { title: "Computed class name that is not a string" },
219
+ FV1003: { title: "Class name with spaces around it" },
220
+ FV1004: { title: "Class binding of an unsupported type" },
221
+ FV1005: { title: "`<style module>`" },
222
+ FV1006: { title: "`v-bind()` in CSS" },
223
+ FV1007: { title: "Style binding of an unsupported type" },
224
+ FV1008: { title: "Computed or spread key in a style object" },
225
+ FV1009: { title: "Style property named by a number or starting with `:`" },
226
+ FV1010: { title: "Style array mixing a string with objects" },
227
+ FV1011: { title: "Style property whose place depends on a condition" },
228
+ FV1012: { title: "Scope ids handed to a component whose render does not take them" },
229
+ FV1101: { title: "Helper called with the wrong number of arguments" },
230
+ FV1102: { title: "Configuration file not found" },
231
+ FV1103: { title: "Configuration file that is not valid JSON" },
232
+ FV1104: { title: "Configuration without `components` or `out`" },
233
+ FV1105: { title: "Unsupported `scopeId`" },
234
+ FV1106: { title: "`builders` that is not `true` or `false`" },
235
+ FV1107: { title: "Unknown helper type" },
236
+ FV1108: { title: "Imported function without a Rust twin" },
237
+ FV1109: { title: "Twin name that is not PascalCase" },
238
+ FV1110: { title: "Twin without `rust`" },
239
+ FV1111: { title: "Twin prop name that is not camelCase" },
240
+ FV1112: { title: "Twin slot name that is not a plain name" },
241
+ FV1201: { title: "Route parameter that is not a present string or number" },
242
+ FV1202: { title: "`to` that is not a string or an object literal" },
243
+ FV1203: { title: "Computed or spread key in a `to` object" },
244
+ FV1204: { title: "Unsupported key in a `to` object" },
245
+ FV1205: { title: "`query` that is not an object literal" },
246
+ FV1206: { title: "Computed or spread key in a query" },
247
+ FV1207: { title: "Query value that may be `null`" },
248
+ FV1208: { title: "`hash` that is not a string" },
249
+ FV1209: { title: "Route name that is not a string literal" },
250
+ FV1210: { title: "Unknown route name" },
251
+ FV1211: { title: "`params` that is not an object literal" },
252
+ FV1212: { title: "Computed or spread key in `params`" },
253
+ FV1213: { title: "Unknown route parameter" },
254
+ FV1214: { title: "Route parameter not given" },
255
+ FV1215: { title: "`to` with both `path` and `params`" },
256
+ FV1216: { title: "`path` that is not a string" },
257
+ FV1217: { title: "`to` without `name` or `path`" },
258
+ FV1218: { title: "`<RouterLink>` attributes that are not literal" },
259
+ FV1219: { title: "Computed or spread key in `<RouterLink>` attributes" },
260
+ FV1220: { title: "`custom` on `<RouterLink>`" },
261
+ FV1221: { title: "`href` or `aria-current` set on `<RouterLink>`" },
262
+ FV1222: { title: "`<RouterLink>` without `to`" },
263
+ FV1223: { title: "Element in a `<RouterLink>` given a slot scope id" },
264
+ FV1224: { title: "`<slot>` in a `<RouterLink>` that takes scope ids" },
265
+ FV1225: { title: "`<RouterLink>` without `routes` configured" },
266
+ FV1226: { title: "`<RouterLink>` attribute that is not a string literal" },
267
+ FV1227: { title: "Fallthrough attribute that would reach a `<RouterLink>` prop" },
268
+ FV1228: { title: "Fallthrough attribute that would replace a `<RouterLink>` attribute" },
269
+ FV1229: { title: "`<RouterLink>` slot other than the default" },
270
+ FV1230: { title: "Route read without `routes` configured" },
271
+ FV1231: { title: "Route field not available on the server" },
272
+ FV1232: { title: "Routes file that is not an array" },
273
+ FV1233: { title: "Route entry of an unsupported shape" },
274
+ FV1234: { title: "`typeof` of anything but a query value" },
275
+ FV1235: { title: "`??` after a query value with a fallback that is not a string" },
276
+ FV1236: { title: "`<RouterView>` in a component with `<style scoped>`" },
277
+ FV1237: { title: "`<RouterView>` in a child component" },
278
+ FV1301: { title: "Type declared by two stores" },
279
+ FV1302: { title: "Store id that is not a string literal" },
280
+ FV1303: { title: "Store of an unsupported shape" },
281
+ FV1304: { title: "Store `state` without a declared return type" },
282
+ FV1305: { title: "Store `getters` that is not an object literal" },
283
+ FV1306: { title: "Getter that is not a function of the state" },
284
+ FV1307: { title: "Setup store without a block body" },
285
+ FV1308: { title: "Unsupported statement in a setup store" },
286
+ FV1309: { title: "Setup store that does not return an object" },
287
+ FV1310: { title: "Setup store returning anything but plain names" },
288
+ FV1311: { title: "Setup store returning a name it does not declare" },
289
+ FV1312: { title: "Interface named as a setup store's state type" },
290
+ FV1313: { title: "`ref<T | null>()` without a value" },
291
+ FV1314: { title: "Setup store `ref` without a type" },
292
+ FV1315: { title: "Getter with a block body" },
293
+ FV1316: { title: "Getter that reads `this`" },
294
+ FV1317: { title: "Getter that returns a function" },
295
+ FV1318: { title: "Getters that read each other" },
296
+ FV1319: { title: "Store imported by anything but its `use…` hook" },
297
+ FV1320: { title: "`storeToRefs` of anything but a store bound in setup" },
298
+ FV1321: { title: "`storeToRefs` not destructured into plain names" },
299
+ FV1322: { title: "Store hook called with arguments" },
300
+ FV1401: { title: "Locale file that is not valid JSON" },
301
+ FV1402: { title: "Locale message that does not parse" },
302
+ FV1403: { title: "Linked message with a key chosen at run time" },
303
+ FV1404: { title: "Linked message with an unknown modifier" },
304
+ FV1405: { title: "Locale message construct ferrovue does not render" },
305
+ FV1406: { title: "`t()` value that is not a present string, number or boolean" },
306
+ FV1407: { title: "`t()` without `i18n` configured" },
307
+ FV1408: { title: "`t()` with unsupported arguments" },
308
+ FV1409: { title: "`t()` key that is not a string" },
309
+ FV1410: { title: "Computed or spread key in `t()`'s named values" },
310
+ FV1411: { title: "Default message given to `t()`" },
311
+ FV1412: { title: "Plural number that is not an integer" },
312
+ FV1413: { title: "`useI18n()` not destructured into plain names" },
313
+ FV1501: { title: "Twin props that are not attributes or an object literal" },
314
+ FV1502: {
315
+ title: "`v-html` of anything but a `TrustedHtml` prop",
316
+ detail: "`v-html` writes raw HTML, which ferrovue allows only from a type you mark as trusted. See [`escaping`](crate::guide::escaping).",
317
+ },
318
+ FV1503: { title: "`TrustedHtml` prop without `trustedHtml` configured" },
319
+ FV1504: { title: "Attributes on `<ClientOnly>`" },
320
+ FV1505: { title: "`<ClientOnly>` slot other than the default and `#fallback`" },
321
+ FV1506: { title: "Slot props taken from `<ClientOnly>`'s `#fallback`" },
322
+ FV1507: { title: "`<Teleport>` in slot content whose emptiness is decided at run time" },
323
+ FV1508: { title: "`<Teleport>` target that is not a string" },
324
+ FV1509: { title: "Twin prop of a type with no Rust type" },
325
+ FV1510: { title: "Twin for a component ferrovue compiles" },
326
+ };
327
+ /** Where a code is documented. */
328
+ export function docsUrl(code) {
329
+ return `https://docs.rs/ferrovue/latest/ferrovue/guide/error_codes/index.html#${code.toLowerCase()}`;
330
+ }
package/dist/expr.d.ts CHANGED
@@ -1,76 +1,7 @@
1
1
  import { type Component, type N, type Scope, type Ty, type Val } from "./model.ts";
2
- /** The refusal for a string that may hold half of a surrogate pair, used where that half matters. */
3
- export declare function lonely(what: string): string;
4
- /** Two strings meeting, where a half of a surrogate pair — which ferrovue holds as U+FFFD — would
5
- * change the result:
6
- * - `equal`: two halves may differ, and a half never equals a literal U+FFFD;
7
- * - `order`: a half orders as a surrogate, below U+E000, where U+FFFD orders above — the same only
8
- * against a literal of characters below U+D800, which both order after;
9
- * - `search`: a half searched for (`b`) matches half of a whole pair in `a`;
10
- * - `join`: two halves side by side join into one character.
11
- * A string holding U+FFFD in the data still equals, or is found in, a half: README, "Strings". */
12
- export declare function meet(comp: Component, a: Val, b: Val, what: string, n: N, how: "equal" | "order" | "search" | "join"): void;
13
- /** Whether a string expression borrows from a temporary it builds — \`&*format!(…)\`, a call that
14
- * returns a \`String\` — rather than from the props or the state. Such a borrow ends with the block
15
- * it is in, so a branch of \`?:\` or \`||\` must hand back the string itself. */
16
- export declare function isTemporary(v: Val): boolean;
17
- /** A string as a \`Cow\`: borrowed when it lives on, owned when it is a temporary. The \`Cow\` is
18
- * itself a temporary of the whole statement, so the \`&str\` taken from it lives to its end. A
19
- * \`String\` built for the purpose is moved into it, and one that is already a \`Cow\` — a branch
20
- * of \`?:\` or \`||\` — is taken as it is. */
21
- export declare function asCow(v: Val): string;
22
- /** Whether built code is a `Cow<str>` already: a runtime routine that borrows when it can
23
- * (`js_slice`, `js_replace`, `js_pad_start`, …), or a fallback taken from one (`.unwrap_or(Cow…)`). */
24
- export declare function yieldsCow(code: string): boolean;
25
- /** Whether a value is a JavaScript number: an integer or a fraction. */
26
- export declare function isNumber(ty: Ty): boolean;
27
- /** A number as an `f64`, as JavaScript holds every number. */
28
- export declare function asF64(v: Val): string;
29
- /** A type as an error names it. */
30
2
  export declare function describeTy(ty: Ty): string;
31
3
  export declare function fieldVal(comp: Component, base: string, ty: Ty, js: string, node: N): Val;
32
- /** A value's truthiness when it is known at generation time: a boolean constant, a string literal,
33
- * a number JavaScript computed. */
34
- export declare function known(v: Val): boolean | undefined;
35
- export declare function truthy(v: Val): string;
36
- /** A value passed where `want` is expected: a present value into an optional slot is wrapped. */
4
+ export declare function holdsNothing(comp: Component, v: Val, want: Ty, node: N, where: string): void;
37
5
  export declare function coerce(comp: Component, v: Val, want: Ty, node: N): string;
38
- /** The JavaScript path an expression names — `$props.user`, `item.author.name` — or `null` when it
39
- * is not a plain chain of names. */
40
- export declare function pathOf(n: N): string | null;
41
- /** A test that an optional value is present, as TypeScript narrows on it: `x`, `x !== undefined`,
42
- * and, `negated`, `!x` and `x === undefined`, after which the value is present in the other branch. */
43
- export interface Presence {
44
- path: string;
45
- /** The value bound where it is present, and its type there. */
46
- pattern: (name: string) => string;
47
- /** The `Option` the pattern matches: the value, or for a truthiness test only its truthy values. */
48
- option: string;
49
- /** The test alone, for a branch that never reads the value. */
50
- present: string;
51
- of: Ty;
52
- negated: boolean;
53
- /** Tested by truthiness, so the test itself is a boolean only when it is negated. */
54
- truthy: boolean;
55
- }
56
- export declare function presence(s: Scope, n: N): Presence | null;
57
- /** The scope with `p`'s value present, bound as `name`. */
58
- export declare function narrowTo(s: Scope, p: Presence, name: string): Scope;
59
- export declare function cond(s: Scope, n: N): string;
60
6
  export declare function childOf(name: string): Component;
61
- /** The reader's route, which the component then takes. */
62
- export declare function theRoute(s: Scope, n: N): Val;
63
- /** A field of the route: what `useRoute()` gives that the server knows as vue-router does. */
64
- export declare function routeField(s: Scope, base: Val, prop: string, n: N): Val;
65
- /** A Pinia getter read from a store's state, `prefs.doubled`: its expression, translated with the
66
- * state it takes bound to that state. `null` when `name` is not a getter of that store. */
67
- export declare function storeGetter(s: Scope, base: Val, name: string, node: N): Val | null;
68
- /** A Rust string literal's text. */
69
- export declare function unquote(literal: string): string;
70
7
  export declare function expr(s: Scope, n: N): Val;
71
- /** A boolean computed at run time, or known now when it folded to a constant. */
72
- export declare function boolOf(code: string): Val;
73
- export declare function call(s: Scope, n: N): Val;
74
- /** Whether `n` is `Object.<method>(…)`. */
75
- export declare function isObjectCall(n: N, method: string): boolean;
76
- export declare function helperCall(s: Scope, name: string, args: N[], n: N): Val;